From ef65ad6cd5d009975b98c1fd0269de3f0f2217ca Mon Sep 17 00:00:00 2001 From: laurent Date: Thu, 22 Dec 2022 11:36:24 +0100 Subject: [PATCH 01/39] fix doc only --- openair1/PHY/TOOLS/cdot_prod.c | 72 +++++++++++++--------------------- 1 file changed, 27 insertions(+), 45 deletions(-) diff --git a/openair1/PHY/TOOLS/cdot_prod.c b/openair1/PHY/TOOLS/cdot_prod.c index 4a94d05dcf..6caf99543f 100644 --- a/openair1/PHY/TOOLS/cdot_prod.c +++ b/openair1/PHY/TOOLS/cdot_prod.c @@ -24,13 +24,7 @@ // returns the complex dot product of x and y -#ifdef MAIN -void print_ints(char *s,__m128i *x); -void print_shorts(char *s,__m128i *x); -void print_bytes(char *s,__m128i *x); -#endif /*! \brief Complex number dot_product - WARNING: the OAI historical name is dot_product but it is not: it is sum(x*y) not, sum(x*conjugate(y)) */ c32_t dot_product(const c16_t *x,//! input vector @@ -75,51 +69,39 @@ c32_t dot_product(const c16_t *x,//! input vector } #ifdef MAIN -void print_bytes(char *s,__m128i *x) -{ - - char *tempb = (char *)x; - - printf("%s : %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s, - tempb[0],tempb[1],tempb[2],tempb[3],tempb[4],tempb[5],tempb[6],tempb[7], - tempb[8],tempb[9],tempb[10],tempb[11],tempb[12],tempb[13],tempb[14],tempb[15] - ); - -} - -void print_shorts(char *s,__m128i *x) -{ - - int16_t *tempb = (int16_t *)x; - - printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s, - tempb[0],tempb[1],tempb[2],tempb[3],tempb[4],tempb[5],tempb[6],tempb[7] - ); - -} - -void print_ints(char *s,__m128i *x) -{ - - int32_t *tempb = (int32_t *)x; - - printf("%s : %d,%d,%d,%d\n",s, - tempb[0],tempb[1],tempb[2],tempb[3] - ); - -} +//gcc -DMAIN openair1/PHY/TOOLS/cdot_prod.c -Iopenair1 -I. -Iopenair2/COMMON -march=native -lm +#include +#include +#include +#include void main(void) { + const int multiply_reduction=15; + const int arraySize=16; + const int signalAmplitude=3000; - int32_t result; - - int16_t x[16*2] __attribute__((aligned(16))) = {1<<0,1<<1,1<<2,1<<3,1<<4,1<<5,1<<6,1<<7,1<<8,1<<9,1<<10,1<<11,1<<12,1<<13,1<<12,1<<13,1<<0,1<<1,1<<2,1<<3,1<<4,1<<5,1<<6,1<<7,1<<8,1<<9,1<<10,1<<11,1<<12,1<<13,1<<12,1<<13}; - int16_t y[16*2] __attribute__((aligned(16))) = {1<<0,1<<1,1<<2,1<<3,1<<4,1<<5,1<<6,1<<7,1<<8,1<<9,1<<10,1<<11,1<<12,1<<13,1<<12,1<<13,1<<0,1<<1,1<<2,1<<3,1<<4,1<<5,1<<6,1<<7,1<<8,1<<9,1<<10,1<<11,1<<12,1<<13,1<<12,1<<13}; - // int16_t y[16*2] __attribute__((aligned(16))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + c32_t result={0}; + cd_t resDouble={0}; + c16_t x[arraySize] __attribute__((aligned(16))); + c16_t y[arraySize] __attribute__((aligned(16))); + int fd=open("/dev/urandom",0); + read(fd,x,sizeof(x)); + read(fd,y,sizeof(y)); + close(fd); + for (int i=0; i Date: Thu, 22 Dec 2022 18:15:48 +0000 Subject: [PATCH 02/39] Prevent Msg3 to be scheduled in downlink slot when nrofUplinkSymbols = 0 and DDDSU --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 35850a1a2d..a44eb36c1f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -894,11 +894,13 @@ void nr_get_Msg3alloc(module_id_t module_id, uint8_t k2 = 0; if (frame_type == TDD) { int msg3_slot = get_first_ul_slot(tdd->nrofDownlinkSlots, tdd->nrofDownlinkSymbols, tdd->nrofUplinkSymbols); - if (tdd->nrofUplinkSymbols < 3) - msg3_slot++; // we can't trasmit msg3 in mixed slot if there are less than 3 symbols - else { - Msg3maxsymb = tdd->nrofUplinkSymbols; - Msg3start = 14 - tdd->nrofUplinkSymbols; + if (tdd->nrofUplinkSymbols != 0) { + if (tdd->nrofUplinkSymbols < 3) + msg3_slot++; // we can't trasmit msg3 in mixed slot if there are less than 3 symbols + else { + Msg3maxsymb = tdd->nrofUplinkSymbols; + Msg3start = 14 - tdd->nrofUplinkSymbols; + } } const int nb_periods_per_frame = get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); const int nb_slots_per_period = ((1< Date: Thu, 15 Dec 2022 18:19:01 +0000 Subject: [PATCH 03/39] Add SRS in nr_ulsim --- openair1/SIMULATION/NR_PHY/ulsim.c | 151 +++++++++++++------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 4 +- 2 files changed, 104 insertions(+), 51 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 071c04d498..9036e505b5 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -278,6 +278,7 @@ int main(int argc, char **argv) double snr_step = .2; uint8_t snr1set = 0; int slot = 8, frame = 1; + int do_SRS = 1; FILE *output_fd = NULL; double **s_re,**s_im,**r_re,**r_im; //uint8_t write_output_file = 0; @@ -803,7 +804,7 @@ int main(int argc, char **argv) maxDoppler, corr_level, 0, - 0, + delay, 0, 0); @@ -868,8 +869,6 @@ int main(int argc, char **argv) memset((void*)Sched_INFO,0,sizeof(*Sched_INFO)); Sched_INFO->UL_tti_req=UL_tti_req; - nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu; - nr_phy_data_tx_t phy_data = {0}; unsigned char *estimated_output_bit; @@ -1090,23 +1089,27 @@ int main(int argc, char **argv) clear_pusch_stats(gNB); for (trial = 0; trial < n_trials; trial++) { + uint8_t round = 0; crc_status = 1; errors_decoding = 0; + while (round < max_rounds && crc_status) { + round_trials[round]++; - UE->ul_harq_processes[harq_pid].round = round; rv_index = nr_rv_round_map[round % 4]; - UE_proc.nr_slot_tx = slot; - UE_proc.frame_tx = frame; - UE_proc.gNB_id = 0; + /// gNB UL PDUs UL_tti_req->SFN = frame; UL_tti_req->Slot = slot; - UL_tti_req->n_pdus = 1; - UL_tti_req->pdus_list[0].pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE; - UL_tti_req->pdus_list[0].pdu_size = sizeof(nfapi_nr_pusch_pdu_t); + UL_tti_req->n_pdus = do_SRS == 1 ? 2 : 1; + + nfapi_nr_ul_tti_request_number_of_pdus_t *pdu_element0 = &UL_tti_req->pdus_list[0]; + pdu_element0->pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE; + pdu_element0->pdu_size = sizeof(nfapi_nr_pusch_pdu_t); + + nfapi_nr_pusch_pdu_t *pusch_pdu = &pdu_element0->pusch_pdu; memset(pusch_pdu, 0, sizeof(nfapi_nr_pusch_pdu_t)); int abwp_size = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth, 275); @@ -1168,6 +1171,42 @@ int main(int argc, char **argv) pusch_pdu->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data; } + if (do_SRS == 1) { + const uint16_t m_SRS[64] = { 4, 8, 12, 16, 16, 20, 24, 24, 28, 32, 36, 40, 48, 48, 52, 56, 60, 64, 72, 72, 76, 80, 88, + 96, 96, 104, 112, 120, 120, 120, 128, 128, 128, 132, 136, 144, 144, 144, 144, 152, 160, + 160, 160, 168, 176, 184, 192, 192, 192, 192, 208, 216, 224, 240, 240, 240, 240, 256, 256, + 256, 264, 272, 272, 272 }; + nfapi_nr_ul_tti_request_number_of_pdus_t *pdu_element1 = &UL_tti_req->pdus_list[1]; + pdu_element1->pdu_type = NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE; + pdu_element1->pdu_size = sizeof(nfapi_nr_srs_pdu_t); + nfapi_nr_srs_pdu_t *srs_pdu = &pdu_element1->srs_pdu; + memset(srs_pdu, 0, sizeof(nfapi_nr_srs_pdu_t)); + srs_pdu->rnti = n_rnti; + srs_pdu->bwp_size = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth, 275); + srs_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp->bwp_Common->genericParameters.locationAndBandwidth, 275); + srs_pdu->subcarrier_spacing = frame_parms->subcarrier_spacing; + srs_pdu->num_ant_ports = n_tx == 4 ? 2 : n_tx == 2 ? 1 : 0; + srs_pdu->sequence_id = 40; + srs_pdu->config_index = rrc_get_max_nr_csrs(srs_pdu->bwp_size, srs_pdu->bandwidth_index); + srs_pdu->resource_type = NR_SRS_Resource__resourceType_PR_periodic; + srs_pdu->t_srs = 1; + srs_pdu->srs_parameters_v4.srs_bandwidth_size = m_SRS[srs_pdu->config_index]; + srs_pdu->srs_parameters_v4.usage = 1 << NR_SRS_ResourceSet__usage_codebook; + srs_pdu->srs_parameters_v4.report_type[0] = 1; + srs_pdu->srs_parameters_v4.iq_representation = 1; + srs_pdu->srs_parameters_v4.prg_size = 1; + srs_pdu->srs_parameters_v4.num_total_ue_antennas = 1 << srs_pdu->num_ant_ports; + srs_pdu->beamforming.num_prgs = m_SRS[srs_pdu->config_index]; + srs_pdu->beamforming.prg_size = 1; + } + + /// UE UL PDUs + + UE->ul_harq_processes[harq_pid].round = round; + UE_proc.nr_slot_tx = slot; + UE_proc.frame_tx = frame; + UE_proc.gNB_id = 0; + // prepare ULSCH/PUSCH reception pushNotifiedFIFO(&gNB->L1_tx_free, msgL1Tx); // to unblock the process in the beginning nr_schedule_response(Sched_INFO); @@ -1186,57 +1225,71 @@ int main(int argc, char **argv) // Config UL TX PDU tx_req.slot = slot; tx_req.sfn = frame; - // tx_req->tx_config // TbD - tx_req.number_of_pdus = 1; + tx_req.number_of_pdus = 1; //do_SRS == 1 ? 2 : 1; + tx_req.tx_request_body[0].pdu_length = TBS / 8; tx_req.tx_request_body[0].pdu_index = 0; tx_req.tx_request_body[0].pdu = &ulsch_input_buffer[0]; ul_config.slot = slot; - ul_config.number_pdus = 1; - ul_config.ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH; - ul_config.ul_config_list[0].pusch_config_pdu.rnti = n_rnti; - ul_config.ul_config_list[0].pusch_config_pdu.pdu_bit_map = pdu_bit_map; - ul_config.ul_config_list[0].pusch_config_pdu.qam_mod_order = mod_order; - ul_config.ul_config_list[0].pusch_config_pdu.rb_size = nb_rb; - ul_config.ul_config_list[0].pusch_config_pdu.rb_start = start_rb; - ul_config.ul_config_list[0].pusch_config_pdu.nr_of_symbols = nb_symb_sch; - ul_config.ul_config_list[0].pusch_config_pdu.start_symbol_index = start_symbol; - ul_config.ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = l_prime_mask; - ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = dmrs_config_type; - ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs; - ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table; - ul_config.ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data; - ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers; - ul_config.ul_config_list[0].pusch_config_pdu.dmrs_ports = ((1 << precod_nbr_layers) - 1); - ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0; - ul_config.ul_config_list[0].pusch_config_pdu.target_code_rate = code_rate; - ul_config.ul_config_list[0].pusch_config_pdu.tbslbrm = tbslbrm; - - ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS / 8; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = trial & 0x1; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = rv_index; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.harq_process_id = harq_pid; - - ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_time_density = ptrs_time_density; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_freq_density = ptrs_freq_density; - ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = (nfapi_nr_ue_ptrs_ports_t *)malloc(2 * sizeof(nfapi_nr_ue_ptrs_ports_t)); - ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0; - - ul_config.ul_config_list[0].pusch_config_pdu.transform_precoding = transform_precoding; + ul_config.number_pdus = do_SRS == 1 ? 2 : 1; + fapi_nr_ul_config_request_pdu_t *ul_config0 = &ul_config.ul_config_list[0]; + ul_config0->pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH; + nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config0->pusch_config_pdu; + pusch_config_pdu->rnti = n_rnti; + pusch_config_pdu->pdu_bit_map = pdu_bit_map; + pusch_config_pdu->qam_mod_order = mod_order; + pusch_config_pdu->rb_size = nb_rb; + pusch_config_pdu->rb_start = start_rb; + pusch_config_pdu->nr_of_symbols = nb_symb_sch; + pusch_config_pdu->start_symbol_index = start_symbol; + pusch_config_pdu->ul_dmrs_symb_pos = l_prime_mask; + pusch_config_pdu->dmrs_config_type = dmrs_config_type; + pusch_config_pdu->mcs_index = Imcs; + pusch_config_pdu->mcs_table = mcs_table; + pusch_config_pdu->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data; + pusch_config_pdu->nrOfLayers = precod_nbr_layers; + pusch_config_pdu->dmrs_ports = ((1 << precod_nbr_layers) - 1); + pusch_config_pdu->absolute_delta_PUSCH = 0; + pusch_config_pdu->target_code_rate = code_rate; + pusch_config_pdu->tbslbrm = tbslbrm; + pusch_config_pdu->pusch_data.tb_size = TBS / 8; + pusch_config_pdu->pusch_data.new_data_indicator = trial & 0x1; + pusch_config_pdu->pusch_data.rv_index = rv_index; + pusch_config_pdu->pusch_data.harq_process_id = harq_pid; + pusch_config_pdu->pusch_ptrs.ptrs_time_density = ptrs_time_density; + pusch_config_pdu->pusch_ptrs.ptrs_freq_density = ptrs_freq_density; + pusch_config_pdu->pusch_ptrs.ptrs_ports_list = (nfapi_nr_ue_ptrs_ports_t *)malloc(2 * sizeof(nfapi_nr_ue_ptrs_ports_t)); + pusch_config_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0; + pusch_config_pdu->transform_precoding = transform_precoding; // if transform precoding is enabled if (transform_precoding == transformPrecoder_enabled) { - ul_config.ul_config_list[0].pusch_config_pdu.dfts_ofdm.low_papr_group_number = *scc->physCellId % 30; // U as defined in 38.211 section 6.4.1.1.1.2 - ul_config.ul_config_list[0].pusch_config_pdu.dfts_ofdm.low_papr_sequence_number = 0; // V as defined in 38.211 section 6.4.1.1.1.2 - // ul_config.ul_config_list[0].pusch_config_pdu.pdu_bit_map |= PUSCH_PDU_BITMAP_DFTS_OFDM; - ul_config.ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data; + pusch_config_pdu->dfts_ofdm.low_papr_group_number = *scc->physCellId % 30; // U as defined in 38.211 section 6.4.1.1.1.2 + pusch_config_pdu->dfts_ofdm.low_papr_sequence_number = 0; // V as defined in 38.211 section 6.4.1.1.1.2 + // pusch_config_pdu->pdu_bit_map |= PUSCH_PDU_BITMAP_DFTS_OFDM; + pusch_config_pdu->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data; } - // nr_fill_ulsch(gNB,frame,slot,pusch_pdu); // Not needed as its its already filled as apart of "nr_schedule_response(Sched_INFO);" + if (do_SRS == 1) { + fapi_nr_ul_config_request_pdu_t *ul_config1 = &ul_config.ul_config_list[1]; + ul_config1->pdu_type = FAPI_NR_UL_CONFIG_TYPE_SRS; + fapi_nr_ul_config_srs_pdu *srs_config_pdu = &ul_config1->srs_config_pdu; + memset(srs_config_pdu, 0, sizeof(fapi_nr_ul_config_srs_pdu)); + srs_config_pdu->rnti = n_rnti; + srs_config_pdu->bwp_size = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth, 275); + srs_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp->bwp_Common->genericParameters.locationAndBandwidth, 275); + srs_config_pdu->subcarrier_spacing = frame_parms->subcarrier_spacing; + srs_config_pdu->num_ant_ports = n_tx == 4 ? 2 : n_tx == 2 ? 1 : 0; + srs_config_pdu->config_index = rrc_get_max_nr_csrs(srs_config_pdu->bwp_size, srs_config_pdu->bandwidth_index); + srs_config_pdu->sequence_id = 40; + srs_config_pdu->resource_type = NR_SRS_Resource__resourceType_PR_periodic; + srs_config_pdu->t_srs = 1; + } for (int i = 0; i < (TBS / 8); i++) UE->ul_harq_processes[harq_pid].a[i] = i & 0xff; + if (input_fd == NULL) { // set FAPI parameters for UE, put them in the scheduled response and call nr_ue_scheduled_response(&scheduled_response); @@ -1280,7 +1333,6 @@ int main(int argc, char **argv) // Justification of division by precod_nbr_layers: // When the channel is the identity matrix, the results in terms of SNR should be almost equal for 2x2 and 4x4. sigma_dB = 10 * log10((double)txlev_sum / precod_nbr_layers * ((double)frame_parms->ofdm_symbol_size / (12 * nb_rb))) - SNR; - ; sigma = pow(10, sigma_dB / 10); if (n_trials == 1) @@ -1310,6 +1362,7 @@ int main(int argc, char **argv) //---------------------------------------------------------- gNB->UL_INFO.rx_ind.number_of_pdus = 0; gNB->UL_INFO.crc_ind.number_crcs = 0; + gNB->UL_INFO.srs_ind.number_of_pdus = 0; for(uint8_t symbol = 0; symbol < (gNB->frame_parms.Ncp == EXTENDED ? 12 : 14); symbol++) { for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 902bb2aec8..077dfc4568 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1014,8 +1014,8 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo srs_config_pdu->rnti = mac->crnti; srs_config_pdu->handle = 0; - srs_config_pdu->bwp_size = NRRIV2BW(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; - srs_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; + srs_config_pdu->bwp_size = NRRIV2BW(ubwp.locationAndBandwidth, MAX_BWP_SIZE); + srs_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth, MAX_BWP_SIZE); srs_config_pdu->subcarrier_spacing = ubwp.subcarrierSpacing; srs_config_pdu->cyclic_prefix = 0; srs_config_pdu->num_ant_ports = srs_resource->nrofSRS_Ports; From 44dabd7377cb59468d056b2eb310a252a83e43f0 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Thu, 15 Dec 2022 19:55:15 +0000 Subject: [PATCH 04/39] Add SRS enable/disable as input command line in nr_ulsim --- openair1/SIMULATION/NR_PHY/ulsim.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 9036e505b5..5f0c6764d9 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -278,7 +278,7 @@ int main(int argc, char **argv) double snr_step = .2; uint8_t snr1set = 0; int slot = 8, frame = 1; - int do_SRS = 1; + int do_SRS = 0; FILE *output_fd = NULL; double **s_re,**s_im,**r_re,**r_im; //uint8_t write_output_file = 0; @@ -355,7 +355,7 @@ int main(int argc, char **argv) /* initialize the sin-cos table */ InitSinLUT(); - while ((c = getopt(argc, argv, "a:b:c:d:ef:g:h:i:kl:m:n:op:q:r:s:t:u:v:w:y:z:C:F:G:H:I:M:N:PR:S:T:U:L:ZW:")) != -1) { + while ((c = getopt(argc, argv, "a:b:c:d:ef:g:h:i:kl:m:n:op:q:r:s:t:u:v:w:y:z:C:F:G:H:I:M:N:PR:S:T:U:L:ZW:E:")) != -1) { printf("handling optarg %c\n",c); switch (c) { @@ -619,6 +619,18 @@ int main(int argc, char **argv) printf("NOTE: TRANSFORM PRECODING (SC-FDMA) is ENABLED in UPLINK (0 - ENABLE, 1 - DISABLE) : %d \n", transform_precoding); break; + case 'E': + do_SRS = atoi(optarg); + if (do_SRS == 0) { + printf("SRS disabled\n"); + } else if (do_SRS == 1) { + printf("SRS enabled\n"); + } else { + printf("Invalid SRS option. SRS disabled.\n"); + do_SRS = 0; + } + break; + default: case 'h': printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -i Intefrence0 -j Interference1 -n n_frames -s snr0 -S snr1 -t Delayspread -x transmission_mode -y TXant -z RXant -A interpolation_file -C(alibration offset dB) -N CellId -Z Enable SC-FDMA in Uplink \n", argv[0]); @@ -660,6 +672,7 @@ int main(int argc, char **argv) printf("-Q If -F used, read parameters from file\n"); printf("-Z If -Z is used, SC-FDMA or transform precoding is enabled in Uplink \n"); printf("-W Num of layer for PUSCH\n"); + printf("-E {SRS: [0] Disabled, [1] Enabled} e.g. -E 1\n"); exit(-1); break; From b95b95e7a7b3cd9f2f7c02db5091e3fa4ea6a6c6 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Fri, 16 Dec 2022 11:25:21 +0000 Subject: [PATCH 05/39] Add SRS time stats in nr_ulsim --- openair1/PHY/defs_gNB.h | 8 ++++++++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 20 +++++++++++++++++++- openair1/SIMULATION/NR_PHY/ulsim.c | 16 ++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 04ece4f0d9..0f2f41c470 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -742,6 +742,14 @@ typedef struct PHY_VARS_gNB_s { time_stats_t ulsch_rbs_extraction_stats; time_stats_t ulsch_mrc_stats; time_stats_t ulsch_llr_stats; + time_stats_t rx_srs_stats; + time_stats_t generate_srs_stats; + time_stats_t get_srs_signal_stats; + time_stats_t srs_channel_estimation_stats; + time_stats_t srs_timing_advance_stats; + time_stats_t srs_report_tlv_stats; + time_stats_t srs_beam_report_stats; + time_stats_t srs_iq_matrix_stats; /* time_stats_t rx_dft_stats; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 7bb81f97ef..a5609f7437 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -867,6 +867,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) { LOG_D(NR_PHY, "(%d.%d) gNB is waiting for SRS, id = %i\n", frame_rx, slot_rx, i); + start_meas(&gNB->rx_srs_stats); + NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; uint8_t N_symb_SRS = 1 << srs_pdu->num_symbols; @@ -877,10 +879,16 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { int8_t snr_per_rb[srs_pdu->bwp_size]; int8_t snr; + start_meas(&gNB->generate_srs_stats); generate_srs_nr(srs_pdu, frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, 0, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx); + stop_meas(&gNB->generate_srs_stats); + + start_meas(&gNB->get_srs_signal_stats); int srs_est = nr_get_srs_signal(gNB, frame_rx, slot_rx, srs_pdu, gNB->nr_srs_info[i], srs_received_signal); + stop_meas(&gNB->get_srs_signal_stats); if (srs_est >= 0) { + start_meas(&gNB->srs_channel_estimation_stats); nr_srs_channel_estimation(gNB, frame_rx, slot_rx, @@ -893,6 +901,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { srs_estimated_channel_time_shifted, snr_per_rb, &snr); + stop_meas(&gNB->srs_channel_estimation_stats); } if ((snr * 10) < gNB->srs_thres) { @@ -922,7 +931,9 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { nfapi_nr_srs_indication_pdu_t *srs_indication = &gNB->srs_pdu_list[gNB->UL_INFO.srs_ind.number_of_pdus]; srs_indication->handle = srs_pdu->handle; srs_indication->rnti = srs_pdu->rnti; + start_meas(&gNB->srs_timing_advance_stats); srs_indication->timing_advance_offset = srs_est >= 0 ? nr_est_timing_advance_srs(frame_parms, srs_estimated_channel_time[0]) : 0xFFFF; + stop_meas(&gNB->srs_timing_advance_stats); srs_indication->timing_advance_offset_nsec = srs_est >= 0 ? (int16_t)((((int32_t)srs_indication->timing_advance_offset - 31) * ((int32_t)TC_NSEC_x32768)) >> 15) : 0xFFFF; switch (srs_pdu->srs_parameters_v4.usage) { case 0: @@ -961,8 +972,10 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { srs_indication->report_tlv->tag = 0; srs_indication->report_tlv->length = 0; + start_meas(&gNB->srs_report_tlv_stats); switch (srs_indication->srs_usage) { case NR_SRS_ResourceSet__usage_beamManagement: { + start_meas(&gNB->srs_beam_report_stats); nfapi_nr_srs_beamforming_report_t nr_srs_beamforming_report; nr_srs_beamforming_report.prg_size = srs_pdu->beamforming.prg_size; nr_srs_beamforming_report.num_symbols = 1 << srs_pdu->num_symbols; @@ -987,10 +1000,12 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { #endif srs_indication->report_tlv->length = pack_nr_srs_beamforming_report(&nr_srs_beamforming_report, srs_indication->report_tlv->value, 16384 * sizeof(uint32_t)); + stop_meas(&gNB->srs_beam_report_stats); break; } case NR_SRS_ResourceSet__usage_codebook: { + start_meas(&gNB->srs_iq_matrix_stats); nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_normalized_channel_iq_matrix; nr_srs_normalized_channel_iq_matrix.normalized_iq_representation = srs_pdu->srs_parameters_v4.iq_representation; nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements = gNB->frame_parms.nb_antennas_rx; @@ -1036,7 +1051,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { srs_indication->report_tlv->length = pack_nr_srs_normalized_channel_iq_matrix(&nr_srs_normalized_channel_iq_matrix, srs_indication->report_tlv->value, 16384 * sizeof(uint32_t)); - + stop_meas(&gNB->srs_iq_matrix_stats); break; } @@ -1048,6 +1063,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { default: AssertFatal(1 == 0, "Invalid SRS usage\n"); } + stop_meas(&gNB->srs_report_tlv_stats); #ifdef SRS_IND_DEBUG LOG_I(NR_PHY, "srs_indication->report_tlv->tag = %i\n", srs_indication->report_tlv->tag); @@ -1060,6 +1076,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->UL_INFO.srs_ind.number_of_pdus += 1; srs->active = 0; + + stop_meas(&gNB->rx_srs_stats); } } } diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 5f0c6764d9..cd776b009d 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -1093,6 +1093,14 @@ int main(int argc, char **argv) reset_meas(&UE->ulsch_rate_matching_stats); reset_meas(&UE->ulsch_interleaving_stats); reset_meas(&UE->ulsch_encoding_stats); + reset_meas(&gNB->rx_srs_stats); + reset_meas(&gNB->generate_srs_stats); + reset_meas(&gNB->get_srs_signal_stats); + reset_meas(&gNB->srs_channel_estimation_stats); + reset_meas(&gNB->srs_timing_advance_stats); + reset_meas(&gNB->srs_report_tlv_stats); + reset_meas(&gNB->srs_beam_report_stats); + reset_meas(&gNB->srs_iq_matrix_stats); uint32_t errors_scrambling[16] = {0}; int n_errors[16] = {0}; @@ -1672,6 +1680,14 @@ int main(int argc, char **argv) //printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving"); //printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx"); //printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding"); + printStatIndent(&gNB->rx_srs_stats,"RX SRS time"); + printStatIndent2(&gNB->generate_srs_stats,"Generate SRS sequence time"); + printStatIndent2(&gNB->get_srs_signal_stats,"Get SRS signal time"); + printStatIndent2(&gNB->srs_channel_estimation_stats,"SRS channel estimation time"); + printStatIndent2(&gNB->srs_timing_advance_stats,"SRS timing advance estimation time"); + printStatIndent2(&gNB->srs_report_tlv_stats,"SRS report TLV build time"); + printStatIndent3(&gNB->srs_beam_report_stats,"SRS beam report build time"); + printStatIndent3(&gNB->srs_iq_matrix_stats,"SRS IQ matrix build time"); printf("\n"); } From 01ddccb10110c3689f316bd0635cd9bb9b09988a Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Fri, 16 Dec 2022 17:48:22 +0000 Subject: [PATCH 06/39] Fix size of IQ channel_matrix of SRS --- nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index d2cd9d7a9f..8b8a1d17ad 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -1691,7 +1691,7 @@ typedef struct { uint16_t num_ue_srs_ports; // Nu: Number of sampled UE SRS ports. Value: 07 uint16_t prg_size; // Size in RBs of a precoding resource block group (PRG) – to which the same digital beamforming gets applied. Value: 1->272 uint16_t num_prgs; // Number of PRGs Np to be reported for this SRS PDU. Value: 0-> 272 - uint8_t channel_matrix[272*512*8*4]; // Array of (numPRGs*Nu*Ng) entries of the type denoted by iqRepresentation H{PRG pI} [ueAntenna uI, gNB antenna gI] = array[uI*Ng*Np + gI*Np + pI]; uI: 0…Nu-1 (UE antenna index); gI: 0…Ng-1 (gNB antenna index); pI: 0…Np-1 (PRG index) + uint8_t channel_matrix[272*2*8*4]; // Array of (numPRGs*Nu*Ng) entries of the type denoted by iqRepresentation H{PRG pI} [ueAntenna uI, gNB antenna gI] = array[uI*Ng*Np + gI*Np + pI]; uI: 0…Nu-1 (UE antenna index); gI: 0…Ng-1 (gNB antenna index); pI: 0…Np-1 (PRG index) } nfapi_nr_srs_normalized_channel_iq_matrix_t; // Beamforming report From 4c6a1c722bfef281f3bdf324a26ea3bd32714895 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Fri, 16 Dec 2022 17:56:55 +0000 Subject: [PATCH 07/39] Change input of rrc_get_max_nr_csrs() from uint8_t to int --- common/utils/nr/nr_common.h | 2 +- openair2/RRC/NR/nr_rrc_config.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 8cd210dec8..858ccd4109 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -82,7 +82,7 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports); uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols); int get_nb_periods_per_frame(uint8_t tdd_period); int get_supported_band_index(int scs, int band, int n_rbs); -long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS); +long rrc_get_max_nr_csrs(const int max_rbs, long b_SRS); void get_samplerate_and_bw(int mu, int n_rb, int8_t threequarter_fs, diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 7476286d5f..e5c1d4bd2b 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -375,7 +375,7 @@ void config_csiim(int do_csirs, int dl_antenna_ports, int curr_bwp, } // TODO: Implement to b_SRS = 1 and b_SRS = 2 -long rrc_get_max_nr_csrs(const uint8_t max_rbs, const long b_SRS) { +long rrc_get_max_nr_csrs(const int max_rbs, const long b_SRS) { if(b_SRS>0) { LOG_E(NR_RRC,"rrc_get_max_nr_csrs(): Not implemented yet for b_SRS>0\n"); From f7a34d4274df9abc108fe2b795102b6b59676b14 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Fri, 16 Dec 2022 18:17:06 +0000 Subject: [PATCH 08/39] Rename some variables --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 84 +++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 74 ++++++++-------- 2 files changed, 79 insertions(+), 79 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index a5609f7437..97643a7963 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -976,79 +976,79 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { switch (srs_indication->srs_usage) { case NR_SRS_ResourceSet__usage_beamManagement: { start_meas(&gNB->srs_beam_report_stats); - nfapi_nr_srs_beamforming_report_t nr_srs_beamforming_report; - nr_srs_beamforming_report.prg_size = srs_pdu->beamforming.prg_size; - nr_srs_beamforming_report.num_symbols = 1 << srs_pdu->num_symbols; - nr_srs_beamforming_report.wide_band_snr = srs_est >= 0 ? (snr + 64) << 1 : 0xFF; // 0xFF will be set if this field is invalid - nr_srs_beamforming_report.num_reported_symbols = 1 << srs_pdu->num_symbols; - nr_srs_beamforming_report.prgs = (nfapi_nr_srs_reported_symbol_t *)calloc(1, nr_srs_beamforming_report.num_reported_symbols * sizeof(nfapi_nr_srs_reported_symbol_t)); - fill_srs_reported_symbol_list(&nr_srs_beamforming_report.prgs[0], srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est); + nfapi_nr_srs_beamforming_report_t nr_srs_bf_report; + nr_srs_bf_report.prg_size = srs_pdu->beamforming.prg_size; + nr_srs_bf_report.num_symbols = 1 << srs_pdu->num_symbols; + nr_srs_bf_report.wide_band_snr = srs_est >= 0 ? (snr + 64) << 1 : 0xFF; // 0xFF will be set if this field is invalid + nr_srs_bf_report.num_reported_symbols = 1 << srs_pdu->num_symbols; + nr_srs_bf_report.prgs = (nfapi_nr_srs_reported_symbol_t *)calloc(1, nr_srs_bf_report.num_reported_symbols * sizeof(nfapi_nr_srs_reported_symbol_t)); + fill_srs_reported_symbol_list(&nr_srs_bf_report.prgs[0], srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est); #ifdef SRS_IND_DEBUG - LOG_I(NR_PHY, "nr_srs_beamforming_report.prg_size = %i\n", nr_srs_beamforming_report.prg_size); - LOG_I(NR_PHY, "nr_srs_beamforming_report.num_symbols = %i\n", nr_srs_beamforming_report.num_symbols); - LOG_I(NR_PHY, "nr_srs_beamforming_report.wide_band_snr = %i (%i dB)\n", nr_srs_beamforming_report.wide_band_snr, (nr_srs_beamforming_report.wide_band_snr >> 1) - 64); - LOG_I(NR_PHY, "nr_srs_beamforming_report.num_reported_symbols = %i\n", nr_srs_beamforming_report.num_reported_symbols); - LOG_I(NR_PHY, "nr_srs_beamforming_report.prgs[0].num_prgs = %i\n", nr_srs_beamforming_report.prgs[0].num_prgs); - for (int prg_idx = 0; prg_idx < nr_srs_beamforming_report.prgs[0].num_prgs; prg_idx++) { + LOG_I(NR_PHY, "nr_srs_bf_report.prg_size = %i\n", nr_srs_bf_report.prg_size); + LOG_I(NR_PHY, "nr_srs_bf_report.num_symbols = %i\n", nr_srs_bf_report.num_symbols); + LOG_I(NR_PHY, "nr_srs_bf_report.wide_band_snr = %i (%i dB)\n", nr_srs_bf_report.wide_band_snr, (nr_srs_bf_report.wide_band_snr >> 1) - 64); + LOG_I(NR_PHY, "nr_srs_bf_report.num_reported_symbols = %i\n", nr_srs_bf_report.num_reported_symbols); + LOG_I(NR_PHY, "nr_srs_bf_report.prgs[0].num_prgs = %i\n", nr_srs_bf_report.prgs[0].num_prgs); + for (int prg_idx = 0; prg_idx < nr_srs_bf_report.prgs[0].num_prgs; prg_idx++) { LOG_I(NR_PHY, "nr_srs_beamforming_report.prgs[0].prg_list[%3i].rb_snr = %i (%i dB)\n", prg_idx, - nr_srs_beamforming_report.prgs[0].prg_list[prg_idx].rb_snr, - (nr_srs_beamforming_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64); + nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr, + (nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64); } #endif - srs_indication->report_tlv->length = pack_nr_srs_beamforming_report(&nr_srs_beamforming_report, srs_indication->report_tlv->value, 16384 * sizeof(uint32_t)); + srs_indication->report_tlv->length = pack_nr_srs_beamforming_report(&nr_srs_bf_report, srs_indication->report_tlv->value, 16384 * sizeof(uint32_t)); stop_meas(&gNB->srs_beam_report_stats); break; } case NR_SRS_ResourceSet__usage_codebook: { start_meas(&gNB->srs_iq_matrix_stats); - nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_normalized_channel_iq_matrix; - nr_srs_normalized_channel_iq_matrix.normalized_iq_representation = srs_pdu->srs_parameters_v4.iq_representation; - nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements = gNB->frame_parms.nb_antennas_rx; - nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports = srs_pdu->srs_parameters_v4.num_total_ue_antennas; - nr_srs_normalized_channel_iq_matrix.prg_size = srs_pdu->srs_parameters_v4.prg_size; - nr_srs_normalized_channel_iq_matrix.num_prgs = srs_pdu->srs_parameters_v4.srs_bandwidth_size / srs_pdu->srs_parameters_v4.prg_size; - fill_srs_channel_matrix(nr_srs_normalized_channel_iq_matrix.channel_matrix, + nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_channel_iq_matrix; + nr_srs_channel_iq_matrix.normalized_iq_representation = srs_pdu->srs_parameters_v4.iq_representation; + nr_srs_channel_iq_matrix.num_gnb_antenna_elements = gNB->frame_parms.nb_antennas_rx; + nr_srs_channel_iq_matrix.num_ue_srs_ports = srs_pdu->srs_parameters_v4.num_total_ue_antennas; + nr_srs_channel_iq_matrix.prg_size = srs_pdu->srs_parameters_v4.prg_size; + nr_srs_channel_iq_matrix.num_prgs = srs_pdu->srs_parameters_v4.srs_bandwidth_size / srs_pdu->srs_parameters_v4.prg_size; + fill_srs_channel_matrix(nr_srs_channel_iq_matrix.channel_matrix, srs_pdu, gNB->nr_srs_info[i], - nr_srs_normalized_channel_iq_matrix.normalized_iq_representation, - nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements, - nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports, - nr_srs_normalized_channel_iq_matrix.prg_size, - nr_srs_normalized_channel_iq_matrix.num_prgs, + nr_srs_channel_iq_matrix.normalized_iq_representation, + nr_srs_channel_iq_matrix.num_gnb_antenna_elements, + nr_srs_channel_iq_matrix.num_ue_srs_ports, + nr_srs_channel_iq_matrix.prg_size, + nr_srs_channel_iq_matrix.num_prgs, &gNB->frame_parms, srs_estimated_channel_freq); #ifdef SRS_IND_DEBUG - LOG_I(NR_PHY, "nr_srs_normalized_channel_iq_matrix.normalized_iq_representation = %i\n", nr_srs_normalized_channel_iq_matrix.normalized_iq_representation); - LOG_I(NR_PHY, "nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements = %i\n", nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements); - LOG_I(NR_PHY, "nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports = %i\n", nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports); - LOG_I(NR_PHY, "nr_srs_normalized_channel_iq_matrix.prg_size = %i\n", nr_srs_normalized_channel_iq_matrix.prg_size); - LOG_I(NR_PHY, "nr_srs_normalized_channel_iq_matrix.num_prgs = %i\n", nr_srs_normalized_channel_iq_matrix.num_prgs); - c16_t *channel_matrix16 = (c16_t *)nr_srs_normalized_channel_iq_matrix.channel_matrix; - c8_t *channel_matrix8 = (c8_t *)nr_srs_normalized_channel_iq_matrix.channel_matrix; - for (int uI = 0; uI < nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports; uI++) { - for (int gI = 0; gI < nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements; gI++) { - for (int pI = 0; pI < nr_srs_normalized_channel_iq_matrix.num_prgs; pI++) { + LOG_I(NR_PHY, "nr_srs_channel_iq_matrix.normalized_iq_representation = %i\n", nr_srs_channel_iq_matrix.normalized_iq_representation); + LOG_I(NR_PHY, "nr_srs_channel_iq_matrix.num_gnb_antenna_elements = %i\n", nr_srs_channel_iq_matrix.num_gnb_antenna_elements); + LOG_I(NR_PHY, "nr_srs_channel_iq_matrix.num_ue_srs_ports = %i\n", nr_srs_channel_iq_matrix.num_ue_srs_ports); + LOG_I(NR_PHY, "nr_srs_channel_iq_matrix.prg_size = %i\n", nr_srs_channel_iq_matrix.prg_size); + LOG_I(NR_PHY, "nr_srs_channel_iq_matrix.num_prgs = %i\n", nr_srs_channel_iq_matrix.num_prgs); + c16_t *channel_matrix16 = (c16_t *)nr_srs_channel_iq_matrix.channel_matrix; + c8_t *channel_matrix8 = (c8_t *)nr_srs_channel_iq_matrix.channel_matrix; + for (int uI = 0; uI < nr_srs_channel_iq_matrix.num_ue_srs_ports; uI++) { + for (int gI = 0; gI < nr_srs_channel_iq_matrix.num_gnb_antenna_elements; gI++) { + for (int pI = 0; pI < nr_srs_channel_iq_matrix.num_prgs; pI++) { uint16_t index = - uI * nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements * nr_srs_normalized_channel_iq_matrix.num_prgs + gI * nr_srs_normalized_channel_iq_matrix.num_prgs + pI; + uI * nr_srs_channel_iq_matrix.num_gnb_antenna_elements * nr_srs_channel_iq_matrix.num_prgs + gI * nr_srs_channel_iq_matrix.num_prgs + pI; LOG_I(NR_PHY, "(uI %i, gI %i, pI %i) channel_matrix --> real %i, imag %i\n", uI, gI, pI, - nr_srs_normalized_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].r : channel_matrix16[index].r, - nr_srs_normalized_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].i : channel_matrix16[index].i); + nr_srs_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].r : channel_matrix16[index].r, + nr_srs_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].i : channel_matrix16[index].i); } } } #endif - srs_indication->report_tlv->length = pack_nr_srs_normalized_channel_iq_matrix(&nr_srs_normalized_channel_iq_matrix, + srs_indication->report_tlv->length = pack_nr_srs_normalized_channel_iq_matrix(&nr_srs_channel_iq_matrix, srs_indication->report_tlv->value, 16384 * sizeof(uint32_t)); stop_meas(&gNB->srs_iq_matrix_stats); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0d25e160fa..b87239b5e1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1181,31 +1181,31 @@ void handle_nr_srs_measurements(const module_id_t module_id, switch (srs_ind->srs_usage) { case NR_SRS_ResourceSet__usage_beamManagement: { - nfapi_nr_srs_beamforming_report_t nr_srs_beamforming_report; + nfapi_nr_srs_beamforming_report_t nr_srs_bf_report; unpack_nr_srs_beamforming_report(srs_ind->report_tlv->value, srs_ind->report_tlv->length, - &nr_srs_beamforming_report, + &nr_srs_bf_report, sizeof(nfapi_nr_srs_beamforming_report_t)); - if (nr_srs_beamforming_report.wide_band_snr == 0xFF) { + if (nr_srs_bf_report.wide_band_snr == 0xFF) { LOG_W(NR_MAC, "Invalid wide_band_snr for RNTI %04x\n", srs_ind->rnti); return; } - int wide_band_snr_dB = (nr_srs_beamforming_report.wide_band_snr >> 1) - 64; + int wide_band_snr_dB = (nr_srs_bf_report.wide_band_snr >> 1) - 64; #ifdef SRS_IND_DEBUG - LOG_I(NR_MAC, "nr_srs_beamforming_report.prg_size = %i\n", nr_srs_beamforming_report.prg_size); - LOG_I(NR_MAC, "nr_srs_beamforming_report.num_symbols = %i\n", nr_srs_beamforming_report.num_symbols); - LOG_I(NR_MAC, "nr_srs_beamforming_report.wide_band_snr = %i (%i dB)\n", nr_srs_beamforming_report.wide_band_snr, wide_band_snr_dB); - LOG_I(NR_MAC, "nr_srs_beamforming_report.num_reported_symbols = %i\n", nr_srs_beamforming_report.num_reported_symbols); - LOG_I(NR_MAC, "nr_srs_beamforming_report.prgs[0].num_prgs = %i\n", nr_srs_beamforming_report.prgs[0].num_prgs); - for (int prg_idx = 0; prg_idx < nr_srs_beamforming_report.prgs[0].num_prgs; prg_idx++) { + LOG_I(NR_MAC, "nr_srs_bf_report.prg_size = %i\n", nr_srs_bf_report.prg_size); + LOG_I(NR_MAC, "nr_srs_bf_report.num_symbols = %i\n", nr_srs_bf_report.num_symbols); + LOG_I(NR_MAC, "nr_srs_bf_report.wide_band_snr = %i (%i dB)\n", nr_srs_bf_report.wide_band_snr, wide_band_snr_dB); + LOG_I(NR_MAC, "nr_srs_bf_report.num_reported_symbols = %i\n", nr_srs_bf_report.num_reported_symbols); + LOG_I(NR_MAC, "nr_srs_bf_report.prgs[0].num_prgs = %i\n", nr_srs_bf_report.prgs[0].num_prgs); + for (int prg_idx = 0; prg_idx < nr_srs_bf_report.prgs[0].num_prgs; prg_idx++) { LOG_I(NR_MAC, - "nr_srs_beamforming_report.prgs[0].prg_list[%3i].rb_snr = %i (%i dB)\n", + "nr_srs_bf_report.prgs[0].prg_list[%3i].rb_snr = %i (%i dB)\n", prg_idx, - nr_srs_beamforming_report.prgs[0].prg_list[prg_idx].rb_snr, - (nr_srs_beamforming_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64); + nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr, + (nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64); } #endif @@ -1214,10 +1214,10 @@ void handle_nr_srs_measurements(const module_id_t module_id, const int ul_prbblack_SNR_threshold = nr_mac->ul_prbblack_SNR_threshold; uint16_t *ulprbbl = nr_mac->ulprbbl; - uint16_t num_rbs = nr_srs_beamforming_report.prg_size * nr_srs_beamforming_report.prgs[0].num_prgs; + uint16_t num_rbs = nr_srs_bf_report.prg_size * nr_srs_bf_report.prgs[0].num_prgs; memset(ulprbbl, 0, num_rbs * sizeof(uint16_t)); for (int rb = 0; rb < num_rbs; rb++) { - int snr = (nr_srs_beamforming_report.prgs[0].prg_list[rb / nr_srs_beamforming_report.prg_size].rb_snr >> 1) - 64; + int snr = (nr_srs_bf_report.prgs[0].prg_list[rb / nr_srs_bf_report.prg_size].rb_snr >> 1) - 64; if (snr < wide_band_snr_dB - ul_prbblack_SNR_threshold) { ulprbbl[rb] = 0x3FFF; // all symbols taken } @@ -1228,31 +1228,31 @@ void handle_nr_srs_measurements(const module_id_t module_id, } case NR_SRS_ResourceSet__usage_codebook: { - nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_normalized_channel_iq_matrix; + nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_channel_iq_matrix; unpack_nr_srs_normalized_channel_iq_matrix(srs_ind->report_tlv->value, srs_ind->report_tlv->length, - &nr_srs_normalized_channel_iq_matrix, + &nr_srs_channel_iq_matrix, sizeof(nfapi_nr_srs_normalized_channel_iq_matrix_t)); #ifdef SRS_IND_DEBUG - LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.normalized_iq_representation = %i\n", nr_srs_normalized_channel_iq_matrix.normalized_iq_representation); - LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements = %i\n", nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements); - LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports = %i\n", nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports); - LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.prg_size = %i\n", nr_srs_normalized_channel_iq_matrix.prg_size); - LOG_I(NR_MAC, "nr_srs_normalized_channel_iq_matrix.num_prgs = %i\n", nr_srs_normalized_channel_iq_matrix.num_prgs); - c16_t *channel_matrix16 = (c16_t *)nr_srs_normalized_channel_iq_matrix.channel_matrix; - c8_t *channel_matrix8 = (c8_t *)nr_srs_normalized_channel_iq_matrix.channel_matrix; - for (int uI = 0; uI < nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports; uI++) { - for (int gI = 0; gI < nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements; gI++) { - for (int pI = 0; pI < nr_srs_normalized_channel_iq_matrix.num_prgs; pI++) { - uint16_t index = uI * nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements * nr_srs_normalized_channel_iq_matrix.num_prgs + gI * nr_srs_normalized_channel_iq_matrix.num_prgs + pI; + LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.normalized_iq_representation = %i\n", nr_srs_channel_iq_matrix.normalized_iq_representation); + LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.num_gnb_antenna_elements = %i\n", nr_srs_channel_iq_matrix.num_gnb_antenna_elements); + LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.num_ue_srs_ports = %i\n", nr_srs_channel_iq_matrix.num_ue_srs_ports); + LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.prg_size = %i\n", nr_srs_channel_iq_matrix.prg_size); + LOG_I(NR_MAC, "nr_srs_channel_iq_matrix.num_prgs = %i\n", nr_srs_channel_iq_matrix.num_prgs); + c16_t *channel_matrix16 = (c16_t *)nr_srs_channel_iq_matrix.channel_matrix; + c8_t *channel_matrix8 = (c8_t *)nr_srs_channel_iq_matrix.channel_matrix; + for (int uI = 0; uI < nr_srs_channel_iq_matrix.num_ue_srs_ports; uI++) { + for (int gI = 0; gI < nr_srs_channel_iq_matrix.num_gnb_antenna_elements; gI++) { + for (int pI = 0; pI < nr_srs_channel_iq_matrix.num_prgs; pI++) { + uint16_t index = uI * nr_srs_channel_iq_matrix.num_gnb_antenna_elements * nr_srs_channel_iq_matrix.num_prgs + gI * nr_srs_channel_iq_matrix.num_prgs + pI; LOG_I(NR_MAC, "(uI %i, gI %i, pI %i) channel_matrix --> real %i, imag %i\n", uI, gI, pI, - nr_srs_normalized_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].r : channel_matrix16[index].r, - nr_srs_normalized_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].i : channel_matrix16[index].i); + nr_srs_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].r : channel_matrix16[index].r, + nr_srs_channel_iq_matrix.normalized_iq_representation == 0 ? channel_matrix8[index].i : channel_matrix16[index].i); } } } @@ -1262,16 +1262,16 @@ void handle_nr_srs_measurements(const module_id_t module_id, NR_UE_UL_BWP_t *current_BWP = &UE->current_UL_BWP; sched_ctrl->srs_feedback.sri = NR_SRS_SRI_0; - nr_srs_ri_computation(&nr_srs_normalized_channel_iq_matrix, current_BWP, &sched_ctrl->srs_feedback.ul_ri); + nr_srs_ri_computation(&nr_srs_channel_iq_matrix, current_BWP, &sched_ctrl->srs_feedback.ul_ri); sched_ctrl->srs_feedback.tpmi = nr_srs_tpmi_estimation(current_BWP->pusch_Config, current_BWP->transform_precoding, - nr_srs_normalized_channel_iq_matrix.channel_matrix, - nr_srs_normalized_channel_iq_matrix.normalized_iq_representation, - nr_srs_normalized_channel_iq_matrix.num_gnb_antenna_elements, - nr_srs_normalized_channel_iq_matrix.num_ue_srs_ports, - nr_srs_normalized_channel_iq_matrix.prg_size, - nr_srs_normalized_channel_iq_matrix.num_prgs, + nr_srs_channel_iq_matrix.channel_matrix, + nr_srs_channel_iq_matrix.normalized_iq_representation, + nr_srs_channel_iq_matrix.num_gnb_antenna_elements, + nr_srs_channel_iq_matrix.num_ue_srs_ports, + nr_srs_channel_iq_matrix.prg_size, + nr_srs_channel_iq_matrix.num_prgs, sched_ctrl->srs_feedback.ul_ri); sprintf(stats->srs_stats, "UL-RI %d, TPMI %d", sched_ctrl->srs_feedback.ul_ri + 1, sched_ctrl->srs_feedback.tpmi); From c6bfb97988c83168cc499e29fa0621c78fb85c9f Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Sun, 18 Dec 2022 03:24:09 +0000 Subject: [PATCH 09/39] Remove calloc of report_tlv, prg_list and prgs --- .../nfapi/public_inc/nfapi_nr_interface_scf.h | 6 ++-- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 16 +++------- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 30 +++++++------------ .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 15 +++++----- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 6 ++-- 6 files changed, 29 insertions(+), 46 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index 8b8a1d17ad..97abfbbe4c 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -1702,7 +1702,7 @@ typedef struct { typedef struct { uint16_t num_prgs; // Number of PRBs to be reported for this SRS PDU. Value: 0 -> 272. - nfapi_nr_srs_reported_symbol_prgs_t *prg_list; + nfapi_nr_srs_reported_symbol_prgs_t prg_list[272]; } nfapi_nr_srs_reported_symbol_t; typedef struct { @@ -1710,7 +1710,7 @@ typedef struct { uint8_t num_symbols; // Number of symbols for SRS. Value: 1 -> 4. If a PHY does not report for individual symbols then this parameter should be set to 1. uint8_t wide_band_snr; // SNR value in dB measured within configured SRS bandwidth on each symbol. Value: 0 -> 255 representing -64 dB to 63 dB with a step size 0.5 dB. 0xff will be set if this field is invalid. uint8_t num_reported_symbols; // Number of symbols reported in this message. This allows PHY to report individual symbols or aggregated symbols where this field will be set to 1. Value: 1 -> 4. - nfapi_nr_srs_reported_symbol_t *prgs; + nfapi_nr_srs_reported_symbol_t prgs; } nfapi_nr_srs_beamforming_report_t; // SRS indication @@ -1728,7 +1728,7 @@ typedef struct { int16_t timing_advance_offset_nsec; // Timing advance measured for the UE between the reference uplink time and the observed arrival time for the UE. Value: -16800 … +16800 nanoseconds. 0xffff should be set if this field is invalid. uint8_t srs_usage; // 0 – beamManagement; 1 – codebook; 2 – nonCodebook; 3 – antennaSwitching; 4 – 255: reserved; Note: This field matches the SRS usage field of the SRS PDU to which this report is linked. uint8_t report_type; // The type of report included in or pointed to by Report TLV depends on the SRS usage: Beam management (1: Beamforming report); Codebook (1: Normalized Channel I/Q Matrix); nonCodebook (1: Normalized Channel I/Q Matrix); antennaSwitch (1: Channel SVD Representation); all (0: null report) - nfapi_srs_report_tlv_t *report_tlv; + nfapi_srs_report_tlv_t report_tlv; } nfapi_nr_srs_indication_pdu_t; typedef struct { diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index e183736578..7cce8fbea4 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -3162,7 +3162,7 @@ int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t return 0; } - if(!pack_nr_srs_reported_symbol(nr_srs_beamforming_report->prgs, &pWritePackedMessage, end)) { + if (!pack_nr_srs_reported_symbol(&nr_srs_beamforming_report->prgs, &pWritePackedMessage, end)) { return 0; } @@ -3199,7 +3199,7 @@ static uint8_t pack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value, return 0; } - if(!pack_nr_srs_report_tlv(value->report_tlv,ppWritePackedMsg, end)) { + if (!pack_nr_srs_report_tlv(&value->report_tlv, ppWritePackedMsg, end)) { return 0; } @@ -5920,10 +5920,6 @@ static uint8_t unpack_nr_srs_reported_symbol(nfapi_nr_srs_reported_symbol_t *prg return 0; } - if(!prgs->prg_list) { - prgs->prg_list = (nfapi_nr_srs_reported_symbol_prgs_t*) calloc(1, prgs->num_prgs*sizeof(nfapi_nr_srs_reported_symbol_prgs_t)); - } - for(int i = 0; i < prgs->num_prgs; i++) { if (!pull8(ppReadPackedMsg, &prgs->prg_list[i].rb_snr, end)) { return 0; @@ -5948,11 +5944,7 @@ int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen, return -1; } - if(!nr_srs_beamforming_report->prgs) { - nr_srs_beamforming_report->prgs = (nfapi_nr_srs_reported_symbol_t*) calloc(1, sizeof(nfapi_nr_srs_reported_symbol_t)); - } - - if(!unpack_nr_srs_reported_symbol(nr_srs_beamforming_report->prgs, &pReadPackedMessage, end)) { + if (!unpack_nr_srs_reported_symbol(&nr_srs_beamforming_report->prgs, &pReadPackedMessage, end)) { return -1; } @@ -5986,7 +5978,7 @@ static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *valu return 0; } - if(!unpack_nr_srs_report_tlv(value->report_tlv, ppReadPackedMsg, end)) { + if (!unpack_nr_srs_report_tlv(&value->report_tlv, ppReadPackedMsg, end)) { return 0; } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 97643a7963..dfeeab7d7a 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -605,11 +605,6 @@ int fill_srs_reported_symbol_list(nfapi_nr_srs_reported_symbol_t *prgs, const int srs_est) { prgs->num_prgs = srs_pdu->beamforming.num_prgs; - - if (!prgs->prg_list) { - prgs->prg_list = (nfapi_nr_srs_reported_symbol_prgs_t*) calloc(1, N_RB_UL*sizeof(nfapi_nr_srs_reported_symbol_prgs_t)); - } - for(int prg_idx = 0; prg_idx < prgs->num_prgs; prg_idx++) { if (srs_est<0) { prgs->prg_list[prg_idx].rb_snr = 0xFF; @@ -966,11 +961,9 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { LOG_I(NR_PHY, "srs_indication->report_type = %i\n", srs_indication->report_type); #endif - if (!srs_indication->report_tlv) { - srs_indication->report_tlv = (nfapi_srs_report_tlv_t *)calloc(1, sizeof(nfapi_srs_report_tlv_t)); - } - srs_indication->report_tlv->tag = 0; - srs_indication->report_tlv->length = 0; + nfapi_srs_report_tlv_t *report_tlv = &srs_indication->report_tlv; + report_tlv->tag = 0; + report_tlv->length = 0; start_meas(&gNB->srs_report_tlv_stats); switch (srs_indication->srs_usage) { @@ -981,8 +974,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { nr_srs_bf_report.num_symbols = 1 << srs_pdu->num_symbols; nr_srs_bf_report.wide_band_snr = srs_est >= 0 ? (snr + 64) << 1 : 0xFF; // 0xFF will be set if this field is invalid nr_srs_bf_report.num_reported_symbols = 1 << srs_pdu->num_symbols; - nr_srs_bf_report.prgs = (nfapi_nr_srs_reported_symbol_t *)calloc(1, nr_srs_bf_report.num_reported_symbols * sizeof(nfapi_nr_srs_reported_symbol_t)); - fill_srs_reported_symbol_list(&nr_srs_bf_report.prgs[0], srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est); + fill_srs_reported_symbol_list(&nr_srs_bf_report.prgs, srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est); #ifdef SRS_IND_DEBUG LOG_I(NR_PHY, "nr_srs_bf_report.prg_size = %i\n", nr_srs_bf_report.prg_size); @@ -999,7 +991,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } #endif - srs_indication->report_tlv->length = pack_nr_srs_beamforming_report(&nr_srs_bf_report, srs_indication->report_tlv->value, 16384 * sizeof(uint32_t)); + report_tlv->length = pack_nr_srs_beamforming_report(&nr_srs_bf_report, report_tlv->value, sizeof(report_tlv->value)); stop_meas(&gNB->srs_beam_report_stats); break; } @@ -1048,9 +1040,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } #endif - srs_indication->report_tlv->length = pack_nr_srs_normalized_channel_iq_matrix(&nr_srs_channel_iq_matrix, - srs_indication->report_tlv->value, - 16384 * sizeof(uint32_t)); + report_tlv->length = pack_nr_srs_normalized_channel_iq_matrix(&nr_srs_channel_iq_matrix, report_tlv->value, sizeof(report_tlv->value)); stop_meas(&gNB->srs_iq_matrix_stats); break; } @@ -1066,10 +1056,10 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { stop_meas(&gNB->srs_report_tlv_stats); #ifdef SRS_IND_DEBUG - LOG_I(NR_PHY, "srs_indication->report_tlv->tag = %i\n", srs_indication->report_tlv->tag); - LOG_I(NR_PHY, "srs_indication->report_tlv->length = %i\n", srs_indication->report_tlv->length); - char *value = (char *)srs_indication->report_tlv->value; - for (int b = 0; b < srs_indication->report_tlv->length; b++) { + LOG_I(NR_PHY, "report_tlv->tag = %i\n", report_tlv->tag); + LOG_I(NR_PHY, "report_tlv->length = %i\n", report_tlv->length); + char *value = (char *)report_tlv->value; + for (int b = 0; b < report_tlv->length; b++) { LOG_I(NR_PHY, "value[%i] = 0x%02x\n", b, value[b] & 0xFF); } #endif diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index b87239b5e1..f497f6ca70 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1151,7 +1151,7 @@ int nr_srs_tpmi_estimation(const NR_PUSCH_Config_t *pusch_Config, void handle_nr_srs_measurements(const module_id_t module_id, const frame_t frame, const sub_frame_t slot, - const nfapi_nr_srs_indication_pdu_t *srs_ind) + nfapi_nr_srs_indication_pdu_t *srs_ind) { LOG_D(NR_MAC, "(%d.%d) Received SRS indication for UE %04x\n", frame, slot, srs_ind->rnti); @@ -1178,12 +1178,13 @@ void handle_nr_srs_measurements(const module_id_t module_id, gNB_MAC_INST *nr_mac = RC.nrmac[module_id]; NR_mac_stats_t *stats = &UE->mac_stats; + nfapi_srs_report_tlv_t *report_tlv = &srs_ind->report_tlv; switch (srs_ind->srs_usage) { case NR_SRS_ResourceSet__usage_beamManagement: { nfapi_nr_srs_beamforming_report_t nr_srs_bf_report; - unpack_nr_srs_beamforming_report(srs_ind->report_tlv->value, - srs_ind->report_tlv->length, + unpack_nr_srs_beamforming_report(report_tlv->value, + report_tlv->length, &nr_srs_bf_report, sizeof(nfapi_nr_srs_beamforming_report_t)); @@ -1214,10 +1215,10 @@ void handle_nr_srs_measurements(const module_id_t module_id, const int ul_prbblack_SNR_threshold = nr_mac->ul_prbblack_SNR_threshold; uint16_t *ulprbbl = nr_mac->ulprbbl; - uint16_t num_rbs = nr_srs_bf_report.prg_size * nr_srs_bf_report.prgs[0].num_prgs; + uint16_t num_rbs = nr_srs_bf_report.prg_size * nr_srs_bf_report.prgs.num_prgs; memset(ulprbbl, 0, num_rbs * sizeof(uint16_t)); for (int rb = 0; rb < num_rbs; rb++) { - int snr = (nr_srs_bf_report.prgs[0].prg_list[rb / nr_srs_bf_report.prg_size].rb_snr >> 1) - 64; + int snr = (nr_srs_bf_report.prgs.prg_list[rb / nr_srs_bf_report.prg_size].rb_snr >> 1) - 64; if (snr < wide_band_snr_dB - ul_prbblack_SNR_threshold) { ulprbbl[rb] = 0x3FFF; // all symbols taken } @@ -1229,8 +1230,8 @@ void handle_nr_srs_measurements(const module_id_t module_id, case NR_SRS_ResourceSet__usage_codebook: { nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_channel_iq_matrix; - unpack_nr_srs_normalized_channel_iq_matrix(srs_ind->report_tlv->value, - srs_ind->report_tlv->length, + unpack_nr_srs_normalized_channel_iq_matrix(report_tlv->value, + report_tlv->length, &nr_srs_channel_iq_matrix, sizeof(nfapi_nr_srs_normalized_channel_iq_matrix_t)); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index fc569c4eee..1384a085fb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -446,7 +446,7 @@ void handle_nr_ul_harq(const int CC_idP, void handle_nr_srs_measurements(const module_id_t module_id, const frame_t frame, const sub_frame_t slot, - const nfapi_nr_srs_indication_pdu_t *srs_ind); + nfapi_nr_srs_indication_pdu_t *srs_ind); int16_t ssb_index_from_prach(module_id_t module_idP, frame_t frameP, diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index a0a7cf5d11..cd30c1bfb7 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -231,15 +231,15 @@ void handle_nr_srs(NR_UL_IND_t *UL_info) { const frame_t frame = UL_info->srs_ind.sfn; const sub_frame_t slot = UL_info->srs_ind.slot; const int num_srs = UL_info->srs_ind.number_of_pdus; - const nfapi_nr_srs_indication_pdu_t *srs_list = UL_info->srs_ind.pdu_list; + nfapi_nr_srs_indication_pdu_t *srs_list = UL_info->srs_ind.pdu_list; for (int i = 0; i < num_srs; i++) { - const nfapi_nr_srs_indication_pdu_t *srs_ind = &srs_list[i]; + nfapi_nr_srs_indication_pdu_t *srs_ind = &srs_list[i]; LOG_D(NR_PHY, "(%d.%d) UL_info->srs_ind.pdu_list[%d].rnti: 0x%04x\n", frame, slot, i, srs_ind->rnti); handle_nr_srs_measurements(module_id, frame, slot, - &srs_list[i]); + srs_ind); } UL_info->srs_ind.number_of_pdus = 0; From a7db9280b8186ea4b1b8f31e79fb29a38f97e46e Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Mon, 19 Dec 2022 01:56:08 +0000 Subject: [PATCH 10/39] Generate SRS sequence only when needed --- openair1/PHY/defs_nr_common.h | 1 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index fe0397970b..6529037a33 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -206,6 +206,7 @@ typedef struct { uint8_t k_0_p[MAX_NUM_NR_SRS_AP][MAX_NUM_NR_SRS_SYMBOLS]; uint8_t srs_generated_signal_bits; int32_t **srs_generated_signal; + nfapi_nr_srs_pdu_t srs_pdu; } nr_srs_info_t; typedef struct { diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index dfeeab7d7a..38e1cfd3b4 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -670,6 +670,20 @@ int fill_srs_channel_matrix(uint8_t *channel_matrix, return 0; } +int check_srs_pdu(const nfapi_nr_srs_pdu_t *srs_pdu, nfapi_nr_srs_pdu_t *saved_srs_pdu) +{ + if (saved_srs_pdu->bwp_start == srs_pdu->bwp_start && + saved_srs_pdu->bwp_size == srs_pdu->bwp_size && + saved_srs_pdu->num_ant_ports == srs_pdu->num_ant_ports && + saved_srs_pdu->time_start_position == srs_pdu->time_start_position && + saved_srs_pdu->num_symbols == srs_pdu->num_symbols && + saved_srs_pdu->config_index == srs_pdu->config_index) { + return 1; + } + *saved_srs_pdu = *srs_pdu; + return 0; +} + int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { /* those variables to log T_GNB_PHY_PUCCH_PUSCH_IQ only when we try to decode */ int pucch_decode_done = 0; @@ -875,7 +889,9 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { int8_t snr; start_meas(&gNB->generate_srs_stats); - generate_srs_nr(srs_pdu, frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, 0, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx); + if (check_srs_pdu(srs_pdu, &gNB->nr_srs_info[i]->srs_pdu) == 0) { + generate_srs_nr(srs_pdu, frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, 0, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx); + } stop_meas(&gNB->generate_srs_stats); start_meas(&gNB->get_srs_signal_stats); From 00c36d7b402ffcaf74a64bf5efd7afb734b81391 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 6 Apr 2022 12:39:26 +0200 Subject: [PATCH 11/39] fixing "making SFN dependent on GPS time" in fact it syncs the USRP time to GPS time when available and then derives the SFN from the USRP time. --- executables/nr-ru.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 58a5e46e09..4844bb0948 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -622,6 +622,7 @@ void *emulatedRF_thread(void *param) { void rx_rf(RU_t *ru,int *frame,int *slot) { RU_proc_t *proc = &ru->proc; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; + openair0_config_t *cfg = &ru->openair0_cfg; void *rxp[ru->nb_rx]; unsigned int rxs; int i; @@ -659,8 +660,8 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { if (rxs != samples_per_slot) LOG_E(PHY, "rx_rf: Asked for %d samples, got %d from USRP\n",samples_per_slot,rxs); if (proc->first_rx == 1) { - ru->ts_offset = proc->timestamp_rx; - proc->timestamp_rx = 0; + //ru->ts_offset = proc->timestamp_rx; + //proc->timestamp_rx = 0; } else { samples_per_slot_prev = fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp); @@ -671,13 +672,22 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { } } + //compute system frame number (SFN) according to O-RAN-WG4-CUS.0-v02.00 (using alpha=beta=0) + // this assumes that the USRP has been synchronized to the GPS time + // OAI uses timestamps in sample time stored in int64_t, but it will fit in double precision for many years to come. + double gps_sec = ((double) ts)/cfg->sample_rate; + //proc->frame_rx = ((int64_t) (gps_sec/0.01)) & 1023; + + // in fact the following line is the same as long as the timestamp_rx is synchronized to GPS. proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023; proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx,fp); // synchronize first reception to frame 0 subframe 0 - LOG_D(PHY,"RU %d/%d TS %llu , frame %d, slot %d.%d / %d\n", + LOG_D(PHY,"RU %d/%d TS %ld, GPS %f, SR %f, frame %d, slot %d.%d / %d\n", ru->idx, 0, - (unsigned long long int)(proc->timestamp_rx+ru->ts_offset), + ts, //(unsigned long long int)(proc->timestamp_rx+ru->ts_offset), + gps_sec, + cfg->sample_rate, proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame); // dump VCD output for first RU in list From ad6c25059542fa54cbcbf087c4dd0f697604b55e Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 20 Dec 2022 15:23:48 +0000 Subject: [PATCH 12/39] adressing reviewer comment --- executables/nr-ru.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 4844bb0948..96ec7e2759 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -659,10 +659,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { //"rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_subframe,rxs); if (rxs != samples_per_slot) LOG_E(PHY, "rx_rf: Asked for %d samples, got %d from USRP\n",samples_per_slot,rxs); - if (proc->first_rx == 1) { - //ru->ts_offset = proc->timestamp_rx; - //proc->timestamp_rx = 0; - } else { + if (proc->first_rx != 1) { samples_per_slot_prev = fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp); if (proc->timestamp_rx - old_ts != samples_per_slot_prev) { From 675ebb1f229707886814b6ce45d23f5fd11d222f Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 27 Dec 2022 16:01:44 +0100 Subject: [PATCH 13/39] attempt to fix issues when starting with SFN > 0 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 3 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 5da2baa613..008e0c02fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -69,7 +69,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc = gNB->common_channels->ServingCellConfigCommon; const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - UL_tti_req_ahead_initialization(gNB, scc, num_slots, CC_idP); + UL_tti_req_ahead_initialization(gNB, scc, num_slots, CC_idP, frameP); nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0]; nfapi_nr_dl_tti_pdcch_pdu_rel15_t **pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t **)gNB->pdcch_pdu_idx[CC_idP]; @@ -178,7 +178,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, } } - if ((slot == 0) && (frame & 127) == 0) { char stats_output[16000] = {0}; dump_mac_stats(RC.nrmac[module_idP], stats_output, sizeof(stats_output), true); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 403ae15df7..00a635fbd4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -3087,7 +3087,7 @@ void schedule_nr_bwp_switch(module_id_t module_id, } } -void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid) { +void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid, frame_t frameP) { if(gNB->UL_tti_req_ahead[CCid]) return; @@ -3099,7 +3099,7 @@ void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCom * already "in the past" and thus we put frame 1 instead of 0! */ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &gNB->UL_tti_req_ahead[CCid][i]; - req->SFN = i < (gNB->if_inst->sl_ahead-1); + req->SFN = frameP + (i < (gNB->if_inst->sl_ahead-1)); req->Slot = i; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index fc569c4eee..2fa395b7a7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -504,7 +504,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options, int max_mcs, frame_t frame); -void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid); +void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid, frame_t frameP); void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP); From 1e6db77be7c8d88281eeb68a34cb8fc7541961e9 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 22 Dec 2022 12:34:31 +0100 Subject: [PATCH 14/39] first commit --- .../nr_dl_channel_estimation.c | 3 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 388 ++++++++---------- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 26 +- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 2 - openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 8 +- .../NR_MAC_UE/nr_ue_dci_configuration.c | 38 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 145 ++----- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 85 ++-- 9 files changed, 285 insertions(+), 414 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 0a0d92743d..2b858e9a91 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -1017,7 +1017,7 @@ void nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, if(nb_rb_coreset==0) return; #ifdef DEBUG_PDCCH - printf(PHY, "pdcch_channel_estimation: first_carrier_offset %d, BWPStart %d, coreset_start_rb %d, coreset_nb_rb %d\n", + printf("pdcch_channel_estimation: first_carrier_offset %d, BWPStart %d, coreset_start_rb %d, coreset_nb_rb %d\n", first_carrier_offset, BWPStart, coreset_start_rb, nb_rb_coreset); #endif @@ -1044,7 +1044,6 @@ void nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, int dmrs_ref = 0; if (coreset->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG) dmrs_ref = BWPStart; - // generate pilot int pilot[(nb_rb_coreset + dmrs_ref) * 3] __attribute__((aligned(16))); nr_pdcch_dmrs_rx(ue,Ns,ue->nr_gold_pdcch[gNB_id][Ns][symbol], &pilot[0],2000,(nb_rb_coreset+dmrs_ref)); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 5d624bfd63..01e4cbefd9 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -911,8 +911,8 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const double N_TA_max = Ta_max * bw_scaling * tc_factor; NR_UE_MAC_INST_t *mac = get_mac_inst(0); - NR_BWP_Id_t dl_bwp = mac->DL_BWP_Id; - NR_BWP_Id_t ul_bwp = mac->UL_BWP_Id; + NR_BWP_Id_t dl_bwp = mac->current_DL_BWP.bwp_id; + NR_BWP_Id_t ul_bwp = mac->current_UL_BWP.bwp_id; NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL; if(ul_bwp){ diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index a9160e84ba..d465cbf2e7 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -427,53 +427,6 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, } -/** \brief This function performs some configuration routines according to clause 12 "Bandwidth part operation" 3GPP TS 38.213 version 16.3.0 Release 16 - @param NR_UE_MAC_INST_t mac: pointer to local MAC instance - @returns void - */ - -void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint32_t *bwp_ind, uint8_t *dci_format) -{ - - NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated; - - int n_ubwp = 0; - if (scd && scd->uplinkConfig && - scd->uplinkConfig->uplinkBWP_ToAddModList) - n_ubwp = scd->uplinkConfig->uplinkBWP_ToAddModList->list.count; - - if (bwp_ind && dci_format){ - switch(*dci_format){ - case NR_UL_DCI_FORMAT_0_1: - mac->UL_BWP_Id = n_ubwp < 4 ? *bwp_ind : *bwp_ind + 1; - break; - case NR_DL_DCI_FORMAT_1_1: - mac->DL_BWP_Id = n_ubwp < 4 ? *bwp_ind : *bwp_ind + 1; - break; - default: - LOG_E(MAC, "In %s: failed to configure BWP Id from DCI with format %d \n", __FUNCTION__, *dci_format); - } - // configure ss coreset after switching BWP - configure_ss_coreset(mac, scd, mac->DL_BWP_Id); - } else { - - if (scd->firstActiveDownlinkBWP_Id) - mac->DL_BWP_Id = *scd->firstActiveDownlinkBWP_Id; - else if (scd->defaultDownlinkBWP_Id) - mac->DL_BWP_Id = *scd->defaultDownlinkBWP_Id; - else - mac->DL_BWP_Id = 0; - - if (scd->uplinkConfig && scd->uplinkConfig->firstActiveUplinkBWP_Id) - mac->UL_BWP_Id = *scd->uplinkConfig->firstActiveUplinkBWP_Id; - else - mac->UL_BWP_Id = 0; - - } - - LOG_D(MAC, "In %s setting DL_BWP_Id %ld UL_BWP_Id %ld \n", __FUNCTION__, mac->DL_BWP_Id, mac->UL_BWP_Id); -} - /** \brief This function is relavant for the UE procedures for control. It loads the search spaces, the BWPs and the CORESETs into the MAC instance and \brief performs assert checks on the relevant RRC configuration. @param NR_UE_MAC_INST_t mac: pointer to local MAC instance @@ -483,8 +436,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){ int bwp_id; NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated; - config_bwp_ue(mac, NULL, NULL); - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + NR_BWP_Id_t dl_bwp_id = mac->current_DL_BWP.bwp_id; // configure DLbwp if (scd->downlinkBWP_ToAddModList) { @@ -586,184 +538,188 @@ int nr_rrc_mac_config_req_ue_logicalChannelBearer( return 0; } -int nr_rrc_mac_config_req_ue( - module_id_t module_id, - int cc_idP, - uint8_t gNB_index, - NR_MIB_t *mibP, - NR_ServingCellConfigCommonSIB_t *sccP, - // NR_MAC_CellGroupConfig_t *mac_cell_group_configP, - // NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, - NR_CellGroupConfig_t *cell_group_config, - NR_CellGroupConfig_t *scell_group_config){ - NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); - RA_config_t *ra = &mac->ra; - fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; +void configure_current_BWP(NR_UE_MAC_INST_t *mac, + NR_ServingCellConfigCommonSIB_t *scc, + NR_CellGroupConfig_t *cell_group_config) +{ + NR_DL_BWP_t *DL_BWP = &mac->current_DL_BWP; + NR_UL_BWP_t *UL_BWP = &mac->current_UL_BWP; - // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. + if(scc) { + DL_BWP->bwp_id = 0; + UL_BWP->bwp_id = 0; + DL_BWP->genericParameters = scc->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + if(scc->uplinkConfigCommon) + UL_BWP->genericParameters = scc->uplinkConfigCommon->initialUplinkBWP.genericParameters; + else + UL_BWP->genericParameters = scc->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + } + if(cell_group_config) { + if (cell_group_config->spCellConfig && + cell_group_config->spCellConfig->spCellConfigDedicated) { + struct NR_ServingCellConfig *spCellConfigDedicated = cell_group_config->spCellConfig->spCellConfigDedicated; + if (spCellConfigDedicated->firstActiveDownlinkBWP_Id) + DL_BWP->bwp_id = *spCellConfigDedicated->firstActiveDownlinkBWP_Id; + if (spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id) + UL_BWP->bwp_id = *spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id; - if(mibP != NULL){ - mac->mib = mibP; // update by every reception - mac->phy_config.Mod_id = module_id; - mac->phy_config.CC_id = cc_idP; - } - AssertFatal(scell_group_config == NULL || cell_group_config == NULL, - "both scell_group_config and cell_group_config cannot be non-NULL\n"); - - if (sccP != NULL) { - - mac->scc_SIB=sccP; - LOG_D(NR_MAC, "In %s: Keeping ServingCellConfigCommonSIB\n", __FUNCTION__); - config_common_ue_sa(mac,module_id,cc_idP); - - int num_slots_ul = nr_slots_per_frame[mac->mib->subCarrierSpacingCommon]; - if(cfg->cell_config.frame_duplex_type == TDD){ - num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { - num_slots_ul++; + NR_BWP_Downlink_t *bwp_downlink = NULL; + const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = spCellConfigDedicated->downlinkBWP_ToAddModList; + if (bwpList && DL_BWP->bwp_id > 0) { + for (int i = 0; i < bwpList->list.count; i++) { + bwp_downlink = bwpList->list.array[i]; + if(bwp_downlink->bwp_Id == DL_BWP->bwp_id) + break; + } + AssertFatal(bwp_downlink != NULL,"Couldn't find DLBWP corresponding to BWP ID %ld\n", DL_BWP->bwp_id); + DL_BWP->genericParameters = bwp_downlink->bwp_Common->genericParameters; + } + else { + if(mac->scc) { + DL_BWP->genericParameters = mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + } + if(mac->scc_SIB) { + DL_BWP->genericParameters = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; } } - LOG_I(NR_MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); - mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t)); - for (int i=0; iul_config_request[i].mutex_ul_config), NULL); - // Setup the SSB to Rach Occasions mapping according to the config - build_ssb_to_ro_map(mac);//->scc, mac->phy_config.config_req.cell_config.frame_duplex_type); - if (!get_softmodem_params()->emulate_l1) - mac->if_module->phy_config_request(&mac->phy_config); - } - if(scell_group_config != NULL ){ - mac->cg = scell_group_config; - mac->servCellIndex = *scell_group_config->spCellConfig->servCellIndex; - mac->DL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id : 0; - mac->UL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id : 0; - - config_control_ue(mac); - if (scell_group_config->spCellConfig->reconfigurationWithSync) { - if (scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) { - ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; + NR_BWP_Uplink_t *bwp_uplink = NULL; + const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList; + if (ubwpList && UL_BWP->bwp_id > 0) { + for (int i = 0; i < ubwpList->list.count; i++) { + bwp_uplink = ubwpList->list.array[i]; + if(bwp_uplink->bwp_Id == UL_BWP->bwp_id) + break; } - mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; - mac->physCellId = *mac->scc->physCellId; + AssertFatal(bwp_uplink != NULL,"Couldn't find ULBWP corresponding to BWP ID %ld\n",UL_BWP->bwp_id); + UL_BWP->genericParameters = bwp_uplink->bwp_Common->genericParameters; + } + else { + if(mac->scc) { + UL_BWP->genericParameters = mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } + if(mac->scc_SIB) { + UL_BWP->genericParameters = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + } + } + else + AssertFatal(1==0,"We shouldn't end here in configuring BWP\n"); + } + + DL_BWP->scs = DL_BWP->genericParameters.subcarrierSpacing; + DL_BWP->cyclicprefix = DL_BWP->genericParameters.cyclicPrefix; + DL_BWP->BWPSize = NRRIV2BW(DL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->BWPStart = NRRIV2PRBOFFSET(DL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->scs = UL_BWP->genericParameters.subcarrierSpacing; + UL_BWP->cyclicprefix = UL_BWP->genericParameters.cyclicPrefix; + UL_BWP->BWPSize = NRRIV2BW(UL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->BWPStart = NRRIV2PRBOFFSET(UL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); +} + + +int nr_rrc_mac_config_req_ue(module_id_t module_id, + int cc_idP, + uint8_t gNB_index, + NR_MIB_t *mibP, + NR_ServingCellConfigCommonSIB_t *sccP, + NR_CellGroupConfig_t *cell_group_config, + NR_CellGroupConfig_t *scell_group_config) +{ + + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); + RA_config_t *ra = &mac->ra; + fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; + + // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. + + if(mibP != NULL){ + mac->mib = mibP; // update by every reception + mac->phy_config.Mod_id = module_id; + mac->phy_config.CC_id = cc_idP; + } + AssertFatal(scell_group_config == NULL || cell_group_config == NULL, + "both scell_group_config and cell_group_config cannot be non-NULL\n"); + + if (sccP != NULL) { + + mac->scc_SIB = sccP; + LOG_D(NR_MAC, "In %s: Keeping ServingCellConfigCommonSIB\n", __FUNCTION__); + config_common_ue_sa(mac, module_id, cc_idP); + configure_current_BWP(mac, sccP, NULL); + + int num_slots_ul = nr_slots_per_frame[mac->mib->subCarrierSpacingCommon]; + if(cfg->cell_config.frame_duplex_type == TDD){ + num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; + if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { + num_slots_ul++; + } + } + LOG_I(NR_MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); + mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t)); + for (int i=0; iul_config_request[i].mutex_ul_config), NULL); + // Setup the SSB to Rach Occasionsif (cell_group_config->spCellConfig) { mapping according to the config + build_ssb_to_ro_map(mac);//->scc, mac->phy_config.config_req.cell_config.frame_duplex_type); + if (!get_softmodem_params()->emulate_l1) + mac->if_module->phy_config_request(&mac->phy_config); + } + if(scell_group_config != NULL ){ + mac->cg = scell_group_config; + mac->servCellIndex = *scell_group_config->spCellConfig->servCellIndex; + if (scell_group_config->spCellConfig->reconfigurationWithSync) { + if (scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) { + ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; + } + mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; + mac->physCellId = *mac->scc->physCellId; + config_common_ue(mac,module_id,cc_idP); + mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; + LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti); + } + configure_current_BWP(mac, NULL, scell_group_config); + config_control_ue(mac); + // Setup the SSB to Rach Occasions mapping according to the config + build_ssb_to_ro_map(mac); + } + else if (cell_group_config != NULL ){ + LOG_I(MAC,"Applying CellGroupConfig from gNodeB\n"); + mac->cg = cell_group_config; + if (cell_group_config->spCellConfig) + mac->servCellIndex = cell_group_config->spCellConfig->servCellIndex ? *cell_group_config->spCellConfig->servCellIndex : 0; + else + mac->servCellIndex = 0; + + mac->scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; + mac->scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; + mac->BSR_reporting_active = NR_BSR_TRIGGER_NONE; + LOG_D(MAC, "[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n", + module_id, + mac->scheduling_info.periodicBSR_SF, + mac->scheduling_info.retxBSR_SF); + + configure_current_BWP(mac, NULL, cell_group_config); + config_control_ue(mac); + + if (get_softmodem_params()->nsa) { + if (cell_group_config->spCellConfig && cell_group_config->spCellConfig->reconfigurationWithSync) { + if (cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) { + ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; + } + mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; + int num_slots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; + if (mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { + num_slots++; + } + mac->ul_config_request = calloc(num_slots, sizeof(*mac->ul_config_request)); config_common_ue(mac,module_id,cc_idP); - mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; + mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti); } // Setup the SSB to Rach Occasions mapping according to the config build_ssb_to_ro_map(mac); } - else if (cell_group_config != NULL ){ - LOG_I(MAC,"Applying CellGroupConfig from gNodeB\n"); - mac->cg = cell_group_config; - if (cell_group_config->spCellConfig) { - mac->servCellIndex = cell_group_config->spCellConfig->servCellIndex ? *cell_group_config->spCellConfig->servCellIndex : 0; - mac->DL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id : 0; - mac->UL_BWP_Id=mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id : 0; - } - else { - mac->servCellIndex = 0; - mac->DL_BWP_Id = 0; - mac->UL_BWP_Id = 0; - } - - mac->scheduling_info.periodicBSR_SF = - MAC_UE_BSR_TIMER_NOT_RUNNING; - mac->scheduling_info.retxBSR_SF = - MAC_UE_BSR_TIMER_NOT_RUNNING; - mac->BSR_reporting_active = NR_BSR_TRIGGER_NONE; - LOG_D(MAC, "[UE %d]: periodic BSR %d (SF), retx BSR %d (SF)\n", - module_id, - mac->scheduling_info.periodicBSR_SF, - mac->scheduling_info.retxBSR_SF); - - config_control_ue(mac); - if (get_softmodem_params()->nsa) { - if (cell_group_config->spCellConfig && cell_group_config->spCellConfig->reconfigurationWithSync) { - if (cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) { - ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; - } - mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; - int num_slots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { - num_slots++; - } - mac->ul_config_request = calloc(num_slots, sizeof(*mac->ul_config_request)); - config_common_ue(mac,module_id,cc_idP); - mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; - LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti); - } - - // Setup the SSB to Rach Occasions mapping according to the config - build_ssb_to_ro_map(mac); - } - - /* - if(mac_cell_group_configP != NULL){ - if(mac_cell_group_configP->drx_Config != NULL ){ - switch(mac_cell_group_configP->drx_Config->present){ - case NR_SetupRelease_DRX_Config_PR_NOTHING: - break; - case NR_SetupRelease_DRX_Config_PR_release: - mac->drx_Config = NULL; - break; - case NR_SetupRelease_DRX_Config_PR_setup: - mac->drx_Config = mac_cell_group_configP->drx_Config->choice.setup; - break; - default: - break; - } - } - - if(mac_cell_group_configP->schedulingRequestConfig != NULL ){ - mac->schedulingRequestConfig = mac_cell_group_configP->schedulingRequestConfig; - } - - if(mac_cell_group_configP->bsr_Config != NULL ){ - mac->bsr_Config = mac_cell_group_configP->bsr_Config; - } - - if(mac_cell_group_configP->tag_Config != NULL ){ - mac->tag_Config = mac_cell_group_configP->tag_Config; - } - - if(mac_cell_group_configP->phr_Config != NULL ){ - switch(mac_cell_group_configP->phr_Config->present){ - case NR_SetupRelease_PHR_Config_PR_NOTHING: - break; - case NR_SetupRelease_PHR_Config_PR_release: - mac->phr_Config = NULL; - break; - case NR_SetupRelease_PHR_Config_PR_setup: - mac->phr_Config = mac_cell_group_configP->phr_Config->choice.setup; - break; - default: - break; - } - } - } - - - if(phy_cell_group_configP != NULL ){ - if(phy_cell_group_configP->cs_RNTI != NULL ){ - switch(phy_cell_group_configP->cs_RNTI->present){ - case NR_SetupRelease_RNTI_Value_PR_NOTHING: - break; - case NR_SetupRelease_RNTI_Value_PR_release: - mac->cs_RNTI = NULL; - break; - case NR_SetupRelease_RNTI_Value_PR_setup: - mac->cs_RNTI = &phy_cell_group_configP->cs_RNTI->choice.setup; - break; - default: - break; - } - } - } - */ - } - - return 0; - + } + return 0; } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 18c34d29e0..4eb3fdfe50 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -372,6 +372,23 @@ typedef struct { } NR_PHY_meas_t; +typedef struct NR_DL_BWP { + NR_BWP_Id_t bwp_id; + NR_BWP_t genericParameters; + int scs; + long *cyclicprefix; + uint16_t BWPSize; + uint16_t BWPStart; +} NR_DL_BWP_t; + +typedef struct NR_UL_BWP { + NR_BWP_Id_t bwp_id; + NR_BWP_t genericParameters; + int scs; + long *cyclicprefix; + uint16_t BWPSize; + uint16_t BWPStart; +} NR_UL_BWP_t; /*!\brief Top level UE MAC structure */ typedef struct { @@ -393,6 +410,9 @@ typedef struct { NR_RNTI_Value_t *cs_RNTI; NR_MIB_t *mib; + NR_DL_BWP_t current_DL_BWP; + NR_UL_BWP_t current_UL_BWP; + NR_BWP_Downlink_t *DLbwp[MAX_NUM_BWP_UE]; NR_BWP_Uplink_t *ULbwp[MAX_NUM_BWP_UE]; NR_ControlResourceSet_t *coreset[MAX_NUM_BWP_UE][FAPI_NR_MAX_CORESET_PER_BWP]; @@ -400,12 +420,6 @@ typedef struct { frame_type_t frame_type; - /*BWP*/ - // dedicated active DL BWP - NR_BWP_Id_t DL_BWP_Id; - // dedicated active UL BWP - NR_BWP_Id_t UL_BWP_Id; - /// Type0-PDCCH seach space fapi_nr_dl_config_dci_dl_pdu_rel15_t type0_pdcch_dci_config; uint32_t type0_pdcch_ss_mux_pattern; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index b8b533705a..ac2881435f 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -451,8 +451,6 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pd void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac); -void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint32_t *bwp_ind, uint8_t *dci_format); - void configure_ss_coreset(NR_UE_MAC_INST_t *mac, NR_ServingCellConfig_t *scd, NR_BWP_Id_t dl_bwp_id); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 8b71713eb6..d63c08dc8e 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -177,11 +177,11 @@ void init_RA(module_id_t mod_id, } } if (ss_id < 0) { - if (mac->DL_BWP_Id>0) { - ra_ss = mac->DLbwp[mac->DL_BWP_Id-1]->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; + if (mac->current_DL_BWP.bwp_id>0) { + ra_ss = mac->DLbwp[mac->current_DL_BWP.bwp_id-1]->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; if (ra_ss) { - commonSearchSpaceList = mac->DLbwp[mac->DL_BWP_Id-1]->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; - ss_id = *mac->DLbwp[mac->DL_BWP_Id-1]->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; + commonSearchSpaceList = mac->DLbwp[mac->current_DL_BWP.bwp_id-1]->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; + ss_id = *mac->DLbwp[mac->current_DL_BWP.bwp_id-1]->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; } } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 9b618cdbfb..b25b530176 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -94,10 +94,10 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t AssertFatal(mac->scc == NULL || mac->scc_SIB == NULL, "both scc and scc_SIB cannot be non-null\n"); - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommonSIB_t *scc_SIB = mac->scc_SIB; - NR_BWP_DownlinkCommon_t *bwp_Common=NULL; NR_BWP_DownlinkCommon_t *initialDownlinkBWP=NULL; NR_BWP_UplinkCommon_t *initialUplinkBWP=NULL; @@ -105,7 +105,6 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t initialDownlinkBWP = scc!=NULL ? scc->downlinkConfigCommon->initialDownlinkBWP : &scc_SIB->downlinkConfigCommon.initialDownlinkBWP; initialUplinkBWP = scc!=NULL ? scc->uplinkConfigCommon->initialUplinkBWP : &scc_SIB->uplinkConfigCommon->initialUplinkBWP; } - bwp_Common = dl_bwp_id>0 ? mac->DLbwp[dl_bwp_id-1]->bwp_Common : NULL; NR_SearchSpace_t *ss; NR_ControlResourceSet_t *coreset; @@ -167,28 +166,20 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t switch(rnti_type) { case NR_RNTI_C: // we use DL BWP dedicated - sps = bwp_Common ? - (bwp_Common->genericParameters.cyclicPrefix ? 12 : 14) : - initialDownlinkBWP->genericParameters.cyclicPrefix ? 12 : 14; + sps = current_DL_BWP->cyclicprefix ? 12 : 14; // for SPS=14 8 MSBs in positions 13 down to 6 monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); rel15->rnti = mac->crnti; - if (!bwp_Common) { - rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } - else { - rel15->BWPSize = NRRIV2BW(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - rel15->SubcarrierSpacing = bwp_Common->genericParameters.subcarrierSpacing; - } + rel15->BWPSize = current_DL_BWP->BWPSize; + rel15->BWPStart = current_DL_BWP->BWPStart; + rel15->SubcarrierSpacing = current_DL_BWP->scs; for (int i = 0; i < rel15->num_dci_options; i++) { rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, dl_bwp_id, coreset_id, mac->type0_PDCCH_CSS_config.num_rbs); } break; case NR_RNTI_RA: // we use the initial DL BWP - sps = initialDownlinkBWP->genericParameters.cyclicPrefix == NULL ? 14 : 12; + sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); rel15->rnti = mac->ra.ra_rnti; if (get_softmodem_params()->sa) { @@ -196,9 +187,9 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; } else { // NSA mode is not using the Initial BWP rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + rel15->BWPStart = current_DL_BWP->BWPStart; } - rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing; + rel15->SubcarrierSpacing = current_DL_BWP->scs; rel15->dci_length_options[0] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, dl_bwp_id, coreset_id, mac->type0_PDCCH_CSS_config.num_rbs); break; case NR_RNTI_P: @@ -207,12 +198,12 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t break; case NR_RNTI_TC: // we use the initial DL BWP - sps = initialDownlinkBWP->genericParameters.cyclicPrefix == NULL ? 14 : 12; + sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); rel15->rnti = mac->ra.t_crnti; rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; - rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing; + rel15->SubcarrierSpacing = current_DL_BWP->scs; for (int i = 0; i < rel15->num_dci_options; i++) { rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_TC, rel15->BWPSize, dl_bwp_id, coreset_id, mac->type0_PDCCH_CSS_config.num_rbs); } @@ -220,9 +211,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t case NR_RNTI_SP_CSI: break; case NR_RNTI_SI: - // we use DL BWP dedicated - if (bwp_Common) sps = bwp_Common->genericParameters.cyclicPrefix == NULL ? 14 : 12; - else sps=14; // note: normally this would be found with SSS detection + sps=14; // for SPS=14 8 MSBs in positions 13 down to 6 monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); @@ -280,7 +269,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl RA_config_t *ra = &mac->ra; int ss_id; - uint8_t bwp_id = (mac->cg) ? mac->DL_BWP_Id : 0; + uint8_t bwp_id = mac->current_DL_BWP.bwp_id; //NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated; NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP; @@ -431,7 +420,6 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl } // for ss_id } else { - AssertFatal(1==0,"Handle DCI searching when CellGroup without dedicated BWP\n"); } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index cef268d517..e2ba12380e 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -310,10 +310,10 @@ int8_t nr_ue_decode_mib(module_id_t module_id, NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); mac->physCellId = cell_id; - nr_mac_rrc_data_ind_ue( module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_BCH, (uint8_t *) pduP, 3 ); // fixed 3 bytes MIB PDU + nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_BCH, (uint8_t *) pduP, 3); // fixed 3 bytes MIB PDU AssertFatal(mac->mib != NULL, "nr_ue_decode_mib() mac->mib == NULL\n"); - //if(mac->mib != NULL){ + uint16_t frame = (mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused); uint16_t frame_number_4lsb = 0; @@ -649,17 +649,13 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr RA_config_t *ra = &mac->ra; fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; uint8_t is_Msg3 = 0; - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; + NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; int default_abc = 1; - uint16_t n_RB_DLBWP; - if (dl_bwp_id>0 && mac->DLbwp[dl_bwp_id-1]) n_RB_DLBWP = NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - else if (mac->scc) n_RB_DLBWP = NRRIV2BW(mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); - else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE); - else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs; - - LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP); + LOG_D(MAC, "In %s: Processing received DCI format %s\n", __FUNCTION__, dci_formats[dci_format]); switch(dci_format){ case NR_UL_DCI_FORMAT_0_0: { @@ -1066,8 +1062,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->accumulated_delta_PUCCH, dci->pucch_resource_indicator, 1+dci->pdsch_to_harq_feedback_timing_indicator.val); - - // dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15.N_RB_BWP = n_RB_DLBWP; LOG_D(MAC,"(nr_ue_procedures.c) pdu_type=%d\n\n",dl_config->dl_config_list[dl_config->number_pdus].pdu_type); @@ -1111,9 +1105,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr LOG_W(NR_MAC,"[%d.%d] bwp_indicator %d > NR_MAX_NUM_BWP Possibly due to false DCI. Ignoring DCI!\n", frame, slot,dci->bwp_indicator.val); return -1; } - config_bwp_ue(mac, &dci->bwp_indicator.val, &dci_format); - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_BWP_Id_t dl_bwp_id = mac->current_DL_BWP.bwp_id; + NR_BWP_Id_t ul_bwp_id = mac->current_UL_BWP.bwp_id; NR_PDSCH_Config_t *pdsch_Config=NULL; NR_BWP_DownlinkDedicated_t *bwpd=NULL; NR_BWP_DownlinkCommon_t *bwpc=NULL; @@ -1127,16 +1120,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu_1_1 = &dl_config->dl_config_list[dl_config->number_pdus].dlsch_config_pdu.dlsch_config_rel15; - dlsch_config_pdu_1_1->BWPSize = NRRIV2BW(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_1->BWPStart = NRRIV2PRBOFFSET(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_1->SubcarrierSpacing = bwpc->genericParameters.subcarrierSpacing; + dlsch_config_pdu_1_1->BWPSize = current_DL_BWP->BWPSize; + dlsch_config_pdu_1_1->BWPStart = current_DL_BWP->BWPStart; + dlsch_config_pdu_1_1->SubcarrierSpacing = current_DL_BWP->scs; /* IDENTIFIER_DCI_FORMATS */ /* CARRIER_IND */ /* BANDWIDTH_PART_IND */ // dlsch_config_pdu_1_1->bandwidth_part_ind = dci->bandwidth_part_ind; /* FREQ_DOM_RESOURCE_ASSIGNMENT_DL */ - if (nr_ue_process_dci_freq_dom_resource_assignment(NULL,dlsch_config_pdu_1_1,0,n_RB_DLBWP,dci->frequency_domain_assignment.val) < 0) { + if (nr_ue_process_dci_freq_dom_resource_assignment(NULL, dlsch_config_pdu_1_1, 0, current_DL_BWP->BWPSize, dci->frequency_domain_assignment.val) < 0) { LOG_W(MAC, "[%d.%d] Invalid frequency_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot); return -1; } @@ -1357,8 +1350,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr /* DMRS_SEQ_INI */ //FIXME!!! - // dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15.N_RB_BWP = n_RB_DLBWP; - /* PDSCH_TO_HARQ_FEEDBACK_TIME_IND */ // according to TS 38.213 Table 9.2.3-1 uint8_t feedback_ti = @@ -1406,9 +1397,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr long *maxMIMO_Layers = mac->cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers; AssertFatal (maxMIMO_Layers != NULL,"Option with max MIMO layers not configured is not supported\n"); int nl_tbslbrm = *maxMIMO_Layers < 4 ? *maxMIMO_Layers : 4; - NR_BWP_t genericParameters = mac->scc ? mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters : - mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - int BWPSize = NRRIV2BW(genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + int BWPSize = current_DL_BWP->BWPSize; int bw_tbslbrm = get_dlbw_tbslbrm(BWPSize, mac->cg); dlsch_config_pdu_1_1->tbslbrm = nr_compute_tbslbrm(dlsch_config_pdu_1_1->mcs_table, bw_tbslbrm, @@ -1527,23 +1516,12 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, int O_CRC = 0; //FIXME uint16_t O_uci = O_CSI + O_ACK; - NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t bwp_id = current_UL_BWP->bwp_id; NR_PUCCH_FormatConfig_t *pucchfmt; long *pusch_id = NULL; long *id0 = NULL; - int scs; - NR_BWP_UplinkCommon_t *initialUplinkBWP; - if (mac->scc) initialUplinkBWP = mac->scc->uplinkConfigCommon->initialUplinkBWP; - else initialUplinkBWP = &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP; - if (mac->cg && bwp_id > 1 && mac->ULbwp[bwp_id - 1] && - mac->cg->spCellConfig && - mac->cg->spCellConfig->spCellConfigDedicated && - mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig && - mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { - scs = mac->ULbwp[bwp_id - 1]->bwp_Common->genericParameters.subcarrierSpacing; - } - else - scs = initialUplinkBWP->genericParameters.subcarrierSpacing; + const int scs = current_UL_BWP->scs; int subframe_number = slot / (nr_slots_per_frame[scs]/10); nb_pucch_format_4_in_subframes[subframe_number] = 0; @@ -1560,10 +1538,8 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, pucch_pdu->start_symbol_index = initial_pucch_resource[pucch->initial_pucch_id].startingSymbolIndex; pucch_pdu->nr_of_symbols = initial_pucch_resource[pucch->initial_pucch_id].nrofSymbols; - pucch_pdu->bwp_size = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, - MAX_BWP_SIZE); - pucch_pdu->bwp_start = NRRIV2PRBOFFSET(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, - MAX_BWP_SIZE); + pucch_pdu->bwp_size = current_UL_BWP->BWPSize; + pucch_pdu->bwp_start = current_UL_BWP->BWPStart; pucch_pdu->prb_size = 1; // format 0 or 1 int RB_BWP_offset; @@ -1626,8 +1602,6 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->transformPrecodingDisabled->scramblingID0; else *id0 = mac->physCellId; pucch_Config = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup; - pucch_pdu->bwp_size = NRRIV2BW(mac->ULbwp[bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); - pucch_pdu->bwp_start = NRRIV2PRBOFFSET(mac->ULbwp[bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); } else if (bwp_id==0 && mac->cg && @@ -1638,12 +1612,11 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) { pucch_Config = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; - pucch_pdu->bwp_size = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE); - pucch_pdu->bwp_start = NRRIV2PRBOFFSET(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE); } else AssertFatal(1==0,"no pucch_Config\n"); - + pucch_pdu->bwp_size = current_UL_BWP->BWPSize; + pucch_pdu->bwp_start = current_UL_BWP->BWPStart; pucch_pdu->prb_start = pucchres->startingPRB; pucch_pdu->freq_hop_flag = pucchres->intraSlotFrequencyHopping!= NULL ? 1 : 0; pucch_pdu->second_hop_prb = pucchres->secondHopPRB!= NULL ? *pucchres->secondHopPRB : 0; @@ -1955,7 +1928,7 @@ int get_deltatf(uint16_t nb_of_prbs, int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) { int pucch_resource_set_id = 0; - NR_BWP_Id_t bwp_id = mac->DL_BWP_Id; + NR_BWP_Id_t bwp_id = mac->current_DL_BWP.bwp_id; //long *pucch_max_pl_bits = NULL; @@ -2027,7 +2000,7 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac, PUCCH_sched_t *pucch) { NR_PUCCH_ResourceId_t *current_resource_id = NULL; - NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; + NR_BWP_Id_t bwp_id = mac->current_UL_BWP.bwp_id; int n_list; if (pucch->is_common == 1 || @@ -2151,10 +2124,12 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, int V_DAI_m_DL = 0; NR_UE_HARQ_STATUS_t *current_harq; int sched_frame,sched_slot; - int slots_per_frame,scs; + int slots_per_frame; - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; + NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; NR_BWP_DownlinkDedicated_t *bwpd=NULL; NR_BWP_DownlinkCommon_t *bwpc=NULL; NR_BWP_UplinkDedicated_t *ubwpd=NULL; @@ -2170,7 +2145,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, number_of_code_word = 2; } - scs = ubwpc->genericParameters.subcarrierSpacing; + int scs = current_UL_BWP->scs; slots_per_frame = nr_slots_per_frame[scs]; @@ -2350,24 +2325,11 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac, frame_t frame, int slot) { - NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t bwp_id = current_UL_BWP->bwp_id; NR_PUCCH_Config_t *pucch_Config = NULL; - int scs; - NR_BWP_UplinkCommon_t *initialUplinkBWP; - if (mac->scc) initialUplinkBWP = mac->scc->uplinkConfigCommon->initialUplinkBWP; - else initialUplinkBWP = &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP; - if (mac->cg && bwp_id && mac->ULbwp[bwp_id - 1] && - mac->cg->spCellConfig && - mac->cg->spCellConfig->spCellConfigDedicated && - mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig && - mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { - scs = mac->ULbwp[bwp_id - 1]->bwp_Common->genericParameters.subcarrierSpacing; - } - else - scs = initialUplinkBWP->genericParameters.subcarrierSpacing; - - const int n_slots_frame = nr_slots_per_frame[scs]; + const int n_slots_frame = nr_slots_per_frame[current_UL_BWP->scs]; if (bwp_id>0 && mac->ULbwp[bwp_id-1] && @@ -2476,7 +2438,8 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, int slot, PUCCH_sched_t *pucch) { - NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t bwp_id = current_UL_BWP->bwp_id; NR_PUCCH_Config_t *pucch_Config = NULL; int csi_bits = 0; @@ -2499,19 +2462,6 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, int period, offset; csi_period_offset(csirep, NULL, &period, &offset); - int scs; - NR_BWP_Uplink_t *ubwp = mac->ULbwp[bwp_id-1]; - NR_BWP_UplinkCommon_t *initialUplinkBWP; - if (mac->scc) initialUplinkBWP = mac->scc->uplinkConfigCommon->initialUplinkBWP; - else initialUplinkBWP = &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP; - - if (ubwp && - mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig && - mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) - scs = ubwp->bwp_Common->genericParameters.subcarrierSpacing; - else - scs = initialUplinkBWP->genericParameters.subcarrierSpacing; - if (bwp_id>0 && mac->ULbwp[bwp_id-1] && mac->ULbwp[bwp_id-1]->bwp_Dedicated && @@ -2527,7 +2477,7 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, pucch_Config = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; } - const int n_slots_frame = nr_slots_per_frame[scs]; + const int n_slots_frame = nr_slots_per_frame[current_UL_BWP->scs]; if (((n_slots_frame*frame + slot - offset)%period) == 0 && pucch_Config) { LOG_D(NR_MAC, "Preparing CSI report in frame %d slot %d CSI report ID %d\n", frame, slot, csi_report_id); NR_PUCCH_CSI_Resource_t *pucchcsires = csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[0]; @@ -2859,7 +2809,7 @@ void nr_ue_send_sdu(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *u int get_n_rb(NR_UE_MAC_INST_t *mac, int rnti_type){ int N_RB = 0, start_RB; - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + NR_BWP_Id_t dl_bwp_id = mac->current_DL_BWP.bwp_id; switch(rnti_type) { case NR_RNTI_RA: case NR_RNTI_TC: @@ -2896,17 +2846,10 @@ static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, int fsize = 0; int rnti_type = get_rnti_type(mac, rnti); - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id ; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id ; - - int N_RB_UL = 0; - if(ul_bwp_id > 0 && mac->ULbwp[ul_bwp_id-1]) { - N_RB_UL = NRRIV2BW(mac->ULbwp[ul_bwp_id - 1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } else if(mac->scc) { - N_RB_UL = NRRIV2BW(mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } else if(mac->scc_SIB) { - N_RB_UL = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } + NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; + int N_RB_UL = current_UL_BWP->BWPSize; LOG_D(MAC,"nr_extract_dci_info : dci_pdu %lx, size %d\n",*dci_pdu,dci_size); switch(dci_format) { @@ -2968,10 +2911,7 @@ static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, LOG_D(MAC,"Format indicator %d (%d bits) N_RB_BWP %d => %d (0x%lx)\n",dci_pdu_rel15->format_indicator,1,N_RB,dci_size-pos,*dci_pdu); #endif - // check BWP id - if (dl_bwp_id>0 && mac->DLbwp[dl_bwp_id-1]) N_RB=NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - else N_RB=NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - + N_RB = current_DL_BWP->BWPSize; // Freq domain assignment (275rb >> fsize = 16) fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); pos+=fsize; @@ -3234,9 +3174,6 @@ static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, break; case NR_UL_DCI_FORMAT_0_0: - if (mac->ULbwp[ul_bwp_id-1]) N_RB_UL=NRRIV2BW(mac->ULbwp[ul_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - else N_RB_UL=NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - switch(rnti_type) { case NR_RNTI_C: diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 902bb2aec8..cebd802bbc 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -107,7 +107,7 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { long k2 = -1; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_BWP_Id_t ul_bwp_id = mac->current_UL_BWP.bwp_id; // Get K2 from RRC configuration NR_PUSCH_Config_t *pusch_config= ul_bwp_id > 0 && mac->ULbwp[ul_bwp_id-1] ? mac->ULbwp[ul_bwp_id-1]->bwp_Dedicated->pusch_Config->choice.setup : NULL; NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL; @@ -149,7 +149,7 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { */ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int slot) { - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->scc==NULL ? mac->scc_SIB->tdd_UL_DL_ConfigurationCommon : mac->scc->tdd_UL_DL_ConfigurationCommon; //Check if request to access ul_config is for a UL slot @@ -161,9 +161,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl // Calculate the index of the UL slot in mac->ul_config_request list. This is // based on the TDD pattern (slot configuration period) and number of UL+mixed // slots in the period. TS 38.213 Sec 11.1 - int mu = ul_bwp_id > 0 && mac->ULbwp[ul_bwp_id-1] ? - mac->ULbwp[ul_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : - mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; + int mu = mac->current_UL_BWP.scs; const int n = nr_slots_per_frame[mu]; const int num_slots_per_tdd = tdd_config ? (n >> (7 - tdd_config->pattern1.dl_UL_TransmissionPeriodicity)) : n; const int num_slots_ul = tdd_config ? (tdd_config->pattern1.nrofUplinkSlots + (tdd_config->pattern1.nrofUplinkSymbols != 0)) : n; @@ -184,7 +182,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl void ul_layers_config(NR_UE_MAC_INST_t * mac, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, dci_pdu_rel15_t *dci) { NR_ServingCellConfigCommon_t *scc = mac->scc; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_BWP_Id_t ul_bwp_id = mac->current_UL_BWP.bwp_id; NR_BWP_UplinkDedicated_t *ubwpd=NULL; NR_SRS_Config_t *srs_config = NULL; @@ -342,7 +340,7 @@ void ul_ports_config(NR_UE_MAC_INST_t *mac, int *n_front_load_symb, nfapi_nr_ue_ uint8_t rank = pusch_config_pdu->nrOfLayers; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_BWP_Id_t ul_bwp_id = mac->current_UL_BWP.bwp_id; NR_ServingCellConfigCommon_t *scc = mac->scc; NR_BWP_UplinkDedicated_t *ubwpd=NULL; @@ -555,7 +553,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, int N_PRB_oh = 0; int rnti_type = get_rnti_type(mac, rnti); - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; // Common configuration pusch_config_pdu->dmrs_config_type = pusch_dmrs_type1; @@ -675,8 +674,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, pusch_config_pdu->tbslbrm = 0; } else if (dci) { - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_BWP_Id_t dl_bwp_id = mac->current_DL_BWP.bwp_id; + NR_BWP_Id_t ul_bwp_id = mac->current_UL_BWP.bwp_id; NR_BWP_DownlinkDedicated_t *bwpd=NULL; NR_BWP_DownlinkCommon_t *bwpc=NULL; NR_BWP_UplinkDedicated_t *ubwpd=NULL; @@ -686,9 +685,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, int target_ss; bool valid_ptrs_setup = 0; - uint16_t n_RB_ULBWP = NRRIV2BW(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - pusch_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - pusch_config_pdu->bwp_size = n_RB_ULBWP; + pusch_config_pdu->bwp_start = current_UL_BWP->BWPStart; + pusch_config_pdu->bwp_size = current_UL_BWP->BWPSize; const NR_PUSCH_Config_t *pusch_Config = ubwpd? ubwpd->pusch_Config->choice.setup : NULL; @@ -710,8 +708,6 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, } else if (*dci_format == NR_UL_DCI_FORMAT_0_1) { - config_bwp_ue(mac, &dci->bwp_indicator.val, dci_format); - get_bwp_info(mac,dl_bwp_id,ul_bwp_id,&bwpd,&bwpc,&ubwpd,&ubwpc); target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; @@ -780,7 +776,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, /* IDENTIFIER_DCI_FORMATS */ /* FREQ_DOM_RESOURCE_ASSIGNMENT_UL */ - if (nr_ue_process_dci_freq_dom_resource_assignment(pusch_config_pdu, NULL, n_RB_ULBWP, 0, dci->frequency_domain_assignment.val) < 0){ + if (nr_ue_process_dci_freq_dom_resource_assignment(pusch_config_pdu, NULL, current_UL_BWP->BWPSize, 0, dci->frequency_domain_assignment.val) < 0){ return -1; } /* TIME_DOM_RESOURCE_ASSIGNMENT */ @@ -953,7 +949,8 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo bool srs_scheduled = false; NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); - const NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; NR_SRS_Config_t *srs_config = NULL; if (ul_bwp_id > 0 && mac->ULbwp[ul_bwp_id-1]) { @@ -997,14 +994,10 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo continue; } - NR_BWP_t ubwp = ul_bwp_id > 0 && mac->ULbwp[ul_bwp_id-1] ? - mac->ULbwp[ul_bwp_id-1]->bwp_Common->genericParameters : - mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters; - uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; uint16_t offset = get_nr_srs_offset(srs_resource->resourceType.choice.periodic->periodicityAndOffset_p); - int n_slots_frame = nr_slots_per_frame[ubwp.subcarrierSpacing]; + int n_slots_frame = nr_slots_per_frame[current_UL_BWP->scs]; // Check if UE should transmit the SRS if((frame*n_slots_frame+slot-offset)%period == 0) { @@ -1014,9 +1007,9 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo srs_config_pdu->rnti = mac->crnti; srs_config_pdu->handle = 0; - srs_config_pdu->bwp_size = NRRIV2BW(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; - srs_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; - srs_config_pdu->subcarrier_spacing = ubwp.subcarrierSpacing; + srs_config_pdu->bwp_size = current_UL_BWP->BWPSize; + srs_config_pdu->bwp_start = current_UL_BWP->BWPStart; + srs_config_pdu->subcarrier_spacing = current_UL_BWP->scs; srs_config_pdu->cyclic_prefix = 0; srs_config_pdu->num_ant_ports = srs_resource->nrofSRS_Ports; srs_config_pdu->num_symbols = srs_resource->resourceMapping.nrofSymbols; @@ -1588,12 +1581,11 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac, uint8_t tda_id){ int delta = 0; - NR_BWP_Id_t ul_bwp_id = mac->UL_BWP_Id; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; // Get the numerology to calculate the Tx frame and slot - int mu = ul_bwp_id > 0 && mac->ULbwp[ul_bwp_id-1] ? - mac->ULbwp[ul_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : - mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; + int mu = current_UL_BWP->scs; NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = ul_bwp_id > 0 && mac->ULbwp[ul_bwp_id-1] ? mac->ULbwp[ul_bwp_id-1]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList: @@ -2338,7 +2330,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, vo // ACKNACK O_ACK = get_downlink_ack(mac, frameP, slotP, &pucch); - NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; + NR_BWP_Id_t bwp_id = mac->current_UL_BWP.bwp_id; NR_PUCCH_Config_t *pucch_Config = NULL; if (bwp_id>0 && @@ -2426,18 +2418,11 @@ void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) { fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; NR_CSI_IM_Resource_t *imcsi; int period, offset; - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; - NR_BWP_t *genericParameters = NULL; - if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) { - genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters; - } else { - genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - } - - int mu = genericParameters->subcarrierSpacing; - uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); - uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); + NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + int mu = current_DL_BWP->scs; + uint16_t bwp_size = current_DL_BWP->BWPSize; + uint16_t bwp_start = current_DL_BWP->BWPStart; for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){ imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id]; @@ -2491,18 +2476,12 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; NR_NZP_CSI_RS_Resource_t *nzpcsi; int period, offset; - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; - NR_BWP_t *genericParameters = NULL; - if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) { - genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters; - } else { - genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - } - - int mu = genericParameters->subcarrierSpacing; - uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); - uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); + int mu = current_DL_BWP->scs; + uint16_t bwp_size = current_DL_BWP->BWPSize; + uint16_t bwp_start = current_DL_BWP->BWPStart; // looking for the correct CSI-RS resource in current BWP NR_NZP_CSI_RS_ResourceSetId_t *nzp = NULL; @@ -2530,7 +2509,7 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15; NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; csirs_config_pdu->subcarrier_spacing = mu; - csirs_config_pdu->cyclic_prefix = genericParameters->cyclicPrefix ? *genericParameters->cyclicPrefix : 0; + csirs_config_pdu->cyclic_prefix = current_DL_BWP->cyclicprefix ? *current_DL_BWP->cyclicprefix : 0; // According to last paragraph of TS 38.214 5.2.2.3.1 if (resourceMapping.freqBand.startingRB < bwp_start) { From e55e880b71210155089a05e439c240d748a10e8e Mon Sep 17 00:00:00 2001 From: francescomani Date: Sat, 24 Dec 2022 14:13:35 +0100 Subject: [PATCH 15/39] cleaning up of dci functions --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 + openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 9 +- openair1/SIMULATION/NR_PHY/dlsim.c | 17 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 65 ++++-- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 18 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 9 + openair2/LAYER2/NR_MAC_UE/mac_defs.h | 4 + openair2/LAYER2/NR_MAC_UE/mac_proto.h | 8 + .../NR_MAC_UE/nr_ue_dci_configuration.c | 203 +++++++++++------- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 107 +++------ openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 28 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 30 +-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 3 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 124 ----------- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 69 +++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 8 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 13 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 4 + 19 files changed, 340 insertions(+), 386 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 21710940d6..ebfb2becb0 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -86,6 +86,7 @@ typedef struct { typedef struct { uint16_t rnti; uint8_t dci_format; + int ss_type; // n_CCE index of first CCE for PDCCH reception int n_CCE; // N_CCE is L, or number of CCEs for DCI @@ -413,6 +414,7 @@ typedef struct { uint8_t num_dci_options; // Num DCIs the UE actually needs to decode (1 or 2) uint8_t dci_length_options[2]; uint8_t dci_format_options[2]; + uint8_t dci_type_options[2]; } fapi_nr_dl_config_dci_dl_pdu_rel15_t; typedef struct { diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 423140fc7a..658b440c21 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -931,10 +931,11 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, else { dci_ind->SFN = proc->frame_rx; dci_ind->slot = proc->nr_slot_rx; - dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti; - dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind; - dci_ind->dci_list[dci_ind->number_of_dcis].N_CCE = L; - dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k]; + dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti; + dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind; + dci_ind->dci_list[dci_ind->number_of_dcis].N_CCE = L; + dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k]; + dci_ind->dci_list[dci_ind->number_of_dcis].ss_type = rel15->dci_type_options[k]; dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length; memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8); dci_ind->number_of_dcis++; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 671e613679..43ecec10d2 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -434,8 +434,6 @@ int main(int argc, char **argv) int loglvl=OAILOG_WARNING; //float target_error_rate = 0.01; - int css_flag=0; - cpuf = get_cpu_freq_GHz(); int8_t enable_ptrs = 0; int8_t modify_dmrs = 0; @@ -463,7 +461,7 @@ int main(int argc, char **argv) FILE *scg_fd=NULL; - while ((c = getopt(argc, argv, "f:hA:pf:g:i:n:s:S:t:v:x:y:z:M:N:F:GR:d:PI:L:Ea:b:e:m:w:T:U:q:X:Y")) != -1) { + while ((c = getopt(argc, argv, "f:hA:pf:g:i:n:s:S:t:v:x:y:z:M:N:F:GR:d:PI:L:a:b:e:m:w:T:U:q:X:Y")) != -1) { switch (c) { case 'f': scg_fd = fopen(optarg,"r"); @@ -622,12 +620,6 @@ int main(int argc, char **argv) loglvl = atoi(optarg); break; - - case 'E': - css_flag=1; - break; - - case 'a': g_rbStart = atoi(optarg); break; @@ -709,7 +701,6 @@ int main(int argc, char **argv) //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); printf("-f raw file containing RRC configuration (generated by gNB)\n"); printf("-F Input filename (.txt format) for RX conformance testing\n"); - printf("-E used CSS scheduler\n"); printf("-o CORESET offset\n"); printf("-a Start PRB for PDSCH\n"); printf("-b Number of PRB for PDSCH\n"); @@ -1122,11 +1113,7 @@ int main(int argc, char **argv) UE_info->UE_sched_ctrl.harq_processes[harq_pid].ndi = !(trial&1); UE_info->UE_sched_ctrl.harq_processes[harq_pid].round = round; - if (css_flag == 0) { - nr_schedule_ue_spec(0, frame, slot); - } else { - nr_schedule_css_dlsch_phytest(0,frame,slot); - } + nr_schedule_ue_spec(0, frame, slot); Sched_INFO.module_id = 0; Sched_INFO.CC_id = 0; Sched_INFO.frame = frame; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index fb20092ed5..713679c4e3 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -3130,16 +3130,42 @@ uint8_t compute_precoding_information(NR_PUSCH_Config_t *pusch_Config, return nbits; } +uint16_t get_rb_bwp_dci(nr_dci_format_t format, + int ss_type, + uint16_t cset0_bwp_size, + uint16_t ul_bwp_size, + uint16_t dl_bwp_size, + uint16_t initial_ul_bwp_size, + uint16_t initial_dl_bwp_size) +{ + uint16_t N_RB; + if (format == NR_UL_DCI_FORMAT_0_0 || format == NR_UL_DCI_FORMAT_0_1) { + if(format == NR_UL_DCI_FORMAT_0_0 && ss_type == NR_SearchSpace__searchSpaceType_PR_common) + N_RB = initial_ul_bwp_size; + else + N_RB = ul_bwp_size; + } + else { + if(format == NR_DL_DCI_FORMAT_1_0 && ss_type == NR_SearchSpace__searchSpaceType_PR_common) { + N_RB = cset0_bwp_size ? cset0_bwp_size : initial_dl_bwp_size; + } + else + N_RB = dl_bwp_size; + } + return N_RB; +} + uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, const NR_BWP_UplinkCommon_t *initialUplinkBWP, const NR_CellGroupConfig_t *cg, dci_pdu_rel15_t *dci_pdu, nr_dci_format_t format, nr_rnti_type_t rnti_type, - uint16_t N_RB, + int controlResourceSetId, int bwp_id, - NR_ControlResourceSetId_t coreset_id, - uint16_t cset0_bwp_size) { + uint16_t N_RB, + uint16_t alt_size) +{ uint16_t size = 0; uint16_t numRBG = 0; @@ -3184,20 +3210,18 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, srs_config = (ubwpd && ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup: NULL; } - int n_ul_bwp=1,n_dl_bwp=1; + int n_ul_bwp = 1,n_dl_bwp = 1; switch(format) { - /*Only sizes for 0_0 and 1_0 are correct at the moment*/ case NR_UL_DCI_FORMAT_0_0: /// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 Time Domain assgnmt 4 --20 size += 20; dci_pdu->frequency_domain_assignment.nbits = (uint8_t)ceil(log2((N_RB * (N_RB + 1)) >>1)); // Freq domain assignment -- hopping scenario to be updated size += dci_pdu->frequency_domain_assignment.nbits; - int dci_10_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP,cg,dci_pdu,NR_DL_DCI_FORMAT_1_0, rnti_type, N_RB, bwp_id, coreset_id, cset0_bwp_size); - if(dci_10_size >= size) - size += dci_10_size - size; // Padding to match 1_0 size + if(alt_size >= size) + size += alt_size - size; // Padding to match 1_0 size else { - dci_pdu->frequency_domain_assignment.nbits -= (size - dci_10_size); - size = dci_10_size; + dci_pdu->frequency_domain_assignment.nbits -= (size - alt_size); + size = alt_size; } // UL/SUL indicator assumed to be 0 break; @@ -3237,11 +3261,12 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, if (pusch_Config->resourceAllocation == 0) dci_pdu->frequency_domain_assignment.nbits = numRBG; else if (pusch_Config->resourceAllocation == 1) - dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + dci_pdu->frequency_domain_assignment.nbits = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); else - dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1; + dci_pdu->frequency_domain_assignment.nbits = ((int)ceil(log2((N_RB * (N_RB + 1)) >> 1)) > numRBG) ? (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)) + 1 : numRBG + 1; } - else dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + else + dci_pdu->frequency_domain_assignment.nbits = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); LOG_D(NR_MAC,"PUSCH Frequency Domain Assignment nbits %d, N_RB %d\n",dci_pdu->frequency_domain_assignment.nbits,N_RB); size += dci_pdu->frequency_domain_assignment.nbits; // Time domain assignment @@ -3357,14 +3382,10 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, // 3GPP TS 38.212 Section 7.3.1.0: DCI size alignment // Size of DCI format 1_0 is given by the size of CORESET 0 if CORESET 0 is configured for the cell and the size // of initial DL bandwidth part if CORESET 0 is not configured for the cell - if(cset0_bwp_size>0) { - N_RB = cset0_bwp_size; - } - size = 28; - size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment + size += (uint8_t)ceil(log2((N_RB * (N_RB + 1)) >> 1)); // Freq domain assignment - dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + dci_pdu->frequency_domain_assignment.nbits = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); dci_pdu->time_domain_assignment.nbits = 4; dci_pdu->vrb_to_prb_mapping.nbits = 1; break; @@ -3399,9 +3420,9 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, if (pdsch_Config && pdsch_Config->resourceAllocation == 0) dci_pdu->frequency_domain_assignment.nbits = numRBG; else if (pdsch_Config == NULL || pdsch_Config->resourceAllocation == 1) - dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + dci_pdu->frequency_domain_assignment.nbits = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); else - dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1; + dci_pdu->frequency_domain_assignment.nbits = ((int)ceil(log2((N_RB * (N_RB + 1)) >> 1)) > numRBG) ? (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)) + 1 : numRBG + 1; size += dci_pdu->frequency_domain_assignment.nbits; LOG_D(NR_MAC,"dci_pdu->frequency_domain_assignment.nbits %d (N_RB %d)\n",dci_pdu->frequency_domain_assignment.nbits,N_RB); // Time domain assignment (see table 5.1.2.1.1-1 in 38.214 @@ -3478,7 +3499,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, LOG_D(NR_MAC,"dci_pdu->antenna_ports.nbits %d\n",dci_pdu->antenna_ports.nbits); // Tx Config Indication for (int i = 0; i < pdcch_Config->controlResourceSetToAddModList->list.count; i++) { - if (pdcch_Config->controlResourceSetToAddModList->list.array[i]->controlResourceSetId == coreset_id) { + if (pdcch_Config->controlResourceSetToAddModList->list.array[i]->controlResourceSetId == controlResourceSetId) { long *isTciEnable = pdcch_Config->controlResourceSetToAddModList->list.array[i]->tci_PresentInDCI; if (isTciEnable != NULL) { dci_pdu->transmission_configuration_indication.nbits = 3; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 7f88216cbd..06251fefb7 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -75,16 +75,24 @@ uint8_t compute_precoding_information(NR_PUSCH_Config_t *pusch_Config, const uint8_t *nrOfLayers, uint32_t *val); -uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDLBWP, - const NR_BWP_UplinkCommon_t *initialULBWP, +uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, + const NR_BWP_UplinkCommon_t *initialUplinkBWP, const NR_CellGroupConfig_t *cg, dci_pdu_rel15_t *dci_pdu, nr_dci_format_t format, nr_rnti_type_t rnti_type, - uint16_t N_RB, + int controlResourceSetId, int bwp_id, - NR_ControlResourceSetId_t coreset_id, - uint16_t cset0_bwp_size); + uint16_t N_RB, + uint16_t alt_size); + +uint16_t get_rb_bwp_dci(nr_dci_format_t format, + int ss_type, + uint16_t cset0_bwp_size, + uint16_t ul_bwp_size, + uint16_t dl_bwp_size, + uint16_t initial_ul_bwp_size, + uint16_t initial_dl_bwp_size); void find_aggregation_candidates(uint8_t *aggregation_level, uint8_t *nr_of_candidates, diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index d465cbf2e7..4b4c92e406 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -615,6 +615,15 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, UL_BWP->cyclicprefix = UL_BWP->genericParameters.cyclicPrefix; UL_BWP->BWPSize = NRRIV2BW(UL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); UL_BWP->BWPStart = NRRIV2PRBOFFSET(UL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + + DL_BWP->initial_BWPSize = mac->scc ? NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : + NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->initial_BWPSize = mac->scc ? NRRIV2BW(mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : + NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->initial_BWPStart = mac->scc ? NRRIV2PRBOFFSET(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : + NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->initial_BWPStart = mac->scc ? NRRIV2PRBOFFSET(mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : + NRRIV2PRBOFFSET(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 4eb3fdfe50..b3a3915993 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -377,6 +377,8 @@ typedef struct NR_DL_BWP { NR_BWP_t genericParameters; int scs; long *cyclicprefix; + uint16_t initial_BWPSize; + uint16_t initial_BWPStart; uint16_t BWPSize; uint16_t BWPStart; } NR_DL_BWP_t; @@ -386,6 +388,8 @@ typedef struct NR_UL_BWP { NR_BWP_t genericParameters; int scs; long *cyclicprefix; + uint16_t initial_BWPSize; + uint16_t initial_BWPStart; uint16_t BWPSize; uint16_t BWPStart; } NR_UL_BWP_t; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index ac2881435f..bf6b89f71c 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -455,6 +455,14 @@ void configure_ss_coreset(NR_UE_MAC_INST_t *mac, NR_ServingCellConfig_t *scd, NR_BWP_Id_t dl_bwp_id); +static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, + uint8_t dci_format, + uint8_t dci_size, + uint16_t rnti, + int ss_type, + uint64_t *dci_pdu, + dci_pdu_rel15_t *dci_pdu_rel15); + fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int slot); void fill_ul_config(fapi_nr_ul_config_request_t *ul_config, frame_t frame_tx, int slot_tx, uint8_t pdu_type); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index b25b530176..0670c1cff0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -87,7 +87,8 @@ void fill_dci_search_candidates(NR_SearchSpace_t *ss, } } -void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id){ +void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id) +{ uint16_t monitoringSymbolsWithinSlot = 0; int sps = 0; @@ -95,6 +96,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t AssertFatal(mac->scc == NULL || mac->scc_SIB == NULL, "both scc and scc_SIB cannot be non-null\n"); NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommonSIB_t *scc_SIB = mac->scc_SIB; @@ -122,7 +124,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t uint8_t coreset_id = *ss->controlResourceSetId; - if(coreset_id>0) { + if(coreset_id > 0) { coreset = mac->coreset[dl_bwp_id][coreset_id - 1]; rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; } else { @@ -161,86 +163,131 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t rel15->coreset.pdcch_dmrs_scrambling_id = mac->physCellId; rel15->coreset.scrambling_rnti = 0; } - // loop over RNTI type and configure resource allocation for DCI - switch(rnti_type) { - case NR_RNTI_C: - // we use DL BWP dedicated - sps = current_DL_BWP->cyclicprefix ? 12 : 14; - // for SPS=14 8 MSBs in positions 13 down to 6 - monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - rel15->rnti = mac->crnti; - rel15->BWPSize = current_DL_BWP->BWPSize; - rel15->BWPStart = current_DL_BWP->BWPStart; - rel15->SubcarrierSpacing = current_DL_BWP->scs; - for (int i = 0; i < rel15->num_dci_options; i++) { - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, dl_bwp_id, coreset_id, mac->type0_PDCCH_CSS_config.num_rbs); - } - break; - case NR_RNTI_RA: - // we use the initial DL BWP - sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; - monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - rel15->rnti = mac->ra.ra_rnti; - if (get_softmodem_params()->sa) { - rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; - } else { // NSA mode is not using the Initial BWP - rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - rel15->BWPStart = current_DL_BWP->BWPStart; - } - rel15->SubcarrierSpacing = current_DL_BWP->scs; - rel15->dci_length_options[0] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, dl_bwp_id, coreset_id, mac->type0_PDCCH_CSS_config.num_rbs); - break; - case NR_RNTI_P: - break; - case NR_RNTI_CS: - break; - case NR_RNTI_TC: - // we use the initial DL BWP - sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; - monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - rel15->rnti = mac->ra.t_crnti; - rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; - rel15->SubcarrierSpacing = current_DL_BWP->scs; - for (int i = 0; i < rel15->num_dci_options; i++) { - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_TC, rel15->BWPSize, dl_bwp_id, coreset_id, mac->type0_PDCCH_CSS_config.num_rbs); + int N_RB; + for (int i = 0; i < rel15->num_dci_options; i++) { + rel15->dci_type_options[i] = ss->searchSpaceType->present; + const int dci_format = rel15->dci_format_options[i]; + uint16_t alt_size = 0; + if(current_DL_BWP) { + N_RB = get_rb_bwp_dci(dci_format, + ss->searchSpaceType->present, + mac->type0_PDCCH_CSS_config.num_rbs, + current_UL_BWP->BWPSize, + current_DL_BWP->BWPSize, + current_UL_BWP->initial_BWPSize, + current_DL_BWP->initial_BWPSize); + + // computing alternative size for padding + uint16_t alt_rb; + dci_pdu_rel15_t temp_pdu; + if(dci_format == NR_DL_DCI_FORMAT_1_0) { + alt_rb = get_rb_bwp_dci(NR_UL_DCI_FORMAT_0_0, + ss->searchSpaceType->present, + mac->type0_PDCCH_CSS_config.num_rbs, + current_UL_BWP->BWPSize, + current_DL_BWP->BWPSize, + current_UL_BWP->initial_BWPSize, + current_DL_BWP->initial_BWPSize); + + alt_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &temp_pdu, + NR_UL_DCI_FORMAT_0_0, rnti_type, coreset_id, dl_bwp_id, alt_rb, 0); } - break; - case NR_RNTI_SP_CSI: - break; - case NR_RNTI_SI: - sps=14; + if(dci_format == NR_UL_DCI_FORMAT_0_0) { + alt_rb = get_rb_bwp_dci(NR_DL_DCI_FORMAT_1_0, + ss->searchSpaceType->present, + mac->type0_PDCCH_CSS_config.num_rbs, + current_UL_BWP->BWPSize, + current_DL_BWP->BWPSize, + current_UL_BWP->initial_BWPSize, + current_DL_BWP->initial_BWPSize); - // for SPS=14 8 MSBs in positions 13 down to 6 - monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - - rel15->rnti = SI_RNTI; // SI-RNTI - 3GPP TS 38.321 Table 7.1-1: RNTI values - rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; - - if(mac->frequency_range == FR1) - rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon; - else - rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon + 2; - - for (int i = 0; i < rel15->num_dci_options; i++) { - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, 0, coreset_id, mac->type0_PDCCH_CSS_config.num_rbs); + alt_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &temp_pdu, + NR_DL_DCI_FORMAT_1_0, rnti_type, coreset_id, dl_bwp_id, alt_rb, 0); } - break; - case NR_RNTI_SFI: - break; - case NR_RNTI_INT: - break; - case NR_RNTI_TPC_PUSCH: - break; - case NR_RNTI_TPC_PUCCH: - break; - case NR_RNTI_TPC_SRS: - break; - default: - break; + } + else + N_RB = mac->type0_PDCCH_CSS_config.num_rbs; + switch(rnti_type) { + case NR_RNTI_C: + // we use DL BWP dedicated + sps = current_DL_BWP->cyclicprefix ? 12 : 14; + // for SPS=14 8 MSBs in positions 13 down to 6 + monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); + rel15->rnti = mac->crnti; + rel15->BWPSize = current_DL_BWP->BWPSize; + rel15->BWPStart = current_DL_BWP->BWPStart; + rel15->SubcarrierSpacing = current_DL_BWP->scs; + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, + &mac->def_dci_pdu_rel15[dci_format], + dci_format, NR_RNTI_C, coreset_id, dl_bwp_id, N_RB, alt_size); + break; + case NR_RNTI_RA: + // we use the initial DL BWP + sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; + monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); + rel15->rnti = mac->ra.ra_rnti; + if (get_softmodem_params()->sa) { + rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; + rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; + } else { // NSA mode is not using the Initial BWP + rel15->BWPSize = current_DL_BWP->initial_BWPSize; + rel15->BWPStart = current_DL_BWP->BWPStart; + } + rel15->SubcarrierSpacing = current_DL_BWP->scs; + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, + &mac->def_dci_pdu_rel15[dci_format], + dci_format, NR_RNTI_RA, coreset_id, dl_bwp_id, N_RB, alt_size); + break; + case NR_RNTI_P: + break; + case NR_RNTI_CS: + break; + case NR_RNTI_TC: + // we use the initial DL BWP + sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; + monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); + rel15->rnti = mac->ra.t_crnti; + rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; + rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; + rel15->SubcarrierSpacing = current_DL_BWP->scs; + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, + mac->cg, &mac->def_dci_pdu_rel15[dci_format], + dci_format, NR_RNTI_TC, coreset_id, dl_bwp_id, N_RB, alt_size); + break; + case NR_RNTI_SP_CSI: + break; + case NR_RNTI_SI: + sps=14; + // for SPS=14 8 MSBs in positions 13 down to 6 + monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); + + rel15->rnti = SI_RNTI; // SI-RNTI - 3GPP TS 38.321 Table 7.1-1: RNTI values + rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; + rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; + + if(mac->frequency_range == FR1) + rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon; + else + rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon + 2; + + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, + &mac->def_dci_pdu_rel15[dci_format], + dci_format, NR_RNTI_SI, coreset_id, 0, mac->type0_PDCCH_CSS_config.num_rbs, alt_size); + break; + case NR_RNTI_SFI: + break; + case NR_RNTI_INT: + break; + case NR_RNTI_TPC_PUSCH: + break; + case NR_RNTI_TPC_PUCCH: + break; + case NR_RNTI_TPC_SRS: + break; + default: + break; + } } for (int i = 0; i < sps; i++) { if ((monitoringSymbolsWithinSlot >> (sps - 1 - i)) & 1) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index e2ba12380e..3b3c483ec0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -130,13 +130,6 @@ const initial_pucch_resource_t initial_pucch_resource[16] = { }; -static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, - uint8_t dci_format, - uint8_t dci_length, - uint16_t rnti, - uint64_t *dci_pdu, - dci_pdu_rel15_t *nr_pdci_info_extracted); - void nr_ue_init_mac(module_id_t module_idP) { int i; @@ -170,7 +163,7 @@ void nr_ue_init_mac(module_id_t module_idP) { for (i = 0; i < NR_MAX_NUM_LCID; i++) { LOG_D(NR_MAC, "[UE%d] Applying default logical channel config for LCGID %d\n", - module_idP, i); + module_idP, i); mac->scheduling_info.Bj[i] = -1; mac->scheduling_info.bucket_size[i] = -1; @@ -626,7 +619,7 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n", dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits); - int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15); + int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, dci->ss_type, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15); if ((ret&1) == 1) return -1; else if (ret == 2) { dci->dci_format = NR_UL_DCI_FORMAT_0_0; @@ -960,12 +953,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr nb_rb_oh, 0, 1); int bw_tbslbrm; - if (mac->scc || mac->scc_SIB || mac->cg) { - NR_BWP_t genericParameters = mac->scc ? mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters : - mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - int BWPSize = NRRIV2BW(genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - bw_tbslbrm = get_dlbw_tbslbrm(BWPSize, mac->cg); - } + if (current_DL_BWP->initial_BWPSize > 0) + bw_tbslbrm = get_dlbw_tbslbrm(current_DL_BWP->initial_BWPSize, mac->cg); else bw_tbslbrm = dlsch_config_pdu_1_0->BWPSize; dlsch_config_pdu_1_0->tbslbrm = nr_compute_tbslbrm(dlsch_config_pdu_1_0->mcs_table, @@ -1397,8 +1386,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr long *maxMIMO_Layers = mac->cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers; AssertFatal (maxMIMO_Layers != NULL,"Option with max MIMO layers not configured is not supported\n"); int nl_tbslbrm = *maxMIMO_Layers < 4 ? *maxMIMO_Layers : 4; - int BWPSize = current_DL_BWP->BWPSize; - int bw_tbslbrm = get_dlbw_tbslbrm(BWPSize, mac->cg); + int bw_tbslbrm = get_dlbw_tbslbrm(current_DL_BWP->initial_BWPSize, mac->cg); dlsch_config_pdu_1_1->tbslbrm = nr_compute_tbslbrm(dlsch_config_pdu_1_1->mcs_table, bw_tbslbrm, nl_tbslbrm); @@ -2805,65 +2793,39 @@ void nr_ue_send_sdu(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *u } -// N_RB configuration according to 7.3.1.0 (DCI size alignment) of TS 38.212 -int get_n_rb(NR_UE_MAC_INST_t *mac, int rnti_type){ - - int N_RB = 0, start_RB; - NR_BWP_Id_t dl_bwp_id = mac->current_DL_BWP.bwp_id; - switch(rnti_type) { - case NR_RNTI_RA: - case NR_RNTI_TC: - case NR_RNTI_P: { - if (mac->DLbwp[dl_bwp_id-1]->bwp_Common->pdcch_ConfigCommon->choice.setup->controlResourceSetZero) { - uint8_t coreset_id = 0; // assuming controlResourceSetId is 0 for controlResourceSetZero - NR_ControlResourceSet_t *coreset = mac->coreset[dl_bwp_id][coreset_id]; - get_coreset_rballoc(coreset->frequencyDomainResources.buf,&N_RB,&start_RB); - } else { - N_RB = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } - break; - } - case NR_RNTI_SI: - N_RB = mac->type0_PDCCH_CSS_config.num_rbs; - break; - case NR_RNTI_C: - N_RB = NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - break; - } - return N_RB; - -} - static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, - uint8_t dci_format, - uint8_t dci_size, - uint16_t rnti, - uint64_t *dci_pdu, - dci_pdu_rel15_t *dci_pdu_rel15) { + uint8_t dci_format, + uint8_t dci_size, + uint16_t rnti, + int ss_type, + uint64_t *dci_pdu, + dci_pdu_rel15_t *dci_pdu_rel15) +{ - int N_RB = 0; int pos = 0; int fsize = 0; - int rnti_type = get_rnti_type(mac, rnti); NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; - NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; - int N_RB_UL = current_UL_BWP->BWPSize; - + int N_RB; + if(current_DL_BWP) + N_RB = get_rb_bwp_dci(dci_format, + ss_type, + mac->type0_PDCCH_CSS_config.num_rbs, + current_UL_BWP->BWPSize, + current_DL_BWP->BWPSize, + current_UL_BWP->initial_BWPSize, + current_DL_BWP->initial_BWPSize); + else + N_RB = mac->type0_PDCCH_CSS_config.num_rbs; LOG_D(MAC,"nr_extract_dci_info : dci_pdu %lx, size %d\n",*dci_pdu,dci_size); switch(dci_format) { case NR_DL_DCI_FORMAT_1_0: switch(rnti_type) { case NR_RNTI_RA: - if(mac->scc_SIB) { - N_RB = mac->type0_PDCCH_CSS_config.num_rbs; - } else { - N_RB = get_n_rb(mac, rnti_type); - } // Freq domain assignment - fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + fsize = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); pos=fsize; dci_pdu_rel15->frequency_domain_assignment.val = *dci_pdu>>(dci_size-pos)&((1<format_indicator == 0) { dci_pdu_rel15 = &mac->def_dci_pdu_rel15[NR_UL_DCI_FORMAT_0_0]; - return 2+nr_extract_dci_info(mac, NR_UL_DCI_FORMAT_0_0, dci_size, rnti, dci_pdu, dci_pdu_rel15); + return 2+nr_extract_dci_info(mac, NR_UL_DCI_FORMAT_0_0, dci_size, rnti, ss_type, dci_pdu, dci_pdu_rel15); } #ifdef DEBUG_EXTRACT_DCI LOG_D(MAC,"Format indicator %d (%d bits) N_RB_BWP %d => %d (0x%lx)\n",dci_pdu_rel15->format_indicator,1,N_RB,dci_size-pos,*dci_pdu); #endif - N_RB = current_DL_BWP->BWPSize; - // Freq domain assignment (275rb >> fsize = 16) - fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + // Freq domain assignment (275rb >> fsize = 16) + fsize = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<type0_PDCCH_CSS_config.num_rbs; // Freq domain assignment 0-16 bit - fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + fsize = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<0 && mac->DLbwp[dl_bwp_id-1]) N_RB=NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - else N_RB=mac->type0_PDCCH_CSS_config.num_rbs; - - // indicating a DL DCI format 1bit pos++; dci_pdu_rel15->format_indicator = (*dci_pdu>>(dci_size-pos))&1; @@ -3103,14 +3058,14 @@ static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, //switch to DCI_0_0 if (dci_pdu_rel15->format_indicator == 0) { dci_pdu_rel15 = &mac->def_dci_pdu_rel15[NR_UL_DCI_FORMAT_0_0]; - return 2+nr_extract_dci_info(mac, NR_UL_DCI_FORMAT_0_0, dci_size, rnti, dci_pdu, dci_pdu_rel15); + return 2+nr_extract_dci_info(mac, NR_UL_DCI_FORMAT_0_0, dci_size, rnti, ss_type, dci_pdu, dci_pdu_rel15); } if (dci_pdu_rel15->format_indicator == 0) return 1; // discard dci, format indicator not corresponding to dci_format // Freq domain assignment 0-16 bit - fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); + fsize = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<bwp_indicator.val = (*dci_pdu>>(dci_size-pos))&((1<bwp_indicator.nbits)-1); // Freq domain assignment max 16 bit - fsize = (int)ceil( log2( (N_RB_UL*(N_RB_UL+1))>>1 ) ); + fsize = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1< 0 ? mac->ULbwp[ul_bwp_id - 1] : NULL; NR_BWP_UplinkDedicated_t *ibwp; - int scs,abwp_start,abwp_size,startSymbolAndLength,mappingtype; + int startSymbolAndLength,mappingtype; NR_PUSCH_Config_t *pusch_Config=NULL; if (mac->cg && ubwp && mac->cg->spCellConfig && @@ -587,22 +587,16 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, startSymbolAndLength = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->startSymbolAndLength; mappingtype = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->mappingType; - // active BWP start - abwp_start = NRRIV2PRBOFFSET(ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - abwp_size = NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - scs = ubwp->bwp_Common->genericParameters.subcarrierSpacing; } else { startSymbolAndLength = initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->startSymbolAndLength; mappingtype = initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[rar_grant->Msg3_t_alloc]->mappingType; - - // active BWP start - abwp_start = NRRIV2PRBOFFSET(initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - abwp_size = NRRIV2BW(initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - scs = initialUplinkBWP->genericParameters.subcarrierSpacing; } - int ibwp_start = NRRIV2PRBOFFSET(initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - int ibwp_size = NRRIV2BW(initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + int ibwp_start = current_UL_BWP->initial_BWPStart; + int ibwp_size = current_UL_BWP->initial_BWPSize; + int abwp_start = current_UL_BWP->BWPStart; + int abwp_size = current_UL_BWP->BWPSize; + int scs = current_UL_BWP->scs; // BWP start selection according to 8.3 of TS 38.213 if ((ibwp_start < abwp_start) || (ibwp_size > abwp_size)) { @@ -862,15 +856,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, if (!maxMIMO_Layers) maxMIMO_Layers = pusch_Config ? pusch_Config->maxRank : NULL; AssertFatal (maxMIMO_Layers != NULL,"Option with max MIMO layers not configured is not supported\n"); - int bw_tbslbrm; - if (mac->scc || mac->scc_SIB || mac->cg) { - NR_BWP_t genericParameters = initialUplinkBWP->genericParameters; - int BWPSize = NRRIV2BW(genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - bw_tbslbrm = get_ulbw_tbslbrm(BWPSize, mac->cg); - } - else { - bw_tbslbrm = pusch_config_pdu->bwp_size; - } + int bw_tbslbrm = get_ulbw_tbslbrm(current_UL_BWP->initial_BWPSize, mac->cg); pusch_config_pdu->tbslbrm = nr_compute_tbslbrm(pusch_config_pdu->mcs_table, bw_tbslbrm, *maxMIMO_Layers); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 35850a1a2d..0d9bb25291 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -731,8 +731,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t uint16_t *vrb_map_UL = &RC.nrmac[module_idP]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; - const int BWPSize = NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - const int BWPStart = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + const int BWPSize = ul_bwp->initial_BWPSize; + const int BWPStart = ul_bwp->initial_BWPStart; int rbStart = 0; for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) { @@ -830,17 +830,18 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ra->Msg3_tda_id, ra->msg3_TPC, 1, // Not toggling NDI in msg3 retransmissions - &ra->UL_BWP); + ul_bwp); fill_dci_pdu_rel15(scc, ra->CellGroup, &ra->DL_BWP, + ul_bwp, dci_pdu, &uldci_payload, NR_UL_DCI_FORMAT_0_0, NR_RNTI_TC, - pusch_pdu->bwp_size, ul_bwp->bwp_id, + ss, coreset, nr_mac->cset0_bwp_size); @@ -953,9 +954,8 @@ void nr_get_Msg3alloc(module_id_t module_id, uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[ra->Msg3_slot * MAX_BWP_SIZE]; - int bwpSize = NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - int bwpStart = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - + int bwpSize = ul_bwp->initial_BWPSize; + int bwpStart = ul_bwp->initial_BWPStart; if (bwpSize != ul_bwp->BWPSize || bwpStart != ul_bwp->BWPStart) { int act_bwp_start = ul_bwp->BWPStart; int act_bwp_size = ul_bwp->BWPSize; @@ -1104,7 +1104,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t nfapi_nr_pusch_pdu_t *pusch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pusch_pdu; memset(pusch_pdu, 0, sizeof(nfapi_nr_pusch_pdu_t)); - const int ibwp_size = NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + const int ibwp_size = ul_bwp->initial_BWPSize; const int scs = ul_bwp->scs; const int fh = (ul_bwp->pusch_Config && ul_bwp->pusch_Config->frequencyHopping) ? 1 : 0; const int startSymbolAndLength = ul_bwp->tdaList->list.array[ra->Msg3_tda_id]->startSymbolAndLength; @@ -1153,7 +1153,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = NULL; if(*ss->controlResourceSetId!=0) { BWPStart = dl_bwp->BWPStart; - BWPSize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + BWPSize = dl_bwp->initial_BWPSize; } else { type0_PDCCH_CSS_config = &nr_mac->type0_PDCCH_CSS_config[ra->beam_id]; BWPStart = type0_PDCCH_CSS_config->cset_start_rb; @@ -1290,8 +1290,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra pdsch_pdu_rel15->TBSize[0] = TBS; } - int scc_bwpsize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - int bw_tbslbrm = get_dlbw_tbslbrm(scc_bwpsize, ra->CellGroup); + int bw_tbslbrm = get_dlbw_tbslbrm(dl_bwp->initial_BWPSize, ra->CellGroup); pdsch_pdu_rel15->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(mcsTableIdx, bw_tbslbrm, 1); @@ -1345,12 +1344,13 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra fill_dci_pdu_rel15(scc, ra->CellGroup, dl_bwp, + &ra->UL_BWP, &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci - 1], &dci_payload, NR_DL_DCI_FORMAT_1_0, NR_RNTI_RA, - BWPSize, dl_bwp->bwp_id, + ss, coreset, nr_mac->cset0_bwp_size); @@ -1676,8 +1676,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int x_Overhead = 0; nr_get_tbs_dl(&dl_tti_pdsch_pdu->pdsch_pdu, x_Overhead, pdsch_pdu_rel15->numDmrsCdmGrpsNoData, tb_scaling); - int scc_bwpsize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - int bw_tbslbrm = get_dlbw_tbslbrm(scc_bwpsize, ra->CellGroup); + int bw_tbslbrm = get_dlbw_tbslbrm(dl_bwp->initial_BWPSize, ra->CellGroup); pdsch_pdu_rel15->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(mcsTableIdx, bw_tbslbrm, 1); @@ -1744,12 +1743,13 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra fill_dci_pdu_rel15(scc, ra->CellGroup, dl_bwp, + &ra->UL_BWP, &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci - 1], &dci_payload, NR_DL_DCI_FORMAT_1_0, NR_RNTI_TC, - pdsch_pdu_rel15->BWPSize, dl_bwp->bwp_id, + ss, coreset, nr_mac->cset0_bwp_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 0438070da3..dc2467e904 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -494,14 +494,15 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, int rnti_type = NR_RNTI_SI; fill_dci_pdu_rel15(scc, + NULL, NULL, NULL, &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci - 1], &dci_payload, dci_format, rnti_type, - pdsch_pdu_rel15->BWPSize, 0, + gNB_mac->sched_ctrlCommon->search_space, gNB_mac->sched_ctrlCommon->coreset, gNB_mac->cset0_bwp_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index c400a8ac13..d5b2b79036 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1012,7 +1012,7 @@ void nr_schedule_ue_spec(module_id_t module_id, long maxMIMO_Layers = current_BWP->pdsch_servingcellconfig ? *current_BWP->pdsch_servingcellconfig->ext1->maxMIMO_Layers : 1; const int nl_tbslbrm = min(maxMIMO_Layers, 4); // Maximum number of PRBs across all configured DL BWPs - int scc_bwpsize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + int scc_bwpsize = current_BWP->initial_BWPSize; int bw_tbslbrm = get_dlbw_tbslbrm(scc_bwpsize, cg); pdsch_pdu->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(current_BWP->mcsTableIdx, bw_tbslbrm, @@ -1110,12 +1110,13 @@ void nr_schedule_ue_spec(module_id_t module_id, fill_dci_pdu_rel15(scc, cg, current_BWP, + &UE->current_UL_BWP, dci_pdu, &dci_payload, current_BWP->dci_format, rnti_type, - pdsch_pdu->BWPSize, bwp_id, + sched_ctrl->search_space, sched_ctrl->coreset, gNB_mac->cset0_bwp_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index da84ccd18f..2ce7877eb7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -55,130 +55,6 @@ extern RAN_CONTEXT_t RC; //#define ENABLE_MAC_PAYLOAD_DEBUG 1 -/*Scheduling of DLSCH with associated DCI in common search space - * current version has only a DCI for type 1 PDCCH for C_RNTI*/ -void nr_schedule_css_dlsch_phytest(module_id_t module_idP, - frame_t frameP, - sub_frame_t slotP) { - uint8_t CC_id; - gNB_MAC_INST *nr_mac = RC.nrmac[module_idP]; - NR_COMMON_channels_t *cc = &nr_mac->common_channels[0]; - nfapi_nr_dl_tti_request_body_t *dl_req; - nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu; - nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu; - nfapi_nr_pdu_t *TX_req; - - uint16_t rnti = 0x1234; - // int time_domain_assignment,k0; - - NR_ServingCellConfigCommon_t *scc=cc->ServingCellConfigCommon; - - int dlBWP_carrier_bandwidth = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - - - /* - int scs = scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing; - - int slots_per_frame = 10*(1<downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257 ? nr_FR2 : nr_FR1; - */ - - for (CC_id=0; CC_iddownlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE)); - - - dl_req = &nr_mac->DL_req[CC_id].dl_tti_request_body; - dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; - memset((void*)dl_tti_pdcch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); - dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE; - dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); - - dl_tti_pdsch_pdu = &nr_mac->DL_req[CC_id].dl_tti_request_body.dl_tti_pdu_list[nr_mac->DL_req[CC_id].dl_tti_request_body.nPDUs+1]; - memset((void *)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); - dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE; - dl_tti_pdsch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdsch_pdu)); - - - // nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; - - pdsch_pdu_rel15->pduBitmap = 0; - pdsch_pdu_rel15->rnti = rnti; - pdsch_pdu_rel15->pduIndex = 0; - - // BWP - pdsch_pdu_rel15->BWPSize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - pdsch_pdu_rel15->BWPStart = NRRIV2PRBOFFSET(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - pdsch_pdu_rel15->SubcarrierSpacing = scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing; - pdsch_pdu_rel15->CyclicPrefix = 0; - pdsch_pdu_rel15->NrOfCodewords = 1; - int mcsIndex = 9; - pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcsIndex,0); - pdsch_pdu_rel15->qamModOrder[0] = 2; - pdsch_pdu_rel15->mcsIndex[0] = mcsIndex; - pdsch_pdu_rel15->mcsTable[0] = 0; - pdsch_pdu_rel15->rvIndex[0] = 0; - pdsch_pdu_rel15->dataScramblingId = *scc->physCellId; - pdsch_pdu_rel15->nrOfLayers = 1; - pdsch_pdu_rel15->transmissionScheme = 0; - pdsch_pdu_rel15->refPoint = 0; // Point A - - pdsch_pdu_rel15->dmrsConfigType = 0; // Type 1 by default for InitialBWP - pdsch_pdu_rel15->dlDmrsScramblingId = *scc->physCellId; - pdsch_pdu_rel15->SCID = 0; - pdsch_pdu_rel15->numDmrsCdmGrpsNoData = 1; - pdsch_pdu_rel15->dmrsPorts = 1; - pdsch_pdu_rel15->resourceAlloc = 1; - pdsch_pdu_rel15->rbStart = 0; - pdsch_pdu_rel15->rbSize = 6; - pdsch_pdu_rel15->VRBtoPRBMapping = 1; // non-interleaved, check if this is ok for initialBWP - // choose shortest PDSCH - int startSymbolAndLength=0; - int StartSymbolIndex=-1,NrOfSymbols=14; - int StartSymbolIndex_tmp,NrOfSymbols_tmp; - int mappingtype_tmp, mappingtype=0; - - for (int i=0; - idownlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count; - i++) { - startSymbolAndLength = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; - SLIV2SL(startSymbolAndLength,&StartSymbolIndex_tmp,&NrOfSymbols_tmp); - mappingtype_tmp = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType; - if (NrOfSymbols_tmp < NrOfSymbols) { - NrOfSymbols = NrOfSymbols_tmp; - StartSymbolIndex = StartSymbolIndex_tmp; - mappingtype = mappingtype_tmp; - } - } - AssertFatal(StartSymbolIndex>=0,"StartSymbolIndex is negative\n"); - pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; - pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; - pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, - scc->dmrs_TypeA_Position, - NrOfSymbols, - StartSymbolIndex, - mappingtype, - 1); - - nr_mac->DL_req[CC_id].dl_tti_request_body.nPDUs+=2; - - TX_req = &nr_mac->TX_req[CC_id].pdu_list[nr_mac->TX_req[CC_id].Number_of_PDUs]; - TX_req->PDU_length = 6; - TX_req->PDU_index = nr_mac->pdu_index[CC_id]++; - TX_req->num_TLV = 1; - TX_req->TLVs[0].length = 8; - // why do we copy from RAR_pdu here? Shouldn't we fill some more or less - // meaningful data, e.g., padding + random data? - //memcpy((void *)&TX_req->TLVs[0].value.direct[0], (void *)&cc[CC_id].RAR_pdu[0].payload[0], TX_req->TLVs[0].length); - nr_mac->TX_req[CC_id].Number_of_PDUs++; - nr_mac->TX_req[CC_id].SFN=frameP; - nr_mac->TX_req[CC_id].Slot=slotP; - } -} - uint32_t target_dl_mcs = 9; uint32_t target_dl_Nl = 1; uint32_t target_dl_bw = 50; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 403ae15df7..5e8e0f3709 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1384,28 +1384,71 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup, void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *CellGroup, - const NR_UE_DL_BWP_t *current_BWP, + const NR_UE_DL_BWP_t *current_DL_BWP, + const NR_UE_UL_BWP_t *current_UL_BWP, nfapi_nr_dl_dci_pdu_t *pdcch_dci_pdu, dci_pdu_rel15_t *dci_pdu_rel15, int dci_format, int rnti_type, - int N_RB, int bwp_id, + NR_SearchSpace_t *ss, NR_ControlResourceSet_t *coreset, - uint16_t cset0_bwp_size) { - uint8_t fsize = 0, pos = 0; + uint16_t cset0_bwp_size) +{ + uint8_t fsize = 0, pos = 0; uint64_t *dci_pdu = (uint64_t *)pdcch_dci_pdu->Payload; - *dci_pdu=0; - NR_ControlResourceSetId_t coreset_id = coreset->controlResourceSetId; + *dci_pdu = 0; + uint16_t alt_size = 0; + uint16_t N_RB; + const int controlResourceSetId = *ss->controlResourceSetId; + if(current_DL_BWP) { + N_RB = get_rb_bwp_dci(dci_format, + ss->searchSpaceType->present, + cset0_bwp_size, + current_UL_BWP->BWPSize, + current_DL_BWP->BWPSize, + current_UL_BWP->initial_BWPSize, + current_DL_BWP->initial_BWPSize); + + // computing alternative size for padding + uint16_t alt_rb; + dci_pdu_rel15_t temp_pdu; + if(dci_format == NR_DL_DCI_FORMAT_1_0) { + alt_rb = get_rb_bwp_dci(NR_UL_DCI_FORMAT_0_0, + ss->searchSpaceType->present, + cset0_bwp_size, + current_UL_BWP->BWPSize, + current_DL_BWP->BWPSize, + current_UL_BWP->initial_BWPSize, + current_DL_BWP->initial_BWPSize); + alt_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP, + scc->uplinkConfigCommon->initialUplinkBWP, + CellGroup, &temp_pdu, NR_UL_DCI_FORMAT_0_0, rnti_type, controlResourceSetId, bwp_id, alt_rb, 0); + + } + if(dci_format == NR_UL_DCI_FORMAT_0_0) { + alt_rb = get_rb_bwp_dci(NR_DL_DCI_FORMAT_1_0, + ss->searchSpaceType->present, + cset0_bwp_size, + current_UL_BWP->BWPSize, + current_DL_BWP->BWPSize, + current_UL_BWP->initial_BWPSize, + current_DL_BWP->initial_BWPSize); + alt_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP, + scc->uplinkConfigCommon->initialUplinkBWP, + CellGroup, &temp_pdu, NR_DL_DCI_FORMAT_1_0, rnti_type, controlResourceSetId, bwp_id, alt_rb, 0); + } + } + else + N_RB = cset0_bwp_size; int dci_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP, scc->uplinkConfigCommon->initialUplinkBWP, - CellGroup, dci_pdu_rel15, dci_format, - rnti_type, N_RB, bwp_id, coreset_id, cset0_bwp_size); + CellGroup, dci_pdu_rel15, dci_format, rnti_type, controlResourceSetId, bwp_id, N_RB, alt_size); pdcch_dci_pdu->PayloadSizeBits = dci_size; AssertFatal(dci_size <= 64, "DCI sizes above 64 bits not yet supported"); if (dci_format == NR_DL_DCI_FORMAT_1_1 || dci_format == NR_UL_DCI_FORMAT_0_1) - prepare_dci(CellGroup, current_BWP, coreset, dci_pdu_rel15, dci_format); + prepare_dci(CellGroup, current_DL_BWP, coreset, dci_pdu_rel15, dci_format); /// Payload generation switch (dci_format) { @@ -2389,7 +2432,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, UL_BWP->tdaList = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; // setting generic parameters - NR_BWP_t dl_genericParameters = (DL_BWP->bwp_id>0 && dl_bwp) ? + NR_BWP_t dl_genericParameters = (DL_BWP->bwp_id > 0 && dl_bwp) ? dl_bwp->bwp_Common->genericParameters: scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; @@ -2397,8 +2440,10 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, DL_BWP->cyclicprefix = dl_genericParameters.cyclicPrefix; DL_BWP->BWPSize = NRRIV2BW(dl_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); DL_BWP->BWPStart = NRRIV2PRBOFFSET(dl_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->initial_BWPSize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->initial_BWPStart = NRRIV2PRBOFFSET(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - NR_BWP_t ul_genericParameters = (UL_BWP->bwp_id>0 && ul_bwp) ? + NR_BWP_t ul_genericParameters = (UL_BWP->bwp_id > 0 && ul_bwp) ? ul_bwp->bwp_Common->genericParameters: scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; @@ -2406,6 +2451,8 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, UL_BWP->cyclicprefix = ul_genericParameters.cyclicPrefix; UL_BWP->BWPSize = NRRIV2BW(ul_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); UL_BWP->BWPStart = NRRIV2PRBOFFSET(ul_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->initial_BWPSize = NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->initial_BWPStart = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); // Set downlink MCS table if (DL_BWP->pdsch_Config && diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0d25e160fa..e1c47559b8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -263,7 +263,7 @@ int nr_process_mac_pdu(instance_t module_idP, // in sched_ctrl we set normalized PH wrt MCS and PRBs long *deltaMCS = ul_bwp->pusch_Config ? ul_bwp->pusch_Config->pusch_PowerControl->deltaMCS : NULL; sched_ctrl->ph = PH + - compute_ph_factor(sched_pusch->mu, + compute_ph_factor(ul_bwp->scs, sched_pusch->tb_size<<3, sched_pusch->rbSize, sched_pusch->nrOfLayers, @@ -1757,7 +1757,6 @@ void pf_ul(module_id_t module_id, /* Calculate the current scheduling bytes */ const int B = cmax(sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes, 0); /* adjust rbSize and MCS according to PHR and BPRE */ - sched_pusch->mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; if(sched_ctrl->pcmax!=0 || sched_ctrl->ph!=0) // verify if the PHR related parameter have been initialized nr_ue_max_mcs_min_rb(current_BWP->scs, sched_ctrl->ph, sched_pusch, current_BWP, min_rb, B, &max_rbSize, &sched_pusch->mcs); @@ -2162,7 +2161,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) if (!maxMIMO_Layers) maxMIMO_Layers = current_BWP->pusch_Config->maxRank; AssertFatal (maxMIMO_Layers != NULL,"Option with max MIMO layers not configured is not supported\n"); - const int scc_bwpsize = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + const int scc_bwpsize = current_BWP->initial_BWPSize; int bw_tbslbrm = get_ulbw_tbslbrm(scc_bwpsize, cg); pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(current_BWP->mcs_table, bw_tbslbrm, @@ -2260,12 +2259,13 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) fill_dci_pdu_rel15(scc, cg, &UE->current_DL_BWP, + current_BWP, dci_pdu, &uldci_payload, current_BWP->dci_format, rnti_types[0], - pusch_pdu->bwp_size, current_BWP->bwp_id, + ss, coreset, nr_mac->cset0_bwp_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index fc569c4eee..93180a7937 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -171,10 +171,6 @@ void nr_preprocessor_phytest(module_id_t module_id, * fixed set of resources */ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_t slot); -void nr_schedule_css_dlsch_phytest(module_id_t module_idP, - frame_t frameP, - sub_frame_t subframeP); - void handle_nr_uci_pucch_0_1(module_id_t mod_id, frame_t frame, sub_frame_t slot, @@ -289,13 +285,14 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac, void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *CellGroup, - const NR_UE_DL_BWP_t *dl_bwp, + const NR_UE_DL_BWP_t *current_DL_BWP, + const NR_UE_UL_BWP_t *current_UL_BWP, nfapi_nr_dl_dci_pdu_t *pdcch_dci_pdu, dci_pdu_rel15_t *dci_pdu_rel15, - int dci_formats, - int rnti_types, - int N_RB, + int dci_format, + int rnti_type, int bwp_id, + NR_SearchSpace_t *ss, NR_ControlResourceSet_t *coreset, uint16_t cset0_bwp_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 27cf3fb1a2..7697d74808 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -99,6 +99,8 @@ typedef struct NR_UE_DL_BWP { long *cyclicprefix; uint16_t BWPSize; uint16_t BWPStart; + uint16_t initial_BWPSize; + uint16_t initial_BWPStart; NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList; NR_PDSCH_Config_t *pdsch_Config; NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig; @@ -113,6 +115,8 @@ typedef struct NR_UE_UL_BWP { long *cyclicprefix; uint16_t BWPSize; uint16_t BWPStart; + uint16_t initial_BWPSize; + uint16_t initial_BWPStart; NR_PUSCH_ServingCellConfig_t *pusch_servingcellconfig; NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList; NR_PUSCH_Config_t *pusch_Config; From 5300c57f3d888e795dafc283eefbc686351bed24 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 27 Dec 2022 18:07:39 +0100 Subject: [PATCH 16/39] common BWP structure and further improvements --- common/utils/nr/nr_common.h | 4 +- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 + openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 3 + openair1/PHY/defs_nr_common.h | 7 -- openair1/PHY/impl_defs_nr.h | 5 -- openair1/PHY/impl_defs_top.h | 3 +- openair1/SCHED_NR_UE/harq_nr.h | 9 -- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 44 ++++++++- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 32 ++++--- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 10 ++- openair2/LAYER2/NR_MAC_UE/config_ue.c | 40 +++++---- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 31 ++----- openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 2 +- .../NR_MAC_UE/nr_ue_dci_configuration.c | 89 ++++++------------- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 81 ++++++++--------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 13 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 35 +++----- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 38 -------- 19 files changed, 189 insertions(+), 261 deletions(-) diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 8cd210dec8..db0802a205 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -37,7 +37,9 @@ #include "assertions.h" #include "PHY/defs_common.h" -#define MAX_BWP_SIZE 275 +#define MAX_BWP_SIZE 275 +#define NR_MAX_NUM_BWP 4 +#define NR_MAX_HARQ_PROCESSES 16 typedef struct nr_bandentry_s { int16_t band; diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index ebfb2becb0..0ddc0986bd 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -22,6 +22,7 @@ #include "platform_types.h" #include "fapi_nr_ue_constants.h" #include "PHY/impl_defs_nr.h" +#include "common/utils/nr/nr_common.h" #define NFAPI_UE_MAX_NUM_CB 8 #define NFAPI_MAX_NUM_UL_PDU 255 @@ -91,6 +92,7 @@ typedef struct { int n_CCE; // N_CCE is L, or number of CCEs for DCI int N_CCE; + int cset_start; uint8_t payloadSize; uint8_t payloadBits[16] __attribute__((aligned(16))); // will be cast as uint64 } fapi_nr_dci_indication_pdu_t; diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 658b440c21..5293d13f90 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -936,6 +936,9 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, dci_ind->dci_list[dci_ind->number_of_dcis].N_CCE = L; dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k]; dci_ind->dci_list[dci_ind->number_of_dcis].ss_type = rel15->dci_type_options[k]; + int n_rb, rb_offset; + get_coreset_rballoc(rel15->coreset.frequency_domain_resource, &n_rb, &rb_offset); + dci_ind->dci_list[dci_ind->number_of_dcis].cset_start = rel15->BWPStart + rb_offset; dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length; memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8); dci_ind->number_of_dcis++; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index fe0397970b..a73ce9b4c4 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -80,8 +80,6 @@ #define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE) #define NR_MAX_DCI_SIZE_DWORD 54 // ceil(NR_MAX_DCI_SIZE/32) -#define NR_MAX_NUM_BWP 4 - #define NR_MAX_PDCCH_AGG_LEVEL 16 // 3GPP TS 38.211 V15.8 Section 7.3.2 Table 7.3.2.1-1: Supported PDCCH aggregation levels #define NR_MAX_CSET_DURATION 3 @@ -158,11 +156,6 @@ typedef enum { MOD_QAM256 }nr_mod_t; -typedef enum { - RA_2STEP = 0, - RA_4STEP -} nr_ra_type_e; - typedef struct { /// Size of first RBG uint8_t start_size; diff --git a/openair1/PHY/impl_defs_nr.h b/openair1/PHY/impl_defs_nr.h index 6db54684e6..8dcb383892 100644 --- a/openair1/PHY/impl_defs_nr.h +++ b/openair1/PHY/impl_defs_nr.h @@ -364,11 +364,6 @@ typedef enum { pusch_dmrs_type2 = 1 } pusch_dmrs_type_t; -typedef enum { - pusch_len1 = 1, - pusch_len2 = 2 -} pusch_maxLength_t; - typedef enum { txConfig_codebook = 1, txConfig_nonCodebook = 2 diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index e082db54fb..6afbd1bf2b 100644 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -107,6 +107,7 @@ * @} */ +#include #include #include "defs_eNB.h" #include "types.h" @@ -277,8 +278,6 @@ #define DURATION_RX_TO_TX (6) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */ #endif - -#define NR_MAX_HARQ_PROCESSES (16) #define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 6.1 UE procedure for receiving the physical uplink shared channel */ #define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 5.1 UE procedure for receiving the physical downlink shared channel */ #endif diff --git a/openair1/SCHED_NR_UE/harq_nr.h b/openair1/SCHED_NR_UE/harq_nr.h index f640d0f7be..9ecdb4a8c9 100644 --- a/openair1/SCHED_NR_UE/harq_nr.h +++ b/openair1/SCHED_NR_UE/harq_nr.h @@ -35,15 +35,6 @@ /************** DEFINE ********************************************/ -#if 0 - -/* these define are in file PHY/impl_defs_top.h" because of compilation problems due to multiple header files inclusions */ -#define NR_MAX_HARQ_PROCESSES (16) -#define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* TS 38.214 6.1 UE procedure for receiving the physical uplink shared channel */ -#define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* TS 38.214 5.1 UE procedure for receiving the physical downlink shared channel */ - -#endif - #define NR_DEFAULT_DLSCH_HARQ_PROCESSES (8) /* TS 38.214 5.1 */ #define DL_ACKNACK_NO_SET (2) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index 1f98723deb..fec7e90178 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -37,10 +37,8 @@ #include #include #include - -#include "NR_SubcarrierSpacing.h" -#include "NR_CSI-ReportConfig.h" -#include "openair1/SCHED_NR_UE/harq_nr.h" +#include "common/utils/nr/nr_common.h" +#include "NR_CellGroupConfig.h" #define NR_SHORT_BSR_TABLE_SIZE 32 #define NR_LONG_BSR_TABLE_SIZE 256 @@ -567,5 +565,43 @@ typedef struct nr_srs_feedback { uint8_t tpmi; } nr_srs_feedback_t; +typedef struct NR_UE_DL_BWP { + NR_BWP_Id_t bwp_id; + int n_dl_bwp; + int scs; + long *cyclicprefix; + uint16_t BWPSize; + uint16_t BWPStart; + uint16_t initial_BWPSize; + uint16_t initial_BWPStart; + NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList; + NR_PDSCH_Config_t *pdsch_Config; + NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig; + uint8_t mcsTableIdx; + nr_dci_format_t dci_format; +} NR_UE_DL_BWP_t; + +typedef struct NR_UE_UL_BWP { + NR_BWP_Id_t bwp_id; + int n_ul_bwp; + int scs; + long *cyclicprefix; + uint16_t BWPSize; + uint16_t BWPStart; + uint16_t initial_BWPSize; + uint16_t initial_BWPStart; + NR_PUSCH_ServingCellConfig_t *pusch_servingcellconfig; + NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList; + NR_PUSCH_Config_t *pusch_Config; + NR_PUCCH_Config_t *pucch_Config; + NR_PUCCH_ConfigCommon_t *pucch_ConfigCommon; + NR_CSI_MeasConfig_t *csi_MeasConfig; + NR_SRS_Config_t *srs_Config; + uint8_t transform_precoding; + uint8_t mcs_table; + nr_dci_format_t dci_format; + int max_fb_time; +} NR_UE_UL_BWP_t; + #endif /*__LAYER2_MAC_H__ */ diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 713679c4e3..8ddb01a053 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -3157,13 +3157,16 @@ uint16_t get_rb_bwp_dci(nr_dci_format_t format, uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, const NR_BWP_UplinkCommon_t *initialUplinkBWP, + const NR_UE_DL_BWP_t *DL_BWP, + const NR_UE_UL_BWP_t *UL_BWP, const NR_CellGroupConfig_t *cg, dci_pdu_rel15_t *dci_pdu, nr_dci_format_t format, nr_rnti_type_t rnti_type, int controlResourceSetId, int bwp_id, - uint16_t N_RB, + int ss_type, + uint16_t cset0_bwp_size, uint16_t alt_size) { @@ -3210,6 +3213,16 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, srs_config = (ubwpd && ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup: NULL; } + uint16_t N_RB = cset0_bwp_size; + if (DL_BWP) + N_RB = get_rb_bwp_dci(format, + ss_type, + cset0_bwp_size, + UL_BWP->BWPSize, + DL_BWP->BWPSize, + UL_BWP->initial_BWPSize, + DL_BWP->initial_BWPSize); + int n_ul_bwp = 1,n_dl_bwp = 1; switch(format) { case NR_UL_DCI_FORMAT_0_0: @@ -3219,7 +3232,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, size += dci_pdu->frequency_domain_assignment.nbits; if(alt_size >= size) size += alt_size - size; // Padding to match 1_0 size - else { + else if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { dci_pdu->frequency_domain_assignment.nbits -= (size - alt_size); size = alt_size; } @@ -3255,9 +3268,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, rbg_size_config = 1; else rbg_size_config = 0; - numRBG = getNRBG(NRRIV2BW(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE), - NRRIV2PRBOFFSET(ubwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE), - rbg_size_config); + numRBG = getNRBG(UL_BWP->BWPSize, UL_BWP->BWPStart, rbg_size_config); if (pusch_Config->resourceAllocation == 0) dci_pdu->frequency_domain_assignment.nbits = numRBG; else if (pusch_Config->resourceAllocation == 1) @@ -3383,9 +3394,10 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, // Size of DCI format 1_0 is given by the size of CORESET 0 if CORESET 0 is configured for the cell and the size // of initial DL bandwidth part if CORESET 0 is not configured for the cell size = 28; - size += (uint8_t)ceil(log2((N_RB * (N_RB + 1)) >> 1)); // Freq domain assignment - - dci_pdu->frequency_domain_assignment.nbits = (int)ceil(log2((N_RB * (N_RB + 1)) >> 1)); + dci_pdu->frequency_domain_assignment.nbits = (uint8_t)ceil(log2((N_RB * (N_RB + 1)) >> 1)); // Freq domain assignment + size += dci_pdu->frequency_domain_assignment.nbits; + if(ss_type == NR_SearchSpace__searchSpaceType_PR_ue_Specific && alt_size >= size) + size += alt_size - size; // Padding to match 0_0 size dci_pdu->time_domain_assignment.nbits = 4; dci_pdu->vrb_to_prb_mapping.nbits = 1; break; @@ -3414,9 +3426,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, if (pdsch_Config) rbg_size_config = pdsch_Config->rbg_Size; else rbg_size_config = 0; - numRBG = getNRBG(NRRIV2BW(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE), - NRRIV2PRBOFFSET(bwpc->genericParameters.locationAndBandwidth, MAX_BWP_SIZE), - rbg_size_config); + numRBG = getNRBG(DL_BWP->BWPSize, DL_BWP->BWPStart, rbg_size_config); if (pdsch_Config && pdsch_Config->resourceAllocation == 0) dci_pdu->frequency_domain_assignment.nbits = numRBG; else if (pdsch_Config == NULL || pdsch_Config->resourceAllocation == 1) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 06251fefb7..9b98ed82f5 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -43,6 +43,11 @@ typedef enum { pusch_dmrs_pos3 = 3, } pusch_dmrs_AdditionalPosition_t; +typedef enum { + pusch_len1 = 1, + pusch_len2 = 2 +} pusch_maxLength_t; + typedef enum { typeA = 0, typeB = 1 @@ -77,13 +82,16 @@ uint8_t compute_precoding_information(NR_PUSCH_Config_t *pusch_Config, uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, const NR_BWP_UplinkCommon_t *initialUplinkBWP, + const NR_UE_DL_BWP_t *DL_BWP, + const NR_UE_UL_BWP_t *UL_BWP, const NR_CellGroupConfig_t *cg, dci_pdu_rel15_t *dci_pdu, nr_dci_format_t format, nr_rnti_type_t rnti_type, int controlResourceSetId, int bwp_id, - uint16_t N_RB, + int ss_type, + uint16_t cset0_bwp_size, uint16_t alt_size); uint16_t get_rb_bwp_dci(nr_dci_format_t format, diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 4b4c92e406..ac48e17b62 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -543,17 +543,19 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommonSIB_t *scc, NR_CellGroupConfig_t *cell_group_config) { - NR_DL_BWP_t *DL_BWP = &mac->current_DL_BWP; - NR_UL_BWP_t *UL_BWP = &mac->current_UL_BWP; + NR_UE_DL_BWP_t *DL_BWP = &mac->current_DL_BWP; + NR_UE_UL_BWP_t *UL_BWP = &mac->current_UL_BWP; + NR_BWP_t dl_genericParameters = {0}; + NR_BWP_t ul_genericParameters = {0}; if(scc) { DL_BWP->bwp_id = 0; UL_BWP->bwp_id = 0; - DL_BWP->genericParameters = scc->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + dl_genericParameters = scc->downlinkConfigCommon.initialDownlinkBWP.genericParameters; if(scc->uplinkConfigCommon) - UL_BWP->genericParameters = scc->uplinkConfigCommon->initialUplinkBWP.genericParameters; + ul_genericParameters = scc->uplinkConfigCommon->initialUplinkBWP.genericParameters; else - UL_BWP->genericParameters = scc->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + ul_genericParameters = scc->downlinkConfigCommon.initialDownlinkBWP.genericParameters; } if(cell_group_config) { if (cell_group_config->spCellConfig && @@ -573,14 +575,14 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, break; } AssertFatal(bwp_downlink != NULL,"Couldn't find DLBWP corresponding to BWP ID %ld\n", DL_BWP->bwp_id); - DL_BWP->genericParameters = bwp_downlink->bwp_Common->genericParameters; + dl_genericParameters = bwp_downlink->bwp_Common->genericParameters; } else { if(mac->scc) { - DL_BWP->genericParameters = mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + dl_genericParameters = mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } if(mac->scc_SIB) { - DL_BWP->genericParameters = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + dl_genericParameters = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; } } NR_BWP_Uplink_t *bwp_uplink = NULL; @@ -592,14 +594,14 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, break; } AssertFatal(bwp_uplink != NULL,"Couldn't find ULBWP corresponding to BWP ID %ld\n",UL_BWP->bwp_id); - UL_BWP->genericParameters = bwp_uplink->bwp_Common->genericParameters; + ul_genericParameters = bwp_uplink->bwp_Common->genericParameters; } else { if(mac->scc) { - UL_BWP->genericParameters = mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + ul_genericParameters = mac->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; } if(mac->scc_SIB) { - UL_BWP->genericParameters = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters; + ul_genericParameters = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters; } } } @@ -607,14 +609,14 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac, AssertFatal(1==0,"We shouldn't end here in configuring BWP\n"); } - DL_BWP->scs = DL_BWP->genericParameters.subcarrierSpacing; - DL_BWP->cyclicprefix = DL_BWP->genericParameters.cyclicPrefix; - DL_BWP->BWPSize = NRRIV2BW(DL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - DL_BWP->BWPStart = NRRIV2PRBOFFSET(DL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - UL_BWP->scs = UL_BWP->genericParameters.subcarrierSpacing; - UL_BWP->cyclicprefix = UL_BWP->genericParameters.cyclicPrefix; - UL_BWP->BWPSize = NRRIV2BW(UL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - UL_BWP->BWPStart = NRRIV2PRBOFFSET(UL_BWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->scs = dl_genericParameters.subcarrierSpacing; + DL_BWP->cyclicprefix = dl_genericParameters.cyclicPrefix; + DL_BWP->BWPSize = NRRIV2BW(dl_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + DL_BWP->BWPStart = NRRIV2PRBOFFSET(dl_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->scs = ul_genericParameters.subcarrierSpacing; + UL_BWP->cyclicprefix = ul_genericParameters.cyclicPrefix; + UL_BWP->BWPSize = NRRIV2BW(ul_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + UL_BWP->BWPStart = NRRIV2PRBOFFSET(ul_genericParameters.locationAndBandwidth, MAX_BWP_SIZE); DL_BWP->initial_BWPSize = mac->scc ? NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) : NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index b3a3915993..66397b20a3 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -164,6 +164,11 @@ typedef enum { UE_PHY_HO_PRACH } NR_UE_L2_STATE_t; +typedef enum { + RA_2STEP = 0, + RA_4STEP +} nr_ra_type_e; + // LTE structure, might need to be adapted for NR typedef struct { /// buffer status for each lcgid @@ -372,28 +377,6 @@ typedef struct { } NR_PHY_meas_t; -typedef struct NR_DL_BWP { - NR_BWP_Id_t bwp_id; - NR_BWP_t genericParameters; - int scs; - long *cyclicprefix; - uint16_t initial_BWPSize; - uint16_t initial_BWPStart; - uint16_t BWPSize; - uint16_t BWPStart; -} NR_DL_BWP_t; - -typedef struct NR_UL_BWP { - NR_BWP_Id_t bwp_id; - NR_BWP_t genericParameters; - int scs; - long *cyclicprefix; - uint16_t initial_BWPSize; - uint16_t initial_BWPStart; - uint16_t BWPSize; - uint16_t BWPStart; -} NR_UL_BWP_t; - /*!\brief Top level UE MAC structure */ typedef struct { @@ -414,8 +397,8 @@ typedef struct { NR_RNTI_Value_t *cs_RNTI; NR_MIB_t *mib; - NR_DL_BWP_t current_DL_BWP; - NR_UL_BWP_t current_UL_BWP; + NR_UE_DL_BWP_t current_DL_BWP; + NR_UE_UL_BWP_t current_UL_BWP; NR_BWP_Downlink_t *DLbwp[MAX_NUM_BWP_UE]; NR_BWP_Uplink_t *ULbwp[MAX_NUM_BWP_UE]; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index d63c08dc8e..e4bbb546d8 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -815,7 +815,7 @@ uint8_t nr_ue_get_rach(module_id_t mod_id, } else if (get_softmodem_params()->nsa) { - uint8_t mac_sdus[MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*1056]; + uint8_t mac_sdus[34*1056]; uint16_t sdu_lengths[NB_RB_MAX] = {0}; int TBS_bytes = 848; int mac_ce_len = 0; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 0670c1cff0..2815a42c16 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -95,9 +95,9 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t AssertFatal(mac->scc == NULL || mac->scc_SIB == NULL, "both scc and scc_SIB cannot be non-null\n"); - NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; - NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; + NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_BWP_Id_t dl_bwp_id = current_DL_BWP ? current_DL_BWP->bwp_id : 0; NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommonSIB_t *scc_SIB = mac->scc_SIB; NR_BWP_DownlinkCommon_t *initialDownlinkBWP=NULL; @@ -164,50 +164,37 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t rel15->coreset.scrambling_rnti = 0; } // loop over RNTI type and configure resource allocation for DCI - int N_RB; for (int i = 0; i < rel15->num_dci_options; i++) { rel15->dci_type_options[i] = ss->searchSpaceType->present; const int dci_format = rel15->dci_format_options[i]; uint16_t alt_size = 0; if(current_DL_BWP) { - N_RB = get_rb_bwp_dci(dci_format, - ss->searchSpaceType->present, - mac->type0_PDCCH_CSS_config.num_rbs, - current_UL_BWP->BWPSize, - current_DL_BWP->BWPSize, - current_UL_BWP->initial_BWPSize, - current_DL_BWP->initial_BWPSize); // computing alternative size for padding - uint16_t alt_rb; dci_pdu_rel15_t temp_pdu; - if(dci_format == NR_DL_DCI_FORMAT_1_0) { - alt_rb = get_rb_bwp_dci(NR_UL_DCI_FORMAT_0_0, - ss->searchSpaceType->present, - mac->type0_PDCCH_CSS_config.num_rbs, - current_UL_BWP->BWPSize, - current_DL_BWP->BWPSize, - current_UL_BWP->initial_BWPSize, - current_DL_BWP->initial_BWPSize); - - alt_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &temp_pdu, - NR_UL_DCI_FORMAT_0_0, rnti_type, coreset_id, dl_bwp_id, alt_rb, 0); - } - if(dci_format == NR_UL_DCI_FORMAT_0_0) { - alt_rb = get_rb_bwp_dci(NR_DL_DCI_FORMAT_1_0, - ss->searchSpaceType->present, - mac->type0_PDCCH_CSS_config.num_rbs, - current_UL_BWP->BWPSize, - current_DL_BWP->BWPSize, - current_UL_BWP->initial_BWPSize, - current_DL_BWP->initial_BWPSize); - - alt_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &temp_pdu, - NR_DL_DCI_FORMAT_1_0, rnti_type, coreset_id, dl_bwp_id, alt_rb, 0); - } + if(dci_format == NR_DL_DCI_FORMAT_1_0) + alt_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, + current_DL_BWP, current_UL_BWP, + mac->cg, &temp_pdu, + NR_UL_DCI_FORMAT_0_0, rnti_type, coreset_id, dl_bwp_id, + ss->searchSpaceType->present, mac->type0_PDCCH_CSS_config.num_rbs, 0); + if(dci_format == NR_UL_DCI_FORMAT_0_0) + alt_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, + current_DL_BWP, current_UL_BWP, + mac->cg, &temp_pdu, + NR_DL_DCI_FORMAT_1_0, rnti_type, coreset_id, dl_bwp_id, + ss->searchSpaceType->present, mac->type0_PDCCH_CSS_config.num_rbs, 0); } - else - N_RB = mac->type0_PDCCH_CSS_config.num_rbs; + + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, + current_DL_BWP, current_UL_BWP, + mac->cg, &mac->def_dci_pdu_rel15[dci_format], + dci_format, NR_RNTI_TC, coreset_id, dl_bwp_id, + ss->searchSpaceType->present, mac->type0_PDCCH_CSS_config.num_rbs, alt_size); + + rel15->BWPStart = coreset_id == 0 ? mac->type0_PDCCH_CSS_config.cset_start_rb : current_DL_BWP->BWPStart; + rel15->BWPSize = coreset_id == 0 ? mac->type0_PDCCH_CSS_config.num_rbs : current_DL_BWP->BWPSize; + switch(rnti_type) { case NR_RNTI_C: // we use DL BWP dedicated @@ -215,29 +202,14 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t // for SPS=14 8 MSBs in positions 13 down to 6 monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); rel15->rnti = mac->crnti; - rel15->BWPSize = current_DL_BWP->BWPSize; - rel15->BWPStart = current_DL_BWP->BWPStart; rel15->SubcarrierSpacing = current_DL_BWP->scs; - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, - &mac->def_dci_pdu_rel15[dci_format], - dci_format, NR_RNTI_C, coreset_id, dl_bwp_id, N_RB, alt_size); break; case NR_RNTI_RA: // we use the initial DL BWP sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); rel15->rnti = mac->ra.ra_rnti; - if (get_softmodem_params()->sa) { - rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; - } else { // NSA mode is not using the Initial BWP - rel15->BWPSize = current_DL_BWP->initial_BWPSize; - rel15->BWPStart = current_DL_BWP->BWPStart; - } rel15->SubcarrierSpacing = current_DL_BWP->scs; - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, - &mac->def_dci_pdu_rel15[dci_format], - dci_format, NR_RNTI_RA, coreset_id, dl_bwp_id, N_RB, alt_size); break; case NR_RNTI_P: break; @@ -248,12 +220,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t sps = current_DL_BWP->cyclicprefix == NULL ? 14 : 12; monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); rel15->rnti = mac->ra.t_crnti; - rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; rel15->SubcarrierSpacing = current_DL_BWP->scs; - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, - mac->cg, &mac->def_dci_pdu_rel15[dci_format], - dci_format, NR_RNTI_TC, coreset_id, dl_bwp_id, N_RB, alt_size); break; case NR_RNTI_SP_CSI: break; @@ -263,17 +230,11 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); rel15->rnti = SI_RNTI; // SI-RNTI - 3GPP TS 38.321 Table 7.1-1: RNTI values - rel15->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; if(mac->frequency_range == FR1) rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon; else rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon + 2; - - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, - &mac->def_dci_pdu_rel15[dci_format], - dci_format, NR_RNTI_SI, coreset_id, 0, mac->type0_PDCCH_CSS_config.num_rbs, alt_size); break; case NR_RNTI_SFI: break; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 3b3c483ec0..831963b454 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -50,6 +50,7 @@ /* PHY */ #include "executables/softmodem-common.h" +#include "openair1/PHY/defs_nr_UE.h" /* utils */ #include "assertions.h" @@ -642,8 +643,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr RA_config_t *ra = &mac->ra; fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; uint8_t is_Msg3 = 0; - NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; int default_abc = 1; @@ -816,15 +817,22 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr NR_PDSCH_Config_t *pdsch_config= (dl_bwp_id>0 && mac->DLbwp[dl_bwp_id-1]) ? mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup : NULL; int is_common=0; + if (dci_ind->ss_type == NR_SearchSpace__searchSpaceType_PR_common) { + dlsch_config_pdu_1_0->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs ? mac->type0_PDCCH_CSS_config.num_rbs : current_DL_BWP->initial_BWPSize; + dlsch_config_pdu_1_0->BWPStart = dci_ind->cset_start; + } + else { + dlsch_config_pdu_1_0->BWPSize = current_DL_BWP->BWPSize; + dlsch_config_pdu_1_0->BWPStart = current_DL_BWP->BWPStart; + } if(rnti == SI_RNTI) { NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config = mac->type0_PDCCH_CSS_config; default_abc = type0_PDCCH_CSS_config.type0_pdcch_ss_mux_pattern; dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH; - dlsch_config_pdu_1_0->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - dlsch_config_pdu_1_0->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; dlsch_config_pdu_1_0->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon; if (pdsch_config) pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL; // For PDSCH with mapping type A, the UE shall assume dmrs-AdditionalPosition='pos2' } else { + dlsch_config_pdu_1_0->SubcarrierSpacing = current_DL_BWP->scs; if (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti){ dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH; } else { @@ -832,34 +840,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr } if( (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti) || (rnti == ra->t_crnti) ) { if (mac->scc == NULL) { // use coreset0 - dlsch_config_pdu_1_0->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs; - dlsch_config_pdu_1_0->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; is_common=1; } - else { - dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } if (!get_softmodem_params()->sa) { // NSA mode is not using the Initial BWP - dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); pdsch_config = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup; } } else if (dl_bwp_id>0 && mac->DLbwp[dl_bwp_id-1]) { - dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_0->SubcarrierSpacing = mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing; pdsch_config = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup; - } else if (mac->scc) { - dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_0->SubcarrierSpacing = mac->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing; + } else if (mac->scc) pdsch_config = NULL; - } else if (mac->scc_SIB) { - dlsch_config_pdu_1_0->BWPSize = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_0->BWPStart = NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - dlsch_config_pdu_1_0->SubcarrierSpacing = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing; - pdsch_config = NULL; - } } /* IDENTIFIER_DCI_FORMATS */ @@ -1504,7 +1493,7 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, int O_CRC = 0; //FIXME uint16_t O_uci = O_CSI + O_ACK; - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t bwp_id = current_UL_BWP->bwp_id; NR_PUCCH_FormatConfig_t *pucchfmt; long *pusch_id = NULL; @@ -1564,7 +1553,7 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, mac->cg->physicalCellGroupConfig && (mac->cg->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH != NULL || mac->cg->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook != 1)) { - LOG_E(MAC,"PUCCH Unsupported cell group configuration : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + LOG_E(MAC,"PUCCH Unsupported cell group configuration\n"); return; } else if (mac->cg && @@ -1573,7 +1562,7 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, mac->cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig && mac->cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup && mac->cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { - LOG_E(MAC,"PUCCH Unsupported code block group for serving cell config : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + LOG_E(MAC,"PUCCH Unsupported code block group for serving cell config\n"); return; } NR_PUCCH_Config_t *pucch_Config; @@ -1611,7 +1600,7 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, pucch_pdu->prb_size = 1; // format 0 or 1 if ((O_SR+O_CSI+O_SR) > (sizeof(uint64_t)*8)) { - LOG_E(MAC,"PUCCH number of UCI bits exceeds payload size : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + LOG_E(MAC,"PUCCH number of UCI bits exceeds payload size\n"); return; } pucch_pdu->payload = (pucch->csi_part1_payload << (O_ACK + O_SR)) | (pucch->sr_payload << O_ACK) | pucch->ack_payload; @@ -1783,7 +1772,7 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac, int16_t G_b_f_c = 0; if (pucch_Config->spatialRelationInfoToAddModList != NULL) { /* FFS TODO NR */ - LOG_D(MAC,"PUCCH Spatial relation infos are not yet implemented : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__); + LOG_D(MAC,"PUCCH Spatial relation infos are not yet implemented\n"); return (PUCCH_POWER_DEFAULT); } @@ -1793,7 +1782,7 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac, } else { G_b_f_c = pucch->delta_pucch; - LOG_D(MAC,"PUCCH Transmit power control command not yet implemented for NR : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__); + LOG_E(MAC,"PUCCH Transmit power control command not yet implemented for NR\n"); return (PUCCH_POWER_DEFAULT); } @@ -1854,13 +1843,13 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac, break; default: { - LOG_E(MAC,"PUCCH unknown pucch format : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__); + LOG_E(MAC,"PUCCH unknown pucch format %d\n", format_type); return (0); } } if (*power_config->twoPUCCH_PC_AdjustmentStates > 1) { - LOG_E(MAC,"PUCCH power control adjustment states with 2 states not yet implemented : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__); + LOG_E(MAC,"PUCCH power control adjustment states with 2 states not yet implemented\n"); return (PUCCH_POWER_DEFAULT); } @@ -1869,8 +1858,8 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac, int16_t pucch_power = P_O_PUCCH + M_pucch_component + pathloss + delta_F_PUCCH + DELTA_TF + G_b_f_c; - NR_TST_PHY_PRINTF("PUCCH ( Tx power : %d dBm ) ( 10Log(...) : %d ) ( from Path Loss : %d ) ( delta_F_PUCCH : %d ) ( DELTA_TF : %d ) ( G_b_f_c : %d ) \n", - pucch_power, M_pucch_component, pathloss, delta_F_PUCCH, DELTA_TF, G_b_f_c); + LOG_D(MAC, "PUCCH ( Tx power : %d dBm ) ( 10Log(...) : %d ) ( from Path Loss : %d ) ( delta_F_PUCCH : %d ) ( DELTA_TF : %d ) ( G_b_f_c : %d ) \n", + pucch_power, M_pucch_component, pathloss, delta_F_PUCCH, DELTA_TF, G_b_f_c); return (pucch_power); } @@ -2017,7 +2006,7 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac, int n_CCE_0 = pucch->n_CCE; int N_CCE_0 = pucch->N_CCE; if (N_CCE_0 == 0) { - AssertFatal(1==0,"PUCCH No compatible pucch format found : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + AssertFatal(1==0,"PUCCH No compatible pucch format found\n"); } int r_PUCCH = ((2 * n_CCE_0)/N_CCE_0) + (2 * delta_PRI); pucch->initial_pucch_id = r_PUCCH; @@ -2114,8 +2103,8 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, int sched_frame,sched_slot; int slots_per_frame; - NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; NR_BWP_DownlinkDedicated_t *bwpd=NULL; @@ -2164,7 +2153,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } if (current_harq->dai > NR_DL_MAX_DAI) { - LOG_E(MAC,"PUCCH Downlink DAI has an invalid value : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + LOG_E(MAC,"PUCCH Downlink DAI has an invalid value of %d\n", current_harq->dai); } else { @@ -2175,7 +2164,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, dai_current = current_harq->dai+1; // DCI DAI to counter DAI conversion if (dai_current == 0) { - LOG_E(MAC,"PUCCH Downlink dai is invalid : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + LOG_E(MAC,"PUCCH Downlink dai is invalid\n"); return(0); } else if (dai_current > dai_max) { dai_max = dai_current; @@ -2209,7 +2198,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, return(0); } else if (number_harq_feedback > (sizeof(uint32_t)*8)) { - LOG_E(MAC,"PUCCH number of ack bits exceeds payload size : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + LOG_E(MAC,"PUCCH number of ack bits exceeds payload size\n"); return(0); } @@ -2223,7 +2212,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, mac->cg->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH != NULL) { int N_TB_max_DL = bwpd->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI[0]; pucch->n_HARQ_ACK = (((V_DAI_m_DL - U_DAI_c)%4) * N_TB_max_DL) + N_m_c_rx + N_SPS_c; - NR_TST_PHY_PRINTF("PUCCH power n(%d) = ( V(%d) - U(%d) )mod4 * N_TB(%d) + N(%d) \n", pucch->n_HARQ_ACK, V_DAI_m_DL, U_DAI_c, N_TB_max_DL, N_m_c_rx); + LOG_D(MAC, "PUCCH power n(%d) = ( V(%d) - U(%d) )mod4 * N_TB(%d) + N(%d) \n", pucch->n_HARQ_ACK, V_DAI_m_DL, U_DAI_c, N_TB_max_DL, N_m_c_rx); } /* @@ -2295,7 +2284,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } if (number_harq_feedback != O_ACK) { - LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); + LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment\n"); return (0); } @@ -2313,7 +2302,7 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac, frame_t frame, int slot) { - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t bwp_id = current_UL_BWP->bwp_id; NR_PUCCH_Config_t *pucch_Config = NULL; @@ -2426,7 +2415,7 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, int slot, PUCCH_sched_t *pucch) { - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t bwp_id = current_UL_BWP->bwp_id; NR_PUCCH_Config_t *pucch_Config = NULL; int csi_bits = 0; @@ -2805,8 +2794,8 @@ static uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, int pos = 0; int fsize = 0; int rnti_type = get_rnti_type(mac, rnti); - NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; int N_RB; if(current_DL_BWP) N_RB = get_rb_bwp_dci(dci_format, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index cc2064bc83..12b45174a0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -540,7 +540,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, dci_pdu_rel15_t *dci, RAR_grant_t *rar_grant, uint16_t rnti, - uint8_t *dci_format){ + uint8_t *dci_format) +{ int f_alloc; int mask; @@ -553,7 +554,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, int N_PRB_oh = 0; int rnti_type = get_rnti_type(mac, rnti); - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; // Common configuration @@ -935,7 +936,7 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo bool srs_scheduled = false; NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; NR_SRS_Config_t *srs_config = NULL; @@ -1567,7 +1568,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac, uint8_t tda_id){ int delta = 0; - NR_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; + NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP; NR_BWP_Id_t ul_bwp_id = current_UL_BWP->bwp_id; // Get the numerology to calculate the Tx frame and slot @@ -2405,7 +2406,7 @@ void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) { NR_CSI_IM_Resource_t *imcsi; int period, offset; - NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; int mu = current_DL_BWP->scs; uint16_t bwp_size = current_DL_BWP->BWPSize; uint16_t bwp_start = current_DL_BWP->BWPStart; @@ -2462,7 +2463,7 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; NR_NZP_CSI_RS_Resource_t *nzpcsi; int period, offset; - NR_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; + NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; NR_BWP_Id_t dl_bwp_id = current_DL_BWP->bwp_id; int mu = current_DL_BWP->scs; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 0d9bb25291..b8fcfcdd1e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1151,7 +1151,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra long BWPStart = 0; long BWPSize = 0; NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = NULL; - if(*ss->controlResourceSetId!=0) { + if(*ss->controlResourceSetId != 0) { BWPStart = dl_bwp->BWPStart; BWPSize = dl_bwp->initial_BWPSize; } else { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5e8e0f3709..65f54bb250 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1412,39 +1412,30 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, current_DL_BWP->initial_BWPSize); // computing alternative size for padding - uint16_t alt_rb; dci_pdu_rel15_t temp_pdu; - if(dci_format == NR_DL_DCI_FORMAT_1_0) { - alt_rb = get_rb_bwp_dci(NR_UL_DCI_FORMAT_0_0, - ss->searchSpaceType->present, - cset0_bwp_size, - current_UL_BWP->BWPSize, - current_DL_BWP->BWPSize, - current_UL_BWP->initial_BWPSize, - current_DL_BWP->initial_BWPSize); + if(dci_format == NR_DL_DCI_FORMAT_1_0) alt_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP, scc->uplinkConfigCommon->initialUplinkBWP, - CellGroup, &temp_pdu, NR_UL_DCI_FORMAT_0_0, rnti_type, controlResourceSetId, bwp_id, alt_rb, 0); + current_DL_BWP, current_UL_BWP, + CellGroup, &temp_pdu, NR_UL_DCI_FORMAT_0_0, rnti_type, + controlResourceSetId, bwp_id, ss->searchSpaceType->present, cset0_bwp_size, 0); - } - if(dci_format == NR_UL_DCI_FORMAT_0_0) { - alt_rb = get_rb_bwp_dci(NR_DL_DCI_FORMAT_1_0, - ss->searchSpaceType->present, - cset0_bwp_size, - current_UL_BWP->BWPSize, - current_DL_BWP->BWPSize, - current_UL_BWP->initial_BWPSize, - current_DL_BWP->initial_BWPSize); + if(dci_format == NR_UL_DCI_FORMAT_0_0) alt_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP, scc->uplinkConfigCommon->initialUplinkBWP, - CellGroup, &temp_pdu, NR_DL_DCI_FORMAT_1_0, rnti_type, controlResourceSetId, bwp_id, alt_rb, 0); - } + current_DL_BWP, current_UL_BWP, + CellGroup, &temp_pdu, NR_DL_DCI_FORMAT_1_0, rnti_type, + controlResourceSetId, bwp_id, ss->searchSpaceType->present, cset0_bwp_size, 0); + } else N_RB = cset0_bwp_size; + int dci_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP, scc->uplinkConfigCommon->initialUplinkBWP, - CellGroup, dci_pdu_rel15, dci_format, rnti_type, controlResourceSetId, bwp_id, N_RB, alt_size); + current_DL_BWP, current_UL_BWP, + CellGroup, dci_pdu_rel15, dci_format, rnti_type, controlResourceSetId, + bwp_id, ss->searchSpaceType->present, cset0_bwp_size, alt_size); pdcch_dci_pdu->PayloadSizeBits = dci_size; AssertFatal(dci_size <= 64, "DCI sizes above 64 bits not yet supported"); if (dci_format == NR_DL_DCI_FORMAT_1_1 || dci_format == NR_UL_DCI_FORMAT_0_1) diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 7697d74808..25be7f7c17 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -92,44 +92,6 @@ typedef struct { int len; } NR_list_t; -typedef struct NR_UE_DL_BWP { - NR_BWP_Id_t bwp_id; - int n_dl_bwp; - int scs; - long *cyclicprefix; - uint16_t BWPSize; - uint16_t BWPStart; - uint16_t initial_BWPSize; - uint16_t initial_BWPStart; - NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList; - NR_PDSCH_Config_t *pdsch_Config; - NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig; - uint8_t mcsTableIdx; - nr_dci_format_t dci_format; -} NR_UE_DL_BWP_t; - -typedef struct NR_UE_UL_BWP { - NR_BWP_Id_t bwp_id; - int n_ul_bwp; - int scs; - long *cyclicprefix; - uint16_t BWPSize; - uint16_t BWPStart; - uint16_t initial_BWPSize; - uint16_t initial_BWPStart; - NR_PUSCH_ServingCellConfig_t *pusch_servingcellconfig; - NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList; - NR_PUSCH_Config_t *pusch_Config; - NR_PUCCH_Config_t *pucch_Config; - NR_PUCCH_ConfigCommon_t *pucch_ConfigCommon; - NR_CSI_MeasConfig_t *csi_MeasConfig; - NR_SRS_Config_t *srs_Config; - uint8_t transform_precoding; - uint8_t mcs_table; - nr_dci_format_t dci_format; - int max_fb_time; -} NR_UE_UL_BWP_t; - typedef enum { RA_IDLE = 0, Msg2 = 1, From f277a27f57e29a398f841d5b20e882a3aa67b900 Mon Sep 17 00:00:00 2001 From: Karim Harouat Date: Fri, 30 Dec 2022 08:54:53 +0100 Subject: [PATCH 17/39] fix buildhelper Saopy folder name, case not respected, reinstall was broken --- cmake_targets/tools/build_helper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index facbb5ea0c..744a46f76b 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -461,7 +461,7 @@ install_soapy_from_source(){ ( cd /tmp echo "Downloading SoapySDR" - rm -rf /tmp/soapysdr + rm -rf /tmp/SoapySDR git clone -b soapy-sdr-0.7.0 --single-branch https://github.com/pothosware/SoapySDR.git cd SoapySDR #git checkout tags/release_003_010_001_001 @@ -474,7 +474,7 @@ install_soapy_from_source(){ $SUDO ldconfig cd /tmp echo "Downloading SoapyRemote" - rm -rf /tmp/soapyremote + rm -rf /tmp/SoapyRemote git clone -b soapy-remote-0.5.0 --single-branch https://github.com/pothosware/SoapyRemote.git cd SoapyRemote #git checkout tags/release_003_010_001_001 From 01030bbc4ed9ae1d24b005669ac804dae7ffec75 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 30 Dec 2022 10:32:58 +0100 Subject: [PATCH 18/39] L2 simulator fix --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 49305421af..eb1de74d20 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -638,41 +638,35 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_config_request_t *dl_config) { + if (!dl_ind->dci_ind) - { return; - } AssertFatal(dl_config->number_pdus < sizeof(dl_config->dl_config_list) / sizeof(dl_config->dl_config_list[0]), "Too many dl_config pdus %d", dl_config->number_pdus); - for (int i = 0; i < dl_config->number_pdus; i++) - { + for (int i = 0; i < dl_config->number_pdus; i++) { LOG_D(PHY, "In %s: filling DCI with a total of %d total DL PDUs (dl_config %p) \n", __FUNCTION__, dl_config->number_pdus, dl_config); fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15_dci = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; int num_dci_options = rel15_dci->num_dci_options; if (num_dci_options <= 0) - { LOG_D(NR_MAC, "num_dci_opts = %d for pdu[%d] in dl_config_list\n", rel15_dci->num_dci_options, i); - } AssertFatal(num_dci_options <= sizeof(rel15_dci->dci_length_options) / sizeof(rel15_dci->dci_length_options[0]), "num_dci_options %d > dci_length_options array\n", num_dci_options); AssertFatal(num_dci_options <= sizeof(rel15_dci->dci_format_options) / sizeof(rel15_dci->dci_format_options[0]), "num_dci_options %d > dci_format_options array\n", num_dci_options); - for (int j = 0; j < num_dci_options; j++) - { + for (int j = 0; j < num_dci_options; j++) { int num_dcis = dl_ind->dci_ind->number_of_dcis; AssertFatal(num_dcis <= sizeof(dl_ind->dci_ind->dci_list) / sizeof(dl_ind->dci_ind->dci_list[0]), "dl_config->number_pdus %d > dci_ind->dci_list array\n", num_dcis); - for (int k = 0; k < num_dcis; k++) - { + for (int k = 0; k < num_dcis; k++) { LOG_T(NR_PHY, "Received len %d, length options[%d] %d, format assigned %d, format options[%d] %d\n", dl_ind->dci_ind->dci_list[k].payloadSize, j, rel15_dci->dci_length_options[j], dl_ind->dci_ind->dci_list[k].dci_format, j, rel15_dci->dci_format_options[j]); - if (rel15_dci->dci_length_options[j] == dl_ind->dci_ind->dci_list[k].payloadSize) - { + if (rel15_dci->dci_length_options[j] == dl_ind->dci_ind->dci_list[k].payloadSize) { dl_ind->dci_ind->dci_list[k].dci_format = rel15_dci->dci_format_options[j]; + dl_ind->dci_ind->dci_list[k].ss_type = rel15_dci->dci_type_options[j]; LOG_D(NR_PHY, "format assigned dl_ind->dci_ind->dci_list[k].dci_format %d\n", dl_ind->dci_ind->dci_list[k].dci_format); } From 719e36159d4a0f70231692f2bd7c84e85d5afb9d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 3 Jan 2023 09:58:02 +0100 Subject: [PATCH 19/39] doc(ci): adding constraint on the branch name Signed-off-by: Raphael Defosseux --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a8634f468..4dca00c09a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,8 @@ We want to make contributing to this project as easy and transparent as possible * This decision was made for the license reasons. * The Continuous Integration will reject your merge request. - All merge requests SHALL have `develop` branch as target branch. + - All merge requests SHALL have source branch names that SHALL not contain the `/` character. + * We are using a `docker` registry scheme and the image names are based on the source branch name. ## Coding Styles ## From 551aee172a0fd0916c666d8bbe9e54491d2335db Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 9 Jan 2023 10:56:59 +0100 Subject: [PATCH 20/39] bugfix CU/DU: use correct IP address for GTP-U Not only the teid is received from the DU but also the IP address. We have to use it too. Also, don't connect the UDP socket. The parameter remote_s_address in the configuration file must not be used, at least not for gtp-u because the IP address is received from the DU (plus for later, for multiple DUs, it won't work at all). --- openair2/F1AP/f1ap_cu_task.c | 8 ++--- openair2/F1AP/f1ap_cu_ue_context_management.c | 30 ++++++++----------- openair3/ocp-gtpu/gtp_itf.cpp | 5 ++-- openair3/ocp-gtpu/gtp_itf.h | 9 +++--- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c index b2d2c872d1..b4e0c1ad2a 100644 --- a/openair2/F1AP/f1ap_cu_task.c +++ b/openair2/F1AP/f1ap_cu_task.c @@ -41,12 +41,10 @@ //Fixme: Uniq dirty DU instance, by global var, datamodel need better management instance_t CUuniqInstance=0; -static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) { +static instance_t cu_task_create_gtpu_instance(eth_params_t *IPaddrs) { openAddr_t tmp= {0}; strncpy(tmp.originHost, IPaddrs->my_addr, sizeof(tmp.originHost)-1); - strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1); - sprintf(tmp.originService, "%d", IPaddrs->my_portd); - sprintf(tmp.destinationService, "%d", IPaddrs->remote_portd); + sprintf(tmp.originService, "%d", IPaddrs->my_portd); return gtpv1Init(tmp); } @@ -59,7 +57,7 @@ static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_as f1ap_cu_data->sctp_in_streams = sctp_new_association_ind->in_streams; f1ap_cu_data->sctp_out_streams = sctp_new_association_ind->out_streams; f1ap_cu_data->default_sctp_stream_id = 0; - getCxt(CUtype, instance)->gtpInst=cu_task_create_gtpu_instance_to_du(IPaddrs); + getCxt(CUtype, instance)->gtpInst=cu_task_create_gtpu_instance(IPaddrs); AssertFatal(getCxt(CUtype, instance)->gtpInst>0,"Failed to create CU F1-U UDP listener"); // Fixme: fully inconsistent instances management // dirty global var is a bad fix diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index b8f1d7d84e..41898d77c7 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -510,18 +510,15 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, /* 12.1.3 uLUPTNLInformation_ToBeSetup_List */ for (int j = 0; j < f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl_length; j++) { - /*Use a dummy teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU*/ - transport_layer_addr_t addr; - int sz=sizeof(f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address); - memcpy(addr.buffer,&f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address, sz); - addr.length = sz*8; + /* Use a dummy address and teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU */ + transport_layer_addr_t addr = { length: 32, buffer: { 0 } }; f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid = newGtpuCreateTunnel(getCxt(CUtype, instance)->gtpInst, f1ap_ue_context_setup_req->rnti, f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id, f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id, 0xFFFF, // We will set the right value from DU answer -1, // no qfi - addr, + addr, // We will set the right value from DU answer f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].port, cu_f1u_data_req, NULL); @@ -700,10 +697,11 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, F1AP_GTPTunnel_t *dl_up_tnl0 = dl_up_tnl_info_p->dLUPTNLInformation.choice.gTPTunnel; BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&dl_up_tnl0->transportLayerAddress, drb_p->up_dl_tnl[0].tl_address); OCTET_STRING_TO_INT32(&dl_up_tnl0->gTP_TEID, drb_p->up_dl_tnl[0].teid); - GtpuUpdateTunnelOutgoingTeid(getCxt(CUtype, instance)->gtpInst, - f1ap_ue_context_setup_resp->rnti, - (ebi_t)drbs_setup_item_p->dRBID, - drb_p->up_dl_tnl[0].teid); + GtpuUpdateTunnelOutgoingAddressAndTeid(getCxt(CUtype, instance)->gtpInst, + f1ap_ue_context_setup_resp->rnti, + (ebi_t)drbs_setup_item_p->dRBID, + drb_p->up_dl_tnl[0].tl_address, + drb_p->up_dl_tnl[0].teid); } } @@ -1478,11 +1476,8 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context /* 12.1.3 uLUPTNLInformation_ToBeSetup_List */ for (int j = 0; j < f1ap_ue_context_modification_req->drbs_to_be_setup[i].up_ul_tnl_length; j++) { - /*Use a dummy teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU*/ - transport_layer_addr_t addr; - int sz=sizeof(f1ap_ue_context_modification_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address); - memcpy(addr.buffer,&f1ap_ue_context_modification_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address, sz); - addr.length = sz*8; + /* Use a dummy address and teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context modification response from the DU */ + transport_layer_addr_t addr = { length: 32, buffer: { 0 } }; f1ap_ue_context_modification_req->drbs_to_be_setup[i].up_ul_tnl[j].teid = newGtpuCreateTunnel(getCxt(CUtype, instance)->gtpInst, f1ap_ue_context_modification_req->rnti, @@ -1490,7 +1485,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context f1ap_ue_context_modification_req->drbs_to_be_setup[i].drb_id, 0xFFFF, // We will set the right value from DU answer -1, // no qfi - addr, + addr, // We will set the right value from DU answer f1ap_ue_context_modification_req->drbs_to_be_setup[i].up_dl_tnl[0].port, cu_f1u_data_req, NULL); @@ -1702,9 +1697,10 @@ int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, F1AP_GTPTunnel_t *dl_up_tnl0 = dl_up_tnl_info_p->dLUPTNLInformation.choice.gTPTunnel; BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&dl_up_tnl0->transportLayerAddress, drb_p->up_dl_tnl[0].tl_address); OCTET_STRING_TO_INT32(&dl_up_tnl0->gTP_TEID, drb_p->up_dl_tnl[0].teid); - GtpuUpdateTunnelOutgoingTeid(getCxt(CUtype, instance)->gtpInst, + GtpuUpdateTunnelOutgoingAddressAndTeid(getCxt(CUtype, instance)->gtpInst, f1ap_ue_context_modification_resp->rnti, (ebi_t)drbs_setupmod_item_p->dRBID, + drb_p->up_dl_tnl[0].tl_address, drb_p->up_dl_tnl[0].teid); } } diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 5a2a7fd591..8045e7f635 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -552,7 +552,7 @@ instance_t gtpv1Init(openAddr_t context) { return id; } -void GtpuUpdateTunnelOutgoingTeid(instance_t instance, ue_id_t ue_id, ebi_t bearer_id, teid_t newOutgoingTeid) { +void GtpuUpdateTunnelOutgoingAddressAndTeid(instance_t instance, ue_id_t ue_id, ebi_t bearer_id, in_addr_t newOutgoingAddr, teid_t newOutgoingTeid) { pthread_mutex_lock(&globGtp.gtp_lock); getInstRetVoid(compatInst(instance)); getUeRetVoid(inst, ue_id); @@ -565,8 +565,9 @@ void GtpuUpdateTunnelOutgoingTeid(instance_t instance, ue_id_t ue_id, ebi_t bear return; } + ptr2->second.outgoing_ip_addr = newOutgoingAddr; ptr2->second.teid_outgoing = newOutgoingTeid; - LOG_I(GTPU, "[%ld] Tunnel Outgoing TEID updated to %x \n", instance, ptr2->second.teid_outgoing); + LOG_I(GTPU, "[%ld] Tunnel Outgoing TEID updated to %x and address to %x\n", instance, ptr2->second.teid_outgoing, ptr2->second.outgoing_ip_addr); pthread_mutex_unlock(&globGtp.gtp_lock); return; } diff --git a/openair3/ocp-gtpu/gtp_itf.h b/openair3/ocp-gtpu/gtp_itf.h index 00736fc672..86d719c200 100644 --- a/openair3/ocp-gtpu/gtp_itf.h +++ b/openair3/ocp-gtpu/gtp_itf.h @@ -92,10 +92,11 @@ extern "C" { gtpCallback callBack, gtpCallbackSDAP callBackSDAP); - void GtpuUpdateTunnelOutgoingTeid(instance_t instance, - ue_id_t ue_id, - ebi_t bearer_id, - teid_t newOutgoingTeid); + void GtpuUpdateTunnelOutgoingAddressAndTeid(instance_t instance, + ue_id_t ue_id, + ebi_t bearer_id, + in_addr_t newOutgoingAddr, + teid_t newOutgoingTeid); int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id); int newGtpuDeleteTunnels(instance_t instance, ue_id_t ue_id, int nbTunnels, pdusessionid_t *pdusession_id); From b7762141e895ca093a21c3fc593ada6101db4d69 Mon Sep 17 00:00:00 2001 From: ahadi Date: Fri, 29 Apr 2022 17:12:18 +0200 Subject: [PATCH 21/39] added NRPPA .asm file and compiled the functions to CMakeFiles --- openair3/NRPPA/MESSAGES/38455.asn | 2844 +++++++++++++++++++++++++++++ 1 file changed, 2844 insertions(+) create mode 100644 openair3/NRPPA/MESSAGES/38455.asn diff --git a/openair3/NRPPA/MESSAGES/38455.asn b/openair3/NRPPA/MESSAGES/38455.asn new file mode 100644 index 0000000000..4c395b25d0 --- /dev/null +++ b/openair3/NRPPA/MESSAGES/38455.asn @@ -0,0 +1,2844 @@ +-- ASN1START +-- ************************************************************** +-- +-- Elementary Procedure definitions +-- +-- ************************************************************** +NRPPA-PDU-Descriptions { itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) ngran-access (22) modules (3) nrppa (4) version1 (1) nrppa-PDU-Descriptions (0) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + Criticality, + ProcedureCode, + NRPPATransactionID + +FROM NRPPA-CommonDataTypes + + + ErrorIndication, + PrivateMessage, + E-CIDMeasurementInitiationRequest, + E-CIDMeasurementInitiationResponse, + E-CIDMeasurementInitiationFailure, + E-CIDMeasurementFailureIndication, + E-CIDMeasurementReport, + E-CIDMeasurementTerminationCommand, + OTDOAInformationRequest, + OTDOAInformationResponse, + OTDOAInformationFailure, + AssistanceInformationControl, + AssistanceInformationFeedback, + PositioningInformationRequest, + PositioningInformationResponse, + PositioningInformationFailure, + PositioningInformationUpdate, + MeasurementRequest, + MeasurementResponse, + MeasurementFailure, + MeasurementReport, + MeasurementUpdate, + MeasurementAbort, + MeasurementFailureIndication, + TRPInformationRequest, + TRPInformationResponse, + TRPInformationFailure, + PositioningActivationRequest, + PositioningActivationResponse, + PositioningActivationFailure, + PositioningDeactivation + + +FROM NRPPA-PDU-Contents + id-errorIndication, id-privateMessage, id-e-CIDMeasurementInitiation, id-e-CIDMeasurementFailureIndication, id-e-CIDMeasurementReport, id-e-CIDMeasurementTermination, id-oTDOAInformationExchange, id-assistanceInformationControl, id-assistanceInformationFeedback, id-positioningInformationExchange, id-positioningInformationUpdate, id-Measurement, id-MeasurementReport, id-MeasurementUpdate, id-MeasurementAbort, id-MeasurementFailureIndication, id-tRPInformationExchange, id-positioningActivation, id-positioningDeactivation + + + +FROM NRPPA-Constants; + +-- ************************************************************** +-- +-- Interface Elementary Procedure Class +-- +-- ************************************************************** + +NRPPA-ELEMENTARY-PROCEDURE ::= CLASS { + &InitiatingMessage , + &SuccessfulOutcome OPTIONAL, + &UnsuccessfulOutcome OPTIONAL, + &procedureCode ProcedureCode UNIQUE, + &criticality Criticality DEFAULT ignore +} +WITH SYNTAX { + INITIATING MESSAGE &InitiatingMessage + [SUCCESSFUL OUTCOME &SuccessfulOutcome] + [UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome] PROCEDURE CODE &procedureCode + [CRITICALITY &criticality] +} + +-- ************************************************************** +-- +-- Interface PDU Definition +-- +-- ************************************************************** +NRPPA-PDU ::= CHOICE { initiatingMessage InitiatingMessage, successfulOutcome SuccessfulOutcome, unsuccessfulOutcome UnsuccessfulOutcome, + ... +} + +InitiatingMessage ::= SEQUENCE { procedureCode NRPPA-ELEMENTARY-PROCEDURE.&procedureCode ({NRPPA-ELEMENTARY-PROCEDURES}), criticality NRPPA-ELEMENTARY-PROCEDURE.&criticality ({NRPPA-ELEMENTARY-PROCEDURES}{@procedureCode}), nrppatransactionID NRPPATransactionID, + value NRPPA-ELEMENTARY-PROCEDURE.&InitiatingMessage ({NRPPA-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +SuccessfulOutcome ::= SEQUENCE { procedureCode NRPPA-ELEMENTARY-PROCEDURE.&procedureCode ({NRPPA-ELEMENTARY-PROCEDURES}), criticality NRPPA-ELEMENTARY-PROCEDURE.&criticality ({NRPPA-ELEMENTARY-PROCEDURES}{@procedureCode}), nrppatransactionID NRPPATransactionID, + value NRPPA-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({NRPPA-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +UnsuccessfulOutcome ::= SEQUENCE { procedureCode NRPPA-ELEMENTARY-PROCEDURE.&procedureCode ({NRPPA-ELEMENTARY-PROCEDURES}), criticality NRPPA-ELEMENTARY-PROCEDURE.&criticality ({NRPPA-ELEMENTARY-PROCEDURES}{@procedureCode}), nrppatransactionID NRPPATransactionID, + value NRPPA-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({NRPPA-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + + +-- ************************************************************** +-- +-- Interface Elementary Procedure List +-- +-- ************************************************************** + +NRPPA-ELEMENTARY-PROCEDURES NRPPA-ELEMENTARY-PROCEDURE ::= { + NRPPA-ELEMENTARY-PROCEDURES-CLASS-1 | + NRPPA-ELEMENTARY-PROCEDURES-CLASS-2 , ... +} + +NRPPA-ELEMENTARY-PROCEDURES-CLASS-1 NRPPA-ELEMENTARY-PROCEDURE ::= { e-CIDMeasurementInitiation | oTDOAInformationExchange | positioningInformationExchange | measurement | + tRPInformationExchange | positioningActivation, + ... +} + +NRPPA-ELEMENTARY-PROCEDURES-CLASS-2 NRPPA-ELEMENTARY-PROCEDURE ::= { e-CIDMeasurementFailureIndication | + + e-CIDMeasurementReport | e-CIDMeasurementTermination | errorIndication | privateMessage | assistanceInformationControl | assistanceInformationFeedback | positioningInformationUpdate | measurementReport | measurementUpdate | measurementAbort | + measurementFailureIndication | positioningDeactivation, + ... +} + + +-- ************************************************************** +-- +-- Interface Elementary Procedures +-- +-- ************************************************************** + +e-CIDMeasurementInitiation NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE E-CIDMeasurementInitiationRequest + SUCCESSFUL OUTCOME E-CIDMeasurementInitiationResponse + UNSUCCESSFUL OUTCOME E-CIDMeasurementInitiationFailure + PROCEDURE CODE id-e-CIDMeasurementInitiation + CRITICALITY reject +} +e-CIDMeasurementFailureIndication NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE E-CIDMeasurementFailureIndication + PROCEDURE CODE id-e-CIDMeasurementFailureIndication + CRITICALITY ignore +} +e-CIDMeasurementReport NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE E-CIDMeasurementReport + PROCEDURE CODE id-e-CIDMeasurementReport + CRITICALITY ignore +} +e-CIDMeasurementTermination NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE E-CIDMeasurementTerminationCommand + PROCEDURE CODE id-e-CIDMeasurementTermination CRITICALITY reject +} +oTDOAInformationExchange NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE OTDOAInformationRequest + SUCCESSFUL OUTCOME OTDOAInformationResponse + UNSUCCESSFUL OUTCOME OTDOAInformationFailure + PROCEDURE CODE id-oTDOAInformationExchange + CRITICALITY reject + +} + +assistanceInformationControl NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE AssistanceInformationControl + PROCEDURE CODE id-assistanceInformationControl + CRITICALITY reject +} +assistanceInformationFeedback NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE AssistanceInformationFeedback + PROCEDURE CODE id-assistanceInformationFeedback + CRITICALITY reject +} + +errorIndication NRPPA-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ErrorIndication + PROCEDURE CODE id-errorIndication + CRITICALITY ignore +} + +privateMessage NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE PrivateMessage + PROCEDURE CODE id-privateMessage + CRITICALITY ignore +} + +positioningInformationExchange NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE PositioningInformationRequest + SUCCESSFUL OUTCOME PositioningInformationResponse + UNSUCCESSFUL OUTCOME PositioningInformationFailure + PROCEDURE CODE id-positioningInformationExchange + CRITICALITY reject +} +positioningInformationUpdate NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE PositioningInformationUpdate + PROCEDURE CODE id-positioningInformationUpdate + CRITICALITY ignore +} +measurement NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE MeasurementRequest + SUCCESSFUL OUTCOME MeasurementResponse + UNSUCCESSFUL OUTCOME MeasurementFailure + PROCEDURE CODE id-Measurement + CRITICALITY reject +} +measurementReport NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE MeasurementReport PROCEDURE CODE id-MeasurementReport + CRITICALITY ignore +} +measurementUpdate NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE MeasurementUpdate + PROCEDURE CODE id-MeasurementUpdate + CRITICALITY ignore +} +measurementAbort NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE MeasurementAbort + PROCEDURE CODE id-MeasurementAbort + CRITICALITY ignore +} +measurementFailureIndication NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE MeasurementFailureIndication + PROCEDURE CODE id-MeasurementFailureIndication + CRITICALITY ignore +} +tRPInformationExchange NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE TRPInformationRequest + SUCCESSFUL OUTCOME TRPInformationResponse + UNSUCCESSFUL OUTCOME TRPInformationFailure + PROCEDURE CODE id-tRPInformationExchange + CRITICALITY reject +} +positioningActivation NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE PositioningActivationRequest + SUCCESSFUL OUTCOME PositioningActivationResponse + UNSUCCESSFUL OUTCOME PositioningActivationFailure + PROCEDURE CODE id-positioningActivation + CRITICALITY reject +} +positioningDeactivation NRPPA-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE PositioningDeactivation + PROCEDURE CODE id-positioningDeactivation + CRITICALITY ignore +} + + +END + +-- ASN1STOP + + +-- ASN1START +-- ************************************************************** +-- +-- PDU definitions for NRPPa +-- +-- ************************************************************** +NRPPA-PDU-Contents { itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) ngran-access (22) modules (3) nrppa (4) version1 (1) nrppa-PDU-Contents (1) } +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules +-- +-- ************************************************************** +IMPORTS + + Cause, + CriticalityDiagnostics, + E-CID-MeasurementResult, + OTDOACells, + OTDOA-Information-Item, + Measurement-ID, + UE-Measurement-ID, + MeasurementPeriodicity, + MeasurementQuantities, + ReportCharacteristics, + RequestedSRSTransmissionCharacteristics, + Cell-Portion-ID, + OtherRATMeasurementQuantities, + OtherRATMeasurementResult, + WLANMeasurementQuantities, + WLANMeasurementResult, + Assistance-Information, + Broadcast, + AssistanceInformationFailureList, + SRSConfiguration, + TRPMeasurementQuantities, + TrpMeasurementResult, + TRP-ID, + TRPInformationTypeList, + TRPInformationList, + TRP-MeasurementRequestList, + TRP-MeasurementResponseList, + MeasurementBeamInfoRequest, + PositioningBroadcastCells, + ActivationTime, + SRSResourceSetID, + SRSSpatialRelation, + SRSResourceTrigger, + TRPList, + AbortTransmission, + SystemFrameNumber, + SlotNumber, + SFNInitialisationTime + + +FROM NRPPA-IEs + + PrivateIE-Container{}, + ProtocolExtensionContainer{}, + ProtocolIE-Container{}, + ProtocolIE-ContainerList{}, + ProtocolIE-Single-Container{}, + NRPPA-PRIVATE-IES, + NRPPA-PROTOCOL-EXTENSION, + NRPPA-PROTOCOL-IES FROM NRPPA-Containers + + + maxnoOTDOAtypes, id-Cause, id-CriticalityDiagnostics, id-LMF-Measurement-ID, id-LMF-UE-Measurement-ID, id-OTDOACells, id-OTDOA-Information-Type-Group, id-OTDOA-Information-Type-Item, id-ReportCharacteristics, id-MeasurementPeriodicity, id-MeasurementQuantities, id-RAN-Measurement-ID, id-RAN-UE-Measurement-ID, id-E-CID-MeasurementResult, id-RequestedSRSTransmissionCharacteristics, id-Cell-Portion-ID, id-OtherRATMeasurementQuantities, id-OtherRATMeasurementResult, id-WLANMeasurementQuantities, id-WLANMeasurementResult, id-Assistance-Information, id-Broadcast, id-AssistanceInformationFailureList, id-SRSConfiguration, id-TRPMeasurementQuantities, id-MeasurementResult, id-TRP-ID, id-TRPInformationTypeList, id-TRPInformationList, id-TRP-MeasurementRequestList, id-TRP-MeasurementResponseList, id-TRP-MeasurementReportList, id-MeasurementBeamInfoRequest, id-PositioningBroadcastCells, id-SRSType, + id-ActivationTime, id-SRSResourceSetID, id-TRPList, id-SRSSpatialRelation, id-AbortTransmission, id-SystemFrameNumber, id-SlotNumber, id-SRSResourceTrigger, id-SFNInitialisationTime + + + +FROM NRPPA-Constants; + +-- ************************************************************** +-- +-- E-CID MEASUREMENT INITIATION REQUEST +-- +-- ************************************************************** + +E-CIDMeasurementInitiationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{E-CIDMeasurementInitiationRequest-IEs}}, + ... +} + +E-CIDMeasurementInitiationRequest-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| + { ID id-ReportCharacteristics CRITICALITY reject TYPE ReportCharacteristics PRESENCE mandatory}| + { ID id-MeasurementPeriodicity CRITICALITY reject TYPE MeasurementPeriodicity +-- The IE shall be present if the Report Characteritics IE is set to \93periodic\94 -- PRESENCE conditional}| + { ID id-MeasurementQuantities CRITICALITY reject TYPE MeasurementQuantities PRESENCE mandatory}| + { ID id-OtherRATMeasurementQuantities CRITICALITY ignore TYPE OtherRATMeasurementQuantities PRESENCE optional}| + { ID id-WLANMeasurementQuantities CRITICALITY ignore TYPE WLANMeasurementQuantities PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- E-CID MEASUREMENT INITIATION RESPONSE +-- +-- ************************************************************** +E-CIDMeasurementInitiationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{E-CIDMeasurementInitiationResponse-IEs}}, + ... +} + +E-CIDMeasurementInitiationResponse-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| + { ID id-RAN-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| + { ID id-E-CID-MeasurementResult CRITICALITY ignore TYPE E-CID-MeasurementResult PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| + { ID id-Cell-Portion-ID CRITICALITY ignore TYPE Cell-Portion-ID PRESENCE optional}| + { ID id-OtherRATMeasurementResult CRITICALITY ignore TYPE OtherRATMeasurementResult PRESENCE optional}| + { ID id-WLANMeasurementResult CRITICALITY ignore TYPE WLANMeasurementResult PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- E-CID MEASUREMENT INITIATION FAILURE -- +-- ************************************************************** + +E-CIDMeasurementInitiationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{E-CIDMeasurementInitiationFailure-IEs}}, ... +} + + +E-CIDMeasurementInitiationFailure-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- E-CID MEASUREMENT FAILURE INDICATION +-- +-- ************************************************************** + +E-CIDMeasurementFailureIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{E-CIDMeasurementFailureIndication-IEs}}, ... +} + + +E-CIDMeasurementFailureIndication-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| + { ID id-RAN-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}, ... +} + +-- ************************************************************** +-- +-- E-CID MEASUREMENT REPORT -- +-- ************************************************************** + +E-CIDMeasurementReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{E-CIDMeasurementReport-IEs}}, ... +} + + +E-CIDMeasurementReport-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| + { ID id-RAN-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| { ID id-E-CID-MeasurementResult CRITICALITY ignore TYPE E-CID-MeasurementResult PRESENCE mandatory}| { ID id-Cell-Portion-ID CRITICALITY ignore TYPE Cell-Portion-ID PRESENCE optional}, ... +} + +-- ************************************************************** +-- +-- E-CID MEASUREMENT TERMINATION +-- +-- ************************************************************** + +E-CIDMeasurementTerminationCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{E-CIDMeasurementTerminationCommand-IEs}}, ... +} + + +E-CIDMeasurementTerminationCommand-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}| { ID id-RAN-UE-Measurement-ID CRITICALITY reject TYPE UE-Measurement-ID PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- OTDOA INFORMATION REQUEST +-- +-- ************************************************************** + +OTDOAInformationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{OTDOAInformationRequest-IEs}}, + ... +} + +OTDOAInformationRequest-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-OTDOA-Information-Type-Group CRITICALITY reject TYPE OTDOA-Information-Type PRESENCE mandatory}, ... +} + +OTDOA-Information-Type ::= SEQUENCE (SIZE(1..maxnoOTDOAtypes)) OF ProtocolIE-Single-Container { { OTDOA-Information-TypeIEs} } + +OTDOA-Information-TypeIEs NRPPA-PROTOCOL-IES ::= { + { ID id-OTDOA-Information-Type-Item CRITICALITY reject TYPE OTDOA-Information-Type-Item PRESENCE mandatory}, ... +} + +OTDOA-Information-Type-Item ::= SEQUENCE { + oTDOA-Information-Type-Item OTDOA-Information-Item, iE-Extensions ProtocolExtensionContainer { { OTDOA-Information-Type-ItemExtIEs} } OPTIONAL, + ... +} + + + +OTDOA-Information-Type-ItemExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +-- ************************************************************** +-- +-- OTDOA INFORMATION RESPONSE +-- +-- ************************************************************** + +OTDOAInformationResponse ::= SEQUENCE { protocolIEs ProtocolIE-Container {{OTDOAInformationResponse-IEs}}, + ... +} + +OTDOAInformationResponse-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-OTDOACells CRITICALITY ignore TYPE OTDOACells PRESENCE mandatory}| { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- OTDOA INFORMATION FAILURE +-- +-- ************************************************************** + +OTDOAInformationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{OTDOAInformationFailure-IEs}}, ... +} + + +OTDOAInformationFailure-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- ASSISTANCE INFORMATION CONTROL +-- +-- ************************************************************** +AssistanceInformationControl ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{AssistanceInformationControl-IEs}}, + ... +} + +AssistanceInformationControl-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-Assistance-Information CRITICALITY reject TYPE Assistance-Information PRESENCE optional}| + { ID id-Broadcast CRITICALITY reject TYPE Broadcast PRESENCE optional}| + { ID id-PositioningBroadcastCells CRITICALITY reject TYPE PositioningBroadcastCells PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- ASSISTANCE INFORMATION FEEDBACK -- +-- ************************************************************** + +AssistanceInformationFeedback ::= SEQUENCE { protocolIEs ProtocolIE-Container {{AssistanceInformationFeedback-IEs}}, + ... +} + +AssistanceInformationFeedback-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-AssistanceInformationFailureList CRITICALITY reject TYPE AssistanceInformationFailureList PRESENCE optional}| + { ID id-PositioningBroadcastCells CRITICALITY reject TYPE PositioningBroadcastCells PRESENCE optional}| { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- ERROR INDICATION +-- +-- ************************************************************** + +ErrorIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ErrorIndication-IEs}}, + ... +} + +ErrorIndication-IEs NRPPA-PROTOCOL-IES ::= { + + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- PRIVATE MESSAGE +-- +-- ************************************************************** + +PrivateMessage ::= SEQUENCE { + privateIEs PrivateIE-Container {{PrivateMessage-IEs}}, + ... +} + +PrivateMessage-IEs NRPPA-PRIVATE-IES ::= { + ... +} + +-- ************************************************************** +-- +-- POSITIONING INFORMATION REQUEST +-- +-- ************************************************************** +PositioningInformationRequest ::= SEQUENCE { protocolIEs ProtocolIE-Container {{PositioningInformationRequest-IEs}}, + ... +} + +PositioningInformationRequest-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-RequestedSRSTransmissionCharacteristics CRITICALITY ignore TYPE RequestedSRSTransmissionCharacteristics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- POSITIONING INFORMATION RESPONSE +-- +-- ************************************************************** + +PositioningInformationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{PositioningInformationResponse-IEs}}, + ... +} + +PositioningInformationResponse-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-SRSConfiguration CRITICALITY ignore TYPE SRSConfiguration PRESENCE optional}| + { ID id-SFNInitialisationTime CRITICALITY ignore TYPE SFNInitialisationTime PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- POSITIONING INFORMATION FAILURE +-- +-- ************************************************************** + +PositioningInformationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{PositioningInformationFailure-IEs}}, ... +} + +PositioningInformationFailure-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- POSITIONING INFORMATION UPDATE +-- +-- ************************************************************** + +PositioningInformationUpdate ::= SEQUENCE { protocolIEs ProtocolIE-Container {{PositioningInformationUpdate-IEs}}, + ... +} + +PositioningInformationUpdate-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-SRSConfiguration CRITICALITY ignore TYPE SRSConfiguration PRESENCE optional}| + { ID id-SFNInitialisationTime CRITICALITY ignore TYPE SFNInitialisationTime PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- MEASUREMENT REQUEST +-- +-- ************************************************************** + +MeasurementRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{MeasurementRequest-IEs}}, + ... +} + +MeasurementRequest-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-TRP-MeasurementRequestList CRITICALITY reject TYPE TRP-MeasurementRequestList PRESENCE mandatory}| { ID id-ReportCharacteristics CRITICALITY reject TYPE ReportCharacteristics PRESENCE mandatory}| + { ID id-MeasurementPeriodicity CRITICALITY reject TYPE MeasurementPeriodicity PRESENCE conditional}| +-- The IE shall be present if the Report Characteritics IE is set to \93periodic\94 \96 + { ID id-TRPMeasurementQuantities CRITICALITY reject TYPE TRPMeasurementQuantities PRESENCE mandatory}| + { ID id-SRSConfiguration CRITICALITY ignore TYPE SRSConfiguration PRESENCE optional}| + { ID id-SFNInitialisationTime CRITICALITY ignore TYPE SFNInitialisationTime PRESENCE optional}| { ID id-MeasurementBeamInfoRequest CRITICALITY ignore TYPE MeasurementBeamInfoRequest PRESENCE optional}| + { ID id-SystemFrameNumber CRITICALITY ignore TYPE SystemFrameNumber PRESENCE optional}| + { ID id-SlotNumber CRITICALITY ignore TYPE SlotNumber PRESENCE optional}, ... +} + +-- ************************************************************** +-- +-- MEASUREMENT RESPONSE -- +-- ************************************************************** + +MeasurementResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{MeasurementResponse-IEs}}, + ... +} + +MeasurementResponse-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-RAN-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-TRP-MeasurementResponseList CRITICALITY reject TYPE TRP-MeasurementResponseList PRESENCE mandatory}| { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- MEASUREMENT FAILURE +-- +-- ************************************************************** + +MeasurementFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{MeasurementFailure-IEs}}, ... +} + +MeasurementFailure-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- MEASUREMENT REPORT +-- +-- ************************************************************** + +MeasurementReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{MeasurementReport-IEs}}, + ... +} + +MeasurementReport-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-RAN-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-TRP-MeasurementReportList CRITICALITY reject TYPE TRP-MeasurementResponseList PRESENCE mandatory}, + + ... +} + +-- ************************************************************** -- +-- MEASUREMENT UPDATE +-- +-- ************************************************************** + +MeasurementUpdate ::= SEQUENCE { protocolIEs ProtocolIE-Container {{MeasurementUpdate-IEs}}, + ... +} + + + +MeasurementUpdate-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-RAN-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| { ID id-SRSConfiguration CRITICALITY ignore TYPE SRSConfiguration PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- MEASUREMENT ABORT +-- +-- ************************************************************** + +MeasurementAbort ::= SEQUENCE { protocolIEs ProtocolIE-Container {{MeasurementAbort-IEs}}, + ... +} + +MeasurementAbort-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| { ID id-RAN-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- MEASUREMENT FAILURE INDICATION +-- +-- ************************************************************** + +MeasurementFailureIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{MeasurementFailureIndication-IEs}}, ... +} + +MeasurementFailureIndication-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-LMF-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-RAN-Measurement-ID CRITICALITY reject TYPE Measurement-ID PRESENCE mandatory}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}, ... +} + +-- ************************************************************** -- +-- TRP INFORMATION REQUEST +-- +-- ************************************************************** + +TRPInformationRequest ::= SEQUENCE { protocolIEs ProtocolIE-Container {{TRPInformationRequest-IEs}}, + ... +} + +TRPInformationRequest-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-TRPList CRITICALITY reject TYPE TRPList PRESENCE mandatory}| + { ID id-TRPInformationTypeList CRITICALITY reject TYPE TRPInformationTypeList PRESENCE mandatory}, ... +} + +-- ************************************************************** -- +-- TRP INFORMATION RESPONSE +-- +-- ************************************************************** + +TRPInformationResponse ::= SEQUENCE { protocolIEs ProtocolIE-Container {{TRPInformationResponse-IEs}}, + ... +} + +TRPInformationResponse-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-TRPInformationList CRITICALITY ignore TYPE TRPInformationList PRESENCE mandatory}| { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- TRP INFORMATION FAILURE +-- +-- ************************************************************** + +TRPInformationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{TRPInformationFailure-IEs}}, ... +} + +TRPInformationFailure-IEs NRPPA-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + + + +-- ************************************************************** +-- +-- POSITIONING ACTIVATION REQUEST -- +-- ************************************************************** + +PositioningActivationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PositioningActivationRequestIEs} }, + ... +} + +PositioningActivationRequestIEs NRPPA-PROTOCOL-IES ::= { + + { ID id-SRSType CRITICALITY reject TYPE SRSType PRESENCE mandatory } | { ID id-ActivationTime CRITICALITY ignore TYPE ActivationTime PRESENCE optional }, ... +} + +SRSType ::= CHOICE { + semipersistentSRS SemipersistentSRS, aperiodicSRS AperiodicSRS, + sRSType-extension ProtocolIE-Single-Container { { SRSType-ExtIEs} } +} + +SRSType-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +SemipersistentSRS ::= SEQUENCE { + sRSResourceSetID SRSResourceSetID, + iE-Extensions ProtocolExtensionContainer { {SemipersistentSRS-ExtIEs} } OPTIONAL, + ... +} + +SemipersistentSRS-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { +{ ID id-SRSSpatialRelation CRITICALITY ignore EXTENSION SRSSpatialRelation PRESENCE optional}, ... +} + +AperiodicSRS ::= SEQUENCE { + aperiodic ENUMERATED{true,...}, + sRSResourceTrigger SRSResourceTrigger OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {AperiodicSRS-ExtIEs} } OPTIONAL, + ... +} + +AperiodicSRS-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +-- ************************************************************** +-- +-- POSITIONING ACTIVATION RESPONSE +-- +-- ************************************************************** + +PositioningActivationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PositioningActivationResponseIEs} }, + ... +} + + +PositioningActivationResponseIEs NRPPA-PROTOCOL-IES ::= { + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-SystemFrameNumber CRITICALITY ignore TYPE SystemFrameNumber PRESENCE optional }| + { ID id-SlotNumber CRITICALITY ignore TYPE SlotNumber PRESENCE optional }, + ... +} + + + +-- ************************************************************** +-- +-- POSITIONING ACTIVATION FAILURE +-- +-- ************************************************************** + +PositioningActivationFailure ::= SEQUENCE { protocolIEs ProtocolIE-Container { { PositioningActivationFailureIEs} }, + ... +} + +PositioningActivationFailureIEs NRPPA-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- POSITIONING DEACTIVATION +-- +-- ************************************************************** + +PositioningDeactivation ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PositioningDeactivationIEs} }, + ... +} + +PositioningDeactivationIEs NRPPA-PROTOCOL-IES ::= { + { ID id-AbortTransmission CRITICALITY ignore TYPE AbortTransmission PRESENCE mandatory } , + ... +} + + +END +-- ASN1STOP + + +-- ASN1START +-- ************************************************************** +-- +-- Information Element Definitions +-- +-- ************************************************************** + +NRPPA-IEs { + +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) ngran-access (22) modules (3) nrppa (4) version1 (1) nrppa-IEs (2) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + + id-MeasurementQuantities-Item, id-GeographicalCoordinates, id-ResultSS-RSRP, id-ResultSS-RSRQ, id-ResultCSI-RSRP, id-ResultCSI-RSRQ, id-AngleOfArrivalNR, id-SRSSpatialRelation, id-ResultNR, id-ResultEUTRA, maxCellinRANnode, maxCellReport, maxNrOfErrors, maxNoMeas, maxnoOTDOAtypes, maxServCell, id-OtherRATMeasurementQuantities-Item, id-WLANMeasurementQuantities-Item, maxGERANMeas, maxUTRANMeas, maxWLANchannels, maxnoFreqHoppingBandsMinusOne, id-TDD-Config-EUTRA-Item, maxNrOfPosSImessage, maxnoAssistInfoFailureListItems, maxNrOfSegments, maxNrOfPosSIBs, maxnoPosMeas, maxnoTRPs, maxnoTRPInfoTypes, maxNoOfMeasTRPs, maxNoPath, maxnoofAngleInfo, maxnolcs-gcs-translation, maxnoBcastCell, maxnoSRSTriggerStates, maxnoSpatialRelations, maxNRMeas, maxEUTRAMeas, maxIndexesReport, maxCellReportNR, maxnoSRS-Carriers, maxnoSCSs, maxnoSRS-Resources, maxnoSRS-PosResources, maxnoSRS-ResourceSets, maxnoSRS-ResourcePerSet, maxnoSRS-PosResourceSets, maxnoSRS-PosResourcePerSet, maxPRS-ResourceSets, maxPRS-ResourcesPerSet, maxNoSSBs, maxnoofPRSresourceSet, maxnoofPRSresource + + + +FROM NRPPA-Constants + + Criticality, + NRPPATransactionID, + ProcedureCode, + ProtocolIE-ID, + TriggeringMessage + +FROM NRPPA-CommonDataTypes + + ProtocolExtensionContainer{}, + ProtocolIE-Single-Container{}, + + NRPPA-PROTOCOL-EXTENSION, + NRPPA-PROTOCOL-IES +FROM NRPPA-Containers; + +-- A + +AbortTransmission ::= CHOICE { sRSResourceSetID SRSResourceSetID, releaseALL NULL, + choice-extension ProtocolIE-Single-Container { { AbortTransmission-ExtIEs } } +} + +AbortTransmission-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +ActiveULBWP ::= SEQUENCE { + locationAndBandwidth INTEGER (0..37949,...), subcarrierSpacing ENUMERATED {kHz15, kHz30, kHz60, kHz120,...}, cyclicPrefix ENUMERATED {normal, extended}, txDirectCurrentLocation INTEGER (0..3301,...), shift7dot5kHz ENUMERATED {true, ...} OPTIONAL, sRSConfig SRSConfig, + iE-Extensions ProtocolExtensionContainer { { ActiveULBWP-ExtIEs} } OPTIONAL, + ... +} + +ActiveULBWP-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ActivationTime ::= SFNInitialisationTime + + + +AdditionalPathList ::= SEQUENCE (SIZE (1.. maxNoPath)) OF AdditionalPathListItem + + +AdditionalPathListItem ::= SEQUENCE { relativeTimeOfPath RelativePathDelay, pathQuality TrpMeasurementQuality OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AdditionalPathListItem-ExtIEs} } OPTIONAL, + ... +} + +AdditionalPathListItem-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +AperiodicSRSResourceTriggerList ::= SEQUENCE (SIZE(1..maxnoSRSTriggerStates)) OF AperiodicSRSResourceTrigger +AperiodicSRSResourceTrigger ::= INTEGER (0..3, ...) + +Assistance-Information ::= SEQUENCE { + systemInformation SystemInformation, + iE-Extensions ProtocolExtensionContainer { { Assistance-Information-ExtIEs} } OPTIONAL, + ... +} + +Assistance-Information-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +AssistanceInformationFailureList ::= SEQUENCE (SIZE (1..maxnoAssistInfoFailureListItems)) OF SEQUENCE { posSIB-Type PosSIB-Type, outcome Outcome, + iE-Extensions ProtocolExtensionContainer { {AssistanceInformationFailureList-ExtIEs} } OPTIONAL, + ... +} + +AssistanceInformationFailureList-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +AssistanceInformationMetaData ::= SEQUENCE { encrypted ENUMERATED {true, ...} OPTIONAL, + gNSSID ENUMERATED {gps, sbas, qzss, galileo, glonass, bds, navic, ...} OPTIONAL, + sBASID ENUMERATED {waas, egnos, msas, gagan, ...} OPTIONAL, iE-Extensions ProtocolExtensionContainer { { +AssistanceInformationMetaData-ExtIEs} } OPTIONAL, + ... +} + +AssistanceInformationMetaData-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + + +-- B + +BandwidthSRS ::= CHOICE { fR1 ENUMERATED {kHz5, kHz10, kHz20, kHz40, kHz50, kHz80, kHz100, ...}, fR2 ENUMERATED {kHz50, kHz100, kHz200, kHz400, ...}, + ... +} + +BCCH ::= INTEGER (0..1023, ...) + +Broadcast ::= ENUMERATED { + start, stop, ... +} + +BroadcastPeriodicity ::= ENUMERATED { + ms80, ms160, ms320, ms640, ms1280, ms2560, ms5120, ... +} + +PositioningBroadcastCells ::= SEQUENCE (SIZE (1..maxnoBcastCell)) OF NG-RAN-CGI +BSSID ::= OCTET STRING (SIZE(6)) + +-- C + +Cause ::= CHOICE { + radioNetwork CauseRadioNetwork, protocol CauseProtocol, misc CauseMisc, + cause-Extension ProtocolIE-Single-Container {{ Cause-ExtensionIE }} +} + +Cause-ExtensionIE NRPPA-PROTOCOL-IES ::= { + ... +} + +CauseMisc ::= ENUMERATED { unspecified, + ... +} + +CauseProtocol ::= ENUMERATED { transfer-syntax-error, abstract-syntax-error-reject, abstract-syntax-error-ignore-and-notify, message-not-compatible-with-receiver-state, semantic-error, unspecified, abstract-syntax-error-falsely-constructed-message, + ... +} + +CauseRadioNetwork ::= ENUMERATED { unspecified, requested-item-not-supported, requested-item-temporarily-not-available, + ... + +} + +Cell-Portion-ID ::= INTEGER (0..4095,...) + +CGI-EUTRA ::= SEQUENCE { + pLMN-Identity PLMN-Identity, eUTRAcellIdentifier EUTRACellIdentifier, + iE-Extensions ProtocolExtensionContainer { {CGI-EUTRA-ExtIEs} } OPTIONAL, + ... +} + +CGI-EUTRA-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +CGI-NR ::= SEQUENCE { + pLMN-Identity PLMN-Identity, nRcellIdentifier NRCellIdentifier, + iE-Extensions ProtocolExtensionContainer { {CGI-NR-ExtIEs} } OPTIONAL, + ... +} + +CGI-NR-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +CPLength-EUTRA ::= ENUMERATED { normal, extended, ... +} + +CriticalityDiagnostics ::= SEQUENCE { + procedureCode ProcedureCode OPTIONAL, triggeringMessage TriggeringMessage OPTIONAL, procedureCriticality Criticality OPTIONAL, nrppatransactionID NRPPATransactionID OPTIONAL, iEsCriticalityDiagnostics CriticalityDiagnostics-IE-List OPTIONAL, iE-Extensions ProtocolExtensionContainer { {CriticalityDiagnostics-ExtIEs} } OPTIONAL, + ... +} + + +CriticalityDiagnostics-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +CriticalityDiagnostics-IE-List ::= SEQUENCE (SIZE (1..maxNrOfErrors)) OF SEQUENCE { iECriticality Criticality, iE-ID ProtocolIE-ID, typeOfError TypeOfError, + iE-Extensions ProtocolExtensionContainer { {CriticalityDiagnostics-IE-List-ExtIEs} } OPTIONAL, + ... +} + +CriticalityDiagnostics-IE-List-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +-- D + +DL-Bandwidth-EUTRA ::= ENUMERATED { + bw6, bw15, bw25, bw50, bw75, bw100, ... +} + +DL-PRS ::= SEQUENCE { + prsid INTEGER (0..255), dl-PRSResourceSetID INTEGER (0..7), dl-PRSResourceID INTEGER (0..63) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {DL-PRS-ExtIEs} } OPTIONAL, + ... +} + +DL-PRS-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +DL-PRSMutingPattern ::= CHOICE { + two BIT STRING (SIZE(2)), four BIT STRING (SIZE(4)), six BIT STRING (SIZE(6)), eight BIT STRING (SIZE(8)), sixteen BIT STRING (SIZE(16)), thirty-two BIT STRING (SIZE(32)), choice-extension ProtocolIE-Single-Container { { DL-PRSMutingPattern-ExtIEs } } +} + +DL-PRSMutingPattern-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +DLPRSResourceCoordinates ::= SEQUENCE { listofDL-PRSResourceSetARP SEQUENCE (SIZE(1.. maxPRS-ResourceSets)) OF DLPRSResourceSetARP, iE-Extensions ProtocolExtensionContainer { { DLPRSResourceCoordinates-ExtIEs } } OPTIONAL, + ... +} + +DLPRSResourceCoordinates-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +DLPRSResourceSetARP ::= SEQUENCE { + dl-PRSResourceSetID INTEGER (0..7), dL-PRSResourceSetARPLocation DL-PRSResourceSetARPLocation, listofDL-PRSResourceARP SEQUENCE (SIZE(1.. maxPRS-ResourcesPerSet)) OF DLPRSResourceARP, iE-Extensions ProtocolExtensionContainer { { DLPRSResourceSetARP-ExtIEs } } OPTIONAL, + ... +} + +DLPRSResourceSetARP-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +DL-PRSResourceSetARPLocation ::= CHOICE { relativeGeodeticLocation RelativeGeodeticLocation, relativeCartesianLocation RelativeCartesianLocation, + choice-Extension ProtocolIE-Single-Container { { DL-PRSResourceSetARPLocation-ExtIEs } } +} + +DL-PRSResourceSetARPLocation-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +DLPRSResourceARP ::= SEQUENCE { + dl-PRSResourceID INTEGER (0..63), dL-PRSResourceARPLocation DL-PRSResourceARPLocation, + iE-Extensions ProtocolExtensionContainer { { DLPRSResourceARP-ExtIEs } } OPTIONAL, + ... +} + +DLPRSResourceARP-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +DL-PRSResourceARPLocation ::= CHOICE { relativeGeodeticLocation RelativeGeodeticLocation, relativeCartesianLocation RelativeCartesianLocation, + choice-Extension ProtocolIE-Single-Container { { DL-PRSResourceARPLocation-ExtIEs } } +} + +DL-PRSResourceARPLocation-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +-- E + +E-CID-MeasurementResult ::= SEQUENCE { + servingCell-ID NG-RAN-CGI, servingCellTAC TAC, + nG-RANAccessPointPosition NG-RANAccessPointPosition OPTIONAL, measuredResults MeasuredResults OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { E-CID-MeasurementResult-ExtIEs} } OPTIONAL, + ... +} + +E-CID-MeasurementResult-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + { ID id-GeographicalCoordinates CRITICALITY ignore EXTENSION GeographicalCoordinates PRESENCE optional}, + ... +} + +EUTRACellIdentifier ::= BIT STRING (SIZE (28)) + +EARFCN ::= INTEGER (0..262143, ...) + +-- F +-- G + +GeographicalCoordinates ::= SEQUENCE { tRPPositionDefinitionType TRPPositionDefinitionType, dLPRSResourceCoordinates DLPRSResourceCoordinates OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { GeographicalCoordinates-ExtIEs } } OPTIONAL, + ... +} + +GeographicalCoordinates-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +GNB-RxTxTimeDiff ::= SEQUENCE { + rxTxTimeDiff GNBRxTxTimeDiffMeas, additionalPathList AdditionalPathList OPTIONAL, + + + iE-Extensions ProtocolExtensionContainer { { GNB-RxTxTimeDiff-ExtIEs} } OPTIONAL, + ... +} + +GNB-RxTxTimeDiff-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + + ... +} + + +GNBRxTxTimeDiffMeas ::= CHOICE { + k0 INTEGER (0.. 1970049), k1 INTEGER (0.. 985025), k2 INTEGER (0.. 492513), k3 INTEGER (0.. 246257), k4 INTEGER (0.. 123129), k5 INTEGER (0.. 61565), + choice-extension ProtocolIE-Single-Container { { GNBRxTxTimeDiffMeas-ExtIEs } } +} + +GNBRxTxTimeDiffMeas-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +-- H + +HESSID ::= OCTET STRING (SIZE(6)) + +-- I +-- J +-- K +-- L + +LCG-to-GCS-TranslationItem::= SEQUENCE { + alpha INTEGER (0..359) OPTIONAL, alphaFine INTEGER (0..9) OPTIONAL, beta INTEGER (0..359) OPTIONAL, betaFine INTEGER (0..9) OPTIONAL, gamma INTEGER (0..359) OPTIONAL, gammaFine INTEGER (0..9) OPTIONAL, ... +} + +LocationUncertainty ::= SEQUENCE { horizontalUncertainty INTEGER (0..255), horizontalConfidence INTEGER (0..100), verticalUncertainty INTEGER (0..255), verticalConfidence INTEGER (0..100), iE-Extensions ProtocolExtensionContainer { { LocationUncertainty-ExtIEs} } OPTIONAL, + ... +} + +LocationUncertainty-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +-- M + +Measurement-ID ::= INTEGER (1.. 65536) + +MeasurementBeamInfoRequest ::= ENUMERATED {true, ...} + +MeasurementBeamInfo ::= SEQUENCE { + pRS-Resource-ID PRS-Resource-ID OPTIONAL, pRS-Resource-Set-ID PRS-Resource-Set-ID OPTIONAL, sSB-Index SSB-Index OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MeasurementBeamInfo-ExtIEs} } OPTIONAL, ... +} + +MeasurementBeamInfo-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +MeasurementPeriodicity ::= ENUMERATED { + ms120, ms240, ms480, ms640, ms1024, ms2048, ms5120, ms10240, min1, min6, min12, min30, min60, ... +} + +MeasurementQuantities ::= SEQUENCE (SIZE (1.. maxNoMeas)) OF ProtocolIE-Single-Container { {MeasurementQuantities-ItemIEs} } +MeasurementQuantities-ItemIEs NRPPA-PROTOCOL-IES ::= { + { ID id-MeasurementQuantities-Item CRITICALITY reject TYPE MeasurementQuantities-Item PRESENCE mandatory} +} + +MeasurementQuantities-Item ::= SEQUENCE { + measurementQuantitiesValue MeasurementQuantitiesValue, iE-Extensions ProtocolExtensionContainer { { MeasurementQuantitiesValue-ExtIEs} } OPTIONAL, ... +} + +MeasurementQuantitiesValue-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +MeasurementQuantitiesValue ::= ENUMERATED { cell-ID, angleOfArrival, timingAdvanceType1, timingAdvanceType2, rSRP, rSRQ, ... , sS-RSRP, sS-RSRQ, cSI-RSRP, cSI-RSRQ, angleOfArrivalNR +} + +MeasuredResults ::= SEQUENCE (SIZE (1.. maxNoMeas)) OF MeasuredResultsValue + +MeasuredResultsValue ::= CHOICE { + valueAngleOfArrival-EUTRA INTEGER (0..719), valueTimingAdvanceType1-EUTRA INTEGER (0..7690), valueTimingAdvanceType2-EUTRA INTEGER (0..7690), resultRSRP-EUTRA ResultRSRP-EUTRA, resultRSRQ-EUTRA ResultRSRQ-EUTRA, + measuredResultsValue-Extension ProtocolIE-Single-Container {{ MeasuredResultsValue-ExtensionIE }} +} + +MeasuredResultsValue-ExtensionIE NRPPA-PROTOCOL-IES ::= { +{ ID id-ResultSS-RSRP CRITICALITY ignore TYPE ResultSS-RSRP PRESENCE mandatory }| + { ID id-ResultSS-RSRQ CRITICALITY ignore TYPE ResultSS-RSRQ PRESENCE mandatory }| { ID id-ResultCSI-RSRP CRITICALITY ignore TYPE ResultCSI-RSRP PRESENCE mandatory }| + { ID id-ResultCSI-RSRQ CRITICALITY ignore TYPE ResultCSI-RSRQ PRESENCE mandatory }| + { ID id-AngleOfArrivalNR CRITICALITY ignore TYPE UL-AoA PRESENCE mandatory }, + ... +} + +-- N + +NarrowBandIndex ::= INTEGER (0..15,...) + +NG-RANAccessPointPosition ::= SEQUENCE { + latitudeSign ENUMERATED {north, south}, latitude INTEGER (0..8388607), longitude INTEGER (-8388608..8388607), directionOfAltitude ENUMERATED {height, depth}, altitude INTEGER (0..32767), uncertaintySemi-major INTEGER (0..127), uncertaintySemi-minor INTEGER (0..127), orientationOfMajorAxis INTEGER (0..179), uncertaintyAltitude INTEGER (0..127), + confidence INTEGER (0..100), + iE-Extensions ProtocolExtensionContainer { { NG-RANAccessPointPosition-ExtIEs} } OPTIONAL, + ... +} + +NG-RANAccessPointPosition-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +NGRANHighAccuracyAccessPointPosition ::= SEQUENCE { + latitude INTEGER (-2147483648.. 2147483647), longitude INTEGER (-2147483648.. 2147483647), altitude INTEGER (-64000..1280000), uncertaintySemi-major INTEGER (0..255), uncertaintySemi-minor INTEGER (0..255), orientationOfMajorAxis INTEGER (0..179), horizontalConfidence INTEGER (0..100), uncertaintyAltitude INTEGER (0..255), verticalConfidence INTEGER (0..100), + iE-Extensions ProtocolExtensionContainer { { NGRANHighAccuracyAccessPointPosition-ExtIEs} } OPTIONAL, + ... +} + +NGRANHighAccuracyAccessPointPosition-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +NG-RAN-CGI ::= SEQUENCE { + pLMN-Identity PLMN-Identity, nG-RANcell NG-RANCell, + iE-Extensions ProtocolExtensionContainer { {NG-RAN-CGI-ExtIEs} } OPTIONAL, + ... +} + +NG-RAN-CGI-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +NG-RANCell ::= CHOICE { eUTRA-CellID EUTRACellIdentifier, nR-CellID NRCellIdentifier, + nG-RANCell-Extension ProtocolIE-Single-Container {{ NG-RANCell-ExtensionIE }} +} + +NG-RANCell-ExtensionIE NRPPA-PROTOCOL-IES ::= { + ... +} + +NR-ARFCN ::= INTEGER (0..3279165) + +NRCellIdentifier ::= BIT STRING (SIZE (36)) + +NR-PCI ::= INTEGER (0..1007) + +NR-PRS-Beam-Information ::= SEQUENCE { nR-PRS-Beam-InformationList SEQUENCE (SIZE(1.. maxPRS-ResourceSets)) OF NR-PRS-Beam-InformationItem, lCG-to-GCS-TranslationList SEQUENCE (SIZE(1..maxnolcs-gcs-translation)) OF LCG-to-GCS-TranslationItem, iE-Extensions ProtocolExtensionContainer { { NR-PRS-Beam-Information-IEs} } OPTIONAL, ... +} + +NR-PRS-Beam-Information-IEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +NR-PRS-Beam-InformationItem ::= SEQUENCE { pRSresourceSetID INTEGER (0..7), pRSAngleItem SEQUENCE (SIZE(1..maxPRS-ResourcesPerSet)) OF PRSAngleItem, + ... +} + +NumberOfAntennaPorts-EUTRA ::= ENUMERATED { + n1-or-n2, n4, ... +} + +NumberOfDlFrames-EUTRA ::= ENUMERATED { + sf1, sf2, sf4, sf6, ... +} + +NumberOfDlFrames-Extended-EUTRA ::= INTEGER (1..160,...) + +NumberOfFrequencyHoppingBands ::= ENUMERATED { twobands, fourbands, ... +} + +NZP-CSI-RS-ResourceID::= INTEGER (0..191, ...) + +-- O + +OTDOACells ::= SEQUENCE (SIZE (1.. maxCellinRANnode)) OF SEQUENCE { + oTDOACellInfo OTDOACell-Information, + iE-Extensions ProtocolExtensionContainer { {OTDOACells-ExtIEs} } OPTIONAL, + ... +} + +OTDOACells-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +OTDOACell-Information ::= SEQUENCE (SIZE (1..maxnoOTDOAtypes)) OF OTDOACell-Information-Item + + + +OTDOACell-Information-Item ::= CHOICE { + pCI-EUTRA PCI-EUTRA, cGI-EUTRA CGI-EUTRA, tAC TAC, eARFCN EARFCN, + pRS-Bandwidth-EUTRA PRS-Bandwidth-EUTRA, pRS-ConfigurationIndex-EUTRA PRS-ConfigurationIndex-EUTRA, cPLength-EUTRA CPLength-EUTRA, + numberOfDlFrames-EUTRA NumberOfDlFrames-EUTRA, numberOfAntennaPorts-EUTRA NumberOfAntennaPorts-EUTRA, sFNInitialisationTime-EUTRA SFNInitialisationTime-EUTRA, nG-RANAccessPointPosition NG-RANAccessPointPosition, pRSMutingConfiguration-EUTRA PRSMutingConfiguration-EUTRA, + prsid-EUTRA PRS-ID-EUTRA, tpid-EUTRA TP-ID-EUTRA, tpType-EUTRA TP-Type-EUTRA, + numberOfDlFrames-Extended-EUTRA NumberOfDlFrames-Extended-EUTRA, crsCPlength-EUTRA CPLength-EUTRA, dL-Bandwidth-EUTRA DL-Bandwidth-EUTRA, pRSOccasionGroup-EUTRA PRSOccasionGroup-EUTRA, + pRSFrequencyHoppingConfiguration-EUTRA PRSFrequencyHoppingConfiguration-EUTRA, + oTDOACell-Information-Item-Extension ProtocolIE-Single-Container {{ OTDOACell-Information-Item-ExtensionIE }} +} + +OTDOACell-Information-Item-ExtensionIE NRPPA-PROTOCOL-IES ::= { + { ID id-TDD-Config-EUTRA-Item CRITICALITY ignore TYPE TDD-Config-EUTRA-Item PRESENCE optional }, + ... +} + +OTDOA-Information-Item ::= ENUMERATED { + pci, cGI, tac, earfcn, prsBandwidth, prsConfigIndex, cpLength, noDlFrames, noAntennaPorts, sFNInitTime, nG-RANAccessPointPosition, prsmutingconfiguration, prsid, tpid, tpType, crsCPlength, dlBandwidth, multipleprsConfigurationsperCell, prsOccasionGroup, prsFrequencyHoppingConfiguration, + ..., + tddConfig +} + +OtherRATMeasurementQuantities ::= SEQUENCE (SIZE (0.. maxNoMeas)) OF ProtocolIE-Single-Container { {OtherRATMeasurementQuantities-ItemIEs} } + +OtherRATMeasurementQuantities-ItemIEs NRPPA-PROTOCOL-IES ::= { + { ID id-OtherRATMeasurementQuantities-Item CRITICALITY reject TYPE OtherRATMeasurementQuantities-Item PRESENCE mandatory}} + +OtherRATMeasurementQuantities-Item ::= SEQUENCE { otherRATMeasurementQuantitiesValue OtherRATMeasurementQuantitiesValue, + iE-Extensions ProtocolExtensionContainer { { OtherRATMeasurementQuantitiesValue-ExtIEs} } OPTIONAL, ... +} + +OtherRATMeasurementQuantitiesValue-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +OtherRATMeasurementQuantitiesValue ::= ENUMERATED { + geran, utran, ... , nR, eUTRA +} + +OtherRATMeasurementResult ::= SEQUENCE (SIZE (1.. maxNoMeas)) OF OtherRATMeasuredResultsValue +OtherRATMeasuredResultsValue ::= CHOICE { + resultGERAN ResultGERAN, resultUTRAN ResultUTRAN, + otherRATMeasuredResultsValue-Extension ProtocolIE-Single-Container {{ OtherRATMeasuredResultsValue-ExtensionIE }} +} + + +OtherRATMeasuredResultsValue-ExtensionIE NRPPA-PROTOCOL-IES ::= { + { ID id-ResultNR CRITICALITY ignore TYPE ResultNR PRESENCE mandatory }| + { ID id-ResultEUTRA CRITICALITY ignore TYPE ResultEUTRA PRESENCE mandatory }, + ... +} + +Outcome ::= ENUMERATED { + failed, ... +} + + +-- P + +PathlossReferenceInformation ::= SEQUENCE { + pathlossReferenceSignal PathlossReferenceSignal, + iE-Extensions ProtocolExtensionContainer { { PathlossReferenceInformation-ExtIEs } } OPTIONAL, + ... +} + +PathlossReferenceInformation-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + + ... +} + + +PathlossReferenceSignal ::= CHOICE { + sSB-Reference SSB, dL-PRS-Reference DL-PRS, + choice-Extension ProtocolIE-Single-Container {{ PathlossReferenceSignal-ExtensionIE }} +} + +PathlossReferenceSignal-ExtensionIE NRPPA-PROTOCOL-IES ::= { + ... +} + + +PCI-EUTRA ::= INTEGER (0..503, ...) +PhysCellIDGERAN ::= INTEGER (0..63, ...) + +PhysCellIDUTRA-FDD ::= INTEGER (0..511, ...) +PhysCellIDUTRA-TDD ::= INTEGER (0..127, ...) + +PLMN-Identity ::= OCTET STRING (SIZE(3)) + +PeriodicityList ::= SEQUENCE (SIZE (1.. maxnoSRS-ResourcePerSet)) OF PeriodicityItem + +PeriodicityItem ::= ENUMERATED {ms0dot125, ms0dot25, ms0dot5, ms0dot625, ms1, ms1dot25, ms2, ms2dot5, ms4dot, ms5, ms8, ms10, ms16, ms20, ms32, ms40, ms64, ms80m, ms160, ms320, ms640m, ms1280, ms2560, ms5120, ms10240, ...} + + +PosSIBs ::= SEQUENCE (SIZE (1.. maxNrOfPosSIBs)) OF SEQUENCE { + posSIB-Type PosSIB-Type, posSIB-Segments PosSIB-Segments, + assistanceInformationMetaData AssistanceInformationMetaData OPTIONAL, broadcastPriority INTEGER (1..16,...) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PosSIBs-ExtIEs} } OPTIONAL, ... +} + +PosSIBs-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PosSIB-Segments ::= SEQUENCE (SIZE (1.. maxNrOfSegments)) OF SEQUENCE { assistanceDataSIBelement OCTET STRING, + iE-Extensions ProtocolExtensionContainer { { PosSIB-Segments-ExtIEs} } OPTIONAL, ... +} + +PosSIB-Segments-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PosSIB-Type ::= ENUMERATED { posSibType1-1, posSibType1-2, posSibType1-3, posSibType1-4, posSibType1-5, posSibType1-6, posSibType1-7, posSibType1-8, posSibType2-1, posSibType2-2, posSibType2-3, posSibType2-4, posSibType2-5, posSibType2-6, posSibType2-7, posSibType2-8, posSibType2-9, posSibType2-10, posSibType2-11, posSibType2-12, posSibType2-13, posSibType2-14, posSibType2-15, posSibType2-16, posSibType2-17, posSibType2-18, posSibType2-19, posSibType2-20, posSibType2-21, posSibType2-22, posSibType2-23, posSibType2-24, posSibType2-25, posSibType3-1, posSibType4-1, posSibType5-1, posSibType6-1, posSibType6-2, posSibType6-3, + ... +} + +PosSRSResource-List ::= SEQUENCE (SIZE (1..maxnoSRS-PosResources)) OF PosSRSResource-Item + +PosSRSResource-Item ::= SEQUENCE { + srs-PosResourceId SRSPosResourceID, transmissionCombPos TransmissionCombPos, startPosition INTEGER (0..13), nrofSymbols ENUMERATED {n1, n2, n4, n8, n12}, freqDomainShift INTEGER (0..268), c-SRS INTEGER (0..63), groupOrSequenceHopping ENUMERATED { neither, groupHopping, sequenceHopping }, resourceTypePos ResourceTypePos, + + sequenceId INTEGER (0.. 65535), spatialRelationPos SpatialRelationPos OPTIONAL, iE-Extensions ProtocolExtensionContainer { { PosSRSResource-Item-ExtIEs} } OPTIONAL, + ... +} + +PosSRSResource-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +PosSRSResourceSet-List ::= SEQUENCE (SIZE (1..maxnoSRS-PosResourceSets)) OF PosSRSResourceSet-Item +PosSRSResourceID-List ::= SEQUENCE (SIZE (1..maxnoSRS-PosResourcePerSet)) OF SRSPosResourceID + + +PosSRSResourceSet-Item ::= SEQUENCE { + possrsResourceSetID INTEGER(0..15), possRSResourceID-List PosSRSResourceID-List, posresourceSetType PosResourceSetType, + iE-Extensions ProtocolExtensionContainer { { PosSRSResourceSet-Item-ExtIEs} } OPTIONAL, + ... +} + +PosSRSResourceSet-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PosResourceSetType ::= CHOICE { + periodic PosResourceSetTypePeriodic, semi-persistent PosResourceSetTypeSemi-persistent, aperiodic PosResourceSetTypeAperiodic, + choice-extension ProtocolIE-Single-Container {{ PosResourceSetType-ExtIEs }} +} + +PosResourceSetType-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +PosResourceSetTypePeriodic ::= SEQUENCE { posperiodicSet ENUMERATED{true, ...}, + iE-Extensions ProtocolExtensionContainer { { PosResourceSetTypePeriodic-ExtIEs} } OPTIONAL, + ... +} + +PosResourceSetTypePeriodic-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PosResourceSetTypeSemi-persistent ::= SEQUENCE { possemi-persistentSet ENUMERATED{true, ...}, iE-Extensions ProtocolExtensionContainer { { PosResourceSetTypeSemi-persistent-ExtIEs} } OPTIONAL, + ... +} + + +PosResourceSetTypeSemi-persistent-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PosResourceSetTypeAperiodic ::= SEQUENCE { sRSResourceTrigger INTEGER(1..3), + iE-Extensions ProtocolExtensionContainer { { PosResourceSetTypeAperiodic-ExtIEs} } OPTIONAL, + ... +} + +PosResourceSetTypeAperiodic-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRS-Bandwidth-EUTRA ::= ENUMERATED { + bw6, bw15, bw25, bw50, bw75, bw100, ... +} + + +PRSAngleItem ::= SEQUENCE { pRSresourceAngleID INTEGER (0..63), nRPRSAzimuth INTEGER (0..359), nRPRSAzimuthFine INTEGER (0..9) OPTIONAL, nRPRSElevation INTEGER (0..180) OPTIONAL, nRPRSElevationFine INTEGER (0..9) OPTIONAL, + ... +} + + +PRSInformationPos ::= SEQUENCE { + pRS-IDPos INTEGER(0..255) OPTIONAL, pRS-Resource-Set-IDPos INTEGER(0..7), pRS-Resource-IDPos INTEGER(0..63), + iE-Extensions ProtocolExtensionContainer { { PRSInformationPos-ExtIEs} } OPTIONAL, + ... +} + +PRSInformationPos-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRSConfiguration ::= SEQUENCE { + pRSResourceSet-List PRSResourceSet-List, + iE-Extensions ProtocolExtensionContainer { { PRSConfiguration-ExtIEs} } OPTIONAL, + ... +} + +PRSConfiguration-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +PRS-ConfigurationIndex-EUTRA ::= INTEGER (0..4095, ...) + +PRS-ID-EUTRA ::= INTEGER (0..4095, ...) + +PRSMutingConfiguration-EUTRA ::= CHOICE { + two BIT STRING (SIZE (2)), four BIT STRING (SIZE (4)), eight BIT STRING (SIZE (8)), sixteen BIT STRING (SIZE (16)), thirty-two BIT STRING (SIZE (32)), sixty-four BIT STRING (SIZE (64)), + one-hundred-and-twenty-eight BIT STRING (SIZE (128)), two-hundred-and-fifty-six BIT STRING (SIZE (256)), five-hundred-and-twelve BIT STRING (SIZE (512)), one-thousand-and-twenty-four BIT STRING (SIZE (1024)), + pRSMutingConfiguration-EUTRA-Extension ProtocolIE-Single-Container {{ PRSMutingConfiguration-EUTRA-ExtensionIE }} +} + +PRSMutingConfiguration-EUTRA-ExtensionIE NRPPA-PROTOCOL-IES ::= { + ... +} + +PRSOccasionGroup-EUTRA ::= ENUMERATED { + og2, og4, og8, og16, og32, og64, og128, ... +} + +PRSFrequencyHoppingConfiguration-EUTRA ::= SEQUENCE { noOfFreqHoppingBands NumberOfFrequencyHoppingBands, bandPositions SEQUENCE(SIZE (1..maxnoFreqHoppingBandsMinusOne)) OF NarrowBandIndex, + iE-Extensions ProtocolExtensionContainer { { PRSFrequencyHoppingConfiguration-EUTRA-Item-IEs} } OPTIONAL, + ... +} + +PRSFrequencyHoppingConfiguration-EUTRA-Item-IEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRSMuting::= SEQUENCE { + pRSMutingOption1 PRSMutingOption1, pRSMutingOption2 PRSMutingOption2, iE-Extensions ProtocolExtensionContainer { { PRSMuting-ExtIEs} } OPTIONAL, + ... + + +} +PRSMuting-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +PRSMutingOption1 ::= SEQUENCE { + mutingPattern DL-PRSMutingPattern, + mutingBitRepetitionFactor ENUMERATED{n1,n2,n4,n8,...}, + iE-Extensions ProtocolExtensionContainer { { PRSMutingOption1-ExtIEs} } OPTIONAL, + ... +} +PRSMutingOption1-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRSMutingOption2 ::= SEQUENCE { + mutingPattern DL-PRSMutingPattern, + iE-Extensions ProtocolExtensionContainer { { PRSMutingOption2-ExtIEs} } OPTIONAL, + ... +} +PRSMutingOption2-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRSResource-List::= SEQUENCE (SIZE (1..maxnoofPRSresource)) OF PRSResource-Item +PRSResource-Item ::= SEQUENCE { + pRSResourceID INTEGER(0..63), sequenceID INTEGER(0..4095,...), rEOffset INTEGER(0..11), + resourceSlotOffset INTEGER(0..511,...), resourceSymbolOffset INTEGER(0..12,...), qCLInfo PRSResource-QCLInfo OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PRSResource-Item-ExtIEs} } OPTIONAL, + ... +} +PRSResource-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRSResource-QCLInfo ::= SEQUENCE { + qCLSourceSSBIndex INTEGER(0..63) OPTIONAL, qCLSourcePRSInfo PRSResource-QCLSourcePRSInfo OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PRSResource-QCLInfo-ExtIEs} } OPTIONAL, + ... +} +PRSResource-QCLInfo-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRSResource-QCLSourcePRSInfo ::= SEQUENCE { qCLSourcePRSResourceSetID INTEGER(0..7), qCLSourcePRSResourceID INTEGER(0..63) OPTIONAL, iE-Extensions ProtocolExtensionContainer { { PRSResource-QCLSourcePRSInfo-ExtIEs} } OPTIONAL, + ... +} +PRSResource-QCLSourcePRSInfo-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + + +PRSResourceSet-List ::= SEQUENCE (SIZE (1..maxnoofPRSresourceSet)) OF PRSResourceSet-Item +PRSResourceSet-Item ::= SEQUENCE { + pRSResourceSetID INTEGER(0..7), subcarrierSpacing ENUMERATED{kHz15, kHz30, kHz60, kHz120, ...}, pRSbandwidth INTEGER(1..63), startPRB INTEGER(0..2176), pointA INTEGER (0..3279165), combSize ENUMERATED{n2, n4, n6, n12, ...}, cPType ENUMERATED{normal, extended, ...}, + resourceSetPeriodicity ENUMERATED{n4,n5,n8,n10,n16,n20,n32,n40,n64,n80,n160,n320,n640,n1280,n2560,n5120,n10240,n20480,n40960, n81920,...}, resourceSetSlotOffset INTEGER(0..81919,...), resourceRepetitionFactor ENUMERATED{rf1,rf2,rf4,rf6,rf8,rf16,rf32,...}, resourceTimeGap ENUMERATED{tg1,tg2,tg4,tg8,tg16,tg32,...}, resourceNumberofSymbols ENUMERATED{n2,n4,n6,n12,...}, pRSMuting PRSMuting OPTIONAL, + pRSResourceTransmitPower INTEGER(-60..50), pRSResource-List PRSResource-List, + iE-Extensions ProtocolExtensionContainer { { PRSResourceSet-Item-ExtIEs} } OPTIONAL, + ... +} + +PRSResourceSet-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +PRS-Resource-ID ::= INTEGER (0..63) + +PRS-Resource-Set-ID ::= INTEGER(0..7) + +PRS-ID ::= INTEGER(0..255) + + +-- Q +-- R + +ReferenceSignal ::= CHOICE { + nZP-CSI-RS NZP-CSI-RS-ResourceID, + sSB SSB, + sRS SRSResourceID, + positioningSRS SRSPosResourceID, + dL-PRS DL-PRS, + choice-Extension ProtocolIE-Single-Container {{ReferenceSignal-ExtensionIE }} +} + +ReferenceSignal-ExtensionIE NRPPA-PROTOCOL-IES ::= { + ... +} + +ReferencePoint ::= CHOICE { + relativeCoordinateID CoordinateID, referencePointCoordinate NG-RANAccessPointPosition, referencePointCoordinateHA NGRANHighAccuracyAccessPointPosition, choice-Extension ProtocolIE-Single-Container { { ReferencePoint-ExtIEs} } +} + +ReferencePoint-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +CoordinateID ::= INTEGER (0..511, ...) +RelativeGeodeticLocation ::= SEQUENCE { milli-Arc-SecondUnits ENUMERATED {zerodot03, zerodot3, three, ...}, heightUnits ENUMERATED {mm, cm, m, ...}, deltaLatitude INTEGER (-1024.. 1023), deltaLongitude INTEGER (-1024.. 1023), deltaHeight INTEGER (-1024.. 1023), locationUncertainty LocationUncertainty, + iE-extensions ProtocolExtensionContainer {{RelativeGeodeticLocation-ExtIEs }} OPTIONAL, + ... +} + +RelativeGeodeticLocation-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +RelativeCartesianLocation ::= SEQUENCE { + xYZunit ENUMERATED {mm, cm, dm, ...}, xvalue INTEGER (-65536..65535), yvalue INTEGER (-65536..65535), zvalue INTEGER (-32768..32767), locationUncertainty LocationUncertainty, + iE-Extensions ProtocolExtensionContainer { { RelativeCartesianLocation-ExtIEs} } OPTIONAL, + ... +} + +RelativeCartesianLocation-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +RelativePathDelay ::= CHOICE { + k0 INTEGER(0..16351,...), k1 INTEGER(0..8176,...), k2 INTEGER(0..4088,...), k3 INTEGER(0..2044,...), k4 INTEGER(0..1022,...), k5 INTEGER(0..511,...), + + + ... +} + +ReportCharacteristics ::= ENUMERATED { onDemand, periodic, ... +} + +RequestedSRSTransmissionCharacteristics ::= SEQUENCE { + numberOfTransmissions INTEGER (0..500,...) OPTIONAL, resourceType ENUMERATED {periodic, semi-persistent, aperiodic, ...}, bandwidth BandwidthSRS, + listOfSRSResourceSet SEQUENCE (SIZE (1.. maxnoSRS-ResourceSets)) OF SRSResourceSet-Item OPTIONAL, sSBInformation SSBInfo OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { RequestedSRSTransmissionCharacteristics-ExtIEs} } OPTIONAL, + ... +} + +RequestedSRSTransmissionCharacteristics-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SRSResourceSet-Item ::= SEQUENCE { + numberOfSRSResourcePerSet INTEGER (1..16, ...) OPTIONAL, periodicityList PeriodicityList OPTIONAL, + spatialRelationInformation SpatialRelationInfo OPTIONAL, pathlossReferenceInformation PathlossReferenceInformation OPTIONAL, + ... +} + + +ResourceSetType ::= CHOICE { + periodic ResourceSetTypePeriodic, semi-persistent ResourceSetTypeSemi-persistent, aperiodic ResourceSetTypeAperiodic, + choice-extension ProtocolIE-Single-Container {{ ResourceSetType-ExtIEs }} +} + +ResourceSetType-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +ResourceSetTypePeriodic ::= SEQUENCE { periodicSet ENUMERATED{true, ...}, + iE-Extensions ProtocolExtensionContainer { { ResourceSetTypePeriodic-ExtIEs} } OPTIONAL, + ... +} + +ResourceSetTypePeriodic-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResourceSetTypeSemi-persistent ::= SEQUENCE { semi-persistentSet ENUMERATED{true, ...}, iE-Extensions ProtocolExtensionContainer { { ResourceSetTypeSemi-persistent-ExtIEs} } OPTIONAL, + ... +} + +ResourceSetTypeSemi-persistent-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResourceSetTypeAperiodic ::= SEQUENCE { sRSResourceTrigger INTEGER(1..3), slotoffset INTEGER(1..32), + iE-Extensions ProtocolExtensionContainer { { ResourceSetTypeAperiodic-ExtIEs} } OPTIONAL, + ... +} + +ResourceSetTypeAperiodic-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ResourceType ::= CHOICE { + periodic ResourceTypePeriodic, semi-persistent ResourceTypeSemi-persistent, aperiodic ResourceTypeAperiodic, + choice-extension ProtocolIE-Single-Container {{ ResourceType-ExtIEs }} +} + +ResourceType-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +ResourceTypePeriodic ::= SEQUENCE { + periodicity ENUMERATED{slot1, slot2, slot4, slot5, slot8, slot10, slot16, slot20, slot32, slot40, slot64, slot80, slot160, slot320, slot640, slot1280, slot2560, ...}, + offset INTEGER(0..2559, ...), + iE-Extensions ProtocolExtensionContainer { { ResourceTypePeriodic-ExtIEs} } OPTIONAL, + ... +} + +ResourceTypePeriodic-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResourceTypeSemi-persistent ::= SEQUENCE { + periodicity ENUMERATED{slot1, slot2, slot4, slot5, slot8, slot10, slot16, slot20, slot32, slot40, slot64, slot80, slot160, slot320, slot640, slot1280, slot2560, ...}, + offset INTEGER(0..2559, ...), + iE-Extensions ProtocolExtensionContainer { { ResourceTypeSemi-persistent-ExtIEs} } OPTIONAL, + ... +} + +ResourceTypeSemi-persistent-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResourceTypeAperiodic ::= SEQUENCE { aperiodicResourceType ENUMERATED{true, ...}, iE-Extensions ProtocolExtensionContainer { { ResourceTypeAperiodic-ExtIEs} } OPTIONAL, + ... +} + +ResourceTypeAperiodic-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ResourceTypePos ::= CHOICE { + periodic ResourceTypePeriodicPos, semi-persistent ResourceTypeSemi-persistentPos, aperiodic ResourceTypeAperiodicPos, choice-extension ProtocolIE-Single-Container {{ ResourceTypePos-ExtIEs }} +} + +ResourceTypePos-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +ResourceTypePeriodicPos ::= SEQUENCE { periodicity ENUMERATED{slot1, slot2, slot4, slot5, slot8, slot10, slot16, slot20, slot32, slot40, slot64, slot80, slot160, slot320, slot640, slot1280, slot2560, slot5120, slot10240, slot20480, slot40960, slot81920, ...}, offset INTEGER(0..81919, ...), + iE-Extensions ProtocolExtensionContainer { { ResourceTypePeriodicPos-ExtIEs} } OPTIONAL, + ... +} + +ResourceTypePeriodicPos-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResourceTypeSemi-persistentPos ::= SEQUENCE { periodicity ENUMERATED{slot1, slot2, slot4, slot5, slot8, slot10, slot16, slot20, slot32, slot40, slot64, slot80, slot160, slot320, slot640, slot1280, slot2560, slot5120, slot10240, slot20480, slot40960, slot81920, ...}, offset INTEGER(0..81919, ...), + iE-Extensions ProtocolExtensionContainer { { ResourceTypeSemi-persistentPos-ExtIEs} } OPTIONAL, + ... +} + +ResourceTypeSemi-persistentPos-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResourceTypeAperiodicPos ::= SEQUENCE { slotOffset INTEGER (1..32), iE-Extensions ProtocolExtensionContainer { { ResourceTypeAperiodicPos-ExtIEs} } OPTIONAL, + ... +} + +ResourceTypeAperiodicPos-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultCSI-RSRP ::= SEQUENCE (SIZE (1.. maxCellReportNR)) OF ResultCSI-RSRP-Item + +ResultCSI-RSRP-Item ::= SEQUENCE { + nR-PCI NR-PCI, nR-ARFCN NR-ARFCN, nG-RAN-CGI NG-RAN-CGI OPTIONAL, valueCSI-RSRP-Cell ValueRSRP-NR OPTIONAL, cSI-RSRP-PerCSI-RS ResultCSI-RSRP-PerCSI-RS OPTIONAL, iE-Extensions ProtocolExtensionContainer { { ResultCSI-RSRP-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultCSI-RSRP-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultCSI-RSRP-PerCSI-RS ::= SEQUENCE (SIZE (1.. maxIndexesReport)) OF ResultCSI-RSRP-PerCSI-RS-Item +ResultCSI-RSRP-PerCSI-RS-Item ::= SEQUENCE { cSI-RS-Index INTEGER (0..95), valueCSI-RSRP ValueRSRP-NR, + iE-Extensions ProtocolExtensionContainer { { ResultCSI-RSRP-PerCSI-RS-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultCSI-RSRP-PerCSI-RS-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultCSI-RSRQ ::= SEQUENCE (SIZE (1.. maxCellReportNR)) OF ResultCSI-RSRQ-Item + +ResultCSI-RSRQ-Item ::= SEQUENCE { + nR-PCI NR-PCI, nR-ARFCN NR-ARFCN, + nG-RAN-CGI NG-RAN-CGI OPTIONAL, valueCSI-RSRQ-Cell ValueRSRQ-NR OPTIONAL, cSI-RSRQ-PerCSI-RS ResultCSI-RSRQ-PerCSI-RS OPTIONAL, iE-Extensions ProtocolExtensionContainer { { ResultCSI-RSRQ-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultCSI-RSRQ-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultCSI-RSRQ-PerCSI-RS ::= SEQUENCE (SIZE (1.. maxIndexesReport)) OF ResultCSI-RSRQ-PerCSI-RS-Item +ResultCSI-RSRQ-PerCSI-RS-Item ::= SEQUENCE { cSI-RS-Index INTEGER (0..95), + + valueCSI-RSRQ ValueRSRQ-NR, iE-Extensions ProtocolExtensionContainer { { ResultCSI-RSRQ-PerCSI-RS-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultCSI-RSRQ-PerCSI-RS-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultEUTRA ::= SEQUENCE (SIZE (1.. maxEUTRAMeas)) OF ResultEUTRA-Item + +ResultEUTRA-Item ::= SEQUENCE { + pCI-EUTRA PCI-EUTRA, eARFCN EARFCN, valueRSRP-EUTRA ValueRSRP-EUTRA OPTIONAL, valueRSRQ-EUTRA ValueRSRQ-EUTRA OPTIONAL, cGI-EUTRA CGI-EUTRA OPTIONAL, iE-Extensions ProtocolExtensionContainer { { ResultEUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultEUTRA-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ResultRSRP-EUTRA ::= SEQUENCE (SIZE (1.. maxCellReport)) OF ResultRSRP-EUTRA-Item + +ResultRSRP-EUTRA-Item ::= SEQUENCE { + pCI-EUTRA PCI-EUTRA, eARFCN EARFCN, + cGI-EUTRA CGI-EUTRA OPTIONAL, valueRSRP-EUTRA ValueRSRP-EUTRA, + iE-Extensions ProtocolExtensionContainer { { ResultRSRP-EUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultRSRP-EUTRA-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultRSRQ-EUTRA ::= SEQUENCE (SIZE (1.. maxCellReport)) OF ResultRSRQ-EUTRA-Item + +ResultRSRQ-EUTRA-Item ::= SEQUENCE { + pCI-EUTRA PCI-EUTRA, eARFCN EARFCN, + cGI-UTRA CGI-EUTRA OPTIONAL, valueRSRQ-EUTRA ValueRSRQ-EUTRA, + iE-Extensions ProtocolExtensionContainer { { ResultRSRQ-EUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultRSRQ-EUTRA-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ResultSS-RSRP ::= SEQUENCE (SIZE (1.. maxCellReportNR)) OF ResultSS-RSRP-Item + +ResultSS-RSRP-Item ::= SEQUENCE { + nR-PCI NR-PCI, nR-ARFCN NR-ARFCN, + nG-RAN-CGI NG-RAN-CGI OPTIONAL, valueSS-RSRP-Cell ValueRSRP-NR OPTIONAL, sS-RSRP-PerSSB ResultSS-RSRP-PerSSB OPTIONAL, iE-Extensions ProtocolExtensionContainer { { ResultSS-RSRP-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultSS-RSRP-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultSS-RSRP-PerSSB ::= SEQUENCE (SIZE (1.. maxIndexesReport)) OF ResultSS-RSRP-PerSSB-Item + +ResultSS-RSRP-PerSSB-Item ::= SEQUENCE { sSB-Index INTEGER (0..63), valueSS-RSRP ValueRSRP-NR, + iE-Extensions ProtocolExtensionContainer { { ResultSS-RSRP-PerSSB-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultSS-RSRP-PerSSB-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultSS-RSRQ ::= SEQUENCE (SIZE (1.. maxCellReportNR)) OF ResultSS-RSRQ-Item + +ResultSS-RSRQ-Item ::= SEQUENCE { + nR-PCI NR-PCI, nR-ARFCN NR-ARFCN, + nG-RAN-CGI NG-RAN-CGI OPTIONAL, valueSS-RSRQ-Cell ValueRSRQ-NR OPTIONAL, sS-RSRQ-PerSSB ResultSS-RSRQ-PerSSB OPTIONAL, iE-Extensions ProtocolExtensionContainer { { ResultSS-RSRQ-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultSS-RSRQ-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +ResultSS-RSRQ-PerSSB ::= SEQUENCE (SIZE (1.. maxIndexesReport)) OF ResultSS-RSRQ-PerSSB-Item + +ResultSS-RSRQ-PerSSB-Item ::= SEQUENCE { sSB-Index INTEGER (0..63), valueSS-RSRQ ValueRSRQ-NR, iE-Extensions ProtocolExtensionContainer { { ResultSS-RSRQ-PerSSB-Item-ExtIEs} } OPTIONAL, ... +} + +ResultSS-RSRQ-PerSSB-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ResultGERAN ::= SEQUENCE (SIZE (1.. maxGERANMeas)) OF ResultGERAN-Item + +ResultGERAN-Item ::= SEQUENCE { + bCCH BCCH, + physCellIDGERAN PhysCellIDGERAN, + rSSI RSSI, + iE-Extensions ProtocolExtensionContainer { { ResultGERAN-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultGERAN-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ResultNR ::= SEQUENCE (SIZE (1.. maxNRMeas)) OF ResultNR-Item + +ResultNR-Item ::= SEQUENCE { + nR-PCI NR-PCI, nR-ARFCN NR-ARFCN, valueSS-RSRP-Cell ValueRSRP-NR OPTIONAL, valueSS-RSRQ-Cell ValueRSRQ-NR OPTIONAL, sS-RSRP-PerSSB ResultSS-RSRP-PerSSB OPTIONAL, sS-RSRQ-PerSSB ResultSS-RSRQ-PerSSB OPTIONAL, cGI-NR CGI-NR OPTIONAL, iE-Extensions ProtocolExtensionContainer { { ResultNR-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultNR-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +ResultUTRAN ::= SEQUENCE (SIZE (1.. maxUTRANMeas)) OF ResultUTRAN-Item + +ResultUTRAN-Item ::= SEQUENCE { uARFCN UARFCN, + physCellIDUTRAN CHOICE { physCellIDUTRA-FDD PhysCellIDUTRA-FDD, physCellIDUTRA-TDD PhysCellIDUTRA-TDD + }, + uTRA-RSCP UTRA-RSCP OPTIONAL, uTRA-EcN0 UTRA-EcN0 OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ResultUTRAN-Item-ExtIEs} } OPTIONAL, + ... +} + +ResultUTRAN-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +RSSI ::= INTEGER (0..63, ...) + +-- S + +SCS-SpecificCarrier ::= SEQUENCE { offsetToCarrier INTEGER (0..2199,...), subcarrierSpacing ENUMERATED {kHz15, kHz30, kHz60, kHz120,...}, carrierBandwidth INTEGER (0..275,...), +iE-Extensions ProtocolExtensionContainer { { SCS-SpecificCarrier-ExtIEs } } OPTIONAL, + ... +} + +SCS-SpecificCarrier-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +Search-window-information ::= SEQUENCE { expectedPropagationDelay INTEGER (-3841..3841,...), delayUncertainty INTEGER (1..246,...), + iE-Extensions ProtocolExtensionContainer { { Search-window-information-ExtIEs } } OPTIONAL, + ... +} + +Search-window-information-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SFNInitialisationTime ::= BIT STRING (SIZE (64)) + +SFNInitialisationTime-EUTRA ::= BIT STRING (SIZE (64)) + +SlotNumber ::= INTEGER (0..79) + +SpatialDirectionInformation ::= SEQUENCE { nR-PRS-Beam-Information NR-PRS-Beam-Information, + iE-Extensions ProtocolExtensionContainer { { SpatialDirectionInformation-ExtIEs } } OPTIONAL, + ... +} + +SpatialDirectionInformation-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SpatialRelationInfo ::= SEQUENCE { + spatialRelationforResourceID SpatialRelationforResourceID, iE-Extensions ProtocolExtensionContainer { {SpatialRelationInfo-ExtIEs} } OPTIONAL, + ... +} + +SpatialRelationInfo-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SpatialRelationforResourceID ::= SEQUENCE (SIZE(1..maxnoSpatialRelations)) OF SpatialRelationforResourceIDItem +SpatialRelationforResourceIDItem ::= SEQUENCE { referenceSignal ReferenceSignal, + iE-Extensions ProtocolExtensionContainer { {SpatialRelationforResourceIDItem-ExtIEs} } OPTIONAL, + ... +} + +SpatialRelationforResourceIDItem-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SpatialRelationPos ::= CHOICE { + sSBPos SSBPos, + pRSInformationPos PRSInformationPos, + choice-extension ProtocolIE-Single-Container {{ SpatialInformationPos-ExtIEs }} +} + +SpatialInformationPos-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + + + +SRSConfig ::= SEQUENCE { sRSResource-List SRSResource-List OPTIONAL, posSRSResource-List PosSRSResource-List OPTIONAL, sRSResourceSet-List SRSResourceSet-List OPTIONAL, posSRSResourceSet-List PosSRSResourceSet-List OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SRSConfig-ExtIEs } } OPTIONAL, + ... +} + +SRSConfig-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +SRSCarrier-List ::= SEQUENCE (SIZE(1.. maxnoSRS-Carriers)) OF SRSCarrier-List-Item + +SRSCarrier-List-Item ::= SEQUENCE { + pointA INTEGER (0..3279165,...), + uplinkChannelBW-PerSCS-List UplinkChannelBW-PerSCS-List, + activeULBWP ActiveULBWP, + pCI INTEGER (0..1007) OPTIONAL, +iE-Extensions ProtocolExtensionContainer { { SRSCarrier-List-Item-ExtIEs } } OPTIONAL, + ... +} + +SRSCarrier-List-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SRSConfiguration ::= SEQUENCE { + sRSCarrier-List SRSCarrier-List, iE-Extensions ProtocolExtensionContainer { { SRSConfiguration-ExtIEs } } OPTIONAL, + ... +} + +SRSConfiguration-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +SRSPosResourceID ::= INTEGER (0..63, ...) + +SRSResource::= SEQUENCE { + sRSResourceID SRSResourceID, + nrofSRS-Ports ENUMERATED {port1, ports2, ports4}, transmissionComb TransmissionComb, startPosition INTEGER (0..13), nrofSymbols ENUMERATED {n1, n2, n4}, repetitionFactor ENUMERATED {n1, n2, n4}, freqDomainPosition INTEGER (0..67), freqDomainShift INTEGER (0..268), c-SRS INTEGER (0..63), b-SRS INTEGER (0..3), b-hop INTEGER (0..3), + groupOrSequenceHopping ENUMERATED { neither, groupHopping, sequenceHopping }, + resourceType ResourceType, slotOffset INTEGER (0..2559), sequenceId INTEGER (0..1023), + iE-Extensions ProtocolExtensionContainer { { SRSResource-ExtIEs } } OPTIONAL, + ... +} + +SRSResource-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +SRSResourceID ::= INTEGER (0..63, ...) + +SRSResource-List ::= SEQUENCE (SIZE (1..maxnoSRS-Resources)) OF SRSResource +SRSResourceSet-List ::= SEQUENCE (SIZE (1..maxnoSRS-ResourceSets)) OF SRSResourceSet +SRSResourceID-List::= SEQUENCE (SIZE (1..maxnoSRS-ResourcePerSet)) OF SRSResourceID +SRSResourceSet::= SEQUENCE { + sRSResourceSetID INTEGER(0..15), sRSResourceID-List SRSResourceID-List, resourceSetType ResourceSetType, iE-Extensions ProtocolExtensionContainer { { SRSResourceSet-ExtIEs } } OPTIONAL, + ... +} + +SRSResourceSet-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +SRSResourceSetID ::= INTEGER (0..15, ...) + +SRSResourceTrigger ::= SEQUENCE { aperiodicSRSResourceTriggerList AperiodicSRSResourceTriggerList, iE-Extensions ProtocolExtensionContainer { {SRSResourceTrigger-ExtIEs} } OPTIONAL, + ... +} + +SRSResourceTrigger-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +SRSSpatialRelation ::= SEQUENCE { spatialRelationforResourceID SpatialRelationforResourceID, iE-Extensions ProtocolExtensionContainer { {SRSSpatialRelation-ExtIEs} } OPTIONAL, + ... +} + +SRSSpatialRelation-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SSBInfo ::= SEQUENCE { listOfSSBInfo SEQUENCE (SIZE (1..maxNoSSBs)) OF SSBInfoList, iE-Extensions ProtocolExtensionContainer { {SSBInfo-ExtIEs} } OPTIONAL, + ... +} + +SSBInfo-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + + +SSBInfoList ::= SEQUENCE { + pCI-NR INTEGER (0..1007), sSB-Configuration TF-Configuration, + iE-Extensions ProtocolExtensionContainer { { SSBInfoList-ExtIEs} } OPTIONAL, + ... +} + + + +SSBInfoList-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SSB ::= SEQUENCE { + pCI-NR INTEGER (0..1007), ssb-index INTEGER (0..63) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SSB-ExtIEs} } OPTIONAL, + ... +} + +SSB-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SSBPos ::= SEQUENCE { + pCI-NR INTEGER (0..1007) OPTIONAL, ssb-index INTEGER (0..63), iE-Extensions ProtocolExtensionContainer { {SSBPos-ExtIEs} } OPTIONAL, + ... +} + +SSBPos-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +SSBBurstPosition ::= CHOICE { shortBitmap BIT STRING (SIZE(4)), mediumBitmap BIT STRING (SIZE(8)), longBitmap BIT STRING (SIZE(64)), ... +} + + +SSB-Index ::= INTEGER(0..63) + + +SSID ::= OCTET STRING (SIZE(1..32)) + +SystemFrameNumber ::= INTEGER (0..1023) + +SystemInformation ::= SEQUENCE (SIZE (1.. maxNrOfPosSImessage)) OF SEQUENCE { broadcastPeriodicity BroadcastPeriodicity, + posSIBs PosSIBs, + iE-Extensions ProtocolExtensionContainer { { SystemInformation-ExtIEs} } OPTIONAL, ... +} + +SystemInformation-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { +... +} + +-- T + +TAC ::= OCTET STRING (SIZE(3)) + +TDD-Config-EUTRA-Item ::= SEQUENCE { subframeAssignment ENUMERATED { sa0, sa1, sa2, sa3, sa4, sa5, sa6, ... }, + iE-Extensions ProtocolExtensionContainer { { TDD-Config-EUTRA-Item-Item-ExtIEs } } OPTIONAL, + ... +} + +TDD-Config-EUTRA-Item-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +TF-Configuration ::= SEQUENCE { + sSB-frequency INTEGER (0..3279165), + sSB-subcarrier-spacing ENUMERATED {kHz15, kHz30, kHz120, kHz240, ...}, sSB-Transmit-power INTEGER (-60..50), + sSB-periodicity ENUMERATED {ms5, ms10, ms20, ms40, ms80, ms160, ...}, sSB-half-frame-offset INTEGER(0..1), sSB-SFN-offset INTEGER(0..15), sSB-BurstPosition SSBBurstPosition OPTIONAL, sFN-initialisation-time SFNInitialisationTime OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { TF-Configuration-ExtIEs} } OPTIONAL, + ... +} + +TF-Configuration-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +TimeStamp ::= SEQUENCE { + systemFrameNumber SystemFrameNumber, + slotIndex TimeStampSlotIndex, + measurementTime SFNInitialisationTime OPTIONAL, + iE-Extension ProtocolExtensionContainer { { TimeStamp-ExtIEs} } OPTIONAL, + ... +} + +TimeStamp-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { +... +} + +TimeStampSlotIndex ::= CHOICE { + sCS-15 INTEGER(0..9), + sCS-30 INTEGER(0..19), + sCS-60 INTEGER(0..39), + sCS-120 INTEGER(0..79), + choice-extension ProtocolIE-Single-Container { { TimeStampSlotIndex-ExtIEs} } +} + +TimeStampSlotIndex-ExtIEs NRPPA-PROTOCOL-IES ::= { +... +} + +TP-ID-EUTRA ::= INTEGER (0..4095, ...) + +TP-Type-EUTRA ::= ENUMERATED { prs-only-tp, ... } + + +TransmissionComb ::= CHOICE { n2 SEQUENCE { combOffset-n2 INTEGER (0..1), cyclicShift-n2 INTEGER (0..7) + }, n4 SEQUENCE { combOffset-n4 INTEGER (0..3), cyclicShift-n4 INTEGER (0..11) + }, + choice-extension ProtocolIE-Single-Container { { TransmissionComb-ExtIEs} } } +TransmissionComb-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +TransmissionCombPos ::= CHOICE { n2 SEQUENCE { combOffset-n2 INTEGER (0..1), cyclicShift-n2 INTEGER (0..7) + }, n4 SEQUENCE { combOffset-n4 INTEGER (0..3), cyclicShift-n4 INTEGER (0..11) + }, n8 SEQUENCE { combOffset-n8 INTEGER (0..7), cyclicShift-n8 INTEGER (0..5) + }, + choice-extension ProtocolIE-Single-Container { { TransmissionCombPos-ExtIEs} } } +TransmissionCombPos-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +TRPMeasurementQuantities ::= SEQUENCE (SIZE (1..maxnoPosMeas)) OF TRPMeasurementQuantitiesList-Item +TRPMeasurementQuantitiesList-Item ::= SEQUENCE { + tRPMeasurementQuantities-Item TRPMeasurementQuantities-Item, timingReportingGranularityFactor INTEGER (0..5) OPTIONAL, iE-Extensions ProtocolExtensionContainer {{ TRPMeasurementQuantitiesList-Item-ExtIEs}} OPTIONAL, + ... + } + +TRPMeasurementQuantitiesList-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +TRPMeasurementQuantities-Item ::= ENUMERATED { gNB-RxTxTimeDiff, uL-SRS-RSRP, uL-AoA, uL-RTOA, ... +} + +TrpMeasurementResult ::= SEQUENCE (SIZE (1.. maxnoPosMeas)) OF TrpMeasurementResultItem TrpMeasurementResultItem ::= SEQUENCE { + measuredResultsValue TrpMeasuredResultsValue, + timeStamp TimeStamp, measurementQuality TrpMeasurementQuality OPTIONAL, measurementBeamInfo MeasurementBeamInfo OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{TrpMeasurementResultItem-ExtIEs}} OPTIONAL, + ... +} + +TrpMeasurementResultItem-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +TrpMeasuredResultsValue ::= CHOICE { uL-AngleOfArrival UL-AoA, uL-SRS-RSRP UL-SRS-RSRP, uL-RTOA UL-RTOAMeasurement, gNB-RxTxTimeDiff GNB-RxTxTimeDiff, + choice-extension ProtocolIE-Single-Container { { TrpMeasuredResultsValue-ExtIEs } } +} + +TrpMeasuredResultsValue-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +TrpMeasurementQuality ::= CHOICE { timingMeasQuality TrpMeasurementTimingQuality, angleMeasQuality TrpMeasurementAngleQuality, + choice-Extension ProtocolIE-Single-Container {{ TrpMeasurementQuality-ExtIEs}} + +} + +TrpMeasurementQuality-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +TrpMeasurementTimingQuality ::= SEQUENCE { measurementQuality INTEGER (0..31), resolution ENUMERATED {m0dot1, m1, m10, m30, ...}, ... +} + + +TrpMeasurementAngleQuality ::= SEQUENCE { azimuthQuality INTEGER (0..255), zenithQuality INTEGER (0..255) OPTIONAL, resolution ENUMERATED {deg0dot1, ...}, ... +} + + +TRP-MeasurementRequestList ::= SEQUENCE (SIZE (1..maxNoOfMeasTRPs)) OF TRP-MeasurementRequestItem +TRP-MeasurementRequestItem ::= SEQUENCE { + tRP-ID TRP-ID, + search-window-information Search-window-information OPTIONAL, + iE-extensions ProtocolExtensionContainer { { TRP-MeasurementRequestItem-ExtIEs } } OPTIONAL, + ... +} + +TRP-MeasurementRequestItem-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +TRP-MeasurementResponseList ::= SEQUENCE (SIZE (1..maxNoOfMeasTRPs)) OF TRP-MeasurementResponseItem +TRP-MeasurementResponseItem ::= SEQUENCE { + tRP-ID TRP-ID, + measurementResult TrpMeasurementResult, + iE-extensions ProtocolExtensionContainer { { TRP-MeasurementResponseItem-ExtIEs } } OPTIONAL, + ... +} + +TRP-MeasurementResponseItem-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +TRPInformationList ::= SEQUENCE (SIZE (1.. maxnoTRPs)) OF SEQUENCE { + tRP-ID TRP-ID, + tRPInformation TRPInformation, + iE-Extensions ProtocolExtensionContainer { {TRPInformation-ExtIEs} } OPTIONAL, + ... +} + +TRPInformation-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +TRPInformation ::= SEQUENCE (SIZE (1..maxnoTRPInfoTypes)) OF TRPInformationItem + +TRPInformationItem ::= CHOICE { + pCI-NR INTEGER (0..1007), nG-RAN-CGI NG-RAN-CGI, aRFCN INTEGER (0..3279165), pRSConfiguration PRSConfiguration, sSBinformation SSBInfo, + sFNInitialisationTime SFNInitialisationTime, spatialDirectionInformation SpatialDirectionInformation, geographicalCoordinates GeographicalCoordinates, choice-extension ProtocolIE-Single-Container { { TRPInformationItem-ExtIEs } } +} + +TRPInformationItem-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... + +} + + +TRPInformationTypeList ::= SEQUENCE (SIZE(1.. maxnoTRPInfoTypes)) OF TRPInformationTypeItem +TRPInformationTypeItem ::= ENUMERATED { + nrPCI, nG-RAN-CGI, arfcn, pRSConfig, sSBInfo, sFNInitTime, spatialDirectInfo, geoCoord, + + ... +} + +TRPList ::= SEQUENCE (SIZE(1.. maxnoTRPs)) OF TRPItem + +TRPItem ::= SEQUENCE { + tRP-ID TRP-ID, ... +} + + +TRP-ID ::= INTEGER (1.. maxnoTRPs, ...) + + +TRPPositionDefinitionType ::= CHOICE { direct TRPPositionDirect, referenced TRPPositionReferenced, + choice-extension ProtocolIE-Single-Container { { TRPPositionDefinitionType-ExtIEs } } +} + +TRPPositionDefinitionType-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + + +TRPPositionDirect ::= SEQUENCE { accuracy TRPPositionDirectAccuracy, iE-extensions ProtocolExtensionContainer { { TRPPositionDirect-ExtIEs } } OPTIONAL, + + + ... +} + +TRPPositionDirect-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +TRPPositionDirectAccuracy ::= CHOICE { + tRPPosition NG-RANAccessPointPosition , + tRPHAposition NGRANHighAccuracyAccessPointPosition , + choice-extension ProtocolIE-Single-Container { { TRPPositionDirectAccuracy-ExtIEs } } +} + +TRPPositionDirectAccuracy-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + +TRPPositionReferenced ::= SEQUENCE { + referencePoint ReferencePoint, referencePointType TRPReferencePointType, + iE-extensions ProtocolExtensionContainer { { TRPPositionReferenced-ExtIEs } } OPTIONAL, ... +} + +TRPPositionReferenced-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +TRPReferencePointType ::= CHOICE { tRPPositionRelativeGeodetic RelativeGeodeticLocation, tRPPositionRelativeCartesian RelativeCartesianLocation, + choice-extension ProtocolIE-Single-Container { { TRPReferencePointType-ExtIEs } } +} + +TRPReferencePointType-ExtIEs NRPPA-PROTOCOL-IES ::= { + ... +} + + +TypeOfError ::= ENUMERATED { not-understood, missing, ... +} + +-- U + +UARFCN ::= INTEGER (0..16383, ...) + +UE-Measurement-ID ::= INTEGER (1..15, ..., 256) + +UTRA-EcN0 ::= INTEGER (0..49, ...) + +UTRA-RSCP ::= INTEGER (-5..91, ...) + + +UL-AoA ::= SEQUENCE { + azimuthAoA INTEGER (0..3599), zenithAoA INTEGER (0..1799) OPTIONAL, + angleCoordinateSystem ENUMERATED {lCS, gCS} OPTIONAL, iE-extensions ProtocolExtensionContainer { { UL-AoA-ExtIEs } } OPTIONAL, + ... +} + +UL-AoA-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + + +UL-RTOAMeasurement ::= SEQUENCE { + uLRTOAmeas ULRTOAMeas, + additionalPathList AdditionalPathList OPTIONAL, + ... +} + +ULRTOAMeas::= CHOICE { k0 INTEGER (0.. 1970049), k1 INTEGER (0.. 985025), k2 INTEGER (0.. 492513), k3 INTEGER (0.. 246257), k4 INTEGER (0.. 123129), k5 INTEGER (0.. 61565), ... +} + + +UL-SRS-RSRP ::= INTEGER (0..127) + +UplinkChannelBW-PerSCS-List ::= SEQUENCE (SIZE (1..maxnoSCSs)) OF SCS-SpecificCarrier + + +-- V + +ValueRSRP-EUTRA ::= INTEGER (0..97, ...) +ValueRSRQ-EUTRA ::= INTEGER (0..34, ...) + +ValueRSRP-NR ::= INTEGER (0..127) +ValueRSRQ-NR ::= INTEGER (0..127) + + +-- W + +WLANMeasurementQuantities ::= SEQUENCE (SIZE (0.. maxNoMeas)) OF ProtocolIE-Single-Container { {WLANMeasurementQuantities-ItemIEs} } + +WLANMeasurementQuantities-ItemIEs NRPPA-PROTOCOL-IES ::= { + { ID id-WLANMeasurementQuantities-Item CRITICALITY reject TYPE WLANMeasurementQuantities-Item PRESENCE mandatory}} + +WLANMeasurementQuantities-Item ::= SEQUENCE { wLANMeasurementQuantitiesValue WLANMeasurementQuantitiesValue, iE-Extensions ProtocolExtensionContainer { { WLANMeasurementQuantitiesValue-ExtIEs} } OPTIONAL, ... +} + +WLANMeasurementQuantitiesValue-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +WLANMeasurementQuantitiesValue ::= ENUMERATED { + wlan, ... +} + +WLANMeasurementResult ::= SEQUENCE (SIZE (1..maxNoMeas)) OF WLANMeasurementResult-Item +WLANMeasurementResult-Item ::= SEQUENCE { + wLAN-RSSI WLAN-RSSI, + sSID SSID OPTIONAL, bSSID BSSID OPTIONAL, hESSID HESSID OPTIONAL, operatingClass WLANOperatingClass OPTIONAL, countryCode WLANCountryCode OPTIONAL, wLANChannelList WLANChannelList OPTIONAL, wLANBand WLANBand OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { WLANMeasurementResult-Item-ExtIEs } } OPTIONAL, + ... +} + +WLANMeasurementResult-Item-ExtIEs NRPPA-PROTOCOL-EXTENSION ::= { + ... +} + +WLAN-RSSI ::= INTEGER (0..141, ...) + +WLANBand ::= ENUMERATED {band2dot4, band5, ...} + +WLANChannelList ::= SEQUENCE (SIZE (1..maxWLANchannels)) OF WLANChannel + +WLANChannel ::= INTEGER (0..255) +WLANCountryCode ::= ENUMERATED { unitedStates, europe, japan, global, ... +} + +WLANOperatingClass ::= INTEGER (0..255) + +-- X +-- Y +-- Z + +END +-- ASN1STOP + + +-- ASN1START +-- ************************************************************** +-- +-- Common definitions +-- +-- ************************************************************** + +NRPPA-CommonDataTypes { itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) ngran-access (22) modules (3) nrppa (4) version1 (1) nrppa-CommonDataTypes (3)} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- Extension constants +-- +-- ************************************************************** + +maxPrivateIEs INTEGER ::= 65535 maxProtocolExtensions INTEGER ::= 65535 maxProtocolIEs INTEGER ::= 65535 + +-- ************************************************************** +-- +-- Common Data Types +-- +-- ************************************************************** + +Criticality ::= ENUMERATED { reject, ignore, notify } + +NRPPATransactionID ::= INTEGER (0..32767) + + +Presence ::= ENUMERATED { optional, conditional, mandatory } + +PrivateIE-ID ::= CHOICE { local INTEGER (0.. maxPrivateIEs), global OBJECT IDENTIFIER +} + +ProcedureCode ::= INTEGER (0..255) + +ProtocolIE-ID ::= INTEGER (0..maxProtocolIEs) + +TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessful-outcome} + +END +-- ASN1STOP + + +-- ASN1START +-- ************************************************************** +-- +-- Constant definitions +-- +-- ************************************************************** + +NRPPA-Constants { itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) ngran-access (22) modules (3) nrppa (4) version1 (1) nrppa-Constants (4) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + + ProcedureCode, + ProtocolIE-ID +FROM NRPPA-CommonDataTypes; + +-- ************************************************************** -- +-- Elementary Procedures +-- +-- ************************************************************** + +id-errorIndication ProcedureCode ::= 0 id-privateMessage ProcedureCode ::= 1 id-e-CIDMeasurementInitiation ProcedureCode ::= 2 id-e-CIDMeasurementFailureIndication ProcedureCode ::= 3 id-e-CIDMeasurementReport ProcedureCode ::= 4 id-e-CIDMeasurementTermination ProcedureCode ::= 5 id-oTDOAInformationExchange ProcedureCode ::= 6 id-assistanceInformationControl ProcedureCode ::= 7 id-assistanceInformationFeedback ProcedureCode ::= 8 id-positioningInformationExchange ProcedureCode ::= 9 id-positioningInformationUpdate ProcedureCode ::= 10 id-Measurement ProcedureCode ::= 11 id-MeasurementReport ProcedureCode ::= 12 id-MeasurementUpdate ProcedureCode ::= 13 + + +id-MeasurementAbort ProcedureCode ::= 14 id-MeasurementFailureIndication ProcedureCode ::= 15 id-tRPInformationExchange ProcedureCode ::= 16 id-positioningActivation ProcedureCode ::= 17 id-positioningDeactivation ProcedureCode ::= 18 + +-- ************************************************************** +-- +-- Lists +-- +-- ************************************************************** + +maxNrOfErrors INTEGER ::= 256 maxCellinRANnode INTEGER ::= 3840 maxIndexesReport INTEGER ::= 64 maxNoMeas INTEGER ::= 64 maxCellReport INTEGER ::= 9 maxCellReportNR INTEGER ::= 9 maxnoOTDOAtypes INTEGER ::= 63 maxServCell INTEGER ::= 5 maxEUTRAMeas INTEGER ::= 8 maxGERANMeas INTEGER ::= 8 maxNRMeas INTEGER ::= 8 maxUTRANMeas INTEGER ::= 8 maxWLANchannels INTEGER ::= 16 maxnoFreqHoppingBandsMinusOne INTEGER ::= 7 maxNoPath INTEGER ::= 2 +maxNrOfPosSImessage INTEGER ::= 32 maxnoAssistInfoFailureListItems INTEGER ::= 32 maxNrOfSegments INTEGER ::= 64 maxNrOfPosSIBs INTEGER ::= 32 maxNoOfMeasTRPs INTEGER ::= 64 maxnoTRPs INTEGER ::= 65535 maxnoTRPInfoTypes INTEGER ::= 64 maxnoofAngleInfo INTEGER ::= 65535 maxnolcs-gcs-translation INTEGER ::= 3 maxnoBcastCell INTEGER ::= 16384 maxnoSRSTriggerStates INTEGER ::= 3 maxnoSpatialRelations INTEGER ::= 64 maxnoPosMeas INTEGER ::= 16384 maxnoSRS-Carriers INTEGER ::= 32 maxnoSCSs INTEGER ::= 5 +maxnoSRS-Resources INTEGER ::= 64 maxnoSRS-PosResources INTEGER ::= 64 maxnoSRS-ResourceSets INTEGER ::= 16 maxnoSRS-ResourcePerSet INTEGER ::= 16 maxnoSRS-PosResourceSets INTEGER ::= 16 maxnoSRS-PosResourcePerSet INTEGER ::= 16 maxPRS-ResourceSets INTEGER ::= 2 maxPRS-ResourcesPerSet INTEGER ::= 64 maxNoSSBs INTEGER ::= 255 maxnoofPRSresourceSet INTEGER ::= 8 maxnoofPRSresource INTEGER ::= 64 + +-- ************************************************************** +-- +-- IEs +-- +-- ************************************************************** + +id-Cause ProtocolIE-ID ::= 0 id-CriticalityDiagnostics ProtocolIE-ID ::= 1 id-LMF-UE-Measurement-ID ProtocolIE-ID ::= 2 id-ReportCharacteristics ProtocolIE-ID ::= 3 id-MeasurementPeriodicity ProtocolIE-ID ::= 4 id-MeasurementQuantities ProtocolIE-ID ::= 5 id-RAN-UE-Measurement-ID ProtocolIE-ID ::= 6 id-E-CID-MeasurementResult ProtocolIE-ID ::= 7 id-OTDOACells ProtocolIE-ID ::= 8 id-OTDOA-Information-Type-Group ProtocolIE-ID ::= 9 id-OTDOA-Information-Type-Item ProtocolIE-ID ::= 10 id-MeasurementQuantities-Item ProtocolIE-ID ::= 11 id-RequestedSRSTransmissionCharacteristics ProtocolIE-ID ::= 12 id-Cell-Portion-ID ProtocolIE-ID ::= 14 id-OtherRATMeasurementQuantities ProtocolIE-ID ::= 15 id-OtherRATMeasurementQuantities-Item ProtocolIE-ID ::= 16 id-OtherRATMeasurementResult ProtocolIE-ID ::= 17 id-WLANMeasurementQuantities ProtocolIE-ID ::= 19 id-WLANMeasurementQuantities-Item ProtocolIE-ID ::= 20 id-WLANMeasurementResult ProtocolIE-ID ::= 21 id-TDD-Config-EUTRA-Item ProtocolIE-ID ::= 22 id-Assistance-Information ProtocolIE-ID ::= 23 id-Broadcast ProtocolIE-ID ::= 24 id-AssistanceInformationFailureList ProtocolIE-ID ::= 25 id-SRSConfiguration ProtocolIE-ID ::= 26 id-MeasurementResult ProtocolIE-ID ::= 27 id-TRP-ID ProtocolIE-ID ::= 28 id-TRPInformationTypeList ProtocolIE-ID ::= 29 id-TRPInformationList ProtocolIE-ID ::= 30 id-MeasurementBeamInfoRequest ProtocolIE-ID ::= 31 id-ResultSS-RSRP ProtocolIE-ID ::= 32 id-ResultSS-RSRQ ProtocolIE-ID ::= 33 id-ResultCSI-RSRP ProtocolIE-ID ::= 34 id-ResultCSI-RSRQ ProtocolIE-ID ::= 35 id-AngleOfArrivalNR ProtocolIE-ID ::= 36 id-GeographicalCoordinates ProtocolIE-ID ::= 37 id-PositioningBroadcastCells ProtocolIE-ID ::= 38 id-LMF-Measurement-ID ProtocolIE-ID ::= 39 id-RAN-Measurement-ID ProtocolIE-ID ::= 40 id-TRP-MeasurementRequestList ProtocolIE-ID ::= 41 id-TRP-MeasurementResponseList ProtocolIE-ID ::= 42 id-TRP-MeasurementReportList ProtocolIE-ID ::= 43 id-SRSType ProtocolIE-ID ::= 44 id-ActivationTime ProtocolIE-ID ::= 45 id-SRSResourceSetID ProtocolIE-ID ::= 46 id-TRPList ProtocolIE-ID ::= 47 + +id-SRSSpatialRelation ProtocolIE-ID ::= 48 id-SystemFrameNumber ProtocolIE-ID ::= 49 id-SlotNumber ProtocolIE-ID ::= 50 id-SRSResourceTrigger ProtocolIE-ID ::= 51 id-TRPMeasurementQuantities ProtocolIE-ID ::= 52 id-AbortTransmission ProtocolIE-ID ::= 53 id-SFNInitialisationTime ProtocolIE-ID ::= 54 id-ResultNR ProtocolIE-ID ::= 55 id-ResultEUTRA ProtocolIE-ID ::= 56 + +END +-- ASN1STOP + + +-- ASN1START +-- ************************************************************** +-- +-- Container definitions +-- +-- ************************************************************** + +NRPPA-Containers { itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) ngran-access (22) modules (3) nrppa (4) version1 (1) nrppa-Containers (5)} +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS maxPrivateIEs, maxProtocolExtensions, maxProtocolIEs, + Criticality, + Presence, + PrivateIE-ID, + ProtocolIE-ID +FROM NRPPA-CommonDataTypes; + +-- ************************************************************** +-- +-- Class Definition for Protocol IEs +-- +-- ************************************************************** + +NRPPA-PROTOCOL-IES ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Protocol Extensions +-- +-- ************************************************************** + +NRPPA-PROTOCOL-EXTENSION ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &criticality Criticality, + &Extension, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + EXTENSION &Extension + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Private IEs +-- +-- ************************************************************** + +NRPPA-PRIVATE-IES ::= CLASS { + &id PrivateIE-ID, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Container for Protocol IEs +-- + +-- ************************************************************** + +ProtocolIE-Container { NRPPA-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (0..maxProtocolIEs)) OF + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-Single-Container { NRPPA-PROTOCOL-IES : IEsSetParam} ::= + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-Field { NRPPA-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE { + id NRPPA-PROTOCOL-IES.&id ({IEsSetParam}), + criticality NRPPA-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}), value NRPPA-PROTOCOL-IES.&Value ({IEsSetParam}{@id}) +} + +-- ************************************************************** -- +-- Container Lists for Protocol IE Containers +-- +-- ************************************************************** + +ProtocolIE-ContainerList {INTEGER : lowerBound, INTEGER : upperBound, NRPPA-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (lowerBound..upperBound)) OF + ProtocolIE-Container {{IEsSetParam}} + +-- ************************************************************** +-- +-- Container for Protocol Extensions +-- +-- ************************************************************** + +ProtocolExtensionContainer { NRPPA-PROTOCOL-EXTENSION : ExtensionSetParam} ::= + SEQUENCE (SIZE (1..maxProtocolExtensions)) OF + ProtocolExtensionField {{ExtensionSetParam}} + +ProtocolExtensionField { NRPPA-PROTOCOL-EXTENSION : ExtensionSetParam} ::= SEQUENCE { + + id NRPPA-PROTOCOL-EXTENSION.&id ({ExtensionSetParam}), + criticality NRPPA-PROTOCOL-EXTENSION.&criticality ({ExtensionSetParam}{@id}), + extensionValue NRPPA-PROTOCOL-EXTENSION.&Extension ({ExtensionSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Private IEs +-- +-- ************************************************************** + +PrivateIE-Container { NRPPA-PRIVATE-IES : IEsSetParam} ::= + SEQUENCE (SIZE (1..maxPrivateIEs)) OF + PrivateIE-Field {{IEsSetParam}} + +PrivateIE-Field { NRPPA-PRIVATE-IES : IEsSetParam} ::= SEQUENCE { + id NRPPA-PRIVATE-IES.&id ({IEsSetParam}), + criticality NRPPA-PRIVATE-IES.&criticality ({IEsSetParam}{@id}), + value NRPPA-PRIVATE-IES.&Value ({IEsSetParam}{@id}) +} + +END +-- ASN1STOP + + From 1434175a84f5ceab2ee77a9fa607255ed8ec91bb Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Thu, 30 Jun 2022 16:21:37 +0200 Subject: [PATCH 22/39] adding Mohsen's NRPPA main program to CMakeLists.txt --- openair3/NRPPA/main_nrppa.c | 91 +++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 openair3/NRPPA/main_nrppa.c diff --git a/openair3/NRPPA/main_nrppa.c b/openair3/NRPPA/main_nrppa.c new file mode 100755 index 0000000000..7f4995726a --- /dev/null +++ b/openair3/NRPPA/main_nrppa.c @@ -0,0 +1,91 @@ +#include +#include +#include +#include +/* + * This is a custom function which writes the + * encoded output into some FILE stream. + */ + +static int write_out(const void *buffer, size_t size, void *app_key) { + FILE *out_fp = app_key; + size_t wrote; + + wrote = fwrite(buffer, 1, size, out_fp); + + return (wrote == size) ? 0 : -1; +} + +int main(int ac, char **av) { + NRPPA_MeasurementRequest_t *NRPPA_MeasurementRequest; /* Type to encode */ + asn_enc_rval_t ec; /* Encoder return value */ + + /* Allocate the NRPPA_MeasurementRequest_t */ + NRPPA_MeasurementRequest = calloc(1, sizeof(NRPPA_MeasurementRequest_t)); /* not malloc! */ + if(!NRPPA_MeasurementRequest) { + perror("calloc() failed"); + exit(71); /* better, EX_OSERR */ + } + + NRPPA_MeasurementRequest_IEs_t xyz; + ASN_SEQUENCE_ADD(&NRPPA_MeasurementRequest->protocolIEs.list,&xyz); + + + /* MeasurementRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{MeasurementRequest-IEs}}, + ... + } */ + + /* Protocl IE container + id-LMF-Measurement-ID ProtocolIE-ID ::= 39 + id-RAN-Measurement-ID ProtocolIE-ID ::= 40 + ID id-TRP-MeasurementRequestList ProtocolIE-ID ::= 41 + ID id-ReportCharacteristics ProtocolIE-ID ::= 3 + ID id-MeasurementPeriodicity ProtocolIE-ID ::= 4 + ID id-TRPMeasurementQuantities ProtocolIE-ID ::= 52 + */ + NRPPA_MeasurementRequest->protocolIEs; + + /* Context for parsing across buffer boundaries */ + NRPPA_MeasurementRequest->_asn_ctx; + + /* BER encode the data if filename is given */ + if(ac < 2) { + fprintf(stderr, "Specify filename for BER output\n"); + } else { + const char *filename = av[1]; + FILE *fp = fopen(filename, "wb"); /* for BER output */ + + if(!fp) { + perror(filename); + exit(71); /* better, EX_OSERR */ + } + + +//asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor, +// const void *struct_ptr, /* Structure to be encoded */ +// asn_app_consume_bytes_f *consume_bytes_cb, +// void *app_key /* Arbitrary callback argument */); + + /* Encode the NRPPA_MeasurementRequest type as BER (DER) */ + ec = der_encode(&asn_DEF_NRPPA_MeasurementRequest, NRPPA_MeasurementRequest, write_out, fp); + + fclose(fp); + if(ec.encoded == -1) { + fprintf(stderr, + "Could not encode NRPPA_MeasurementRequest (at %s)\n", + ec.failed_type ? ec.failed_type->name : "unknown"); + exit(65); /* better, EX_DATAERR */ + } else { + fprintf(stderr, "Created %s with BER encoded NRPPA_MeasurementRequest\n", + filename); + } + } + + /* Also print the constructed NRPPA_MeasurementRequest XER encoded (XML) */ + xer_fprint(stdout, &asn_DEF_NRPPA_MeasurementRequest, NRPPA_MeasurementRequest); + + return 0; /* Encoding finished successfully */ +} + + From 24237b3e351835edf745f2af6aec9826bb2cf037 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 10 Jan 2023 11:26:27 +0100 Subject: [PATCH 23/39] adapting ans1 handling of NRPPA to new framework --- CMakeLists.txt | 4 + openair3/CMakeLists.txt | 1 + openair3/NRPPA/CMakeLists.txt | 1 + openair3/NRPPA/MESSAGES/{ => ASN1}/38455.asn | 0 openair3/NRPPA/MESSAGES/ASN1/38455.cmake | 715 +++++++++++++++++++ openair3/NRPPA/MESSAGES/CMakeLists.txt | 22 + 6 files changed, 743 insertions(+) create mode 100644 openair3/NRPPA/CMakeLists.txt rename openair3/NRPPA/MESSAGES/{ => ASN1}/38455.asn (100%) create mode 100644 openair3/NRPPA/MESSAGES/ASN1/38455.cmake create mode 100644 openair3/NRPPA/MESSAGES/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 07d1eea0b2..dd4d7161e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -525,6 +525,10 @@ target_link_libraries(f1ap PRIVATE ngap nr_rrc) ############## # target asn1_lpp in openair3/LPP/MESSAGES/CMakeLists.txt used below +# NRPPA +############## +add_executable(main_nrppa ${OPENAIR3_DIR}/NRPPA/main_nrppa.c ) +target_link_libraries(main_nrppa asn1_nrppa) # Hardware dependant options ################################### diff --git a/openair3/CMakeLists.txt b/openair3/CMakeLists.txt index 676bbd377b..be9574aef6 100644 --- a/openair3/CMakeLists.txt +++ b/openair3/CMakeLists.txt @@ -2,3 +2,4 @@ add_subdirectory(LPP) add_subdirectory(M3AP) add_subdirectory(S1AP) add_subdirectory(NGAP) +add_subdirectory(NRPPA) \ No newline at end of file diff --git a/openair3/NRPPA/CMakeLists.txt b/openair3/NRPPA/CMakeLists.txt new file mode 100644 index 0000000000..7537bd661d --- /dev/null +++ b/openair3/NRPPA/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(MESSAGES) diff --git a/openair3/NRPPA/MESSAGES/38455.asn b/openair3/NRPPA/MESSAGES/ASN1/38455.asn similarity index 100% rename from openair3/NRPPA/MESSAGES/38455.asn rename to openair3/NRPPA/MESSAGES/ASN1/38455.asn diff --git a/openair3/NRPPA/MESSAGES/ASN1/38455.cmake b/openair3/NRPPA/MESSAGES/ASN1/38455.cmake new file mode 100644 index 0000000000..08795339cb --- /dev/null +++ b/openair3/NRPPA/MESSAGES/ASN1/38455.cmake @@ -0,0 +1,715 @@ +set(NRPPA_GRAMMAR ASN1/38455.asn) + +set(nrppa_source +ANY.c +asn_application.c +asn_bit_data.c +asn_codecs_prim.c +asn_internal.c +asn_random_fill.c +asn_SEQUENCE_OF.c +asn_SET_OF.c +ber_decoder.c +ber_tlv_length.c +ber_tlv_tag.c +BIT_STRING.c +BOOLEAN.c +constraints.c +constr_CHOICE.c +constr_SEQUENCE.c +constr_SEQUENCE_OF.c +constr_SET_OF.c +constr_TYPE.c +der_encoder.c +INTEGER.c +NativeEnumerated.c +NativeInteger.c +NRPPA_AbortTransmission.c +NRPPA_ActivationTime.c +NRPPA_ActiveULBWP.c +NRPPA_AdditionalPathList.c +NRPPA_AdditionalPathListItem.c +NRPPA_AperiodicSRS.c +NRPPA_AperiodicSRSResourceTrigger.c +NRPPA_AperiodicSRSResourceTriggerList.c +NRPPA_Assistance-Information.c +NRPPA_AssistanceInformationControl.c +NRPPA_AssistanceInformationFailureList.c +NRPPA_AssistanceInformationFeedback.c +NRPPA_AssistanceInformationMetaData.c +NRPPA_BandwidthSRS.c +NRPPA_BCCH.c +NRPPA_Broadcast.c +NRPPA_BroadcastPeriodicity.c +NRPPA_BSSID.c +NRPPA_Cause.c +NRPPA_CauseMisc.c +NRPPA_CauseProtocol.c +NRPPA_CauseRadioNetwork.c +NRPPA_Cell-Portion-ID.c +NRPPA_CGI-EUTRA.c +NRPPA_CGI-NR.c +NRPPA_CoordinateID.c +NRPPA_CPLength-EUTRA.c +NRPPA_Criticality.c +NRPPA_CriticalityDiagnostics.c +NRPPA_CriticalityDiagnostics-IE-List.c +NRPPA_DL-Bandwidth-EUTRA.c +NRPPA_DL-PRS.c +NRPPA_DL-PRSMutingPattern.c +NRPPA_DLPRSResourceARP.c +NRPPA_DL-PRSResourceARPLocation.c +NRPPA_DLPRSResourceCoordinates.c +NRPPA_DLPRSResourceSetARP.c +NRPPA_DL-PRSResourceSetARPLocation.c +NRPPA_EARFCN.c +NRPPA_E-CIDMeasurementFailureIndication.c +NRPPA_E-CIDMeasurementInitiationFailure.c +NRPPA_E-CIDMeasurementInitiationRequest.c +NRPPA_E-CIDMeasurementInitiationResponse.c +NRPPA_E-CIDMeasurementReport.c +NRPPA_E-CID-MeasurementResult.c +NRPPA_E-CIDMeasurementTerminationCommand.c +NRPPA_ErrorIndication.c +NRPPA_EUTRACellIdentifier.c +NRPPA_GeographicalCoordinates.c +NRPPA_GNB-RxTxTimeDiff.c +NRPPA_GNBRxTxTimeDiffMeas.c +NRPPA_HESSID.c +NRPPA_InitiatingMessage.c +NRPPA_LCG-to-GCS-TranslationItem.c +NRPPA_LocationUncertainty.c +NRPPA_MeasuredResults.c +NRPPA_MeasuredResultsValue.c +NRPPA_MeasurementAbort.c +NRPPA_MeasurementBeamInfo.c +NRPPA_MeasurementBeamInfoRequest.c +NRPPA_MeasurementFailure.c +NRPPA_MeasurementFailureIndication.c +NRPPA_Measurement-ID.c +NRPPA_MeasurementPeriodicity.c +NRPPA_MeasurementQuantities.c +NRPPA_MeasurementQuantities-Item.c +NRPPA_MeasurementQuantitiesValue.c +NRPPA_MeasurementReport.c +NRPPA_MeasurementRequest.c +NRPPA_MeasurementResponse.c +NRPPA_MeasurementUpdate.c +NRPPA_NarrowBandIndex.c +NRPPA_NG-RANAccessPointPosition.c +NRPPA_NG-RANCell.c +NRPPA_NG-RAN-CGI.c +NRPPA_NGRANHighAccuracyAccessPointPosition.c +NRPPA_NR-ARFCN.c +NRPPA_NRCellIdentifier.c +NRPPA_NR-PCI.c +NRPPA_NRPPA-PDU.c +NRPPA_NRPPATransactionID.c +NRPPA_NR-PRS-Beam-Information.c +NRPPA_NR-PRS-Beam-InformationItem.c +NRPPA_NumberOfAntennaPorts-EUTRA.c +NRPPA_NumberOfDlFrames-EUTRA.c +NRPPA_NumberOfDlFrames-Extended-EUTRA.c +NRPPA_NumberOfFrequencyHoppingBands.c +NRPPA_NZP-CSI-RS-ResourceID.c +NRPPA_OTDOACell-Information.c +NRPPA_OTDOACell-Information-Item.c +NRPPA_OTDOACells.c +NRPPA_OTDOAInformationFailure.c +NRPPA_OTDOA-Information-Item.c +NRPPA_OTDOAInformationRequest.c +NRPPA_OTDOAInformationResponse.c +NRPPA_OTDOA-Information-Type.c +NRPPA_OTDOA-Information-Type-Item.c +NRPPA_OtherRATMeasuredResultsValue.c +NRPPA_OtherRATMeasurementQuantities.c +NRPPA_OtherRATMeasurementQuantities-Item.c +NRPPA_OtherRATMeasurementQuantitiesValue.c +NRPPA_OtherRATMeasurementResult.c +NRPPA_Outcome.c +NRPPA_PathlossReferenceInformation.c +NRPPA_PathlossReferenceSignal.c +NRPPA_PCI-EUTRA.c +NRPPA_PeriodicityItem.c +NRPPA_PeriodicityList.c +NRPPA_PhysCellIDGERAN.c +NRPPA_PhysCellIDUTRA-FDD.c +NRPPA_PhysCellIDUTRA-TDD.c +NRPPA_PLMN-Identity.c +NRPPA_PositioningActivationFailure.c +NRPPA_PositioningActivationRequest.c +NRPPA_PositioningActivationResponse.c +NRPPA_PositioningBroadcastCells.c +NRPPA_PositioningDeactivation.c +NRPPA_PositioningInformationFailure.c +NRPPA_PositioningInformationRequest.c +NRPPA_PositioningInformationResponse.c +NRPPA_PositioningInformationUpdate.c +NRPPA_PosResourceSetTypeAperiodic.c +NRPPA_PosResourceSetType.c +NRPPA_PosResourceSetTypePeriodic.c +NRPPA_PosResourceSetTypeSemi-persistent.c +NRPPA_PosSIBs.c +NRPPA_PosSIB-Segments.c +NRPPA_PosSIB-Type.c +NRPPA_PosSRSResourceID-List.c +NRPPA_PosSRSResource-Item.c +NRPPA_PosSRSResource-List.c +NRPPA_PosSRSResourceSet-Item.c +NRPPA_PosSRSResourceSet-List.c +NRPPA_Presence.c +NRPPA_PrivateIE-Container.c +NRPPA_PrivateIE-Field.c +NRPPA_PrivateIE-ID.c +NRPPA_PrivateMessage.c +NRPPA_ProcedureCode.c +NRPPA_ProtocolExtensionContainer.c +NRPPA_ProtocolExtensionField.c +NRPPA_ProtocolIE-Container.c +NRPPA_ProtocolIE-ContainerList.c +NRPPA_ProtocolIE-Field.c +NRPPA_ProtocolIE-ID.c +NRPPA_ProtocolIE-Single-Container.c +NRPPA_PRSAngleItem.c +NRPPA_PRS-Bandwidth-EUTRA.c +NRPPA_PRSConfiguration.c +NRPPA_PRS-ConfigurationIndex-EUTRA.c +NRPPA_PRSFrequencyHoppingConfiguration-EUTRA.c +NRPPA_PRS-ID.c +NRPPA_PRS-ID-EUTRA.c +NRPPA_PRSInformationPos.c +NRPPA_PRSMuting.c +NRPPA_PRSMutingConfiguration-EUTRA.c +NRPPA_PRSMutingOption1.c +NRPPA_PRSMutingOption2.c +NRPPA_PRSOccasionGroup-EUTRA.c +NRPPA_PRS-Resource-ID.c +NRPPA_PRSResource-Item.c +NRPPA_PRSResource-List.c +NRPPA_PRSResource-QCLInfo.c +NRPPA_PRSResource-QCLSourcePRSInfo.c +NRPPA_PRS-Resource-Set-ID.c +NRPPA_PRSResourceSet-Item.c +NRPPA_PRSResourceSet-List.c +NRPPA_ReferencePoint.c +NRPPA_ReferenceSignal.c +NRPPA_RelativeCartesianLocation.c +NRPPA_RelativeGeodeticLocation.c +NRPPA_RelativePathDelay.c +NRPPA_ReportCharacteristics.c +NRPPA_RequestedSRSTransmissionCharacteristics.c +NRPPA_ResourceSetTypeAperiodic.c +NRPPA_ResourceSetType.c +NRPPA_ResourceSetTypePeriodic.c +NRPPA_ResourceSetTypeSemi-persistent.c +NRPPA_ResourceTypeAperiodic.c +NRPPA_ResourceTypeAperiodicPos.c +NRPPA_ResourceType.c +NRPPA_ResourceTypePeriodic.c +NRPPA_ResourceTypePeriodicPos.c +NRPPA_ResourceTypePos.c +NRPPA_ResourceTypeSemi-persistent.c +NRPPA_ResourceTypeSemi-persistentPos.c +NRPPA_ResultCSI-RSRP.c +NRPPA_ResultCSI-RSRP-Item.c +NRPPA_ResultCSI-RSRP-PerCSI-RS.c +NRPPA_ResultCSI-RSRP-PerCSI-RS-Item.c +NRPPA_ResultCSI-RSRQ.c +NRPPA_ResultCSI-RSRQ-Item.c +NRPPA_ResultCSI-RSRQ-PerCSI-RS.c +NRPPA_ResultCSI-RSRQ-PerCSI-RS-Item.c +NRPPA_ResultEUTRA.c +NRPPA_ResultEUTRA-Item.c +NRPPA_ResultGERAN.c +NRPPA_ResultGERAN-Item.c +NRPPA_ResultNR.c +NRPPA_ResultNR-Item.c +NRPPA_ResultRSRP-EUTRA.c +NRPPA_ResultRSRP-EUTRA-Item.c +NRPPA_ResultRSRQ-EUTRA.c +NRPPA_ResultRSRQ-EUTRA-Item.c +NRPPA_ResultSS-RSRP.c +NRPPA_ResultSS-RSRP-Item.c +NRPPA_ResultSS-RSRP-PerSSB.c +NRPPA_ResultSS-RSRP-PerSSB-Item.c +NRPPA_ResultSS-RSRQ.c +NRPPA_ResultSS-RSRQ-Item.c +NRPPA_ResultSS-RSRQ-PerSSB.c +NRPPA_ResultSS-RSRQ-PerSSB-Item.c +NRPPA_ResultUTRAN.c +NRPPA_ResultUTRAN-Item.c +NRPPA_RSSI.c +NRPPA_SCS-SpecificCarrier.c +NRPPA_Search-window-information.c +NRPPA_SemipersistentSRS.c +NRPPA_SFNInitialisationTime.c +NRPPA_SFNInitialisationTime-EUTRA.c +NRPPA_SlotNumber.c +NRPPA_SpatialDirectionInformation.c +NRPPA_SpatialRelationforResourceID.c +NRPPA_SpatialRelationforResourceIDItem.c +NRPPA_SpatialRelationInfo.c +NRPPA_SpatialRelationPos.c +NRPPA_SRSCarrier-List.c +NRPPA_SRSCarrier-List-Item.c +NRPPA_SRSConfig.c +NRPPA_SRSConfiguration.c +NRPPA_SRSPosResourceID.c +NRPPA_SRSResource.c +NRPPA_SRSResourceID.c +NRPPA_SRSResourceID-List.c +NRPPA_SRSResource-List.c +NRPPA_SRSResourceSet.c +NRPPA_SRSResourceSetID.c +NRPPA_SRSResourceSet-Item.c +NRPPA_SRSResourceSet-List.c +NRPPA_SRSResourceTrigger.c +NRPPA_SRSSpatialRelation.c +NRPPA_SRSType.c +NRPPA_SSBBurstPosition.c +NRPPA_SSB.c +NRPPA_SSB-Index.c +NRPPA_SSBInfo.c +NRPPA_SSBInfoList.c +NRPPA_SSBPos.c +NRPPA_SSID.c +NRPPA_SuccessfulOutcome.c +NRPPA_SystemFrameNumber.c +NRPPA_SystemInformation.c +NRPPA_TAC.c +NRPPA_TDD-Config-EUTRA-Item.c +NRPPA_TF-Configuration.c +NRPPA_TimeStamp.c +NRPPA_TimeStampSlotIndex.c +NRPPA_TP-ID-EUTRA.c +NRPPA_TP-Type-EUTRA.c +NRPPA_TransmissionComb.c +NRPPA_TransmissionCombPos.c +NRPPA_TriggeringMessage.c +NRPPA_TRP-ID.c +NRPPA_TRPInformation.c +NRPPA_TRPInformationFailure.c +NRPPA_TRPInformationItem.c +NRPPA_TRPInformationList.c +NRPPA_TRPInformationRequest.c +NRPPA_TRPInformationResponse.c +NRPPA_TRPInformationTypeItem.c +NRPPA_TRPInformationTypeList.c +NRPPA_TRPItem.c +NRPPA_TRPList.c +NRPPA_TrpMeasuredResultsValue.c +NRPPA_TrpMeasurementAngleQuality.c +NRPPA_TrpMeasurementQuality.c +NRPPA_TRPMeasurementQuantities.c +NRPPA_TRPMeasurementQuantities-Item.c +NRPPA_TRPMeasurementQuantitiesList-Item.c +NRPPA_TRP-MeasurementRequestItem.c +NRPPA_TRP-MeasurementRequestList.c +NRPPA_TRP-MeasurementResponseItem.c +NRPPA_TRP-MeasurementResponseList.c +NRPPA_TrpMeasurementResult.c +NRPPA_TrpMeasurementResultItem.c +NRPPA_TrpMeasurementTimingQuality.c +NRPPA_TRPPositionDefinitionType.c +NRPPA_TRPPositionDirectAccuracy.c +NRPPA_TRPPositionDirect.c +NRPPA_TRPPositionReferenced.c +NRPPA_TRPReferencePointType.c +NRPPA_TypeOfError.c +NRPPA_UARFCN.c +NRPPA_UE-Measurement-ID.c +NRPPA_UL-AoA.c +NRPPA_ULRTOAMeas.c +NRPPA_UL-RTOAMeasurement.c +NRPPA_UL-SRS-RSRP.c +NRPPA_UnsuccessfulOutcome.c +NRPPA_UplinkChannelBW-PerSCS-List.c +NRPPA_UTRA-EcN0.c +NRPPA_UTRA-RSCP.c +NRPPA_ValueRSRP-EUTRA.c +NRPPA_ValueRSRP-NR.c +NRPPA_ValueRSRQ-EUTRA.c +NRPPA_ValueRSRQ-NR.c +NRPPA_WLANBand.c +NRPPA_WLANChannel.c +NRPPA_WLANChannelList.c +NRPPA_WLANCountryCode.c +NRPPA_WLANMeasurementQuantities.c +NRPPA_WLANMeasurementQuantities-Item.c +NRPPA_WLANMeasurementQuantitiesValue.c +NRPPA_WLANMeasurementResult.c +NRPPA_WLANMeasurementResult-Item.c +NRPPA_WLANOperatingClass.c +NRPPA_WLAN-RSSI.c +NULL.c +OBJECT_IDENTIFIER.c +OCTET_STRING.c +OPEN_TYPE.c +per_decoder.c +per_encoder.c +per_opentype.c +per_support.c +xer_decoder.c +xer_encoder.c +xer_support.c + +) + +set(nrppa_headers +ANY.h +asn_application.h +asn_bit_data.h +asn_codecs.h +asn_codecs_prim.h +asn_internal.h +asn_ioc.h +asn_random_fill.h +asn_SEQUENCE_OF.h +asn_SET_OF.h +asn_system.h +ber_decoder.h +ber_tlv_length.h +ber_tlv_tag.h +BIT_STRING.h +BOOLEAN.h +constraints.h +constr_CHOICE.h +constr_SEQUENCE.h +constr_SEQUENCE_OF.h +constr_SET_OF.h +constr_TYPE.h +der_encoder.h +INTEGER.h +NativeEnumerated.h +NativeInteger.h +NRPPA_AbortTransmission.h +NRPPA_ActivationTime.h +NRPPA_ActiveULBWP.h +NRPPA_AdditionalPathList.h +NRPPA_AdditionalPathListItem.h +NRPPA_AperiodicSRS.h +NRPPA_AperiodicSRSResourceTrigger.h +NRPPA_AperiodicSRSResourceTriggerList.h +NRPPA_asn_constant.h +NRPPA_AssistanceInformationControl.h +NRPPA_AssistanceInformationFailureList.h +NRPPA_AssistanceInformationFeedback.h +NRPPA_Assistance-Information.h +NRPPA_AssistanceInformationMetaData.h +NRPPA_BandwidthSRS.h +NRPPA_BCCH.h +NRPPA_Broadcast.h +NRPPA_BroadcastPeriodicity.h +NRPPA_BSSID.h +NRPPA_Cause.h +NRPPA_CauseMisc.h +NRPPA_CauseProtocol.h +NRPPA_CauseRadioNetwork.h +NRPPA_Cell-Portion-ID.h +NRPPA_CGI-EUTRA.h +NRPPA_CGI-NR.h +NRPPA_CoordinateID.h +NRPPA_CPLength-EUTRA.h +NRPPA_CriticalityDiagnostics.h +NRPPA_CriticalityDiagnostics-IE-List.h +NRPPA_Criticality.h +NRPPA_DL-Bandwidth-EUTRA.h +NRPPA_DL-PRS.h +NRPPA_DL-PRSMutingPattern.h +NRPPA_DLPRSResourceARP.h +NRPPA_DL-PRSResourceARPLocation.h +NRPPA_DLPRSResourceCoordinates.h +NRPPA_DLPRSResourceSetARP.h +NRPPA_DL-PRSResourceSetARPLocation.h +NRPPA_EARFCN.h +NRPPA_E-CIDMeasurementFailureIndication.h +NRPPA_E-CIDMeasurementInitiationFailure.h +NRPPA_E-CIDMeasurementInitiationRequest.h +NRPPA_E-CIDMeasurementInitiationResponse.h +NRPPA_E-CIDMeasurementReport.h +NRPPA_E-CID-MeasurementResult.h +NRPPA_E-CIDMeasurementTerminationCommand.h +NRPPA_ErrorIndication.h +NRPPA_EUTRACellIdentifier.h +NRPPA_GeographicalCoordinates.h +NRPPA_GNB-RxTxTimeDiff.h +NRPPA_GNBRxTxTimeDiffMeas.h +NRPPA_HESSID.h +NRPPA_InitiatingMessage.h +NRPPA_LCG-to-GCS-TranslationItem.h +NRPPA_LocationUncertainty.h +NRPPA_MeasuredResults.h +NRPPA_MeasuredResultsValue.h +NRPPA_MeasurementAbort.h +NRPPA_MeasurementBeamInfo.h +NRPPA_MeasurementBeamInfoRequest.h +NRPPA_MeasurementFailure.h +NRPPA_MeasurementFailureIndication.h +NRPPA_Measurement-ID.h +NRPPA_MeasurementPeriodicity.h +NRPPA_MeasurementQuantities.h +NRPPA_MeasurementQuantities-Item.h +NRPPA_MeasurementQuantitiesValue.h +NRPPA_MeasurementReport.h +NRPPA_MeasurementRequest.h +NRPPA_MeasurementResponse.h +NRPPA_MeasurementUpdate.h +NRPPA_NarrowBandIndex.h +NRPPA_NG-RANAccessPointPosition.h +NRPPA_NG-RANCell.h +NRPPA_NG-RAN-CGI.h +NRPPA_NGRANHighAccuracyAccessPointPosition.h +NRPPA_NR-ARFCN.h +NRPPA_NRCellIdentifier.h +NRPPA_NR-PCI.h +NRPPA_NRPPA-PDU.h +NRPPA_NRPPATransactionID.h +NRPPA_NR-PRS-Beam-Information.h +NRPPA_NR-PRS-Beam-InformationItem.h +NRPPA_NumberOfAntennaPorts-EUTRA.h +NRPPA_NumberOfDlFrames-EUTRA.h +NRPPA_NumberOfDlFrames-Extended-EUTRA.h +NRPPA_NumberOfFrequencyHoppingBands.h +NRPPA_NZP-CSI-RS-ResourceID.h +NRPPA_OTDOACell-Information.h +NRPPA_OTDOACell-Information-Item.h +NRPPA_OTDOACells.h +NRPPA_OTDOAInformationFailure.h +NRPPA_OTDOA-Information-Item.h +NRPPA_OTDOAInformationRequest.h +NRPPA_OTDOAInformationResponse.h +NRPPA_OTDOA-Information-Type.h +NRPPA_OTDOA-Information-Type-Item.h +NRPPA_OtherRATMeasuredResultsValue.h +NRPPA_OtherRATMeasurementQuantities.h +NRPPA_OtherRATMeasurementQuantities-Item.h +NRPPA_OtherRATMeasurementQuantitiesValue.h +NRPPA_OtherRATMeasurementResult.h +NRPPA_Outcome.h +NRPPA_PathlossReferenceInformation.h +NRPPA_PathlossReferenceSignal.h +NRPPA_PCI-EUTRA.h +NRPPA_PeriodicityItem.h +NRPPA_PeriodicityList.h +NRPPA_PhysCellIDGERAN.h +NRPPA_PhysCellIDUTRA-FDD.h +NRPPA_PhysCellIDUTRA-TDD.h +NRPPA_PLMN-Identity.h +NRPPA_PositioningActivationFailure.h +NRPPA_PositioningActivationRequest.h +NRPPA_PositioningActivationResponse.h +NRPPA_PositioningBroadcastCells.h +NRPPA_PositioningDeactivation.h +NRPPA_PositioningInformationFailure.h +NRPPA_PositioningInformationRequest.h +NRPPA_PositioningInformationResponse.h +NRPPA_PositioningInformationUpdate.h +NRPPA_PosResourceSetTypeAperiodic.h +NRPPA_PosResourceSetType.h +NRPPA_PosResourceSetTypePeriodic.h +NRPPA_PosResourceSetTypeSemi-persistent.h +NRPPA_PosSIB-Segments.h +NRPPA_PosSIBs.h +NRPPA_PosSIB-Type.h +NRPPA_PosSRSResourceID-List.h +NRPPA_PosSRSResource-Item.h +NRPPA_PosSRSResource-List.h +NRPPA_PosSRSResourceSet-Item.h +NRPPA_PosSRSResourceSet-List.h +NRPPA_Presence.h +NRPPA_PrivateIE-Container.h +NRPPA_PrivateIE-Field.h +NRPPA_PrivateIE-ID.h +NRPPA_PrivateMessage.h +NRPPA_ProcedureCode.h +NRPPA_ProtocolExtensionContainer.h +NRPPA_ProtocolExtensionField.h +NRPPA_ProtocolIE-Container.h +NRPPA_ProtocolIE-ContainerList.h +NRPPA_ProtocolIE-Field.h +NRPPA_ProtocolIE-ID.h +NRPPA_ProtocolIE-Single-Container.h +NRPPA_PRSAngleItem.h +NRPPA_PRS-Bandwidth-EUTRA.h +NRPPA_PRSConfiguration.h +NRPPA_PRS-ConfigurationIndex-EUTRA.h +NRPPA_PRSFrequencyHoppingConfiguration-EUTRA.h +NRPPA_PRS-ID-EUTRA.h +NRPPA_PRS-ID.h +NRPPA_PRSInformationPos.h +NRPPA_PRSMutingConfiguration-EUTRA.h +NRPPA_PRSMuting.h +NRPPA_PRSMutingOption1.h +NRPPA_PRSMutingOption2.h +NRPPA_PRSOccasionGroup-EUTRA.h +NRPPA_PRS-Resource-ID.h +NRPPA_PRSResource-Item.h +NRPPA_PRSResource-List.h +NRPPA_PRSResource-QCLInfo.h +NRPPA_PRSResource-QCLSourcePRSInfo.h +NRPPA_PRS-Resource-Set-ID.h +NRPPA_PRSResourceSet-Item.h +NRPPA_PRSResourceSet-List.h +NRPPA_ReferencePoint.h +NRPPA_ReferenceSignal.h +NRPPA_RelativeCartesianLocation.h +NRPPA_RelativeGeodeticLocation.h +NRPPA_RelativePathDelay.h +NRPPA_ReportCharacteristics.h +NRPPA_RequestedSRSTransmissionCharacteristics.h +NRPPA_ResourceSetTypeAperiodic.h +NRPPA_ResourceSetType.h +NRPPA_ResourceSetTypePeriodic.h +NRPPA_ResourceSetTypeSemi-persistent.h +NRPPA_ResourceTypeAperiodic.h +NRPPA_ResourceTypeAperiodicPos.h +NRPPA_ResourceType.h +NRPPA_ResourceTypePeriodic.h +NRPPA_ResourceTypePeriodicPos.h +NRPPA_ResourceTypePos.h +NRPPA_ResourceTypeSemi-persistent.h +NRPPA_ResourceTypeSemi-persistentPos.h +NRPPA_ResultCSI-RSRP.h +NRPPA_ResultCSI-RSRP-Item.h +NRPPA_ResultCSI-RSRP-PerCSI-RS.h +NRPPA_ResultCSI-RSRP-PerCSI-RS-Item.h +NRPPA_ResultCSI-RSRQ.h +NRPPA_ResultCSI-RSRQ-Item.h +NRPPA_ResultCSI-RSRQ-PerCSI-RS.h +NRPPA_ResultCSI-RSRQ-PerCSI-RS-Item.h +NRPPA_ResultEUTRA.h +NRPPA_ResultEUTRA-Item.h +NRPPA_ResultGERAN.h +NRPPA_ResultGERAN-Item.h +NRPPA_ResultNR.h +NRPPA_ResultNR-Item.h +NRPPA_ResultRSRP-EUTRA.h +NRPPA_ResultRSRP-EUTRA-Item.h +NRPPA_ResultRSRQ-EUTRA.h +NRPPA_ResultRSRQ-EUTRA-Item.h +NRPPA_ResultSS-RSRP.h +NRPPA_ResultSS-RSRP-Item.h +NRPPA_ResultSS-RSRP-PerSSB.h +NRPPA_ResultSS-RSRP-PerSSB-Item.h +NRPPA_ResultSS-RSRQ.h +NRPPA_ResultSS-RSRQ-Item.h +NRPPA_ResultSS-RSRQ-PerSSB.h +NRPPA_ResultSS-RSRQ-PerSSB-Item.h +NRPPA_ResultUTRAN.h +NRPPA_ResultUTRAN-Item.h +NRPPA_RSSI.h +NRPPA_SCS-SpecificCarrier.h +NRPPA_Search-window-information.h +NRPPA_SemipersistentSRS.h +NRPPA_SFNInitialisationTime-EUTRA.h +NRPPA_SFNInitialisationTime.h +NRPPA_SlotNumber.h +NRPPA_SpatialDirectionInformation.h +NRPPA_SpatialRelationforResourceID.h +NRPPA_SpatialRelationforResourceIDItem.h +NRPPA_SpatialRelationInfo.h +NRPPA_SpatialRelationPos.h +NRPPA_SRSCarrier-List.h +NRPPA_SRSCarrier-List-Item.h +NRPPA_SRSConfig.h +NRPPA_SRSConfiguration.h +NRPPA_SRSPosResourceID.h +NRPPA_SRSResource.h +NRPPA_SRSResourceID.h +NRPPA_SRSResourceID-List.h +NRPPA_SRSResource-List.h +NRPPA_SRSResourceSet.h +NRPPA_SRSResourceSetID.h +NRPPA_SRSResourceSet-Item.h +NRPPA_SRSResourceSet-List.h +NRPPA_SRSResourceTrigger.h +NRPPA_SRSSpatialRelation.h +NRPPA_SRSType.h +NRPPA_SSBBurstPosition.h +NRPPA_SSB.h +NRPPA_SSB-Index.h +NRPPA_SSBInfo.h +NRPPA_SSBInfoList.h +NRPPA_SSBPos.h +NRPPA_SSID.h +NRPPA_SuccessfulOutcome.h +NRPPA_SystemFrameNumber.h +NRPPA_SystemInformation.h +NRPPA_TAC.h +NRPPA_TDD-Config-EUTRA-Item.h +NRPPA_TF-Configuration.h +NRPPA_TimeStamp.h +NRPPA_TimeStampSlotIndex.h +NRPPA_TP-ID-EUTRA.h +NRPPA_TP-Type-EUTRA.h +NRPPA_TransmissionComb.h +NRPPA_TransmissionCombPos.h +NRPPA_TriggeringMessage.h +NRPPA_TRP-ID.h +NRPPA_TRPInformationFailure.h +NRPPA_TRPInformation.h +NRPPA_TRPInformationItem.h +NRPPA_TRPInformationList.h +NRPPA_TRPInformationRequest.h +NRPPA_TRPInformationResponse.h +NRPPA_TRPInformationTypeItem.h +NRPPA_TRPInformationTypeList.h +NRPPA_TRPItem.h +NRPPA_TRPList.h +NRPPA_TrpMeasuredResultsValue.h +NRPPA_TrpMeasurementAngleQuality.h +NRPPA_TrpMeasurementQuality.h +NRPPA_TRPMeasurementQuantities.h +NRPPA_TRPMeasurementQuantities-Item.h +NRPPA_TRPMeasurementQuantitiesList-Item.h +NRPPA_TRP-MeasurementRequestItem.h +NRPPA_TRP-MeasurementRequestList.h +NRPPA_TRP-MeasurementResponseItem.h +NRPPA_TRP-MeasurementResponseList.h +NRPPA_TrpMeasurementResult.h +NRPPA_TrpMeasurementResultItem.h +NRPPA_TrpMeasurementTimingQuality.h +NRPPA_TRPPositionDefinitionType.h +NRPPA_TRPPositionDirectAccuracy.h +NRPPA_TRPPositionDirect.h +NRPPA_TRPPositionReferenced.h +NRPPA_TRPReferencePointType.h +NRPPA_TypeOfError.h +NRPPA_UARFCN.h +NRPPA_UE-Measurement-ID.h +NRPPA_UL-AoA.h +NRPPA_ULRTOAMeas.h +NRPPA_UL-RTOAMeasurement.h +NRPPA_UL-SRS-RSRP.h +NRPPA_UnsuccessfulOutcome.h +NRPPA_UplinkChannelBW-PerSCS-List.h +NRPPA_UTRA-EcN0.h +NRPPA_UTRA-RSCP.h +NRPPA_ValueRSRP-EUTRA.h +NRPPA_ValueRSRP-NR.h +NRPPA_ValueRSRQ-EUTRA.h +NRPPA_ValueRSRQ-NR.h +NRPPA_WLANBand.h +NRPPA_WLANChannel.h +NRPPA_WLANChannelList.h +NRPPA_WLANCountryCode.h +NRPPA_WLANMeasurementQuantities.h +NRPPA_WLANMeasurementQuantities-Item.h +NRPPA_WLANMeasurementQuantitiesValue.h +NRPPA_WLANMeasurementResult.h +NRPPA_WLANMeasurementResult-Item.h +NRPPA_WLANOperatingClass.h +NRPPA_WLAN-RSSI.h +NULL.h +OBJECT_IDENTIFIER.h +OCTET_STRING.h +OPEN_TYPE.h +per_decoder.h +per_encoder.h +per_opentype.h +per_support.h +xer_decoder.h +xer_encoder.h +xer_support.h + +) \ No newline at end of file diff --git a/openair3/NRPPA/MESSAGES/CMakeLists.txt b/openair3/NRPPA/MESSAGES/CMakeLists.txt new file mode 100644 index 0000000000..e596272175 --- /dev/null +++ b/openair3/NRPPA/MESSAGES/CMakeLists.txt @@ -0,0 +1,22 @@ +#set(NRPPA_VERSION 16 78 0) +#make_version(NRPPA_cc ${NRPPA_VERSION}) +#add_definitions(-DNRPPA_VERSION=${NRPPA_cc}) +#string(REPLACE ";" "." NRPPA_RELEASE "${NRPPA_VERSION}") + +#if(NRPPA_RELEASE VERSION_EQUAL "16.78.0") +include(ASN1/38455.cmake) +#else() +# message(FATAL_ERROR "unknown NRPPA_RELEASE ${NRPPA_RELEASE}") +#endif() + +add_custom_command(OUTPUT ${nrppa_source} ${nrppa_headers} + COMMAND ASN1C_PREFIX=NRPPA_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${NRPPA_GRAMMAR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${NRPPA_GRAMMAR} + COMMENT "Generating NRPPA source files from ${CMAKE_CURRENT_SOURCE_DIR}/${NRPPA_GRAMMAR}" +) + +add_library(asn1_nrppa ${nrppa_source}) +target_include_directories(asn1_nrppa PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") +target_compile_options(asn1_nrppa PRIVATE -DASN_DISABLE_OER_SUPPORT -w) + + From 9a789dbb8a672cbee758ac8384a5a39d9511d16e Mon Sep 17 00:00:00 2001 From: laurent Date: Tue, 3 Jan 2023 11:39:26 +0100 Subject: [PATCH 24/39] ASN_SEQUENCE_ADD return code was checked only in 0.5% of calls, existing errors not detected by sanitize address --- common/ran_context.h | 1 + .../utils/{asn1_conversions.h => oai_asn1.h} | 16 +- doc/Doxyfile | 9 +- openair1/PHY/MODULATION/modulation_UE.h | 4 +- openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c | 2 +- openair1/SCHED_NR/phy_procedures_nr_common.c | 0 openair1/SCHED_NR_UE/fapi_nr_ue_l1.h | 0 openair1/SIMULATION/TOOLS/scm_corrmat.h | 2 +- openair2/F1AP/f1ap_common.h | 1 + openair2/F1AP/f1ap_cu_system_information.c | 2 +- openair2/F1AP/f1ap_cu_ue_context_management.c | 2 +- .../f1ap_cu_warning_message_transmission.c | 2 +- openair2/F1AP/f1ap_du_paging.c | 4 +- openair2/F1AP/f1ap_du_rrc_message_transfer.c | 8 +- openair2/F1AP/f1ap_du_system_information.c | 2 +- openair2/F1AP/f1ap_du_ue_context_management.c | 8 +- .../f1ap_du_warning_message_transmission.c | 2 +- openair2/GNB_APP/gnb_config.c | 29 +-- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- .../{asn1_utils.h => nr_pdcp_asn1_utils.h} | 0 openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 7 +- .../{asn1_utils.h => nr_rlc_asn1_utils.h} | 0 openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- .../rlc_v2/{asn1_utils.h => rlc_asn1_utils.h} | 0 openair2/LAYER2/rlc_v2/rlc_oai_api.c | 2 +- openair2/M2AP/m2ap_MCE_generate_messages.c | 64 +++--- openair2/M2AP/m2ap_MCE_handler.c | 2 +- openair2/M2AP/m2ap_MCE_interface_management.c | 68 +++--- openair2/M2AP/m2ap_common.h | 2 +- openair2/M2AP/m2ap_eNB_generate_messages.c | 64 +++--- openair2/M2AP/m2ap_eNB_handler.c | 2 - openair2/M2AP/m2ap_eNB_interface_management.c | 58 +++--- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 0 openair2/RRC/LTE/MESSAGES/asn1_msg.c | 195 +++++++++--------- openair2/RRC/LTE/MESSAGES/asn1_msg.h | 9 - openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c | 42 ++-- openair2/RRC/LTE/rrc_UE.c | 24 +-- openair2/RRC/LTE/rrc_eNB.c | 160 +++++++------- openair2/RRC/LTE/rrc_eNB_GTPV1U.c | 2 +- openair2/RRC/LTE/rrc_eNB_M2AP.c | 36 ++-- openair2/RRC/LTE/rrc_eNB_S1AP.c | 2 +- openair2/RRC/LTE/rrc_eNB_endc.c | 5 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 93 ++++----- openair2/RRC/NR/MESSAGES/asn1_msg.h | 1 - openair2/RRC/NR/nr_rrc_config.c | 84 ++++---- openair2/RRC/NR/nr_rrc_config.h | 9 +- openair2/RRC/NR/rrc_gNB.c | 46 ++--- openair2/RRC/NR/rrc_gNB_GTPV1U.c | 2 +- openair2/RRC/NR/rrc_gNB_NGAP.c | 2 +- openair2/RRC/NR/rrc_gNB_radio_bearers.c | 9 +- openair2/RRC/NR/rrc_gNB_radio_bearers.h | 2 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 35 ++-- openair2/RRC/NR_UE/rrc_UE.c | 8 +- openair2/X2AP/x2ap_common.h | 2 +- openair2/X2AP/x2ap_eNB_generate_messages.c | 156 +++++++------- openair2/X2AP/x2ap_eNB_handler.c | 2 - openair3/M3AP/m3ap_MCE_generate_messsages.c | 64 +++--- openair3/M3AP/m3ap_MCE_handler.c | 2 +- openair3/M3AP/m3ap_MCE_interface_management.c | 40 ++-- openair3/M3AP/m3ap_MME_generate_messages.c | 64 +++--- openair3/M3AP/m3ap_MME_handler.c | 2 +- openair3/M3AP/m3ap_MME_interface_management.c | 60 +++--- openair3/M3AP/m3ap_common.h | 2 +- openair3/M3AP/m3ap_handler.c | 2 +- .../ESM/MSG/PduSessionEstablishmentAccept.c | 2 +- .../ESM/MSG/PduSessionEstablishmentAccept.h | 2 +- openair3/NGAP/ngap_common.h | 1 + openair3/NGAP/ngap_gNB.c | 14 +- .../ngap_gNB_context_management_procedures.c | 14 +- openair3/NGAP/ngap_gNB_handlers.c | 2 - openair3/NGAP/ngap_gNB_nas_procedures.c | 90 ++++---- openair3/S1AP/s1ap_common.h | 1 + openair3/S1AP/s1ap_eNB.c | 12 +- .../s1ap_eNB_context_management_procedures.c | 10 +- openair3/S1AP/s1ap_eNB_handlers.c | 20 +- openair3/S1AP/s1ap_eNB_nas_procedures.c | 134 ++++++------ openair3/S1AP/s1ap_eNB_trace.c | 8 +- 78 files changed, 910 insertions(+), 931 deletions(-) rename common/utils/{asn1_conversions.h => oai_asn1.h} (88%) mode change 100755 => 100644 openair1/SCHED_NR/phy_procedures_nr_common.c mode change 100755 => 100644 openair1/SCHED_NR_UE/fapi_nr_ue_l1.h rename openair2/LAYER2/nr_pdcp/{asn1_utils.h => nr_pdcp_asn1_utils.h} (100%) rename openair2/LAYER2/nr_rlc/{asn1_utils.h => nr_rlc_asn1_utils.h} (100%) rename openair2/LAYER2/rlc_v2/{asn1_utils.h => rlc_asn1_utils.h} (100%) mode change 100755 => 100644 openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h mode change 100755 => 100644 openair2/RRC/NR/MESSAGES/asn1_msg.c mode change 100755 => 100644 openair2/RRC/NR/rrc_gNB.c diff --git a/common/ran_context.h b/common/ran_context.h index 1201753d1d..ae8d5b02c4 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -110,4 +110,5 @@ typedef struct { } RAN_CONTEXT_t; extern RAN_CONTEXT_t RC; + #endif diff --git a/common/utils/asn1_conversions.h b/common/utils/oai_asn1.h similarity index 88% rename from common/utils/asn1_conversions.h rename to common/utils/oai_asn1.h index 82dca54c08..f76f75c84c 100644 --- a/common/utils/asn1_conversions.h +++ b/common/utils/oai_asn1.h @@ -71,12 +71,11 @@ static inline uint16_t BIT_STRING_to_uint16(BIT_STRING_t *asn) { */ static inline uint32_t BIT_STRING_to_uint32(BIT_STRING_t *asn) { uint32_t result = 0; - int index; - int shift; + size_t index; DevCheck ((asn->size > 0) && (asn->size <= 4), asn->size, 0, 0); - shift = ((asn->size - 1) * 8) - asn->bits_unused; + int shift = ((asn->size - 1) * 8) - asn->bits_unused; for (index = 0; index < (asn->size - 1); index++) { result |= asn->buf[index] << shift; shift -= 8; @@ -94,7 +93,7 @@ static inline uint32_t BIT_STRING_to_uint32(BIT_STRING_t *asn) { */ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) { uint64_t result = 0; - int index; + size_t index; int shift; DevCheck ((asn->size > 0) && (asn->size <= 8), asn->size, 0, 0); @@ -110,4 +109,13 @@ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) { return result; } +#define asn1cSeqAdd(VaR, PtR) if (ASN_SEQUENCE_ADD(VaR,PtR)!=0) AssertFatal(false, "ASN.1 encoding error " #VaR "\n") +#define asn1cCallocOne(VaR, VaLue) \ + VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue +#define asn1cCalloc(VaR, lOcPtr) \ + typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR)) +#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \ + TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \ + asn1cSeqAdd(&VaR,lOcPtr) + #endif diff --git a/doc/Doxyfile b/doc/Doxyfile index 0da3180b99..5b849ccaa4 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -888,6 +888,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../common/config/libconfig/config_libconfig.c \ @CMAKE_CURRENT_SOURCE_DIR@/../common/config/libconfig/config_libconfig_private.h \ @CMAKE_CURRENT_SOURCE_DIR@/../common/config/config_userapi.c \ +@CMAKE_CURRENT_SOURCE_DIR@/../common/oai_asn1.h \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/time_meas.h \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/backtrace.c \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/time_stat.h \ @@ -930,7 +931,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/load_module_shlib.c \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/backtrace.h \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/assertions.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/asn1_conversions.h \ +@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/oai_asn1.h \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/threadPool/thread-pool.h \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/threadPool/thread-pool.c \ @CMAKE_CURRENT_SOURCE_DIR@/../common/utils/T/T.c \ @@ -1248,7 +1249,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/rlc_entity_am.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/rlc_sdu.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/rlc_entity.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/asn1_utils.h \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/rlc_asn1_utils.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/rlc_ue_manager.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/rlc_oai_api.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/rlc_v2/rlc_sdu.h \ @@ -1356,7 +1357,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_security_nea2.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/asn1_utils.h \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_asn1_utils.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia1.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/asn1_utils.c \ @@ -1390,7 +1391,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/nr_rlc_entity.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/nr_rlc_pdu.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/nr_rlc_sdu.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/asn1_utils.h \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/nr_rlc_asn1_utils.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/nr_rlc_pdu.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/nr_rlc_entity_am.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_rlc/asn1_utils.c \ diff --git a/openair1/PHY/MODULATION/modulation_UE.h b/openair1/PHY/MODULATION/modulation_UE.h index 031b444323..147e0855d0 100644 --- a/openair1/PHY/MODULATION/modulation_UE.h +++ b/openair1/PHY/MODULATION/modulation_UE.h @@ -48,10 +48,10 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, int no_prefix, int reset_freq_est); -int nr_slot_fep(PHY_VARS_NR_UE *phy_vars_ue, +int nr_slot_fep(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, unsigned char l, - c16_t rxdataF[][phy_vars_ue->frame_parms.samples_per_slot_wCP]); + c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c index c3ef1edb28..d2a25b1258 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c +++ b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c @@ -341,4 +341,4 @@ short filt16_ul_middle[16] = {2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048}; short filt16_ul_last[16] = {4096, 4096, 4096, 4096, 8192, 8192, 8192, 8192, - 0, 0, 0, 0, 0, 0, 0, 0}; \ No newline at end of file + 0, 0, 0, 0, 0, 0, 0, 0}; diff --git a/openair1/SCHED_NR/phy_procedures_nr_common.c b/openair1/SCHED_NR/phy_procedures_nr_common.c old mode 100755 new mode 100644 diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h old mode 100755 new mode 100644 diff --git a/openair1/SIMULATION/TOOLS/scm_corrmat.h b/openair1/SIMULATION/TOOLS/scm_corrmat.h index b3e4f0b6ad..6cb77b5796 100644 --- a/openair1/SIMULATION/TOOLS/scm_corrmat.h +++ b/openair1/SIMULATION/TOOLS/scm_corrmat.h @@ -136,4 +136,4 @@ static double R18_medium_high[8][8] = { {0.947664, 0.966182, 0.980834, 0.991436, 0.997852, 1.000000, 0.997852, 0.991436}, {0.925512, 0.947664, 0.966182, 0.980834, 0.991436, 0.997852, 1.000000, 0.997852}, {0.900000, 0.925512, 0.947664, 0.966182, 0.980834, 0.991436, 0.997852, 1.000000} -}; \ No newline at end of file +}; diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h index b322c4b3aa..1c537f1722 100644 --- a/openair2/F1AP/f1ap_common.h +++ b/openair2/F1AP/f1ap_common.h @@ -33,6 +33,7 @@ #define F1AP_COMMON_H_ #include "common/openairinterface5g_limits.h" +#include "oai_asn1.h" #include #define F1AP_UE_IDENTIFIER_NUMBER 3 diff --git a/openair2/F1AP/f1ap_cu_system_information.c b/openair2/F1AP/f1ap_cu_system_information.c index b6bbedba2f..725bb4e1af 100644 --- a/openair2/F1AP/f1ap_cu_system_information.c +++ b/openair2/F1AP/f1ap_cu_system_information.c @@ -28,4 +28,4 @@ * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr * \note * \warning - */ \ No newline at end of file + */ diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index b8f1d7d84e..7e29cba635 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -1262,7 +1262,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context F1AP_ULUPTNLInformation_ToBeSetup_Item_t, uLUPTNLInformation_ToBeSetup_Item); uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel; asn1cCalloc(uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel, - gTPTunnel) + gTPTunnel); /* transportLayerAddress */ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress); /* gTP_TEID */ diff --git a/openair2/F1AP/f1ap_cu_warning_message_transmission.c b/openair2/F1AP/f1ap_cu_warning_message_transmission.c index b6bbedba2f..725bb4e1af 100644 --- a/openair2/F1AP/f1ap_cu_warning_message_transmission.c +++ b/openair2/F1AP/f1ap_cu_warning_message_transmission.c @@ -28,4 +28,4 @@ * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr * \note * \warning - */ \ No newline at end of file + */ diff --git a/openair2/F1AP/f1ap_du_paging.c b/openair2/F1AP/f1ap_du_paging.c index 46f17fd64d..92601b357d 100644 --- a/openair2/F1AP/f1ap_du_paging.c +++ b/openair2/F1AP/f1ap_du_paging.c @@ -32,7 +32,7 @@ #include "f1ap_common.h" #include "f1ap_du_paging.h" #include "conversions.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "openair2/RRC/LTE/rrc_proto.h" int DU_handle_Paging(instance_t instance, @@ -94,4 +94,4 @@ int DU_handle_Paging(instance_t instance, } return 0; -} \ No newline at end of file +} diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.c b/openair2/F1AP/f1ap_du_rrc_message_transfer.c index 433e8414a3..c3e1595f42 100644 --- a/openair2/F1AP/f1ap_du_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.c @@ -550,7 +550,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ie->criticality = F1AP_Criticality_reject; ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID; ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(DUtype, instance, rnti); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. GNB_DU_UE_F1AP_ID */ ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t)); @@ -558,7 +558,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ie->criticality = F1AP_Criticality_reject; ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID; ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(DUtype, instance, rnti); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c3. SRBID */ ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t)); @@ -566,7 +566,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ie->criticality = F1AP_Criticality_reject; ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID; ie->value.choice.SRBID = msg->srb_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); // issue in here /* mandatory */ /* c4. RRCContainer */ @@ -577,7 +577,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char *) msg->rrc_container, msg->rrc_container_length); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (msg->srb_id == 1 || msg->srb_id == 2) { struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[instance], rnti); diff --git a/openair2/F1AP/f1ap_du_system_information.c b/openair2/F1AP/f1ap_du_system_information.c index b6bbedba2f..725bb4e1af 100644 --- a/openair2/F1AP/f1ap_du_system_information.c +++ b/openair2/F1AP/f1ap_du_system_information.c @@ -28,4 +28,4 @@ * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr * \note * \warning - */ \ No newline at end of file + */ diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c index aae59bbdae..05b4effbc0 100644 --- a/openair2/F1AP/f1ap_du_ue_context_management.c +++ b/openair2/F1AP/f1ap_du_ue_context_management.c @@ -1053,11 +1053,11 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, // criticalityDiagnostics_ie_item->iECriticality = F1AP_Criticality_reject; // criticalityDiagnostics_ie_item->iE_ID = 0L; // criticalityDiagnostics_ie_item->typeOfError = F1AP_TypeOfError_not_understood; - // ASN_SEQUENCE_ADD(&ie->value.choice.CriticalityDiagnostics.iEsCriticalityDiagnostics->list, + // asn1cSeqAdd(&ie->value.choice.CriticalityDiagnostics.iEsCriticalityDiagnostics->list, // criticalityDiagnostics_ie_item); // } // } - // ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + // asn1cSeqAdd(&out->protocolIEs.list, ie); //} /* encode */ uint8_t *buffer; @@ -1078,7 +1078,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, char *DUaddr, uint16_t DUport) { - openAddr_t tmp; + openAddr_t tmp={0}; strncpy(tmp.originHost, DUaddr, sizeof(tmp.originHost)-1); strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1); sprintf(tmp.originService, "%d", DUport); @@ -1427,7 +1427,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex &srbs_failedToBeSetupMod_item_ies->value.choice.SRBs_FailedToBeSetupMod_Item; /* - sRBID */ srbs_failedToBeSetupMod_item->sRBID = resp->srbs_failed_to_be_setup[i].rb_id; - asn1cCalloc(srbs_failedToBeSetupMod_item->cause, tmp) + asn1cCalloc(srbs_failedToBeSetupMod_item->cause, tmp); tmp->present = F1AP_Cause_PR_radioNetwork; tmp->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id; } diff --git a/openair2/F1AP/f1ap_du_warning_message_transmission.c b/openair2/F1AP/f1ap_du_warning_message_transmission.c index b6bbedba2f..725bb4e1af 100644 --- a/openair2/F1AP/f1ap_du_warning_message_transmission.c +++ b/openair2/F1AP/f1ap_du_warning_message_transmission.c @@ -28,4 +28,4 @@ * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr * \note * \warning - */ \ No newline at end of file + */ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index a33bbd0741..2c5db19d6d 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -34,6 +34,7 @@ #include "common/utils/nr/nr_common.h" #include "common/utils/LOG/log_extern.h" #include "assertions.h" +#include "oai_asn1.h" #include "executables/softmodem-common.h" #include "gnb_config.h" #include "gnb_paramdef.h" @@ -125,8 +126,8 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list,dl_frequencyBandList); - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list,dl_scs_SpecificCarrierList); + asn1cSeqAdd(&scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list,dl_frequencyBandList); + asn1cSeqAdd(&scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list,dl_scs_SpecificCarrierList); // scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long)); scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDCCH_ConfigCommon)); scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->present=NR_SetupRelease_PDCCH_ConfigCommon_PR_setup; @@ -148,7 +149,7 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR)); - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list,ul_frequencyBandList); + asn1cSeqAdd(&scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list,ul_frequencyBandList); scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t)); // scc->uplinkConfigCommon->frequencyInfoUL->additionalSpectrumEmission = CALLOC(1,sizeof(NR_AdditionalSpectrumEmission_t)); @@ -191,7 +192,7 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,ul_scs_SpecificCarrierList); + asn1cSeqAdd(&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,ul_scs_SpecificCarrierList); //ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern)); //ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); @@ -237,12 +238,12 @@ void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_R struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation0 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation0->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; timedomainresourceallocation0->startSymbolAndLength=54; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + asn1cSeqAdd(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, timedomainresourceallocation0); struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation1 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation1->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; timedomainresourceallocation1->startSymbolAndLength=57; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + asn1cSeqAdd(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, timedomainresourceallocation1); *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=mu_ul?78:38; *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; @@ -272,13 +273,13 @@ void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_R *pusch_timedomainresourceallocation0->k2=6; pusch_timedomainresourceallocation0->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; pusch_timedomainresourceallocation0->startSymbolAndLength=55; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation0); + asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation0); struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long)); *pusch_timedomainresourceallocation1->k2=6; pusch_timedomainresourceallocation1->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; pusch_timedomainresourceallocation1->startSymbolAndLength=38; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); + asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; @@ -426,17 +427,17 @@ void prepare_scd(NR_ServingCellConfig_t *scd) { NR_PTRS_DownlinkCfg->frequencyDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->frequencyDensity)); long *dl_rbs = CALLOC(2, sizeof(long)); for (int i=0;i<2;i++) { - ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->frequencyDensity->list, &dl_rbs[i]); + asn1cSeqAdd(&NR_PTRS_DownlinkCfg->frequencyDensity->list, &dl_rbs[i]); } NR_PTRS_DownlinkCfg->timeDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->timeDensity)); long *dl_mcs = CALLOC(3, sizeof(long)); for (int i=0;i<3;i++) { - ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->timeDensity->list, &dl_mcs[i]); + asn1cSeqAdd(&NR_PTRS_DownlinkCfg->timeDensity->list, &dl_mcs[i]); } NR_PTRS_DownlinkCfg->epre_Ratio = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->epre_Ratio)); NR_PTRS_DownlinkCfg->resourceElementOffset = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->resourceElementOffset)); *NR_PTRS_DownlinkCfg->resourceElementOffset = 0; - ASN_SEQUENCE_ADD(&scd->downlinkBWP_ToAddModList->list,bwp); + asn1cSeqAdd(&scd->downlinkBWP_ToAddModList->list,bwp); // Allocate uplink structures @@ -455,12 +456,12 @@ void prepare_scd(NR_ServingCellConfig_t *scd) { NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity)); long *n_rbs = CALLOC(2, sizeof(long)); for (int i=0;i<2;i++) { - ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity->list, &n_rbs[i]); + asn1cSeqAdd(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity->list, &n_rbs[i]); } NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity)); long *ptrs_mcs = CALLOC(3, sizeof(long)); for (int i = 0; i < 3; i++) { - ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity->list, &ptrs_mcs[i]); + asn1cSeqAdd(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity->list, &ptrs_mcs[i]); } NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset)); *NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset = 0; @@ -475,7 +476,7 @@ void prepare_scd(NR_ServingCellConfig_t *scd) { ubwp->bwp_Dedicated->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup; ubwp->bwp_Dedicated->pusch_Config->choice.setup = pusch_Config; - ASN_SEQUENCE_ADD(&scd->uplinkConfig->uplinkBWP_ToAddModList->list,ubwp); + asn1cSeqAdd(&scd->uplinkConfig->uplinkBWP_ToAddModList->list,ubwp); } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index cef268d517..4ba6a19c2a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -53,7 +53,7 @@ /* utils */ #include "assertions.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 902bb2aec8..0a742e2b5f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -43,7 +43,7 @@ /* utils */ #include "assertions.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "SIMULATION/TOOLS/sim.h" // for taus #include "utils.h" diff --git a/openair2/LAYER2/nr_pdcp/asn1_utils.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_asn1_utils.h similarity index 100% rename from openair2/LAYER2/nr_pdcp/asn1_utils.h rename to openair2/LAYER2/nr_pdcp/nr_pdcp_asn1_utils.h diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 1c1ee59e9e..c0046a7713 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -22,7 +22,7 @@ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif -#include "asn1_utils.h" +#include "nr_pdcp_asn1_utils.h" #include "nr_pdcp_ue_manager.h" #include "nr_pdcp_timer_thread.h" #include "NR_RadioBearerConfig.h" @@ -33,6 +33,7 @@ #include /* from OAI */ +#include "oai_asn1.h" #include "pdcp.h" #include "LAYER2/nr_rlc/nr_rlc_oai_api.h" #include @@ -1071,7 +1072,7 @@ void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid) *drb_ToAddMod->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0; drb_ToAddMod->pdcp_Config->ext1 = NULL; - ASN_SEQUENCE_ADD(&rbconfig->drb_ToAddModList->list,drb_ToAddMod); + asn1cSeqAdd(&rbconfig->drb_ToAddModList->list,drb_ToAddMod); rbconfig->drb_ToReleaseList = NULL; @@ -1093,7 +1094,7 @@ void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid) nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig); Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list)); - ASN_SEQUENCE_ADD(&Rlc_Bearer_ToAdd_list->list, RLC_BearerConfig); + asn1cSeqAdd(&Rlc_Bearer_ToAdd_list->list, RLC_BearerConfig); if (ENB_NAS_USE_TUN){ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_YES, crntiMaybeUEid, 0, 0, 0); diff --git a/openair2/LAYER2/nr_rlc/asn1_utils.h b/openair2/LAYER2/nr_rlc/nr_rlc_asn1_utils.h similarity index 100% rename from openair2/LAYER2/nr_rlc/asn1_utils.h rename to openair2/LAYER2/nr_rlc/nr_rlc_asn1_utils.h diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index d841260475..d17e53cce4 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -24,7 +24,7 @@ #include "pdcp.h" /* from nr rlc module */ -#include "asn1_utils.h" +#include "nr_rlc_asn1_utils.h" #include "nr_rlc_ue_manager.h" #include "nr_rlc_entity.h" #include "nr_rlc_oai_api.h" diff --git a/openair2/LAYER2/rlc_v2/asn1_utils.h b/openair2/LAYER2/rlc_v2/rlc_asn1_utils.h similarity index 100% rename from openair2/LAYER2/rlc_v2/asn1_utils.h rename to openair2/LAYER2/rlc_v2/rlc_asn1_utils.h diff --git a/openair2/LAYER2/rlc_v2/rlc_oai_api.c b/openair2/LAYER2/rlc_v2/rlc_oai_api.c index d0ab6a0632..7e9a33e087 100644 --- a/openair2/LAYER2/rlc_v2/rlc_oai_api.c +++ b/openair2/LAYER2/rlc_v2/rlc_oai_api.c @@ -24,7 +24,7 @@ #include "pdcp.h" /* from new rlc module */ -#include "asn1_utils.h" +#include "rlc_asn1_utils.h" #include "rlc_ue_manager.h" #include "rlc_entity.h" diff --git a/openair2/M2AP/m2ap_MCE_generate_messages.c b/openair2/M2AP/m2ap_MCE_generate_messages.c index 969863b445..3a4c1bb473 100644 --- a/openair2/M2AP/m2ap_MCE_generate_messages.c +++ b/openair2/M2AP/m2ap_MCE_generate_messages.c @@ -83,7 +83,7 @@ int m2ap_MCE_generate_m2_setup_request( // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[0], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[1], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupRequest_Ies_t *)calloc(1, sizeof(M2AP_M2SetupRequest_Ies_t)); @@ -105,7 +105,7 @@ int m2ap_MCE_generate_m2_setup_request( // plmn = (M2AP_PLMN_Identity_t *)calloc(1,sizeof(M2AP_PLMN_Identity_t)); // { // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - // ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); + // asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); // } // if (instance_p->frame_type[i] == FDD) { @@ -146,10 +146,10 @@ int m2ap_MCE_generate_m2_setup_request( // AssertFatal(0,"M2Setuprequest not supported for TDD!"); // } // } - // ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); + // asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); // } //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupRequest_Ies_t *)calloc(1, sizeof(M2AP_M2SetupRequest_Ies_t)); @@ -164,9 +164,9 @@ int m2ap_MCE_generate_m2_setup_request( // //@TODO: consider to update this value // INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); // } - // ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); + // asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { M2AP_ERROR("Failed to encode M2 setup request\n"); @@ -216,7 +216,7 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[0], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[1], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -238,7 +238,7 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // plmn = (M2AP_PLMN_Identity_t *)calloc(1,sizeof(M2AP_PLMN_Identity_t)); // { // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - // ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); + // asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); // } // if (instance_p->frame_type[i] == FDD) { @@ -279,10 +279,10 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // AssertFatal(0,"M2Setupresponse not supported for TDD!"); // } // } - // ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); + // asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); // } //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -297,9 +297,9 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // //@TODO: consider to update this value // INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); // } - // ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); + // asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { M2AP_ERROR("Failed to encode M2 setup response\n"); @@ -343,7 +343,7 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, //m2ap_MCE_set_cause (&ie->value.choice.Cause, cause_type, cause_value); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional: consider to handle this later */ ie = (M2AP_M2SetupFailure_Ies_t *)calloc(1, sizeof(M2AP_M2SetupFailure_Ies_t)); @@ -355,7 +355,7 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, // ie->value.choice.TimeToWait = time_to_wait; //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { M2AP_ERROR("Failed to encode M2 setup failure\n"); @@ -431,7 +431,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = m2ap_id_get_id_source(&instance_p->id_manager, ue_id); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -440,7 +440,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_Cause; // ie->value.choice.Cause.present = M2AP_Cause_PR_radioNetwork; // ie->value.choice.Cause.choice.radioNetwork = M2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -450,7 +450,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, // &ie->value.choice.ECGI.pLMN_Identity); // MACRO_MCE_ID_TO_CELL_IDENTITY(m2ap_MCE_data_p->MCE_id, 0, &ie->value.choice.ECGI.eUTRANcellIdentifier); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -462,7 +462,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // //@TODO: consider to update these values // INT16_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_group_id, &ie->value.choice.GUMMEI.gU_Group_ID.mME_Group_ID); // MME_CODE_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_code, &ie->value.choice.GUMMEI.mME_Code); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -514,13 +514,13 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // // INT32_TO_OCTET_STRING(m2ap_handover_req->e_rabs_tobesetup[i].gtp_teid,&e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.gTP_TEID); // } -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); // } // } // // OCTET_STRING_fromBuf(&ie->value.choice.UE_ContextInformation.rRC_Context, (char*) m2ap_handover_req->rrc_buffer, m2ap_handover_req->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -536,10 +536,10 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // MACRO_MCE_ID_TO_CELL_IDENTITY(0, 0, &lastVisitedCell_Item->choice.e_UTRAN_Cell.global_Cell_ID.eUTRANcellIdentifier); // lastVisitedCell_Item->choice.e_UTRAN_Cell.cellType.cell_Size = M2AP_Cell_Size_small; // lastVisitedCell_Item->choice.e_UTRAN_Cell.time_UE_StayedInCell = 2; -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); +// asn1cSeqAdd(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover request\n"); @@ -590,7 +590,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -598,7 +598,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -616,11 +616,11 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // { // e_RABs_Admitted_Item->e_RAB_ID = m2ap_handover_req_ack->e_rabs_tobesetup[i].e_rab_id; // } -// ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); // } // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -630,7 +630,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // // OCTET_STRING_fromBuf(&ie->value.choice.TargetMCEtoSource_MCETransparentContainer, (char*) m2ap_handover_req_ack->rrc_buffer, m2ap_handover_req_ack->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover response\n"); @@ -682,7 +682,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(M2AP_UEContextRelease_IEs_t)); @@ -690,7 +690,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 UE Context Release\n"); @@ -739,7 +739,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional */ // if (id_target != -1) { @@ -748,7 +748,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // } // // /* mandatory */ @@ -772,7 +772,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // M2AP_ERROR("unhandled cancel cause\n"); // exit(1); // } -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 Handover Cancel\n"); diff --git a/openair2/M2AP/m2ap_MCE_handler.c b/openair2/M2AP/m2ap_MCE_handler.c index 3f6d5ff64d..540acc4f6d 100644 --- a/openair2/M2AP/m2ap_MCE_handler.c +++ b/openair2/M2AP/m2ap_MCE_handler.c @@ -30,7 +30,7 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "m2ap_common.h" #include "m2ap_MCE_defs.h" diff --git a/openair2/M2AP/m2ap_MCE_interface_management.c b/openair2/M2AP/m2ap_MCE_interface_management.c index 28f5fccffa..0ece50b88e 100644 --- a/openair2/M2AP/m2ap_MCE_interface_management.c +++ b/openair2/M2AP/m2ap_MCE_interface_management.c @@ -76,7 +76,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStartRequest_Ies__value_PR_MCE_MBMS_M2AP_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. TMGI (integrer value) */ @@ -90,7 +90,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id //&ie->choice.TMGI.pLMN_Identity); //INT16_TO_OCTET_STRING(0,&ie->choice.TMGI.serviceId); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c3. MBMS_Session_ID (integrer value) */ //OCTET_STRING @@ -100,7 +100,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStartRequest_Ies__value_PR_MBMS_Session_ID; //INT16_TO_OCTET_STRING(0,&ie->choice.MBMS_Session_ID); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -113,7 +113,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id //strlen(m2ap_setup_resp->MCEname)); //INT16_TO_OCTET_STRING(0,&ie->choice.TMGI.serviceId); ie->value.choice.MBMS_Service_Area.buf = calloc(3,sizeof(uint8_t)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ @@ -131,7 +131,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id OCTET_STRING_fromBuf(&ie->value.choice.TNL_Information.iPMCAddress, "1204",strlen("1234")); OCTET_STRING_fromBuf(&ie->value.choice.TNL_Information.iPSourceAddress, "1204",strlen("1234")); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if(0){ // /* optional */ @@ -141,7 +141,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_SessionStartRequest_Ies__value_PR_TNL_Information_1; // //asn_int642INTEGER(&ie->value.choice.MBMS_Session_ID, f1ap_du_data->MBMS_Session_ID); //? - // ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + // asn1cSeqAdd(&out->protocolIEs.list, ie); } @@ -258,8 +258,8 @@ int MCE_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m2ap_session_stop_re ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID; ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStopRequest_Ies__value_PR_MCE_MBMS_M2AP_ID; - ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + ie->value.choice.MCE_MBMS_M2AP_ID = 0; /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. ENB_MBMS_M2AP_ID (integer value) */ //long @@ -267,9 +267,9 @@ int MCE_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m2ap_session_stop_re ie->id = M2AP_ProtocolIE_ID_id_ENB_MBMS_M2AP_ID; ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStopRequest_Ies__value_PR_ENB_MBMS_M2AP_ID; - ie->value.choice.ENB_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? + ie->value.choice.ENB_MBMS_M2AP_ID = 0;/*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* encode */ @@ -411,7 +411,7 @@ int MCE_send_MBMS_SCHEDULING_INFORMATION(instance_t instance, /*uint32_t assoc_i //ie->value.choice.MCCH_Update_Time = ; ie->value.choice.MCCH_Update_Time = m2ap_mbms_scheduling_information->mcch_update_time; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. MBSFN_Area_Configuration_List */ //long @@ -471,7 +471,7 @@ int MCE_send_MBMS_SCHEDULING_INFORMATION(instance_t instance, /*uint32_t assoc_i member->lcid = m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].lcid; //member->lcid = (M2AP_LCID_t*)calloc(1,sizeof(M2AP_LCID_t)); - ASN_SEQUENCE_ADD(&pmch_configuration_item->mbms_Session_List.list,member); + asn1cSeqAdd(&pmch_configuration_item->mbms_Session_List.list,member); } } @@ -479,11 +479,11 @@ int MCE_send_MBMS_SCHEDULING_INFORMATION(instance_t instance, /*uint32_t assoc_i // M2AP_MBSFN_Area_Configuration_Item_t *mbsfn_area_configuration_item_ie2; //(mbsfn_area_configuration_item_ie+1) =(M2AP_MBSFN_Area_Configuration_Item_t*)calloc(1,sizeof(M2AP_MBSFN_Area_Configuration_Item_t)); - ASN_SEQUENCE_ADD(&mbsfn_area_configuration_item_ie->value.choice.PMCH_Configuration_List.list,pmch_configuration_item_ies); + asn1cSeqAdd(&mbsfn_area_configuration_item_ie->value.choice.PMCH_Configuration_List.list,pmch_configuration_item_ies); } - ASN_SEQUENCE_ADD(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie); + asn1cSeqAdd(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie); /*M2AP_MBSFN_Area_Configuration_Item_t*/ M2AP_MBSFN_Area_Configuration_Item_t *mbsfn_area_configuration_item_ie_1; @@ -523,11 +523,11 @@ int MCE_send_MBMS_SCHEDULING_INFORMATION(instance_t instance, /*uint32_t assoc_i mbsfn_subframe_configuration->subframeAllocation.choice.oneFrame.buf[0] = (m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].subframe_allocation & 0x3F)<<2; } - ASN_SEQUENCE_ADD(&(mbsfn_area_configuration_item_ie_1)->value.choice.MBSFN_Subframe_ConfigurationList.list,mbsfn_subframe_configuration_item_ies); + asn1cSeqAdd(&(mbsfn_area_configuration_item_ie_1)->value.choice.MBSFN_Subframe_ConfigurationList.list,mbsfn_subframe_configuration_item_ies); } } - ASN_SEQUENCE_ADD(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie_1); + asn1cSeqAdd(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie_1); /*M2AP_MBSFN_Area_Configuration_Item_t*/ @@ -538,7 +538,7 @@ int MCE_send_MBMS_SCHEDULING_INFORMATION(instance_t instance, /*uint32_t assoc_i (mbsfn_area_configuration_item_ie_2)->value.present = M2AP_MBSFN_Area_Configuration_Item__value_PR_Common_Subframe_Allocation_Period; (mbsfn_area_configuration_item_ie_2)->value.choice.Common_Subframe_Allocation_Period=m2ap_mbms_scheduling_information->mbms_area_config_list[i].common_sf_allocation_period; - ASN_SEQUENCE_ADD(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie_2); + asn1cSeqAdd(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie_2); /*M2AP_MBSFN_Area_Configuration_Item_t*/ @@ -549,7 +549,7 @@ int MCE_send_MBMS_SCHEDULING_INFORMATION(instance_t instance, /*uint32_t assoc_i (mbsfn_area_configuration_item_ie_3)->value.present = M2AP_MBSFN_Area_Configuration_Item__value_PR_MBSFN_Area_ID; (mbsfn_area_configuration_item_ie_3)->value.choice.MBSFN_Area_ID = m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_area_id; - ASN_SEQUENCE_ADD(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie_3); + asn1cSeqAdd(m2ap_mbsfn_area_configuration_list,mbsfn_area_configuration_item_ie_3); ASN_SET_ADD(&ie->value.choice.MBSFN_Area_Configuration_List,m2ap_mbsfn_area_configuration_list); @@ -563,7 +563,7 @@ ASN_SET_ADD(&ie->value.choice.MBSFN_Area_Configuration_List,m2ap_mbsfn_area_conf } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); @@ -879,7 +879,7 @@ int MCE_send_M2_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/ ie->value.choice.GlobalMCE_ID.mCE_ID.size=2; //ie->value.choice.GlobalMCE_ID.mCE_ID.bits_unused=0; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c2. MCEname */ @@ -890,7 +890,7 @@ int MCE_send_M2_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/ ie->value.present = M2AP_M2SetupResponse_Ies__value_PR_MCEname; OCTET_STRING_fromBuf(&ie->value.choice.MCEname, m2ap_setup_resp->MCE_name, strlen(m2ap_setup_resp->MCE_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -934,12 +934,12 @@ int MCE_send_M2_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/ //memset(&config_per_mbsfn_area_item->subframeAllocationInfo,0,sizeof(BIT_STRING_t)); config_per_mbsfn_area_item->modulationAndCodingScheme = m2ap_setup_resp->mcch_config_per_mbsfn[i].mcs;//M2AP_MCCHrelatedBCCH_ConfigPerMBSFNArea_Item__modulationAndCodingScheme_n2; - ASN_SEQUENCE_ADD(&ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea.list,mcch_related_bcch_config_per_mbsfn_area_item_ies); + asn1cSeqAdd(&ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea.list,mcch_related_bcch_config_per_mbsfn_area_item_ies); } } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* encode */ @@ -986,7 +986,7 @@ int MCE_send_M2_SETUP_FAILURE(instance_t instance,m2ap_setup_failure_t* m2ap_set // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_M2SetupFailure_Ies__value_PR_GlobalENB_ID; // ie->value.choice.GlobalENB_ID = M2AP_get_next_transaction_identifier(enb_mod_idP, mce_mod_idP); - // ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + // asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. Cause */ @@ -996,7 +996,7 @@ int MCE_send_M2_SETUP_FAILURE(instance_t instance,m2ap_setup_failure_t* m2ap_set ie->value.present = M2AP_M2SetupFailure_Ies__value_PR_Cause; ie->value.choice.Cause.present = M2AP_Cause_PR_radioNetwork; ie->value.choice.Cause.choice.radioNetwork = M2AP_CauseRadioNetwork_unspecified; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c3. TimeToWait */ @@ -1006,7 +1006,7 @@ int MCE_send_M2_SETUP_FAILURE(instance_t instance,m2ap_setup_failure_t* m2ap_set ie->criticality = M2AP_Criticality_ignore; ie->value.present = M2AP_M2SetupFailure_Ies__value_PR_TimeToWait; ie->value.choice.TimeToWait = M2AP_TimeToWait_v10s; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1024,7 +1024,7 @@ int MCE_send_M2_SETUP_FAILURE(instance_t instance,m2ap_setup_failure_t* m2ap_set *ie->value.choice.CriticalityDiagnostics.procedureCriticality = M2AP_Criticality_reject; //ie->value.choice.CriticalityDiagnostics.transactionID = (M2AP_TransactionID_t *)calloc(1, sizeof(M2AP_TransactionID_t)); //*ie->value.choice.CriticalityDiagnostics.transactionID = 0; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* encode */ @@ -1080,7 +1080,7 @@ int MCE_send_MCE_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_id ie->value.choice.GlobalMCE_ID.mCE_ID.size=2; //ie->value.choice.GlobalMCE_ID.mCE_ID.bits_unused=6; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c2. MCEname */ @@ -1091,7 +1091,7 @@ int MCE_send_MCE_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_id // ie->value.present = M2AP_MCEConfigurationUpdate_Ies__value_PR_MCEname; // OCTET_STRING_fromBuf(&ie->value.choice.MCEname, m2ap_setup_resp->MCEname, // strlen(m2ap_setup_resp->MCEname)); - // ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + // asn1cSeqAdd(&out->protocolIEs.list, ie); //} /* mandatory */ @@ -1122,10 +1122,10 @@ int MCE_send_MCE_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_id //memset(&config_per_mbsfn_area_item->subframeAllocationInfo,0,sizeof(BIT_STRING_t)); config_per_mbsfn_area_item->modulationAndCodingScheme = M2AP_MCCHrelatedBCCH_ConfigPerMBSFNArea_Item__modulationAndCodingScheme_n2; - ASN_SEQUENCE_ADD(&ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea.list,mcch_related_bcch_config_per_mbsfn_area_item_ies); + asn1cSeqAdd(&ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea.list,mcch_related_bcch_config_per_mbsfn_area_item_ies); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* encode */ @@ -1428,7 +1428,7 @@ int MCE_handle_MBMS_SESSION_COUNTING_FAILURE(instance_t instance, module_id_t d //ie->value.choice.MCCH_Update_Time = ; //ie->value.choice.MCCH_Update_Time = m2ap_mbms_scheduling_information->mcch_update_time; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ @@ -1438,7 +1438,7 @@ int MCE_handle_MBMS_SESSION_COUNTING_FAILURE(instance_t instance, module_id_t d ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_MbmsServiceCountingRequest_Ies__value_PR_MBSFN_Area_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. TMGI (integrer value) */ @@ -1451,7 +1451,7 @@ int MCE_handle_MBMS_SESSION_COUNTING_FAILURE(instance_t instance, module_id_t d //&ie->choice.TMGI.pLMN_Identity); //INT16_TO_OCTET_STRING(0,&ie->choice.TMGI.serviceId); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { LOG_E(M2AP, "Failed to encode MBMS Service Counting Results Report\n"); diff --git a/openair2/M2AP/m2ap_common.h b/openair2/M2AP/m2ap_common.h index 2e84c51938..c144c78dcf 100644 --- a/openair2/M2AP/m2ap_common.h +++ b/openair2/M2AP/m2ap_common.h @@ -20,7 +20,7 @@ */ #ifndef M2AP_COMMON_H_ #define M2AP_COMMON_H_ - +#include "oai_asn1.h" #include "M2AP_ProtocolIE-Field.h" #include "M2AP_M2AP-PDU.h" #include "M2AP_InitiatingMessage.h" diff --git a/openair2/M2AP/m2ap_eNB_generate_messages.c b/openair2/M2AP/m2ap_eNB_generate_messages.c index 6496d608b8..89c83a8701 100644 --- a/openair2/M2AP/m2ap_eNB_generate_messages.c +++ b/openair2/M2AP/m2ap_eNB_generate_messages.c @@ -84,7 +84,7 @@ // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // ///* mandatory */ // ///* c2. GNB_eNB_ID (integrer value) */ @@ -93,7 +93,7 @@ // //ie->criticality = M2AP_Criticality_reject; // //ie->value.present = M2AP_M2SetupRequestIEs__value_PR_GNB_eNB_ID; // //asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, f1ap_du_data->gNB_eNB_id); -// //ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// //asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional */ // /* c3. ENBname */ @@ -104,7 +104,7 @@ // ie->value.present = M2AP_M2SetupRequest_Ies__value_PR_ENBname; // //OCTET_STRING_fromBuf(&ie->value.choice.ENB_Name, m2ap_eNB_data_p->eNB_name, // //strlen(m2ap_eNB_data_p->eNB_name)); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // } // // /* mandatory */ @@ -138,7 +138,7 @@ // &mbms_configuration_data_item->eCGI.eUTRANcellIdentifier); // M2AP_MBMS_Service_Area_t * mbms_service_area; // mbms_service_area = (M2AP_MBMS_Service_Area_t*)calloc(1,sizeof(M2AP_MBMS_Service_Area_t)); -// ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); +// asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); // // // } @@ -154,10 +154,10 @@ // //M2AP_MBMS_Service_Area_ID_List_t mbmsServiceAreaList; // // -// ASN_SEQUENCE_ADD(&ie->value.choice.ENB_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); +// asn1cSeqAdd(&ie->value.choice.ENB_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); // // } -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // LOG_W(M2AP,"m2ap_eNB_data_p->assoc_id %d\n",m2ap_eNB_data_p->assoc_id); // /* encode */ @@ -213,7 +213,7 @@ // // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0], // // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], // // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -235,7 +235,7 @@ // // plmn = (M2AP_PLMN_Identity_t *)calloc(1,sizeof(M2AP_PLMN_Identity_t)); // // { // // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); -// // ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); +// // asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); // // } // // // if (instance_p->frame_type[i] == FDD) { @@ -276,10 +276,10 @@ // // AssertFatal(0,"M2Setupresponse not supported for TDD!"); // // } // // } -// // ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); +// // asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); // // } // //} -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -294,9 +294,9 @@ // // //@TODO: consider to update this value // // INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); // // } -// // ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); +// // asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); // //} -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode M2 setup response\n"); @@ -340,7 +340,7 @@ // // //m2ap_eNB_set_cause (&ie->value.choice.Cause, cause_type, cause_value); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional: consider to handle this later */ // ie = (M2AP_M2SetupFailure_Ies_t *)calloc(1, sizeof(M2AP_M2SetupFailure_Ies_t)); @@ -352,7 +352,7 @@ // // ie->value.choice.TimeToWait = time_to_wait; // //} // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode M2 setup failure\n"); @@ -428,7 +428,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = m2ap_id_get_id_source(&instance_p->id_manager, ue_id); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -437,7 +437,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_Cause; // ie->value.choice.Cause.present = M2AP_Cause_PR_radioNetwork; // ie->value.choice.Cause.choice.radioNetwork = M2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -447,7 +447,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, // &ie->value.choice.ECGI.pLMN_Identity); // MACRO_ENB_ID_TO_CELL_IDENTITY(m2ap_eNB_data_p->eNB_id, 0, &ie->value.choice.ECGI.eUTRANcellIdentifier); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -459,7 +459,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // //@TODO: consider to update these values // INT16_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_group_id, &ie->value.choice.GUMMEI.gU_Group_ID.mME_Group_ID); // MME_CODE_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_code, &ie->value.choice.GUMMEI.mME_Code); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -511,13 +511,13 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // // INT32_TO_OCTET_STRING(m2ap_handover_req->e_rabs_tobesetup[i].gtp_teid,&e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.gTP_TEID); // } -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); // } // } // // OCTET_STRING_fromBuf(&ie->value.choice.UE_ContextInformation.rRC_Context, (char*) m2ap_handover_req->rrc_buffer, m2ap_handover_req->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -533,10 +533,10 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // MACRO_ENB_ID_TO_CELL_IDENTITY(0, 0, &lastVisitedCell_Item->choice.e_UTRAN_Cell.global_Cell_ID.eUTRANcellIdentifier); // lastVisitedCell_Item->choice.e_UTRAN_Cell.cellType.cell_Size = M2AP_Cell_Size_small; // lastVisitedCell_Item->choice.e_UTRAN_Cell.time_UE_StayedInCell = 2; -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); +// asn1cSeqAdd(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover request\n"); @@ -587,7 +587,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -595,7 +595,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -613,11 +613,11 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // { // e_RABs_Admitted_Item->e_RAB_ID = m2ap_handover_req_ack->e_rabs_tobesetup[i].e_rab_id; // } -// ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); // } // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -627,7 +627,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // // OCTET_STRING_fromBuf(&ie->value.choice.TargeteNBtoSource_eNBTransparentContainer, (char*) m2ap_handover_req_ack->rrc_buffer, m2ap_handover_req_ack->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover response\n"); @@ -679,7 +679,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(M2AP_UEContextRelease_IEs_t)); @@ -687,7 +687,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 UE Context Release\n"); @@ -736,7 +736,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional */ // if (id_target != -1) { @@ -745,7 +745,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // } // // /* mandatory */ @@ -769,7 +769,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // M2AP_ERROR("unhandled cancel cause\n"); // exit(1); // } -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 Handover Cancel\n"); diff --git a/openair2/M2AP/m2ap_eNB_handler.c b/openair2/M2AP/m2ap_eNB_handler.c index 7c4a9758da..cc73572492 100644 --- a/openair2/M2AP/m2ap_eNB_handler.c +++ b/openair2/M2AP/m2ap_eNB_handler.c @@ -30,8 +30,6 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" - #include "m2ap_common.h" #include "m2ap_eNB_defs.h" #include "m2ap_eNB_handler.h" diff --git a/openair2/M2AP/m2ap_eNB_interface_management.c b/openair2/M2AP/m2ap_eNB_interface_management.c index 9bab800525..df3f060226 100644 --- a/openair2/M2AP/m2ap_eNB_interface_management.c +++ b/openair2/M2AP/m2ap_eNB_interface_management.c @@ -235,7 +235,7 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_MbmsSchedulingInformationResponse_Ies__value_PR_MCE_MBMS_M2AP_ID; // //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // /* c1. MCE_MBMS_M2AP_ID (integer value) */ //long @@ -244,7 +244,7 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_MbmsSchedulingInformationResponse_Ies__value_PR_ENB_MBMS_M2AP_ID; // //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { @@ -330,7 +330,7 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStartResponse_Ies__value_PR_MCE_MBMS_M2AP_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c1. MCE_MBMS_M2AP_ID (integer value) */ //long @@ -339,7 +339,7 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStartResponse_Ies__value_PR_ENB_MBMS_M2AP_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { @@ -387,7 +387,7 @@ int eNB_send_MBMS_SESSION_START_FAILURE(instance_t instance, m2ap_session_start_ // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_M2SetupFailure_Ies__value_PR_GlobalENB_ID; // ie->value.choice.GlobalENB_ID = M2AP_get_next_transaction_identifier(enb_mod_idP, mce_mod_idP); - // ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + // asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c1. MCE_MBMS_M2AP_ID (integer value) */ //long @@ -396,7 +396,7 @@ int eNB_send_MBMS_SESSION_START_FAILURE(instance_t instance, m2ap_session_start_ ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStartFailure_Ies__value_PR_MCE_MBMS_M2AP_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); @@ -408,7 +408,7 @@ int eNB_send_MBMS_SESSION_START_FAILURE(instance_t instance, m2ap_session_start_ ie->value.present = M2AP_SessionStartFailure_Ies__value_PR_Cause; ie->value.choice.Cause.present = M2AP_Cause_PR_radioNetwork; ie->value.choice.Cause.choice.radioNetwork = M2AP_CauseRadioNetwork_unspecified; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* encode */ @@ -494,7 +494,7 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStopResponse_Ies__value_PR_MCE_MBMS_M2AP_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c1. MCE_MBMS_M2AP_ID (integer value) */ //long @@ -503,7 +503,7 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_SessionStopResponse_Ies__value_PR_ENB_MBMS_M2AP_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { @@ -571,7 +571,7 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t* ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ///* mandatory */ ///* c2. GNB_eNB_ID (integrer value) */ @@ -580,7 +580,7 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t* //ie->criticality = M2AP_Criticality_reject; //ie->value.present = M2AP_M2SetupRequestIEs__value_PR_GNB_eNB_ID; //asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, f1ap_du_data->gNB_eNB_id); - //ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + //asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c3. ENBname */ @@ -591,7 +591,7 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t* ie->value.present = M2AP_M2SetupRequest_Ies__value_PR_ENBname; OCTET_STRING_fromBuf(&ie->value.choice.ENBname, m2ap_eNB_data_p->eNB_name, strlen(m2ap_eNB_data_p->eNB_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -635,16 +635,16 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t* OCTET_STRING_fromBuf(mbms_service_area,buf,2); //LOG_D(M2AP,"%s\n",instance_p->mbms_configuration_data_list[i].mbms_service_area_list[j]); //OCTET_STRING_fromBuf(mbms_service_area,"03",2); - ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); + asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); } /*M2AP_MBMS_Service_Area_t * mbms_service_area,*mbms_service_area2; mbms_service_area = (M2AP_MBMS_Service_Area_t*)calloc(1,sizeof(M2AP_MBMS_Service_Area_t)); mbms_service_area2 = (M2AP_MBMS_Service_Area_t*)calloc(1,sizeof(M2AP_MBMS_Service_Area_t)); //memset(mbms_service_area,0,sizeof(OCTET_STRING_t)); OCTET_STRING_fromBuf(mbms_service_area,"01",2); - ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); + asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); OCTET_STRING_fromBuf(mbms_service_area2,"02",2); - ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area2);*/ + asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area2);*/ } @@ -660,10 +660,10 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t* //M2AP_MBMS_Service_Area_ID_List_t mbmsServiceAreaList; - ASN_SEQUENCE_ADD(&ie->value.choice.ENB_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); + asn1cSeqAdd(&ie->value.choice.ENB_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); LOG_D(M2AP,"m2ap_eNB_data_p->assoc_id %d\n",m2ap_eNB_data_p->assoc_id); /* encode */ @@ -888,7 +888,7 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c3. ENBname */ @@ -899,7 +899,7 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio ie->value.present = M2AP_ENBConfigurationUpdate_Ies__value_PR_ENBname; //OCTET_STRING_fromBuf(&ie->value.choice.ENBname, m2ap_eNB_data_p->eNB_name, //strlen(m2ap_eNB_data_p->eNB_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -940,9 +940,9 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio mbms_service_area2 = (M2AP_MBMS_Service_Area_t*)calloc(1,sizeof(M2AP_MBMS_Service_Area_t)); //memset(mbms_service_area,0,sizeof(OCTET_STRING_t)); OCTET_STRING_fromBuf(mbms_service_area,"01",2); - ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); + asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); OCTET_STRING_fromBuf(mbms_service_area2,"02",2); - ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area2); + asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area2); } @@ -958,10 +958,10 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio //M2AP_MBMS_Service_Area_ID_List_t mbmsServiceAreaList; - ASN_SEQUENCE_ADD(&ie->value.choice.ENB_MBMS_Configuration_data_List_ConfigUpdate.list,mbms_configuration_data_list_item_ies); + asn1cSeqAdd(&ie->value.choice.ENB_MBMS_Configuration_data_List_ConfigUpdate.list,mbms_configuration_data_list_item_ies); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); //LOG_D(M2AP,"m2ap_eNB_data_p->assoc_id %d\n",m2ap_eNB_data_p->assoc_id); /* encode */ @@ -1291,7 +1291,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_REPORT(instance_t instance, m2ap_mbms_service ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_MbmsServiceCountingResultsReport_Ies__value_PR_MBSFN_Area_ID; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c1. MBSFN_Area_ID (integer value) */ //long @@ -1315,11 +1315,11 @@ int eNB_send_MBMS_SERVICE_COUNTING_REPORT(instance_t instance, m2ap_mbms_service //M2AP_CountingResult_t * m2ap_counting_result = &m2ap_mbms_counting_result->countingResult; - ASN_SEQUENCE_ADD(&m2ap_mbms_counting_result_list->list,m2ap_mbms_counting_result_item); + asn1cSeqAdd(&m2ap_mbms_counting_result_list->list,m2ap_mbms_counting_result_item); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { LOG_E(M2AP, "Failed to encode MBMS Service Counting Results Report\n"); @@ -1357,7 +1357,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_RESP(instance_t instance, m2ap_mbms_service_c ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_MbmsServiceCountingResponse_Ies__value_PR_CriticalityDiagnostics; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { LOG_E(M2AP, "Failed to encode MBMS Service Counting Results Report\n"); @@ -1396,7 +1396,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_FAILURE(instance_t instance, m2ap_mbms_servic ie->criticality = M2AP_Criticality_reject; ie->value.present = M2AP_MbmsServiceCountingFailure_Ies__value_PR_CriticalityDiagnostics; //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. Cause */ @@ -1406,7 +1406,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_FAILURE(instance_t instance, m2ap_mbms_servic ie->value.present = M2AP_MbmsServiceCountingFailure_Ies__value_PR_Cause; ie->value.choice.Cause.present = M2AP_Cause_PR_radioNetwork; ie->value.choice.Cause.choice.radioNetwork = M2AP_CauseRadioNetwork_unspecified; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h old mode 100755 new mode 100644 diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 4cbf23ee9d..ec3f42ee22 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -44,8 +44,8 @@ #include /* for EX_* exit codes */ #include /* for errno */ #include "common/utils/LOG/log.h" +#include "oai_asn1.h" #include -#include /* for _ASN_DEFAULT_STACK_MAX */ #include #include "executables/lte-softmodem.h" #include "assertions.h" @@ -456,9 +456,9 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier, *dummy_mcc_1 = (configuration->mcc[i] / 10) % 10; *dummy_mcc_2 = (configuration->mcc[i] / 1) % 10; - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_0); - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_1); - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_2); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_0); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_1); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_2); PLMN_identity_info[i].plmn_Identity.mnc.list.size=0; PLMN_identity_info[i].plmn_Identity.mnc.list.count=0; dummy_mnc_0 = CALLOC(1, sizeof(LTE_MCC_MNC_Digit_t)); @@ -484,18 +484,18 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier, } } - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_0); - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_1); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_0); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_1); if (*dummy_mnc_2 != 0xf) { - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_2); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_2); } else { free(dummy_mnc_2); } //assign_enum(&PLMN_identity_info.cellReservedForOperatorUse,PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved); PLMN_identity_info[i].cellReservedForOperatorUse=LTE_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved; - ASN_SEQUENCE_ADD(&(*sib1_MBMS)->cellAccessRelatedInfo_r14.plmn_IdentityList_r14.list,&PLMN_identity_info[i]); + asn1cSeqAdd(&(*sib1_MBMS)->cellAccessRelatedInfo_r14.plmn_IdentityList_r14.list,&PLMN_identity_info[i]); } // 16 bits @@ -516,8 +516,8 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier, schedulingInfo->si_Periodicity_r14=LTE_SchedulingInfo__si_Periodicity_rf16; *sib_type = LTE_SIB_Type_MBMS_r14_sibType13_v920; - ASN_SEQUENCE_ADD(&schedulingInfo->sib_MappingInfo_r14.list, sib_type); - ASN_SEQUENCE_ADD(&(*sib1_MBMS)->schedulingInfoList_MBMS_r14.list, schedulingInfo); + asn1cSeqAdd(&schedulingInfo->sib_MappingInfo_r14.list, sib_type); + asn1cSeqAdd(&(*sib1_MBMS)->schedulingInfoList_MBMS_r14.list, schedulingInfo); (*sib1_MBMS)->si_WindowLength_r14=LTE_SystemInformationBlockType1_MBMS_r14__si_WindowLength_r14_ms20; (*sib1_MBMS)->systemInfoValueTag_r14=0; // (*sib1).nonCriticalExtension = calloc(1,sizeof(*(*sib1).nonCriticalExtension)); @@ -553,7 +553,7 @@ uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier, MBSFN_Area1->ext1->subcarrierSpacingMBMS_r14 = CALLOC(1,sizeof(*( MBSFN_Area1->ext1)->subcarrierSpacingMBMS_r14)); memset(MBSFN_Area1->ext1->subcarrierSpacingMBMS_r14,0,sizeof(*((MBSFN_Area1)->ext1)->subcarrierSpacingMBMS_r14)); *(MBSFN_Area1->ext1->subcarrierSpacingMBMS_r14) = LTE_MBSFN_AreaInfo_r9__ext1__subcarrierSpacingMBMS_r14_khz_1dot25; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1); + asn1cSeqAdd(&MBSFNArea_list->list,MBSFN_Area1); } //nonMBSFN_SubframeConfig_r14 optional @@ -875,9 +875,9 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, *dummy_mcc_0 = (configuration->mcc[i] / 100) % 10; *dummy_mcc_1 = (configuration->mcc[i] / 10) % 10; *dummy_mcc_2 = (configuration->mcc[i] / 1) % 10; - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_0); - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_1); - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_2); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_0); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_1); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mcc->list, dummy_mcc_2); PLMN_identity_info[i].plmn_Identity.mnc.list.size=0; PLMN_identity_info[i].plmn_Identity.mnc.list.count=0; dummy_mnc_0 = CALLOC(1, sizeof(LTE_MCC_MNC_Digit_t)); @@ -903,18 +903,18 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, *dummy_mnc_2 = (configuration->mnc[i] / 1) % 10; } } - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_0); - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_1); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_0); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_1); if (*dummy_mnc_2 != 0xf) { - ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_2); + asn1cSeqAdd(&PLMN_identity_info[i].plmn_Identity.mnc.list, dummy_mnc_2); } else { free(dummy_mnc_2); } //assign_enum(&PLMN_identity_info.cellReservedForOperatorUse,PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved); PLMN_identity_info[i].cellReservedForOperatorUse=LTE_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved; - ASN_SEQUENCE_ADD(&(*sib1)->cellAccessRelatedInfo.plmn_IdentityList.list,&PLMN_identity_info[i]); + asn1cSeqAdd(&(*sib1)->cellAccessRelatedInfo.plmn_IdentityList.list,&PLMN_identity_info[i]); } // 16 bits @@ -947,14 +947,14 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, } // This is for SIB2/3 sib_type=LTE_SIB_Type_sibType3; - ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type); - ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo); + asn1cSeqAdd(&schedulingInfo.sib_MappingInfo.list,&sib_type); + asn1cSeqAdd(&(*sib1)->schedulingInfoList.list,&schedulingInfo); if(configuration->eMBMS_M2_configured){ sib_type2=LTE_SIB_Type_sibType13_v920; - ASN_SEQUENCE_ADD(&schedulingInfo2.sib_MappingInfo.list,&sib_type2); - ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo2); + asn1cSeqAdd(&schedulingInfo2.sib_MappingInfo.list,&sib_type2); + asn1cSeqAdd(&(*sib1)->schedulingInfoList.list,&schedulingInfo2); } - // ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,NULL); + // asn1cSeqAdd(&schedulingInfo.sib_MappingInfo.list,NULL); if (configuration->frame_type[CC_id] == TDD) { @@ -1042,7 +1042,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, schedulinginfo_br_13->si_Narrowband_r13 = configuration->si_Narrowband_r13[CC_id][index]; schedulinginfo_br_13->si_TBS_r13 = configuration->si_TBS_r13[CC_id][index]; LOG_I(RRC,"Adding (%d,%d) to scheduling_info_br_13\n",(int)schedulinginfo_br_13->si_Narrowband_r13,(int)schedulinginfo_br_13->si_TBS_r13); - ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->schedulingInfoList_BR_r13->list, schedulinginfo_br_13); + asn1cSeqAdd(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->schedulingInfoList_BR_r13->list, schedulinginfo_br_13); } if (configuration->fdd_DownlinkOrTddSubframeBitmapBR_r13[CC_id]) { @@ -1116,7 +1116,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, *systemInfoValueTagSi_r13 = 0; } - ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, systemInfoValueTagSi_r13); + asn1cSeqAdd(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, systemInfoValueTagSi_r13); } } else { sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13 = NULL; @@ -1357,7 +1357,7 @@ uint8_t do_SIB23(uint8_t Mod_id, rach_ce_levelinfo_r13->rar_HoppingConfig_r13 = LTE_RACH_CE_LevelInfo_r13__rar_HoppingConfig_r13_off; } - ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->rach_CE_LevelInfoList_r13->list, rach_ce_levelinfo_r13); + asn1cSeqAdd(&(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->rach_CE_LevelInfoList_r13->list, rach_ce_levelinfo_r13); } } @@ -1578,7 +1578,7 @@ uint8_t do_SIB23(uint8_t Mod_id, if (configuration->rsrp_range_list_size[CC_id]) *rsrp_range = configuration->rsrp_range[CC_id][rsrp_index]; else *rsrp_range = 60; - ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->rsrp_ThresholdsPrachInfoList_r13.list, rsrp_range); + asn1cSeqAdd(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->rsrp_ThresholdsPrachInfoList_r13.list, rsrp_range); } (*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->mpdcch_startSF_CSS_RA_r13 = NULL; @@ -1634,12 +1634,12 @@ uint8_t do_SIB23(uint8_t Mod_id, for (narrow_band_index = 0; narrow_band_index < num_narrow_bands; narrow_band_index++) { maxavailablenarrowband = CALLOC(1, sizeof(long)); *maxavailablenarrowband = configuration->max_available_narrow_band[CC_id][prach_parameters_index][narrow_band_index]; - ASN_SEQUENCE_ADD(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, maxavailablenarrowband); + asn1cSeqAdd(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, maxavailablenarrowband); } prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1; prach_parametersce_r13->prach_HoppingConfig_r13 = LTE_PRACH_ParametersCE_r13__prach_HoppingConfig_r13_off; - ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->prach_ParametersListCE_r13.list, prach_parametersce_r13); + asn1cSeqAdd(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->prach_ParametersListCE_r13.list, prach_parametersce_r13); } } else (*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310 = NULL; @@ -1656,7 +1656,7 @@ uint8_t do_SIB23(uint8_t Mod_id, if (configuration->pucch_info_value_size[CC_id]) *pucch_info_value = configuration->pucch_info_value[CC_id][pucch_index]; else *pucch_info_value = 0; - ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13->list, pucch_info_value); + asn1cSeqAdd(&(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13->list, pucch_info_value); } if (configuration->pucch_NumRepetitionCE_Msg4_Level0_r13[CC_id]) { @@ -1714,7 +1714,7 @@ uint8_t do_SIB23(uint8_t Mod_id, sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1; sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2; sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2; - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); + asn1cSeqAdd(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); if (configuration->eMBMS_configured == 4 ) { LOG_I(RRC,"Adding MBSFN subframe Configuration 2 to SIB2\n"); @@ -1728,7 +1728,7 @@ uint8_t do_SIB23(uint8_t Mod_id, sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.size= 1; sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.bits_unused= 2; sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2; - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig2); + asn1cSeqAdd(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig2); } } @@ -1788,7 +1788,7 @@ uint8_t do_SIB23(uint8_t Mod_id, MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x20<<2; // FDD: SF1 MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2; MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1); + asn1cSeqAdd(&MBSFNArea_list->list,MBSFN_Area1); //MBSFN Area 2: currently only activated for eMBMS relaying if (configuration->eMBMS_configured == 4 ) { @@ -1805,7 +1805,7 @@ uint8_t do_SIB23(uint8_t Mod_id, MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2; MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6 MBSFN_Area2->mcch_Config_r9.signallingMCS_r9= LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area2); + asn1cSeqAdd(&MBSFNArea_list->list,MBSFN_Area2); } // end of adding for MBMS SIB13 @@ -1908,7 +1908,7 @@ uint8_t do_SIB23(uint8_t Mod_id, SL_CommResourcePool->ext1 = NULL ; //end SL_CommResourcePool //add SL_CommResourcePool to SL_CommRxPoolList - ASN_SEQUENCE_ADD(&SL_CommRxPoolList->list,SL_CommResourcePool); + asn1cSeqAdd(&SL_CommRxPoolList->list,SL_CommResourcePool); //end commRxPool_r12 //TODO: commTxPoolNormalCommon_r12, similar to commRxPool_r12 //TODO: commTxPoolExceptional_r12 @@ -1981,7 +1981,7 @@ uint8_t do_SIB23(uint8_t Mod_id, } //add SL_DiscResourcePool to SL_DiscRxPoolList - ASN_SEQUENCE_ADD(&SL_DiscRxPoolList->list,SL_DiscResourcePool); + asn1cSeqAdd(&SL_DiscRxPoolList->list,SL_DiscResourcePool); /* //for DiscRxPoolPS (*sib19)->ext1 = CALLOC (1, sizeof(*(*sib19)->ext1)); @@ -2048,7 +2048,7 @@ uint8_t do_SIB23(uint8_t Mod_id, } //add SL_DiscResourcePool to SL_DiscRxPoolList - ASN_SEQUENCE_ADD(&SL_DiscRxPoolPSList->list,SL_DiscResourcePoolPS); + asn1cSeqAdd(&SL_DiscRxPoolPSList->list,SL_DiscResourcePoolPS); */ (*sib19)->lateNonCriticalExtension = NULL; //end SIB19 @@ -2084,7 +2084,7 @@ uint8_t do_SIB23(uint8_t Mod_id, SL_CommResourcePoolV2X->rxParametersNCell_r14->tdd_Config_r14->subframeAssignment = 0 ; SL_CommResourcePoolV2X->rxParametersNCell_r14->tdd_Config_r14->specialSubframePatterns = 0; SL_CommResourcePoolV2X->rxParametersNCell_r14->syncConfigIndex_r14 = 0; - ASN_SEQUENCE_ADD(&SL_CommRxPoolListV2X->list,SL_CommResourcePoolV2X); + asn1cSeqAdd(&SL_CommRxPoolListV2X->list,SL_CommResourcePoolV2X); //end SIB21 } @@ -2097,13 +2097,13 @@ uint8_t do_SIB23(uint8_t Mod_id, bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count=0; // asn_set_empty(&systemInformation->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list);//.size=0; // systemInformation->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count=0; - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib2_part); - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib3_part); if (configuration->eMBMS_configured > 0) { - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); } if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { @@ -2510,7 +2510,7 @@ do_RRCConnectionSetup( logicalchannelgroup = CALLOC(1,sizeof(long)); *logicalchannelgroup=0; SRB1_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; - ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config); + asn1cSeqAdd(&(*SRB_configList)->list,SRB1_config); // PhysicalConfigDedicated physicalConfigDedicated2 = CALLOC(1,sizeof(*physicalConfigDedicated2)); *physicalConfigDedicated = physicalConfigDedicated2; @@ -2876,7 +2876,7 @@ uint8_t do_RRCConnectionSetup_BR( logicalchannelgroup = CALLOC(1,sizeof(long)); *logicalchannelgroup=0; SRB1_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; - ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config); + asn1cSeqAdd(&(*SRB_configList)->list,SRB1_config); // PhysicalConfigDedicated physicalConfigDedicated2 = CALLOC(1,sizeof(*physicalConfigDedicated2)); *physicalConfigDedicated = physicalConfigDedicated2; @@ -3105,7 +3105,7 @@ uint8_t do_RRCConnectionSetup_BR( epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.fdd_r13 = LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_StartSF_UESS_r13__fdd_r13_v1; epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_NumRepetition_r13 = LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_NumRepetition_r13_r1; epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 = 3; // note: this is narrowband index 2 - ASN_SEQUENCE_ADD(physicalConfigDedicated2->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11, epdcch_setconfig_r11); + asn1cSeqAdd(physicalConfigDedicated2->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11, epdcch_setconfig_r11); // FIXME allocate physicalConfigDedicated2->ext7 physicalConfigDedicated2->ext7 = CALLOC(1, sizeof(struct LTE_PhysicalConfigDedicated__ext7)); physicalConfigDedicated2->ext7->pdsch_ConfigDedicated_v1310 = NULL; // has some parameters to be filled @@ -3245,7 +3245,7 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.present = LTE_UECapabilityEnquiry__criticalExtensions__c1_PR_ueCapabilityEnquiry_r8; dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count=0; - ASN_SEQUENCE_ADD(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list, + asn1cSeqAdd(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list, &rat); /* request NR configuration */ @@ -3276,7 +3276,7 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, nsa_band->present = NR_FreqBandInformation_PR_bandInformationEUTRA; nsa_band->choice.bandInformationEUTRA = (NR_FreqBandInformationEUTRA_t *) calloc(1, sizeof(NR_FreqBandInformationEUTRA_t)); nsa_band->choice.bandInformationEUTRA->bandEUTRA = eutra_band; - ASN_SEQUENCE_ADD(&nsa_band_list->list, nsa_band); + asn1cSeqAdd(&nsa_band_list->list, nsa_band); nsa_band = (NR_FreqBandInformation_t *) calloc(1,sizeof(NR_FreqBandInformation_t)); nsa_band->present = NR_FreqBandInformation_PR_bandInformationNR; @@ -3285,7 +3285,7 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, nsa_band->choice.bandInformationNR->bandNR = nr_band; else nsa_band->choice.bandInformationNR->bandNR = 78; - ASN_SEQUENCE_ADD(&nsa_band_list->list, nsa_band); + asn1cSeqAdd(&nsa_band_list->list, nsa_band); OCTET_STRING_t req_freq; //unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x02, 0x68 }; // bands 7 & nr78 @@ -3361,9 +3361,9 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.present = LTE_UECapabilityEnquiry__criticalExtensions__c1_PR_ueCapabilityEnquiry_r8; dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count=0; - ASN_SEQUENCE_ADD(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list, + asn1cSeqAdd(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list, &rat_nr); - ASN_SEQUENCE_ADD(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list, + asn1cSeqAdd(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list, &rat_eutra_nr); /* request NR configuration */ @@ -3394,7 +3394,7 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, nsa_band->present = NR_FreqBandInformation_PR_bandInformationEUTRA; nsa_band->choice.bandInformationEUTRA = (NR_FreqBandInformationEUTRA_t *) calloc(1, sizeof(NR_FreqBandInformationEUTRA_t)); nsa_band->choice.bandInformationEUTRA->bandEUTRA = eutra_band; - ASN_SEQUENCE_ADD(&nsa_band_list->list, nsa_band); + asn1cSeqAdd(&nsa_band_list->list, nsa_band); nsa_band = (NR_FreqBandInformation_t *) calloc(1,sizeof(NR_FreqBandInformation_t)); nsa_band->present = NR_FreqBandInformation_PR_bandInformationNR; @@ -3403,7 +3403,7 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, nsa_band->choice.bandInformationNR->bandNR = nr_band; else nsa_band->choice.bandInformationNR->bandNR = 78; - ASN_SEQUENCE_ADD(&nsa_band_list->list, nsa_band); + asn1cSeqAdd(&nsa_band_list->list, nsa_band); OCTET_STRING_t req_freq; //unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x02, 0x68 }; // bands 7 & nr78 @@ -3843,7 +3843,7 @@ do_RRCConnectionReestablishment( if (SRB2_config == NULL) { LOG_W(RRC,"SRB2 configuration does not exist in SRB configuration list\n"); } else { - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); } if (*SRB_configList) { @@ -3851,7 +3851,7 @@ do_RRCConnectionReestablishment( } *SRB_configList = CALLOC(1, sizeof(LTE_SRB_ToAddModList_t)); - ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config); + asn1cSeqAdd(&(*SRB_configList)->list,SRB1_config); physicalConfigDedicated2 = *physicalConfigDedicated; rrcConnectionReestablishment->rrc_TransactionIdentifier = Transaction_id; rrcConnectionReestablishment->criticalExtensions.present = LTE_RRCConnectionReestablishment__criticalExtensions_PR_c1; @@ -4070,7 +4070,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id, break; } - ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1); + asn1cSeqAdd(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1); // commonSF-AllocPeriod-r9 (*mbsfnAreaConfiguration)->commonSF_AllocPeriod_r9= LTE_MBSFNAreaConfiguration_r9__commonSF_AllocPeriod_r9_rf16; // PMCHs Information List (PMCH-InfoList-r9) @@ -4102,7 +4102,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id, mbms_Session_1->sessionId_r9->buf[0]= MTCH; // Logical Channel ID mbms_Session_1->logicalChannelIdentity_r9= MTCH; - ASN_SEQUENCE_ADD(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_1); + asn1cSeqAdd(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_1); /* // Session 2 //mbms_Session_2 = CALLOC(1,sizeof(MBMS_SessionInfo_r9_t)); memset(mbms_Session_2,0,sizeof(MBMS_SessionInfo_r9_t)); @@ -4118,9 +4118,9 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id, mbms_Session_2->sessionID_r9->buf[0]= 0x11; // Logical Channel ID mbms_Session_2->logicalChannelIdentity_r9= 2; - ASN_SEQUENCE_ADD(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_2); + asn1cSeqAdd(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_2); */ - ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->pmch_InfoList_r9.list,pmch_Info_1); + asn1cSeqAdd(&(*mbsfnAreaConfiguration)->pmch_InfoList_r9.list,pmch_Info_1); if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout,&asn_DEF_LTE_MCCH_Message,(void *)mcch_message); @@ -4181,17 +4181,17 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size asn_set_empty(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list);//.size=0; LTE_MCC_MNC_Digit_t dummy; dummy=2; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); + asn1cSeqAdd(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); dummy=6; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); + asn1cSeqAdd(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); dummy=2; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); + asn1cSeqAdd(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list.size=0; measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list.count=0; dummy=8; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list,&dummy); + asn1cSeqAdd(&measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list,&dummy); dummy=0; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list,&dummy); + asn1cSeqAdd(&measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list,&dummy); measresult_cgi2->cellGlobalId.cellIdentity.buf=MALLOC(8); measresult_cgi2->cellGlobalId.cellIdentity.buf[0]=0x01; measresult_cgi2->cellGlobalId.cellIdentity.buf[1]=0x48; @@ -4212,7 +4212,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size meas2.rsrqResult=&(rsrq_t); meas2.ext1 = NULL; measresulteutra2->measResult=meas2; - ASN_SEQUENCE_ADD(&measResultListEUTRA2->list,measresulteutra2); + asn1cSeqAdd(&measResultListEUTRA2->list,measresulteutra2); measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2); if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { @@ -4237,15 +4237,6 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size measResultListEUTRA2 = NULL; return((enc_rval.encoded+7)/8); } - -#define asn1cCallocOne(VaR, VaLue) \ - VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue; -#define asn1cCalloc(VaR, lOcPtr) \ - typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR)); -#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \ - TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \ - ASN_SEQUENCE_ADD(&VaR,lOcPtr); - ssize_t do_nrMeasurementReport(uint8_t *buffer, size_t bufsize, LTE_MeasId_t measid, @@ -4353,7 +4344,7 @@ uint8_t do_Paging(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size, for (j = 0; j< ue_paging_identity.choice.imsi.length; j++) { /* IMSI size */ imsi_digit[j] = (LTE_IMSI_Digit_t)ue_paging_identity.choice.imsi.buffer[j]; - ASN_SEQUENCE_ADD(&paging_record_p->ue_Identity.choice.imsi.list, &imsi_digit[j]); + asn1cSeqAdd(&paging_record_p->ue_Identity.choice.imsi.list, &imsi_digit[j]); } } @@ -4365,7 +4356,7 @@ uint8_t do_Paging(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size, } /* add to list */ - ASN_SEQUENCE_ADD(&pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list, paging_record_p); + asn1cSeqAdd(&pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list, paging_record_p); LOG_D(RRC, "[eNB %d] do_Paging paging_record: cn_Domain %ld, ue_paging_identity.presenceMask %d, PagingRecordList.count %d\n", Mod_id, paging_record_p->cn_Domain, ue_paging_identity.presenceMask, pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list.count); enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_PCCH_Message, NULL, (void *)&pcch_msg, @@ -4425,7 +4416,7 @@ int do_HandoverPreparation(char *ho_buf, int ho_size, LTE_UE_EUTRA_Capability_t AssertFatal (OCTET_STRING_fromBuf( &ue_cap_rat_container->ueCapabilityRAT_Container, rrc_buf, rrc_size) != -1, "fatal: OCTET_STRING_fromBuf failed\n"); - ASN_SEQUENCE_ADD(&ho_info->ue_RadioAccessCapabilityInfo.list, ue_cap_rat_container); + asn1cSeqAdd(&ho_info->ue_RadioAccessCapabilityInfo.list, ue_cap_rat_container); } enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_HandoverPreparationInformation, NULL, @@ -4614,9 +4605,9 @@ void allocate_en_DC_r15(LTE_UE_EUTRA_Capability_t *cap) OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname, bool received_nr_msg) { static OAI_UECapability_t UECapability; /* TODO declared static to allow returning this has an address should be allocated in a cleaner way. */ - static LTE_SupportedBandEUTRA_t Bandlist[4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it - static LTE_InterFreqBandInfo_t InterFreqBandInfo[4][4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it - static LTE_BandInfoEUTRA_t BandInfoEUTRA[4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it + static LTE_SupportedBandEUTRA_t Bandlist[4]; // the macro asn1cSeqAdd() does not copy the source, but only stores a reference to it + static LTE_InterFreqBandInfo_t InterFreqBandInfo[4][4]; // the macro asn1cSeqAdd() does not copy the source, but only stores a reference to it + static LTE_BandInfoEUTRA_t BandInfoEUTRA[4]; // the macro asn1cSeqAdd() does not copy the source, but only stores a reference to it asn_enc_rval_t enc_rval; asn_dec_rval_t dec_rval; long maxNumberROHC_ContextSessions = LTE_PDCP_Parameters__maxNumberROHC_ContextSessions_cs16; @@ -4670,30 +4661,30 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname, bool UE_EUTRA_Capability->phyLayerParameters.ue_TxAntennaSelectionSupported = 0; UE_EUTRA_Capability->phyLayerParameters.ue_SpecificRefSigsSupported = 0; UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count = 0; - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[3]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[3]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][3]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][3]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][3]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][3]); + asn1cSeqAdd(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[0]); + asn1cSeqAdd(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[1]); + asn1cSeqAdd(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[2]); + asn1cSeqAdd(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void *)&Bandlist[3]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[0]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[1]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[2]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void *)&BandInfoEUTRA[3]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][0]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][1]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][2]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void *)&InterFreqBandInfo[0][3]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][0]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][1]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][2]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void *)&InterFreqBandInfo[1][3]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][0]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][1]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][2]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void *)&InterFreqBandInfo[2][3]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][0]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][1]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][2]); + asn1cSeqAdd(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void *)&InterFreqBandInfo[3][3]); // UE_EUTRA_Capability->measParameters.bandListEUTRA.list.count = 0; // no measurements on other bands // UE_EUTRA_Capability->featureGroupIndicators // null diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.h b/openair2/RRC/LTE/MESSAGES/asn1_msg.h index 8373bb53f3..3d5a8bb68c 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.h @@ -40,7 +40,6 @@ #include /* for errno */ #include -#include /* for _ASN_DEFAULT_STACK_MAX */ #include "RRC/LTE/rrc_defs.h" #include "LTE_SL-DestinationInfoList-r12.h" @@ -56,14 +55,6 @@ */ int xer_sprint(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr); -#define asn1cCallocOne(VaR, VaLue) \ - VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue; -#define asn1cCalloc(VaR, lOcPtr) \ - typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR)); -#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \ - TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \ - ASN_SEQUENCE_ADD(&VaR,lOcPtr); - uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index); uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId); diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c index 1f6a578a8a..f9df7f3581 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c @@ -35,8 +35,8 @@ #include /* for EX_* exit codes */ #include /* for errno */ #include "common/utils/LOG/log.h" +#include "oai_asn1.h" #include -#include /* for _ASN_DEFAULT_STACK_MAX */ #include #include "asn1_msg.h" @@ -180,9 +180,9 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, dummy_mcc[0] = (configuration->mcc / 100) % 10; dummy_mcc[1] = (configuration->mcc / 10) % 10; dummy_mcc[2] = (configuration->mcc / 1) % 10; - ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[0]); - ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[1]); - ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[2]); + asn1cSeqAdd(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[0]); + asn1cSeqAdd(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[1]); + asn1cSeqAdd(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[2]); PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list.size=0; PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list.count=0; @@ -202,18 +202,18 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, } } - ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[0]); - ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[1]); + asn1cSeqAdd(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[0]); + asn1cSeqAdd(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[1]); if (dummy_mnc[2] != 0xf) { - ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[2]); + asn1cSeqAdd(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[2]); } //still set to "notReserved" as in the previous case PLMN_identity_info_NB_IoT.cellReservedForOperatorUse_r13=LTE_PLMN_IdentityInfo_NB_r13__cellReservedForOperatorUse_r13_notReserved; *attachWithoutPDN_Connectivity = 0; PLMN_identity_info_NB_IoT.attachWithoutPDN_Connectivity_r13 = attachWithoutPDN_Connectivity; - ASN_SEQUENCE_ADD(&(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.plmn_IdentityList_r13.list,&PLMN_identity_info_NB_IoT); + asn1cSeqAdd(&(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.plmn_IdentityList_r13.list,&PLMN_identity_info_NB_IoT); // 16 bits = 2 byte (*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.buf = MALLOC(2); //MALLOC works in byte //lefts as it is? @@ -274,8 +274,8 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, * listed in the schedulingInfoList list. * */ sib_type_NB_IoT[0]=LTE_SIB_Type_NB_r13_sibType3_NB_r13; - ASN_SEQUENCE_ADD(&schedulingInfo_NB_IoT[0].sib_MappingInfo_r13.list,&sib_type_NB_IoT[0]); - ASN_SEQUENCE_ADD(&(*sib1_NB_IoT)->schedulingInfoList_r13.list,&schedulingInfo_NB_IoT[0]); + asn1cSeqAdd(&schedulingInfo_NB_IoT[0].sib_MappingInfo_r13.list,&sib_type_NB_IoT[0]); + asn1cSeqAdd(&(*sib1_NB_IoT)->schedulingInfoList_r13.list,&schedulingInfo_NB_IoT[0]); //printf("[ASN Debug] SI P: %ld\n",(*sib1_NB_IoT)->schedulingInfoList_r13.list.array[0]->si_Periodicity_r13); if (configuration->frame_type == TDD) @@ -295,7 +295,7 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, //FIXME correct? (*sib1_NB_IoT)->systemInfoValueTagList_r13 = CALLOC(1, sizeof(struct LTE_SystemInfoValueTagList_NB_r13)); asn_set_empty(&(*sib1_NB_IoT)->systemInfoValueTagList_r13->list); - ASN_SEQUENCE_ADD(&(*sib1_NB_IoT)->systemInfoValueTagList_r13->list,&systemInfoValueTagSI); + asn1cSeqAdd(&(*sib1_NB_IoT)->systemInfoValueTagList_r13->list,&systemInfoValueTagSI); if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message_NB, (void *)bcch_message); @@ -391,7 +391,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id, rach_Info_NB_IoT.ra_ResponseWindowSize_r13 = configuration->rach_raResponseWindowSize_NB; rach_Info_NB_IoT.mac_ContentionResolutionTimer_r13 = configuration-> rach_macContentionResolutionTimer_NB; //rach_infoList max size = maxNPRACH-Resources-NB-r13 = 3 - ASN_SEQUENCE_ADD(&sib2_NB_IoT->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.rach_InfoList_r13.list,&rach_Info_NB_IoT); + asn1cSeqAdd(&sib2_NB_IoT->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.rach_InfoList_r13.list,&rach_Info_NB_IoT); //TS 36.331 pag 614 --> if not present the value to infinity sould be used *connEstFailOffset = 0; sib2_NB_IoT->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.connEstFailOffset_r13 = connEstFailOffset; /*OPTIONAL*/ @@ -410,7 +410,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id, // =CALLOC(1, sizeof(struct RSRP_ThresholdsNPRACH_InfoList_NB_r13)); //fatto uguale dopo // rsrp_ThresholdsPrachInfoList = sib2_NB_IoT->radioResourceConfigCommon_r13.nprach_Config_r13.rsrp_ThresholdsPrachInfoList_r13; // rsrp_range = configuration->nprach_rsrp_range_NB; - // ASN_SEQUENCE_ADD(&rsrp_ThresholdsPrachInfoList->list,rsrp_range); + // asn1cSeqAdd(&rsrp_ThresholdsPrachInfoList->list,rsrp_range); // According configuration to set the 3 CE level configuration setting nprach_parameters[0].nprach_Periodicity_r13 = configuration->nprach_Periodicity[0]; nprach_parameters[0].nprach_StartTime_r13 = configuration->nprach_StartTime[0]; @@ -443,15 +443,15 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id, nprach_parameters[2].npdcch_StartSF_CSS_RA_r13 = configuration->npdcch_StartSF_CSS_RA[2]; nprach_parameters[2].npdcch_Offset_RA_r13 = configuration->npdcch_Offset_RA[2]; //nprach_parameterList have a max size of 3 possible nprach configuration (see maxNPRACH_Resources_NB_r13) - ASN_SEQUENCE_ADD(&sib2_NB_IoT->radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list,&nprach_parameters[0]); - ASN_SEQUENCE_ADD(&sib2_NB_IoT->radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list,&nprach_parameters[1]); - ASN_SEQUENCE_ADD(&sib2_NB_IoT->radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list,&nprach_parameters[2]); + asn1cSeqAdd(&sib2_NB_IoT->radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list,&nprach_parameters[0]); + asn1cSeqAdd(&sib2_NB_IoT->radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list,&nprach_parameters[1]); + asn1cSeqAdd(&sib2_NB_IoT->radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list,&nprach_parameters[2]); // NPDSCH-Config NB-IOT sib2_NB_IoT->radioResourceConfigCommon_r13.npdsch_ConfigCommon_r13.nrs_Power_r13= configuration->npdsch_nrs_Power; //NPUSCH-Config NB-IoT---------------------------------------------------------------- //list of size 3 (see maxNPRACH_Resources_NB_r13) ack_nack_repetition = configuration-> npusch_ack_nack_numRepetitions_NB; //is an enumerative - ASN_SEQUENCE_ADD(&(sib2_NB_IoT->radioResourceConfigCommon_r13.npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list) ,&ack_nack_repetition); + asn1cSeqAdd(&(sib2_NB_IoT->radioResourceConfigCommon_r13.npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list) ,&ack_nack_repetition); *srs_SubframeConfig = configuration->npusch_srs_SubframeConfig_NB; sib2_NB_IoT->radioResourceConfigCommon_r13.npusch_ConfigCommon_r13.srs_SubframeConfig_r13= srs_SubframeConfig; /*OPTIONAL*/ /*OPTIONAL*/ @@ -515,9 +515,9 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id, bcch_message->message.choice.c1.present = LTE_BCCH_DL_SCH_MessageType_NB__c1_PR_systemInformation_r13; bcch_message->message.choice.c1.choice.systemInformation_r13.criticalExtensions.present = LTE_SystemInformation_NB__criticalExtensions_PR_systemInformation_r13; bcch_message->message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.list.count=0; - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.list, + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.list, sib2_NB_part); - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.list, + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.list, sib3_NB_part); if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { @@ -624,7 +624,7 @@ uint8_t do_RRCConnectionSetup_NB_IoT( // SRB1_lchan_config_NB->choice.explicitValue.logicalChannelSR_Prohibit_r13 = logicalChannelSR_Prohibit; // // //ADD SRB1 - // ASN_SEQUENCE_ADD(&(*SRB_configList_NB_IoT)->list,SRB1_config_NB); + // asn1cSeqAdd(&(*SRB_configList_NB_IoT)->list,SRB1_config_NB); } ///SRB1bis (The configuration for SRB1 and SRB1bis is the same) the only difference is the logical channel identity = 3 but not set here SRB1bis_config_NB_IoT = CALLOC(1,sizeof(*SRB1bis_config_NB_IoT)); @@ -649,7 +649,7 @@ uint8_t do_RRCConnectionSetup_NB_IoT( //ADD SRB1bis //MP: Actually there is no way to distinguish SRB1 and SRB1bis once put in the list //MP: SRB_ToAddModList_NB_r13_t size = 1 - ASN_SEQUENCE_ADD(&(*SRB_configList_NB_IoT)->list,SRB1bis_config_NB_IoT); + asn1cSeqAdd(&(*SRB_configList_NB_IoT)->list,SRB1bis_config_NB_IoT); // PhysicalConfigDedicated (NPDCCH, NPUSCH, CarrierConfig, UplinkPowerControl) physicalConfigDedicated2_NB_IoT = CALLOC(1,sizeof(*physicalConfigDedicated2_NB_IoT)); *physicalConfigDedicated_NB_IoT = physicalConfigDedicated2_NB_IoT; diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index cd7e524bf9..3bb86d93b5 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -36,7 +36,7 @@ #include "assertions.h" #include "hashtable.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "rrc_defs.h" #include "rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" @@ -373,7 +373,7 @@ void init_SL_preconfig(UE_RRC_INST *UE, const uint8_t eNB_index ) { preconfigpool->dataHoppingConfig_r12.numSubbands_r12 = LTE_SL_HoppingConfigComm_r12__numSubbands_r12_ns1; preconfigpool->dataHoppingConfig_r12.rb_Offset_r12 = 0; preconfigpool->dataTxParameters_r12 = 0; - ASN_SEQUENCE_ADD(&UE->SL_Preconfiguration[eNB_index]->preconfigComm_r12.list,preconfigpool); + asn1cSeqAdd(&UE->SL_Preconfiguration[eNB_index]->preconfigComm_r12.list,preconfigpool); // Rel13 extensions UE->SL_Preconfiguration[eNB_index]->ext1 = NULL; } @@ -1656,7 +1656,7 @@ rrc_ue_process_MBMSCountingRequest( MBMSCountingResponse_r10_IEs->mbsfn_AreaIndex_r10 = calloc(1,sizeof(long)); // MBMSCountingResponse_r10_IEs->countingResponseList_r10 = calloc(1,sizeof(struct LTE_CountingResponseList_r10)); // -// ASN_SEQUENCE_ADD( +// asn1cSeqAdd( // &MBMSCountingResponse->criticalExtensions.choice.c1.choice.countingResponse_r10.countingResponseList_r10.list, // &CountingResponse); // @@ -1743,7 +1743,7 @@ rrc_ue_process_nrueCapabilityEnquiry( for (int i = 0; i < count; i++) { enc_rval.encoded = 0; if (*cap_req->list.array[i] == LTE_RAT_Type_nr) { - ASN_SEQUENCE_ADD(&ue_cap->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, + asn1cSeqAdd(&ue_cap->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, &ue_CapabilityRAT_Container); ue_cap->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.array[i]->rat_Type = LTE_RAT_Type_nr; asn_enc_rval_t enc_rval_nr = uper_encode_to_buffer(&asn_DEF_LTE_UL_DCCH_Message, NULL, (void *) &ul_dcch_msg, buffer, sizeof(buffer)); @@ -1755,7 +1755,7 @@ rrc_ue_process_nrueCapabilityEnquiry( __FUNCTION__, enc_rval.encoded, (enc_rval.encoded+7)/8); } else if (*cap_req->list.array[i] == LTE_RAT_Type_eutra_nr) { - ASN_SEQUENCE_ADD(&ue_cap->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, + asn1cSeqAdd(&ue_cap->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, &ue_CapabilityRAT_Container_mrdc); ue_cap->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.array[i]->rat_Type = LTE_RAT_Type_eutra_nr; asn_enc_rval_t enc_rval_eutra_nr = uper_encode_to_buffer(&asn_DEF_LTE_UL_DCCH_Message, NULL, (void *) &ul_dcch_msg, buffer, sizeof(buffer)); @@ -1825,7 +1825,7 @@ rrc_ue_process_ueCapabilityEnquiry( for (i=0; icriticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count; i++) { if (*UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.array[i] == LTE_RAT_Type_eutra) { - ASN_SEQUENCE_ADD( + asn1cSeqAdd( &ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, &ue_CapabilityRAT_Container); enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UL_DCCH_Message, NULL, (void *) &ul_dcch_msg, buffer, 100); @@ -1849,7 +1849,7 @@ rrc_ue_process_ueCapabilityEnquiry( } else if (*UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.array[i] == LTE_RAT_Type_nr) { - ASN_SEQUENCE_ADD( + asn1cSeqAdd( &ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, &ue_CapabilityRAT_Container); enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UL_DCCH_Message, NULL, (void *) &ul_dcch_msg, buffer, 100); @@ -2108,7 +2108,7 @@ rrc_ue_process_mobilityControlInfo( lcid= CALLOC (1, sizeof (DRB_Identity_t)); // long for (*lcid=0;*lcidlist,lcid); + asn1cSeqAdd (&(drb2release_list)->list,lcid); } */ //Removing SRB1 and SRB2 and DRB0 @@ -2419,7 +2419,7 @@ rrc_ue_decode_dcch( sl_destination_identity->buf[1] = 0x00; sl_destination_identity->buf[2] = 0x01; sl_destination_identity->bits_unused = 0; - ASN_SEQUENCE_ADD(&destinationInfoList->list,sl_destination_identity); + asn1cSeqAdd(&destinationInfoList->list,sl_destination_identity); rrc_ue_generate_SidelinkUEInformation(ctxt_pP, eNB_indexP, destinationInfoList, NULL, SL_TRANSMIT_NON_RELAY_ONE_TO_ONE); send_ue_information ++; } @@ -5813,7 +5813,7 @@ void *rrc_control_socket_thread_fct(void *arg) { *logicalchannelgroup_drb = 1; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; UE->DRB_configList = CALLOC(1,sizeof(LTE_DRB_ToAddModList_t)); - ASN_SEQUENCE_ADD(&UE->DRB_configList->list,UE->DRB_config[0][0]); + asn1cSeqAdd(&UE->DRB_configList->list,UE->DRB_config[0][0]); rrc_pdcp_config_asn1_req(&ctxt, (LTE_SRB_ToAddModList_t *) NULL, UE->DRB_configList, @@ -6018,7 +6018,7 @@ void *rrc_control_socket_thread_fct(void *arg) { *logicalchannelgroup_drb = 1; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; UE->DRB_configList = CALLOC(1,sizeof(LTE_DRB_ToAddModList_t)); - ASN_SEQUENCE_ADD(&UE->DRB_configList->list,UE->DRB_config[0][0]); + asn1cSeqAdd(&UE->DRB_configList->list,UE->DRB_config[0][0]); rrc_pdcp_config_asn1_req(&ctxt, (LTE_SRB_ToAddModList_t *) NULL, UE->DRB_configList, @@ -6172,7 +6172,7 @@ void *rrc_control_socket_thread_fct(void *arg) { *logicalchannelgroup_drb = 1; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; UE->DRB_configList = CALLOC(1,sizeof(LTE_DRB_ToAddModList_t)); - ASN_SEQUENCE_ADD(&UE->DRB_configList->list,UE->DRB_config[0][0]); + asn1cSeqAdd(&UE->DRB_configList->list,UE->DRB_config[0][0]); rrc_pdcp_config_asn1_req(&ctxt, (LTE_SRB_ToAddModList_t *) NULL, UE->DRB_configList, diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 07c90f74eb..b4f7eece01 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -29,15 +29,13 @@ */ #define RRC_ENB #define RRC_ENB_C +#include "oai_asn1.h" #include -#include /* for _ASN_DEFAULT_STACK_MAX */ #include #include "rrc_defs.h" #include "rrc_extern.h" #include "assertions.h" #include "common/ran_context.h" -#include "asn1_conversions.h" -#include "asn_internal.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "LAYER2/RLC/rlc.h" #include "LAYER2/MAC/mac_proto.h" @@ -1078,7 +1076,7 @@ int rrc_eNB_previous_SRB2(rrc_eNB_ue_context_t *ue_context_pP) { } if (SRB2_config != NULL) { - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); } else { LOG_E(RRC, "rrc_eNB_previous_SRB2 SRB2_config NULL\n"); } @@ -1427,8 +1425,8 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( if (SRB2_config != NULL) { // Add SRB2 to SRB configuration list - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); LOG_D(RRC, "Add SRB2_config (srb_Identity:%ld) to ue_context_pP->ue_context.SRB_configList\n", SRB2_config->srb_Identity); LOG_D(RRC, "Add SRB2_config (srb_Identity:%ld) to ue_context_pP->ue_context.SRB_configList2[%d]\n", @@ -1451,7 +1449,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( for (i = 0; (i < DRB_configList->list.count) && (i < 3); i++) { DRB_config = DRB_configList->list.array[i]; // Add DRB to DRB configuration list, for LTE_RRCConnectionReconfigurationComplete - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); } } @@ -1556,32 +1554,32 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( MeasId0->measId = 1; MeasId0->measObjectId = 1; MeasId0->reportConfigId = 1; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId0); + asn1cSeqAdd(&MeasId_list->list, MeasId0); MeasId1 = CALLOC(1, sizeof(*MeasId1)); MeasId1->measId = 2; MeasId1->measObjectId = 1; MeasId1->reportConfigId = 2; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId1); + asn1cSeqAdd(&MeasId_list->list, MeasId1); MeasId2 = CALLOC(1, sizeof(*MeasId2)); MeasId2->measId = 3; MeasId2->measObjectId = 1; MeasId2->reportConfigId = 3; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId2); + asn1cSeqAdd(&MeasId_list->list, MeasId2); MeasId3 = CALLOC(1, sizeof(*MeasId3)); MeasId3->measId = 4; MeasId3->measObjectId = 1; MeasId3->reportConfigId = 4; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId3); + asn1cSeqAdd(&MeasId_list->list, MeasId3); MeasId4 = CALLOC(1, sizeof(*MeasId4)); MeasId4->measId = 5; MeasId4->measObjectId = 1; MeasId4->reportConfigId = 5; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId4); + asn1cSeqAdd(&MeasId_list->list, MeasId4); MeasId5 = CALLOC(1, sizeof(*MeasId5)); MeasId5->measId = 6; MeasId5->measObjectId = 1; MeasId5->reportConfigId = 6; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId5); + asn1cSeqAdd(&MeasId_list->list, MeasId5); // LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measIdToAddModList = MeasId_list; // Add one EUTRA Measurement Object MeasObj_list = CALLOC(1, sizeof(*MeasObj_list)); @@ -1610,10 +1608,10 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( CellToAdd->cellIndex = i + 1; CellToAdd->physCellId = get_adjacent_cell_id(ctxt_pP->module_id, i); CellToAdd->cellIndividualOffset = LTE_Q_OffsetRange_dB0; - ASN_SEQUENCE_ADD(&CellsToAddModList->list, CellToAdd); + asn1cSeqAdd(&CellsToAddModList->list, CellToAdd); } - ASN_SEQUENCE_ADD(&MeasObj_list->list, MeasObj); + asn1cSeqAdd(&MeasObj_list->list, MeasObj); // LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measObjectToAddModList = MeasObj_list; // Report Configurations for periodical, A1-A5 events ReportConfig_list = CALLOC(1, sizeof(*ReportConfig_list)); @@ -1634,7 +1632,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( ReportConfig_per->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_per->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_per->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_per); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_per); ReportConfig_A1->reportConfigId = 2; ReportConfig_A1->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -1650,7 +1648,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A1); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A1); if (RC.rrc[ctxt_pP->module_id]->HO_flag == 1 /*HO_MEASUREMENT */ ) { LOG_I(RRC, "[eNB %d] frame %d: requesting A2, A3, A4, A5, and A6 event reporting\n", @@ -1671,7 +1669,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A2); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A2); ReportConfig_A3->reportConfigId = 4; ReportConfig_A3->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -1690,7 +1688,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis = 0.5; // FIXME ...hysteresis is of type long! ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger = LTE_TimeToTrigger_ms40; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A3); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A3); ReportConfig_A4->reportConfigId = 5; ReportConfig_A4->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -1707,7 +1705,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A4); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A4); ReportConfig_A5->reportConfigId = 6; ReportConfig_A5->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -1728,7 +1726,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A5); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A5); // LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->reportConfigToAddModList = ReportConfig_list; #if 0 /* TODO: set a proper value. @@ -1795,7 +1793,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( (char *)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer, ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length); LOG_D(RRC, "Add LTE_DedicatedInfoNAS(%d) to LTE_DedicatedInfoNASList\n", i); - ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas); + asn1cSeqAdd(&dedicatedInfoNASList->list, dedicatedInfoNas); } /* TODO parameters yet to process ... */ @@ -2220,8 +2218,8 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co logicalchannelgroup_drb = CALLOC(1, sizeof(long)); *logicalchannelgroup_drb = 1;//(i+1) % 3; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; - ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config); - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&DRB_configList->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); //ue_context_pP->ue_context.DRB_configList2[drb_identity_index] = &(*DRB_configList); LOG_I(RRC,"EPS ID %ld, DRB ID %ld (index %d), QCI %d, priority %ld, LCID %ld LCGID %ld \n", *DRB_config->eps_BearerIdentity, @@ -2241,7 +2239,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co OCTET_STRING_fromBuf(dedicatedInfoNas, (char *)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer, ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas); + asn1cSeqAdd(&dedicatedInfoNASList->list, dedicatedInfoNas); LOG_I(RRC,"add NAS info with size %d (rab id %d)\n",ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length, i); } else { LOG_W(RRC,"Not received activate dedicated EPS bearer context request\n"); @@ -2467,7 +2465,7 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *cons DRB_ul_SpecificParameters->prioritisedBitRate = LTE_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8; DRB_ul_SpecificParameters->bucketSizeDuration = LTE_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50; - ASN_SEQUENCE_ADD(&(DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&(DRB_configList2)->list, DRB_config); LOG_I(RRC, "EPS ID %ld, DRB ID %ld (index %d), QCI %d, priority %ld, LCID %ld LCGID %ld \n", *DRB_config->eps_BearerIdentity, DRB_config->drb_Identity, i, @@ -2486,7 +2484,7 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *cons OCTET_STRING_fromBuf(dedicatedInfoNas, (char *)ue_context_pP->ue_context.modify_e_rab[i].param.nas_pdu.buffer, ue_context_pP->ue_context.modify_e_rab[i].param.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas); + asn1cSeqAdd(&dedicatedInfoNASList->list, dedicatedInfoNas); LOG_I(RRC, "add NAS info with size %d (rab id %d)\n",ue_context_pP->ue_context.modify_e_rab[i].param.nas_pdu.length, i); } else { LOG_W(RRC, "Not received activate dedicated EPS bearer context request\n"); @@ -2576,7 +2574,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_ if((ue_context_pP->ue_context.e_rab[i].status == E_RAB_STATUS_TORELEASE) && ue_context_pP->ue_context.e_rab[i].xid == xid) { DRB_release = CALLOC(1, sizeof(LTE_DRB_Identity_t)); *DRB_release = i+1; - ASN_SEQUENCE_ADD(&(*DRB_Release_configList2)->list, DRB_release); + asn1cSeqAdd(&(*DRB_Release_configList2)->list, DRB_release); //free(DRB_release); } } @@ -2590,7 +2588,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_ OCTET_STRING_fromBuf(dedicatedInfoNas, (char *)nas_buffer, nas_length); - ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas); + asn1cSeqAdd(&dedicatedInfoNASList->list, dedicatedInfoNas); LOG_I(RRC,"add NAS info with size %d\n",nas_length); } else { LOG_W(RRC,"dedlicated NAS list is empty\n"); @@ -2745,8 +2743,8 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *logicalchannelgroup = 0; SRB2_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters = SRB2_ul_SpecificParameters; - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); // this list has the configuration for SRB1 and SRB2 - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); // this list has only the configuration for SRB2 + asn1cSeqAdd(&SRB_configList->list, SRB2_config); // this list has the configuration for SRB1 and SRB2 + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); // this list has only the configuration for SRB2 /* Configure DRB */ // list for all the configured DRB @@ -2817,8 +2815,8 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t logicalchannelgroup_drb = CALLOC(1, sizeof(long)); *logicalchannelgroup_drb = 1; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; - ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); /* MAC Main Config */ // The different parts of MAC main config are set below mac_MainConfig = CALLOC(1, sizeof(*mac_MainConfig)); @@ -2943,32 +2941,32 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t MeasId0->measId = 1; MeasId0->measObjectId = 1; MeasId0->reportConfigId = 1; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId0); + asn1cSeqAdd(&MeasId_list->list, MeasId0); MeasId1 = CALLOC(1, sizeof(*MeasId1)); MeasId1->measId = 2; MeasId1->measObjectId = 1; MeasId1->reportConfigId = 2; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId1); + asn1cSeqAdd(&MeasId_list->list, MeasId1); MeasId2 = CALLOC(1, sizeof(*MeasId2)); MeasId2->measId = 3; MeasId2->measObjectId = 1; MeasId2->reportConfigId = 3; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId2); + asn1cSeqAdd(&MeasId_list->list, MeasId2); MeasId3 = CALLOC(1, sizeof(*MeasId3)); MeasId3->measId = 4; MeasId3->measObjectId = 1; MeasId3->reportConfigId = 4; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId3); + asn1cSeqAdd(&MeasId_list->list, MeasId3); MeasId4 = CALLOC(1, sizeof(*MeasId4)); MeasId4->measId = 5; MeasId4->measObjectId = 1; MeasId4->reportConfigId = 5; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId4); + asn1cSeqAdd(&MeasId_list->list, MeasId4); MeasId5 = CALLOC(1, sizeof(*MeasId5)); MeasId5->measId = 6; MeasId5->measObjectId = 1; MeasId5->reportConfigId = 6; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId5); + asn1cSeqAdd(&MeasId_list->list, MeasId5); if (ue_context_pP->ue_context.does_nr) { MeasId6 = calloc(1, sizeof(LTE_MeasIdToAddMod_t)); @@ -2978,7 +2976,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t MeasId6->measId = 7; MeasId6->measObjectId = 2; MeasId6->reportConfigId = 7; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId6); + asn1cSeqAdd(&MeasId_list->list, MeasId6); } // LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measIdToAddModList = MeasId_list; @@ -3024,10 +3022,10 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t CellToAdd->physCellId = RC.rrc[ctxt_pP->module_id]->neigh_cells_id[i][0];//get_adjacent_cell_id(ctxt_pP->module_id, i); CellToAdd->cellIndividualOffset = LTE_Q_OffsetRange_dB0; ue_context_pP->ue_context.measurement_info->cellIndividualOffset[i+1] = CellToAdd->cellIndividualOffset; - ASN_SEQUENCE_ADD(&CellsToAddModList->list, CellToAdd); + asn1cSeqAdd(&CellsToAddModList->list, CellToAdd); } - ASN_SEQUENCE_ADD(&MeasObj_list->list, MeasObj); + asn1cSeqAdd(&MeasObj_list->list, MeasObj); // LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measObjectToAddModList = MeasObj_list; if (ue_context_pP->ue_context.does_nr) { @@ -3061,7 +3059,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t else MeasObj2->measObject.choice.measObjectNR_r15.ext1->bandNR_r15->choice.setup = 78; - ASN_SEQUENCE_ADD(&MeasObj_list->list, MeasObj2); + asn1cSeqAdd(&MeasObj_list->list, MeasObj2); } if (!ue_context_pP->ue_context.measurement_info->events) { @@ -3092,7 +3090,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ReportConfig_per->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_per->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_per->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_per); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_per); ReportConfig_A1->reportConfigId = 2; ReportConfig_A1->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -3108,7 +3106,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A1); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A1); //if (ho_state == 1 /*HO_MEASURMENT */ ) { LOG_I(RRC, "[eNB %d] frame %d: requesting A2, A3, A4, and A5 event reporting\n", ctxt_pP->module_id, ctxt_pP->frame); @@ -3128,7 +3126,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A2); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A2); ReportConfig_A3->reportConfigId = 4; ReportConfig_A3->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -3147,7 +3145,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis = 0; // FIXME ...hysteresis is of type long! ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger = LTE_TimeToTrigger_ms40; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A3); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A3); ReportConfig_A4->reportConfigId = 5; ReportConfig_A4->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -3164,7 +3162,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A4); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A4); ReportConfig_A5->reportConfigId = 6; ReportConfig_A5->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -3185,7 +3183,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A5); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A5); if (ue_context_pP->ue_context.does_nr) { LOG_I(RRC,"Configuring measurement for NR cell\n"); @@ -3212,7 +3210,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15->ss_rsrp = true; ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15->ss_rsrq = true; ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15->ss_sinr = true; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_NR); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_NR); LOG_A(RRC, "Generating RRCCConnectionReconfigurationRequest (NRUE Measurement Report Request).\n"); } @@ -3271,7 +3269,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t OCTET_STRING_fromBuf(dedicatedInfoNas, (char *)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer, ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas); + asn1cSeqAdd(&dedicatedInfoNASList->list, dedicatedInfoNas); } /* TODO parameters yet to process ... */ @@ -3519,9 +3517,9 @@ static int encode_CG_ConfigInfo( AssertFatal(cg_configinfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo-> ue_CapabilityInfo != NULL, "failed to allocate memory for ue_capabilityinfo"); ue_cap_rat_container_list = calloc(1,sizeof(NR_UE_CapabilityRAT_ContainerList_t)); if (ue_cap_rat_container_MRDC != NULL) - ASN_SEQUENCE_ADD(&ue_cap_rat_container_list->list, ue_cap_rat_container_MRDC); + asn1cSeqAdd(&ue_cap_rat_container_list->list, ue_cap_rat_container_MRDC); if (ue_cap_rat_container_nr != NULL) - ASN_SEQUENCE_ADD(&ue_cap_rat_container_list->list, ue_cap_rat_container_nr); + asn1cSeqAdd(&ue_cap_rat_container_list->list, ue_cap_rat_container_nr); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_CapabilityRAT_ContainerList,NULL, (void *)ue_cap_rat_container_list,temp_buff,ASN_MAX_ENCODE_SIZE); AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", @@ -3728,7 +3726,7 @@ rrc_eNB_process_MeasurementReport( for (i=0; i < neighboring_cells; i++) { if (i>=ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.count) { //printf("NeighCells number: %d \n", ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.count); - ASN_SEQUENCE_ADD(&ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list,measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[i]); + asn1cSeqAdd(&ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list,measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[i]); } ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[i]->physCellId = @@ -4370,7 +4368,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct logicalchannelgroup = CALLOC(1, sizeof(long)); *logicalchannelgroup = 0; SRB1_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB1_config); + asn1cSeqAdd(&SRB_configList->list, SRB1_config); ue_context_pP->ue_context.SRB_configList = SRB_configList; // Configure SRB2 /// SRB2 @@ -4409,9 +4407,9 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct SRB2_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters = SRB2_ul_SpecificParameters; // this list has the configuration for SRB1 and SRB2 - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); // this list has only the configuration for SRB2 - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); // Configure DRB //*DRB_configList = CALLOC(1, sizeof(*DRB_configList)); @@ -4488,8 +4486,8 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct logicalchannelgroup_drb = CALLOC(1, sizeof(long)); *logicalchannelgroup_drb = 1; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; - ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); //ue_context_pP->ue_context.DRB_configList2[0] = &(*DRB_configList); mac_MainConfig = CALLOC(1, sizeof(*mac_MainConfig)); ue_context_pP->ue_context.mac_MainConfig = mac_MainConfig; @@ -4738,8 +4736,8 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct *logicalchannelgroup = 0; SRB2_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters = SRB2_ul_SpecificParameters; - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); // Configure target eNB DRB DRB_configList2 = CALLOC(1, sizeof(*DRB_configList2)); /// DRB @@ -4776,7 +4774,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct logicalchannelgroup_drb = CALLOC(1, sizeof(long)); *logicalchannelgroup_drb = 1; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); mac_MainConfig = CALLOC(1, sizeof(*mac_MainConfig)); ue_context_pP->ue_context.mac_MainConfig = mac_MainConfig; mac_MainConfig->ul_SCH_Config = CALLOC(1, sizeof(*mac_MainConfig->ul_SCH_Config)); @@ -4805,32 +4803,32 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct MeasId0->measId = 1; MeasId0->measObjectId = 1; MeasId0->reportConfigId = 1; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId0); + asn1cSeqAdd(&MeasId_list->list, MeasId0); MeasId1 = CALLOC(1, sizeof(*MeasId1)); MeasId1->measId = 2; MeasId1->measObjectId = 1; MeasId1->reportConfigId = 2; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId1); + asn1cSeqAdd(&MeasId_list->list, MeasId1); MeasId2 = CALLOC(1, sizeof(*MeasId2)); MeasId2->measId = 3; MeasId2->measObjectId = 1; MeasId2->reportConfigId = 3; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId2); + asn1cSeqAdd(&MeasId_list->list, MeasId2); MeasId3 = CALLOC(1, sizeof(*MeasId3)); MeasId3->measId = 4; MeasId3->measObjectId = 1; MeasId3->reportConfigId = 4; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId3); + asn1cSeqAdd(&MeasId_list->list, MeasId3); MeasId4 = CALLOC(1, sizeof(*MeasId4)); MeasId4->measId = 5; MeasId4->measObjectId = 1; MeasId4->reportConfigId = 5; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId4); + asn1cSeqAdd(&MeasId_list->list, MeasId4); MeasId5 = CALLOC(1, sizeof(*MeasId5)); MeasId5->measId = 6; MeasId5->measObjectId = 1; MeasId5->reportConfigId = 6; - ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId5); + asn1cSeqAdd(&MeasId_list->list, MeasId5); // LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measIdToAddModList = MeasId_list; // Add one EUTRA Measurement Object MeasObj_list = CALLOC(1, sizeof(*MeasObj_list)); @@ -4874,10 +4872,10 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct CellToAdd->physCellId = RC.rrc[ctxt_pP->module_id]->neigh_cells_id[i][0];//get_adjacent_cell_id(ctxt_pP->module_id, i); CellToAdd->cellIndividualOffset = LTE_Q_OffsetRange_dB0; ue_context_pP->ue_context.measurement_info->cellIndividualOffset[i+1] = CellToAdd->cellIndividualOffset; - ASN_SEQUENCE_ADD(&CellsToAddModList->list, CellToAdd); + asn1cSeqAdd(&CellsToAddModList->list, CellToAdd); } - ASN_SEQUENCE_ADD(&MeasObj_list->list, MeasObj); + asn1cSeqAdd(&MeasObj_list->list, MeasObj); // LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measObjectToAddModList = MeasObj_list; if (!ue_context_pP->ue_context.measurement_info->events) { @@ -4903,7 +4901,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct ReportConfig_per->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_per->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_per->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_per); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_per); ReportConfig_A1->reportConfigId = 2; ReportConfig_A1->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -4919,7 +4917,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A1->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A1); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A1); // if (ho_state == 1 /*HO_MEASUREMENT */ ) { LOG_I(RRC, "[eNB %d] frame %d: requesting A2, A3, A4, and A5 event reporting\n", ctxt_pP->module_id, ctxt_pP->frame); @@ -4939,7 +4937,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A2->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A2); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A2); ReportConfig_A3->reportConfigId = 4; ReportConfig_A3->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -4958,7 +4956,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis = 0; // FIXME ...hysteresis is of type long! ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger = LTE_TimeToTrigger_ms40; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A3); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A3); ReportConfig_A4->reportConfigId = 5; ReportConfig_A4->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -4975,7 +4973,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A4->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A4); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A4); ReportConfig_A5->reportConfigId = 6; ReportConfig_A5->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.triggerType.present = @@ -4996,7 +4994,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.maxReportCells = 2; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120; ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity; - ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A5); + asn1cSeqAdd(&ReportConfig_list->list, ReportConfig_A5); // rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->reportConfigToAddModList = ReportConfig_list; /* A3 event update */ @@ -5162,7 +5160,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct OCTET_STRING_fromBuf(dedicatedInfoNas, (char *)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer, ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas); + asn1cSeqAdd(&dedicatedInfoNASList->list, dedicatedInfoNas); } /* TODO parameters yet to process ... */ @@ -8528,7 +8526,7 @@ rrc_eNB_process_SidelinkUEInformation( for (int i=0; i< n_destinations; i++ ) { //sl_DestinationIdentityList[i] = *(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->destinationInfoList_r12.list.array[i]); - ASN_SEQUENCE_ADD(&destinationInfoList->list, sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->destinationInfoList_r12.list.array[i]); + asn1cSeqAdd(&destinationInfoList->list, sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.commTxResourceReq_r12->destinationInfoList_r12.list.array[i]); } //generate RRC Reconfiguration @@ -8547,7 +8545,7 @@ rrc_eNB_process_SidelinkUEInformation( for (int i=0; i< n_destinations; i++ ) { //sl_DestinationIdentityList[i] = *(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->destinationInfoList_r12.list.array[i]); - ASN_SEQUENCE_ADD(&destinationInfoList->list, + asn1cSeqAdd(&destinationInfoList->list, sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceReqUC_r13->destinationInfoList_r12.list.array[i]); } @@ -8570,7 +8568,7 @@ rrc_eNB_process_SidelinkUEInformation( for (int i=0; i< n_destinations; i++ ) { //sl_DestinationIdentityList[i] = *(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.array[i]); - ASN_SEQUENCE_ADD(&destinationInfoList->list, + asn1cSeqAdd(&destinationInfoList->list, sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.array[i]); } @@ -8593,7 +8591,7 @@ rrc_eNB_process_SidelinkUEInformation( for (int i=0; i< n_destinations; i++ ) { //sl_DestinationIdentityList[i] = *(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.array[i]); - ASN_SEQUENCE_ADD(&destinationInfoList->list, + asn1cSeqAdd(&destinationInfoList->list, sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.array[i]); } diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c index bffb3dc0c8..647be50252 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c @@ -34,7 +34,7 @@ # include "rrc_eNB_UE_context.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "intertask_interface.h" diff --git a/openair2/RRC/LTE/rrc_eNB_M2AP.c b/openair2/RRC/LTE/rrc_eNB_M2AP.c index 25142b287a..550bb7c2bc 100644 --- a/openair2/RRC/LTE/rrc_eNB_M2AP.c +++ b/openair2/RRC/LTE/rrc_eNB_M2AP.c @@ -32,7 +32,7 @@ # include "RRC/LTE/MESSAGES/asn1_msg.h" # include "rrc_eNB_M2AP.h" //# include "rrc_eNB_UE_context.h" -# include "asn1_conversions.h" +# include "oai_asn1.h" # include "intertask_interface.h" # include "common/ran_context.h" @@ -96,7 +96,7 @@ static uint8_t rrc_M2AP_do_MBSFNCountingRequest( lte_counting_request_info->tmgi_r10.plmn_Id_r9.choice.plmn_Index_r9= 1; memset(<e_counting_request_info->tmgi_r10.serviceId_r9,0,sizeof(OCTET_STRING_t)); OCTET_STRING_fromBuf(<e_counting_request_info->tmgi_r10.serviceId_r9,(const char*)&TMGI[2],3); - ASN_SEQUENCE_ADD(&(*mbsfnCoutingRequest)->countingRequestList_r10.list,lte_counting_request_info); + asn1cSeqAdd(&(*mbsfnCoutingRequest)->countingRequestList_r10.list,lte_counting_request_info); if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout,&asn_DEF_LTE_MCCH_Message,(void *)mcch_message); @@ -177,7 +177,7 @@ static uint8_t rrc_M2AP_do_MBSFNAreaConfig( mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0] = (m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].subframe_allocation & 0x3F)<<2; } - ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1); + asn1cSeqAdd(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1); } // commonSF-AllocPeriod-r9 (*mbsfnAreaConfiguration)->commonSF_AllocPeriod_r9= m2ap_mbms_scheduling_information->mbms_area_config_list[i].common_sf_allocation_period;//LTE_MBSFNAreaConfiguration_r9__commonSF_AllocPeriod_r9_rf16; @@ -220,9 +220,9 @@ static uint8_t rrc_M2AP_do_MBSFNAreaConfig( mbms_Session_1->logicalChannelIdentity_r9=m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].lcid; //1; LOG_D(RRC,"lcid %lu %d\n",mbms_Session_1->logicalChannelIdentity_r9,m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].lcid); LOG_D(RRC,"service_id %d\n",m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id); - ASN_SEQUENCE_ADD(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_1); + asn1cSeqAdd(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_1); } - ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->pmch_InfoList_r9.list,pmch_Info_1); + asn1cSeqAdd(&(*mbsfnAreaConfiguration)->pmch_InfoList_r9.list,pmch_Info_1); } } @@ -460,7 +460,7 @@ static uint8_t rrc_M2AP_do_SIB1_MBMS_SIB13( MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0] = m2ap_setup_resp->mcch_config_per_mbsfn[j].subframe_allocation_info << 2; // FDD: SF1 MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused = 2; MBSFN_Area1->mcch_Config_r9.signallingMCS_r9 = m2ap_setup_resp->mcch_config_per_mbsfn[j].mcs; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list, MBSFN_Area1); + asn1cSeqAdd(&MBSFNArea_list->list, MBSFN_Area1); } break; case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib14_v1130: @@ -523,7 +523,7 @@ static uint8_t rrc_M2AP_do_SIB1_MBMS_SIB13( sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0] = (m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation << 2); } - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list, sib2_mbsfn_SubframeConfig1); + asn1cSeqAdd(&MBSFNSubframeConfigList->list, sib2_mbsfn_SubframeConfig1); } } @@ -561,10 +561,10 @@ static uint8_t rrc_M2AP_do_SIB1_MBMS_SIB13( MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0] = m2ap_setup_resp->mcch_config_per_mbsfn[i].subframe_allocation_info << 2; // FDD: SF1 MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused = 2; MBSFN_Area1->mcch_Config_r9.signallingMCS_r9 = m2ap_setup_resp->mcch_config_per_mbsfn[i].mcs; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list, MBSFN_Area1); + asn1cSeqAdd(&MBSFNArea_list->list, MBSFN_Area1); } - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); } RC.rrc[Mod_id]->carrier[CC_id].sib1_MBMS = &bcch_message_fembms->message.choice.c1.choice.systemInformationBlockType1_MBMS_r14; @@ -664,7 +664,7 @@ static uint8_t rrc_M2AP_do_SIB1_MBMS_SIB13( // // schedulingInfo.si_Periodicity=LTE_SchedulingInfo__si_Periodicity_rf8; // sib_type=LTE_SIB_Type_sibType13_v920; -// ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo); +// asn1cSeqAdd(&(*sib1)->schedulingInfoList.list,&schedulingInfo); // } // // enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message, @@ -829,7 +829,7 @@ static uint8_t rrc_M2AP_do_SIB23_SIB2( } - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); + asn1cSeqAdd(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); } } @@ -938,7 +938,7 @@ static uint8_t rrc_M2AP_do_SIB23_SIB13( sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2; sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2; - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); + asn1cSeqAdd(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); break; @@ -979,10 +979,10 @@ static uint8_t rrc_M2AP_do_SIB23_SIB13( MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0] = m2ap_setup_resp->mcch_config_per_mbsfn[i].subframe_allocation_info << 2; // FDD: SF1 MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused = 2; MBSFN_Area1->mcch_Config_r9.signallingMCS_r9 = m2ap_setup_resp->mcch_config_per_mbsfn[i].mcs; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list, MBSFN_Area1); + asn1cSeqAdd(&MBSFNArea_list->list, MBSFN_Area1); } - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); //xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message); @@ -1125,7 +1125,7 @@ static uint8_t rrc_M2AP_do_SIB23_SIB2_SIB13( MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=m2ap_setup_resp->mcch_config_per_mbsfn[j].subframe_allocation_info<<2; // FDD: SF1 MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2; MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].mcs; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1); + asn1cSeqAdd(&MBSFNArea_list->list,MBSFN_Area1); } break; case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib14_v1130: @@ -1189,7 +1189,7 @@ static uint8_t rrc_M2AP_do_SIB23_SIB2_SIB13( } - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); + asn1cSeqAdd(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); } } @@ -1226,10 +1226,10 @@ static uint8_t rrc_M2AP_do_SIB23_SIB2_SIB13( MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=m2ap_setup_resp->mcch_config_per_mbsfn[i].subframe_allocation_info<<2; // FDD: SF1 MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2; MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].mcs; - ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1); + asn1cSeqAdd(&MBSFNArea_list->list,MBSFN_Area1); } - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); + asn1cSeqAdd(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); } diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index ca1fb806dc..e2e8e56f4a 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -41,7 +41,7 @@ #include "s1ap_eNB_defs.h" #include "s1ap_eNB_management_procedures.h" #include "s1ap_eNB_ue_context.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "intertask_interface.h" #include "pdcp.h" #include "pdcp_primitives.h" diff --git a/openair2/RRC/LTE/rrc_eNB_endc.c b/openair2/RRC/LTE/rrc_eNB_endc.c index a91b81e9f4..b33cf83d3a 100644 --- a/openair2/RRC/LTE/rrc_eNB_endc.c +++ b/openair2/RRC/LTE/rrc_eNB_endc.c @@ -23,6 +23,7 @@ #include "rrc_extern.h" #include "rrc_eNB_UE_context.h" #include "common/ran_context.h" +#include "oai_asn1.h" #include "LTE_DL-DCCH-Message.h" #include @@ -95,7 +96,7 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, drb.logicalChannelIdentity = &lcid; drb.logicalChannelConfig = &lc; - ASN_SEQUENCE_ADD(&drb_list.list, &drb); + asn1cSeqAdd(&drb_list.list, &drb); rlc.present = LTE_RLC_Config_PR_am; rlc.choice.am.ul_AM_RLC.t_PollRetransmit = LTE_T_PollRetransmit_ms50; @@ -110,7 +111,7 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, /* release drb 1 */ drb = 1; - ASN_SEQUENCE_ADD(&drb_list.list, &drb); + asn1cSeqAdd(&drb_list.list, &drb); rrcd.drb_ToReleaseList = &drb_list; ul_params.priority = 12; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c old mode 100755 new mode 100644 index d46d85897a..e52e637dd8 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -36,8 +36,8 @@ #include /* for EX_* exit codes */ #include /* for errno */ #include "common/utils/LOG/log.h" +#include "oai_asn1.h" #include -#include /* for _ASN_DEFAULT_STACK_MAX */ #include #include #include @@ -382,24 +382,24 @@ uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, NR_SIB_TypeInfo_t *sib_type3 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type)); sib_type3->type = NR_SIB_TypeInfo__type_sibType3; sib_type3->valueTag = CALLOC(1,sizeof(sib_type3->valueTag)); - ASN_SEQUENCE_ADD(&schedulingInfo->sib_MappingInfo.list,sib_type3); + asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type3); NR_SIB_TypeInfo_t *sib_type5 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type)); sib_type5->type = NR_SIB_TypeInfo__type_sibType5; sib_type5->valueTag = CALLOC(1,sizeof(sib_type5->valueTag)); - ASN_SEQUENCE_ADD(&schedulingInfo->sib_MappingInfo.list,sib_type5); + asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type5); NR_SIB_TypeInfo_t *sib_type4 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type)); sib_type4->type = NR_SIB_TypeInfo__type_sibType4; sib_type4->valueTag = CALLOC(1,sizeof(sib_type4->valueTag)); - ASN_SEQUENCE_ADD(&schedulingInfo->sib_MappingInfo.list,sib_type4); + asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type4); NR_SIB_TypeInfo_t *sib_type2 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type)); sib_type2->type = NR_SIB_TypeInfo__type_sibType2; sib_type2->valueTag = CALLOC(1,sizeof(sib_type2->valueTag)); - ASN_SEQUENCE_ADD(&schedulingInfo->sib_MappingInfo.list,sib_type2); + asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type2); - ASN_SEQUENCE_ADD(&sib1->si_SchedulingInfo->schedulingInfoList.list,schedulingInfo);*/ + asn1cSeqAdd(&sib1->si_SchedulingInfo->schedulingInfoList.list,schedulingInfo);*/ // servingCellConfigCommon asn1cCalloc(sib1->servingCellConfigCommon, ServCellCom); @@ -435,7 +435,7 @@ uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, absolute_diff,scs_scaling2,scs_scaling,(int)sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA); for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.count; i++) { - ASN_SEQUENCE_ADD(&ServCellCom->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list, + asn1cSeqAdd(&ServCellCom->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list, configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[i]); } @@ -445,13 +445,13 @@ uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList)); NR_SearchSpace_t *ss1 = rrc_searchspace_config(true, 1, 0); - ASN_SEQUENCE_ADD(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss1); + asn1cSeqAdd(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss1); NR_SearchSpace_t *ss2 = rrc_searchspace_config(true, 2, 0); - ASN_SEQUENCE_ADD(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss2); + asn1cSeqAdd(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss2); NR_SearchSpace_t *ss3 = rrc_searchspace_config(true, 3, 0); - ASN_SEQUENCE_ADD(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss3); + asn1cSeqAdd(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss3); asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1, 0); asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation, 3); @@ -476,10 +476,10 @@ uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, ZoneEight); asn1cCallocOne(ZoneEight, 0); - asn1cCalloc(ServCellCom->uplinkConfigCommon, UL) + asn1cCalloc(ServCellCom->uplinkConfigCommon, UL); asn_set_empty(&UL->frequencyInfoUL.scs_SpecificCarrierList.list); for(int i = 0; i< configuration->scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.count; i++) { - ASN_SEQUENCE_ADD(&UL->frequencyInfoUL.scs_SpecificCarrierList.list, + asn1cSeqAdd(&UL->frequencyInfoUL.scs_SpecificCarrierList.list, configuration->scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[i]); } @@ -573,7 +573,7 @@ uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, nr_uac_BarringInfoSet->uac_BarringForAccessIdentity.buf = CALLOC(1, 1); nr_uac_BarringInfoSet->uac_BarringForAccessIdentity.size = 1; nr_uac_BarringInfoSet->uac_BarringForAccessIdentity.bits_unused = 1; - ASN_SEQUENCE_ADD(&sib1->uac_BarringInfo->uac_BarringInfoSetList, nr_uac_BarringInfoSet);*/ + asn1cSeqAdd(&sib1->uac_BarringInfo->uac_BarringInfoSetList, nr_uac_BarringInfoSet);*/ // useFullResumeID // TODO: add useFullResumeID @@ -626,12 +626,12 @@ uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier, sib2->choice.sib2->intraFreqCellReselectionInfo.s_IntraSearchP = 2; // INTEGER (0..31) sib2->choice.sib2->intraFreqCellReselectionInfo.t_ReselectionNR = 2; // INTEGER (0..7) sib2->choice.sib2->intraFreqCellReselectionInfo.deriveSSB_IndexFromCell = true; - ASN_SEQUENCE_ADD(&ies->sib_TypeAndInfo.list, sib2); + asn1cSeqAdd(&ies->sib_TypeAndInfo.list, sib2); sib3 = CALLOC(1, sizeof(SystemInformation_IEs__sib_TypeAndInfo__Member)); sib3->present = NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib3; sib3->choice.sib3 = CALLOC(1, sizeof(struct NR_SIB3)); - ASN_SEQUENCE_ADD(&ies->sib_TypeAndInfo.list, sib3); + asn1cSeqAdd(&ies->sib_TypeAndInfo.list, sib3); //encode SIB to data // carrier->SIB23 = (uint8_t *) malloc16(128); @@ -772,13 +772,13 @@ void fill_initial_SpCellConfig(int uid, uint64_t bitmap = get_ssb_bitmap(scc); rrc_coreset_config(coreset, 0, curr_bwp, bitmap); - ASN_SEQUENCE_ADD(&bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list, + asn1cSeqAdd(&bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list, coreset); bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList)); NR_SearchSpace_t *ss2 = rrc_searchspace_config(false, 5, coreset->controlResourceSetId); - ASN_SEQUENCE_ADD(&bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list, ss2); + asn1cSeqAdd(&bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list, ss2); bwp_Dedicated->pdsch_Config = config_pdsch(bitmap, 0, pdsch_AntennaPorts); @@ -803,7 +803,7 @@ void fill_initial_SpCellConfig(int uid, servingcellconfigdedicated, NULL, 0, false, bwp_loop, true); - ASN_SEQUENCE_ADD(&SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp); + asn1cSeqAdd(&SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp); } SpCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id)); *SpCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = servingcellconfigdedicated->firstActiveDownlinkBWP_Id ? *servingcellconfigdedicated->firstActiveDownlinkBWP_Id : 1; @@ -827,7 +827,7 @@ void fill_initial_SpCellConfig(int uid, servingcellconfigdedicated, scc, NULL); - ASN_SEQUENCE_ADD(&uplinkConfig->uplinkBWP_ToAddModList->list, ubwp); + asn1cSeqAdd(&uplinkConfig->uplinkBWP_ToAddModList->list, ubwp); } uplinkConfig->firstActiveUplinkBWP_Id = calloc(1,sizeof(*uplinkConfig->firstActiveUplinkBWP_Id)); *uplinkConfig->firstActiveUplinkBWP_Id = servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id : 1; @@ -853,10 +853,10 @@ void fill_initial_SpCellConfig(int uid, if ((bitmap >> (63 - i)) & 0x01) { NR_SSB_Index_t *ssbres = NULL; asn1cCallocOne(ssbres, i); - ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list, ssbres); + asn1cSeqAdd(&ssbresset0->csi_SSB_ResourceList.list, ssbres); } } - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); + asn1cSeqAdd(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); int bwp_loop_end = n_dl_bwp>0 ? n_dl_bwp : 1; for (int bwp_loop = 0; bwp_loop < bwp_loop_end; bwp_loop++) { @@ -885,10 +885,10 @@ void fill_initial_SpCellConfig(int uid, csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList)); NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00)); *ssbres00 = 0; - ASN_SEQUENCE_ADD(&csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00); + asn1cSeqAdd(&csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00); csires1->bwp_Id = bwp_id; csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1); + asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1); NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1)); pucchcsires1->uplinkBandwidthPartId=bwp_id; @@ -902,10 +902,10 @@ void fill_initial_SpCellConfig(int uid, csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)); NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0)); *nzp0 = bwp_loop; - ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); + asn1cSeqAdd(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); csires0->bwp_Id = bwp_id; csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0); + asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0); } if (configuration->do_CSIRS && pdsch_AntennaPorts > 1) { @@ -915,10 +915,10 @@ void fill_initial_SpCellConfig(int uid, csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); *csiim00 = bwp_loop; - ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + asn1cSeqAdd(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); csires2->bwp_Id = bwp_id; csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); + asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); config_csi_meas_report(csi_MeasConfig, scc, pucchcsires1, pdsch_Config, &configuration->pdsch_AntennaPorts, NR_MAX_SUPPORTED_DL_LAYERS, bwp_id, uid); } @@ -1025,16 +1025,16 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr // TS38.331 9.2.1 Default SRB configurations if (configure_srb){ NR_RLC_BearerConfig_t *rlc_BearerConfig = get_SRB_RLC_BearerConfig(2, 3, NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms5); - ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); - ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig); + asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); + asn1cSeqAdd(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig); } // DRB Configuration for (int i = bearer_id_start; i < bearer_id_start + nb_bearers_to_setup; i++ ){ const NR_RLC_Config_PR rlc_conf = use_rlc_um_for_drb ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am; NR_RLC_BearerConfig_t *rlc_BearerConfig = get_DRB_RLC_BearerConfig(3 + i, i, rlc_conf, priority[i-1]); - ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); - ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig); + asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); + asn1cSeqAdd(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig); } } @@ -1179,7 +1179,7 @@ void fill_initial_cellGroupConfig(int uid, /* TS38.331 9.2.1 Default SRB configurations */ cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList)); NR_RLC_BearerConfig_t *rlc_BearerConfig = get_SRB_RLC_BearerConfig(1, 1, NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms1000); - ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); + asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); cellGroupConfig->rlc_BearerToReleaseList = NULL; @@ -1195,7 +1195,7 @@ void fill_initial_cellGroupConfig(int uid, struct NR_TAG *tag=calloc(1,sizeof(*tag)); tag->tag_Id = 0; tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity; - ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag); + asn1cSeqAdd(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag); set_phr_config(mac_CellGroupConfig); mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig)); @@ -1204,7 +1204,7 @@ void fill_initial_cellGroupConfig(int uid, schedulingrequestlist->schedulingRequestId = 0; schedulingrequestlist->sr_ProhibitTimer = NULL; schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64; - ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist); + asn1cSeqAdd(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist); cellGroupConfig->mac_CellGroupConfig = mac_CellGroupConfig; @@ -1273,7 +1273,7 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, // pdcp_Config->t_Reordering SRB1_config->pdcp_Config = pdcp_Config; ie->radioBearerConfig.srb_ToAddModList = *SRB_configList; - ASN_SEQUENCE_ADD(&(*SRB_configList)->list, SRB1_config); + asn1cSeqAdd(&(*SRB_configList)->list, SRB1_config); ie->radioBearerConfig.srb3_ToRelease = NULL; ie->radioBearerConfig.drb_ToAddModList = NULL; @@ -1403,7 +1403,7 @@ uint8_t do_NR_SA_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, sa_band_info->choice.bandInformationNR = sa_band_infoNR; sa_band_list = (NR_FreqBandList_t *)calloc(1, sizeof(NR_FreqBandList_t)); - ASN_SEQUENCE_ADD(&sa_band_list->list, sa_band_info); + asn1cSeqAdd(&sa_band_list->list, sa_band_info); sa_band_filter = (NR_UE_CapabilityRequestFilterNR_t*)calloc(1,sizeof(NR_UE_CapabilityRequestFilterNR_t)); sa_band_filter->frequencyBandListFilter = sa_band_list; @@ -1425,7 +1425,7 @@ uint8_t do_NR_SA_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP, ue_capabilityrat_request->capabilityRequestFilter = &req_freq; - ASN_SEQUENCE_ADD(&dl_dcch_msg.message.choice.c1->choice.ueCapabilityEnquiry->criticalExtensions.choice.ueCapabilityEnquiry->ue_CapabilityRAT_RequestList.list, + asn1cSeqAdd(&dl_dcch_msg.message.choice.c1->choice.ueCapabilityEnquiry->criticalExtensions.choice.ueCapabilityEnquiry->ue_CapabilityRAT_RequestList.list, ue_capabilityrat_request); @@ -1941,7 +1941,7 @@ NR_SRB_ToAddModList_t **SRB_configList if (SRB2_config == NULL) { LOG_W(NR_RRC,"SRB2 configuration does not exist in SRB configuration list\n"); } else { - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); } if (*SRB_configList) { @@ -1949,7 +1949,7 @@ NR_SRB_ToAddModList_t **SRB_configList } *SRB_configList = CALLOC(1, sizeof(LTE_SRB_ToAddModList_t)); - ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config); + asn1cSeqAdd(&(*SRB_configList)->list,SRB1_config); rrcReestablishment->rrc_TransactionIdentifier = Transaction_id; rrcReestablishment->criticalExtensions.present = NR_RRCReestablishment__criticalExtensions_PR_rrcReestablishment; @@ -2076,9 +2076,8 @@ NR_MeasConfig_t *get_defaultMeasConfig(const gNB_RrcConfigurationReq *conf) monr1->ext1 = calloc(1, sizeof(*monr1->ext1)); asn1cCallocOne(monr1->ext1->freqBandIndicatorNR, band); mo1->measObject.choice.measObjectNR = monr1; - int ret = ASN_SEQUENCE_ADD(&mc->measObjectToAddModList->list, mo1); - AssertFatal(ret == 0, "ASN_SEQUENCE_ADD() returned %d\n", ret); - + asn1cSeqAdd(&mc->measObjectToAddModList->list, mo1); + // Reporting Configuration: Specifies how reporting should be done. This could be periodic or event-triggered. NR_ReportConfigToAddMod_t *rc = calloc(1, sizeof(*rc)); rc->reportConfigId = 1; @@ -2105,9 +2104,7 @@ NR_MeasConfig_t *get_defaultMeasConfig(const gNB_RrcConfigurationReq *conf) rc->reportConfig.choice.reportConfigNR = rcnr; - ret = ASN_SEQUENCE_ADD(&mc->reportConfigToAddModList->list, rc); - AssertFatal(ret == 0, "ASN_SEQUENCE_ADD() returned %d\n", ret); - //prc->reportQuantityRS_Indexes->rsrp = 1; + asn1cSeqAdd(&mc->reportConfigToAddModList->list, rc); // Measurement ID: Identifies how to report measurements of a specific object. This is a many-to-many mapping: a // measurement object could have multiple reporting configurations, a reporting configuration could apply to multiple @@ -2118,8 +2115,7 @@ NR_MeasConfig_t *get_defaultMeasConfig(const gNB_RrcConfigurationReq *conf) measid->measId = 1; measid->measObjectId = 1; measid->reportConfigId = 1; - ret = ASN_SEQUENCE_ADD(&mc->measIdToAddModList->list, measid); - AssertFatal(ret == 0, "ASN_SEQUENCE_ADD() returned %d\n", ret); + asn1cSeqAdd(&mc->measIdToAddModList->list, measid); // Quantity Configuration: Specifies parameters for layer 3 filtering of measurements. Only after filtering, reporting // criteria are evaluated. The formula used is F_n = (1-a)F_(n-1) + a*M_n, where M is the latest measurement, F is the @@ -2129,8 +2125,7 @@ NR_MeasConfig_t *get_defaultMeasConfig(const gNB_RrcConfigurationReq *conf) NR_QuantityConfigNR_t *qcnr3 = calloc(1, sizeof(*qcnr3)); asn1cCallocOne(qcnr3->quantityConfigCell.ssb_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6); asn1cCallocOne(qcnr3->quantityConfigCell.csi_RS_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6); - ret = ASN_SEQUENCE_ADD(&mc->quantityConfig->quantityConfigNR_List->list, qcnr3); - AssertFatal(ret == 0, "ASN_SEQUENCE_ADD() returned %d\n", ret); + asn1cSeqAdd(&mc->quantityConfig->quantityConfigNR_List->list, qcnr3); return mc; } diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 241c2deb48..87124c1172 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -40,7 +40,6 @@ #include /* for errno */ #include -#include /* for _ASN_DEFAULT_STACK_MAX */ #include "RRC/NR/nr_rrc_defs.h" #include "RRC/NR/nr_rrc_config.h" diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 7476286d5f..7ba87727af 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -31,6 +31,7 @@ #include "nr_rrc_config.h" #include "common/utils/nr/nr_common.h" #include "executables/softmodem-common.h" +#include "oai_asn1.h" const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; @@ -109,7 +110,7 @@ void rrc_coreset_config(NR_ControlResourceSet_t *coreset, if ((ssb_bitmap>>(63-i))&0x01){ tci[i]=calloc(1,sizeof(*tci[i])); *tci[i] = i; - ASN_SEQUENCE_ADD(&coreset->tci_StatesPDCCH_ToAddList->list,tci[i]); + asn1cSeqAdd(&coreset->tci_StatesPDCCH_ToAddList->list,tci[i]); } } coreset->tci_StatesPDCCH_ToReleaseList = NULL; @@ -200,11 +201,11 @@ void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigcommon, nzpcsirs0->nzp_CSI_ResourceSetId = id; NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0)); *nzpid0 = id; - ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); + asn1cSeqAdd(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); nzpcsirs0->repetition = NULL; nzpcsirs0->aperiodicTriggeringOffset = NULL; nzpcsirs0->trs_Info = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); + asn1cSeqAdd(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); const NR_TDD_UL_DL_Pattern_t *tdd = servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon ? &servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; @@ -266,7 +267,7 @@ void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigcommon, set_csirs_periodicity(nzpcsi0, uid, nb_slots_per_period); nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS)); *nzpcsi0->qcl_InfoPeriodicCSI_RS = 0; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); + asn1cSeqAdd(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); } else { csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; @@ -355,15 +356,15 @@ void config_csiim(int do_csirs, int dl_antenna_ports, int curr_bwp, // same period and offset of the associated CSI-RS imres->periodicityAndOffset->present = nzpcsi->periodicityAndOffset->present; set_csiim_offset(imres->periodicityAndOffset, nzpcsi->periodicityAndOffset); - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres); + asn1cSeqAdd(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres); if (!csi_MeasConfig->csi_IM_ResourceSetToAddModList) csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1, sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList)); NR_CSI_IM_ResourceSet_t *imset = calloc(1,sizeof(*imset)); imset->csi_IM_ResourceSetId = id; NR_CSI_IM_ResourceId_t *res = calloc(1,sizeof(*res)); *res = id; - ASN_SEQUENCE_ADD(&imset->csi_IM_Resources,res); - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset); + asn1cSeqAdd(&imset->csi_IM_Resources,res); + asn1cSeqAdd(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset); } else { csi_MeasConfig->csi_IM_ResourceToAddModList = NULL; @@ -513,7 +514,7 @@ void config_srs(const NR_ServingCellConfigCommon_t *scc, srs_resset0->srs_ResourceIdList = calloc(1,sizeof(*srs_resset0->srs_ResourceIdList)); NR_SRS_ResourceId_t *srs_resset0_id = calloc(1,sizeof(*srs_resset0_id)); *srs_resset0_id = res_id; - ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list, srs_resset0_id); + asn1cSeqAdd(&srs_resset0->srs_ResourceIdList->list, srs_resset0_id); srs_Config->srs_ResourceToReleaseList=NULL; if (do_srs) { srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; @@ -535,7 +536,7 @@ void config_srs(const NR_ServingCellConfigCommon_t *scc, *srs_resset0->p0 =-80; srs_resset0->pathlossReferenceRS = NULL; srs_resset0->srs_PowerControlAdjustmentStates = NULL; - ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceSetToAddModList->list,srs_resset0); + asn1cSeqAdd(&srs_Config->srs_ResourceSetToAddModList->list,srs_resset0); srs_Config->srs_ResourceToReleaseList = NULL; @@ -609,7 +610,7 @@ void config_srs(const NR_ServingCellConfigCommon_t *scc, // TODO include CSI as reference signal when BWPs are handled properly srs_res0->spatialRelationInfo->referenceSignal.present = NR_SRS_SpatialRelationInfo__referenceSignal_PR_ssb_Index; srs_res0->spatialRelationInfo->referenceSignal.choice.ssb_Index = 0; - ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0); + asn1cSeqAdd(&srs_Config->srs_ResourceToAddModList->list,srs_res0); } void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, @@ -622,7 +623,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; NR_BandNR_t *nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); nr_bandnr->bandNR = band; - ASN_SEQUENCE_ADD(&cap->rf_Parameters.supportedBandListNR.list, + asn1cSeqAdd(&cap->rf_Parameters.supportedBandListNR.list, nr_bandnr); if (mcs_table == 1) { int bw = get_supported_band_index(numerology, band, rbsize); @@ -652,7 +653,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, } fs_cc->supportedModulationOrderDL = CALLOC(1,sizeof(*fs_cc->supportedModulationOrderDL)); *fs_cc->supportedModulationOrderDL = NR_ModulationOrder_qam256; - ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list, fs_cc); + asn1cSeqAdd(&fs->featureSetsDownlinkPerCC->list, fs_cc); } phy_Parameters->phy_ParametersFRX_Diff = CALLOC(1,sizeof(*phy_Parameters->phy_ParametersFRX_Diff)); @@ -675,12 +676,12 @@ void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsc //*timedomainresourceallocation->k0 = 0; timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; timedomainresourceallocation->startSymbolAndLength = get_SLIV(len_coreset,14-len_coreset); // basic slot configuration starting in symbol 1 til the end of the slot - ASN_SEQUENCE_ADD(&pdsch_TimeDomainAllocationList->list, timedomainresourceallocation); + asn1cSeqAdd(&pdsch_TimeDomainAllocationList->list, timedomainresourceallocation); // setting TDA for CSI-RS symbol with index 1 struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation1 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation1->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; timedomainresourceallocation1->startSymbolAndLength = get_SLIV(len_coreset,14-len_coreset-1); // 1 symbol CSI-RS - ASN_SEQUENCE_ADD(&pdsch_TimeDomainAllocationList->list, timedomainresourceallocation1); + asn1cSeqAdd(&pdsch_TimeDomainAllocationList->list, timedomainresourceallocation1); if(frame_type==TDD) { // TDD if(tdd_UL_DL_ConfigurationCommon) { @@ -690,7 +691,7 @@ void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsc struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation2 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation2->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; timedomainresourceallocation2->startSymbolAndLength = get_SLIV(len_coreset,dl_symb-len_coreset); // mixed slot configuration starting in symbol 1 til the end of the dl allocation - ASN_SEQUENCE_ADD(&pdsch_TimeDomainAllocationList->list, timedomainresourceallocation2); + asn1cSeqAdd(&pdsch_TimeDomainAllocationList->list, timedomainresourceallocation2); } } } @@ -713,7 +714,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ *pusch_timedomainresourceallocation->k2 = k2; pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0,13); - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); + asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); // UL TDA index 1 in case of SRS struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); @@ -721,7 +722,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ *pusch_timedomainresourceallocation1->k2 = k2; pusch_timedomainresourceallocation1->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; pusch_timedomainresourceallocation1->startSymbolAndLength = get_SLIV(0,12); - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); + asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); if(frame_type==TDD) { if(scc->tdd_UL_DL_ConfigurationCommon) { @@ -733,7 +734,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ *pusch_timedomainresourceallocation->k2 = k2; pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); + asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); } // UL TDA index 3 for msg3 in the mixed slot (TDD) int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); @@ -751,7 +752,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(0,13); // full allocation if there is no mixed slot else pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); + asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); } } } @@ -766,7 +767,7 @@ void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time, if (curr_delay <= n_slots_frame) { delay[i] = calloc(1,sizeof(*delay[i])); *delay[i] = curr_delay; - ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); + asn1cSeqAdd(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } } } @@ -778,7 +779,7 @@ void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp pucchresset->pucch_ResourceSetId = 0; NR_PUCCH_ResourceId_t *pucchid=calloc(1,sizeof(*pucchid)); *pucchid=0; - ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchid); + asn1cSeqAdd(&pucchresset->resourceList.list,pucchid); pucchresset->maxPayloadSize=NULL; if(uecap) { @@ -796,9 +797,9 @@ void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp pucchres0->format.choice.format0->initialCyclicShift=0; pucchres0->format.choice.format0->nrofSymbols=1; pucchres0->format.choice.format0->startingSymbolIndex=13; - ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0); + asn1cSeqAdd(&pucch_Config->resourceToAddModList->list,pucchres0); - ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset); + asn1cSeqAdd(&pucch_Config->resourceSetToAddModList->list,pucchresset); } @@ -809,7 +810,7 @@ void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t pucchresset->pucch_ResourceSetId = 1; NR_PUCCH_ResourceId_t *pucchressetid=calloc(1,sizeof(*pucchressetid)); *pucchressetid=2; - ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchressetid); + asn1cSeqAdd(&pucchresset->resourceList.list,pucchressetid); pucchresset->maxPayloadSize=NULL; if(uecap) { @@ -827,9 +828,9 @@ void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t pucchres2->format.choice.format2->nrofPRBs=8; pucchres2->format.choice.format2->nrofSymbols=1; pucchres2->format.choice.format2->startingSymbolIndex=13; - ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2); + asn1cSeqAdd(&pucch_Config->resourceToAddModList->list,pucchres2); - ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset); + asn1cSeqAdd(&pucch_Config->resourceSetToAddModList->list,pucchresset); pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2)); pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup; @@ -855,7 +856,7 @@ void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) { p00->p0_PUCCH_Id = 1; p00->p0_PUCCH_Value = 0; pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set)); - ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00); + asn1cSeqAdd(&pucch_Config->pucch_PowerControl->p0_Set->list,p00); pucch_Config->pucch_PowerControl->pathlossReferenceRSs = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->pathlossReferenceRSs)); struct NR_PUCCH_PathlossReferenceRS *PL_ref_RS = calloc(1,sizeof(*PL_ref_RS)); @@ -863,7 +864,7 @@ void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) { // TODO include CSI as reference signal when BWPs are handled properly PL_ref_RS->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_ssb_Index; PL_ref_RS->referenceSignal.choice.ssb_Index = 0; - ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->pathlossReferenceRSs->list,PL_ref_RS); + asn1cSeqAdd(&pucch_Config->pucch_PowerControl->pathlossReferenceRSs->list,PL_ref_RS); pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0)); *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0; @@ -882,7 +883,7 @@ void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) { pucchspatial->pucch_PathlossReferenceRS_Id = PL_ref_RS->pucch_PathlossReferenceRS_Id; pucchspatial->p0_PUCCH_Id = p00->p0_PUCCH_Id; pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0; - ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial); + asn1cSeqAdd(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial); } static void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig, const NR_ServingCellConfigCommon_t *scc) @@ -945,7 +946,7 @@ void scheduling_request_config(const NR_ServingCellConfigCommon_t *scc, schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource)); *schedulingRequestResourceConfig->resource = *pucchressetid; - ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig); + asn1cSeqAdd(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig); } void set_dl_mcs_table(int scs, @@ -1029,13 +1030,13 @@ struct NR_SetupRelease_PUSCH_Config *config_pusch(NR_PUSCH_Config_t *pusch_Confi *aset->p0 = 0; aset->alpha = calloc(1, sizeof(*aset->alpha)); *aset->alpha = NR_Alpha_alpha1; - ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->p0_AlphaSets->list, aset); + asn1cSeqAdd(&pusch_Config->pusch_PowerControl->p0_AlphaSets->list, aset); pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList = calloc(1, sizeof(*pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList)); NR_PUSCH_PathlossReferenceRS_t *plrefRS = calloc(1, sizeof(*plrefRS)); plrefRS->pusch_PathlossReferenceRS_Id = 0; plrefRS->referenceSignal.present = NR_PUSCH_PathlossReferenceRS__referenceSignal_PR_ssb_Index; plrefRS->referenceSignal.choice.ssb_Index = 0; - ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList->list, plrefRS); + asn1cSeqAdd(&pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList->list, plrefRS); pusch_Config->pusch_PowerControl->pathlossReferenceRSToReleaseList = NULL; pusch_Config->pusch_PowerControl->twoPUSCH_PC_AdjustmentStates = NULL; pusch_Config->pusch_PowerControl->deltaMCS = calloc(1, sizeof(*pusch_Config->pusch_PowerControl->deltaMCS)); @@ -1091,17 +1092,18 @@ struct NR_SetupRelease_PDSCH_Config *config_pdsch(uint64_t ssb_bitmap, int bwp_I *pdsch_Config->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband; int n_ssb = 0; + if (!pdsch_Config->tci_StatesToAddModList) + pdsch_Config->tci_StatesToAddModList=calloc(1,sizeof(*pdsch_Config->tci_StatesToAddModList)); for (int i = 0; i < 64; i++) { if (((ssb_bitmap >> (63 - i)) & 0x01) == 0) continue; - NR_TCI_State_t *tcid = calloc(1, sizeof(*tcid)); + asn1cSequenceAdd(pdsch_Config->tci_StatesToAddModList->list, NR_TCI_State_t, tcid); tcid->tci_StateId = n_ssb++; tcid->qcl_Type1.cell = NULL; asn1cCallocOne(tcid->qcl_Type1.bwp_Id, bwp_Id); tcid->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb; tcid->qcl_Type1.referenceSignal.choice.ssb = i; tcid->qcl_Type1.qcl_Type = NR_QCL_Info__qcl_Type_typeC; - ASN_SEQUENCE_ADD(&pdsch_Config->tci_StatesToAddModList->list, tcid); } return setup_pdsch_Config; } @@ -1147,7 +1149,7 @@ void config_downlinkBWP(NR_BWP_Downlink_t *bwp, bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList=calloc(1,sizeof(*bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList)); NR_SearchSpace_t *ss = rrc_searchspace_config(true, 5+bwp->bwp_Id, coreset->controlResourceSetId); - ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list,ss); + asn1cSeqAdd(&bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list,ss); bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=NULL; bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation=NULL; @@ -1177,11 +1179,11 @@ void config_downlinkBWP(NR_BWP_Downlink_t *bwp, bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList)); bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList = calloc(1,sizeof(*bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList)); - ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list, coreset); + asn1cSeqAdd(&bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list, coreset); bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList)); NR_SearchSpace_t *ss2 = rrc_searchspace_config(false, 10+bwp->bwp_Id, coreset->controlResourceSetId); - ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list, ss2); + asn1cSeqAdd(&bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list, ss2); bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToReleaseList = NULL; bwp->bwp_Dedicated->pdsch_Config = config_pdsch(ssb_bitmap, bwp->bwp_Id, dl_antenna_ports); @@ -1463,7 +1465,7 @@ void config_csi_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig, csirep->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep->reportConfigType.choice.periodic = calloc(1, sizeof(*csirep->reportConfigType.choice.periodic)); set_csi_meas_periodicity(servingcellconfigcommon, csirep, uid, false); - ASN_SEQUENCE_ADD(&csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list, pucchcsires); + asn1cSeqAdd(&csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list, pucchcsires); csirep->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; csirep->reportQuantity.choice.cri_RI_PMI_CQI = (NULL_t)0; csirep->reportFreqConfiguration = calloc(1, sizeof(*csirep->reportFreqConfiguration)); @@ -1488,7 +1490,7 @@ void config_csi_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig, csirep->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; csirep->non_PMI_PortIndication = NULL; csirep->ext1 = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list, csirep); + asn1cSeqAdd(&csi_MeasConfig->csi_ReportConfigToAddModList->list, csirep); } void config_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig, @@ -1523,7 +1525,7 @@ void config_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig, csirep->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep->reportConfigType.choice.periodic = calloc(1, sizeof(*csirep->reportConfigType.choice.periodic)); set_csi_meas_periodicity(servingcellconfigcommon, csirep, uid, true); - ASN_SEQUENCE_ADD(&csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list, pucchcsires); + asn1cSeqAdd(&csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list, pucchcsires); if (do_csi) { csirep->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP; csirep->reportQuantity.choice.cri_RSRP = (NULL_t)0; @@ -1535,5 +1537,5 @@ void config_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig, csirep->groupBasedBeamReporting.choice.disabled = calloc(1, sizeof(*csirep->groupBasedBeamReporting.choice.disabled)); csirep->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1, sizeof(*csirep->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); *csirep->groupBasedBeamReporting.choice.disabled->nrofReportedRS = NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list, csirep); + asn1cSeqAdd(&csi_MeasConfig->csi_ReportConfigToAddModList->list, csirep); } diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index d100750eac..85eccc5e53 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -32,14 +32,7 @@ #define __NR_RRC_CONFIG_H__ #include "nr_rrc_defs.h" - -#define asn1cCallocOne(VaR, VaLue) \ - VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue; -#define asn1cCalloc(VaR, lOcPtr) \ - typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR)); -#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \ - TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \ - ASN_SEQUENCE_ADD(&VaR,lOcPtr); +#include "openair2/RRC/NR/MESSAGES/asn1_msg.h" void set_phr_config(NR_MAC_CellGroupConfig_t *mac_CellGroupConfig); uint64_t get_ssb_bitmap(const NR_ServingCellConfigCommon_t *scc); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c old mode 100755 new mode 100644 index edc4a8dcfb..5a0a138c66 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -39,7 +39,7 @@ #include "nr_rrc_extern.h" #include "assertions.h" #include "common/ran_context.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "rrc_gNB_radio_bearers.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" @@ -537,8 +537,8 @@ rrc_gNB_generate_defaultRRCReconfiguration( memset(*SRB_configList2, 0, sizeof(**SRB_configList2)); SRB2_config = CALLOC(1, sizeof(*SRB2_config)); SRB2_config->srb_Identity = 2; - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config);*/ + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config);*/ /* Configure DRB */ /*DRB_configList = &ue_context_pP->ue_context.DRB_configList; @@ -586,8 +586,8 @@ rrc_gNB_generate_defaultRRCReconfiguration( *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms100; DRB_config->pdcp_Config->ext1 = NULL; - ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);*/ + asn1cSeqAdd(&(*DRB_configList)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config);*/ dedicatedNAS_MessageList = CALLOC(1, sizeof(struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList)); @@ -599,7 +599,7 @@ rrc_gNB_generate_defaultRRCReconfiguration( OCTET_STRING_fromBuf(dedicatedNAS_Message, (char *)ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer, ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); + asn1cSeqAdd(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); } ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_DONE; @@ -613,7 +613,7 @@ rrc_gNB_generate_defaultRRCReconfiguration( OCTET_STRING_fromBuf(dedicatedNAS_Message, (char *)ue_context_pP->ue_context.nas_pdu.buffer, ue_context_pP->ue_context.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); + asn1cSeqAdd(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); } /* If list is empty free the list and reset the address */ @@ -878,8 +878,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( rrc->security.do_drb_integrity, rrc->security.do_drb_ciphering); if (drb_id_to_setup_start == 0) drb_id_to_setup_start = DRB_config->drb_Identity; - ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); } } } @@ -893,7 +893,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( OCTET_STRING_fromBuf(dedicatedNAS_Message, (char *)ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer, ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); + asn1cSeqAdd(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); LOG_I(NR_RRC,"add NAS info with size %d (pdusession id %d)\n",ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length, i); } else { @@ -1078,7 +1078,7 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( ); } - ASN_SEQUENCE_ADD(&DRB_configList2->list, DRB_config); + asn1cSeqAdd(&DRB_configList2->list, DRB_config); ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_DONE; ue_context_pP->ue_context.modify_pdusession[i].xid = xid; @@ -1089,7 +1089,7 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( OCTET_STRING_fromBuf(dedicatedNAS_Message, (char *)ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer, ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.length); - ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); + asn1cSeqAdd(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); LOG_I(NR_RRC,"add NAS info with size %d (pdusession id %d)\n",ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length, ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id); @@ -1190,7 +1190,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( if((ue_context_pP->ue_context.pduSession[i].status == PDU_SESSION_STATUS_TORELEASE) && ue_context_pP->ue_context.pduSession[i].xid == xid) { DRB_release = CALLOC(1, sizeof(NR_DRB_Identity_t)); *DRB_release = i+1; - ASN_SEQUENCE_ADD(&(*DRB_Release_configList2)->list, DRB_release); + asn1cSeqAdd(&(*DRB_Release_configList2)->list, DRB_release); } } @@ -1202,7 +1202,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( OCTET_STRING_fromBuf(dedicatedNAS_Message, (char *)nas_buffer, nas_length); - ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); + asn1cSeqAdd(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); LOG_I(NR_RRC,"add NAS info with size %d\n", nas_length); } else { LOG_W(NR_RRC,"dedlicated NAS list is empty\n"); @@ -1565,8 +1565,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( if (SRB2_config != NULL) { // Add SRB2 to SRB configuration list - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); LOG_D(NR_RRC, "Add SRB2_config (srb_Identity:%ld) to ue_context_pP->ue_context.SRB_configList\n", SRB2_config->srb_Identity); LOG_D(NR_RRC, "Add SRB2_config (srb_Identity:%ld) to ue_context_pP->ue_context.SRB_configList2[%d]\n", @@ -1589,7 +1589,7 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( for (i = 0; (i < DRB_configList->list.count) && (i < 3); i++) { DRB_config = DRB_configList->list.array[i]; // Add DRB to DRB configuration list, for LTE_RRCConnectionReconfigurationComplete - ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); + asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); } } @@ -3194,7 +3194,7 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha for (int i=0; isrbs_to_be_setup_length; i++){ SRB2_config = CALLOC(1, sizeof(*SRB2_config)); SRB2_config->srb_Identity = req->srbs_to_be_setup[i].srb_id; - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); } } @@ -3214,7 +3214,7 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha DRB_config = CALLOC(1, sizeof(*DRB_config)); DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id; if (drb_id_to_setup_start == 0) drb_id_to_setup_start = DRB_config->drb_Identity; - ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config); + asn1cSeqAdd(&DRB_configList->list, DRB_config); f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i]; transport_layer_addr_t addr; memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address)); @@ -3335,7 +3335,7 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co for (int i=0; isrbs_to_be_setup_length; i++){ SRB2_config = CALLOC(1, sizeof(*SRB2_config)); SRB2_config->srb_Identity = req->srbs_to_be_setup[i].srb_id; - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); } } @@ -3353,7 +3353,7 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co DRB_config = CALLOC(1, sizeof(*DRB_config)); DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id; if (drb_id_to_setup_start == 0) drb_id_to_setup_start = DRB_config->drb_Identity; - ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config); + asn1cSeqAdd(&DRB_configList->list, DRB_config); f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i]; transport_layer_addr_t addr; memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address)); @@ -3486,7 +3486,7 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, const ch if(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList != NULL){ int ue_ctxt_rlc_Bearers = ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list.count; for(int i=ue_ctxt_rlc_Bearers; irlc_BearerToAddModList->list.count; i++){ - ASN_SEQUENCE_ADD(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list, + asn1cSeqAdd(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list, cellGroupConfig->rlc_BearerToAddModList->list.array[i-ue_ctxt_rlc_Bearers]); } } @@ -3543,7 +3543,7 @@ static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, c if(ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList != NULL){ int ue_ctxt_rlc_Bearers = ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list.count; for(int i=ue_ctxt_rlc_Bearers; irlc_BearerToAddModList->list.count; i++){ - ASN_SEQUENCE_ADD(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list, + asn1cSeqAdd(&ue_context_p->ue_context.masterCellGroup->rlc_BearerToAddModList->list, cellGroupConfig->rlc_BearerToAddModList->list.array[i-ue_ctxt_rlc_Bearers]); } } diff --git a/openair2/RRC/NR/rrc_gNB_GTPV1U.c b/openair2/RRC/NR/rrc_gNB_GTPV1U.c index 3556074b97..ec220172d0 100644 --- a/openair2/RRC/NR/rrc_gNB_GTPV1U.c +++ b/openair2/RRC/NR/rrc_gNB_GTPV1U.c @@ -35,7 +35,7 @@ # include "openair2/RRC/NR/rrc_gNB_UE_context.h" //# if defined(ENABLE_ITTI) -# include "asn1_conversions.h" +# include "oai_asn1.h" # include "intertask_interface.h" //#endif diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 8e9d3f7939..3eccf0ef37 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -34,7 +34,7 @@ #include "gnb_config.h" #include "common/ran_context.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "intertask_interface.h" #include "pdcp.h" #include "pdcp_primitives.h" diff --git a/openair2/RRC/NR/rrc_gNB_radio_bearers.c b/openair2/RRC/NR/rrc_gNB_radio_bearers.c index 6c8f2ecdda..9c3b6aada0 100644 --- a/openair2/RRC/NR/rrc_gNB_radio_bearers.c +++ b/openair2/RRC/NR/rrc_gNB_radio_bearers.c @@ -20,6 +20,7 @@ */ #include "rrc_gNB_radio_bearers.h" +#include "oai_asn1.h" NR_SRB_ToAddMod_t *generateSRB2() { NR_SRB_ToAddMod_t *SRB2_config = NULL; @@ -40,8 +41,8 @@ NR_SRB_ToAddModList_t **generateSRB2_confList(gNB_RRC_UE_t *ue, *SRB_configList2 = CALLOC(1, sizeof(**SRB_configList2)); memset(*SRB_configList2, 0, sizeof(**SRB_configList2)); NR_SRB_ToAddMod_t *SRB2_config = generateSRB2(); - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); + asn1cSeqAdd(&(*SRB_configList2)->list, SRB2_config); + asn1cSeqAdd(&SRB_configList->list, SRB2_config); } return SRB_configList2; @@ -83,7 +84,7 @@ NR_DRB_ToAddMod_t *generateDRB(gNB_RRC_UE_t *ue, { NR_QFI_t *qfi = calloc(1, sizeof(NR_QFI_t)); *qfi = pduSession->param.qos[qos_flow_index].qfi; - ASN_SEQUENCE_ADD(&SDAP_config->mappedQoS_FlowsToAdd->list, qfi); + asn1cSeqAdd(&SDAP_config->mappedQoS_FlowsToAdd->list, qfi); if(pduSession->param.qos[qos_flow_index].fiveQI > 5) ue->pduSession[pduSession->param.pdusession_id].param.used_drbs[drb_id-1] = DRB_ACTIVE_NONGBR; @@ -156,4 +157,4 @@ bool drb_is_active(gNB_RRC_UE_t *ue, uint8_t drb_id) { if(ue->DRB_active[drb_id-1] == DRB_ACTIVE) return true; return false; -} \ No newline at end of file +} diff --git a/openair2/RRC/NR/rrc_gNB_radio_bearers.h b/openair2/RRC/NR/rrc_gNB_radio_bearers.h index 729b5b7819..a686fed767 100644 --- a/openair2/RRC/NR/rrc_gNB_radio_bearers.h +++ b/openair2/RRC/NR/rrc_gNB_radio_bearers.h @@ -49,4 +49,4 @@ NR_DRB_ToAddMod_t *generateDRB(gNB_RRC_UE_t *rrc_ue, uint8_t next_available_drb(gNB_RRC_UE_t *ue, uint8_t pdusession_id, bool is_gbr); bool drb_is_active(gNB_RRC_UE_t *ue, uint8_t drb_id); -#endif \ No newline at end of file +#endif diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 159144b406..09330ff54e 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -41,6 +41,7 @@ #include "NR_RLC-BearerConfig.h" #include "BOOLEAN.h" #include "assertions.h" +#include "oai_asn1.h" #include "common/utils/nr/nr_common.h" #include "SIMULATION/TOOLS/sim.h" #include "executables/softmodem-common.h" @@ -116,7 +117,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig); secondaryCellGroup->rlc_BearerToAddModList = calloc(1,sizeof(*secondaryCellGroup->rlc_BearerToAddModList)); - ASN_SEQUENCE_ADD(&secondaryCellGroup->rlc_BearerToAddModList->list, RLC_BearerConfig); + asn1cSeqAdd(&secondaryCellGroup->rlc_BearerToAddModList->list, RLC_BearerConfig); NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = secondaryCellGroup->mac_CellGroupConfig; @@ -132,7 +133,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco struct NR_TAG *tag=calloc(1,sizeof(*tag)); tag->tag_Id = 0; tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity; - ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag); + asn1cSeqAdd(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag); set_phr_config(mac_CellGroupConfig); mac_CellGroupConfig->skipUplinkTxDynamic=false; mac_CellGroupConfig->ext1 = NULL; @@ -180,7 +181,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ssbElem[n_ssb] = calloc(1,sizeof(struct NR_CFRA_SSB_Resource)); ssbElem[n_ssb]->ssb = i; ssbElem[n_ssb]->ra_PreambleIndex = 63 - (uid % 64); - ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list,ssbElem[n_ssb]); + asn1cSeqAdd(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list,ssbElem[n_ssb]); n_ssb++; } } @@ -263,7 +264,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco dl_antenna_ports, configuration->force_256qam_off, bwp_loop, false); - ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp); + asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp); } secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id)); *secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = servingcellconfigdedicated->firstActiveDownlinkBWP_Id ? *servingcellconfigdedicated->firstActiveDownlinkBWP_Id : 1; @@ -285,7 +286,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco servingcellconfigdedicated, servingcellconfigcommon, uecap); - ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list,ubwp); + asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list,ubwp); } secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id)); *secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id : 1; @@ -301,7 +302,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco schedulingrequestlist->schedulingRequestId = 0; schedulingrequestlist->sr_ProhibitTimer = NULL; schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64; - ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist); + asn1cSeqAdd(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist); secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig)); NR_PUSCH_ServingCellConfig_t *pusch_scc = calloc(1,sizeof(*pusch_scc)); @@ -356,10 +357,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco if ((bitmap >> (63 - i)) & 0x01) { NR_SSB_Index_t *ssbres = NULL; asn1cCallocOne(ssbres, i); - ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list, ssbres); + asn1cSeqAdd(&ssbresset0->csi_SSB_ResourceList.list, ssbres); } } - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); + asn1cSeqAdd(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); for (int bwp_loop = 0; bwp_loop < n_dl_bwp; bwp_loop++) { @@ -377,10 +378,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)); NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0)); *nzp0 = bwp_loop; - ASN_SEQUENCE_ADD(&csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); + asn1cSeqAdd(&csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); csires->bwp_Id = bwp->bwp_Id; csires->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires); + asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires); } if (do_csirs && dl_antenna_ports > 1) { NR_CSI_ResourceConfig_t *csiresim = calloc(1,sizeof(*csiresim)); @@ -389,10 +390,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csiresim->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csiresim->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); *csiim00 = bwp_loop; - ASN_SEQUENCE_ADD(&csiresim->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + asn1cSeqAdd(&csiresim->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); csiresim->bwp_Id = bwp->bwp_Id; csiresim->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csiresim); + asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csiresim); } NR_CSI_ResourceConfig_t *ssbres = calloc(1,sizeof(*ssbres)); ssbres->csi_ResourceConfigId = bwp->bwp_Id+20; @@ -401,10 +402,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList)); NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00)); *ssbres00 = 0; - ASN_SEQUENCE_ADD(&ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00); + asn1cSeqAdd(&ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00); ssbres->bwp_Id = bwp->bwp_Id; ssbres->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,ssbres); + asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,ssbres); NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1)); pucchcsires1->uplinkBandwidthPartId = bwp->bwp_Id; @@ -501,7 +502,7 @@ void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig, *drb_ToAddMod->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0; drb_ToAddMod->pdcp_Config->ext1 = NULL; - ASN_SEQUENCE_ADD(&rbconfig->drb_ToAddModList->list,drb_ToAddMod); + asn1cSeqAdd(&rbconfig->drb_ToAddModList->list,drb_ToAddMod); rbconfig->drb_ToReleaseList = NULL; @@ -529,10 +530,10 @@ void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, int *ptrsNrb, int *ptrsMc bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->resourceElementOffset = calloc(1,sizeof(long)); /* Fill the given values */ for(i = 0; i < 2; i++) { - ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list,&ptrsNrb[i]); + asn1cSeqAdd(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list,&ptrsNrb[i]); } for(i = 0; i < 3; i++) { - ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list,&ptrsMcs[i]); + asn1cSeqAdd(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list,&ptrsMcs[i]); } }// if memory exist then over write the old values else { diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 0441478ce6..a9c03885f7 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -33,7 +33,7 @@ #define RRC_UE #define RRC_UE_C -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "NR_DL-DCCH-Message.h" //asn_DEF_NR_DL_DCCH_Message #include "NR_DL-CCCH-Message.h" //asn_DEF_NR_DL_CCCH_Message @@ -2515,7 +2515,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( NR_BandNR_t *nr_bandnr; nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); nr_bandnr->bandNR = 1; - ASN_SEQUENCE_ADD(&UE_Capability_nr->rf_Parameters.supportedBandListNR.list, + asn1cSeqAdd(&UE_Capability_nr->rf_Parameters.supportedBandListNR.list, nr_bandnr); } OAI_NR_UECapability_t *UECap; @@ -2559,7 +2559,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry( for (i=0; icriticalExtensions.choice.ueCapabilityEnquiry->ue_CapabilityRAT_RequestList.list.count; i++) { if (UECapabilityEnquiry->criticalExtensions.choice.ueCapabilityEnquiry->ue_CapabilityRAT_RequestList.list.array[i]->rat_Type == NR_RAT_Type_nr) { - ASN_SEQUENCE_ADD( + asn1cSeqAdd( &ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation->criticalExtensions.choice.ueCapabilityInformation->ue_CapabilityRAT_ContainerList->list, &ue_CapabilityRAT_Container); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_DCCH_Message, NULL, (void *) &ul_dcch_msg, buffer, 500); @@ -2651,7 +2651,7 @@ static void nsa_rrc_ue_process_ueCapabilityEnquiry(void) NR_UE_NR_Capability_t *UE_Capability_nr = CALLOC(1, sizeof(NR_UE_NR_Capability_t)); NR_BandNR_t *nr_bandnr = CALLOC(1, sizeof(NR_BandNR_t)); nr_bandnr->bandNR = 78; - ASN_SEQUENCE_ADD(&UE_Capability_nr->rf_Parameters.supportedBandListNR.list, nr_bandnr); + asn1cSeqAdd(&UE_Capability_nr->rf_Parameters.supportedBandListNR.list, nr_bandnr); OAI_NR_UECapability_t *UECap = CALLOC(1, sizeof(OAI_NR_UECapability_t)); UECap->UE_NR_Capability = UE_Capability_nr; diff --git a/openair2/X2AP/x2ap_common.h b/openair2/X2AP/x2ap_common.h index e7b86c77b9..e35fd30adf 100644 --- a/openair2/X2AP/x2ap_common.h +++ b/openair2/X2AP/x2ap_common.h @@ -20,7 +20,7 @@ */ #ifndef X2AP_COMMON_H_ #define X2AP_COMMON_H_ - +#include "oai_asn1.h" #include "X2AP_ProtocolIE-Field.h" #include "X2AP_X2AP-PDU.h" #include "X2AP_InitiatingMessage.h" diff --git a/openair2/X2AP/x2ap_eNB_generate_messages.c b/openair2/X2AP/x2ap_eNB_generate_messages.c index be5ab82740..09cf85c527 100644 --- a/openair2/X2AP/x2ap_eNB_generate_messages.c +++ b/openair2/X2AP/x2ap_eNB_generate_messages.c @@ -84,7 +84,7 @@ int x2ap_eNB_generate_x2_setup_request( ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0], ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_X2SetupRequest_IEs_t *)calloc(1, sizeof(X2AP_X2SetupRequest_IEs_t)); @@ -106,7 +106,7 @@ int x2ap_eNB_generate_x2_setup_request( plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t)); { MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); + asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); } if (instance_p->frame_type[i] == FDD) { @@ -232,10 +232,10 @@ int x2ap_eNB_generate_x2_setup_request( } } } - ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); + asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); } } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_X2SetupRequest_IEs_t *)calloc(1, sizeof(X2AP_X2SetupRequest_IEs_t)); @@ -250,9 +250,9 @@ int x2ap_eNB_generate_x2_setup_request( //@TODO: consider to update this value INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); } - ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); + asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode X2 setup request\n"); @@ -302,7 +302,7 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0], ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_X2SetupResponse_IEs_t *)calloc(1, sizeof(X2AP_X2SetupResponse_IEs_t)); @@ -328,7 +328,7 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t)); { MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); + asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); } if (instance_p->frame_type[i] == FDD) { @@ -454,10 +454,10 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN } } } - ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); + asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); } } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_X2SetupResponse_IEs_t *)calloc(1, sizeof(X2AP_X2SetupResponse_IEs_t)); @@ -472,9 +472,9 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN //@TODO: consider to update this value INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); } - ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); + asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode X2 setup response\n"); @@ -518,7 +518,7 @@ int x2ap_eNB_generate_x2_setup_failure(instance_t instance, x2ap_eNB_set_cause (&ie->value.choice.Cause, cause_type, cause_value); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional: consider to handle this later */ ie = (X2AP_X2SetupFailure_IEs_t *)calloc(1, sizeof(X2AP_X2SetupFailure_IEs_t)); @@ -530,7 +530,7 @@ int x2ap_eNB_generate_x2_setup_failure(instance_t instance, ie->value.choice.TimeToWait = time_to_wait; } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode X2 setup failure\n"); @@ -606,7 +606,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_HandoverRequest_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = x2ap_id_get_id_source(&instance_p->id_manager, ue_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequest_IEs_t)); @@ -615,7 +615,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap ie->value.present = X2AP_HandoverRequest_IEs__value_PR_Cause; ie->value.choice.Cause.present = X2AP_Cause_PR_radioNetwork; ie->value.choice.Cause.choice.radioNetwork = X2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequest_IEs_t)); @@ -625,7 +625,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, &ie->value.choice.ECGI.pLMN_Identity); MACRO_ENB_ID_TO_CELL_IDENTITY(x2ap_eNB_data_p->eNB_id, 0, &ie->value.choice.ECGI.eUTRANcellIdentifier); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequest_IEs_t)); @@ -637,7 +637,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap //@TODO: consider to update these values INT16_TO_OCTET_STRING(x2ap_handover_req->ue_gummei.mme_group_id, &ie->value.choice.GUMMEI.gU_Group_ID.mME_Group_ID); MME_CODE_TO_OCTET_STRING(x2ap_handover_req->ue_gummei.mme_code, &ie->value.choice.GUMMEI.mME_Code); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequest_IEs_t)); @@ -689,13 +689,13 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap INT32_TO_OCTET_STRING(x2ap_handover_req->e_rabs_tobesetup[i].gtp_teid,&e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.gTP_TEID); } - ASN_SEQUENCE_ADD(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); + asn1cSeqAdd(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); } } OCTET_STRING_fromBuf(&ie->value.choice.UE_ContextInformation.rRC_Context, (char*) x2ap_handover_req->rrc_buffer, x2ap_handover_req->rrc_buffer_size); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequest_IEs_t)); @@ -711,10 +711,10 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap MACRO_ENB_ID_TO_CELL_IDENTITY(0, 0, &lastVisitedCell_Item->choice.e_UTRAN_Cell.global_Cell_ID.eUTRANcellIdentifier); lastVisitedCell_Item->choice.e_UTRAN_Cell.cellType.cell_Size = X2AP_Cell_Size_small; lastVisitedCell_Item->choice.e_UTRAN_Cell.time_UE_StayedInCell = 2; - ASN_SEQUENCE_ADD(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); + asn1cSeqAdd(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode X2 handover request\n"); @@ -765,7 +765,7 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, ie->criticality = X2AP_Criticality_ignore; ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = id_source; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequestAcknowledge_IEs_t)); @@ -773,7 +773,7 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, ie->criticality = X2AP_Criticality_ignore; ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID_1; ie->value.choice.UE_X2AP_ID_1 = id_target; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequestAcknowledge_IEs_t)); @@ -812,11 +812,11 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, INT32_TO_OCTET_STRING(x2ap_handover_req_ack->e_rabs_tobesetup[i].gtp_teid, &e_RABs_Admitted_Item->dL_GTP_TunnelEndpoint->gTP_TEID); } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); + asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); } } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequestAcknowledge_IEs_t)); @@ -826,7 +826,7 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, OCTET_STRING_fromBuf(&ie->value.choice.TargeteNBtoSource_eNBTransparentContainer, (char*) x2ap_handover_req_ack->rrc_buffer, x2ap_handover_req_ack->rrc_buffer_size); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode X2 handover response\n"); @@ -878,7 +878,7 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2 ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = id_source; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(X2AP_UEContextRelease_IEs_t)); @@ -886,7 +886,7 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2 ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID_1; ie->value.choice.UE_X2AP_ID_1 = id_target; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode X2 UE Context Release\n"); @@ -935,7 +935,7 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_ ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = id_source; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (id_target != -1) { @@ -944,7 +944,7 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_ ie->criticality = X2AP_Criticality_ignore; ie->value.present = X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID_1; ie->value.choice.UE_X2AP_ID_1 = id_target; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -968,7 +968,7 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_ X2AP_ERROR("unhandled cancel cause\n"); exit(1); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode X2 Handover Cancel\n"); @@ -1009,7 +1009,7 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2 ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = 0; /* TODO */ - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* id-UE-SecurityCapabilities - conditional - criticality reject */ /* TODO */ @@ -1030,7 +1030,7 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2 LOG_E(X2AP, "%s:%d:%s: fatal asn1 error\n", __FILE__, __LINE__, __FUNCTION__); exit(1); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* id-ServingPLMN - optional - criticality ignore */ /* TODO */ @@ -1041,7 +1041,7 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2 ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_List; /* TODO: set value of ie->value.choice.E_RABs_ToBeAdded_List.list */ - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* id-MeNBtoSeNBContainer - mandatory - criticality reject */ ie = (X2AP_SeNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequest_IEs_t)); @@ -1049,7 +1049,7 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2 ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_ProtocolIE_ID_id_MeNBtoSeNBContainer; /* TODO: set value of ie->value.choice.MeNBtoSeNBContainer */ - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* id-CSGMembershipStatus - optional - criticality reject */ /* TODO */ @@ -1115,7 +1115,7 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_SeNBAdditionRequestAcknowledge_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = 0; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_SeNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequestAcknowledge_IEs_t)); @@ -1123,7 +1123,7 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_SeNBAdditionRequestAcknowledge_IEs__value_PR_UE_X2AP_ID_1; ie->value.choice.UE_X2AP_ID_1 = 0; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_SeNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequestAcknowledge_IEs_t)); @@ -1153,7 +1153,7 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p e_RABs_Admitted_ToBeAdded_Item->choice.sCG_Bearer.s1_DL_GTPtunnelEndpoint.transportLayerAddress.size); } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_ToBeAdded_List.list, e_RABS_Admitted_ToBeAdded_ItemIEs); + asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_ToBeAdded_List.list, e_RABS_Admitted_ToBeAdded_ItemIEs); } // Split bearers to be added @@ -1177,12 +1177,12 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p e_RABs_Admitted_ToBeAdded_Item->choice.split_Bearer.seNB_GTPtunnelEndpoint.transportLayerAddress.size); } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_ToBeAdded_List.list, e_RABS_Admitted_ToBeAdded_ItemIEs); + asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_ToBeAdded_List.list, e_RABS_Admitted_ToBeAdded_ItemIEs); } } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (X2AP_SeNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequestAcknowledge_IEs_t)); @@ -1192,7 +1192,7 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p OCTET_STRING_fromBuf(&ie->value.choice.SeNBtoMeNBContainer, (char*) x2ap_addition_req_ack->rrc_buffer, x2ap_addition_req_ack->rrc_buffer_size); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode SeNB addition response\n"); @@ -1254,7 +1254,7 @@ X2AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id, MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, &ie_GNB_ENDC->value.choice.GlobalGNB_ID.pLMN_Identity); - ASN_SEQUENCE_ADD(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list, ie_GNB_ENDC); + asn1cSeqAdd(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list, ie_GNB_ENDC); ie_GNB_ENDC = (X2AP_En_gNB_ENDCX2SetupReqIEs_t *)calloc(1, sizeof(X2AP_En_gNB_ENDCX2SetupReqIEs_t)); ie_GNB_ENDC->id = X2AP_ProtocolIE_ID_id_ServedNRcellsENDCX2ManagementList; @@ -1284,7 +1284,7 @@ MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t)); { MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.broadcastPLMNs.list, plmn); + asn1cSeqAdd(&servedCellMember->servedNRCellInfo.broadcastPLMNs.list, plmn); } if (instance_p->frame_type[i] == TDD) { X2AP_FreqBandNrItem_t *freq_band; @@ -1296,7 +1296,7 @@ MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length exit(1); freq_band->freqBandIndicatorNr = instance_p->nr_band[i]; - ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nRFreqInfo.freqBandListNr, freq_band); + asn1cSeqAdd(&servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nRFreqInfo.freqBandListNr, freq_band); switch (instance_p->N_RB_DL[i]) { case 24: servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb24; @@ -1334,13 +1334,13 @@ MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length /*Don't know where to extract the value of measurementTimingConfiguration from. Set it to 0 for now */ INT8_TO_OCTET_STRING(0, &servedCellMember->servedNRCellInfo.measurementTimingConfiguration); } - ASN_SEQUENCE_ADD(&ie_GNB_ENDC->value.choice.ServedNRcellsENDCX2ManagementList.list, servedCellMember); + asn1cSeqAdd(&ie_GNB_ENDC->value.choice.ServedNRcellsENDCX2ManagementList.list, servedCellMember); } } - ASN_SEQUENCE_ADD(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list, ie_GNB_ENDC); + asn1cSeqAdd(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list, ie_GNB_ENDC); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 setup request\n"); @@ -1394,7 +1394,7 @@ int x2ap_eNB_generate_ENDC_x2_setup_response( MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, &ie_ENB_ENDC->value.choice.GlobalENB_ID.pLMN_Identity); - ASN_SEQUENCE_ADD(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list, ie_ENB_ENDC); + asn1cSeqAdd(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list, ie_ENB_ENDC); ie_ENB_ENDC = (X2AP_ENB_ENDCX2SetupReqAckIEs_t *)calloc(1, sizeof(X2AP_ENB_ENDCX2SetupReqAckIEs_t)); ie_ENB_ENDC->id = X2AP_ProtocolIE_ID_id_ServedEUTRAcellsENDCX2ManagementList; @@ -1416,7 +1416,7 @@ int x2ap_eNB_generate_ENDC_x2_setup_response( plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t)); { MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - ASN_SEQUENCE_ADD(&servedCellMember->servedEUTRACellInfo.broadcastPLMNs.list, plmn); + asn1cSeqAdd(&servedCellMember->servedEUTRACellInfo.broadcastPLMNs.list, plmn); } if (instance_p->frame_type[i] == FDD) { @@ -1543,13 +1543,13 @@ int x2ap_eNB_generate_ENDC_x2_setup_response( } } } - ASN_SEQUENCE_ADD(&ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list, servedCellMember); + asn1cSeqAdd(&ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list, servedCellMember); } } - ASN_SEQUENCE_ADD(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list, ie_ENB_ENDC); + asn1cSeqAdd(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list, ie_ENB_ENDC); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 setup response\n"); @@ -1614,7 +1614,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = x2ap_id_get_id_source(&instance_p->id_manager, ue_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_NRUESecurityCapabilities; @@ -1622,14 +1622,14 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_NRUESecurityCapabilities; INT16_TO_BIT_STRING(nRencryptionAlgorithms, &ie->value.choice.NRUESecurityCapabilities.nRencryptionAlgorithms); INT16_TO_BIT_STRING(nRintegrityProtectionAlgorithms, &ie->value.choice.NRUESecurityCapabilities.nRintegrityProtectionAlgorithms); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_SgNBSecurityKey; ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_SgNBSecurityKey; KENB_STAR_TO_BIT_STRING(SgNBSecurityKey, &ie->value.choice.SgNBSecurityKey); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_SgNBUEAggregateMaximumBitRate; @@ -1643,7 +1643,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( INT32_TO_BUFFER(uEaggregateMaximumBitRateUplink, ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink.buf); ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink.size = 4; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t)); //Not sure if id should be X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_List or X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList @@ -1688,9 +1688,9 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( } } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_ToBeAdded_SgNBAddReqList.list, e_RABS_ToBeAdded_SgNBAddReq_ItemIEs); + asn1cSeqAdd(&ie->value.choice.E_RABs_ToBeAdded_SgNBAddReqList.list, e_RABS_ToBeAdded_SgNBAddReq_ItemIEs); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_MeNBtoSgNBContainer; @@ -1704,7 +1704,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( memcpy(ie->value.choice.MeNBtoSgNBContainer.buf, x2ap_ENDC_sgnb_addition_req->rrc_buffer, x2ap_ENDC_sgnb_addition_req->rrc_buffer_size); ie->value.choice.MeNBtoSgNBContainer.size = x2ap_ENDC_sgnb_addition_req->rrc_buffer_size; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n"); @@ -1759,7 +1759,7 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBAdditionRequestAcknowledge_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = x2ap_id_get_id_source(&instance_p->id_manager, ue_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); // SgNB_UE_X2AP_id ie = (X2AP_SgNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequestAcknowledge_IEs_t)); @@ -1767,7 +1767,7 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBAdditionRequestAcknowledge_IEs__value_PR_SgNB_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = x2ap_id_get_id_target(&instance_p->id_manager, ue_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequestAcknowledge_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList; @@ -1800,9 +1800,9 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in } } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList.list, e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs); + asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList.list, e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequestAcknowledge_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_SgNBtoMeNBContainer; @@ -1811,7 +1811,7 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in ie->value.choice.SgNBtoMeNBContainer.buf = (uint8_t *)calloc(x2ap_sgnb_addition_req_ACK->rrc_buffer_size, sizeof(uint8_t)); memcpy(ie->value.choice.SgNBtoMeNBContainer.buf, x2ap_sgnb_addition_req_ACK->rrc_buffer, x2ap_sgnb_addition_req_ACK->rrc_buffer_size); ie->value.choice.SgNBtoMeNBContainer.size = x2ap_sgnb_addition_req_ACK->rrc_buffer_size; //4096; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n"); @@ -1855,14 +1855,14 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_reconfiguration_complete( ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBReconfigurationComplete_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = x2ap_id_get_id_source(&instance_p->id_manager, ue_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBReconfigurationComplete_IEs_t *)calloc(1, sizeof(X2AP_SgNBReconfigurationComplete_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID; ie->criticality = X2AP_Criticality_reject; ie->value.present = X2AP_SgNBReconfigurationComplete_IEs__value_PR_SgNB_UE_X2AP_ID; ie->value.choice.SgNB_UE_X2AP_ID = SgNB_ue_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBReconfigurationComplete_IEs_t *)calloc(1, sizeof(X2AP_SgNBReconfigurationComplete_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_ResponseInformationSgNBReconfComp; @@ -1871,7 +1871,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_reconfiguration_complete( ie->value.choice.ResponseInformationSgNBReconfComp.present = X2AP_ResponseInformationSgNBReconfComp_PR_success_SgNBReconfComp; // meNBtoSgNBContainer should contain the RRCReconfigurationComplete message from the UE but in the specs 36.423(9.1.4.4) its presence is not mandatory ie->value.choice.ResponseInformationSgNBReconfComp.choice.success_SgNBReconfComp.meNBtoSgNBContainer = NULL; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n"); @@ -1911,7 +1911,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_release_request( ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBReleaseRequest_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = x2_id_source; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2_id_target != -1) { ie = (X2AP_SgNBReleaseRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBReleaseRequest_IEs_t)); @@ -1919,7 +1919,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_release_request( ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBReleaseRequest_IEs__value_PR_SgNB_UE_X2AP_ID; ie->value.choice.SgNB_UE_X2AP_ID = x2_id_target; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } ie = (X2AP_SgNBReleaseRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBReleaseRequest_IEs_t)); @@ -1939,7 +1939,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_release_request( X2AP_ERROR("%s: unhandled cause %d\n", __FUNCTION__, cause); exit(1); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 SgNB_release_request message\n"); @@ -1980,14 +1980,14 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_release_request_acknowledge( ie->criticality= X2AP_Criticality_ignore; ie->value.present = X2AP_SgNBReleaseRequestAcknowledge_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = menb_ue_x2ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBReleaseRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBReleaseRequestAcknowledge_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID; ie->criticality= X2AP_Criticality_ignore; ie->value.present = X2AP_SgNBReleaseRequestAcknowledge_IEs__value_PR_SgNB_UE_X2AP_ID; ie->value.choice.SgNB_UE_X2AP_ID = sgnb_ue_x2ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 SgNB Release Request Acknowledge\n"); @@ -2027,14 +2027,14 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_release_required( ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBReleaseRequired_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = x2_id_source; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBReleaseRequired_IEs_t *)calloc(1, sizeof(X2AP_SgNBReleaseRequired_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID; ie->criticality= X2AP_Criticality_reject; ie->value.present = X2AP_SgNBReleaseRequired_IEs__value_PR_SgNB_UE_X2AP_ID; ie->value.choice.SgNB_UE_X2AP_ID = x2_id_target; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBReleaseRequired_IEs_t *)calloc(1, sizeof(X2AP_SgNBReleaseRequired_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_Cause; @@ -2049,7 +2049,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_release_required( X2AP_ERROR("%s: unhandled cause %d\n", __FUNCTION__, cause); exit(1); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 SgNB_release_request message\n"); @@ -2088,14 +2088,14 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_release_confirm( ie->criticality= X2AP_Criticality_ignore; ie->value.present = X2AP_SgNBReleaseConfirm_IEs__value_PR_UE_X2AP_ID; ie->value.choice.UE_X2AP_ID = menb_ue_x2ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (X2AP_SgNBReleaseConfirm_IEs_t *)calloc(1, sizeof(X2AP_SgNBReleaseConfirm_IEs_t)); ie->id = X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID; ie->criticality= X2AP_Criticality_ignore; ie->value.present = X2AP_SgNBReleaseConfirm_IEs__value_PR_SgNB_UE_X2AP_ID; ie->value.choice.SgNB_UE_X2AP_ID = sgnb_ue_x2ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { X2AP_ERROR("Failed to encode ENDC X2 SgNB Release Request Acknowledge\n"); diff --git a/openair2/X2AP/x2ap_eNB_handler.c b/openair2/X2AP/x2ap_eNB_handler.c index f70cd632aa..9d3fc9c0a4 100644 --- a/openair2/X2AP/x2ap_eNB_handler.c +++ b/openair2/X2AP/x2ap_eNB_handler.c @@ -30,8 +30,6 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" - #include "x2ap_common.h" #include "x2ap_eNB_defs.h" #include "x2ap_eNB_handler.h" diff --git a/openair3/M3AP/m3ap_MCE_generate_messsages.c b/openair3/M3AP/m3ap_MCE_generate_messsages.c index 4822a09db9..218fb965d3 100644 --- a/openair3/M3AP/m3ap_MCE_generate_messsages.c +++ b/openair3/M3AP/m3ap_MCE_generate_messsages.c @@ -84,7 +84,7 @@ int m2ap_eNB_generate_m2_setup_request( ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ///* mandatory */ ///* c2. GNB_eNB_ID (integrer value) */ @@ -93,7 +93,7 @@ int m2ap_eNB_generate_m2_setup_request( //ie->criticality = M2AP_Criticality_reject; //ie->value.present = M2AP_M2SetupRequestIEs__value_PR_GNB_eNB_ID; //asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, f1ap_du_data->gNB_eNB_id); - //ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + //asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c3. ENBname */ @@ -104,7 +104,7 @@ int m2ap_eNB_generate_m2_setup_request( ie->value.present = M2AP_M2SetupRequest_Ies__value_PR_ENBname; //OCTET_STRING_fromBuf(&ie->value.choice.ENB_Name, m2ap_eNB_data_p->eNB_name, //strlen(m2ap_eNB_data_p->eNB_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -138,7 +138,7 @@ int m2ap_eNB_generate_m2_setup_request( &mbms_configuration_data_item->eCGI.eUTRANcellIdentifier); M2AP_MBMS_Service_Area_t * mbms_service_area; mbms_service_area = (M2AP_MBMS_Service_Area_t*)calloc(1,sizeof(M2AP_MBMS_Service_Area_t)); - ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); + asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); } @@ -154,10 +154,10 @@ int m2ap_eNB_generate_m2_setup_request( //M2AP_MBMS_Service_Area_ID_List_t mbmsServiceAreaList; - ASN_SEQUENCE_ADD(&ie->value.choice.ENB_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); + asn1cSeqAdd(&ie->value.choice.ENB_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); LOG_W(M2AP,"m2ap_eNB_data_p->assoc_id %d\n",m2ap_eNB_data_p->assoc_id); /* encode */ @@ -214,7 +214,7 @@ int m2ap_eNB_generate_m2_setup_request( // // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0], // // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1], // // ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -236,7 +236,7 @@ int m2ap_eNB_generate_m2_setup_request( // // plmn = (M2AP_PLMN_Identity_t *)calloc(1,sizeof(M2AP_PLMN_Identity_t)); // // { // // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); -// // ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); +// // asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); // // } // // // if (instance_p->frame_type[i] == FDD) { @@ -277,10 +277,10 @@ int m2ap_eNB_generate_m2_setup_request( // // AssertFatal(0,"M2Setupresponse not supported for TDD!"); // // } // // } -// // ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); +// // asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); // // } // //} -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -295,9 +295,9 @@ int m2ap_eNB_generate_m2_setup_request( // // //@TODO: consider to update this value // // INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); // // } -// // ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); +// // asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); // //} -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode M2 setup response\n"); @@ -341,7 +341,7 @@ int m2ap_eNB_generate_m2_setup_request( // // //m2ap_eNB_set_cause (&ie->value.choice.Cause, cause_type, cause_value); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional: consider to handle this later */ // ie = (M2AP_M2SetupFailure_Ies_t *)calloc(1, sizeof(M2AP_M2SetupFailure_Ies_t)); @@ -353,7 +353,7 @@ int m2ap_eNB_generate_m2_setup_request( // // ie->value.choice.TimeToWait = time_to_wait; // //} // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode M2 setup failure\n"); @@ -429,7 +429,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = m2ap_id_get_id_source(&instance_p->id_manager, ue_id); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -438,7 +438,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_Cause; // ie->value.choice.Cause.present = M2AP_Cause_PR_radioNetwork; // ie->value.choice.Cause.choice.radioNetwork = M2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -448,7 +448,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, // &ie->value.choice.ECGI.pLMN_Identity); // MACRO_ENB_ID_TO_CELL_IDENTITY(m2ap_eNB_data_p->eNB_id, 0, &ie->value.choice.ECGI.eUTRANcellIdentifier); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -460,7 +460,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // //@TODO: consider to update these values // INT16_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_group_id, &ie->value.choice.GUMMEI.gU_Group_ID.mME_Group_ID); // MME_CODE_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_code, &ie->value.choice.GUMMEI.mME_Code); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -512,13 +512,13 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // // INT32_TO_OCTET_STRING(m2ap_handover_req->e_rabs_tobesetup[i].gtp_teid,&e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.gTP_TEID); // } -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); // } // } // // OCTET_STRING_fromBuf(&ie->value.choice.UE_ContextInformation.rRC_Context, (char*) m2ap_handover_req->rrc_buffer, m2ap_handover_req->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -534,10 +534,10 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // MACRO_ENB_ID_TO_CELL_IDENTITY(0, 0, &lastVisitedCell_Item->choice.e_UTRAN_Cell.global_Cell_ID.eUTRANcellIdentifier); // lastVisitedCell_Item->choice.e_UTRAN_Cell.cellType.cell_Size = M2AP_Cell_Size_small; // lastVisitedCell_Item->choice.e_UTRAN_Cell.time_UE_StayedInCell = 2; -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); +// asn1cSeqAdd(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover request\n"); @@ -588,7 +588,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -596,7 +596,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -614,11 +614,11 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // { // e_RABs_Admitted_Item->e_RAB_ID = m2ap_handover_req_ack->e_rabs_tobesetup[i].e_rab_id; // } -// ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); // } // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -628,7 +628,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // // OCTET_STRING_fromBuf(&ie->value.choice.TargeteNBtoSource_eNBTransparentContainer, (char*) m2ap_handover_req_ack->rrc_buffer, m2ap_handover_req_ack->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover response\n"); @@ -680,7 +680,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(M2AP_UEContextRelease_IEs_t)); @@ -688,7 +688,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 UE Context Release\n"); @@ -737,7 +737,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional */ // if (id_target != -1) { @@ -746,7 +746,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // } // // /* mandatory */ @@ -770,7 +770,7 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // M2AP_ERROR("unhandled cancel cause\n"); // exit(1); // } -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 Handover Cancel\n"); diff --git a/openair3/M3AP/m3ap_MCE_handler.c b/openair3/M3AP/m3ap_MCE_handler.c index 3da0c00145..3bc47dc295 100644 --- a/openair3/M3AP/m3ap_MCE_handler.c +++ b/openair3/M3AP/m3ap_MCE_handler.c @@ -30,7 +30,7 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "m3ap_common.h" #include "m3ap_MCE_defs.h" diff --git a/openair3/M3AP/m3ap_MCE_interface_management.c b/openair3/M3AP/m3ap_MCE_interface_management.c index ef26312245..f17513e7f8 100644 --- a/openair3/M3AP/m3ap_MCE_interface_management.c +++ b/openair3/M3AP/m3ap_MCE_interface_management.c @@ -129,7 +129,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionStartResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c1. MME_MBMS_M3AP_ID (integer value) */ //long @@ -138,7 +138,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionStartResponse_IEs__value_PR_MME_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m3ap_encode_pdu(&pdu, &buffer, &len) < 0) { @@ -186,7 +186,7 @@ int MCE_send_MBMS_SESSION_START_FAILURE(instance_t instance, m3ap_session_start_ // // ie->criticality = M3AP_Criticality_reject; // // ie->value.present = M3AP_M3SetupFailure_Ies__value_PR_GlobalMCE_ID; // // ie->value.choice.GlobalMCE_ID = M3AP_get_next_transaction_identifier(enb_mod_idP, mce_mod_idP); -// // ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// // asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // /* c2. Cause */ @@ -196,7 +196,7 @@ int MCE_send_MBMS_SESSION_START_FAILURE(instance_t instance, m3ap_session_start_ // ie->value.present = M3AP_SessionStartFailure_Ies__value_PR_Cause; // ie->value.choice.Cause.present = M3AP_Cause_PR_radioNetwork; // ie->value.choice.Cause.choice.radioNetwork = M3AP_CauseRadioNetwork_unspecified; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // // /* encode */ @@ -290,7 +290,7 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_ ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionStopResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c1. MCE_MBMS_M3AP_ID (integer value) */ //long @@ -299,7 +299,7 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_ ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionStopResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m3ap_encode_pdu(&pdu, &buffer, &len) < 0) { @@ -389,7 +389,7 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionUpdateResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c1. MCE_MBMS_M3AP_ID (integer value) */ //long @@ -398,7 +398,7 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionUpdateResponse_IEs__value_PR_MCE_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m3ap_encode_pdu(&pdu, &buffer, &len) < 0) { @@ -486,7 +486,7 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * // ie->value.choice.Global_MCE_ID.mCE_ID.buf[1], // ie->value.choice.Global_MCE_ID.mCE_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); // // ///* mandatory */ // ///* c2. GNB_MCE_ID (integrer value) */ @@ -495,7 +495,7 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * // //ie->criticality = M3AP_Criticality_reject; // //ie->value.present = M3AP_M3SetupRequestIEs__value_PR_GNB_MCE_ID; // //asn_int642INTEGER(&ie->value.choice.GNB_MCE_ID, f1ap_du_data->gNB_MCE_id); -// //ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// //asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional */ /* c3. MCEname */ @@ -507,7 +507,7 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * ie->value.present = M3AP_M3SetupRequestIEs__value_PR_MCEname; OCTET_STRING_fromBuf(&ie->value.choice.MCEname, m3ap_MCE_data_p->MCE_name, strlen(m3ap_MCE_data_p->MCE_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ //but removed from asn definition (optional) since it crashes when decoding ??????????? @@ -531,13 +531,13 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * OCTET_STRING_fromBuf(m3ap_mbmsservicearea1,"02",2); - //ASN_SEQUENCE_ADD(&m3ap_mbmsservicearealistitem->list,m3ap_mbmsservicearea1); + //asn1cSeqAdd(&m3ap_mbmsservicearealistitem->list,m3ap_mbmsservicearea1); - //ASN_SEQUENCE_ADD(&ie->value.choice.MBMSServiceAreaListItem,m3ap_mbmsservicearealistitem); - //ASN_SEQUENCE_ADD(&ie->value.choice.MBMSServiceAreaListItem.list,m3ap_mbmsservicearealistitem); - ASN_SEQUENCE_ADD(&ie->value.choice.MBMSServiceAreaListItem.list,m3ap_mbmsservicearea1); + //asn1cSeqAdd(&ie->value.choice.MBMSServiceAreaListItem,m3ap_mbmsservicearealistitem); + //asn1cSeqAdd(&ie->value.choice.MBMSServiceAreaListItem.list,m3ap_mbmsservicearealistitem); + asn1cSeqAdd(&ie->value.choice.MBMSServiceAreaListItem.list,m3ap_mbmsservicearea1); - //ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + //asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ @@ -578,9 +578,9 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * // mbms_service_area2 = (M3AP_MBMS_Service_Area_t*)calloc(1,sizeof(M3AP_MBMS_Service_Area_t)); // //memset(mbms_service_area,0,sizeof(OCTET_STRING_t)); // OCTET_STRING_fromBuf(mbms_service_area,"01",2); -// ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); +// asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area); // OCTET_STRING_fromBuf(mbms_service_area2,"02",2); -// ASN_SEQUENCE_ADD(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area2); +// asn1cSeqAdd(&mbms_configuration_data_item->mbmsServiceAreaList.list,mbms_service_area2); // // // } @@ -596,10 +596,10 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * // //M3AP_MBMS_Service_Area_ID_List_t mbmsServiceAreaList; // // -// ASN_SEQUENCE_ADD(&ie->value.choice.MCE_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); +// asn1cSeqAdd(&ie->value.choice.MCE_MBMS_Configuration_data_List.list,mbms_configuration_data_list_item_ies); // // } -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // LOG_W(M3AP,"m3ap_MCE_data_p->assoc_id %d\n",m3ap_MCE_data_p->assoc_id); // /* encode */ diff --git a/openair3/M3AP/m3ap_MME_generate_messages.c b/openair3/M3AP/m3ap_MME_generate_messages.c index 969863b445..3a4c1bb473 100644 --- a/openair3/M3AP/m3ap_MME_generate_messages.c +++ b/openair3/M3AP/m3ap_MME_generate_messages.c @@ -83,7 +83,7 @@ int m2ap_MCE_generate_m2_setup_request( // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[0], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[1], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupRequest_Ies_t *)calloc(1, sizeof(M2AP_M2SetupRequest_Ies_t)); @@ -105,7 +105,7 @@ int m2ap_MCE_generate_m2_setup_request( // plmn = (M2AP_PLMN_Identity_t *)calloc(1,sizeof(M2AP_PLMN_Identity_t)); // { // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - // ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); + // asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); // } // if (instance_p->frame_type[i] == FDD) { @@ -146,10 +146,10 @@ int m2ap_MCE_generate_m2_setup_request( // AssertFatal(0,"M2Setuprequest not supported for TDD!"); // } // } - // ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); + // asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); // } //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupRequest_Ies_t *)calloc(1, sizeof(M2AP_M2SetupRequest_Ies_t)); @@ -164,9 +164,9 @@ int m2ap_MCE_generate_m2_setup_request( // //@TODO: consider to update this value // INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); // } - // ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); + // asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { M2AP_ERROR("Failed to encode M2 setup request\n"); @@ -216,7 +216,7 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[0], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[1], // ie->value.choice.GlobalMCE_ID.MCE_ID.choice.macro_MCE_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -238,7 +238,7 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // plmn = (M2AP_PLMN_Identity_t *)calloc(1,sizeof(M2AP_PLMN_Identity_t)); // { // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - // ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); + // asn1cSeqAdd(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn); // } // if (instance_p->frame_type[i] == FDD) { @@ -279,10 +279,10 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // AssertFatal(0,"M2Setupresponse not supported for TDD!"); // } // } - // ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember); + // asn1cSeqAdd(&ie->value.choice.ServedCells.list, servedCellMember); // } //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (M2AP_M2SetupResponse_Ies_t *)calloc(1, sizeof(M2AP_M2SetupResponse_Ies_t)); @@ -297,9 +297,9 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC // //@TODO: consider to update this value // INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID); // } - // ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu); + // asn1cSeqAdd(&ie->value.choice.GUGroupIDList.list, gu); //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { M2AP_ERROR("Failed to encode M2 setup response\n"); @@ -343,7 +343,7 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, //m2ap_MCE_set_cause (&ie->value.choice.Cause, cause_type, cause_value); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional: consider to handle this later */ ie = (M2AP_M2SetupFailure_Ies_t *)calloc(1, sizeof(M2AP_M2SetupFailure_Ies_t)); @@ -355,7 +355,7 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, // ie->value.choice.TimeToWait = time_to_wait; //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) { M2AP_ERROR("Failed to encode M2 setup failure\n"); @@ -431,7 +431,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = m2ap_id_get_id_source(&instance_p->id_manager, ue_id); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -440,7 +440,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->value.present = M2AP_HandoverRequest_IEs__value_PR_Cause; // ie->value.choice.Cause.present = M2AP_Cause_PR_radioNetwork; // ie->value.choice.Cause.choice.radioNetwork = M2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -450,7 +450,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, // &ie->value.choice.ECGI.pLMN_Identity); // MACRO_MCE_ID_TO_CELL_IDENTITY(m2ap_MCE_data_p->MCE_id, 0, &ie->value.choice.ECGI.eUTRANcellIdentifier); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -462,7 +462,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // //@TODO: consider to update these values // INT16_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_group_id, &ie->value.choice.GUMMEI.gU_Group_ID.mME_Group_ID); // MME_CODE_TO_OCTET_STRING(m2ap_handover_req->ue_gummei.mme_code, &ie->value.choice.GUMMEI.mME_Code); -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -514,13 +514,13 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // // INT32_TO_OCTET_STRING(m2ap_handover_req->e_rabs_tobesetup[i].gtp_teid,&e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.gTP_TEID); // } -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list, e_RABS_ToBeSetup_ItemIEs); // } // } // // OCTET_STRING_fromBuf(&ie->value.choice.UE_ContextInformation.rRC_Context, (char*) m2ap_handover_req->rrc_buffer, m2ap_handover_req->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequest_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequest_IEs_t)); @@ -536,10 +536,10 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // MACRO_MCE_ID_TO_CELL_IDENTITY(0, 0, &lastVisitedCell_Item->choice.e_UTRAN_Cell.global_Cell_ID.eUTRANcellIdentifier); // lastVisitedCell_Item->choice.e_UTRAN_Cell.cellType.cell_Size = M2AP_Cell_Size_small; // lastVisitedCell_Item->choice.e_UTRAN_Cell.time_UE_StayedInCell = 2; -// ASN_SEQUENCE_ADD(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); +// asn1cSeqAdd(&ie->value.choice.UE_HistoryInformation.list, lastVisitedCell_Item); // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover request\n"); @@ -590,7 +590,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -598,7 +598,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -616,11 +616,11 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // { // e_RABs_Admitted_Item->e_RAB_ID = m2ap_handover_req_ack->e_rabs_tobesetup[i].e_rab_id; // } -// ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); +// asn1cSeqAdd(&ie->value.choice.E_RABs_Admitted_List.list, e_RABS_Admitted_ItemIEs); // } // } // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(M2AP_HandoverRequestAcknowledge_IEs_t)); @@ -630,7 +630,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // // OCTET_STRING_fromBuf(&ie->value.choice.TargetMCEtoSource_MCETransparentContainer, (char*) m2ap_handover_req_ack->rrc_buffer, m2ap_handover_req_ack->rrc_buffer_size); // -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 handover response\n"); @@ -682,7 +682,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // ie = (M2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(M2AP_UEContextRelease_IEs_t)); @@ -690,7 +690,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_UEContextRelease_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 UE Context Release\n"); @@ -739,7 +739,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_reject; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID; // ie->value.choice.UE_M2AP_ID = id_source; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional */ // if (id_target != -1) { @@ -748,7 +748,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // ie->criticality = M2AP_Criticality_ignore; // ie->value.present = M2AP_HandoverCancel_IEs__value_PR_UE_M2AP_ID_1; // ie->value.choice.UE_M2AP_ID_1 = id_target; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // } // // /* mandatory */ @@ -772,7 +772,7 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // M2AP_ERROR("unhandled cancel cause\n"); // exit(1); // } -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // if (m2ap_MCE_encode_pdu(&pdu, &buffer, &len) < 0) { // M2AP_ERROR("Failed to encode X2 Handover Cancel\n"); diff --git a/openair3/M3AP/m3ap_MME_handler.c b/openair3/M3AP/m3ap_MME_handler.c index eaba0e8ef1..b4a753784a 100644 --- a/openair3/M3AP/m3ap_MME_handler.c +++ b/openair3/M3AP/m3ap_MME_handler.c @@ -30,7 +30,7 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "m3ap_common.h" #include "m3ap_MME_defs.h" diff --git a/openair3/M3AP/m3ap_MME_interface_management.c b/openair3/M3AP/m3ap_MME_interface_management.c index 038a0721d1..4b866fad2f 100644 --- a/openair3/M3AP/m3ap_MME_interface_management.c +++ b/openair3/M3AP/m3ap_MME_interface_management.c @@ -94,7 +94,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionStartRequest_IEs__value_PR_MME_MBMS_M3AP_ID; //ie->value.choice.MME_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. TMGI */ @@ -108,7 +108,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id uint8_t TMGI[5] = {4,3,2,1,0}; OCTET_STRING_fromBuf(&tmgi->serviceID,(const char*)&TMGI[2],3); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c2. MBMS_Session_ID */ if(0){ @@ -118,7 +118,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id ie->value.present = M3AP_MBMSSessionStartRequest_IEs__value_PR_MBMS_Session_ID; //M3AP_MBMS_Session_ID_t * mbms_session_id = &ie->value.choice.MBMS_Session_ID; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ /* c2. MBMS_E_RAB_QoS_Parameters */ @@ -133,7 +133,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id //struct M3AP_GBR_QosInformation *gbrQosInformation; /* OPTIONAL */ } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. MBMS_Session_Duration */ ie = (M3AP_MBMSSessionStartRequest_IEs_t *)calloc(1, sizeof(M3AP_MBMSSessionStartRequest_IEs_t)); @@ -145,7 +145,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id uint8_t duration[5] = {4,3,2,1,0}; OCTET_STRING_fromBuf(mbms_session_duration,(const char*)&duration[2],3); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2 MBMS_Service_Area */ ie = (M3AP_MBMSSessionStartRequest_IEs_t *)calloc(1, sizeof(M3AP_MBMSSessionStartRequest_IEs_t)); @@ -157,7 +157,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id uint8_t duration[5] = {4,3,2,1,0}; OCTET_STRING_fromBuf(mbms_service_area,(const char*)&duration[2],1); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2 MinimumTimeToMBMSDataTransfer */ ie = (M3AP_MBMSSessionStartRequest_IEs_t *)calloc(1, sizeof(M3AP_MBMSSessionStartRequest_IEs_t)); @@ -170,7 +170,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id OCTET_STRING_fromBuf(minimumtimetombmsdatatransfer,(const char*)&duration[2],1); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2 TNL_Information */ ie = (M3AP_MBMSSessionStartRequest_IEs_t *)calloc(1, sizeof(M3AP_MBMSSessionStartRequest_IEs_t)); @@ -195,7 +195,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id ip = (224U << 24) | (0) << 16 | (0) << 8 | (2); INT32_TO_OCTET_STRING(ip, &tnl_information->iPSourceAddress); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c2 Time_ofMBMS_DataTransfer */ if(0){ @@ -208,7 +208,7 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id //char duration[5] = {4,3,2,1,0}; //OCTET_STRING_fromBuf(absolute_time_ofmbms_data,(const char*)&duration[2],3); //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ /* c2 MBMS_Cell_List */ @@ -222,9 +222,9 @@ int MME_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id { //MCC_MNC_TO_PLMNID(0,0,3,ecgi->pLMN_Identity); //MACRO_ENB_ID_TO_CELL_IDENTITY(1,0,ecgi->eUTRANcellIdentifier); - ASN_SEQUENCE_ADD(&mbms_cell_list->list,ecgi); + asn1cSeqAdd(&mbms_cell_list->list,ecgi); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* encode */ @@ -344,7 +344,7 @@ int MME_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m3ap_session_stop_re ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionStopRequest_IEs__value_PR_MME_MBMS_M3AP_ID; //ie->value.choice.MME_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. MCE_MBMS_M3AP_ID (integer value) */ //long @@ -354,7 +354,7 @@ int MME_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m3ap_session_stop_re ie->value.present = M3AP_MBMSSessionStopRequest_IEs__value_PR_MCE_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* encode */ @@ -667,7 +667,7 @@ int MME_send_M3_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/ *ie->value.choice.CriticalityDiagnostics.procedureCriticality = M3AP_Criticality_reject; //ie->value.choice.CriticalityDiagnostics.transactionID = (M2AP_TransactionID_t *)calloc(1, sizeof(M3AP_TransactionID_t)); //*ie->value.choice.CriticalityDiagnostics.transactionID = 0; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* encode */ @@ -717,7 +717,7 @@ int MME_send_M3_SETUP_FAILURE(instance_t instance,m3ap_setup_failure_t* m3ap_set // // ie->criticality = M3AP_Criticality_reject; // // ie->value.present = M3AP_M3SetupFailure_Ies__value_PR_GlobalMCE_ID; // // ie->value.choice.GlobalMCE_ID = M3AP_get_next_transaction_identifier(enb_mod_idP, mce_mod_idP); -// // ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// // asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* mandatory */ // /* c2. Cause */ @@ -727,7 +727,7 @@ int MME_send_M3_SETUP_FAILURE(instance_t instance,m3ap_setup_failure_t* m3ap_set // ie->value.present = M3AP_M3SetupFailure_Ies__value_PR_Cause; // ie->value.choice.Cause.present = M3AP_Cause_PR_radioNetwork; // ie->value.choice.Cause.choice.radioNetwork = M3AP_CauseRadioNetwork_unspecified; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // // /* optional */ // /* c3. TimeToWait */ @@ -737,7 +737,7 @@ int MME_send_M3_SETUP_FAILURE(instance_t instance,m3ap_setup_failure_t* m3ap_set // ie->criticality = M3AP_Criticality_ignore; // ie->value.present = M3AP_M3SetupFailure_Ies__value_PR_TimeToWait; // ie->value.choice.TimeToWait = M3AP_TimeToWait_v10s; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // } // // /* optional */ @@ -755,7 +755,7 @@ int MME_send_M3_SETUP_FAILURE(instance_t instance,m3ap_setup_failure_t* m3ap_set // *ie->value.choice.CriticalityDiagnostics.procedureCriticality = M3AP_Criticality_reject; // //ie->value.choice.CriticalityDiagnostics.transactionID = (M3AP_TransactionID_t *)calloc(1, sizeof(M3AP_TransactionID_t)); // //*ie->value.choice.CriticalityDiagnostics.transactionID = 0; -// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); +// asn1cSeqAdd(&out->protocolIEs.list, ie); // } // // /* encode */ @@ -858,7 +858,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ ie->criticality = M3AP_Criticality_reject; ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MME_MBMS_M3AP_ID; //ie->value.choice.MME_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. MCE_MBMS_M3AP_ID (integer value) */ //long @@ -868,7 +868,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MCE_MBMS_M3AP_ID; //ie->value.choice.MCE_MBMS_M3AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //? - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. TMGI */ @@ -882,7 +882,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ uint8_t TMGI[5] = {4,3,2,1,0}; OCTET_STRING_fromBuf(&tmgi->serviceID,(const char*)&TMGI[2],3); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c2. MBMS_Session_ID */ if(0){ @@ -892,7 +892,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MBMS_Session_ID; //M3AP_MBMS_Session_ID_t * mbms_session_id = &ie->value.choice.MBMS_Session_ID; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ /* c2. MBMS_E_RAB_QoS_Parameters */ @@ -907,7 +907,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ //struct M3AP_GBR_QosInformation *gbrQosInformation; /* OPTIONAL */ } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ /* c2. MBMS_Session_Duration */ ie = (M3AP_MBMSSessionUpdateRequest_IEs_t *)calloc(1, sizeof(M3AP_MBMSSessionUpdateRequest_IEs_t)); @@ -919,7 +919,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ uint8_t duration[5] = {4,3,2,1,0}; OCTET_STRING_fromBuf(mbms_session_duration,(const char*)&duration[2],3); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c2 MBMS_Service_Area */ if(0){ @@ -929,7 +929,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ ie->value.present = M3AP_MBMSSessionUpdateRequest_IEs__value_PR_MBMS_Service_Area; //M3AP_MBMS_Service_Area_t * mbms_service_area = &ie->value.choice.MBMS_Service_Area; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ /* c2 MinimumTimeToMBMSDataTransfer */ @@ -943,7 +943,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ OCTET_STRING_fromBuf(minimumtimetombmsdatatransfer,(const char*)&duration[2],1); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ /* c2 TNL_Information */ if(0){ @@ -957,7 +957,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ OCTET_STRING_fromBuf(&tnl_information->iPSourceAddress,"1204",strlen("1234")); OCTET_STRING_fromBuf(&tnl_information->gTP_DLTEID,"1204",strlen("1234")); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ /* c2 Time_ofMBMS_DataTransfer */ @@ -971,7 +971,7 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ //char duration[5] = {4,3,2,1,0}; //OCTET_STRING_fromBuf(absolute_time_ofmbms_data,(const char*)&duration[2],3); //} - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ /* c2 MBMS_Cell_List */ @@ -985,9 +985,9 @@ int MME_send_MBMS_SESSION_UPDATE_REQUEST(instance_t instance, m3ap_mbms_session_ { //MCC_MNC_TO_PLMNID(0,0,3,ecgi->pLMN_Identity); //MACRO_ENB_ID_TO_CELL_IDENTITY(1,0,ecgi->eUTRANcellIdentifier); - ASN_SEQUENCE_ADD(&mbms_cell_list->list,ecgi); + asn1cSeqAdd(&mbms_cell_list->list,ecgi); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* encode */ diff --git a/openair3/M3AP/m3ap_common.h b/openair3/M3AP/m3ap_common.h index 75c60db71a..cf2189a243 100644 --- a/openair3/M3AP/m3ap_common.h +++ b/openair3/M3AP/m3ap_common.h @@ -20,7 +20,7 @@ */ #ifndef M3AP_COMMON_H_ #define M3AP_COMMON_H_ - +#include "oai_asn1.h" #include "M3AP_ProtocolIE-Field.h" #include "M3AP_M3AP-PDU.h" #include "M3AP_InitiatingMessage.h" diff --git a/openair3/M3AP/m3ap_handler.c b/openair3/M3AP/m3ap_handler.c index 583552528b..9aa4d5233f 100644 --- a/openair3/M3AP/m3ap_handler.c +++ b/openair3/M3AP/m3ap_handler.c @@ -30,7 +30,7 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" +#include "oai_asn1.h" #include "m3ap_common.h" #include "m3ap_MCE_defs.h" diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 62d22698d7..a87dc6348a 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -189,4 +189,4 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ set_qfi_pduid(qos_rule.qfi, psea_msg.pdu_id); return; -} \ No newline at end of file +} diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 0e09425033..95ca942339 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -168,4 +168,4 @@ typedef struct security_protected_nas_5gs_msg_s { void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_length); -#endif \ No newline at end of file +#endif diff --git a/openair3/NGAP/ngap_common.h b/openair3/NGAP/ngap_common.h index cfb9d63e59..9879ce7313 100644 --- a/openair3/NGAP/ngap_common.h +++ b/openair3/NGAP/ngap_common.h @@ -38,6 +38,7 @@ #include "common/utils/LOG/log.h" +#include "oai_asn1.h" #include "NGAP_ProtocolIE-Field.h" #include "NGAP_NGAP-PDU.h" diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index bce973354b..b4a3aa2f14 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -459,7 +459,7 @@ static int ngap_gNB_generate_ng_setup_request( ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID.buf[1], ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID.buf[2], ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID.buf[3]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (instance_p->gNB_name) { @@ -469,7 +469,7 @@ static int ngap_gNB_generate_ng_setup_request( ie->value.present = NGAP_NGSetupRequestIEs__value_PR_RANNodeName; OCTET_STRING_fromBuf(&ie->value.choice.RANNodeName, instance_p->gNB_name, strlen(instance_p->gNB_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -502,15 +502,15 @@ static int ngap_gNB_generate_ng_setup_request( } - ASN_SEQUENCE_ADD(&plmn->tAISliceSupportList.list, ssi); + asn1cSeqAdd(&plmn->tAISliceSupportList.list, ssi); } - ASN_SEQUENCE_ADD(&ta->broadcastPLMNList.list, plmn); + asn1cSeqAdd(&ta->broadcastPLMNList.list, plmn); } } - ASN_SEQUENCE_ADD(&ie->value.choice.SupportedTAList.list, ta); + asn1cSeqAdd(&ie->value.choice.SupportedTAList.list, ta); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_NGSetupRequestIEs_t *)calloc(1, sizeof(NGAP_NGSetupRequestIEs_t)); @@ -518,7 +518,7 @@ static int ngap_gNB_generate_ng_setup_request( ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_NGSetupRequestIEs__value_PR_PagingDRX; ie->value.choice.PagingDRX = instance_p->default_drx; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (ngap_gNB_encode_pdu(&pdu, &buffer, &len) < 0) { diff --git a/openair3/NGAP/ngap_gNB_context_management_procedures.c b/openair3/NGAP/ngap_gNB_context_management_procedures.c index ea22c91bc2..6c1a8584a6 100644 --- a/openair3/NGAP/ngap_gNB_context_management_procedures.c +++ b/openair3/NGAP/ngap_gNB_context_management_procedures.c @@ -98,7 +98,7 @@ int ngap_ue_context_release_complete(instance_t instance, ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_UEContextReleaseComplete_IEs__value_PR_AMF_UE_NGAP_ID; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_UEContextReleaseComplete_IEs_t *)calloc(1, sizeof(NGAP_UEContextReleaseComplete_IEs_t)); @@ -106,7 +106,7 @@ int ngap_ue_context_release_complete(instance_t instance, ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_UEContextReleaseComplete_IEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = ue_release_complete_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { @@ -183,7 +183,7 @@ int ngap_ue_context_release_req(instance_t instance, ie->criticality = NGAP_Criticality_reject; ie->value.present = NGAP_UEContextReleaseRequest_IEs__value_PR_AMF_UE_NGAP_ID; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_UEContextReleaseRequest_IEs_t *)calloc(1, sizeof(NGAP_UEContextReleaseRequest_IEs_t)); @@ -191,7 +191,7 @@ int ngap_ue_context_release_req(instance_t instance, ie->criticality = NGAP_Criticality_reject; ie->value.present = NGAP_UEContextReleaseRequest_IEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = ue_release_req_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (ue_release_req_p->nb_of_pdusessions > 0) { @@ -203,9 +203,9 @@ int ngap_ue_context_release_req(instance_t instance, NGAP_PDUSessionResourceItemCxtRelReq_t *item; item = (NGAP_PDUSessionResourceItemCxtRelReq_t *)calloc(1,sizeof(NGAP_PDUSessionResourceItemCxtRelReq_t)); item->pDUSessionID = ue_release_req_p->pdusessions[i].pdusession_id; - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceListCxtRelReq.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceListCxtRelReq.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -246,7 +246,7 @@ int ngap_ue_context_release_req(instance_t instance, break; } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 35b152f129..ab2503f1d5 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -31,8 +31,6 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" - #include "ngap_common.h" // #include "ngap_gNB.h" #include "ngap_gNB_defs.h" diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.c b/openair3/NGAP/ngap_gNB_nas_procedures.c index 976a4220dd..f163b5b838 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.c +++ b/openair3/NGAP/ngap_gNB_nas_procedures.c @@ -199,7 +199,7 @@ int ngap_gNB_handle_nas_first_req( ie->criticality = NGAP_Criticality_reject; ie->value.present = NGAP_InitialUEMessage_IEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = ue_desc_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_InitialUEMessage_IEs_t *)calloc(1, sizeof(NGAP_InitialUEMessage_IEs_t)); ie->id = NGAP_ProtocolIE_ID_id_NAS_PDU; @@ -214,7 +214,7 @@ int ngap_gNB_handle_nas_first_req( ngap_nas_first_req_p->nas_pdu.length); #endif ie->value.choice.NAS_PDU.size = ngap_nas_first_req_p->nas_pdu.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_InitialUEMessage_IEs_t *)calloc(1, sizeof(NGAP_InitialUEMessage_IEs_t)); @@ -244,7 +244,7 @@ int ngap_gNB_handle_nas_first_req( instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity], &userinfo_nr_p->tAI.pLMNIdentity); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* Set the establishment cause according to those provided by RRC */ @@ -257,7 +257,7 @@ int ngap_gNB_handle_nas_first_req( ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_InitialUEMessage_IEs__value_PR_RRCEstablishmentCause; ie->value.choice.RRCEstablishmentCause = ngap_nas_first_req_p->establishment_cause; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (ngap_nas_first_req_p->ue_identity.presenceMask & NGAP_UE_IDENTITIES_FiveG_s_tmsi) { @@ -272,7 +272,7 @@ int ngap_gNB_handle_nas_first_req( &ie->value.choice.FiveG_S_TMSI.aMFPointer); M_TMSI_TO_OCTET_STRING(ngap_nas_first_req_p->ue_identity.s_tmsi.m_tmsi, &ie->value.choice.FiveG_S_TMSI.fiveG_TMSI); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } @@ -282,7 +282,7 @@ int ngap_gNB_handle_nas_first_req( ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_InitialUEMessage_IEs__value_PR_UEContextRequest; ie->value.choice.UEContextRequest = NGAP_UEContextRequest_requested; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { @@ -455,14 +455,14 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_ ie->value.present = NGAP_UplinkNASTransport_IEs__value_PR_AMF_UE_NGAP_ID; //ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(NGAP_UplinkNASTransport_IEs_t)); ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; ie->value.present = NGAP_UplinkNASTransport_IEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = ue_context_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(NGAP_UplinkNASTransport_IEs_t)); ie->id = NGAP_ProtocolIE_ID_id_NAS_PDU; @@ -470,7 +470,7 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_ ie->value.present = NGAP_UplinkNASTransport_IEs__value_PR_NAS_PDU; ie->value.choice.NAS_PDU.buf = ngap_uplink_nas_p->nas_pdu.buffer; ie->value.choice.NAS_PDU.size = ngap_uplink_nas_p->nas_pdu.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(NGAP_UplinkNASTransport_IEs_t)); ie->id = NGAP_ProtocolIE_ID_id_UserLocationInformation; @@ -498,7 +498,7 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_ &userinfo_nr_p->tAI.pLMNIdentity); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { NGAP_ERROR("Failed to encode uplink NAS transport\n"); @@ -553,14 +553,14 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, ie->criticality = NGAP_Criticality_reject; ie->value.present = NGAP_NASNonDeliveryIndication_IEs__value_PR_AMF_UE_NGAP_ID; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(NGAP_NASNonDeliveryIndication_IEs_t)); ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; ie->value.present = NGAP_NASNonDeliveryIndication_IEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = ue_context_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(NGAP_NASNonDeliveryIndication_IEs_t)); ie->id = NGAP_ProtocolIE_ID_id_NAS_PDU; @@ -568,7 +568,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, ie->value.present = NGAP_NASNonDeliveryIndication_IEs__value_PR_NAS_PDU; ie->value.choice.NAS_PDU.buf = ngap_nas_non_delivery_ind->nas_pdu.buffer; ie->value.choice.NAS_PDU.size = ngap_nas_non_delivery_ind->nas_pdu.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(NGAP_NASNonDeliveryIndication_IEs_t)); ie->id = NGAP_ProtocolIE_ID_id_Cause; @@ -577,7 +577,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, ie->value.present = NGAP_NASNonDeliveryIndication_IEs__value_PR_Cause; ie->value.choice.Cause.present = NGAP_Cause_PR_radioNetwork; ie->value.choice.Cause.choice.radioNetwork = NGAP_CauseRadioNetwork_radio_connection_with_ue_lost; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { NGAP_ERROR("Failed to encode NAS NON delivery indication\n"); @@ -650,14 +650,14 @@ int ngap_gNB_initial_ctxt_resp( ie->value.present = NGAP_InitialContextSetupResponseIEs__value_PR_AMF_UE_NGAP_ID; //ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(NGAP_InitialContextSetupResponseIEs_t)); ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_InitialContextSetupResponseIEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = initial_ctxt_resp_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (initial_ctxt_resp_p->nb_of_pdusessions){ @@ -708,7 +708,7 @@ int ngap_gNB_initial_ctxt_resp( // ass_qos_item_p->qosFlowMappingIndication = malloc(sizeof(*ass_qos_item_p->qosFlowMappingIndication)); // *ass_qos_item_p->qosFlowMappingIndication = initial_ctxt_resp_p->pdusessions[i].associated_qos_flows[j].qos_flow_mapping_ind; // } - ASN_SEQUENCE_ADD(&pdusessionTransfer_p->dLQosFlowPerTNLInformation.associatedQosFlowList.list, ass_qos_item_p); + asn1cSeqAdd(&pdusessionTransfer_p->dLQosFlowPerTNLInformation.associatedQosFlowList.list, ass_qos_item_p); } //res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NGAP_PDUSessionResourceSetupResponseTransfer, pdusessionTransfer_p); @@ -730,10 +730,10 @@ int ngap_gNB_initial_ctxt_resp( ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceSetupResponseTransfer, pdusessionTransfer_p); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceSetupListCxtRes.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceSetupListCxtRes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ if (initial_ctxt_resp_p->nb_of_pdusessions_failed) { @@ -787,10 +787,10 @@ int ngap_gNB_initial_ctxt_resp( ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer, pdusessionUnTransfer_p); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceFailedToSetupListCxtRes.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceFailedToSetupListCxtRes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -800,7 +800,7 @@ int ngap_gNB_initial_ctxt_resp( ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_InitialContextSetupResponseIEs__value_PR_CriticalityDiagnostics; // ie->value.choice.CriticalityDiagnostics =; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } if (asn1_xer_print) { @@ -873,14 +873,14 @@ int ngap_gNB_ue_capabilities(instance_t instance, ie->value.present = NGAP_UERadioCapabilityInfoIndicationIEs__value_PR_AMF_UE_NGAP_ID; //ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_UERadioCapabilityInfoIndicationIEs_t *)calloc(1, sizeof(NGAP_UERadioCapabilityInfoIndicationIEs_t)); ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; ie->value.present = NGAP_UERadioCapabilityInfoIndicationIEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = ue_cap_info_ind_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_UERadioCapabilityInfoIndicationIEs_t *)calloc(1, sizeof(NGAP_UERadioCapabilityInfoIndicationIEs_t)); ie->id = NGAP_ProtocolIE_ID_id_UERadioCapability; @@ -888,7 +888,7 @@ int ngap_gNB_ue_capabilities(instance_t instance, ie->value.present = NGAP_UERadioCapabilityInfoIndicationIEs__value_PR_UERadioCapability; ie->value.choice.UERadioCapability.buf = ue_cap_info_ind_p->ue_radio_cap.buffer; ie->value.choice.UERadioCapability.size = ue_cap_info_ind_p->ue_radio_cap.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ //NGAP_UERadioCapabilityForPaging TBD if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { @@ -955,14 +955,14 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceSetupResponseIEs__value_PR_AMF_UE_NGAP_ID; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = calloc(1, sizeof *ie ); ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceSetupResponseIEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = pdusession_setup_resp_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (pdusession_setup_resp_p->nb_of_pdusessions > 0) { @@ -1015,7 +1015,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, // ass_qos_item_p->qosFlowMappingIndication = malloc(sizeof(*ass_qos_item_p->qosFlowMappingIndication)); // *ass_qos_item_p->qosFlowMappingIndication = pdusession_setup_resp_p->pdusessions[i].associated_qos_flows[j].qos_flow_mapping_ind; //} - ASN_SEQUENCE_ADD(&pdusessionTransfer_p->dLQosFlowPerTNLInformation.associatedQosFlowList.list, ass_qos_item_p); + asn1cSeqAdd(&pdusessionTransfer_p->dLQosFlowPerTNLInformation.associatedQosFlowList.list, ass_qos_item_p); } asn_encode_to_new_buffer_result_t res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, @@ -1026,9 +1026,9 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceSetupResponseTransfer, pdusessionTransfer_p); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceSetupListSURes.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceSetupListSURes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1084,10 +1084,10 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer, pdusessionUnTransfer_p); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceFailedToSetupListSURes.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceFailedToSetupListSURes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1097,7 +1097,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceSetupResponseIEs__value_PR_CriticalityDiagnostics; // ie->value.choice.CriticalityDiagnostics = ; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } @@ -1167,14 +1167,14 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_AMF_UE_NGAP_ID; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t)); ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = pdusession_modify_resp_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* PDUSessionResourceModifyListModRes optional */ if (pdusession_modify_resp_p->nb_of_pdusessions > 0) { @@ -1198,7 +1198,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, NGAP_QosFlowAddOrModifyResponseItem_t *qosFlowAddOrModifyResponseItem_p = calloc(1, sizeof(NGAP_QosFlowAddOrModifyResponseItem_t)); qosFlowAddOrModifyResponseItem_p->qosFlowIdentifier = pdusession_modify_resp_p->pdusessions[i].qos[qos_flow_index].qfi; - ASN_SEQUENCE_ADD(&transfer_p->qosFlowAddOrModifyResponseList->list, qosFlowAddOrModifyResponseItem_p); + asn1cSeqAdd(&transfer_p->qosFlowAddOrModifyResponseList->list, qosFlowAddOrModifyResponseItem_p); } memset(&res, 0, sizeof(res)); @@ -1209,10 +1209,10 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceModifyResponseTransfer, transfer_p); NGAP_DEBUG("pdusession_modify_resp: modified pdusession ID %ld\n", item->pDUSessionID); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceModifyListModRes.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceModifyListModRes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1267,10 +1267,10 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, NGAP_DEBUG("pdusession_modify_resp: failed pdusession ID %ld\n", item->pDUSessionID); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceFailedToModifyListModRes.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceFailedToModifyListModRes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1280,7 +1280,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_CriticalityDiagnostics; // ie->value.choice.CriticalityDiagnostics = ; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } fprintf(stderr, "start encode\n"); @@ -1338,14 +1338,14 @@ int ngap_gNB_pdusession_release_resp(instance_t instance, ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_AMF_UE_NGAP_ID; asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t)); ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_RAN_UE_NGAP_ID; ie->value.choice.RAN_UE_NGAP_ID = pdusession_release_resp_p->gNB_ue_ngap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (pdusession_release_resp_p->nb_of_pdusessions_released > 0) { @@ -1371,10 +1371,10 @@ int ngap_gNB_pdusession_release_resp(instance_t instance, NGAP_DEBUG("pdusession_release_resp: transfer_buffer is NULL!\n"); } NGAP_DEBUG("pdusession_release_resp: pdusession ID %ld\n", item->pDUSessionID); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceReleasedListRelRes.list, item); + asn1cSeqAdd(&ie->value.choice.PDUSessionResourceReleasedListRelRes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } diff --git a/openair3/S1AP/s1ap_common.h b/openair3/S1AP/s1ap_common.h index 9eee0d8dff..bdfc9b9f6f 100644 --- a/openair3/S1AP/s1ap_common.h +++ b/openair3/S1AP/s1ap_common.h @@ -27,6 +27,7 @@ #define S1AP_COMMON_H_ #include "common/utils/LOG/log.h" +#include "oai_asn1.h" #include "S1AP_ProtocolIE-Field.h" #include "S1AP_S1AP-PDU.h" diff --git a/openair3/S1AP/s1ap_eNB.c b/openair3/S1AP/s1ap_eNB.c index 5f30386bb3..f9dcd73f6b 100644 --- a/openair3/S1AP/s1ap_eNB.c +++ b/openair3/S1AP/s1ap_eNB.c @@ -698,7 +698,7 @@ static int s1ap_eNB_generate_s1_setup_request( ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[0], ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[1], ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (instance_p->eNB_name) { @@ -708,7 +708,7 @@ static int s1ap_eNB_generate_s1_setup_request( ie->value.present = S1AP_S1SetupRequestIEs__value_PR_ENBname; OCTET_STRING_fromBuf(&ie->value.choice.ENBname, instance_p->eNB_name, strlen(instance_p->eNB_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -726,19 +726,19 @@ static int s1ap_eNB_generate_s1_setup_request( instance_p->mnc[s1ap_mme_data_p->broadcast_plmn_index[i]], instance_p->mnc_digit_length[s1ap_mme_data_p->broadcast_plmn_index[i]], plmn); - ASN_SEQUENCE_ADD(&ta->broadcastPLMNs.list, plmn); + asn1cSeqAdd(&ta->broadcastPLMNs.list, plmn); } } - ASN_SEQUENCE_ADD(&ie->value.choice.SupportedTAs.list, ta); + asn1cSeqAdd(&ie->value.choice.SupportedTAs.list, ta); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_DefaultPagingDRX; ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_S1SetupRequestIEs__value_PR_PagingDRX; ie->value.choice.PagingDRX = instance_p->default_drx; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (s1ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { diff --git a/openair3/S1AP/s1ap_eNB_context_management_procedures.c b/openair3/S1AP/s1ap_eNB_context_management_procedures.c index 6255abb14d..826debc2bd 100644 --- a/openair3/S1AP/s1ap_eNB_context_management_procedures.c +++ b/openair3/S1AP/s1ap_eNB_context_management_procedures.c @@ -93,7 +93,7 @@ int s1ap_ue_context_release_complete(instance_t instance, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_UEContextReleaseComplete_IEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UEContextReleaseComplete_IEs_t *)calloc(1, sizeof(S1AP_UEContextReleaseComplete_IEs_t)); @@ -101,7 +101,7 @@ int s1ap_ue_context_release_complete(instance_t instance, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_UEContextReleaseComplete_IEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_release_complete_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { @@ -177,7 +177,7 @@ int s1ap_ue_context_release_req(instance_t instance, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_UEContextReleaseRequest_IEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UEContextReleaseRequest_IEs_t *)calloc(1, sizeof(S1AP_UEContextReleaseRequest_IEs_t)); @@ -185,7 +185,7 @@ int s1ap_ue_context_release_req(instance_t instance, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_UEContextReleaseRequest_IEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_release_req_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UEContextReleaseRequest_IEs_t *)calloc(1, sizeof(S1AP_UEContextReleaseRequest_IEs_t)); @@ -225,7 +225,7 @@ int s1ap_ue_context_release_req(instance_t instance, break; } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c index b3b38e7017..8291294bd2 100644 --- a/openair3/S1AP/s1ap_eNB_handlers.c +++ b/openair3/S1AP/s1ap_eNB_handlers.c @@ -31,8 +31,6 @@ #include "intertask_interface.h" -#include "asn1_conversions.h" - #include "s1ap_common.h" // #include "s1ap_eNB.h" #include "s1ap_eNB_defs.h" @@ -1898,7 +1896,7 @@ static int s1ap_eNB_snd_s1_setup_request( ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[0], ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[1], ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[2]); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (instance_p->eNB_name) { @@ -1908,7 +1906,7 @@ static int s1ap_eNB_snd_s1_setup_request( ie->value.present = S1AP_S1SetupRequestIEs__value_PR_ENBname; OCTET_STRING_fromBuf(&ie->value.choice.ENBname, instance_p->eNB_name, strlen(instance_p->eNB_name)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -1926,19 +1924,19 @@ static int s1ap_eNB_snd_s1_setup_request( instance_p->mnc[s1ap_mme_data_p->broadcast_plmn_index[i]], instance_p->mnc_digit_length[s1ap_mme_data_p->broadcast_plmn_index[i]], plmn); - ASN_SEQUENCE_ADD(&ta->broadcastPLMNs.list, plmn); + asn1cSeqAdd(&ta->broadcastPLMNs.list, plmn); } } - ASN_SEQUENCE_ADD(&ie->value.choice.SupportedTAs.list, ta); + asn1cSeqAdd(&ie->value.choice.SupportedTAs.list, ta); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_DefaultPagingDRX; ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_S1SetupRequestIEs__value_PR_PagingDRX; ie->value.choice.PagingDRX = instance_p->default_drx; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (0) { @@ -1947,7 +1945,7 @@ static int s1ap_eNB_snd_s1_setup_request( ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_S1SetupRequestIEs__value_PR_CSG_IdList; // ie->value.choice.CSG_IdList = ; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1959,7 +1957,7 @@ static int s1ap_eNB_snd_s1_setup_request( ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_S1SetupRequestIEs__value_PR_UE_RetentionInformation; // ie->value.choice.UE_RetentionInformation = ; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1969,7 +1967,7 @@ static int s1ap_eNB_snd_s1_setup_request( ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_S1SetupRequestIEs__value_PR_NB_IoT_DefaultPagingDRX; // ie->value.choice.NB_IoT_DefaultPagingDRX = ; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } #endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */ diff --git a/openair3/S1AP/s1ap_eNB_nas_procedures.c b/openair3/S1AP/s1ap_eNB_nas_procedures.c index 0b56d31211..e493629535 100644 --- a/openair3/S1AP/s1ap_eNB_nas_procedures.c +++ b/openair3/S1AP/s1ap_eNB_nas_procedures.c @@ -190,7 +190,7 @@ int s1ap_eNB_handle_nas_first_req( ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_InitialUEMessage_IEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_desc_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU; @@ -205,7 +205,7 @@ int s1ap_eNB_handle_nas_first_req( s1ap_nas_first_req_p->nas_pdu.length); #endif ie->value.choice.NAS_PDU.size = s1ap_nas_first_req_p->nas_pdu.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_TAI; @@ -217,7 +217,7 @@ int s1ap_eNB_handle_nas_first_req( instance_p->mnc[ue_desc_p->selected_plmn_identity], instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity], &ie->value.choice.TAI.pLMNidentity); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI; @@ -235,7 +235,7 @@ int s1ap_eNB_handle_nas_first_req( instance_p->mnc[ue_desc_p->selected_plmn_identity], instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity], &ie->value.choice.EUTRAN_CGI.pLMNidentity); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* Set the establishment cause according to those provided by RRC */ DevCheck(s1ap_nas_first_req_p->establishment_cause < RRC_CAUSE_LAST, s1ap_nas_first_req_p->establishment_cause, RRC_CAUSE_LAST, 0); @@ -245,7 +245,7 @@ int s1ap_eNB_handle_nas_first_req( ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_InitialUEMessage_IEs__value_PR_RRC_Establishment_Cause; ie->value.choice.RRC_Establishment_Cause = s1ap_nas_first_req_p->establishment_cause; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (s1ap_nas_first_req_p->ue_identity.presenceMask & UE_IDENTITIES_s_tmsi) { @@ -258,7 +258,7 @@ int s1ap_eNB_handle_nas_first_req( &ie->value.choice.S_TMSI.mMEC); M_TMSI_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.s_tmsi.m_tmsi, &ie->value.choice.S_TMSI.m_TMSI); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } @@ -278,7 +278,7 @@ int s1ap_eNB_handle_nas_first_req( &ie->value.choice.GUMMEI.mME_Group_ID); MME_CODE_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.gummei.mme_code, &ie->value.choice.GUMMEI.mME_Code); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } @@ -458,14 +458,14 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU; @@ -473,7 +473,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_NAS_PDU; ie->value.choice.NAS_PDU.buf = s1ap_uplink_nas_p->nas_pdu.buffer; ie->value.choice.NAS_PDU.size = s1ap_uplink_nas_p->nas_pdu.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI; @@ -488,7 +488,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id, 0, &ie->value.choice.EUTRAN_CGI.cell_ID); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_TAI; @@ -500,7 +500,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ s1ap_eNB_instance_p->mnc_digit_length[ue_context_p->selected_plmn_identity], &ie->value.choice.TAI.pLMNidentity); TAC_TO_ASN1(s1ap_eNB_instance_p->tac, &ie->value.choice.TAI.tAC); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ @@ -555,14 +555,14 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU; @@ -570,7 +570,7 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance, ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_NAS_PDU; ie->value.choice.NAS_PDU.buf = s1ap_nas_non_delivery_ind->nas_pdu.buffer; ie->value.choice.NAS_PDU.size = s1ap_nas_non_delivery_ind->nas_pdu.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t)); ie->id = S1AP_ProtocolIE_ID_id_Cause; @@ -579,7 +579,7 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance, ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_Cause; ie->value.choice.Cause.present = S1AP_Cause_PR_radioNetwork; ie->value.choice.Cause.choice.radioNetwork = S1AP_CauseRadioNetwork_radio_connection_with_ue_lost; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { S1AP_ERROR("Failed to encode NAS NON delivery indication\n"); @@ -644,14 +644,14 @@ int s1ap_eNB_initial_ctxt_resp( ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = initial_ctxt_resp_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_E_RABSetupListCtxtSURes; @@ -680,10 +680,10 @@ int s1ap_eNB_initial_ctxt_resp( item->value.choice.E_RABSetupItemCtxtSURes.transportLayerAddress.buf[2], item->value.choice.E_RABSetupItemCtxtSURes.transportLayerAddress.buf[3], item->value.choice.E_RABSetupItemCtxtSURes.transportLayerAddress.size); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABSetupListCtxtSURes.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABSetupListCtxtSURes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (initial_ctxt_resp_p->nb_of_e_rabs_failed) { @@ -729,10 +729,10 @@ int s1ap_eNB_initial_ctxt_resp( } S1AP_DEBUG("initial context setup response: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABList.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABList.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -742,7 +742,7 @@ int s1ap_eNB_initial_ctxt_resp( ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_CriticalityDiagnostics; // ie->value.choice.CriticalityDiagnostics =; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { @@ -807,14 +807,14 @@ int s1ap_eNB_ue_capabilities(instance_t instance, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_UECapabilityInfoIndicationIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_UECapabilityInfoIndicationIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_cap_info_ind_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_UERadioCapability; @@ -822,7 +822,7 @@ int s1ap_eNB_ue_capabilities(instance_t instance, ie->value.present = S1AP_UECapabilityInfoIndicationIEs__value_PR_UERadioCapability; ie->value.choice.UERadioCapability.buf = ue_cap_info_ind_p->ue_radio_cap.buffer; ie->value.choice.UERadioCapability.size = ue_cap_info_ind_p->ue_radio_cap.length; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { @@ -888,14 +888,14 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_E_RABSetupResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = e_rab_setup_resp_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (e_rab_setup_resp_p->nb_of_e_rabs > 0) { @@ -927,10 +927,10 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance, item->value.choice.E_RABSetupItemBearerSURes.transportLayerAddress.buf[2], item->value.choice.E_RABSetupItemBearerSURes.transportLayerAddress.buf[3], item->value.choice.E_RABSetupItemBearerSURes.transportLayerAddress.size); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABSetupListBearerSURes.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABSetupListBearerSURes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -976,10 +976,10 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance, } S1AP_DEBUG("e_rab_setup_resp: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABList.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABList.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -989,7 +989,7 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_CriticalityDiagnostics; // ie->value.choice.CriticalityDiagnostics = ; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* S1AP_E_RABSetupListBearerSURes_t e_RABSetupListBearerSURes; @@ -1063,14 +1063,14 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABModifyResponseIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_E_RABModifyResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABModifyResponseIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABModifyResponseIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = e_rab_modify_resp_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (e_rab_modify_resp_p->nb_of_e_rabs > 0) { @@ -1087,10 +1087,10 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance, item->value.present = S1AP_E_RABModifyItemBearerModResIEs__value_PR_E_RABModifyItemBearerModRes; item->value.choice.E_RABModifyItemBearerModRes.e_RAB_ID = e_rab_modify_resp_p->e_rabs[i].e_rab_id; S1AP_DEBUG("e_rab_modify_resp: modified e_rab ID %ld\n", item->value.choice.E_RABModifyItemBearerModRes.e_RAB_ID); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABModifyListBearerModRes.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABModifyListBearerModRes.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1136,10 +1136,10 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance, } S1AP_DEBUG("e_rab_modify_resp: failed e_rab ID %ld\n", item->value.choice.E_RABItem.e_RAB_ID); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABList.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABList.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1149,7 +1149,7 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABModifyResponseIEs__value_PR_CriticalityDiagnostics; // ie->value.choice.CriticalityDiagnostics = ; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } fprintf(stderr, "start encode\n"); @@ -1205,14 +1205,14 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABReleaseResponseIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_E_RABReleaseResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABReleaseResponseIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_E_RABReleaseResponseIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = e_rab_release_resp_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* optional */ if (e_rab_release_resp_p->nb_of_e_rabs_released > 0) { @@ -1229,10 +1229,10 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance, item->value.present = S1AP_E_RABReleaseItemBearerRelCompIEs__value_PR_E_RABReleaseItemBearerRelComp; item->value.choice.E_RABReleaseItemBearerRelComp.e_RAB_ID = e_rab_release_resp_p->e_rab_release[i].e_rab_id; S1AP_DEBUG("e_rab_release_resp: e_rab ID %ld\n", item->value.choice.E_RABReleaseItemBearerRelComp.e_RAB_ID); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABReleaseListBearerRelComp.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABReleaseListBearerRelComp.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* optional */ @@ -1277,10 +1277,10 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance, break; } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABList.list, item); + asn1cSeqAdd(&ie->value.choice.E_RABList.list, item); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } @@ -1401,7 +1401,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_PathSwitchRequestIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ if (path_switch_req_p->nb_of_e_rabs > 0) { @@ -1438,10 +1438,10 @@ int s1ap_eNB_path_switch_req(instance_t instance, e_RABToBeSwitchedDLItem->transportLayerAddress.buf[3], e_RABToBeSwitchedDLItem->transportLayerAddress.size); - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABToBeSwitchedDLList.list, e_RABToBeSwitchedDLItemIEs); + asn1cSeqAdd(&ie->value.choice.E_RABToBeSwitchedDLList.list, e_RABToBeSwitchedDLItemIEs); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); } /* mandatory */ @@ -1450,7 +1450,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_PathSwitchRequestIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = path_switch_req_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_PathSwitchRequestIEs_t *)calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t)); @@ -1464,7 +1464,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, s1ap_eNB_instance_p->mnc[0], s1ap_eNB_instance_p->mnc_digit_length[0], &ie->value.choice.EUTRAN_CGI.pLMNidentity); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_PathSwitchRequestIEs_t *)calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t)); @@ -1477,7 +1477,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, s1ap_eNB_instance_p->mnc[0], s1ap_eNB_instance_p->mnc_digit_length[0], &ie->value.choice.TAI.pLMNidentity); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_PathSwitchRequestIEs_t *)calloc(1, sizeof(S1AP_PathSwitchRequestIEs_t)); @@ -1488,7 +1488,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, &ie->value.choice.UESecurityCapabilities.encryptionAlgorithms); INTPROTALG_TO_BIT_STRING(path_switch_req_p->security_capabilities.integrity_algorithms, &ie->value.choice.UESecurityCapabilities.integrityProtectionAlgorithms); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { S1AP_ERROR("Failed to encode Path Switch Req \n"); @@ -1582,14 +1582,14 @@ int s1ap_eNB_path_switch_req(instance_t instance, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = e_rab_modification_ind->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = e_rab_modification_ind->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); //E-RABs to be modified list ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); @@ -1617,10 +1617,10 @@ int s1ap_eNB_path_switch_req(instance_t instance, INT32_TO_OCTET_STRING(e_rab_modification_ind->e_rabs_tobemodified[i].gtp_teid, &E_RAB_ToBeModifiedItem_BearerModInd->dL_GTP_TEID); } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABToBeModifiedListBearerModInd.list, E_RAB_ToBeModifiedItem_BearerModInd_IEs); + asn1cSeqAdd(&ie->value.choice.E_RABToBeModifiedListBearerModInd.list, E_RAB_ToBeModifiedItem_BearerModInd_IEs); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); //E-RABs NOT to be modified list ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); @@ -1649,7 +1649,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, INT32_TO_OCTET_STRING(e_rab_modification_ind->e_rabs_nottobemodified[i].gtp_teid, &E_RAB_NotToBeModifiedItem_BearerModInd->dL_GTP_TEID); } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABNotToBeModifiedListBearerModInd.list, E_RAB_NotToBeModifiedItem_BearerModInd_IEs); + asn1cSeqAdd(&ie->value.choice.E_RABNotToBeModifiedListBearerModInd.list, E_RAB_NotToBeModifiedItem_BearerModInd_IEs); } } else{ @@ -1659,7 +1659,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_CSGMembershipInfo; @@ -1667,7 +1667,7 @@ int s1ap_eNB_path_switch_req(instance_t instance, ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_CSGMembershipInfo; ie->value.choice.CSGMembershipInfo.cSGMembershipStatus = S1AP_CSGMembershipStatus_member; INT32_TO_BIT_STRING(CSG_id, &ie->value.choice.CSGMembershipInfo.cSG_Id); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (s1ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { @@ -1736,14 +1736,14 @@ int s1ap_eNB_generate_E_RAB_Modification_Indication( ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = e_rab_modification_ind->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID; ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_E_RABModificationIndicationIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = e_rab_modification_ind->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); //E-RABs to be modified list ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); @@ -1771,10 +1771,10 @@ int s1ap_eNB_generate_E_RAB_Modification_Indication( INT32_TO_OCTET_STRING(e_rab_modification_ind->e_rabs_tobemodified[i].gtp_teid, &E_RAB_ToBeModifiedItem_BearerModInd->dL_GTP_TEID); } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABToBeModifiedListBearerModInd.list, E_RAB_ToBeModifiedItem_BearerModInd_IEs); + asn1cSeqAdd(&ie->value.choice.E_RABToBeModifiedListBearerModInd.list, E_RAB_ToBeModifiedItem_BearerModInd_IEs); } - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); //E-RABs NOT to be modified list /*ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); @@ -1804,7 +1804,7 @@ int s1ap_eNB_generate_E_RAB_Modification_Indication( INT32_TO_OCTET_STRING(pseudo_gtp_teid, &E_RAB_NotToBeModifiedItem_BearerModInd->dL_GTP_TEID); } - ASN_SEQUENCE_ADD(&ie->value.choice.E_RABNotToBeModifiedListBearerModInd.list, E_RAB_NotToBeModifiedItem_BearerModInd_IEs); + asn1cSeqAdd(&ie->value.choice.E_RABNotToBeModifiedListBearerModInd.list, E_RAB_NotToBeModifiedItem_BearerModInd_IEs); } // } //else{ @@ -1814,7 +1814,7 @@ int s1ap_eNB_generate_E_RAB_Modification_Indication( - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);*/ + asn1cSeqAdd(&out->protocolIEs.list, ie);*/ /*ie = (S1AP_E_RABModificationIndicationIEs_t *)calloc(1, sizeof(S1AP_E_RABModificationIndicationIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_CSGMembershipInfo; @@ -1824,7 +1824,7 @@ int s1ap_eNB_generate_E_RAB_Modification_Indication( INT32_TO_BIT_STRING(CSG_id, &ie->value.choice.CSGMembershipInfo.cSG_Id); ie->value.choice.CSGMembershipInfo.cSG_Id.bits_unused=5; ie->value.choice.CSGMembershipInfo.cellAccessMode = S1AP_CellAccessMode_hybrid; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);*/ + asn1cSeqAdd(&out->protocolIEs.list, ie);*/ if (s1ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { S1AP_ERROR("Failed to encode S1 E-RAB modification indication \n"); diff --git a/openair3/S1AP/s1ap_eNB_trace.c b/openair3/S1AP/s1ap_eNB_trace.c index de84682ec1..38787a6999 100644 --- a/openair3/S1AP/s1ap_eNB_trace.c +++ b/openair3/S1AP/s1ap_eNB_trace.c @@ -66,7 +66,7 @@ void s1ap_eNB_generate_trace_failure(struct s1ap_eNB_ue_context_s *ue_desc_p, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_TraceFailureIndicationIEs__value_PR_MME_UE_S1AP_ID; ie->value.choice.MME_UE_S1AP_ID = ue_desc_p->mme_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_TraceFailureIndicationIEs_t *)calloc(1, sizeof(S1AP_TraceFailureIndicationIEs_t)); @@ -74,7 +74,7 @@ void s1ap_eNB_generate_trace_failure(struct s1ap_eNB_ue_context_s *ue_desc_p, ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_TraceFailureIndicationIEs__value_PR_ENB_UE_S1AP_ID; ie->value.choice.ENB_UE_S1AP_ID = ue_desc_p->eNB_ue_s1ap_id; - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_TraceFailureIndicationIEs_t *)calloc(1, sizeof(S1AP_TraceFailureIndicationIEs_t)); @@ -82,7 +82,7 @@ void s1ap_eNB_generate_trace_failure(struct s1ap_eNB_ue_context_s *ue_desc_p, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_TraceFailureIndicationIEs__value_PR_E_UTRAN_Trace_ID; memcpy(&ie->value.choice.E_UTRAN_Trace_ID, trace_id, sizeof(S1AP_E_UTRAN_Trace_ID_t)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); /* mandatory */ ie = (S1AP_TraceFailureIndicationIEs_t *)calloc(1, sizeof(S1AP_TraceFailureIndicationIEs_t)); @@ -90,7 +90,7 @@ void s1ap_eNB_generate_trace_failure(struct s1ap_eNB_ue_context_s *ue_desc_p, ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_TraceFailureIndicationIEs__value_PR_Cause; memcpy(&ie->value.choice.Cause, cause_p, sizeof(S1AP_Cause_t)); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + asn1cSeqAdd(&out->protocolIEs.list, ie); if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { return; From 21ef822c4519c2dc5b2969c7d037bea70c65ecd6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 9 Jan 2023 15:54:42 +0100 Subject: [PATCH 25/39] Shorten IP address buffer to avoid strncpy() warning --- openair2/F1AP/f1ap_du_ue_context_management.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c index 05b4effbc0..4be90a9c15 100644 --- a/openair2/F1AP/f1ap_du_ue_context_management.c +++ b/openair2/F1AP/f1ap_du_ue_context_management.c @@ -1170,12 +1170,14 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, extern instance_t DUuniqInstance; if (DUuniqInstance == 0) { - char gtp_tunnel_ip_address[128]; - sprintf(gtp_tunnel_ip_address, "%d.%d.%d.%d", - drb_p->up_ul_tnl[0].tl_address & 0xff, - (drb_p->up_ul_tnl[0].tl_address >> 8) & 0xff, - (drb_p->up_ul_tnl[0].tl_address >> 16) & 0xff, - (drb_p->up_ul_tnl[0].tl_address >> 24) & 0xff); + char gtp_tunnel_ip_address[32]; + snprintf(gtp_tunnel_ip_address, + sizeof(gtp_tunnel_ip_address), + "%d.%d.%d.%d", + drb_p->up_ul_tnl[0].tl_address & 0xff, + (drb_p->up_ul_tnl[0].tl_address >> 8) & 0xff, + (drb_p->up_ul_tnl[0].tl_address >> 16) & 0xff, + (drb_p->up_ul_tnl[0].tl_address >> 24) & 0xff); getCxt(DUtype, instance)->gtpInst=du_create_gtpu_instance_to_cu( gtp_tunnel_ip_address, getCxt(false,instance)->setupReq.CUport, From 89bddc76f0ff84739872d71f5bd9a8be4760de98 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 11 Jan 2023 10:10:02 +0100 Subject: [PATCH 26/39] addressing reviewer comments --- CMakeLists.txt | 5 -- openair3/CMakeLists.txt | 2 +- openair3/NRPPA/CMakeLists.txt | 4 ++ openair3/NRPPA/main_nrppa.c | 91 ----------------------------------- openair3/NRPPA/test_nrppa.c | 86 +++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 97 deletions(-) delete mode 100755 openair3/NRPPA/main_nrppa.c create mode 100755 openair3/NRPPA/test_nrppa.c diff --git a/CMakeLists.txt b/CMakeLists.txt index dd4d7161e3..014a67c9f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -525,11 +525,6 @@ target_link_libraries(f1ap PRIVATE ngap nr_rrc) ############## # target asn1_lpp in openair3/LPP/MESSAGES/CMakeLists.txt used below -# NRPPA -############## -add_executable(main_nrppa ${OPENAIR3_DIR}/NRPPA/main_nrppa.c ) -target_link_libraries(main_nrppa asn1_nrppa) - # Hardware dependant options ################################### add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4") diff --git a/openair3/CMakeLists.txt b/openair3/CMakeLists.txt index be9574aef6..555ca7cbc8 100644 --- a/openair3/CMakeLists.txt +++ b/openair3/CMakeLists.txt @@ -2,4 +2,4 @@ add_subdirectory(LPP) add_subdirectory(M3AP) add_subdirectory(S1AP) add_subdirectory(NGAP) -add_subdirectory(NRPPA) \ No newline at end of file +add_subdirectory(NRPPA) diff --git a/openair3/NRPPA/CMakeLists.txt b/openair3/NRPPA/CMakeLists.txt index 7537bd661d..613cbfc3ce 100644 --- a/openair3/NRPPA/CMakeLists.txt +++ b/openair3/NRPPA/CMakeLists.txt @@ -1 +1,5 @@ add_subdirectory(MESSAGES) + +add_executable(test_nrppa ${OPENAIR3_DIR}/NRPPA/test_nrppa.c ) +target_link_libraries(test_nrppa asn1_nrppa) + diff --git a/openair3/NRPPA/main_nrppa.c b/openair3/NRPPA/main_nrppa.c deleted file mode 100755 index 7f4995726a..0000000000 --- a/openair3/NRPPA/main_nrppa.c +++ /dev/null @@ -1,91 +0,0 @@ -#include -#include -#include -#include -/* - * This is a custom function which writes the - * encoded output into some FILE stream. - */ - -static int write_out(const void *buffer, size_t size, void *app_key) { - FILE *out_fp = app_key; - size_t wrote; - - wrote = fwrite(buffer, 1, size, out_fp); - - return (wrote == size) ? 0 : -1; -} - -int main(int ac, char **av) { - NRPPA_MeasurementRequest_t *NRPPA_MeasurementRequest; /* Type to encode */ - asn_enc_rval_t ec; /* Encoder return value */ - - /* Allocate the NRPPA_MeasurementRequest_t */ - NRPPA_MeasurementRequest = calloc(1, sizeof(NRPPA_MeasurementRequest_t)); /* not malloc! */ - if(!NRPPA_MeasurementRequest) { - perror("calloc() failed"); - exit(71); /* better, EX_OSERR */ - } - - NRPPA_MeasurementRequest_IEs_t xyz; - ASN_SEQUENCE_ADD(&NRPPA_MeasurementRequest->protocolIEs.list,&xyz); - - - /* MeasurementRequest ::= SEQUENCE { - protocolIEs ProtocolIE-Container {{MeasurementRequest-IEs}}, - ... - } */ - - /* Protocl IE container - id-LMF-Measurement-ID ProtocolIE-ID ::= 39 - id-RAN-Measurement-ID ProtocolIE-ID ::= 40 - ID id-TRP-MeasurementRequestList ProtocolIE-ID ::= 41 - ID id-ReportCharacteristics ProtocolIE-ID ::= 3 - ID id-MeasurementPeriodicity ProtocolIE-ID ::= 4 - ID id-TRPMeasurementQuantities ProtocolIE-ID ::= 52 - */ - NRPPA_MeasurementRequest->protocolIEs; - - /* Context for parsing across buffer boundaries */ - NRPPA_MeasurementRequest->_asn_ctx; - - /* BER encode the data if filename is given */ - if(ac < 2) { - fprintf(stderr, "Specify filename for BER output\n"); - } else { - const char *filename = av[1]; - FILE *fp = fopen(filename, "wb"); /* for BER output */ - - if(!fp) { - perror(filename); - exit(71); /* better, EX_OSERR */ - } - - -//asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor, -// const void *struct_ptr, /* Structure to be encoded */ -// asn_app_consume_bytes_f *consume_bytes_cb, -// void *app_key /* Arbitrary callback argument */); - - /* Encode the NRPPA_MeasurementRequest type as BER (DER) */ - ec = der_encode(&asn_DEF_NRPPA_MeasurementRequest, NRPPA_MeasurementRequest, write_out, fp); - - fclose(fp); - if(ec.encoded == -1) { - fprintf(stderr, - "Could not encode NRPPA_MeasurementRequest (at %s)\n", - ec.failed_type ? ec.failed_type->name : "unknown"); - exit(65); /* better, EX_DATAERR */ - } else { - fprintf(stderr, "Created %s with BER encoded NRPPA_MeasurementRequest\n", - filename); - } - } - - /* Also print the constructed NRPPA_MeasurementRequest XER encoded (XML) */ - xer_fprint(stdout, &asn_DEF_NRPPA_MeasurementRequest, NRPPA_MeasurementRequest); - - return 0; /* Encoding finished successfully */ -} - - diff --git a/openair3/NRPPA/test_nrppa.c b/openair3/NRPPA/test_nrppa.c new file mode 100755 index 0000000000..850d3db71b --- /dev/null +++ b/openair3/NRPPA/test_nrppa.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +/* + * This is a custom function which writes the + * encoded output into some FILE stream. + */ + +static int write_out(const void *buffer, size_t size, void *app_key) +{ + FILE *out_fp = app_key; + size_t wrote; + + wrote = fwrite(buffer, 1, size, out_fp); + + return (wrote == size) ? 0 : -1; +} + +int main(int ac, char **av) +{ + NRPPA_MeasurementRequest_t *NRPPA_MeasurementRequest; /* Type to encode */ + asn_enc_rval_t ec; /* Encoder return value */ + + /* Allocate the NRPPA_MeasurementRequest_t */ + NRPPA_MeasurementRequest = calloc(1, sizeof(NRPPA_MeasurementRequest_t)); /* not malloc! */ + if (!NRPPA_MeasurementRequest) { + perror("calloc() failed"); + exit(71); /* better, EX_OSERR */ + } + + NRPPA_MeasurementRequest_IEs_t xyz; + ASN_SEQUENCE_ADD(&NRPPA_MeasurementRequest->protocolIEs.list, &xyz); + + /* MeasurementRequest ::= SEQUENCE { +protocolIEs ProtocolIE-Container {{MeasurementRequest-IEs}}, +... +} */ + + /* Protocl IE container + id-LMF-Measurement-ID ProtocolIE-ID ::= 39 + id-RAN-Measurement-ID ProtocolIE-ID ::= 40 + ID id-TRP-MeasurementRequestList ProtocolIE-ID ::= 41 + ID id-ReportCharacteristics ProtocolIE-ID ::= 3 + ID id-MeasurementPeriodicity ProtocolIE-ID ::= 4 + ID id-TRPMeasurementQuantities ProtocolIE-ID ::= 52 + */ + //NRPPA_MeasurementRequest->protocolIEs; + + /* Context for parsing across buffer boundaries */ + //NRPPA_MeasurementRequest->_asn_ctx; + + /* BER encode the data if filename is given */ + if (ac < 2) { + fprintf(stderr, "Specify filename for BER output\n"); + } else { + const char *filename = av[1]; + FILE *fp = fopen(filename, "wb"); /* for BER output */ + + if (!fp) { + perror(filename); + exit(71); /* better, EX_OSERR */ + } + + // asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor, + // const void *struct_ptr, /* Structure to be encoded */ + // asn_app_consume_bytes_f *consume_bytes_cb, + // void *app_key /* Arbitrary callback argument */); + + /* Encode the NRPPA_MeasurementRequest type as BER (DER) */ + ec = der_encode(&asn_DEF_NRPPA_MeasurementRequest, NRPPA_MeasurementRequest, write_out, fp); + + fclose(fp); + if (ec.encoded == -1) { + fprintf(stderr, "Could not encode NRPPA_MeasurementRequest (at %s)\n", ec.failed_type ? ec.failed_type->name : "unknown"); + exit(65); /* better, EX_DATAERR */ + } else { + fprintf(stderr, "Created %s with BER encoded NRPPA_MeasurementRequest\n", filename); + } + } + + /* Also print the constructed NRPPA_MeasurementRequest XER encoded (XML) */ + xer_fprint(stdout, &asn_DEF_NRPPA_MeasurementRequest, NRPPA_MeasurementRequest); + + return 0; /* Encoding finished successfully */ +} From affa5e3086866de2715732149aa6a394b7ed2fea Mon Sep 17 00:00:00 2001 From: Adeel Malik Date: Wed, 11 Jan 2023 11:12:19 +0100 Subject: [PATCH 27/39] bugfix in function channelmod_modify_cmd --- openair1/SIMULATION/TOOLS/random_channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 822d5c1aa5..3aad57f015 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -2162,7 +2162,7 @@ static int channelmod_show_cmd(char *buff, int debug, telnet_printfunc_t prnt) { static int channelmod_modify_cmd(char *buff, int debug, telnet_printfunc_t prnt) { char *param=NULL, *value=NULL; int cd_id= -1; - int s = sscanf(buff, "%*s %*s %i %ms %ms \n", &cd_id, ¶m, &value); + int s = sscanf(buff, "%i %ms %ms \n", &cd_id, ¶m, &value); if (cd_id<0 || cd_id >= max_chan) { prnt("ERROR, %i: Channel model id outof range (0-%i)\n",cd_id,max_chan-1); From ce03b84898eb7d228253e73d948067479ec9ce52 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 15 Dec 2022 07:54:09 +0100 Subject: [PATCH 28/39] Add new SSH/local cmd classes --- ci-scripts/cls_cmd.py | 217 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 ci-scripts/cls_cmd.py diff --git a/ci-scripts/cls_cmd.py b/ci-scripts/cls_cmd.py new file mode 100644 index 0000000000..12eb75e7da --- /dev/null +++ b/ci-scripts/cls_cmd.py @@ -0,0 +1,217 @@ +#/* +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ +#--------------------------------------------------------------------- +# +# Required Python Version +# Python 3.x +# +#--------------------------------------------------------------------- + +import abc +import logging +import subprocess as sp +import os +import paramiko +import uuid + +# provides a partial interface for the legacy SSHconnection class (getBefore(), command()) +class Cmd(metaclass=abc.ABCMeta): + def cd(self, d, silent=False): + if d == None or d == '' or d == []: + self.cwd = None + elif d[0] == '/': + self.cwd = d + else: + if not self.cwd: + # no cwd set: get current working directory + self.cwd = self.run('pwd').stdout.strip() + self.cwd += f"/{d}" + if not silent: + logging.debug(f'cd {self.cwd}') + + @abc.abstractmethod + def run(self, line, timeout=300, silent=False): + return + + @abc.abstractmethod + def command(self, commandline, expectedline, timeout, silent=False, resync=False): + return + + @abc.abstractmethod + def close(self): + return + + @abc.abstractmethod + def getBefore(self): + return + + @abc.abstractmethod + def copyin(self, scpIp, scpUser, scpPw, src, tgt): + return + + @abc.abstractmethod + def copyout(self, scpIp, scpUser, scpPw, src, tgt): + return + +class LocalCmd(Cmd): + def __init__(self, d = None): + self.cwd = d + self.cp = sp.CompletedProcess(args='', returncode=0, stdout='') + + def run(self, line, timeout=300, silent=False, reportNonZero=True): + if type(line) is str: + line = [s for s in line.split(' ') if len(s) > 0] + if not silent: + logging.debug(' '.join(line)) + try: + ret = sp.run(line, cwd=self.cwd, stdout=sp.PIPE, stderr=sp.STDOUT, timeout=timeout) + except Exception as e: + ret = sp.CompletedProcess(args=line, returncode=255, stdout=f'Exception: {str(e)}'.encode('utf-8')) + if ret.stdout is None: + ret.stdout = b'' + ret.stdout = ret.stdout.decode('utf-8').strip() + if reportNonZero and ret.returncode != 0: + cmd = ' '.join(ret.args) + logging.warning(f'command "{cmd}" returned non-zero returncode {ret.returncode}: output:\n{ret.stdout}') + self.cp = ret + return ret + + def command(self, commandline, expectedline=None, timeout=300, silent=False, resync=False): + line = [s for s in commandline.split(' ') if len(s) > 0] + if line[0] == 'cd': + self.cd(line[1], silent) + else: + self.run(line, timeout, silent) + return 0 + + def close(self): + pass + + def getBefore(self): + return self.cp.stdout + + def copyin(self, scpIp, scpUser, scpPw, src, tgt): + logging.warning("LocalCmd emulating sshconnection.copyin() function") + self.run(f'cp -r {src} {tgt}') + + def copyout(self, scpIp, scpUser, scpPw, src, tgt): + logging.warning("LocalCmd emulating sshconnection.copyout() function") + self.run(f'cp -r {src} {tgt}') + +class RemoteCmd(Cmd): + def __init__(self, hostname, d=None): + logging.getLogger('paramiko').setLevel(logging.INFO) # prevent spamming through Paramiko + self.client = paramiko.SSHClient() + self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + cfg = RemoteCmd._lookup_ssh_config(hostname) + self.client.connect(**cfg) + self.cwd = d + self.cp = sp.CompletedProcess(args='', returncode=0, stdout='') + + def _lookup_ssh_config(hostname): + ssh_config = paramiko.SSHConfig() + user_config_file = os.path.expanduser("~/.ssh/config") + if os.path.exists(user_config_file): + with open(user_config_file) as f: + ssh_config.parse(f) + else: + raise FileNotFoundError('class needs SSH config at ~/.ssh/config') + ucfg = ssh_config.lookup(hostname) + if 'identityfile' not in ucfg or 'user' not in ucfg: + raise KeyError(f'no identityfile or user in SSH config for host {hostname}') + cfg = {'hostname':hostname, 'username':ucfg['user'], 'key_filename':ucfg['identityfile']} + if 'hostname' in ucfg: + cfg['hostname'] = ucfg['hostname'] # override user-given hostname with what is in config + if 'port' in ucfg: + cfg['port'] = int(ucfg['port']) + if 'proxycommand' in ucfg: + cfg['sock'] = paramiko.ProxyCommand(ucfg['proxycommand']) + return cfg + + def run(self, line, timeout=300, silent=False, reportNonZero=True): + if type(line) is list: + line = ' '.join(line) + if not silent: + logging.debug(line) + if self.cwd: + line = f"cd {self.cwd} && {line}" + args = line.split(' ') + try: + stdin, stdout, stderr = self.client.exec_command(line, timeout=timeout) + ret = sp.CompletedProcess(args=args, returncode=stdout.channel.recv_exit_status(), stdout=stdout.read(size=None) + stderr.read(size=None)) + except Exception as e: + ret = sp.CompletedProcess(args=args, returncode=255, stdout=f'Exception: {str(e)}'.encode('utf-8')) + ret.stdout = ret.stdout.decode('utf-8').strip() + if reportNonZero and ret.returncode != 0: + cmd = ' '.join(ret.args) + logging.warning(f'command "{cmd}" returned non-zero returncode {ret.returncode}: output:\n{ret.stdout}') + self.cp = ret + return ret + + def command(self, commandline, expectedline=None, timeout=300, silent=False, resync=False): + line = [s for s in commandline.split(' ') if len(s) > 0] + if line[0] == 'cd': + self.cd(line[1], silent) + else: + self.run(line, timeout, silent) + return 0 + + def close(self): + self.client.close() + + def getBefore(self): + return self.cp.stdout + + def copyout(self, src, tgt, recursive=False): + logging.warning("RemoteCmd emulating sshconnection.copyout() function, ignoring scpIp") + logging.debug(f"copyout: local:{src} -> remote:{tgt}") + if recursive: + tmpfile = f"{uuid.uuid4()}.tar" + abstmpfile = f"/tmp/{tmpfile}" + cmd = LocalCmd() + cmd.run(f"tar -cf {abstmpfile} {src}") + sftp = self.client.open_sftp() + sftp.put(abstmpfile, abstmpfile) + sftp.close() + cmd.run(f"rm {abstmpfile}") + self.run(f"mv {abstmpfile} {tgt}; cd {tgt} && tar -xf {tmpfile} && rm {tmpfile}") + else: + sftp = self.client.open_sftp() + sftp.put(src, tgt) + sftp.close() + + def copyin(self, src, tgt, recursive=False): + logging.warning("RemoteCmd emulating sshconnection.copyout() function") + logging.debug(f"copyin: remote:{src} -> local:{tgt}") + if recursive: + tmpfile = f"{uuid.uuid4()}.tar" + abstmpfile = f"/tmp/{tmpfile}" + self.run(f"tar -cf {abstmpfile} {src}") + sftp = self.client.open_sftp() + sftp.get(abstmpfile, abstmpfile) + sftp.close() + self.run(f"rm {abstmpfile}") + cmd = LocalCmd() + cmd.run(f"mv {abstmpfile} {tgt}; cd {tgt} && tar -xf {tmpfile} && rm {tmpfile}") + else: + sftp = self.client.open_sftp() + sftp.get(src, tgt) + sftp.close() From de4a9e1d5a5ea09253dec2ce5f1b79f12c111f89 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 15 Dec 2022 07:54:17 +0100 Subject: [PATCH 29/39] Use new SSH class to execute cluster build --- ci-scripts/cls_cluster.py | 287 ++++++++++++++++++-------------------- 1 file changed, 137 insertions(+), 150 deletions(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 5eea6a1953..80f7326338 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -32,16 +32,13 @@ # Import #----------------------------------------------------------- import logging -import sshconnection as SSH import cls_oai_html -#import os import re import time -#import subprocess -import sys import constants as CONST import helpreadme as HELP import cls_containerize +import cls_cmd class Cluster: def __init__(self): @@ -58,86 +55,82 @@ class Cluster: self.ranCommitID = "" self.ranAllowMerge = False self.ranTargetBranch = "" + self.cmd = None - def _recreate_entitlements(self, sshSession): + + def _recreate_entitlements(self): # recreating entitlements, don't care if deletion fails - sshSession.command('oc delete secret etc-pki-entitlement', '\$', 5) - if re.search(r"not found", sshSession.getBefore()): - logging.warning("no secrets etc-pki-entitlement found, recreating") - sshSession.command('ls /etc/pki/entitlement/???????????????????.pem | tail -1', '\$', 5, silent=True) - regres1 = re.search(r"/etc/pki/entitlement/[0-9]+.pem", sshSession.getBefore()) - sshSession.command('ls /etc/pki/entitlement/???????????????????-key.pem | tail -1', '\$', 5, silent=True) - regres2 = re.search(r"/etc/pki/entitlement/[0-9]+-key.pem", sshSession.getBefore()) + self.cmd.run('oc delete secret etc-pki-entitlement') + ret = self.cmd.run('ls /etc/pki/entitlement/???????????????????.pem | tail -1', silent=True) + regres1 = re.search(r"/etc/pki/entitlement/[0-9]+.pem", ret.stdout) + ret = self.cmd.run('ls /etc/pki/entitlement/???????????????????-key.pem | tail -1', silent=True) + regres2 = re.search(r"/etc/pki/entitlement/[0-9]+-key.pem", ret.stdout) if regres1 is None or regres2 is None: logging.error("could not find entitlements") return False file1 = regres1.group(0) file2 = regres2.group(0) - sshSession.command(f'oc create secret generic etc-pki-entitlement --from-file {file1} --from-file {file2}', '\$', 5) - regres = re.search(r"secret/etc-pki-entitlement created", sshSession.getBefore()) - if regres is None: + ret = self.cmd.run(f'oc create secret generic etc-pki-entitlement --from-file {file1} --from-file {file2}') + regres = re.search(r"secret/etc-pki-entitlement created", ret.stdout) + if ret.returncode != 0 or regres is None: logging.error("could not create secret/etc-pki-entitlement") return False return True - def _recreate_bc(self, sshSession, name, newTag, filename): - self._retag_image_statement(sshSession, name, name, newTag, filename) - sshSession.command(f'oc delete -f {filename}', '\$', 5) - sshSession.command(f'oc create -f {filename}', '\$', 5) - before = sshSession.getBefore() - if re.search('buildconfig.build.openshift.io/[a-zA-Z\-0-9]+ created', before) is not None: + def _recreate_bc(self, name, newTag, filename): + self._retag_image_statement(name, name, newTag, filename) + self.cmd.run(f'oc delete -f {filename}') + ret = self.cmd.run(f'oc create -f {filename}') + if re.search('buildconfig.build.openshift.io/[a-zA-Z\-0-9]+ created', ret.stdout) is not None: return True - logging.error('error while creating buildconfig: ' + sshSession.getBefore()) + logging.error('error while creating buildconfig: ' + ret.stdout) return False - def _recreate_is_tag(self, sshSession, name, newTag, filename): - sshSession.command(f'oc describe is {name}', '\$', 5) - if sshSession.getBefore().count('NotFound') > 0: - sshSession.command(f'oc create -f {filename}', '\$', 5) - before = sshSession.getBefore() - if re.search(f'imagestream.image.openshift.io/{name} created', before) is None: - logging.error('error while creating imagestream: ' + sshSession.getBefore()) + def _recreate_is_tag(self, name, newTag, filename): + ret = self.cmd.run(f'oc describe is {name}') + if ret.returncode != 0: + ret = self.cmd.run(f'oc create -f {filename}') + if ret.returncode != 0: + logging.error(f'error while creating imagestream: {ret.stdout}') return False else: logging.debug(f'-> imagestream {name} found') image = f'{name}:{newTag}' - sshSession.command(f'oc delete istag {image}', '\$', 5) # we don't care if this fails, e.g., if it is missing - sshSession.command(f'oc create istag {image}', '\$', 5) - before = sshSession.getBefore() - if re.search(f'imagestreamtag.image.openshift.io/{image} created', before) is not None: + self.cmd.run(f'oc delete istag {image}', reportNonZero=False) # we don't care if this fails, e.g., if it is missing + ret = self.cmd.run(f'oc create istag {image}') + if ret.returncode == 0: return True - logging.error('error while creating imagestreamtag: ' + sshSession.getBefore()) + logging.error(f'error while creating imagestreamtag: {ret.stdout}') return False - def _start_build(self, sshSession, name): + def _start_build(self, name): # will return "immediately" but build runs in background # if multiple builds are started at the same time, this can take some time, however - ret = sshSession.command(f'oc start-build {name} --from-file={self.eNBSourceCodePath}', '\$', 300) - before = sshSession.getBefore() - regres = re.search(r'build.build.openshift.io/(?P[a-zA-Z0-9\-]+) started', str(before)) - if ret != 0 or before.count('Uploading finished') != 1 or regres is None: - logging.error("error during oc start-build: " + sshSession.getBefore()) - self._delete_pod(sshSession, name) + ret = self.cmd.run(f'oc start-build {name} --from-file={self.eNBSourceCodePath}') + regres = re.search(r'build.build.openshift.io/(?P[a-zA-Z0-9\-]+) started', ret.stdout) + if ret.returncode != 0 or ret.stdout.count('Uploading finished') != 1 or regres is None: + logging.error(f"error during oc start-build: {ret.stdout}") + self._delete_pod(name) return None return regres.group('jobname') + '-build' - def _delete_pod(self, sshSession, shortName): - sshSession.command(f"oc get pods | grep {shortName}", '\$', 5) - regres = re.search(rf'{shortName}-[0-9]+-build', sshSession.getBefore()) + def _delete_pod(self, shortName): + ret = self.cmd.run(f"oc get pods | grep {shortName}") + regres = re.search(rf'{shortName}-[0-9]+-build', ret.stdout) if regres is not None: - sshSession.command(f"oc delete pod {regres.group(0)}", '\$', 5) + self.cmd.run(f"oc delete pod {regres.group(0)}") else: logging.warning(f"no pod found with name {shortName}") - def _wait_build_end(self, sshSession, jobs, timeout_sec, check_interval_sec = 5): + def _wait_build_end(self, jobs, timeout_sec, check_interval_sec = 5): logging.debug(f"waiting for jobs {jobs} to finish building") while timeout_sec > 0: # check status for j in jobs: - sshSession.command(f'oc get pods | grep {j}', '\$', 30, silent = True) - if sshSession.getBefore().count('Completed') > 0: jobs.remove(j) - if sshSession.getBefore().count('Error') > 0: - logging.error(f'error for job {j}: ' + sshSession.getBefore()) + ret = self.cmd.run(f'oc get pods | grep {j}', silent = True) + if ret.stdout.count('Completed') > 0: jobs.remove(j) + if ret.stdout.count('Error') > 0: + logging.error(f'error for job {j}: {ret.stdout}') return False if jobs == []: logging.debug('all jobs completed') @@ -147,44 +140,43 @@ class Cluster: logging.error(f"timeout while waiting for end of build of {jobs}") return False - def _retag_image_statement(self, sshSession, oldImage, newImage, newTag, filename): - sshSession.command(f'sed -i -e "s#{oldImage}:latest#{newImage}:{newTag}#" {filename}', '\$', 5) + def _retag_image_statement(self, oldImage, newImage, newTag, filename): + self.cmd.run(f'sed -i -e "s#{oldImage}:latest#{newImage}:{newTag}#" {filename}') - def _get_image_size(self, sshSession, image, tag): + def _get_image_size(self, image, tag): # get the SHA of the image we built using the image name and its tag - sshSession.command(f'oc describe is {image} | grep -A4 {tag}', '\$', 5) - result = re.search(f'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/(?P{image}@sha256:[a-f0-9]+)', sshSession.getBefore()) + ret = self.cmd.run(f'oc describe is {image} | grep -A4 {tag}') + result = re.search(f'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/(?P{image}@sha256:[a-f0-9]+)', ret.stdout) if result is None: return -1 imageSha = result.group("imageSha") # retrieve the size - sshSession.command(f'oc get -o json isimage {imageSha} | jq -Mc "{{dockerImageSize: .image.dockerImageMetadata.Size}}"', '\$', 5) - result = re.search('{"dockerImageSize":(?P[0-9]+)}', str(sshSession.getBefore())) + ret = self.cmd.run(f'oc get -o json isimage {imageSha} | jq -Mc "{{dockerImageSize: .image.dockerImageMetadata.Size}}"') + result = re.search('{"dockerImageSize":(?P[0-9]+)}', ret.stdout) if result is None: return -1 return int(result.group("size")) - def _deploy_pod(self, sshSession, filename, timeout = 30): - sshSession.command(f'oc create -f {filename}', '\$', 10) - result = re.search(f'pod/(?P[a-zA-Z0-9_\-]+) created', sshSession.getBefore()) + def _deploy_pod(self, filename, timeout = 30): + ret = self.cmd.run(f'oc create -f {filename}') + result = re.search(f'pod/(?P[a-zA-Z0-9_\-]+) created', ret.stdout) if result is None: - logging.error(f'could not deploy pod: {sshSession.getBefore()}') + logging.error(f'could not deploy pod: {ret.stdout}') return None pod = result.group("pod") logging.debug(f'checking if pod {pod} is in Running state') while timeout > 0: - sshSession.command(f'oc get pod {pod} -o json | jq -Mc .status.phase', '\$', 5, silent=True) - if re.search('"Running"', sshSession.getBefore()) is not None: return pod + ret = self.cmd.run(f'oc get pod {pod} -o json | jq -Mc .status.phase', silent=True) + if re.search('"Running"', ret.stdout) is not None: return pod timeout -= 1 time.sleep(1) logging.error(f'pod {pod} did not reach Running state') - self._undeploy_pod(sshSession, filename) + self._undeploy_pod(filename) return None - def _undeploy_pod(self, sshSession, filename): - # to save time we start this in the background and trust that oc stops correctly - sshSession.command(f'oc delete -f {filename} &', '\$', 5) + def _undeploy_pod(self, filename): + self.cmd.run(f'oc delete -f {filename}') def BuildClusterImage(self, HTML): if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': @@ -194,8 +186,7 @@ class Cluster: lIpAddr = self.eNBIPAddress lSourcePath = self.eNBSourceCodePath if lIpAddr == '' or lSourcePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter: no SSH Credentials') + sys.exit('Insufficient Parameter: eNBSourceCodePath missing') ocUserName = self.OCUserName ocPassword = self.OCPassword ocProjectName = self.OCProjectName @@ -206,20 +197,18 @@ class Cluster: sys.exit(f'ocRegistry {self.OCRegistry} should not start with http:// or https:// and end on a slash /') logging.debug(f'Building on cluster triggered from server: {lIpAddr}') - mySSH = SSH.SSHConnection() - mySSH.open(lIpAddr, "oaicicd", "SHOULD NOT BE NECESSARY") + self.cmd = cls_cmd.RemoteCmd(lIpAddr) self.testCase_id = HTML.testCase_id # Workaround for some servers, we need to erase completely the workspace if self.forcedWorkspaceCleanup: - mySSH.command(f'rm -Rf {lSourcePath}', '\$', 15) - cls_containerize.CreateWorkspace(mySSH, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) + self.cmd.run(f'rm -Rf {lSourcePath}') + cls_containerize.CreateWorkspace(self.cmd, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) - # we don't necessarily need a forced workspace cleanup, but in - # order to reduce the amount of data send to OpenShift, we + # to reduce the amount of data send to OpenShift, we # manually delete all generated files in the workspace - mySSH.command(f'rm -rf {lSourcePath}/cmake_targets/ran_build', '\$', 30); + self.cmd.run(f'rm -rf {lSourcePath}/cmake_targets/ran_build'); baseTag = 'develop' forceBaseImageBuild = False @@ -227,8 +216,8 @@ class Cluster: if self.ranAllowMerge: # merging MR branch into develop -> temporary image imageTag = 'ci-temp' if self.ranTargetBranch == 'develop': - mySSH.command(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.rhel8.2 | grep --colour=never -i INDEX', '\$', 5) - result = re.search('index', mySSH.getBefore()) + ret = self.cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.rhel8.2 | grep --colour=never -i INDEX') + result = re.search('index', ret.stdout) if result is not None: forceBaseImageBuild = True baseTag = 'ci-temp' @@ -236,122 +225,120 @@ class Cluster: forceBaseImageBuild = True # logging to OC Cluster and then switch to corresponding project - mySSH.command(f'oc login -u {ocUserName} -p {ocPassword} --server {self.OCUrl}', '\$', 31) - if mySSH.getBefore().count('Login successful.') == 0: + ret = self.cmd.run(f'oc login -u {ocUserName} -p {ocPassword}') + if ret.returncode != 0: logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m') - mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL) return False - mySSH.command(f'oc project {ocProjectName}', '\$', 30) - if mySSH.getBefore().count(f'Already on project "{ocProjectName}"') == 0 and mySSH.getBefore().count(f'Now using project "{self.OCProjectName}"') == 0: + ret = self.cmd.run(f'oc project {ocProjectName}') + if ret.returncode != 0: logging.error(f'\u001B[1mUnable to access OC project {ocProjectName}\u001B[0m') - mySSH.command('oc logout', '\$', 30) - mySSH.close() + self.cmd.run('oc logout') HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PROJECT_FAIL) return False - self._recreate_entitlements(mySSH) + self._recreate_entitlements() status = True # flag to abandon compiling if any image fails attemptedImages = [] if forceBaseImageBuild: - self._recreate_is_tag(mySSH, 'ran-base', baseTag, 'openshift/ran-base-is.yaml') - self._recreate_bc(mySSH, 'ran-base', baseTag, 'openshift/ran-base-bc.yaml') - ranbase_job = self._start_build(mySSH, 'ran-base') + self._recreate_is_tag('ran-base', baseTag, 'openshift/ran-base-is.yaml') + self._recreate_bc('ran-base', baseTag, 'openshift/ran-base-bc.yaml') + ranbase_job = self._start_build('ran-base') attemptedImages += ['ran-base'] - status = ranbase_job is not None and self._wait_build_end(mySSH, [ranbase_job], 600) + status = ranbase_job is not None and self._wait_build_end([ranbase_job], 600) if not status: logging.error('failure during build of ran-base') - mySSH.command(f'oc logs {ranbase_job} &> cmake_targets/log/ran-base.log', '\$', 10) + self.cmd.run(f'oc logs {ranbase_job} &> cmake_targets/log/ran-base.log') # cannot use cmd.run because of redirect # recover logs by mounting image - self._retag_image_statement(mySSH, 'ran-base', 'ran-base', baseTag, 'openshift/ran-base-log-retrieval.yaml') - pod = self._deploy_pod(mySSH, 'openshift/ran-base-log-retrieval.yaml') + self._retag_image_statement('ran-base', 'ran-base', baseTag, 'openshift/ran-base-log-retrieval.yaml') + pod = self._deploy_pod('openshift/ran-base-log-retrieval.yaml') if pod is not None: - mySSH.command(f'mkdir -p cmake_targets/log/ran-base', '\$', 5) - mySSH.command(f'oc rsync {pod}:/oai-ran/cmake_targets/log/ cmake_targets/log/ran-base', '\$', 5) - self._undeploy_pod(mySSH, 'openshift/ran-base-log-retrieval.yaml') + self.cmd.run(f'mkdir -p cmake_targets/log/ran-base') + self.cmd.run(f'oc rsync {pod}:/oai-ran/cmake_targets/log/ cmake_targets/log/ran-base') + self._undeploy_pod('openshift/ran-base-log-retrieval.yaml') else: status = False if status: - self._recreate_is_tag(mySSH, 'oai-physim', imageTag, 'openshift/oai-physim-is.yaml') - self._recreate_bc(mySSH, 'oai-physim', imageTag, 'openshift/oai-physim-bc.yaml') - self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.phySim.rhel8.2') - physim_job = self._start_build(mySSH, 'oai-physim') + self._recreate_is_tag('oai-physim', imageTag, 'openshift/oai-physim-is.yaml') + self._recreate_bc('oai-physim', imageTag, 'openshift/oai-physim-bc.yaml') + self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.phySim.rhel8.2') + physim_job = self._start_build('oai-physim') attemptedImages += ['oai-physim'] - self._recreate_is_tag(mySSH, 'ran-build', imageTag, 'openshift/ran-build-is.yaml') - self._recreate_bc(mySSH, 'ran-build', imageTag, 'openshift/ran-build-bc.yaml') - self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.build.rhel8.2') - ranbuild_job = self._start_build(mySSH, 'ran-build') + self._recreate_is_tag('ran-build', imageTag, 'openshift/ran-build-is.yaml') + self._recreate_bc('ran-build', imageTag, 'openshift/ran-build-bc.yaml') + self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.build.rhel8.2') + ranbuild_job = self._start_build('ran-build') attemptedImages += ['ran-build'] - wait = ranbuild_job is not None and physim_job is not None and self._wait_build_end(mySSH, [ranbuild_job, physim_job], 1200) + wait = ranbuild_job is not None and physim_job is not None and self._wait_build_end([ranbuild_job, physim_job], 1200) if not wait: logging.error('error during build of ranbuild_job or physim_job') status = status and wait - mySSH.command(f'oc logs {ranbuild_job} &> cmake_targets/log/ran-build.log', '\$', 10) - mySSH.command(f'oc logs {physim_job} &> cmake_targets/log/oai-physim.log', '\$', 10) - mySSH.command('oc get pods.metrics.k8s.io >> cmake_targets/log/build-metrics.log', '\$', 10) + self.cmd.run(f'oc logs {ranbuild_job} &> cmake_targets/log/ran-build.log') + self.cmd.run(f'oc logs {physim_job} &> cmake_targets/log/oai-physim.log') + self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) if status: - self._recreate_is_tag(mySSH, 'oai-enb', imageTag, 'openshift/oai-enb-is.yaml') - self._recreate_bc(mySSH, 'oai-enb', imageTag, 'openshift/oai-enb-bc.yaml') - self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.eNB.rhel8.2') - self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.eNB.rhel8.2') - enb_job = self._start_build(mySSH, 'oai-enb') + self._recreate_is_tag('oai-enb', imageTag, 'openshift/oai-enb-is.yaml') + self._recreate_bc('oai-enb', imageTag, 'openshift/oai-enb-bc.yaml') + self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.eNB.rhel8.2') + self._retag_image_statement('ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.eNB.rhel8.2') + enb_job = self._start_build('oai-enb') attemptedImages += ['oai-enb'] - self._recreate_is_tag(mySSH, 'oai-gnb', imageTag, 'openshift/oai-gnb-is.yaml') - self._recreate_bc(mySSH, 'oai-gnb', imageTag, 'openshift/oai-gnb-bc.yaml') - self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.gNB.rhel8.2') - self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.gNB.rhel8.2') - gnb_job = self._start_build(mySSH, 'oai-gnb') + self._recreate_is_tag('oai-gnb', imageTag, 'openshift/oai-gnb-is.yaml') + self._recreate_bc('oai-gnb', imageTag, 'openshift/oai-gnb-bc.yaml') + self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.gNB.rhel8.2') + self._retag_image_statement('ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.gNB.rhel8.2') + gnb_job = self._start_build('oai-gnb') attemptedImages += ['oai-gnb'] - self._recreate_is_tag(mySSH, 'oai-gnb-aw2s', imageTag, 'openshift/oai-gnb-aw2s-is.yaml') - self._recreate_bc(mySSH, 'oai-gnb-aw2s', imageTag, 'openshift/oai-gnb-aw2s-bc.yaml') - self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.gNB.aw2s.rhel8.2') - self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.gNB.aw2s.rhel8.2') - gnb_aw2s_job = self._start_build(mySSH, 'oai-gnb-aw2s') + self._recreate_is_tag('oai-gnb-aw2s', imageTag, 'openshift/oai-gnb-aw2s-is.yaml') + self._recreate_bc('oai-gnb-aw2s', imageTag, 'openshift/oai-gnb-aw2s-bc.yaml') + self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.gNB.aw2s.rhel8.2') + self._retag_image_statement('ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.gNB.aw2s.rhel8.2') + gnb_aw2s_job = self._start_build('oai-gnb-aw2s') attemptedImages += ['oai-gnb-aw2s'] - wait = enb_job is not None and gnb_job is not None and gnb_aw2s_job is not None and self._wait_build_end(mySSH, [enb_job, gnb_job, gnb_aw2s_job], 600) + wait = enb_job is not None and gnb_job is not None and gnb_aw2s_job is not None and self._wait_build_end([enb_job, gnb_job, gnb_aw2s_job], 600) if not wait: logging.error('error during build of eNB/gNB') status = status and wait # recover logs - mySSH.command(f'oc logs {enb_job} &> cmake_targets/log/oai-enb.log', '\$', 10) - mySSH.command(f'oc logs {gnb_job} &> cmake_targets/log/oai-gnb.log', '\$', 10) - mySSH.command(f'oc logs {gnb_aw2s_job} &> cmake_targets/log/oai-gnb-aw2s.log', '\$', 10) + self.cmd.run(f'oc logs {enb_job} &> cmake_targets/log/oai-enb.log') + self.cmd.run(f'oc logs {gnb_job} &> cmake_targets/log/oai-gnb.log') + self.cmd.run(f'oc logs {gnb_aw2s_job} &> cmake_targets/log/oai-gnb-aw2s.log') - self._recreate_is_tag(mySSH, 'oai-lte-ue', imageTag, 'openshift/oai-lte-ue-is.yaml') - self._recreate_bc(mySSH, 'oai-lte-ue', imageTag, 'openshift/oai-lte-ue-bc.yaml') - self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.lteUE.rhel8.2') - self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.lteUE.rhel8.2') - lteue_job = self._start_build(mySSH, 'oai-lte-ue') + self._recreate_is_tag('oai-lte-ue', imageTag, 'openshift/oai-lte-ue-is.yaml') + self._recreate_bc('oai-lte-ue', imageTag, 'openshift/oai-lte-ue-bc.yaml') + self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.lteUE.rhel8.2') + self._retag_image_statement('ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.lteUE.rhel8.2') + lteue_job = self._start_build('oai-lte-ue') attemptedImages += ['oai-lte-ue'] - self._recreate_is_tag(mySSH, 'oai-nr-ue', imageTag, 'openshift/oai-nr-ue-is.yaml') - self._recreate_bc(mySSH, 'oai-nr-ue', imageTag, 'openshift/oai-nr-ue-bc.yaml') - self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.nrUE.rhel8.2') - self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.nrUE.rhel8.2') - nrue_job = self._start_build(mySSH, 'oai-nr-ue') + self._recreate_is_tag('oai-nr-ue', imageTag, 'openshift/oai-nr-ue-is.yaml') + self._recreate_bc('oai-nr-ue', imageTag, 'openshift/oai-nr-ue-bc.yaml') + self._retag_image_statement('ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.nrUE.rhel8.2') + self._retag_image_statement('ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.nrUE.rhel8.2') + nrue_job = self._start_build('oai-nr-ue') attemptedImages += ['oai-nr-ue'] - wait = lteue_job is not None and nrue_job is not None and self._wait_build_end(mySSH, [lteue_job, nrue_job], 600) + wait = lteue_job is not None and nrue_job is not None and self._wait_build_end([lteue_job, nrue_job], 600) if not wait: logging.error('error during build of lteUE/nrUE') status = status and wait # recover logs - mySSH.command(f'oc logs {lteue_job} &> cmake_targets/log/oai-lte-ue.log', '\$', 10) - mySSH.command(f'oc logs {nrue_job} &> cmake_targets/log/oai-nr-ue.log', '\$', 10) - mySSH.command('oc get pods.metrics.k8s.io >> cmake_targets/log/build-metrics.log', '\$', 10) + self.cmd.run(f'oc logs {lteue_job} &> cmake_targets/log/oai-lte-ue.log') + self.cmd.run(f'oc logs {nrue_job} &> cmake_targets/log/oai-nr-ue.log') + self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) # split and analyze logs imageSize = {} for image in attemptedImages: - mySSH.command(f'mkdir -p cmake_targets/log/{image}', '\$', 5) - mySSH.command(f'python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/{image}.log', '\$', 5) + self.cmd.run(f'mkdir -p cmake_targets/log/{image}') + self.cmd.run(f'python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/{image}.log') tag = imageTag if image != 'ran-base' else baseTag - size = self._get_image_size(mySSH, image, tag) + size = self._get_image_size(image, tag) if size <= 0: imageSize[image] = 'unknown -- BUILD FAILED' status = False @@ -361,17 +348,17 @@ class Cluster: logging.info(f'\u001B[1m{image} size is {imageSize[image]}\u001B[0m') grep_exp = "\|".join(attemptedImages) - mySSH.command(f'oc get images | grep -e \'{grep_exp}\' &> cmake_targets/log/image_registry.log', '\$', 10); - mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc get pod $pod -o json >> cmake_targets/log/build_pod_summary.log; done', '\$', 60) + self.cmd.run(f'oc get images | grep -e \'{grep_exp}\' &> cmake_targets/log/image_registry.log'); + self.cmd.run(f'for pod in $(oc get pods | tail -n +2 | awk \'{{print $1}}\'); do oc get pod $pod -o json &>> cmake_targets/log/build_pod_summary.log; done', '\$', 60) build_log_name = f'build_log_{self.testCase_id}' - cls_containerize.CopyLogsToExecutor(mySSH, lSourcePath, build_log_name, lIpAddr, 'oaicicd', CONST.CI_NO_PASSWORD) + cls_containerize.CopyLogsToExecutor(self.cmd, lSourcePath, build_log_name, lIpAddr, 'oaicicd', CONST.CI_NO_PASSWORD) - mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc delete pod ${pod}; done', '\$', 60) + self.cmd.run('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc delete pod ${pod}; done') # logout will return eventually, but we don't care when -> start in background - mySSH.command('oc logout &', '\$', 5) - mySSH.close() + self.cmd.run(f'oc logout &') + self.cmd.close() # Analyze the logs collectInfo = cls_containerize.AnalyzeBuildLogs(build_log_name, attemptedImages, status) From 7361c1689ecafd7eb86832efe442a7afdbb97e8e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 15 Dec 2022 09:27:43 +0100 Subject: [PATCH 30/39] Use new SSH class to execute image build --- ci-scripts/cls_cluster.py | 2 +- ci-scripts/cls_containerize.py | 100 ++++++++++++++++----------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 80f7326338..892d9e847e 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -352,7 +352,7 @@ class Cluster: self.cmd.run(f'for pod in $(oc get pods | tail -n +2 | awk \'{{print $1}}\'); do oc get pod $pod -o json &>> cmake_targets/log/build_pod_summary.log; done', '\$', 60) build_log_name = f'build_log_{self.testCase_id}' - cls_containerize.CopyLogsToExecutor(self.cmd, lSourcePath, build_log_name, lIpAddr, 'oaicicd', CONST.CI_NO_PASSWORD) + cls_containerize.CopyLogsToExecutor(self.cmd, lSourcePath, build_log_name) self.cmd.run('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc delete pod ${pod}; done') diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 4540f2a8a0..d766f02b8b 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -44,6 +44,7 @@ from zipfile import ZipFile #----------------------------------------------------------- # OAI Testing modules #----------------------------------------------------------- +import cls_cmd import sshconnection as SSH import helpreadme as HELP import constants as CONST @@ -83,20 +84,20 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge logging.debug(f'Merging with the target branch: {ranTargetBranch}') sshSession.command(f'git merge --ff origin/{ranTargetBranch} -m "Temporary merge for CI"', '\$', 30) -def CopyLogsToExecutor(sshSession, sourcePath, log_name, scpIp, scpUser, scpPw): - sshSession.command(f'cd {sourcePath}/cmake_targets', '\$', 5) - sshSession.command(f'rm -f {log_name}.zip', '\$', 5) - sshSession.command(f'mkdir -p {log_name}', '\$', 5) - sshSession.command(f'mv log/* {log_name}', '\$', 5) - sshSession.command(f'zip -r -qq {log_name}.zip {log_name}', '\$', 5) +def CopyLogsToExecutor(cmd, sourcePath, log_name): + cmd.cd(f'{sourcePath}/cmake_targets') + cmd.run(f'rm -f {log_name}.zip') + cmd.run(f'mkdir -p {log_name}') + cmd.run(f'mv log/* {log_name}') + cmd.run(f'zip -r -qq {log_name}.zip {log_name}') # copy zip to executor for analysis if (os.path.isfile(f'./{log_name}.zip')): os.remove(f'./{log_name}.zip') if (os.path.isdir(f'./{log_name}')): shutil.rmtree(f'./{log_name}') - sshSession.copyin(scpIp, scpUser, scpPw, f'{sourcePath}/cmake_targets/{log_name}.zip', '.') - sshSession.command(f'rm -f {log_name}.zip','\$', 5) + cmd.copyin(f'{sourcePath}/cmake_targets/{log_name}.zip', f'./{log_name}.zip') + cmd.run(f'rm -f {log_name}.zip') ZipFile(f'{log_name}.zip').extractall('.') def AnalyzeBuildLogs(buildRoot, images, globalStatus): @@ -329,12 +330,11 @@ class Containerize(): HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') logging.debug('Building on server: ' + lIpAddr) - mySSH = SSH.SSHConnection() - mySSH.open(lIpAddr, lUserName, lPassWord) + cmd = cls_cmd.RemoteCmd(lIpAddr) # Checking the hostname to get adapted on cli and dockerfileprefixes - mySSH.command('hostnamectl', '\$', 5) - result = re.search('Ubuntu|Red Hat', mySSH.getBefore()) + cmd.run('hostnamectl') + result = re.search('Ubuntu|Red Hat', cmd.getBefore()) self.host = result.group(0) if self.host == 'Ubuntu': self.cli = 'docker' @@ -369,18 +369,18 @@ class Containerize(): # Workaround for some servers, we need to erase completely the workspace if self.forcedWorkspaceCleanup: - mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf ' + lSourcePath, '\$', 15) + cmd.run(f'sudo -S rm -Rf {lSourcePath}') self.testCase_id = HTML.testCase_id - CreateWorkspace(mySSH, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) + CreateWorkspace(cmd, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge) # if asterix, copy the entitlement and subscription manager configurations if self.host == 'Red Hat': - mySSH.command('mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca', '\$', 5) - mySSH.command('sudo cp /etc/rhsm/rhsm.conf ./rhsm-conf/', '\$', 5) - mySSH.command('sudo cp /etc/rhsm/ca/redhat-uep.pem ./rhsm-ca/', '\$', 5) - mySSH.command('sudo cp /etc/pki/entitlement/*.pem ./etc-pki-entitlement/', '\$', 5) + cmd.run('mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca') + cmd.run('cp /etc/rhsm/rhsm.conf ./rhsm-conf/') + cmd.run('cp /etc/rhsm/ca/redhat-uep.pem ./rhsm-ca/') + cmd.run('cp /etc/pki/entitlement/*.pem ./etc-pki-entitlement/') baseImage = 'ran-base' baseTag = 'develop' @@ -389,8 +389,8 @@ class Containerize(): if (self.ranAllowMerge): imageTag = 'ci-temp' if self.ranTargetBranch == 'develop': - mySSH.command('git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base' + self.dockerfileprefix + ' | grep --colour=never -i INDEX', '\$', 5) - result = re.search('index', mySSH.getBefore()) + cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base{self.dockerfileprefix} | grep --colour=never -i INDEX') + result = re.search('index', cmd.getBefore()) if result is not None: forceBaseImageBuild = True baseTag = 'ci-temp' @@ -398,31 +398,31 @@ class Containerize(): forceBaseImageBuild = True # Let's remove any previous run artifacts if still there - mySSH.command(self.cli + ' image prune --force', '\$', 30) + cmd.run(f"{self.cli} image prune --force") if forceBaseImageBuild: - mySSH.command(self.cli + ' image rm ' + baseImage + ':' + baseTag + ' || true', '\$', 30) + cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}") for image,pattern in imageNames: - mySSH.command(self.cli + ' image rm ' + image + ':' + imageTag + ' || true', '\$', 30) + cmd.run(f"{self.cli} image rm {image}:{imageTag}") # Build the base image only on Push Events (not on Merge Requests) # On when the base image docker file is being modified. if forceBaseImageBuild: - mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + baseImage + ' --tag ' + baseImage + ':' + baseTag + ' --file docker/Dockerfile.base' + self.dockerfileprefix + ' . > cmake_targets/log/ran-base.log 2>&1', '\$', 1600) + cmd.run(f"{self.cli} build {self.cliBuildOptions} --target {baseImage} --tag {baseImage}:{baseTag} --file docker/Dockerfile.base{self.dockerfileprefix} . &> cmake_targets/log/ran-base.log", timeout=1600) # First verify if the base image was properly created. - mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + baseImage + ':' + baseTag, '\$', 5) + ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {baseImage}:{baseTag}") allImagesSize = {} - if mySSH.getBefore().count('o such image') != 0: + if ret.returncode != 0: logging.error('\u001B[1m Could not build properly ran-base\u001B[0m') # Recover the name of the failed container? - mySSH.command(self.cli + ' ps --quiet --filter "status=exited" -n1 | xargs ' + self.cli + ' rm -f', '\$', 5) - mySSH.command(self.cli + ' image prune --force', '\$', 30) - mySSH.close() + cmd.run(f"{self.cli} ps --quiet --filter \"status=exited\" -n1 | xargs {self.cli} rm -f") + cmd.run(f"{self.cli} image prune --force") + cmd.close() logging.error('\u001B[1m Building OAI Images Failed\u001B[0m') HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTabFooter(False) sys.exit(1) else: - result = re.search('Size *= *(?P[0-9\-]+) *bytes', mySSH.getBefore()) + result = re.search('Size *= *(?P[0-9\-]+) *bytes', cmd.getBefore()) if result is not None: size = float(result.group("size")) / 1000000 imageSizeStr = f'{size:.1f}' @@ -432,10 +432,10 @@ class Containerize(): logging.debug('ran-base size is unknown') # Recover build logs, for the moment only possible when build is successful - mySSH.command(self.cli + ' create --name test ' + baseImage + ':' + baseTag, '\$', 5) - mySSH.command('mkdir -p cmake_targets/log/ran-base', '\$', 5) - mySSH.command(self.cli + ' cp test:/oai-ran/cmake_targets/log/. cmake_targets/log/ran-base', '\$', 5) - mySSH.command(self.cli + ' rm -f test', '\$', 5) + cmd.run(f"{self.cli} create --name test {baseImage}:{baseTag}") + cmd.run("mkdir -p cmake_targets/log/ran-base") + cmd.run(f"{self.cli} cp test:/oai-ran/cmake_targets/log/. cmake_targets/log/ran-base") + cmd.run(f"{self.cli} rm -f test") # Build the target image(s) status = True @@ -444,24 +444,24 @@ class Containerize(): attemptedImages += [image] # the archived Dockerfiles have "ran-base:latest" as base image # we need to update them with proper tag - mySSH.command(f'sed -i -e "s#{baseImage}:latest#{baseImage}:{baseTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}', '\$', 5) + cmd.run(f'sed -i -e "s#{baseImage}:latest#{baseImage}:{baseTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}') if image != 'ran-build': - mySSH.command(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}', '\$', 5) - mySSH.command(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {image}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} . > cmake_targets/log/{image}.log 2>&1', '\$', 1200) + cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}') + cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {image}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} . > cmake_targets/log/{image}.log 2>&1', timeout=1200) # split the log - mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5) - mySSH.command('python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/' + image + '.log', '\$', 5) - # checking the status of the build - mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + image + ':' + imageTag, '\$', 5) - if mySSH.getBefore().count('o such image') != 0: + cmd.run(f"mkdir -p cmake_targets/log/{image}") + cmd.run(f"python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/{image}.log") + # check the status of the build + ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {image}:{imageTag}") + if ret.returncode != 0: logging.error('\u001B[1m Could not build properly ' + image + '\u001B[0m') status = False # Here we should check if the last container corresponds to a failed command and destroy it - mySSH.command(self.cli + ' ps --quiet --filter "status=exited" -n1 | xargs ' + self.cli + ' rm -f', '\$', 5) + cmd.run(f"{self.cli} ps --quiet --filter \"status=exited\" -n1 | xargs {self.cli} rm -f") allImagesSize[image] = 'N/A -- Build Failed' break else: - result = re.search('Size *= *(?P[0-9\-]+) *bytes', mySSH.getBefore()) + result = re.search('Size *= *(?P[0-9\-]+) *bytes', cmd.getBefore()) if result is not None: size = float(result.group("size")) / 1000000 imageSizeStr = f'{size:.1f}' @@ -471,18 +471,18 @@ class Containerize(): logging.debug(f'{image} size is unknown') allImagesSize[image] = 'unknown' # Now pruning dangling images in between target builds - mySSH.command(self.cli + ' image prune --force', '\$', 30) + cmd.run(f"{self.cli} image prune --force") # Remove all intermediate build images and clean up if self.ranAllowMerge and forceBaseImageBuild: - mySSH.command(f'{self.cli} image rm {baseImage}:{baseTag} || true', '\$', 30) - mySSH.command(f'{self.cli} image rm ran-build:{imageTag}','\$', 30) - mySSH.command(f'{self.cli} volume prune --force','\$', 15) + cmd.run(f"{self.cli} image rm {baseImage}:{baseTag}") + cmd.run(f"{self.cli} image rm ran-build:{imageTag}") + cmd.run(f"{self.cli} volume prune --force") # create a zip with all logs build_log_name = f'build_log_{self.testCase_id}' - CopyLogsToExecutor(mySSH, lSourcePath, build_log_name, lIpAddr, lUserName, lPassWord) - mySSH.close() + CopyLogsToExecutor(cmd, lSourcePath, build_log_name) + cmd.close() # Analyze the logs collectInfo = AnalyzeBuildLogs(build_log_name, attemptedImages, status) From 941acb2e8d886e03bfc31fa2db698f776a796d6b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 15 Dec 2022 13:43:16 +0100 Subject: [PATCH 31/39] Tag cluster images with branch and commit ID --- ci-scripts/cls_cluster.py | 2 +- ci-scripts/cls_physim1.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 892d9e847e..c42d112ceb 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -214,7 +214,7 @@ class Cluster: forceBaseImageBuild = False imageTag = 'develop' if self.ranAllowMerge: # merging MR branch into develop -> temporary image - imageTag = 'ci-temp' + imageTag = f'{self.ranBranch}-{self.ranCommitID[0:8]}' if self.ranTargetBranch == 'develop': ret = self.cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.rhel8.2 | grep --colour=never -i INDEX') result = re.search('index', ret.stdout) diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 5bb64d250c..775eeb5405 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -105,7 +105,7 @@ class PhySim: if self.ranCommitID != '': mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30) if self.ranAllowMerge: - imageTag = "ci-temp" + imageTag = f'{self.ranBranch}-{self.ranCommitID[0:8]}' if self.ranTargetBranch == '': if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'): mySSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 30) From 074cf91bec10d76da4f340f99e086ed2a67d5bdb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Jan 2023 15:09:15 +0100 Subject: [PATCH 32/39] cls_cluster: various fixes after review - Mention python version and separate Python/own modules - Use constants for registry and namespace name - Provide OC url in oc login - Do not perform oc logout in background --- ci-scripts/cls_cluster.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index c42d112ceb..2096404204 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -19,27 +19,28 @@ # * contact@openairinterface.org # */ #--------------------------------------------------------------------- -# Python for CI of OAI-eNB + COTS-UE # # Required Python Version # Python 3.x # -# Required Python Package -# pexpect #--------------------------------------------------------------------- #----------------------------------------------------------- # Import #----------------------------------------------------------- import logging -import cls_oai_html import re import time + +import cls_oai_html import constants as CONST import helpreadme as HELP import cls_containerize import cls_cmd +IMAGE_REGISTRY_SERVICE_NAME = "image-registry.openshift-image-registry.svc" +NAMESPACE = "oaicicd-ran" + class Cluster: def __init__(self): self.eNBIPAddress = "" @@ -110,18 +111,9 @@ class Cluster: regres = re.search(r'build.build.openshift.io/(?P[a-zA-Z0-9\-]+) started', ret.stdout) if ret.returncode != 0 or ret.stdout.count('Uploading finished') != 1 or regres is None: logging.error(f"error during oc start-build: {ret.stdout}") - self._delete_pod(name) return None return regres.group('jobname') + '-build' - def _delete_pod(self, shortName): - ret = self.cmd.run(f"oc get pods | grep {shortName}") - regres = re.search(rf'{shortName}-[0-9]+-build', ret.stdout) - if regres is not None: - self.cmd.run(f"oc delete pod {regres.group(0)}") - else: - logging.warning(f"no pod found with name {shortName}") - def _wait_build_end(self, jobs, timeout_sec, check_interval_sec = 5): logging.debug(f"waiting for jobs {jobs} to finish building") while timeout_sec > 0: @@ -146,7 +138,7 @@ class Cluster: def _get_image_size(self, image, tag): # get the SHA of the image we built using the image name and its tag ret = self.cmd.run(f'oc describe is {image} | grep -A4 {tag}') - result = re.search(f'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/(?P{image}@sha256:[a-f0-9]+)', ret.stdout) + result = re.search(f'{IMAGE_REGISTRY_SERVICE_NAME}:5000/{NAMESPACE}/(?P{image}@sha256:[a-f0-9]+)', ret.stdout) if result is None: return -1 imageSha = result.group("imageSha") @@ -225,7 +217,7 @@ class Cluster: forceBaseImageBuild = True # logging to OC Cluster and then switch to corresponding project - ret = self.cmd.run(f'oc login -u {ocUserName} -p {ocPassword}') + ret = self.cmd.run(f'oc login -u {ocUserName} -p {ocPassword} --server {self.OCUrl}') if ret.returncode != 0: logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m') HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL) @@ -357,7 +349,7 @@ class Cluster: self.cmd.run('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc delete pod ${pod}; done') # logout will return eventually, but we don't care when -> start in background - self.cmd.run(f'oc logout &') + self.cmd.run(f'oc logout') self.cmd.close() # Analyze the logs From 57dbc796686388e28b06c12b8214bdb7377a3f52 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Jan 2023 15:09:38 +0100 Subject: [PATCH 33/39] cls_physim1: Mention python version and separate Python/own modules --- ci-scripts/cls_physim1.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 775eeb5405..0a45f945a2 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -32,13 +32,14 @@ # Import #----------------------------------------------------------- import logging -import sshconnection as SSH -import cls_oai_html import os import re import time import subprocess import sys + +import sshconnection as SSH +import cls_oai_html import constants as CONST import helpreadme as HELP From 3b9107228a774cffac41e97a5923eab7adfad284 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 16 Dec 2022 18:20:50 +0100 Subject: [PATCH 34/39] cls_containerize: Add comment to help understand the magnitude of size --- ci-scripts/cls_containerize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index d766f02b8b..c9114227bb 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -463,7 +463,7 @@ class Containerize(): else: result = re.search('Size *= *(?P[0-9\-]+) *bytes', cmd.getBefore()) if result is not None: - size = float(result.group("size")) / 1000000 + size = float(result.group("size")) / 1000000 # convert to MB imageSizeStr = f'{size:.1f}' logging.debug(f'\u001B[1m {image} size is {imageSizeStr} Mbytes\u001B[0m') allImagesSize[image] = f'{imageSizeStr} Mbytes' From cdf7fb6f703d279e1552de7097a75cc239cab07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Soares=20da=20Silva?= Date: Mon, 2 Jan 2023 16:54:24 +0000 Subject: [PATCH 35/39] Fix setup_time overflow in vnf processing thread, preventing gNB from stopping message processing once setup_time overflowed --- nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c index 852707fbbd..d707582587 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c @@ -153,11 +153,11 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config) //struct timespec original_pselect_timeout; struct timespec pselect_timeout; pselect_timeout.tv_sec = 100; - pselect_timeout.tv_nsec = 0; + pselect_timeout.tv_nsec = 0; struct timespec ref_time; clock_gettime(CLOCK_MONOTONIC, &ref_time); - uint8_t setup_time; + uint8_t setup_done; while(vnf_p7->terminate == 0) { fd_set rfds; @@ -169,9 +169,14 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config) FD_SET(vnf_p7->socket, &rfds); maxSock = vnf_p7->socket; - struct timespec curr_time; - clock_gettime(CLOCK_MONOTONIC, &curr_time); - setup_time = curr_time.tv_sec - ref_time.tv_sec; + if (setup_done == 0) { + struct timespec curr_time; + clock_gettime(CLOCK_MONOTONIC, &curr_time); + uint8_t setup_time = curr_time.tv_sec - ref_time.tv_sec; + if (setup_time > 3) { + setup_done = 1; + } + } nfapi_nr_slot_indication_scf_t *slot_ind = get_queue(&gnb_slot_ind_queue); NFAPI_TRACE(NFAPI_TRACE_DEBUG, "This is the slot_ind queue size %ld in %s():%d\n", @@ -182,8 +187,8 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config) gNB->UL_INFO.slot = slot_ind->slot; NFAPI_TRACE(NFAPI_TRACE_DEBUG, "gNB->UL_INFO.frame = %d and slot %d, prev_slot = %d, setup_time = %d\n", - gNB->UL_INFO.frame, gNB->UL_INFO.slot, prev_slot, setup_time); - if (setup_time > 3 && prev_slot != gNB->UL_INFO.slot) { //Give the VNF sufficient time to setup before starting scheduling && prev_slot != gNB->UL_INFO.slot + gNB->UL_INFO.frame, gNB->UL_INFO.slot, prev_slot); + if (setup_done && prev_slot != gNB->UL_INFO.slot) { //Give the VNF sufficient time to setup before starting scheduling && prev_slot != gNB->UL_INFO.slot //Call the scheduler gNB->UL_INFO.module_id = gNB->Mod_id; From 096a32bf16fcb935472b0dd427694cacc58867ed Mon Sep 17 00:00:00 2001 From: Karim Harouat Date: Tue, 3 Jan 2023 08:53:02 +0100 Subject: [PATCH 36/39] system.c : cleaning check result of system call --- common/utils/system.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/utils/system.c b/common/utils/system.c index aeea9a1595..9d52639b2f 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -366,9 +366,14 @@ void set_latency_target(void) { LOG_E(HW,"Can't set /dev/cpu_dma_latency to %u us\n", latency_target_value); // Set CPU frequency to it's maximum - if ( 0 != system("for d in /sys/devices/system/cpu/cpu[0-9]*; do cat $d/cpufreq/cpuinfo_max_freq > $d/cpufreq/scaling_min_freq; done")) - LOG_E(HW,"Can't set cpu frequency\n"); - + int system_ret = system("for d in /sys/devices/system/cpu/cpu[0-9]*; do cat $d/cpufreq/cpuinfo_max_freq > $d/cpufreq/scaling_min_freq; done"); + if (system_ret == -1) { + LOG_E(HW, "Can't set cpu frequency: [%d] %s\n", errno, strerror(errno)); + return; + } + if (!((WIFEXITED(system_ret)) && (WEXITSTATUS(system_ret) == 0))) { + LOG_E(HW, "Can't set cpu frequency\n"); + } mlockall(MCL_CURRENT | MCL_FUTURE); } From 75e542c6ad66284016badeb11860839ffec9f5cc Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 12 Jan 2023 18:02:45 +0100 Subject: [PATCH 37/39] Restore LDPC decdoer documentation --- .../CODING/nrLDPC_decoder/doc/nrLDPC/logo.png | Bin 0 -> 3723 bytes .../nrLDPC_decoder/doc/nrLDPC/nrLDPC.tex | 960 ++++++++++++++++++ 2 files changed, 960 insertions(+) create mode 100644 openair1/PHY/CODING/nrLDPC_decoder/doc/nrLDPC/logo.png create mode 100644 openair1/PHY/CODING/nrLDPC_decoder/doc/nrLDPC/nrLDPC.tex diff --git a/openair1/PHY/CODING/nrLDPC_decoder/doc/nrLDPC/logo.png b/openair1/PHY/CODING/nrLDPC_decoder/doc/nrLDPC/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..7b785ca0517c0aa7467aafebff9255b2bdf0b8ef GIT binary patch literal 3723 zcmb7HcQ_l~*QZpKvIIZ9D8A_L(Nlzj5k-+7Ue-=fU2;YB$FPfLyhA9*Ce5QssEb)of9eM|CmU` z|Ib7s{$Hj@amv_Cn}-Z1?>u9Z&3Uy{x%qgnT_cOW-&OYITa%ca>)Eesd8Ja|>3LOk znraDi#RBjn6#q9#8;kU&2nD$CVj3Fhap5@+7qI10x@~NEDBmf{>+IYcgrK;ZZPc#x z2^)%nQr`MOuTCHCxTF?2168#BXL?kcd5FxDkJi{Iy5`1C#-ykBpQ#3rf-5C5-A7`o zlx?2T9*F*vh0#~Ov*znN(>1g$tF6=&`E#6w`t7cOBVrHrvUsG`bpRrfnsO4FkjLY= z!#ZHyE*H!o@{Q9_?Vt_a%c($B@QU8gjyuT~H_rvcx(*qAW->Lr>$(Ss8dgX;uRy?| zW}5+w3$qzb^-`$E3Sd%#-`zU>ZKndZeb#`QY$wGvzvRnfE%SShUxyMv7fWc3xr;oy zEuqK341;|catTpIA8PuDWBINa{5=PtGrsg!y|FqQ!v4X*pqPN$L8C->I7iD$T&#W~ zu|9J6g_1VD-b|uN{wIt_fV0G}duJN1<-n!!!ct=`FNY#9KXOu8OP&`}MCHv`JZ_;r zN9G)nSYE~BwvZynC<)5q|~BvPD?y522~$3UjQ!vHk;MBW{y^&l&R&g{y7WE zB%$J6mPR1@c(rZvSu>1FBKPYYqBBD}VQL4#2PtNafBX*&rNnR~M8t(L<#?E`I4A8S zrhCYn>fP}dyWo6zjicnrM_P^uK4Pft*`kHHQ9yLT(a6VlD^{S3)!KOT>k$UuZz*#h zq_MCZ_dC2h6^$ZZvGGbiehDleEidD%nK1ZxJeB3gYi9fFp-E(XCbFZ+; zwTdXV0W2PDJ;gjF8*f2i?wsOKkNJV*0CRUGGr^&^`#5Epy=Rkmt3(2L?PQV{+-UU# z^Ja_@uOF(x?mVyCE*ca=%+%30Gb1frGlf57q&uEA<5=pP&0YP5+I@XSLgS3R1%#s zWbT%-z_jU&z(lN*9#wZq`1ZuzE)E4SZdxB-FXMT+0fq#*-#efk9<&ro(xyi*KTo6+ z-Oh!Vmda2&iNYVIDmMKy+CWENInI=G=`|0J9rmqvX`Js})Y$|&FVb|-5gfEZrJu5L zi5}e4)JoI3JK5+Wr?F4+lU~DPj0YXkNz^aG0UeQc3=Itl@0>|*AfY)f-69<0Esg|< zHECu5GN4tZU{kM6QDNzQ+H0U zaZNWXDyeAs)E4d*m!;yk9>w{wXBp_^O;JgFBeihGxt{5+ju}yqZOj1VfFBe0%sfT$ zGT}b@=!KljI|0rFiuvzJ`;HD9b+TJ5sS|+&G_YtQKvzgqlKs)BFOFh{F26}^xbU8G zmU~pE5qxhaIRM<#AHX^njPhk&m5=gTzP$&MA$K}1-IZ}cl)yXNDOjQZJ?j~bI}~rIk2eP8#VWGJKZ+zF$fIxKCHY{Dr2tTKrYo-^GuY9rv~F-)FPC0 zY1LFL7or%LjY%|L4TgEyQ8(g-uAZ6z`ZAP?Uf3sVQ9h;G_y7C78W$*@z}^y@g4565 z<(+Pk*@=j^Ou6Gz@-FN*Jnpwe+1mkE!rdN^s;=XPa1V}gkr#Hjb&msC*YUq*3{LqH z>Mk7TIG6s{uW^Gxq5eZZb4wGrDn+Y6-iLg;Pi`L+ECzr|6pHk=XIOyc&v;G!6*88p z247ov_j*PRE7L|NrAdo+^(h9j4gcOnGy%M^0?t!IZ&A>Pl;^k#!TEZHlA;e)?Lb^1 z;~}>xvIdSBeoR5=-`y0W%4(z+Ah-ctn{fPomnRA4Y5;a(`$^#of5k=$Nq0&++Q4wB zgMB5XHSuo*#|Nl#dxxdXtjzBf{*7GSe$*=+Dv4L;fD6U|8J{saFVoTI2KZ(>%&^=o z#=$G7Joe{(lP7AX$4Mwzd2B>sBs<%{{0X!b_Pb*CFZ+&OsSr=1VA8fin->3$R#pB`%3vH z)p_Hc`Ph4jXUfS0UBI_wCS$)HWl7j36(mTSZgU!(uFlX~EAeIG@&KgE8!qJ{StNTI z&)~&n^mfz0BZ-E3oBhx8^PLW5N!zDd@l=6~Of~oij{JYlORh5otcmaI%YQ~VpbhWc z&k3R^Izj|{hTClF7o6&Uvl)O?_eBrv-8atLif6E*6X&^H%rXZ|sF2FtXH(?I^|EFY zr87BFJvgeh9O+SN3t9}$u&7OK@Rfxd7I&AJRL4)cA1M3ewVPc9m)6(kH_FV{e@Gqt z!mlehRxg5*5i;ufQj+&^{cs0wf;e#kkIzB|i+;sh)S8X}lg;0Q#p1s77>r8p_+Mvf z?kW~IeeQYpbCI~VFiM6RmA?~|Tkv<6_NLOj34Iom^E@WkLtNnG=MjX+H?;76@dgeLS7#XzrZvML#JVpV)IEbiZd?Zc(?wrBOfEYXMkG(hDeqHS~ z*MpdSSy$njlsRFFf82RG?GDeTm>qI?94|x(pIk!WdxnoOw zq9%gdvu*;sl003d&+uIVgdENtdj_&x1l#O93a$L7pWchswsiqV<^hVf`{t}CR@KGY@+1LPfH9hnm&Ei{@R6wvXf();$ZnRe)t91LKba;KUoe)Yx3hZ>8H zL2JE*#j3OkBlt48(~8eRv`nNRme|g+GCVrd3vmwAiF{WS($j+rJ2}aUmdNzwQO`|$ z8oeg!=I9_DvOz;bs&_C~S_#}tSznqbSd`~bW5{AV=b{fmR`&z_p64)GfQO2HWCk9? zspRlmYlmy*Oi)9V2XAU=`@~^A@&`_ts@mZcMA}bYjc&V4;1EY|`kRpok-LFQilp31 zn&qP=DG%6cTu;85g{;tB-GE#V`@_gkT=?fCq4kj!-NQXpQ6Au>BR7wGyfAj}O)-bm z9P65F?z_hawZo*I{8&R6W?drFg8#ammgnE-`a8kof&WHrQ5qX0(z(!Gt-RnkDl=v$ z*Y|FzCH|Zo{ds0j^_Y3&pt9_+T;~egq7^MsH=Grx5O7G2E~CY$9#i!>HkJ)+#?05d zkv~217W)VryS#DPVx+=zRc$i2m$3c|o8&mc@1bNSjN->^+OkKsip+l!d@ctg^b&rN zRmv_7>=ST*yT!^*kmu42KGr$VRmJ5T_f?KNAGltZ9SQ5rC@a)gWwNE?qIJ$>W-<+p3T0|%a+;D0^pB$, $K-B=140$ filler bits are appended to the information bits. The PCM $\Hbgt$ is of size $2688\times 3328$ and the $640$ bits $\b$ are encoded according to \eqref{eq:29} at a rate $R \approx 0.192$. To achieve the higher base rate of $0.2$, the first $128$ are punctured, i.e. instead of transmitting all $3328$ bits, only $3200$ are transmitted resulting in the desired rate $R=640/3200=0.2$. + +\subsection{LDPC Decoding} +\label{sec:ldpc-decoding} + +The decoding of codeword $\c$ can be achieved via the classical message passing algorithm. This algorithm can be illustrated best using the Tanner graph of the PCM. The rows of the PCM are called check nodes (CN) since they represent the parity check equations. The parity check equation of each of these check nodes involves various bits in the codeword. Similarly, every column of the PCM corresponds to a bit and each bit is involved in several parity check equations. In the Tanner graph representation, the bits are called bit nodes (BN). Let's go back to the previous example of BG2 and assume $\Zc=2$, hence the first 3 rows and 13 columns of BG2 $\Hbgt$ read +\begin{equation*} + \label{eq:36} + \Hbgt = + \begin{bmatrix} + 1 & 1 & 0 & 0 & \emptyset & \emptyset & 1 & \emptyset & \emptyset & 1 & 0 & 0 & \emptyset & \emptyset \\ + 1 & \emptyset & \emptyset & 0 & 1 & 1 & 0 & 0 & 0 & 0 & \emptyset & 0 & 0 & \emptyset \\ + 1 & 0 & \emptyset & 0 & 0 & \emptyset & \emptyset & \emptyset & 0 & \emptyset & 1 & \emptyset & 0 & 0 + \end{bmatrix}. +\end{equation*} +Replacing the elements according to \eqref{eq:35}, we obtain the first 6 rows and 26 columns of the PCM as +\begin{equation*} + \label{eq:39} + \H = + \begin{bmatrix} + 0 & 1 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ + 1 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0\\ + 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0\\ + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0\\ + 0 & 1 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 1 & 0\\ + 1 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 1 + \end{bmatrix}. +\end{equation*} + +The Tanner graph of the first 8 BNs is shown in Figure \ref{fig:tannergraph}. + +\begin{figure}[ht] + \label{fig:tannergraph} + \centering + \def\ww{0.3cm} + \def\hh{0.3cm} + \tikzstyle{cnode}=[fill=white,rectangle,draw=black,thick,inner sep=2pt, minimum height=\hh,minimum width=\ww, rounded corners=1pt,text width=\ww] + \tikzstyle{vnode}=[fill=white,circle,draw=black,thick,inner sep=2pt, minimum height=\hh,minimum width=\ww, rounded corners=1pt,text width=\ww] + \tikzstyle{connector}=[<->,>=latex',semithick] + + \begin{tikzpicture} + \tikzstyle{every node}=[node distance=1.5cm,text centered] + % Check nodes + \node[cnode, label=above:$v_0$] (v0) {}; + \node[cnode, label=above:$v_1$, right of=v0] (v1) {}; + \node[cnode, label=above:$v_2$, right of=v1] (v2) {}; + % Variable nodes + \node[vnode, label=below:$c_3$, below of=v1, node distance=1.5cm] (c3) {}; + \node[vnode, label=below:$c_2$, left of=c3, node distance=1.5cm] (c2) {}; + \node[vnode, label=below:$c_1$, left of=c2, node distance=1.5cm] (c1) {}; + \node[vnode, label=below:$c_0$, left of=c1, node distance=1.5cm] (c0) {}; + \node[vnode, label=below:$c_4$, right of=c3, node distance=1.5cm] (c4) {}; + \node[vnode, label=below:$c_5$, right of=c4, node distance=1.5cm] (c5) {}; + \node[vnode, label=below:$c_6$, right of=c5, node distance=1.5cm] (c6) {}; + + % Draw edges + \draw (c0) edge[connector] (v1); + \draw (c1) edge[connector] (v0); + \draw (c1) edge[connector] (v2); + \draw (c2) edge[connector] (v1); + \draw (c3) edge[connector] (v0); + \draw (c4) edge[connector] (v0); + \draw (c4) edge[connector] (v2); + \draw (c5) edge[connector] (v1); + \draw (c6) edge[connector] (v0); + \draw (c6) edge[connector] (v2); + + \end{tikzpicture} + + \caption{Tanner graph for first 7 bits nodes and 3 check nodes from \eqref{eq:39}.} +\end{figure} + +The message passing algorithm is an iterative algorithm where probabilities of the bits (being either 0 or 1) are exchanged between the BNs and CNs. After sufficient iterations, the probabilities will have either converged to either 0 or 1 and the parity check equations will be satisfied, at this point, the codeword has been decoded correctly. + +\newpage +\section{LDPC Decoder Implementation} +\label{sec:ldpc-implementation} + +The implementation on a general purpose processor (GPP) has to take advantage of potential instruction extension of the processor architecture. We focus on the Intel x86 instruction set architecture (ISA) and its advanced vector extension (AVX). In particular, we utilize AVX2 with its 256-bit single instruction multiple data (SIMD) format. In order to utilize AVX2 to speed up the processing at the CNs and BNs, the corresponding data has to be ordered/aligned in a specific way. The processing flow of the LDPC decoder is depicted in \ref{fig:ldpc_decoder_flow}. + +\begin{figure}[ht] + \label{fig:ldpc_decoder_flow} + \centering + \def\ww{0.3cm} + \def\hh{0.3cm} + \tikzstyle{func}=[,draw=none] + \tikzstyle{connector}=[->,>=latex',semithick] + + \begin{tikzpicture} + \tikzstyle{every node}=[node distance=2.5cm,text centered] + % Check nodes + % First iteration + \node[func] (llr2llrProcBuf) {\texttt{llr2llrProcBuf}}; + \node[func, above of=llr2llrProcBuf] (llr2CnProcBuf) {\texttt{llr2CnProcBuf}}; + \node[func, above right of=llr2CnProcBuf] (cnProc1) {\texttt{cnProc}}; + \node[func, below right of=cnProc1] (cn2bnProcBuf1) {\texttt{cn2bnProcBuf}}; + \node[func, below of=cn2bnProcBuf1] (bnProcPc1) {\texttt{bnProcPc}}; + + % Iterations + \node[func, right of=cnProc1, node distance=7cm] (cnProc) {\texttt{cnProc}}; + \node[func, below right of=cnProc] (cn2bnProcBuf) {\texttt{cn2bnProcBuf}}; + \node[func, below of=cn2bnProcBuf] (bnProcPc) {\texttt{bnProcPc}}; + \node[func, below left of=cnProc] (bn2cnProcBuf) {\texttt{bn2cnProcBuf}}; + \node[func, below of=bn2cnProcBuf] (bnProc) {\texttt{bnProc}}; + + % Post processing + \node[func, below of=bnProcPc] (llrRes2llrOut) {\texttt{llrRes2llrOut}}; + \node[func, below of=llrRes2llrOut, node distance=1cm] (llr2bit) {\texttt{llr2bit}}; + + % Draw edges + \draw (llr2llrProcBuf) edge[connector] (llr2CnProcBuf); + \draw (llr2CnProcBuf) edge[connector] (cnProc1); + \draw (cnProc1) edge[connector] (cn2bnProcBuf1); + \draw (cn2bnProcBuf1) edge[connector] (bnProcPc1); + + \draw (bnProcPc) edge[connector] (bnProc); + \draw (bnProc) edge[connector] (bn2cnProcBuf); + \draw (bn2cnProcBuf) edge[connector] node[above left] {\texttt{cnProcPc}} (cnProc); + \draw (cnProc) edge[connector] (cn2bnProcBuf); + \draw (cn2bnProcBuf) edge[connector] (bnProcPc); + + \draw (bnProcPc1) edge[connector] (bnProc); + + \draw (bnProcPc) edge[connector] node[left] {iterations done} (llrRes2llrOut); + \draw (llrRes2llrOut) edge[connector] (llr2bit); + + % Boxes + \node[inner sep=0pt,above right of=cn2bnProcBuf1, node distance = 2.5cm] (ref) {}; + + \draw[fill=black,opacity=.2, rounded corners] (llr2llrProcBuf.south west) rectangle ($(ref) + (-.5cm,.5cm)$); + \draw[fill=black,opacity=.2, rounded corners] ($(ref) + (.5cm,.5cm)$) rectangle ($(bnProcPc.south east) + (.4cm,0)$); + + \node[func, above of=cnProc1, node distance=.8cm] (iter1) {\textbf{First Iteration}}; + \node[func, above of=cnProc , node distance=.8cm] (iterX) {\textbf{Subsequent Iterations}}; + + \end{tikzpicture} + + \caption{LDPC Decoder processing flow.} +\end{figure} + +The functions involved are described in more detail in Table \ref{tab:sum_func}. + +\begin{table}[ht] + \centering + \begin{tabular}{ll} + \toprule + \textbf{Function} & \textbf{Description} \\ + \midrule + \texttt{llr2llrProcBuf} & Copies input LLRs to LLR processing buffer \\ + \texttt{llr2CnProcBuf} & Copies input LLRs to CN processing buffer \\ + \texttt{cnProc} & Performs CN signal processing \\ + \texttt{cnProcPc} & Performs parity check \\ + \texttt{cn2bnProcBuf} & Copies the CN results to the BN processing buffer \\ + \texttt{bnProcPc} & Performs BN processing for parity check and/or hard-decision \\ + \texttt{bnProc} & Utilizes the results of \texttt{bnProcPc} to compute LLRs for CN processing \\ + \texttt{bn2cnProcBuf} & Copies the BN results to the CN processing buffer \\ + \texttt{llrRes2llrOut} & Copies the results of \texttt{bnProcPc} to output LLRs \\ + \texttt{llr2bit} & Performs hard-decision on the output LLRs \\ + \bottomrule + \end{tabular} + \caption{Summary of the LDPC decoder functions.} + \label{tab:sum_func} +\end{table} + +The input LLRs are assumed to be 8-bit and aligned on 32 bytes. CN processing is carried out in 8-bit whereas BN processing is done in 16 bit. Subsequently, the processing tasks at the CNs and BNs are explained in more detail. + +\newpage +\subsection{Check Node Processing} +\label{sec:check-node-proc} + +Denote $q_{ij}$ the value from BN $j$ to CN $i$ and let $\Bcal_i$ be the set of connected BNs to the $i$th CN. Then, using the min-sum approximation, CN $i$ has to carry out the following operation for each connected BN. +\begin{equation} + \label{eq:40} + r_{ji} = \prod_{j'\in\Bcal_i\setminus j}\sgn q_{ij'}\min_{j'\in\Bcal_i\setminus j} |q_{ij'}| +\end{equation} +where $r_{ji}$ is the value returned to BN $j$ from CN $i$. There are $\Mb = \{46,42\}$ CNs in BG 1 and BG 2, respectively. Each of these CNs is connected to only a small number of BNs. The number of connected BNs to CN $i$ is $|\Bcal_i|$. In BG1 and BG2, $|\Bcal_i|=\{3,4,5,6,7,8,9,10,19\}$ and $|\Bcal_i|=\{3,4,5,6,8,10\}$, respectively. The following tables show the number of CNs $M_{|\Bcal_i|}$ that are connected to the same number of BNs. + +\begin{table}[ht] + \centering + \begin{tabular}{llllllllll} + \toprule + $|\Bcal_i|$ & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 19 \\ + \midrule + $M_{|\Bcal_i|}^\mathrm{BG1}$ & 1 & 5 &18 & 8 & 5 & 2 & 2 & 1 & 4 \\ + $M_{|\Bcal_i|}^\mathrm{BG2}$ & 6 & 20 & 9 & 3 & 0 & 2 & 0 & 2 & 0 \\ + \bottomrule + \end{tabular} + \caption{Ceck node groups for BG1 and BG2.} + \label{tab:checkNodeGroups} +\end{table} + +It can be observed that each CN is at least connected to 3 BNs and there are 9 groups and 5 groups in BG1 and BG2, respectively. Denote the set of CN groups as $\Gcal$ and $M_k$ the number of CNs in group $k\in\Gcal$, e.g. for BG2 $M_4=20\Zc$. Each CN group will be processed separately. The CN processing buffer $p_C^k$ of group $k$ is defined as +\begin{equation} + \label{eq:44} + p_C^k = \{\underbrace{q_{11}q_{21}\dots q_{M_k 1}}_{\text 1. BN},\underbrace{q_{12}q_{22}\dots q_{M_k 2}}_{\text 2. BN},\dots,\underbrace{q_{12}q_{22}\dots q_{M_k k}}_{\text last BN}\} +\end{equation} +Hence, $|p_C^k| = kM_k$, e.g, $\Zc=128$, $|p_C^4| = 4\cdot 20\cdot 128 = 10240$. + +\begin{lstlisting}[frame=single,caption={Example of CN processing for group 3 from \texttt{cnProc}.},label=code_cnproc] % Start your code-block + + const uint8_t lut_idxCnProcG3[3][2] = {{72,144}, {0,144}, {0,72}}; + + // ===================================================================== + // Process group with 3 BNs + + // Number of groups of 32 CNs for parallel processing + M = (lut_numCnInCnGroups[0]*Z)>>5; + // Set the offset to each bit within a group in terms of 32 Byte + bitOffsetInGroup = (lut_numCnInCnGroups_BG2_R15[0]*NR_LDPC_ZMAX)>>5; + + // Set pointers to start of group 3 + p_cnProcBuf = (__m256i*) &cnProcBuf [lut_startAddrCnGroups[0]]; + p_cnProcBufRes = (__m256i*) &cnProcBufRes[lut_startAddrCnGroups[0]]; + + // Loop over every BN + for (j=0; j<3; j++) + { + // Set of results pointer to correct BN address + p_cnProcBufResBit = p_cnProcBufRes + (j*bitOffsetInGroup); + + // Loop over CNs + for (i=0; i>5; + + // Set the offset to each CN within a group in terms of 16 Byte + cnOffsetInGroup = (lut_numBnInBnGroups[2]*NR_LDPC_ZMAX)>>4; + + // Set pointers to start of group 3 + p_bnProcBuf = (__m128i*) &bnProcBuf [lut_startAddrBnGroups [idxBnGroup]]; + p_llrProcBuf = (__m128i*) &llrProcBuf [lut_startAddrBnGroupsLlr[idxBnGroup]]; + p_llrRes = (__m256i*) &llrRes [lut_startAddrBnGroupsLlr[idxBnGroup]]; + + // Loop over BNs + for (i=0,j=0; i Date: Thu, 12 Jan 2023 18:05:16 +0100 Subject: [PATCH 38/39] Fix warning in nFAPI --- nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c index d707582587..e12b10ec52 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c @@ -186,7 +186,7 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config) gNB->UL_INFO.frame = slot_ind->sfn; gNB->UL_INFO.slot = slot_ind->slot; - NFAPI_TRACE(NFAPI_TRACE_DEBUG, "gNB->UL_INFO.frame = %d and slot %d, prev_slot = %d, setup_time = %d\n", + NFAPI_TRACE(NFAPI_TRACE_DEBUG, "gNB->UL_INFO.frame = %d and slot %d, prev_slot = %d\n", gNB->UL_INFO.frame, gNB->UL_INFO.slot, prev_slot); if (setup_done && prev_slot != gNB->UL_INFO.slot) { //Give the VNF sufficient time to setup before starting scheduling && prev_slot != gNB->UL_INFO.slot From 7d3100dbe7a8f47eca5a8be6d43ebbeb0a538b7d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 13 Jan 2023 13:42:13 +0100 Subject: [PATCH 39/39] Force correct min_rxtxtime in OAI UE test --- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 8a6c67fa34..8a51662ce4 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -54,7 +54,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa --usrp-tx-thread-config 1 --tune-offset 30000000 --thread-pool 1,3,5,7,9,11,13,15 --gNBs.[0].min_rxtxtime 5 --log_config.global_log_options level,nocolor,time + -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --gNBs.[0].min_rxtxtime 5 --sa --usrp-tx-thread-config 1 --tune-offset 30000000 --thread-pool 1,3,5,7,9,11,13,15 --gNBs.[0].min_rxtxtime 5 --log_config.global_log_options level,nocolor,time 0 0 nr