From a8709f0381b9408ed068a07d274d18d2ed52be3b Mon Sep 17 00:00:00 2001 From: Calvin HSU Date: Fri, 29 Jun 2018 10:14:02 +0200 Subject: [PATCH] ue add MIB RX primitives and RRC --- cmake_targets/CMakeLists.txt | 9 + .../nfapi/public_inc/nfapi_nr_ue_interface.h | 565 +++ .../nfapi/public_inc/nr_fapi_ue_interface.h | 3886 ----------------- openair2/LAYER2/NR_MAC_UE/config_ue.c | 87 +- openair2/LAYER2/NR_MAC_UE/defs.h | 79 +- openair2/LAYER2/NR_MAC_UE/mac.h | 92 + .../LAYER2/NR_MAC_UE/{vars.c => mac_vars.c} | 4 +- openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 8 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 49 + openair2/LAYER2/NR_MAC_UE/proto.h | 61 + openair2/LAYER2/NR_MAC_UE/vars.h | 155 - openair2/RRC/NR_UE/L2_interface_ue.c | 57 + openair2/RRC/NR_UE/defs.h | 160 - openair2/RRC/NR_UE/main_ue.c | 8 +- openair2/RRC/NR_UE/proto.h | 79 - openair2/RRC/NR_UE/rrc_UE.c | 422 +- openair2/RRC/NR_UE/rrc_defs.h | 116 + openair2/RRC/NR_UE/rrc_list.h | 82 + openair2/RRC/NR_UE/rrc_proto.h | 107 + openair2/RRC/NR_UE/rrc_types.h | 71 - openair2/RRC/NR_UE/{vars.h => rrc_vars.h} | 6 +- openair2/UTIL/OMG/defs.h | 1 + 22 files changed, 1489 insertions(+), 4615 deletions(-) create mode 100644 nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h delete mode 100644 nfapi/open-nFAPI/nfapi/public_inc/nr_fapi_ue_interface.h create mode 100644 openair2/LAYER2/NR_MAC_UE/mac.h rename openair2/LAYER2/NR_MAC_UE/{vars.c => mac_vars.c} (94%) create mode 100644 openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c create mode 100644 openair2/LAYER2/NR_MAC_UE/proto.h delete mode 100644 openair2/LAYER2/NR_MAC_UE/vars.h create mode 100644 openair2/RRC/NR_UE/L2_interface_ue.c delete mode 100644 openair2/RRC/NR_UE/defs.h delete mode 100644 openair2/RRC/NR_UE/proto.h create mode 100644 openair2/RRC/NR_UE/rrc_defs.h create mode 100644 openair2/RRC/NR_UE/rrc_list.h create mode 100644 openair2/RRC/NR_UE/rrc_proto.h delete mode 100644 openair2/RRC/NR_UE/rrc_types.h rename openair2/RRC/NR_UE/{vars.h => rrc_vars.h} (92%) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 412ed26e55..98587fb308 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1319,12 +1319,14 @@ add_library(PHY_RU ${PHY_SRC_RU}) #Layer 2 library ##################### set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC) +set(NR_UE_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_UE) set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE) set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC) set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0) set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0) set(RLC_TM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0) set(RRC_DIR ${OPENAIR2_DIR}/RRC/LTE) +set(NR_UE_RRC_DIR ${OPENAIR2_DIR}/RRC/NR_UE) set(PDCP_DIR ${OPENAIR2_DIR}/LAYER2/PDCP_v10.1.0) set(L2_SRC ${OPENAIR2_DIR}/LAYER2/openair2_proc.c @@ -1411,6 +1413,9 @@ set(L2_SRC_UE ${RRC_DIR}/rrc_common.c ${RRC_DIR}/L2_interface_common.c ${RRC_DIR}/L2_interface_ue.c + ${NR_UE_RRC_DIR}/L2_interface_ue.c + ${NR_UE_RRC_DIR}/main_ue.c + ${NR_UE_RRC_DIR}/rrc_UE.c ) set (MAC_SRC @@ -1442,6 +1447,10 @@ set (MAC_SRC_UE ${MAC_DIR}/l1_helpers.c ${MAC_DIR}/rar_tools_ue.c ${MAC_DIR}/config_ue.c + ${NR_UE_MAC_DIR}/config_ue.c + ${NR_UE_MAC_DIR}/mac_vars.c + ${NR_UE_MAC_DIR}/main_ue_nr.c + ${NR_UE_MAC_DIR}/nr_ue_procedures.c ) set (ENB_APP_SRC diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h new file mode 100644 index 0000000000..627c052df5 --- /dev/null +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h @@ -0,0 +1,565 @@ +/* + * Copyright 2017 Cisco Systems, Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + + +#ifndef _NFAPI_NR_INTERFACE_NR_EXTENSION_H_ +#define _NFAPI_NR_INTERFACE_NR_EXTENSION_H_ +#define _NFAPI_NR_INTERFACE_H_ + +#include "stddef.h" + + + +#define NFAPI_NR_MAX_NUM_DL_ALLOCATIONS 16 +#define NFAPI_NR_MAX_NUM_UL_ALLOCATIONS 16 +#define NFAPI_NR_MAX_NUM_SERVING_CELLS 32 +#define NFAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET 16 + +typedef unsigned int uint32_t; +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; +typedef signed int int32_t; +typedef signed short int16_t; +typedef signed char int8_t; + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t spare; +} nfapi_nr_p4_p5_message_header_t; + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/ + uint32_t checksum; + uint32_t transmit_timestamp; +} nfapi_nr_p7_message_header_t; + +typedef struct { + uint16_t tag; + uint16_t length; +} nfapi_nr_tl_t; +#define NFAPI_NR_TAG_LENGTH_PACKED_LEN 4 + + + + + +typedef struct { + nfapi_nr_tl_t tl; + // common C-RNTI + uint8_t dci_format; + uint8_t frequency_domain_resouce_assignment; // 38.214 chapter 5.1.2.2 + uint8_t time_domain_resource_assignment; // 38.214 chapter 5.1.2.1 + uint8_t frequency_hopping_enabled_flag; + uint8_t frequency_hopping_bits; + uint8_t mcs; + uint8_t new_data_indication; + uint8_t redundancy_version; + uint8_t harq_process; + uint8_t tpc_command; + + uint8_t ul_sul_ind; + + uint8_t carrier_indicator; + uint8_t bwp_indndicator; + uint8_t vrb_to_prb_mapping; + uint8_t downlink_assignment_index_1; + uint8_t downlink_assignment_index_2; + uint8_t srs_resource_indicator; + uint8_t precoding_information; + uint8_t antenna_ports; + uint8_t srs_request; + uint8_t cqi_csi_request; + uint8_t cbg_transmission_information; + uint8_t ptrs_dmrs_association; + + uint8_t downlink_assignment_index; + uint8_t pucch_resource_indicator; + uint8_t pdsch_to_harq_feedback_timing_indicator; + + uint8_t short_messages_indicator; + + uint8_t prb_bundling_size_indicator; // 38.214 chapter 5.1.2.3 + uint8_t rate_matching_indicator; + uint8_t zp_csi_rs_trigger; + uint8_t transmission_configuration_indication; + uint8_t cbg_flushing_out_information; + + uint8_t slot_format_count; + uint8_t *slot_format_indicators; // 38.213 chapter 11.1.1 + + uint8_t preemption_indication_count; + uint8_t *preemption_indications; // 38.213 chapter 11.2 + + uint8_t tpc_command_count; + uint8_t *tpc_command_numbers; + + uint8_t block_number_count; + uint8_t *block_numbers; + uint8_t dci2_3_srs_request; // 38.212 table 7.3.1.1.2-5 + uint8_t dci2_3_tpc_command; + +} nfapi_nr_dci_pdu_rel15_t; +#define NFAPI_NR_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020 + +typedef struct { + nfapi_nr_tl_t tl; + uint8_t uci_format; + uint8_t uci_channel; + uint8_t harq_ack_bits; + uint32_t harq_ack; + uint8_t csi_bits; + uint32_t csi; + uint8_t sr_bits; + uint32_t sr; +} nfapi_nr_uci_pdu_rel15_t; + + + + +// +// Top level NFAPI messages +// + + + +// +// P7 +// + + typedef struct { + uint16_t rnti; + uint8_t dci_type; + uint8_t dci_size; + nfapi_nr_dci_pdu_rel15_t dci; + }nfapi_nr_dci_indication_pdu_t; + + typedef struct { + nfapi_nr_tl_t tl; + uint16_t number_of_dcis; + nfapi_nr_dci_indication_pdu_t* dci_list; + } nfapi_nr_dci_indication_body_t; + +/// +typedef struct { + nfapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + nfapi_nr_dci_indication_body_t dci_indication_body; +} nfapi_nr_dci_indication_t; + + #define NFAPI_NR_TX_MAX_PDU 100 + typedef struct { + nfapi_nr_tl_t tl; + uint8_t* data; + } nfapi_nr_rx_request_body_t; + #define NFAPI_NR_TX_REQUEST_BODY_TAG 0x2022 + +/// +typedef struct { + nfapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + nfapi_nr_rx_request_body_t rx_request_body; +} nfapi_nr_rx_indication_t; + + typedef struct { + nfapi_nr_tl_t tl; + uint8_t ul_cqi; + uint16_t timing_advance; + } nfapi_nr_tx_indication_t; + + + #define NFAPI_NR_TX_MAX_SEGMENTS 32 + typedef struct { + uint16_t pdu_length; + uint16_t pdu_index; + uint8_t num_segments; + struct { + uint32_t segment_length; + uint8_t* segment_data; + } segments[NFAPI_NR_TX_MAX_SEGMENTS]; + + } nfapi_nr_tx_indication_pdu_t; + + #define NFAPI_NR_RX_IND_MAX_PDU 100 + typedef struct { + nfapi_nr_tl_t tl; + nfapi_nr_tx_indication_t tx_indication; + uint16_t number_of_pdus; + nfapi_nr_tx_indication_pdu_t* tx_pdu_list; + } nfapi_nr_tx_indication_body_t; + #define NFAPI_NR_RX_INDICATION_BODY_TAG 0x2023 + +/// +typedef struct { + nfapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + nfapi_nr_tx_indication_body_t tx_indication_body; +} nfapi_nr_tx_request_t; + + + typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + /*nfapi_nr_ul_config_ulsch_pdu ulsch_pdu; + nfapi_nr_ul_config_ulsch_cqi_ri_pdu ulsch_cqi_ri_pdu; + nfapi_nr_ul_config_ulsch_harq_pdu ulsch_harq_pdu; + nfapi_nr_ul_config_ulsch_cqi_harq_ri_pdu ulsch_cqi_harq_ri_pdu; + nfapi_nr_ul_config_uci_cqi_pdu uci_cqi_pdu; + nfapi_nr_ul_config_uci_sr_pdu uci_sr_pdu; + nfapi_nr_ul_config_uci_harq_pdu uci_harq_pdu; + nfapi_nr_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu; + nfapi_nr_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu; + nfapi_nr_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu; + nfapi_nr_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu; + nfapi_nr_ul_config_srs_pdu srs_pdu; + nfapi_nr_ul_config_harq_buffer_pdu harq_buffer_pdu; + nfapi_nr_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu; + nfapi_nr_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu; + nfapi_nr_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu;*/ + }; + } nfapi_nr_ul_config_request_pdu_t; + + typedef struct { + nfapi_nr_tl_t tl; + nfapi_nr_ul_config_request_pdu_t ul_config_pdu_list; + } nfapi_nr_ul_config_request_body_t; +/// +typedef struct { + nfapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + nfapi_nr_ul_config_request_body_t ul_config_request_body; +} nfapi_nr_ul_config_request_t; + + + + typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + /*nfapi_nr_dl_config_dlsch_pdu dlsch_pdu; + nfapi_nr_dl_config_prs_pdu prs_pdu; + nfapi_nr_dl_config_csi_rs_pdu csi_rs_pdu;*/ + }; + } nfapi_nr_dl_config_request_pdu_t; + +/// +typedef struct { + nfapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + nfapi_nr_dl_config_request_pdu_t dl_config_request_body; +} nfapi_nr_dl_config_request_t; + + + +// +// P5 +// + + typedef struct { + uint32_t frequency_domain_resource; + uint8_t duration; + uint8_t cce_reg_mapping_type; // interleaved or noninterleaved + uint8_t cce_reg_interleaved_reg_bundle_size; // valid if CCE to REG mapping type is interleaved type + uint8_t cce_reg_interleaved_interleaver_size; // valid if CCE to REG mapping type is interleaved type + uint8_t cce_reg_interleaved_shift_index; // valid if CCE to REG mapping type is interleaved type + uint8_t precoder_granularity; + uint8_t tci_state_pdcch; + uint8_t tci_present_in_dci; + uint16_t pdcch_dmrs_scrambling_id; + } nfapi_nr_coreset_t; + + typedef struct { + nfapi_nr_coreset_t coreset; + + uint8_t monitoring_slot_peridicity; + uint8_t monitoring_slot_offset; + uint16_t duration; + uint16_t monitoring_symbols_within_slot; + uint8_t number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 + + uint8_t dci_2_0_number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 + uint8_t dci_2_3_monitorying_periodicity; + uint8_t dci_2_3_number_of_candidates; + + } nfapi_nr_search_space_t; + + typedef struct { + nfapi_nr_search_space_t search_space_sib1; + nfapi_nr_search_space_t search_space_others_sib; + nfapi_nr_search_space_t search_space_paging; + nfapi_nr_coreset_t coreset_ra; // common coreset + nfapi_nr_search_space_t search_space_ra; + } nfapi_nr_pdcch_config_common_t; + + typedef struct { + uint8_t k0; + uint8_t mapping_type; + uint8_t symbol_starting; + uint8_t symbol_length; + } nfapi_nr_pdsch_time_domain_resource_allocation_t; + + typedef struct { + nfapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[NFAPI_NR_MAX_NUM_DL_ALLOCATIONS]; + } nfapi_nr_pdsch_config_common_t; + + typedef struct { + uint8_t prach_configuration_index; + uint8_t msg1_fdm; + uint8_t msg1_frequency_start; + uint8_t zero_correlation_zone_config; + uint8_t preamble_received_target_power; + uint8_t preamble_transmission_max; + uint8_t power_ramping_step; + uint8_t ra_window_size; + + uint8_t total_number_of_preamble; + uint8_t ssb_occasion_per_rach; + uint8_t cb_preamble_per_ssb; + + uint8_t group_a_msg3_size; + uint8_t group_a_number_of_preamble; + uint8_t group_b_power_offset; + uint8_t contention_resolution_timer; + uint8_t rsrp_threshold_ssb; + uint8_t rsrp_threshold_ssb_sul; + uint8_t prach_length; // l839, l139 + uint8_t prach_root_sequence_index; // 0 - 837 for l839, 0 - 137 for l139 + uint8_t msg1_subcarrier_spacing; + uint8_t restrictedset_config; + uint8_t msg3_transform_precoding; + } nfapi_nr_rach_config_common_t; + + typedef struct { + uint8_t k2; + uint8_t mapping_type; + uint8_t symbol_starting; + uint8_t symbol_length; + } nfapi_nr_pusch_time_domain_resource_allocation_t; + + typedef struct { + uint8_t group_hopping_enabled_transform_precoding; + nfapi_nr_pusch_time_domain_resource_allocation_t allocation_list[NFAPI_NR_MAX_NUM_UL_ALLOCATIONS]; + uint8_t msg3_delta_preamble; + uint8_t p0_nominal_with_grant; + } nfapi_nr_pusch_config_common_t; + + typedef struct { + uint8_t pucch_resource_common; + uint8_t pucch_group_hopping; + uint8_t hopping_id; + uint8_t p0_nominal; + } nfapi_nr_pucch_config_common_t; + + typedef struct { + uint8_t subcarrier_spacing_common; + uint8_t ssb_subcarrier_offset; + uint8_t dmrs_type_a_position; + uint8_t pdcch_config_sib1; + uint8_t cell_barred; + uint8_t intra_frquency_reselection; + } nfapi_nr_pbch_config_t; + + typedef struct { + nfapi_nr_tl_t tl; + + nfapi_nr_pdcch_config_common_t pdcch_config_common; + nfapi_nr_pdsch_config_common_t pdsch_config_common; + + } nfapi_nr_dl_bwp_common_config_t; + + + + typedef struct { + uint16_t int_rnti; + uint8_t time_frequency_set; + uint8_t dci_payload_size; + uint8_t serving_cell_id[NFAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell + uint8_t position_in_dci[NFAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell + } nfapi_nr_downlink_preemption_t; + + typedef struct { + uint8_t tpc_index; + uint8_t tpc_index_sul; + uint8_t target_cell; + } nfapi_nr_pusch_tpc_command_config_t; + + typedef struct { + uint8_t tpc_index_pcell; + uint8_t tpc_index_pucch_scell; + } nfapi_nr_pucch_tpc_command_config_t; + + typedef struct { + uint8_t starting_bit_of_format_2_3; + uint8_t feild_type_format_2_3; + } nfapi_nr_srs_tpc_command_config_t; + + typedef struct { + nfapi_nr_downlink_preemption_t downlink_preemption; + nfapi_nr_pusch_tpc_command_config_t tpc_pusch; + nfapi_nr_pucch_tpc_command_config_t tpc_pucch; + nfapi_nr_srs_tpc_command_config_t tpc_srs; + } nfapi_nr_pdcch_config_dedicated_t; + + typedef struct { + uint8_t dmrs_type; + uint8_t dmrs_addition_position; + uint8_t max_length; + uint16_t scrambling_id_0; + uint16_t scrambling_id_1; + uint8_t ptrs_frequency_density[2]; // phase tracking rs + uint8_t ptrs_time_density[3]; // phase tracking rs + uint8_t ptrs_epre_ratio; // phase tracking rs + uint8_t ptrs_resource_element_offset; // phase tracking rs + } nfapi_nr_dmrs_downlink_config_t; + + typedef struct { + uint8_t bwp_or_cell_level; + uint8_t pattern_type; + uint32_t resource_blocks[9]; // bitmaps type 275 bits + uint8_t slot_type; // bitmaps type one/two slot(s) + uint32_t symbols_in_resouece_block; // bitmaps type 14/28 bits + uint8_t periodic; // bitmaps type + uint32_t pattern[2]; // bitmaps type 2/4/5/8/10/20/40 bits + + nfapi_nr_coreset_t coreset; // coreset + + uint8_t subcarrier_spacing; + uint8_t mode; + } nfapi_nr_rate_matching_pattern_group_t; + + typedef struct { + // resource mapping + uint8_t row; // row1/row2/row4/other + uint16_t frequency_domain_allocation; // 4/12/3/6 bits + uint8_t number_of_ports; + uint8_t first_ofdm_symbol_in_time_domain; + uint8_t first_ofdm_symbol_in_time_domain2; + uint8_t cdm_type; + uint8_t density; // .5/1/3 + uint8_t density_dot5_type; // even/odd PRBs + + uint8_t frequency_band_starting_rb; // freqBand + uint8_t frequency_band_number_of_rb; // freqBand + + // periodicityAndOffset + uint8_t periodicity; // slot4/5/8/10/16/20/32/40/64/80/160/320/640 + uint32_t offset; // 0..639 bits + } nfapi_nr_zp_csi_rs_resource_t; + + typedef struct { + uint16_t data_scrambling_id_pdsch; + nfapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_a; + nfapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_b; + uint8_t vrb_to_prb_interleaver; + uint8_t resource_allocation; + nfapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[NFAPI_NR_MAX_NUM_DL_ALLOCATIONS]; + uint8_t pdsch_aggregation_factor; + nfapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group1; + nfapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group2; + uint8_t rbg_size; + uint8_t mcs_table; + uint8_t max_num_of_code_word_scheduled_by_dci; + uint8_t bundle_size; // prb_bundling static + uint8_t bundle_size_set1; // prb_bundling dynamic + uint8_t bundle_size_set2; // prb_bundling dynamic + nfapi_nr_zp_csi_rs_resource_t periodically_zp_csi_rs_resource_set[NFAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET]; + } nfapi_nr_pdsch_config_dedicated_t; + + typedef struct { + uint16_t starting_prb; + uint8_t intra_slot_frequency_hopping; + uint16_t second_hop_prb; + uint8_t format; // pucch format 0..4 + uint8_t initial_cyclic_shift; + uint8_t number_of_symbols; + uint8_t starting_symbol_index; + uint8_t time_domain_occ; + uint8_t number_of_prbs; + uint8_t occ_length; + uint8_t occ_index; + } nfapi_nr_pucch_resource_t; + + typedef struct { + uint8_t periodicity; + uint8_t number_of_harq_process; + nfapi_nr_pucch_resource_t n1_pucch_an; + } nfapi_nr_sps_config_t; + + typedef struct { + uint8_t beam_failure_instance_max_count; + uint8_t beam_failure_detection_timer; + } nfapi_nr_radio_link_monitoring_config_t; + + typedef struct { + nfapi_nr_pdcch_config_dedicated_t pdcch_config_dedicated; + nfapi_nr_pdsch_config_dedicated_t pdsch_config_dedicated; + nfapi_nr_sps_config_t sps_config; + nfapi_nr_radio_link_monitoring_config_t radio_link_monitoring_config; + + } nfapi_nr_dl_bwp_dedicated_config_t; + + typedef struct { + nfapi_nr_rach_config_common_t rach_config_common; + nfapi_nr_pusch_config_common_t pusch_config_common; + nfapi_nr_pucch_config_common_t pucch_config_common; + + } nfapi_nr_ul_bwp_common_config_t; + + typedef struct { + uint8_t inter_slot_frequency_hopping; + uint8_t additional_dmrs; + uint8_t max_code_rate; + uint8_t number_of_slots; + uint8_t pi2bpsk; + uint8_t simultaneous_harq_ack_csi; + } nfapi_nr_pucch_format_config_t; + + typedef struct { + nfapi_nr_pucch_format_config_t format1; + nfapi_nr_pucch_format_config_t format2; + nfapi_nr_pucch_format_config_t format3; + nfapi_nr_pucch_format_config_t format4; + nfapi_nr_pucch_resource_t multi_csi_pucch_resources[2]; + uint8_t dl_data_to_ul_ack[8]; + // pucch power control + uint8_t deltaF_pucch_f0; + uint8_t deltaF_pucch_f1; + uint8_t deltaF_pucch_f2; + uint8_t deltaF_pucch_f3; + uint8_t deltaF_pucch_f4; + uint8_t two_pucch_pc_adjusment_states; + } nfapi_nr_ul_bwp_dedicated_config_t; + +typedef struct { + nfapi_nr_p4_p5_message_header_t header; + uint8_t num_tlv; + + nfapi_nr_pbch_config_t pbch_config_common; // MIB + + nfapi_nr_dl_bwp_common_config_t dl_bwp_common; + nfapi_nr_dl_bwp_dedicated_config_t dl_bwp_dedicated; + + nfapi_nr_ul_bwp_common_config_t ul_bwp_common; + nfapi_nr_ul_bwp_dedicated_config_t ul_bwp_dedicated; + +} nfapi_nr_config_request_t; + +#endif /* _NFAPI_INTERFACE_H_ */ diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nr_fapi_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nr_fapi_ue_interface.h deleted file mode 100644 index fcfb7e7b25..0000000000 --- a/nfapi/open-nFAPI/nfapi/public_inc/nr_fapi_ue_interface.h +++ /dev/null @@ -1,3886 +0,0 @@ -/* - * Copyright 2017 Cisco Systems, Inc. - * - * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - - -#ifndef _NFAPI_INTERFACE_NR_EXTENSION_H_ -#define _NFAPI_INTERFACE_NR_EXTENSION_H_ -#define _NFAPI_INTERFACE_H_ - -#include "stddef.h" - -// Constants - update based on implementation -#define NFAPI_MAX_PHY_RF_INSTANCES 2 -#define NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH 16 -#define NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH 3 -#define NFAPI_MAX_NUM_RF_BANDS 16 - -// The following definition control the size of arrays used in the interface. -// These may be changed if desired. They are used in the encoder to make sure -// that the user has not specified a 'count' larger than the max array, and also -// used by the decoder when decode an array. If the 'count' received is larger -// than the array it is to be stored in the decode fails. -#define NFAPI_MAX_NUM_ANTENNAS 8 -#define NFAPI_MAX_NUM_SUBBANDS 13 -#define NFAPI_MAX_BF_VECTORS 8 -#define NFAPI_MAX_CC 1 -#define NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8 -#define NFAPI_MAX_RSSI 8 -#define NFAPI_MAX_PSC_LIST 32 -#define NFAPI_MAX_PCI_LIST 32 -#define NFAPI_MAX_CARRIER_LIST 32 -#define NFAPI_MAX_ARFCN_LIST 128 -#define NFAPI_MAX_LTE_CELLS_FOUND 8 -#define NFAPI_MAX_UTRAN_CELLS_FOUND 8 -#define NFAPI_MAX_GSM_CELLS_FOUND 8 -#define NFAPI_MAX_NB_IOT_CELLS_FOUND 8 -#define NFAPI_MAX_SI_PERIODICITY 8 -#define NFAPI_MAX_SI_INDEX 8 -#define NFAPI_MAX_MIB_LENGTH 32 -#define NFAPI_MAX_SIB_LENGTH 256 -#define NFAPI_MAX_SI_LENGTH 256 -#define NFAPI_MAX_OPAQUE_DATA 64 -#define NFAPI_MAX_NUM_SCHEDULED_UES 8 // Used in the TPM structure -#define NFAPI_MAX_PNF_PHY 5 -#define NFAPI_MAX_PNF_PHY_RF_CONFIG 5 -#define NFAPI_MAX_PNF_RF 5 -#define NFAPI_MAX_NMM_FREQUENCY_BANDS 32 -#define NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS 100 -#define NFAPI_MAX_UL_DL_CONFIGURATIONS 5 -#define NFAPI_MAX_CSI_RS_RESOURCE_CONFIG 4 -#define NFAPI_MAX_ANTENNA_PORT_COUNT 8 -#define NFAPI_MAX_EPDCCH_PRB 8 -#define NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS 8 -#define NFAPI_MAX_NUMBER_ACK_NACK_TDD 8 -#define NFAPI_MAX_RO_DL 8 - -#define NFAPI_HEADER_LENGTH 8 -#define NFAPI_P7_HEADER_LENGTH 16 - -#define NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE 0xF000 -#define NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE 0xFFFF - -#define NFAPI_VERSION_3_0_11 0x000 -#define NFAPI_VERSION_3_0_12 0x001 - -// The IANA agreed port definition of the P5 SCTP VNF enpoint -// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=7701 -#define NFAPI_P5_SCTP_PORT 7701 - -typedef unsigned int uint32_t; -typedef unsigned short uint16_t; -typedef unsigned char uint8_t; -typedef signed int int32_t; -typedef signed short int16_t; -typedef signed char int8_t; - -typedef struct { - uint16_t phy_id; - uint16_t message_id; - uint16_t message_length; - uint16_t spare; -} nfapi_p4_p5_message_header_t; - -typedef struct { - uint16_t phy_id; - uint16_t message_id; - uint16_t message_length; - uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/ - uint32_t checksum; - uint32_t transmit_timestamp; -} nfapi_p7_message_header_t; - -#define NFAPI_PHY_ID_NA 0 - -//#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x80) >> 7 ) -//#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x70) >> 4 ) -#define NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x8000) >> 15 ) -#define NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x7F00) >> 8 ) -#define NFAPI_P7_GET_SEQUENCE(_mss) ( (_mss) & 0x00FF ) -#define NFAPI_P7_SET_MSS(_more, _segm, _sequ) ( (((_more) & 0x1) << 7) | (((_segm) & 0x7) << 4) | ((_sequ) & 0xF) ) - -typedef struct { - uint16_t tag; - uint16_t length; -} nfapi_tl_t; -#define NFAPI_TAG_LENGTH_PACKED_LEN 4 - -// Convenience methods to convert between SFN/SFN formats -#define NFAPI_SFNSF2DEC(_sfnsf) ((((_sfnsf) >> 4) * 10) + ((_sfnsf) & 0xF)) -#define NFAPI_SFNSFDEC2SFNSF(_sfnsf_dec) ((((_sfnsf_dec) / 10) << 4) | (((_sfnsf_dec) - (((_sfnsf_dec) / 10) * 10)) & 0xF)) - -#define NFAPI_SFNSF2SFN(_sfnsf) ((_sfnsf) >> 4) -#define NFAPI_SFNSF2SF(_sfnsf) ((_sfnsf) & 0xF) - -#define NFAPI_MAX_SFNSFDEC 10240 - -typedef nfapi_tl_t* nfapi_vendor_extension_tlv_t; - - -// nFAPI Message IDs -typedef enum { - NFAPI_DL_CONFIG_REQUEST = 0x0080, - NFAPI_UL_CONFIG_REQUEST, - NFAPI_SUBFRAME_INDICATION, - NFAPI_HI_DCI0_REQUEST, - NFAPI_TX_REQUEST, - NFAPI_HARQ_INDICATION, - NFAPI_CRC_INDICATION, - NFAPI_RX_ULSCH_INDICATION, - NFAPI_RACH_INDICATION, - NFAPI_SRS_INDICATION, - NFAPI_RX_SR_INDICATION, - NFAPI_RX_CQI_INDICATION, - NFAPI_LBT_DL_CONFIG_REQUEST, - NFAPI_LBT_DL_INDICATION, - NFAPI_NB_HARQ_INDICATION, - NFAPI_NRACH_INDICATION, - - NFAPI_PNF_PARAM_REQUEST = 0x0100, - NFAPI_PNF_PARAM_RESPONSE, - NFAPI_PNF_CONFIG_REQUEST, - NFAPI_PNF_CONFIG_RESPONSE, - NFAPI_PNF_START_REQUEST, - NFAPI_PNF_START_RESPONSE, - NFAPI_PNF_STOP_REQUEST, - NFAPI_PNF_STOP_RESPONSE, - NFAPI_PARAM_REQUEST, - NFAPI_PARAM_RESPONSE, - NFAPI_CONFIG_REQUEST, - NFAPI_CONFIG_RESPONSE, - NFAPI_START_REQUEST, - NFAPI_START_RESPONSE, - NFAPI_STOP_REQUEST, - NFAPI_STOP_RESPONSE, - NFAPI_MEASUREMENT_REQUEST, - NFAPI_MEASUREMENT_RESPONSE, - - NFAPI_UL_NODE_SYNC = 0x0180, - NFAPI_DL_NODE_SYNC, - NFAPI_TIMING_INFO, - - - NFAPI_RSSI_REQUEST = 0x0200, - NFAPI_RSSI_RESPONSE, - NFAPI_RSSI_INDICATION, - NFAPI_CELL_SEARCH_REQUEST, - NFAPI_CELL_SEARCH_RESPONSE, - NFAPI_CELL_SEARCH_INDICATION, - NFAPI_BROADCAST_DETECT_REQUEST, - NFAPI_BROADCAST_DETECT_RESPONSE, - NFAPI_BROADCAST_DETECT_INDICATION, - NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST, - NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE, - NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION, - NFAPI_SYSTEM_INFORMATION_REQUEST, - NFAPI_SYSTEM_INFORMATION_RESPONSE, - NFAPI_SYSTEM_INFORMATION_INDICATION, - NFAPI_NMM_STOP_REQUEST, - NFAPI_NMM_STOP_RESPONSE, - - NFAPI_VENDOR_EXT_MSG_MIN = 0x0300, - NFAPI_VENDOR_EXT_MSG_MAX = 0x03FF, - - - NFAPI_MAX_MESSAGE_ID, -} nfapi_message_id_e; - -// nFAPI Error Codes -typedef enum { - NFAPI_MSG_OK = 0, - NFAPI_MSG_INVALID_STATE, - NFAPI_MSG_INVALID_CONFIG, - NFAPI_SFN_OUT_OF_SYNC, - NFAPI_MSG_SUBFRAME_ERR, - NFAPI_MSG_BCH_MISSING, - NFAPI_MSG_INVALID_SFN, - NFAPI_MSG_HI_ERR, - NFAPI_MSG_TX_ERR, - - NFAPI_LBT_NO_PDU_IN_DL_REQ, - NFAPI_LBT_NO_VALID_CONFIG_REQ_RECEIVED, - NFAPI_FAPI_E_LBT_SF_SFN_PASSED_END_SF_SFN, - NFAPI_FAPI_E_LBT_OVERLAP, - NFAPI_MSG_BCH_PRESENT, - - NFAPI_NBIOT_UNEXPECTED_REQ, - - // This is special return code that indicates that a response has - // been send via P9 - NFAPI_MSG_P9_RESPONSE = 0xAA -} nfapi_error_code_e; - - -typedef enum { - NFAPI_P4_MSG_OK = 100, - NFAPI_P4_MSG_INVALID_STATE = 101, - NFAPI_P4_MSG_INVALID_CONFIG = 102, - NFAPI_P4_MSG_RAT_NOT_SUPPORTED = 103, - NFAPI_P4_MSG_NMM_STOP_OK = 200, - NFAPI_P4_MSG_NMM_STOP_IGNOREDED = 201, - NFAPI_P4_MSG_NMM_STOP_INVALID_STATE = 202, - NFAPI_P4_MSG_PROCEDURE_COMPLETE = 300, - NFAPI_P4_MSG_PROCEDURE_STOPPED = 301, - NFAPI_P4_MSG_PARTIAL_RESULTS = 302, - NFAPI_P4_MSG_TIMEOUT = 303 -} nfapi_p4_error_code_e; - -// nFAPI enums -typedef enum { - NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE = 0, - NFAPI_DL_CONFIG_BCH_PDU_TYPE, - NFAPI_DL_CONFIG_MCH_PDU_TYPE, - NFAPI_DL_CONFIG_DLSCH_PDU_TYPE, - NFAPI_DL_CONFIG_PCH_PDU_TYPE, - NFAPI_DL_CONFIG_PRS_PDU_TYPE, - NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE, - NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE, - NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE, - NFAPI_DL_CONFIG_NBCH_PDU_TYPE, - NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE, - NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE -} nfapi_dl_config_pdu_type_e; - -typedef enum { - NFAPI_DL_DCI_FORMAT_1 = 0, - NFAPI_DL_DCI_FORMAT_1A, - NFAPI_DL_DCI_FORMAT_1B, - NFAPI_DL_DCI_FORMAT_1C, - NFAPI_DL_DCI_FORMAT_1D, - NFAPI_DL_DCI_FORMAT_2, - NFAPI_DL_DCI_FORMAT_2A, - NFAPI_DL_DCI_FORMAT_2B, - NFAPI_DL_DCI_FORMAT_2C -} nfapi_dl_dci_format_e; - -typedef enum { - NFAPI_UL_DCI_FORMAT_0 = 0, - NFAPI_UL_DCI_FORMAT_3, - NFAPI_UL_DCI_FORMAT_3A, - NFAPI_UL_DCI_FORMAT_4 -} nfapi_ul_dci_format_e; - -typedef enum { - NFAPI_UL_CONFIG_ULSCH_PDU_TYPE = 0, - NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE, - NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, - NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, - NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE, - NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE, - NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE, - NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE, - NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE, - NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE, - NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE, - NFAPI_UL_CONFIG_SRS_PDU_TYPE, - NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE, - NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE, - NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, - NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, - NFAPI_UL_CONFIG_NULSCH_PDU_TYPE, - NFAPI_UL_CONFIG_NRACH_PDU_TYPE, -} nfapi_ul_config_pdu_type_e; - -typedef enum { - NFAPI_HI_DCI0_HI_PDU_TYPE = 0, - NFAPI_HI_DCI0_DCI_PDU_TYPE, - NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE, - NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE, - NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE, -} nfapi_hi_dci0_pdu_type_e; - -typedef enum { - NFAPI_HARQ_ACK = 1, - NFAPI_HARQ_NACK, - NFAPI_HARQ_ACK_OR_NACK, - NFAPI_HARQ_DTX, - NFAPI_HARQ_ACK_OR_DTX, - NFAPI_HARQ_NACK_OR_DTX, - NFAPI_HARQ_ACK_OR_NACK_OR_DTX -} nfapi_harq_type_e; - -typedef enum { - NFAPI_CSI_REPORT_TYPE_PERIODIC = 0, - NFAPI_CSI_REPORT_TYPE_APERIODIC -} nfapi_csi_report_type_e; - -typedef enum { - NFAPI_DL_BW_SUPPORTED_6 = 1, - NFAPI_DL_BW_SUPPORTED_15 = 2, - NFAPI_DL_BW_SUPPORTED_25 = 4, - NFAPI_DL_BW_SUPPORTED_50 = 8, - NFAPI_DL_BW_SUPPORTED_75 = 16, - NFAPI_DL_BW_SUPPORTED_100 = 32 -} nfapi_dl_bandwith_supported_e; - -typedef enum { - NFAPI_UL_BW_SUPPORTED_6 = 1, - NFAPI_UL_BW_SUPPORTED_15 = 2, - NFAPI_UL_BW_SUPPORTED_25 = 4, - NFAPI_UL_BW_SUPPORTED_50 = 8, - NFAPI_UL_BW_SUPPORTED_75 = 16, - NFAPI_UL_BW_SUPPORTED_100 = 32 -} nfapi_ul_bandwith_supported_e; - -typedef enum { - NFAPI_3GPP_REL_SUPPORTED_8 = 0, - NFAPI_3GPP_REL_SUPPORTED_9 = 1, - NFAPI_3GPP_REL_SUPPORTED_10 = 2, - NFAPI_3GPP_REL_SUPPORTED_11 = 4, - NFAPI_3GPP_REL_SUPPORTED_12 = 8, - NFAPI_3GPP_REL_SUPPORTED_15 = 64 -} nfapi_3gpp_release_supported_e; - - -typedef enum { - NFAPI_DUPLEXING_MODE_TDD = 0, - NFAPI_DUPLEXING_MODE_FDD = 1, - NFAPI_DUPLEXING_MODE_HD_FDD = 2, -} nfapi_duplexing_mode_e; - -typedef enum { - NFAPI_CP_NORMAL = 0, - NFAPI_CP_EXTENDED = 1 -} nfapi_cyclic_prefix_type_e; - -typedef enum { - NFAPI_RAT_TYPE_LTE = 0, - NFAPI_RAT_TYPE_UTRAN = 1, - NFAPI_RAT_TYPE_GERAN = 2, - NFAPI_RAT_TYPE_NB_IOT = 3, - NFAPI_RAT_TYPE_NR = 4 -} nfapi_rat_type_e; - -typedef enum { - NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING, - NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING, - NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING, - NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION, - NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3, - NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4, - NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5 -} nfapi_harq_indication_tdd_ack_nackformat_e; - - -typedef enum { - NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE = 0, - NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE -} nfapi_lbt_dl_config_pdu_type_e; - -typedef enum { - NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE = 0, - NFAPI_LBT_DL_RSP_DRS_PDU_TYPE -} nfapi_lbt_dl_rsp_pdu_type_e; - -typedef struct { - nfapi_tl_t tl; - uint32_t length; - uint8_t value[NFAPI_MAX_OPAQUE_DATA]; -} nfapi_opaqaue_data_t; - -// Utility functions to turn enums into char* -const char* nfapi_error_code_to_str(nfapi_error_code_e value); - - -// P5 Sub Structures -typedef struct { - nfapi_tl_t tl; - uint8_t nfapi_sync_mode; - uint8_t location_mode; - uint16_t location_coordinates_length; - uint8_t location_coordinates[NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH]; - uint32_t dl_config_timing; - uint32_t tx_timing; - uint32_t ul_config_timing; - uint32_t hi_dci0_timing; - uint16_t maximum_number_phys; - uint16_t maximum_total_bandwidth; - uint8_t maximum_total_number_dl_layers; - uint8_t maximum_total_number_ul_layers; - uint8_t shared_bands; - uint8_t shared_pa; - int16_t maximum_total_power; - uint8_t oui[NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH]; -} nfapi_pnf_param_general_t; -#define NFAPI_PNF_PARAM_GENERAL_TAG 0x1000 - - - - - -typedef struct { - uint16_t rf_config_index; -} nfapi_rf_config_info_t; - -typedef struct { - uint16_t phy_config_index; - uint16_t number_of_rfs; - nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; - uint16_t number_of_rf_exclusions; - nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; - uint16_t downlink_channel_bandwidth_supported; - uint16_t uplink_channel_bandwidth_supported; - uint8_t number_of_dl_layers_supported; - uint8_t number_of_ul_layers_supported; - uint16_t maximum_3gpp_release_supported; - uint8_t nmm_modes_supported; -} nfapi_pnf_phy_info_t; - - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_phys; - nfapi_pnf_phy_info_t phy[NFAPI_MAX_PNF_PHY]; -} nfapi_pnf_phy_t; -#define NFAPI_PNF_PHY_TAG 0x1001 - -typedef struct { - uint16_t phy_config_index; - uint16_t transmission_mode_7_supported; - uint16_t transmission_mode_8_supported; - uint16_t two_antenna_ports_for_pucch; - uint16_t transmission_mode_9_supported; - uint16_t simultaneous_pucch_pusch; - uint16_t four_layer_tx_with_tm3_and_tm4; -} nfapi_pnf_phy_rel10_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_phys; - nfapi_pnf_phy_rel10_info_t phy[NFAPI_MAX_PNF_PHY]; -} nfapi_pnf_phy_rel10_t; -#define NFAPI_PNF_PHY_REL10_TAG 0x100A - -typedef struct { - uint16_t phy_config_index; - uint16_t edpcch_supported; - uint16_t multi_ack_csi_reporting; - uint16_t pucch_tx_diversity; - uint16_t ul_comp_supported; - uint16_t transmission_mode_5_supported; -} nfapi_pnf_phy_rel11_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_phys; - nfapi_pnf_phy_rel11_info_t phy[NFAPI_MAX_PNF_PHY]; -} nfapi_pnf_phy_rel11_t; -#define NFAPI_PNF_PHY_REL11_TAG 0x100B - - -typedef struct { - uint16_t phy_config_index; - uint16_t csi_subframe_set; - uint16_t enhanced_4tx_codebook; - uint16_t drs_supported; - uint16_t ul_64qam_supported; - uint16_t transmission_mode_10_supported; - uint16_t alternative_bts_indices; -} nfapi_pnf_phy_rel12_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_phys; - nfapi_pnf_phy_rel12_info_t phy[NFAPI_MAX_PNF_PHY]; -} nfapi_pnf_phy_rel12_t; -#define NFAPI_PNF_PHY_REL12_TAG 0x100C - -typedef struct { - uint16_t phy_config_index; - uint16_t pucch_format4_supported; - uint16_t pucch_format5_supported; - uint16_t more_than_5_ca_support; - uint16_t laa_supported; - uint16_t laa_ending_in_dwpts_supported; - uint16_t laa_starting_in_second_slot_supported; - uint16_t beamforming_supported; - uint16_t csi_rs_enhancement_supported; - uint16_t drms_enhancement_supported; - uint16_t srs_enhancement_supported; -} nfapi_pnf_phy_rel13_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_phys; - nfapi_pnf_phy_rel13_info_t phy[NFAPI_MAX_PNF_PHY]; -} nfapi_pnf_phy_rel13_t; -#define NFAPI_PNF_PHY_REL13_TAG 0x100D - -typedef struct { - uint16_t phy_config_index; - uint16_t number_of_rfs; - nfapi_rf_config_info_t rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; - uint16_t number_of_rf_exclusions; - nfapi_rf_config_info_t excluded_rf_config[NFAPI_MAX_PNF_PHY_RF_CONFIG]; - uint8_t number_of_dl_layers_supported; - uint8_t number_of_ul_layers_supported; - uint16_t maximum_3gpp_release_supported; - uint8_t nmm_modes_supported; -} nfapi_pnf_phy_rel13_nb_iot_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_phys; - nfapi_pnf_phy_rel13_nb_iot_info_t phy[NFAPI_MAX_PNF_PHY]; -} nfapi_pnf_phy_rel13_nb_iot_t; -#define NFAPI_PNF_PHY_REL13_NB_IOT_TAG 0x100E - -typedef struct { - uint16_t phy_config_index; -} nfapi_pnf_phy_rel15_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_phys; - nfapi_pnf_phy_rel15_info_t phy[NFAPI_MAX_PNF_PHY]; -} nfapi_pnf_phy_rel15_t; -#define NFAPI_PNF_PHY_REL15_TAG 0x100H - - -typedef struct { - uint16_t rf_config_index; - uint16_t band; - int16_t maximum_transmit_power; - int16_t minimum_transmit_power; - uint8_t number_of_antennas_suppported; - uint32_t minimum_downlink_frequency; - uint32_t maximum_downlink_frequency; - uint32_t minimum_uplink_frequency; - uint32_t maximum_uplink_frequency; -} nfapi_pnf_rf_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_rfs; - nfapi_pnf_rf_info_t rf[NFAPI_MAX_PNF_RF]; -} nfapi_pnf_rf_t; -#define NFAPI_PNF_RF_TAG 0x1002 - -typedef struct { - uint16_t phy_id; - uint16_t phy_config_index; - uint16_t rf_config_index; -} nfapi_phy_rf_config_info_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_phy_rf_config_info; - nfapi_phy_rf_config_info_t phy_rf_config[NFAPI_MAX_PHY_RF_INSTANCES]; -} nfapi_pnf_phy_rf_config_t; -#define NFAPI_PNF_PHY_RF_TAG 0x1003 - -// Generic strucutre for single tlv value. -typedef struct { - nfapi_tl_t tl; - uint16_t value; -} nfapi_uint16_tlv_t; - -typedef struct { - nfapi_tl_t tl; - int16_t value; -} nfapi_int16_tlv_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t value; -} nfapi_uint8_tlv_t; - -typedef struct { - nfapi_uint16_tlv_t phy_state; -} nfapi_l1_status; - -#define NFAPI_L1_STATUS_PHY_STATE_TAG 0x00FA - -typedef struct { - nfapi_uint16_tlv_t dl_bandwidth_support; - nfapi_uint16_tlv_t ul_bandwidth_support; - nfapi_uint16_tlv_t dl_modulation_support; - nfapi_uint16_tlv_t ul_modulation_support; - nfapi_uint16_tlv_t phy_antenna_capability; - nfapi_uint16_tlv_t release_capability; - nfapi_uint16_tlv_t mbsfn_capability; -} nfapi_phy_capabilities_t; - -#define NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG 0x00C8 -#define NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG 0x00C9 -#define NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG 0x00CA -#define NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG 0x00CB -#define NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG 0x00CC -#define NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG 0x00CD -#define NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG 0x00CE - - -typedef struct { - nfapi_uint16_tlv_t data_report_mode; - nfapi_uint16_tlv_t sfnsf; -} nfapi_l23_config_t; - - -#define NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG 0x00F0 -#define NFAPI_L23_CONFIG_SFNSF_TAG 0x00F1 - -typedef struct { - nfapi_uint16_tlv_t numerology_index_mu; - nfapi_uint16_tlv_t duplex_mode; - nfapi_uint16_tlv_t pcfich_power_offset; - nfapi_uint16_tlv_t pb; - nfapi_uint16_tlv_t dl_cyclic_prefix_type; - nfapi_uint16_tlv_t ul_cyclic_prefix_type; -} nfapi_subframe_config_t; - -#define NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x0001 -#define NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x0002 -#define NFAPI_SUBFRAME_CONFIG_PB_TAG 0x0003 -#define NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x0004 -#define NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x0005 -#define NFAPI_SUBFRAME_CONFIG_NUMEROLOGY_INDEX_MU_TAG 0x0006 - -typedef struct { - nfapi_uint16_tlv_t dl_channel_bandwidth; - nfapi_uint16_tlv_t ul_channel_bandwidth; - nfapi_uint16_tlv_t reference_signal_power; - nfapi_uint16_tlv_t tx_antenna_ports; - nfapi_uint16_tlv_t rx_antenna_ports; -} nfapi_rf_config_t; - -#define NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x000A -#define NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG 0x000B -#define NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG 0x000C -#define NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG 0x000D -#define NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG 0x000E - -typedef struct { - nfapi_uint16_tlv_t phich_resource; - nfapi_uint16_tlv_t phich_duration; - nfapi_uint16_tlv_t phich_power_offset; -} nfapi_phich_config_t; - -#define NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG 0x0014 -#define NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG 0x0015 -#define NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG 0x0016 - -typedef enum { - NFAPI_HALF_FRAME_INDEX_FIRST_HALF = 0, - NFAPI_HALF_FRAME_INDEX_SECOND_HALF = 1 -} nfapi_half_frame_index_e; - -typedef struct { - nfapi_uint16_tlv_t primary_synchronization_signal_epre_eprers; - nfapi_uint16_tlv_t secondary_synchronization_signal_epre_eprers; - nfapi_uint16_tlv_t physical_cell_id; - nfapi_half_frame_index_e half_frame_index; - nfapi_uint16_tlv_t ssb_subcarrier_offset; - nfapi_uint16_tlv_t ssb_position_in_burst; - nfapi_uint16_tlv_t ssb_periodicity; - nfapi_uint16_tlv_t ss_pbch_block_power; -} nfapi_sch_config_t; - -#define NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001E -#define NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001F -#define NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x0020 -#define NFAPI_SCH_CONFIG_HALF_FRAME_INDEX_TAG 0x0021 -#define NFAPI_SCH_CONFIG_SSB_SUBCARRIER_OFFSET_TAG 0x0022 -#define NFAPI_SCH_CONFIG_SSB_POSITION_IN_BURST 0x0023 -#define NFAPI_SCH_CONFIG_SSB_PERIODICITY 0x0024 -#define NFAPI_SCH_CONFIG_SS_PBCH_BLOCK_POWER 0x0025 - -typedef struct { - nfapi_uint16_tlv_t configuration_index; - nfapi_uint16_tlv_t root_sequence_index; - nfapi_uint16_tlv_t zero_correlation_zone_configuration; - nfapi_uint16_tlv_t high_speed_flag; - nfapi_uint16_tlv_t frequency_offset; -} nfapi_prach_config_t; - -#define NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG 0x0028 -#define NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG 0x0029 -#define NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x002A -#define NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG 0x002B -#define NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG 0x002C - -typedef struct { - nfapi_uint16_tlv_t hopping_mode; - nfapi_uint16_tlv_t hopping_offset; - nfapi_uint16_tlv_t number_of_subbands; -} nfapi_pusch_config_t; - -#define NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG 0x0032 -#define NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG 0x0033 -#define NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG 0x0034 - -typedef struct { - nfapi_uint16_tlv_t delta_pucch_shift; - nfapi_uint16_tlv_t n_cqi_rb; - nfapi_uint16_tlv_t n_an_cs; - nfapi_uint16_tlv_t n1_pucch_an; -} nfapi_pucch_config_t; - -#define NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG 0x003C -#define NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG 0x003D -#define NFAPI_PUCCH_CONFIG_N_AN_CS_TAG 0x003E -#define NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG 0x003F - -typedef struct { - nfapi_uint16_tlv_t bandwidth_configuration; - nfapi_uint16_tlv_t max_up_pts; - nfapi_uint16_tlv_t srs_subframe_configuration; - nfapi_uint16_tlv_t srs_acknack_srs_simultaneous_transmission; -} nfapi_srs_config_t; - -#define NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG 0x0046 -#define NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG 0x0047 -#define NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG 0x0048 -#define NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG 0x0049 - -typedef struct { - nfapi_uint16_tlv_t uplink_rs_hopping; - nfapi_uint16_tlv_t group_assignment; - nfapi_uint16_tlv_t cyclic_shift_1_for_drms; -} nfapi_uplink_reference_signal_config_t; - -#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG 0x0050 -#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG 0x0051 -#define NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG 0x0052 - - -typedef struct { - nfapi_uint16_tlv_t ed_threshold_lbt_pdsch; - nfapi_uint16_tlv_t ed_threshold_lbt_drs; - nfapi_uint16_tlv_t pd_threshold; - nfapi_uint16_tlv_t multi_carrier_type; - nfapi_uint16_tlv_t multi_carrier_tx; - nfapi_uint16_tlv_t multi_carrier_freeze; - nfapi_uint16_tlv_t tx_antenna_ports_drs; - nfapi_uint16_tlv_t tx_power_drs; -} nfapi_laa_config_t; - -#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG 0x0064 -#define NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG 0x0065 -#define NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG 0x0066 -#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG 0x0067 -#define NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG 0x0068 -#define NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG 0x0069 -#define NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG 0x006A -#define NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG 0x006B - -typedef struct { - - nfapi_uint16_tlv_t pbch_repetitions_enable_r13; - nfapi_uint16_tlv_t prach_catm_root_sequence_index; - nfapi_uint16_tlv_t prach_catm_zero_correlation_zone_configuration; - nfapi_uint16_tlv_t prach_catm_high_speed_flag; - nfapi_uint16_tlv_t prach_ce_level_0_enable; - nfapi_uint16_tlv_t prach_ce_level_0_configuration_index; - nfapi_uint16_tlv_t prach_ce_level_0_frequency_offset; - nfapi_uint16_tlv_t prach_ce_level_0_number_of_repetitions_per_attempt; - nfapi_uint16_tlv_t prach_ce_level_0_starting_subframe_periodicity; - nfapi_uint16_tlv_t prach_ce_level_0_hopping_enable; - nfapi_uint16_tlv_t prach_ce_level_0_hopping_offset; - nfapi_uint16_tlv_t prach_ce_level_1_enable; - nfapi_uint16_tlv_t prach_ce_level_1_configuration_index; - nfapi_uint16_tlv_t prach_ce_level_1_frequency_offset; - nfapi_uint16_tlv_t prach_ce_level_1_number_of_repetitions_per_attempt; - nfapi_uint16_tlv_t prach_ce_level_1_starting_subframe_periodicity; - nfapi_uint16_tlv_t prach_ce_level_1_hopping_enable; - nfapi_uint16_tlv_t prach_ce_level_1_hopping_offset; - nfapi_uint16_tlv_t prach_ce_level_2_enable; - nfapi_uint16_tlv_t prach_ce_level_2_configuration_index; - nfapi_uint16_tlv_t prach_ce_level_2_frequency_offset; - nfapi_uint16_tlv_t prach_ce_level_2_number_of_repetitions_per_attempt; - nfapi_uint16_tlv_t prach_ce_level_2_starting_subframe_periodicity; - nfapi_uint16_tlv_t prach_ce_level_2_hopping_enable; - nfapi_uint16_tlv_t prach_ce_level_2_hopping_offset; - nfapi_uint16_tlv_t prach_ce_level_3_enable; - nfapi_uint16_tlv_t prach_ce_level_3_configuration_index; - nfapi_uint16_tlv_t prach_ce_level_3_frequency_offset; - nfapi_uint16_tlv_t prach_ce_level_3_number_of_repetitions_per_attempt; - nfapi_uint16_tlv_t prach_ce_level_3_starting_subframe_periodicity; - nfapi_uint16_tlv_t prach_ce_level_3_hopping_enable; - nfapi_uint16_tlv_t prach_ce_level_3_hopping_offset; - nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodea; - nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodeb; -} nfapi_emtc_config_t; - -#define NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG 0x0078 -#define NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG 0x0079 -#define NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x007A -#define NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG 0x007B -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG 0x007C -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG 0x007D -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG 0x007E -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x007F -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG 0x0080 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG 0x0081 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG 0x0082 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG 0x0083 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG 0x0084 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG 0x0085 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0086 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG 0x0087 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG 0x0088 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG 0x0089 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG 0x008A -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG 0x008B -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG 0x008C -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x008D -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG 0x008E -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG 0x008F -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG 0x0090 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG 0x0091 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG 0x0092 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG 0x0093 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0094 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG 0x0095 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG 0x0096 -#define NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG 0x0097 -#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG 0x0098 -#define NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG 0x0099 - -typedef struct { - nfapi_uint16_tlv_t operating_mode; - nfapi_uint16_tlv_t anchor; - nfapi_uint16_tlv_t prb_index; - nfapi_uint16_tlv_t control_region_size; - nfapi_uint16_tlv_t assumed_crs_aps; - nfapi_uint16_tlv_t nprach_config_0_enabled; - nfapi_uint16_tlv_t nprach_config_0_sf_periodicity; - nfapi_uint16_tlv_t nprach_config_0_start_time; - nfapi_uint16_tlv_t nprach_config_0_subcarrier_offset; - nfapi_uint16_tlv_t nprach_config_0_number_of_subcarriers; - nfapi_uint16_tlv_t nprach_config_0_cp_length; - nfapi_uint16_tlv_t nprach_config_0_number_of_repetitions_per_attempt; - nfapi_uint16_tlv_t nprach_config_1_enabled; - nfapi_uint16_tlv_t nprach_config_1_sf_periodicity; - nfapi_uint16_tlv_t nprach_config_1_start_time; - nfapi_uint16_tlv_t nprach_config_1_subcarrier_offset; - nfapi_uint16_tlv_t nprach_config_1_number_of_subcarriers; - nfapi_uint16_tlv_t nprach_config_1_cp_length; - nfapi_uint16_tlv_t nprach_config_1_number_of_repetitions_per_attempt; - nfapi_uint16_tlv_t nprach_config_2_enabled; - nfapi_uint16_tlv_t nprach_config_2_sf_periodicity; - nfapi_uint16_tlv_t nprach_config_2_start_time; - nfapi_uint16_tlv_t nprach_config_2_subcarrier_offset; - nfapi_uint16_tlv_t nprach_config_2_number_of_subcarriers; - nfapi_uint16_tlv_t nprach_config_2_cp_length; - nfapi_uint16_tlv_t nprach_config_2_number_of_repetitions_per_attempt; - nfapi_uint16_tlv_t three_tone_base_sequence; - nfapi_uint16_tlv_t six_tone_base_sequence; - nfapi_uint16_tlv_t twelve_tone_base_sequence; - nfapi_uint16_tlv_t three_tone_cyclic_shift; - nfapi_uint16_tlv_t six_tone_cyclic_shift; - nfapi_uint16_tlv_t dl_gap_config_enable; - nfapi_uint16_tlv_t dl_gap_threshold; - nfapi_uint16_tlv_t dl_gap_periodicity; - nfapi_uint16_tlv_t dl_gap_duration_coefficient; -} nfapi_nb_iot_config_t; - -#define NFAPI_NB_IOT_CONFIG_OPERATING_MODE_TAG 0x00A5 -#define NFAPI_NB_IOT_CONFIG_ANCHOR_TAG 0x00A6 -#define NFAPI_NB_IOT_CONFIG_PRB_INDEX_TAG 0x00A7 -#define NFAPI_NB_IOT_CONFIG_CONTROL_REGION_SIZE_TAG 0x00A8 -#define NFAPI_NB_IOT_CONFIG_ASSUMED_CRS_APS_TAG 0x00A9 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_ENABLED_TAG 0x00AA -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SF_PERIODICITY_TAG 0x00AB -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_START_TIME_TAG 0x00AC -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SUBCARRIER_OFFSET_TAG 0x00AD -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_SUBCARRIERS_TAG 0x00AE -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_CP_LENGTH_TAG 0x00AF -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B0 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_ENABLED_TAG 0x00B1 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SF_PERIODICITY_TAG 0x00B2 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_START_TIME_TAG 0x00B3 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SUBCARRIER_OFFSET_TAG 0x00B4 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_SUBCARRIERS_TAG 0x00B5 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_CP_LENGTH_TAG 0x00B6 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B7 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_ENABLED_TAG 0x00B8 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SF_PERIODICITY_TAG 0x00B9 -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_START_TIME_TAG 0x00BA -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SUBCARRIER_OFFSET_TAG 0x00BB -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_SUBCARRIERS_TAG 0x00BC -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_CP_LENGTH_TAG 0x00BD -#define NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00BE -#define NFAPI_NB_IOT_CONFIG_THREE_TONE_BASE_SEQUENCE_TAG 0x00BF -#define NFAPI_NB_IOT_CONFIG_SIX_TONE_BASE_SEQUENCE_TAG 0x00C0 -#define NFAPI_NB_IOT_CONFIG_TWELVE_TONE_BASE_SEQUENCE_TAG 0x00C1 -#define NFAPI_NB_IOT_CONFIG_THREE_TONE_CYCLIC_SHIFT_TAG 0x00C2 -#define NFAPI_NB_IOT_CONFIG_SIX_TONE_CYCLIC_SHIFT_TAG 0x00C3 -#define NFAPI_NB_IOT_CONFIG_DL_GAP_CONFIG_ENABLE_TAG 0x00C4 -#define NFAPI_NB_IOT_CONFIG_DL_GAP_THRESHOLD_TAG 0x00C5 -#define NFAPI_NB_IOT_CONFIG_DL_GAP_PERIODICITY_TAG 0x00C6 -#define NFAPI_NB_IOT_CONFIG_DL_GAP_DURATION_COEFFICIENT_TAG 0x00C7 - -typedef struct { - nfapi_uint16_tlv_t laa_support; - nfapi_uint16_tlv_t pd_sensing_lbt_support; - nfapi_uint16_tlv_t multi_carrier_lbt_support; - nfapi_uint16_tlv_t partial_sf_support; -} nfapi_laa_capability_t; - -#define NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG 0x00D1 -#define NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG 0x00D2 -#define NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG 0x00D3 -#define NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG 0x00D4 - -typedef struct { - nfapi_uint16_tlv_t nb_iot_support; - nfapi_uint16_tlv_t nb_iot_operating_mode_capability; -} nfapi_nb_iot_capability_t; - -#define NFAPI_LAA_CAPABILITY_NB_IOT_SUPPORT_TAG 0x00D5 -#define NFAPI_LAA_CAPABILITY_NB_IOT_OPERATING_MODE_CAPABILITY_TAG 0x00D6 - -typedef struct { - nfapi_uint16_tlv_t subframe_assignment; - nfapi_uint16_tlv_t special_subframe_patterns; -} nfapi_tdd_frame_structure_t; - -#define NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG 0x005A -#define NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG 0x005B - -typedef struct { - nfapi_tl_t tl; - uint16_t number_rf_bands; - uint16_t rf_band[NFAPI_MAX_NUM_RF_BANDS]; -} nfapi_rf_bands_t; -#define NFAPI_PHY_RF_BANDS_TAG 0x0114 - -#define NFAPI_IPV4_ADDRESS_LENGTH 4 -#define NFAPI_IPV6_ADDRESS_LENGTH 16 - -// Convience enum to allow the ip addres type to be distinguished -typedef enum { - NFAPI_IP_ADDRESS_IPV4 = 0, - NFAPI_IP_ADDRESS_IPV6 -} nfapi_ip_address_type_e; - -// The type could be infered from the length, but it is clearer in -// code to have a type variable set -typedef struct { - nfapi_tl_t tl; - uint8_t type; - union { - uint8_t ipv4_address[NFAPI_IPV4_ADDRESS_LENGTH]; - uint8_t ipv6_address[NFAPI_IPV6_ADDRESS_LENGTH]; - } u; -} nfapi_ip_address_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t address[NFAPI_IPV4_ADDRESS_LENGTH]; -} nfapi_ipv4_address_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t address[NFAPI_IPV6_ADDRESS_LENGTH]; -} nfapi_ipv6_address_t; - - - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_rf_bands; - uint16_t bands[NFAPI_MAX_NMM_FREQUENCY_BANDS]; -} nfapi_nmm_frequency_bands_t; - -//These TLVs are used exclusively by nFAPI -typedef struct -{ - // These TLVs are used to setup the transport connection between VNF and PNF - nfapi_ipv4_address_t p7_vnf_address_ipv4; - nfapi_ipv6_address_t p7_vnf_address_ipv6; - nfapi_uint16_tlv_t p7_vnf_port; - - nfapi_ipv4_address_t p7_pnf_address_ipv4; - nfapi_ipv6_address_t p7_pnf_address_ipv6; - nfapi_uint16_tlv_t p7_pnf_port; - - // These TLVs are used to setup the transport connection between VNF and PNF - nfapi_uint8_tlv_t dl_ue_per_sf; - nfapi_uint8_tlv_t ul_ue_per_sf; - - // These TLVs are used by PNF to report its RF capabilities to the VNF software - nfapi_rf_bands_t rf_bands; - - // These TLVs are used by the VNF to configure the synchronization with the PNF. - nfapi_uint8_tlv_t timing_window; - nfapi_uint8_tlv_t timing_info_mode; - nfapi_uint8_tlv_t timing_info_period; - - // These TLVs are used by the VNF to configure the RF in the PNF - nfapi_uint16_tlv_t max_transmit_power; - nfapi_uint16_tlv_t earfcn; - - nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands; - nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands; - nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands; - nfapi_uint8_tlv_t nmm_uplink_rssi_supported; - -} nfapi_nfapi_t; - -#define NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x0100 -#define NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x0101 -#define NFAPI_NFAPI_P7_VNF_PORT_TAG 0x0102 -#define NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG 0x0103 -#define NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG 0x0104 -#define NFAPI_NFAPI_P7_PNF_PORT_TAG 0x0105 - -#define NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG 0x010A -#define NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG 0x010B -#define NFAPI_NFAPI_RF_BANDS_TAG 0x0114 -#define NFAPI_NFAPI_TIMING_WINDOW_TAG 0x011E -#define NFAPI_NFAPI_TIMING_INFO_MODE_TAG 0x011F -#define NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120 -#define NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x0128 -#define NFAPI_NFAPI_EARFCN_TAG 0x0129 -#define NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x0130 -#define NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x0131 -#define NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x0132 -#define NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG 0x0133 - - -// P5 Message Structures -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_param_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_pnf_param_general_t pnf_param_general; - nfapi_pnf_phy_t pnf_phy; - nfapi_pnf_rf_t pnf_rf; - nfapi_pnf_phy_rel10_t pnf_phy_rel10; - nfapi_pnf_phy_rel11_t pnf_phy_rel11; - nfapi_pnf_phy_rel12_t pnf_phy_rel12; - nfapi_pnf_phy_rel13_t pnf_phy_rel13; - nfapi_pnf_phy_rel13_nb_iot_t pnf_phy_rel13_nb_iot; - nfapi_pnf_phy_rel15_t pnf_phy_rel15; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_param_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_pnf_phy_rf_config_t pnf_phy_rf_config; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_config_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_config_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_start_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_start_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_stop_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_pnf_stop_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_param_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t error_code; - uint8_t num_tlv; - // fdd or tdd in idle or configured tlvs - nfapi_l1_status l1_status; - nfapi_phy_capabilities_t phy_capabilities; - nfapi_laa_capability_t laa_capability; - nfapi_nb_iot_capability_t nb_iot_capability; - - nfapi_subframe_config_t subframe_config; - nfapi_rf_config_t rf_config; - nfapi_phich_config_t phich_config; - nfapi_sch_config_t sch_config; - nfapi_prach_config_t prach_config; - nfapi_pusch_config_t pusch_config; - nfapi_pucch_config_t pucch_config; - nfapi_srs_config_t srs_config; - nfapi_uplink_reference_signal_config_t uplink_reference_signal_config; - nfapi_tdd_frame_structure_t tdd_frame_structure_config; - nfapi_l23_config_t l23_config; - nfapi_nb_iot_config_t nb_iot_config; - - // addition nfapi tlvs as per table 2-16 in idle or configure - nfapi_nfapi_t nfapi_config; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_param_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t num_tlv; - nfapi_subframe_config_t subframe_config; - nfapi_rf_config_t rf_config; - nfapi_phich_config_t phich_config; - nfapi_sch_config_t sch_config; - nfapi_prach_config_t prach_config; - nfapi_pusch_config_t pusch_config; - nfapi_pucch_config_t pucch_config; - nfapi_srs_config_t srs_config; - nfapi_uplink_reference_signal_config_t uplink_reference_signal_config; - nfapi_laa_config_t laa_config; - nfapi_emtc_config_t emtc_config; - nfapi_tdd_frame_structure_t tdd_frame_structure_config; - nfapi_l23_config_t l23_config; - nfapi_nb_iot_config_t nb_iot_config; - - // addition nfapi tlvs as per table 2-16 in idle or configure - nfapi_nfapi_t nfapi_config; - - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_config_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_config_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_start_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_start_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_stop_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_stop_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_uint16_tlv_t dl_rs_tx_power; - nfapi_uint16_tlv_t received_interference_power; - nfapi_uint16_tlv_t thermal_noise_power; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_measurement_request_t; - -#define NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG 0x1004 -#define NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG 0x1005 -#define NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG 0x1006 - - - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_resource_blocks; - int16_t received_interference_power[NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS]; -} nfapi_received_interference_power_measurement_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_int16_tlv_t dl_rs_tx_power_measurement; - nfapi_received_interference_power_measurement_t received_interference_power_measurement; - nfapi_int16_tlv_t thermal_noise_power_measurement; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_measurement_response_t; - -#define NFAPI_MEASUREMENT_RESPONSE_DL_RS_POWER_MEASUREMENT_TAG 0x1007 -#define NFAPI_MEASUREMENT_RESPONSE_RECEIVED_INTERFERENCE_POWER_MEASUREMENT_TAG 0x1008 -#define NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG 0x1009 - -// P7 Sub Structures -typedef struct { - nfapi_tl_t tl; - uint8_t dci_format; - uint8_t cce_idx; - uint8_t aggregation_level; - uint16_t rnti; - uint8_t resource_allocation_type; - uint8_t virtual_resource_block_assignment_flag; - uint32_t resource_block_coding; - uint8_t mcs_1; - uint8_t redundancy_version_1; - uint8_t new_data_indicator_1; - uint8_t transport_block_to_codeword_swap_flag; - uint8_t mcs_2; - uint8_t redundancy_version_2; - uint8_t new_data_indicator_2; - uint8_t harq_process; - uint8_t tpmi; - uint8_t pmi; - uint8_t precoding_information; - uint8_t tpc; - uint8_t downlink_assignment_index; - uint8_t ngap; - uint8_t transport_block_size_index; - uint8_t downlink_power_offset; - uint8_t allocate_prach_flag; - uint8_t preamble_index; - uint8_t prach_mask_index; - uint8_t rnti_type; - uint16_t transmission_power; -} nfapi_dl_config_dci_dl_pdu_rel8_t; -#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG 0x2001 - -typedef struct { - nfapi_tl_t tl; - uint8_t mcch_flag; - uint8_t mcch_change_notification; - uint8_t scrambling_identity; -} nfapi_dl_config_dci_dl_pdu_rel9_t; -#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG 0x2002 - -typedef struct { - nfapi_tl_t tl; - uint8_t cross_carrier_scheduling_flag; - uint8_t carrier_indicator; - uint8_t srs_flag; - uint8_t srs_request; - uint8_t antenna_ports_scrambling_and_layers; - uint8_t total_dci_length_including_padding; - uint8_t n_dl_rb; -} nfapi_dl_config_dci_dl_pdu_rel10_t; -#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG 0x2003 - - -typedef struct { - nfapi_tl_t tl; - uint8_t harq_ack_resource_offset; - uint8_t pdsch_re_mapping_quasi_co_location_indicator; -} nfapi_dl_config_dci_dl_pdu_rel11_t; - -#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG 0x2039 - - - -typedef struct { - nfapi_tl_t tl; - uint8_t primary_cell_type; - uint8_t ul_dl_configuration_flag; - uint8_t number_ul_dl_configurations; - uint8_t ul_dl_configuration_indication[NFAPI_MAX_UL_DL_CONFIGURATIONS]; -} nfapi_dl_config_dci_dl_pdu_rel12_t; - -#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG 0x203a - - - -typedef struct { - uint8_t subband_index; - uint8_t scheduled_ues; - uint16_t precoding_value[NFAPI_MAX_NUM_PHYSICAL_ANTENNAS][NFAPI_MAX_NUM_SCHEDULED_UES]; -} nfapi_dl_config_dci_dl_tpm_subband_info_t; - -typedef struct { - uint8_t num_prb_per_subband; - uint8_t number_of_subbands; - uint8_t num_antennas; - nfapi_dl_config_dci_dl_tpm_subband_info_t subband_info[NFAPI_MAX_NUM_SUBBANDS]; -} nfapi_dl_config_dci_dl_tpm_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t laa_end_partial_sf_flag; - uint8_t laa_end_partial_sf_configuration; - uint8_t initial_lbt_sf; - uint8_t codebook_size_determination; - uint8_t drms_table_flag; - uint8_t tpm_struct_flag; - nfapi_dl_config_dci_dl_tpm_t tpm; -} nfapi_dl_config_dci_dl_pdu_rel13_t; - -#define NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG 0x203b - -typedef struct { - nfapi_dl_config_dci_dl_pdu_rel8_t dci_dl_pdu_rel8; - nfapi_dl_config_dci_dl_pdu_rel9_t dci_dl_pdu_rel9; - nfapi_dl_config_dci_dl_pdu_rel10_t dci_dl_pdu_rel10; - nfapi_dl_config_dci_dl_pdu_rel11_t dci_dl_pdu_rel11; - nfapi_dl_config_dci_dl_pdu_rel12_t dci_dl_pdu_rel12; - nfapi_dl_config_dci_dl_pdu_rel13_t dci_dl_pdu_rel13; -} nfapi_dl_config_dci_dl_pdu; - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t pdu_index; - uint16_t transmission_power; -} nfapi_dl_config_bch_pdu_rel8_t; -#define NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG 0x2004 - -typedef struct { - nfapi_dl_config_bch_pdu_rel8_t bch_pdu_rel8; -} nfapi_dl_config_bch_pdu; - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t pdu_index; - uint16_t rnti; - uint8_t resource_allocation_type; - uint32_t resource_block_coding; - uint8_t modulation; - uint16_t transmission_power; - uint16_t mbsfn_area_id; -} nfapi_dl_config_mch_pdu_rel8_t; -#define NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG 0x2005 - -typedef struct { - nfapi_dl_config_mch_pdu_rel8_t mch_pdu_rel8; -} nfapi_dl_config_mch_pdu; - - -typedef struct { - uint8_t subband_index; - uint8_t num_antennas; - uint16_t bf_value[NFAPI_MAX_NUM_ANTENNAS]; -} nfapi_bf_vector_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t pdu_index; - uint16_t rnti; - uint8_t resource_allocation_type; - uint8_t virtual_resource_block_assignment_flag; - uint32_t resource_block_coding; - uint8_t modulation; - uint8_t redundancy_version; - uint8_t transport_blocks; - uint8_t transport_block_to_codeword_swap_flag; - uint8_t transmission_scheme; - uint8_t number_of_layers; - uint8_t number_of_subbands; - uint8_t codebook_index[NFAPI_MAX_NUM_SUBBANDS]; - uint8_t ue_category_capacity; - uint8_t pa; - uint8_t delta_power_offset_index; - uint8_t ngap; - uint8_t nprb; - uint8_t transmission_mode; - uint8_t num_bf_prb_per_subband; - uint8_t num_bf_vector; - nfapi_bf_vector_t bf_vector[NFAPI_MAX_BF_VECTORS]; -} nfapi_dl_config_dlsch_pdu_rel8_t; -#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG 0x2006 - -typedef struct { - nfapi_tl_t tl; - uint8_t nscid; -} nfapi_dl_config_dlsch_pdu_rel9_t; -#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG 0x2007 - -typedef struct { - nfapi_tl_t tl; - uint8_t csi_rs_flag; - uint8_t csi_rs_resource_config_r10; - uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10; - uint8_t csi_rs_number_nzp_configuration; - uint8_t csi_rs_resource_config[NFAPI_MAX_CSI_RS_RESOURCE_CONFIG]; - uint8_t pdsch_start; -} nfapi_dl_config_dlsch_pdu_rel10_t; -#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG 0x2008 - -typedef struct { - nfapi_tl_t tl; - uint8_t drms_config_flag; - uint16_t drms_scrambling; - uint8_t csi_config_flag; - uint16_t csi_scrambling; - uint8_t pdsch_re_mapping_flag; - uint8_t pdsch_re_mapping_atenna_ports; - uint8_t pdsch_re_mapping_freq_shift; -} nfapi_dl_config_dlsch_pdu_rel11_t; -#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG 0x203C - -typedef struct { - nfapi_tl_t tl; - uint8_t altcqi_table_r12; - uint8_t maxlayers; - uint8_t n_dl_harq; -} nfapi_dl_config_dlsch_pdu_rel12_t; -#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG 0x203D - -typedef struct { - nfapi_tl_t tl; - uint8_t dwpts_symbols; - uint8_t initial_lbt_sf; - uint8_t ue_type; - uint8_t pdsch_payload_type; - uint16_t initial_transmission_sf_io; - uint8_t drms_table_flag; -} nfapi_dl_config_dlsch_pdu_rel13_t; -#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG 0x203E - -typedef struct { - nfapi_dl_config_dlsch_pdu_rel8_t dlsch_pdu_rel8; - nfapi_dl_config_dlsch_pdu_rel9_t dlsch_pdu_rel9; - nfapi_dl_config_dlsch_pdu_rel10_t dlsch_pdu_rel10; - nfapi_dl_config_dlsch_pdu_rel11_t dlsch_pdu_rel11; - nfapi_dl_config_dlsch_pdu_rel12_t dlsch_pdu_rel12; - nfapi_dl_config_dlsch_pdu_rel13_t dlsch_pdu_rel13; -} nfapi_dl_config_dlsch_pdu; - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t pdu_index; - uint16_t p_rnti; - uint8_t resource_allocation_type; - uint8_t virtual_resource_block_assignment_flag; - uint32_t resource_block_coding; - uint8_t mcs; - uint8_t redundancy_version; - uint8_t number_of_transport_blocks; - uint8_t transport_block_to_codeword_swap_flag; - uint8_t transmission_scheme; - uint8_t number_of_layers; - uint8_t codebook_index; - uint8_t ue_category_capacity; - uint8_t pa; - uint16_t transmission_power; - uint8_t nprb; - uint8_t ngap; -} nfapi_dl_config_pch_pdu_rel8_t; -#define NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG 0x2009 - -typedef struct { - nfapi_tl_t tl; - uint8_t ue_mode; - uint16_t initial_transmission_sf_io; -} nfapi_dl_config_pch_pdu_rel13_t; -#define NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG 0x203F - -typedef struct { - nfapi_dl_config_pch_pdu_rel8_t pch_pdu_rel8; - nfapi_dl_config_pch_pdu_rel13_t pch_pdu_rel13; -} nfapi_dl_config_pch_pdu; - -typedef struct { - nfapi_tl_t tl; - uint16_t transmission_power; - uint8_t prs_bandwidth; - uint8_t prs_cyclic_prefix_type; - uint8_t prs_muting; -} nfapi_dl_config_prs_pdu_rel9_t; -#define NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG 0x200A - -typedef struct { - nfapi_dl_config_prs_pdu_rel9_t prs_pdu_rel9; -} nfapi_dl_config_prs_pdu; - -typedef struct { - nfapi_tl_t tl; - uint8_t csi_rs_antenna_port_count_r10; - uint8_t csi_rs_resource_config_r10; - uint16_t transmission_power; - uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10; - uint8_t csi_rs_number_of_nzp_configuration; - uint8_t csi_rs_resource_config[NFAPI_MAX_CSI_RS_RESOURCE_CONFIG]; -} nfapi_dl_config_csi_rs_pdu_rel10_t; -#define NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG 0x200B - -typedef struct { - nfapi_tl_t tl; - uint8_t csi_rs_class; - uint8_t cdm_type; - uint8_t num_bf_vector; - struct { - uint8_t csi_rs_resource_index; - uint16_t bf_value[NFAPI_MAX_ANTENNA_PORT_COUNT]; - } bf_vector[NFAPI_MAX_BF_VECTORS]; - -}nfapi_dl_config_csi_rs_pdu_rel13_t; -#define NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG 0x2040 - -typedef struct { - nfapi_dl_config_csi_rs_pdu_rel10_t csi_rs_pdu_rel10; - nfapi_dl_config_csi_rs_pdu_rel13_t csi_rs_pdu_rel13; -} nfapi_dl_config_csi_rs_pdu; - -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG 0x2001 -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG 0x2002 -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG 0x2003 -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG 0x2039 -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG 0x203a -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG 0x203b - -typedef struct { - nfapi_tl_t tl; - uint8_t epdcch_resource_assignment_flag; - uint16_t epdcch_id; - uint8_t epdcch_start_symbol; - uint8_t epdcch_num_prb; - uint8_t epdcch_prb_index[NFAPI_MAX_EPDCCH_PRB]; - nfapi_bf_vector_t bf_vector; -} nfapi_dl_config_epdcch_parameters_rel11_t; -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG 0x2041 - -typedef struct { - nfapi_tl_t tl; - uint8_t dwpts_symbols; - uint8_t initial_lbt_sf; -} nfapi_dl_config_epdcch_parameters_rel13_t; -#define NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG 0x2042 - -typedef struct { - nfapi_dl_config_dci_dl_pdu_rel8_t epdcch_pdu_rel8; - nfapi_dl_config_dci_dl_pdu_rel9_t epdcch_pdu_rel9; - nfapi_dl_config_dci_dl_pdu_rel10_t epdcch_pdu_rel10; - nfapi_dl_config_dci_dl_pdu_rel11_t epdcch_pdu_rel11; - nfapi_dl_config_dci_dl_pdu_rel12_t epdcch_pdu_rel12; - nfapi_dl_config_dci_dl_pdu_rel13_t epdcch_pdu_rel13; - nfapi_dl_config_epdcch_parameters_rel11_t epdcch_params_rel11; - nfapi_dl_config_epdcch_parameters_rel13_t epdcch_params_rel13; -} nfapi_dl_config_epdcch_pdu; - - -typedef struct { - nfapi_tl_t tl; - uint8_t mpdcch_narrow_band; - uint8_t number_of_prb_pairs; - uint8_t resource_block_assignment; - uint8_t mpdcch_tansmission_type; - uint8_t start_symbol; - uint8_t ecce_index; - uint8_t aggregation_level; - uint8_t rnti_type; - uint16_t rnti; - uint8_t ce_mode; - uint16_t drms_scrambling_init; - uint16_t initial_transmission_sf_io; - uint16_t transmission_power; - uint8_t dci_format; - uint16_t resource_block_coding; - uint8_t mcs; - uint8_t pdsch_reptition_levels; - uint8_t redundancy_version; - uint8_t new_data_indicator; - uint8_t harq_process; - uint8_t tpmi_length; - uint8_t tpmi; - uint8_t pmi_flag; - uint8_t pmi; - uint8_t harq_resource_offset; - uint8_t dci_subframe_repetition_number; - uint8_t tpc; - uint8_t downlink_assignment_index_length; - uint8_t downlink_assignment_index; - uint8_t allocate_prach_flag; - uint8_t preamble_index; - uint8_t prach_mask_index; - uint8_t starting_ce_level; - uint8_t srs_request; - uint8_t antenna_ports_and_scrambling_identity_flag; - uint8_t antenna_ports_and_scrambling_identity; - uint8_t frequency_hopping_enabled_flag; - uint8_t paging_direct_indication_differentiation_flag; - uint8_t direct_indication; - uint8_t total_dci_length_including_padding; - uint8_t number_of_tx_antenna_ports; - uint16_t precoding_value[NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS]; -} nfapi_dl_config_mpdcch_pdu_rel13_t; -#define NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG 0x205B - - -typedef struct { - nfapi_dl_config_mpdcch_pdu_rel13_t mpdcch_pdu_rel13; -} nfapi_dl_config_mpdcch_pdu; - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t pdu_index; - uint16_t transmission_power; - uint16_t hyper_sfn_2_lsbs; -} nfapi_dl_config_nbch_pdu_rel13_t; - -#define NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG 0x205C - -typedef struct { - nfapi_dl_config_nbch_pdu_rel13_t nbch_pdu_rel13; -} nfapi_dl_config_nbch_pdu; - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t pdu_index; - uint8_t ncce_index; - uint8_t aggregation_level; - uint8_t start_symbol; - uint8_t rnti_type; - uint16_t rnti; - uint8_t scrambling_reinitialization_batch_index; - uint8_t nrs_antenna_ports_assumed_by_the_ue; - uint8_t dci_format; - uint8_t scheduling_delay; - uint8_t resource_assignment; - uint8_t repetition_number; - uint8_t mcs; - uint8_t new_data_indicator; - uint8_t harq_ack_resource; - uint8_t npdcch_order_indication; - uint8_t starting_number_of_nprach_repetitions; - uint8_t subcarrier_indication_of_nprach; - uint8_t paging_direct_indication_differentation_flag; - uint8_t direct_indication; - uint8_t dci_subframe_repetition_number; - uint8_t total_dci_length_including_padding; -} nfapi_dl_config_npdcch_pdu_rel13_t; - -#define NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG 0x205D - -typedef struct { - nfapi_dl_config_npdcch_pdu_rel13_t npdcch_pdu_rel13; -} nfapi_dl_config_npdcch_pdu; - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t pdu_index; - uint8_t start_symbol; - uint8_t rnti_type; - uint16_t rnti; - uint16_t resource_assignment; - uint16_t repetition_number; - uint8_t modulation; - uint8_t number_of_subframes_for_resource_assignment; - uint8_t scrambling_sequence_initialization_cinit; - uint16_t sf_idx; - uint8_t nrs_antenna_ports_assumed_by_the_ue; -} nfapi_dl_config_ndlsch_pdu_rel13_t; - -#define NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG 0x205E - -typedef struct { - nfapi_dl_config_ndlsch_pdu_rel13_t ndlsch_pdu_rel13; -} nfapi_dl_config_ndlsch_pdu; - - -typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - union { - nfapi_dl_config_dci_dl_pdu dci_dl_pdu; - nfapi_dl_config_bch_pdu bch_pdu; - nfapi_dl_config_mch_pdu mch_pdu; - nfapi_dl_config_dlsch_pdu dlsch_pdu; - nfapi_dl_config_pch_pdu pch_pdu; - nfapi_dl_config_prs_pdu prs_pdu; - nfapi_dl_config_csi_rs_pdu csi_rs_pdu; - nfapi_dl_config_epdcch_pdu epdcch_pdu; - nfapi_dl_config_mpdcch_pdu mpdcch_pdu; - nfapi_dl_config_nbch_pdu nbch_pdu; - nfapi_dl_config_npdcch_pdu npdcch_pdu; - nfapi_dl_config_ndlsch_pdu ndlsch_pdu; - }; -} nfapi_dl_config_request_pdu_t; - -#define NFAPI_DL_CONFIG_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint8_t number_pdcch_ofdm_symbols; - uint8_t number_dci; - uint16_t number_pdu; - uint8_t number_pdsch_rnti; - uint16_t transmission_power_pcfich; - nfapi_dl_config_request_pdu_t* dl_config_pdu_list; -} nfapi_dl_config_request_body_t; -#define NFAPI_DL_CONFIG_REQUEST_BODY_TAG 0x2000 - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint16_t size; - uint16_t rnti; - uint8_t resource_block_start; - uint8_t number_of_resource_blocks; - uint8_t modulation_type; - uint8_t cyclic_shift_2_for_drms; - uint8_t frequency_hopping_enabled_flag; - uint8_t frequency_hopping_bits; - uint8_t new_data_indication; - uint8_t redundancy_version; - uint8_t harq_process_number; - uint8_t ul_tx_mode; - uint8_t current_tx_nb; - uint8_t n_srs; -} nfapi_ul_config_ulsch_pdu_rel8_t; -#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG 0x200D - -typedef struct { - nfapi_tl_t tl; - uint8_t resource_allocation_type; - uint32_t resource_block_coding; - uint8_t transport_blocks; - uint8_t transmission_scheme; - uint8_t number_of_layers; - uint8_t codebook_index; - uint8_t disable_sequence_hopping_flag; -} nfapi_ul_config_ulsch_pdu_rel10_t; -#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG 0x200E - - -typedef struct { - nfapi_tl_t tl; - uint8_t virtual_cell_id_enabled_flag; - uint16_t npusch_identity; - uint8_t dmrs_config_flag; - uint16_t ndmrs_csh_identity; -} nfapi_ul_config_ulsch_pdu_rel11_t; - -#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG 0x2043 - -typedef struct { - nfapi_tl_t tl; - uint8_t ue_type; - uint16_t total_number_of_repetitions; - uint16_t repetition_number; - uint16_t initial_transmission_sf_io; - uint8_t empty_symbols_due_to_re_tunning; -} nfapi_ul_config_ulsch_pdu_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG 0x2044 - -typedef struct { - nfapi_ul_config_ulsch_pdu_rel8_t ulsch_pdu_rel8; - nfapi_ul_config_ulsch_pdu_rel10_t ulsch_pdu_rel10; - nfapi_ul_config_ulsch_pdu_rel11_t ulsch_pdu_rel11; - nfapi_ul_config_ulsch_pdu_rel13_t ulsch_pdu_rel13; -} nfapi_ul_config_ulsch_pdu; - -typedef struct { - nfapi_tl_t tl; - uint8_t dl_cqi_pmi_size_rank_1; - uint8_t dl_cqi_pmi_size_rank_greater_1; - uint8_t ri_size; - uint8_t delta_offset_cqi; - uint8_t delta_offset_ri; -} nfapi_ul_config_cqi_ri_information_rel8_t; -#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG 0x2010 - -typedef struct { - uint8_t dl_cqi_pmi_ri_size; - uint8_t control_type; -} nfapi_ul_config_periodic_cqi_pmi_ri_report_t; - -typedef struct { - uint8_t number_of_cc; - struct { - uint8_t ri_size; - uint8_t dl_cqi_pmi_size[8]; - } cc[NFAPI_MAX_CC]; -} nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t report_type; - uint8_t delta_offset_cqi; - uint8_t delta_offset_ri; - union { - nfapi_ul_config_periodic_cqi_pmi_ri_report_t periodic_cqi_pmi_ri_report; - nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t aperiodic_cqi_pmi_ri_report; - }; -} nfapi_ul_config_cqi_ri_information_rel9_t; -#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG 0x2011 - -typedef struct { - uint16_t dl_cqi_pmi_ri_size_2; -} nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t; - -typedef struct { -} nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t report_type; // Convience parameter, not sent on the wire - union { - nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t periodic_cqi_pmi_ri_report; - nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t aperiodic_cqi_pmi_ri_report; - }; -} nfapi_ul_config_cqi_ri_information_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG 0x2045 - -typedef struct { - nfapi_ul_config_cqi_ri_information_rel8_t cqi_ri_information_rel8; - nfapi_ul_config_cqi_ri_information_rel9_t cqi_ri_information_rel9; - nfapi_ul_config_cqi_ri_information_rel13_t cqi_ri_information_rel13; -} nfapi_ul_config_cqi_ri_information; - -typedef struct { - nfapi_tl_t tl; - uint8_t harq_size; - uint8_t delta_offset_harq; - uint8_t ack_nack_mode; -} nfapi_ul_config_ulsch_harq_information_rel10_t; -#define NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG 0x2012 - -typedef struct { - nfapi_tl_t tl; - uint16_t harq_size_2; - uint8_t delta_offset_harq_2; -} nfapi_ul_config_ulsch_harq_information_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG 0x2046 - -typedef struct { - nfapi_ul_config_ulsch_harq_information_rel10_t harq_information_rel10; - nfapi_ul_config_ulsch_harq_information_rel13_t harq_information_rel13; -} nfapi_ul_config_ulsch_harq_information; - -typedef struct { - nfapi_tl_t tl; - uint8_t n_srs_initial; - uint8_t initial_number_of_resource_blocks; -} nfapi_ul_config_initial_transmission_parameters_rel8_t; -#define NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG 0x200F - -typedef struct { - nfapi_ul_config_initial_transmission_parameters_rel8_t initial_transmission_parameters_rel8; -} nfapi_ul_config_initial_transmission_parameters; - -typedef struct { - nfapi_ul_config_ulsch_pdu ulsch_pdu; - nfapi_ul_config_cqi_ri_information cqi_ri_information; - nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; -} nfapi_ul_config_ulsch_cqi_ri_pdu; - -typedef struct { - nfapi_ul_config_ulsch_pdu ulsch_pdu; - nfapi_ul_config_ulsch_harq_information harq_information; - nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; -} nfapi_ul_config_ulsch_harq_pdu; - -typedef struct { - nfapi_ul_config_ulsch_pdu ulsch_pdu; - nfapi_ul_config_cqi_ri_information cqi_ri_information; - nfapi_ul_config_ulsch_harq_information harq_information; - nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; -} nfapi_ul_config_ulsch_cqi_harq_ri_pdu; - - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint16_t rnti; -} nfapi_ul_config_ue_information_rel8_t; -#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG 0x2013 - -typedef struct { - nfapi_tl_t tl; - uint8_t virtual_cell_id_enabled_flag; - uint16_t npusch_identity; -} nfapi_ul_config_ue_information_rel11_t; - -#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG 0x2047 - -typedef struct { - nfapi_tl_t tl; - uint8_t ue_type; - uint8_t empty_symbols; - uint16_t total_number_of_repetitions; - uint16_t repetition_number; -} nfapi_ul_config_ue_information_rel13_t; - -#define NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG 0x2048 - -typedef struct { - nfapi_ul_config_ue_information_rel8_t ue_information_rel8; - nfapi_ul_config_ue_information_rel11_t ue_information_rel11; - nfapi_ul_config_ue_information_rel13_t ue_information_rel13; -} nfapi_ul_config_ue_information; - -typedef struct { - nfapi_tl_t tl; - uint16_t pucch_index; - uint8_t dl_cqi_pmi_size; -} nfapi_ul_config_cqi_information_rel8_t; -#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG 0x2014 - -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_pucch_resource; - uint16_t pucch_index_p1; -} nfapi_ul_config_cqi_information_rel10_t; -#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG 0x2015 - -typedef struct { - nfapi_tl_t tl; - uint8_t csi_mode; - uint16_t dl_cqi_pmi_size_2; - uint8_t starting_prb; - uint8_t n_prb; - uint8_t cdm_index; - uint8_t n_srs; -} nfapi_ul_config_cqi_information_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG 0x2049 - -typedef struct { - nfapi_ul_config_cqi_information_rel8_t cqi_information_rel8; - nfapi_ul_config_cqi_information_rel10_t cqi_information_rel10; - nfapi_ul_config_cqi_information_rel13_t cqi_information_rel13; -} nfapi_ul_config_cqi_information; - -typedef struct { - nfapi_tl_t tl; - uint16_t pucch_index; -} nfapi_ul_config_sr_information_rel8_t; -#define NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG 0x2016 - -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_pucch_resources; - uint16_t pucch_index_p1; -} nfapi_ul_config_sr_information_rel10_t; -#define NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG 0x2017 - -typedef struct { - nfapi_ul_config_sr_information_rel8_t sr_information_rel8; - nfapi_ul_config_sr_information_rel10_t sr_information_rel10; -} nfapi_ul_config_sr_information; - -typedef struct { - nfapi_tl_t tl; - uint8_t harq_size; - uint8_t ack_nack_mode; - uint8_t number_of_pucch_resources; - uint16_t n_pucch_1_0; - uint16_t n_pucch_1_1; - uint16_t n_pucch_1_2; - uint16_t n_pucch_1_3; -} nfapi_ul_config_harq_information_rel10_tdd_t; -#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG 0x2018 - - -typedef struct { - nfapi_tl_t tl; - uint16_t n_pucch_1_0; - uint8_t harq_size; -} nfapi_ul_config_harq_information_rel8_fdd_t; -#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG 0x2019 - -typedef struct { - nfapi_tl_t tl; - uint8_t harq_size; - uint8_t ack_nack_mode; - uint8_t number_of_pucch_resources; - uint16_t n_pucch_1_0; - uint16_t n_pucch_1_1; - uint16_t n_pucch_1_2; - uint16_t n_pucch_1_3; -} nfapi_ul_config_harq_information_rel9_fdd_t; -#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG 0x201a - -typedef struct { - nfapi_tl_t tl; - uint8_t num_ant_ports; - uint16_t n_pucch_2_0; - uint16_t n_pucch_2_1; - uint16_t n_pucch_2_2; - uint16_t n_pucch_2_3; -} nfapi_ul_config_harq_information_rel11_t; -#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG 0x204A - -typedef struct { - nfapi_tl_t tl; - uint16_t harq_size_2; - uint8_t starting_prb; - uint8_t n_prb; - uint8_t cdm_index; - uint8_t n_srs; -} nfapi_ul_config_harq_information_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG 0x204B - -typedef struct { - nfapi_ul_config_harq_information_rel10_tdd_t harq_information_rel10_tdd; - nfapi_ul_config_harq_information_rel8_fdd_t harq_information_rel8_fdd; - nfapi_ul_config_harq_information_rel9_fdd_t harq_information_rel9_fdd; - nfapi_ul_config_harq_information_rel11_t harq_information_rel11; - nfapi_ul_config_harq_information_rel13_t harq_information_rel13; -} nfapi_ul_config_harq_information; - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint16_t size; - uint16_t rnti; - uint8_t srs_bandwidth; - uint8_t frequency_domain_position; - uint8_t srs_hopping_bandwidth; - uint8_t transmission_comb; - uint16_t i_srs; - uint8_t sounding_reference_cyclic_shift; -} nfapi_ul_config_srs_pdu_rel8_t; -#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG 0x201b - -typedef struct { - nfapi_tl_t tl; - uint8_t antenna_port; -} nfapi_ul_config_srs_pdu_rel10_t; -#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG 0x201c - -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_combs; -} nfapi_ul_config_srs_pdu_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG 0x204c - -typedef struct { - nfapi_ul_config_srs_pdu_rel8_t srs_pdu_rel8; - nfapi_ul_config_srs_pdu_rel10_t srs_pdu_rel10; - nfapi_ul_config_srs_pdu_rel13_t srs_pdu_rel13; -} nfapi_ul_config_srs_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_cqi_information cqi_information; -} nfapi_ul_config_uci_cqi_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_sr_information sr_information; -} nfapi_ul_config_uci_sr_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_harq_information harq_information; -} nfapi_ul_config_uci_harq_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_sr_information sr_information; - nfapi_ul_config_harq_information harq_information; -} nfapi_ul_config_uci_sr_harq_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_cqi_information cqi_information; - nfapi_ul_config_harq_information harq_information; -} nfapi_ul_config_uci_cqi_harq_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_cqi_information cqi_information; - nfapi_ul_config_sr_information sr_information; -} nfapi_ul_config_uci_cqi_sr_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_cqi_information cqi_information; - nfapi_ul_config_sr_information sr_information; - nfapi_ul_config_harq_information harq_information; -} nfapi_ul_config_uci_cqi_sr_harq_pdu; - -typedef struct { - nfapi_ul_config_ue_information ue_information; -} nfapi_ul_config_harq_buffer_pdu; - -typedef struct { - nfapi_ul_config_ulsch_pdu ulsch_pdu; - nfapi_ul_config_cqi_information csi_information; -} nfapi_ul_config_ulsch_uci_csi_pdu; - -typedef struct { - nfapi_ul_config_ulsch_pdu ulsch_pdu; - nfapi_ul_config_harq_information harq_information; -} nfapi_ul_config_ulsch_uci_harq_pdu; - -typedef struct { - nfapi_ul_config_ulsch_pdu ulsch_pdu; - nfapi_ul_config_cqi_information csi_information; - nfapi_ul_config_harq_information harq_information; -} nfapi_ul_config_ulsch_csi_uci_harq_pdu; - -typedef struct { - nfapi_tl_t tl; - uint8_t harq_ack_resource; -} nfapi_ul_config_nb_harq_information_rel13_fdd_t; -#define NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG 0x2061 - -typedef struct { - nfapi_ul_config_nb_harq_information_rel13_fdd_t nb_harq_information_rel13_fdd; -} nfapi_ul_config_nb_harq_information; - -typedef struct { - nfapi_tl_t tl; - uint8_t nulsch_format; - uint32_t handle; - uint16_t size; - uint16_t rnti; - uint8_t subcarrier_indication; - uint8_t resource_assignment; - uint8_t mcs; - uint8_t redudancy_version; - uint8_t repetition_number; - uint8_t new_data_indication; - uint8_t n_srs; - uint16_t scrambling_sequence_initialization_cinit; - uint16_t sf_idx; - nfapi_ul_config_ue_information ue_information; - nfapi_ul_config_nb_harq_information nb_harq_information; -} nfapi_ul_config_nulsch_pdu_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG 0x205F - -typedef struct { - nfapi_ul_config_nulsch_pdu_rel13_t nulsch_pdu_rel13; -} nfapi_ul_config_nulsch_pdu; - - -typedef struct { - nfapi_tl_t tl; - uint8_t nprach_config_0; - uint8_t nprach_config_1; - uint8_t nprach_config_2; -} nfapi_ul_config_nrach_pdu_rel13_t; -#define NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG 0x2067 - -typedef struct { - nfapi_ul_config_nrach_pdu_rel13_t nrach_pdu_rel13; -} nfapi_ul_config_nrach_pdu; - -typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - union { - nfapi_ul_config_ulsch_pdu ulsch_pdu; - nfapi_ul_config_ulsch_cqi_ri_pdu ulsch_cqi_ri_pdu; - nfapi_ul_config_ulsch_harq_pdu ulsch_harq_pdu; - nfapi_ul_config_ulsch_cqi_harq_ri_pdu ulsch_cqi_harq_ri_pdu; - nfapi_ul_config_uci_cqi_pdu uci_cqi_pdu; - nfapi_ul_config_uci_sr_pdu uci_sr_pdu; - nfapi_ul_config_uci_harq_pdu uci_harq_pdu; - nfapi_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu; - nfapi_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu; - nfapi_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu; - nfapi_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu; - nfapi_ul_config_srs_pdu srs_pdu; - nfapi_ul_config_harq_buffer_pdu harq_buffer_pdu; - nfapi_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu; - nfapi_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu; - nfapi_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu; - nfapi_ul_config_nulsch_pdu nulsch_pdu; - nfapi_ul_config_nrach_pdu nrach_pdu; - }; -} nfapi_ul_config_request_pdu_t; - -#define NFAPI_UL_CONFIG_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_pdus; - uint8_t rach_prach_frequency_resources; - uint8_t srs_present; - nfapi_ul_config_request_pdu_t* ul_config_pdu_list; -} nfapi_ul_config_request_body_t; -#define NFAPI_UL_CONFIG_REQUEST_BODY_TAG 0x200C - -typedef struct { - nfapi_tl_t tl; - uint8_t resource_block_start; - uint8_t cyclic_shift_2_for_drms; - uint8_t hi_value; - uint8_t i_phich; - uint16_t transmission_power; -} nfapi_hi_dci0_hi_pdu_rel8_t; -#define NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG 0x201e - -typedef struct { - nfapi_tl_t tl; - uint8_t flag_tb2; - uint8_t hi_value_2; -} nfapi_hi_dci0_hi_pdu_rel10_t; -#define NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG 0x201f - -typedef struct { - nfapi_hi_dci0_hi_pdu_rel8_t hi_pdu_rel8; - nfapi_hi_dci0_hi_pdu_rel10_t hi_pdu_rel10; -} nfapi_hi_dci0_hi_pdu; - -typedef struct { - nfapi_tl_t tl; - uint8_t dci_format; - uint8_t cce_index; - uint8_t aggregation_level; - uint16_t rnti; - uint8_t resource_block_start; - uint8_t number_of_resource_block; - uint8_t mcs_1; - uint8_t cyclic_shift_2_for_drms; - uint8_t frequency_hopping_enabled_flag; - uint8_t frequency_hopping_bits; - uint8_t new_data_indication_1; - uint8_t ue_tx_antenna_seleciton; - uint8_t tpc; - uint8_t cqi_csi_request; - uint8_t ul_index; - uint8_t dl_assignment_index; - uint32_t tpc_bitmap; - uint16_t transmission_power; -} nfapi_hi_dci0_dci_pdu_rel8_t; -#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020 - -typedef struct { - nfapi_tl_t tl; - uint8_t cross_carrier_scheduling_flag; - uint8_t carrier_indicator; - uint8_t size_of_cqi_csi_feild; - uint8_t srs_flag; - uint8_t srs_request; - uint8_t resource_allocation_flag; - uint8_t resource_allocation_type; - uint32_t resource_block_coding; - uint8_t mcs_2; - uint8_t new_data_indication_2; - uint8_t number_of_antenna_ports; - uint8_t tpmi; - uint8_t total_dci_length_including_padding; - uint8_t n_ul_rb; -} nfapi_hi_dci0_dci_pdu_rel10_t; -#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG 0x2021 - -typedef struct { - nfapi_tl_t tl; - uint8_t pscch_resource; - uint8_t time_resource_pattern; -} nfapi_hi_dci0_dci_pdu_rel12_t; - -#define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG 0x204D - -typedef struct { - nfapi_hi_dci0_dci_pdu_rel8_t dci_pdu_rel8; - nfapi_hi_dci0_dci_pdu_rel10_t dci_pdu_rel10; - nfapi_hi_dci0_dci_pdu_rel12_t dci_pdu_rel12; -} nfapi_hi_dci0_dci_pdu; - -typedef nfapi_hi_dci0_dci_pdu_rel8_t nfapi_hi_dci0_epdcch_dci_pdu_rel8_t; -#define NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG 0x2020 - -typedef nfapi_hi_dci0_dci_pdu_rel10_t nfapi_hi_dci0_epdcch_dci_pdu_rel10_t; -#define NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG 0x2021 - -typedef nfapi_dl_config_epdcch_parameters_rel11_t nfapi_hi_dci0_epdcch_parameters_rel11_t; -#define NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG 0x2041 - -typedef struct { - nfapi_hi_dci0_epdcch_dci_pdu_rel8_t epdcch_dci_pdu_rel8; - nfapi_hi_dci0_epdcch_dci_pdu_rel10_t epdcch_dci_pdu_rel10; - nfapi_hi_dci0_epdcch_parameters_rel11_t epdcch_parameters_rel11; -} nfapi_hi_dci0_epdcch_dci_pdu; - - -typedef struct { - nfapi_tl_t tl; - uint8_t mpdcch_narrowband; - uint8_t number_of_prb_pairs; - uint8_t resource_block_assignment; - uint8_t mpdcch_transmission_type; - uint8_t start_symbol; - uint8_t ecce_index; - uint8_t aggreagation_level; - uint8_t rnti_type; - uint16_t rnti; - uint8_t ce_mode; - uint16_t drms_scrambling_init; - uint16_t initial_transmission_sf_io; - uint16_t transmission_power; - uint8_t dci_format; - uint8_t resource_block_start; - uint8_t number_of_resource_blocks; - uint8_t mcs; - uint8_t pusch_repetition_levels; - uint8_t frequency_hopping_flag; - uint8_t new_data_indication; - uint8_t harq_process; - uint8_t redudency_version; - uint8_t tpc; - uint8_t csi_request; - uint8_t ul_inex; - uint8_t dai_presence_flag; - uint8_t dl_assignment_index; - uint8_t srs_request; - uint8_t dci_subframe_repetition_number; - uint32_t tcp_bitmap; - uint8_t total_dci_length_include_padding; - uint8_t number_of_tx_antenna_ports; - uint16_t precoding_value[NFAPI_MAX_ANTENNA_PORT_COUNT]; -} nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t; -#define NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG 0x204E - -typedef struct { - nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t mpdcch_dci_pdu_rel13; -} nfapi_hi_dci0_mpdcch_dci_pdu; - -typedef struct { - nfapi_tl_t tl; - uint8_t ncce_index; - uint8_t aggregation_level; - uint8_t start_symbol; - uint16_t rnti; - uint8_t scrambling_reinitialization_batch_index; - uint8_t nrs_antenna_ports_assumed_by_the_ue; - uint8_t subcarrier_indication; - uint8_t resource_assignment; - uint8_t scheduling_delay; - uint8_t mcs; - uint8_t redudancy_version; - uint8_t repetition_number; - uint8_t new_data_indicator; - uint8_t dci_subframe_repetition_number; -} nfapi_hi_dci0_npdcch_dci_pdu_rel13_t; - -#define NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG 0x2062 - -typedef struct { - nfapi_hi_dci0_npdcch_dci_pdu_rel13_t npdcch_dci_pdu_rel13; -} nfapi_hi_dci0_npdcch_dci_pdu; - -typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - union { - nfapi_hi_dci0_hi_pdu hi_pdu; - nfapi_hi_dci0_dci_pdu dci_pdu; - nfapi_hi_dci0_epdcch_dci_pdu epdcch_dci_pdu; - nfapi_hi_dci0_mpdcch_dci_pdu mpdcch_dci_pdu; - nfapi_hi_dci0_npdcch_dci_pdu npdcch_dci_pdu; - }; -} nfapi_hi_dci0_request_pdu_t; - -#define NFAPI_HI_DCI0_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t sfnsf; - uint8_t number_of_dci; - uint8_t number_of_hi; - nfapi_hi_dci0_request_pdu_t* hi_dci0_pdu_list; -} nfapi_hi_dci0_request_body_t; -#define NFAPI_HI_DCI0_REQUEST_BODY_TAG 0x201D - -#define NFAPI_TX_MAX_SEGMENTS 32 -typedef struct { - uint16_t pdu_length; - uint16_t pdu_index; - uint8_t num_segments; - struct { - uint32_t segment_length; - uint8_t* segment_data; - } segments[NFAPI_TX_MAX_SEGMENTS]; -} nfapi_tx_request_pdu_t; - -#define NFAPI_TX_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_pdus; - nfapi_tx_request_pdu_t* tx_pdu_list; -} nfapi_tx_request_body_t; -#define NFAPI_TX_REQUEST_BODY_TAG 0x2022 - -// P7 Message Structures -typedef struct { - nfapi_p7_message_header_t header; - uint32_t t1; - int32_t delta_sfn_sf; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_dl_node_sync_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint32_t t1; - uint32_t t2; - uint32_t t3; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_ul_node_sync_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint32_t last_sfn_sf; - uint32_t time_since_last_timing_info; - uint32_t dl_config_jitter; - uint32_t tx_request_jitter; - uint32_t ul_config_jitter; - uint32_t hi_dci0_jitter; - int32_t dl_config_latest_delay; - int32_t tx_request_latest_delay; - int32_t ul_config_latest_delay; - int32_t hi_dci0_latest_delay; - int32_t dl_config_earliest_arrival; - int32_t tx_request_earliest_arrival; - int32_t ul_config_earliest_arrival; - int32_t hi_dci0_earliest_arrival; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_timing_info_t; - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint16_t rnti; -} nfapi_rx_ue_information; -#define NFAPI_RX_UE_INFORMATION_TAG 0x2038 - -typedef struct { - uint8_t value_0; - uint8_t value_1; -} nfapi_harq_indication_tdd_harq_data_bundling_t; - -typedef struct { - uint8_t value_0; - uint8_t value_1; - uint8_t value_2; - uint8_t value_3; -} nfapi_harq_indication_tdd_harq_data_multiplexing_t; - -typedef struct { - uint8_t value_0; -} nfapi_harq_indication_tdd_harq_data_special_bundling_t; - -typedef struct { - uint8_t value_0; -} nfapi_harq_indication_tdd_harq_data_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t mode; - uint8_t number_of_ack_nack; - union{ - nfapi_harq_indication_tdd_harq_data_bundling_t bundling; - nfapi_harq_indication_tdd_harq_data_multiplexing_t multiplex; - nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; - } harq_data; -} nfapi_harq_indication_tdd_rel8_t; -#define NFAPI_HARQ_INDICATION_TDD_REL8_TAG 0x2027 - -typedef struct { - nfapi_tl_t tl; - uint8_t mode; - uint8_t number_of_ack_nack; - union{ - nfapi_harq_indication_tdd_harq_data_t bundling; - nfapi_harq_indication_tdd_harq_data_t multiplex; - nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; - nfapi_harq_indication_tdd_harq_data_t channel_selection; - nfapi_harq_indication_tdd_harq_data_t format_3; - } harq_data[NFAPI_MAX_NUMBER_ACK_NACK_TDD]; -} nfapi_harq_indication_tdd_rel9_t; -#define NFAPI_HARQ_INDICATION_TDD_REL9_TAG 0x2028 - -typedef struct { - nfapi_tl_t tl; - uint8_t mode; - uint16_t number_of_ack_nack; - union{ - nfapi_harq_indication_tdd_harq_data_t bundling; - nfapi_harq_indication_tdd_harq_data_t multiplex; - nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; - nfapi_harq_indication_tdd_harq_data_t channel_selection; - nfapi_harq_indication_tdd_harq_data_t format_3; - nfapi_harq_indication_tdd_harq_data_t format_4; - nfapi_harq_indication_tdd_harq_data_t format_5; - } harq_data[NFAPI_MAX_NUMBER_ACK_NACK_TDD]; -} nfapi_harq_indication_tdd_rel13_t; -#define NFAPI_HARQ_INDICATION_TDD_REL13_TAG 0x204F - -typedef struct { - nfapi_tl_t tl; - uint8_t harq_tb1; - uint8_t harq_tb2; -} nfapi_harq_indication_fdd_rel8_t; -#define NFAPI_HARQ_INDICATION_FDD_REL8_TAG 0x2029 - -#define NFAPI_HARQ_ACK_NACK_REL9_MAX 10 -typedef struct { - nfapi_tl_t tl; - uint8_t mode; - uint8_t number_of_ack_nack; - uint8_t harq_tb_n[NFAPI_HARQ_ACK_NACK_REL9_MAX]; -} nfapi_harq_indication_fdd_rel9_t; -#define NFAPI_HARQ_INDICATION_FDD_REL9_TAG 0x202a - -#define NFAPI_HARQ_ACK_NACK_REL13_MAX 22 // Need to check this max? -typedef struct { - nfapi_tl_t tl; - uint8_t mode; - uint16_t number_of_ack_nack; - uint8_t harq_tb_n[NFAPI_HARQ_ACK_NACK_REL13_MAX]; -} nfapi_harq_indication_fdd_rel13_t; -#define NFAPI_HARQ_INDICATION_FDD_REL13_TAG 0x2050 - -typedef struct { - nfapi_tl_t tl; - uint8_t ul_cqi; - uint8_t channel; -} nfapi_ul_cqi_information_t; -#define NFAPI_UL_CQI_INFORMATION_TAG 0x2052 - -// Only expect 1 harq_indication TLV.tag to be set -// Would this be a better a an union, but not clear which combinations -// are valid -typedef struct { - uint16_t instance_length; - nfapi_rx_ue_information rx_ue_information; - nfapi_harq_indication_tdd_rel8_t harq_indication_tdd_rel8; - nfapi_harq_indication_tdd_rel9_t harq_indication_tdd_rel9; - nfapi_harq_indication_tdd_rel13_t harq_indication_tdd_rel13; - nfapi_harq_indication_fdd_rel8_t harq_indication_fdd_rel8; - nfapi_harq_indication_fdd_rel9_t harq_indication_fdd_rel9; - nfapi_harq_indication_fdd_rel13_t harq_indication_fdd_rel13; - nfapi_ul_cqi_information_t ul_cqi_information; -} nfapi_harq_indication_pdu_t; - -#define NFAPI_HARQ_IND_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_harqs; - nfapi_harq_indication_pdu_t* harq_pdu_list; -} nfapi_harq_indication_body_t; -#define NFAPI_HARQ_INDICATION_BODY_TAG 0x2026 - -typedef struct { - nfapi_tl_t tl; - uint8_t crc_flag; -} nfapi_crc_indication_rel8_t; -#define NFAPI_CRC_INDICATION_REL8_TAG 0x202c - -typedef struct { - uint16_t instance_length; - nfapi_rx_ue_information rx_ue_information; - nfapi_crc_indication_rel8_t crc_indication_rel8; -} nfapi_crc_indication_pdu_t; - -#define NFAPI_CRC_IND_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_crcs; - nfapi_crc_indication_pdu_t* crc_pdu_list; -} nfapi_crc_indication_body_t; -#define NFAPI_CRC_INDICATION_BODY_TAG 0x202b - -typedef struct { - uint16_t instance_length; - nfapi_rx_ue_information rx_ue_information; - nfapi_ul_cqi_information_t ul_cqi_information; -} nfapi_sr_indication_pdu_t; - -#define NFAPI_SR_IND_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_srs; // Question : should this be srs - nfapi_sr_indication_pdu_t* sr_pdu_list; -} nfapi_sr_indication_body_t; -#define NFAPI_SR_INDICATION_BODY_TAG 0x202d - -// The data offset should be set to 0 or 1 before encoding -// If it is set to 1 the nfapi library will detemine the correct offset - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t data_offset; - uint8_t ul_cqi; - uint8_t ri; - uint16_t timing_advance; -} nfapi_cqi_indication_rel8_t; -#define NFAPI_CQI_INDICATION_REL8_TAG 0x202f - -#define NFAPI_CC_MAX 4 -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t data_offset; - uint8_t ul_cqi; - uint8_t number_of_cc_reported; - uint8_t ri[NFAPI_CC_MAX]; - uint16_t timing_advance; - uint16_t timing_advance_r9; -} nfapi_cqi_indication_rel9_t; -#define NFAPI_CQI_INDICATION_REL9_TAG 0x2030 - -typedef struct { - uint16_t instance_length; - nfapi_rx_ue_information rx_ue_information; - nfapi_cqi_indication_rel8_t cqi_indication_rel8; - nfapi_cqi_indication_rel9_t cqi_indication_rel9; - nfapi_ul_cqi_information_t ul_cqi_information; -} nfapi_cqi_indication_pdu_t; - -#define NFAPI_CQI_RAW_MAX_LEN 12 -typedef struct { - uint8_t pdu[NFAPI_CQI_RAW_MAX_LEN]; -} nfapi_cqi_indication_raw_pdu_t; - -#define NFAPI_CQI_IND_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_cqis; - nfapi_cqi_indication_pdu_t* cqi_pdu_list; - nfapi_cqi_indication_raw_pdu_t* cqi_raw_pdu_list; -} nfapi_cqi_indication_body_t; -#define NFAPI_CQI_INDICATION_BODY_TAG 0x202e - -typedef struct { - nfapi_tl_t tl; - uint16_t rnti; - uint8_t preamble; - uint16_t timing_advance; -} nfapi_preamble_pdu_rel8_t; -#define NFAPI_PREAMBLE_REL8_TAG 0x2032 - -typedef struct { - nfapi_tl_t tl; - uint16_t timing_advance_r9; -} nfapi_preamble_pdu_rel9_t; -#define NFAPI_PREAMBLE_REL9_TAG 0x2033 - -typedef struct { - nfapi_tl_t tl; - uint8_t rach_resource_type; -} nfapi_preamble_pdu_rel13_t; -#define NFAPI_PREAMBLE_REL13_TAG 0x2051 - -typedef struct { - uint16_t instance_length; - nfapi_preamble_pdu_rel8_t preamble_rel8; - nfapi_preamble_pdu_rel9_t preamble_rel9; - nfapi_preamble_pdu_rel13_t preamble_rel13; -} nfapi_preamble_pdu_t; - -#define NFAPI_PREAMBLE_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_preambles; - nfapi_preamble_pdu_t* preamble_list; -} nfapi_rach_indication_body_t; -#define NFAPI_RACH_INDICATION_BODY_TAG 0x2031 - -#define NFAPI_NUM_RB_MAX 1000 -typedef struct { - nfapi_tl_t tl; - uint16_t doppler_estimation; - uint16_t timing_advance; - uint8_t number_of_resource_blocks; - uint8_t rb_start; - uint8_t snr[NFAPI_NUM_RB_MAX]; -} nfapi_srs_indication_fdd_rel8_t; -#define NFAPI_SRS_INDICATION_FDD_REL8_TAG 0x2035 - -typedef struct { - nfapi_tl_t tl; - uint16_t timing_advance_r9; -} nfapi_srs_indication_fdd_rel9_t; -#define NFAPI_SRS_INDICATION_FDD_REL9_TAG 0x2036 - -typedef struct { - nfapi_tl_t tl; - uint8_t uppts_symbol; -} nfapi_srs_indication_ttd_rel10_t; -#define NFAPI_SRS_INDICATION_TDD_REL10_TAG 0x2037 - -typedef struct { - nfapi_tl_t tl; - uint16_t ul_rtoa; -} nfapi_srs_indication_fdd_rel11_t; -#define NFAPI_SRS_INDICATION_FDD_REL11_TAG 0x2053 - - -typedef struct { - nfapi_tl_t tl; - uint8_t num_prb_per_subband; - uint8_t number_of_subbands; - uint8_t num_atennas; - struct { - uint8_t subband_index; - uint16_t channel[NFAPI_MAX_NUM_PHYSICAL_ANTENNAS]; - } subands[NFAPI_MAX_NUM_SUBBANDS]; -} nfapi_tdd_channel_measurement_t; -#define NFAPI_TDD_CHANNEL_MEASUREMENT_TAG 0x2054 - -typedef struct { - uint16_t instance_length; - nfapi_rx_ue_information rx_ue_information; - nfapi_srs_indication_fdd_rel8_t srs_indication_fdd_rel8; - nfapi_srs_indication_fdd_rel9_t srs_indication_fdd_rel9; - nfapi_srs_indication_ttd_rel10_t srs_indication_tdd_rel10; - nfapi_srs_indication_fdd_rel11_t srs_indication_fdd_rel11; - nfapi_tdd_channel_measurement_t tdd_channel_measurement; -} nfapi_srs_indication_pdu_t; - -#define NFAPI_SRS_IND_MAX_PDU 16 -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_ues; - nfapi_srs_indication_pdu_t* srs_pdu_list; -} nfapi_srs_indication_body_t; -#define NFAPI_SRS_INDICATION_BODY_TAG 0x2034 - -typedef struct { - nfapi_tl_t tl; - uint16_t length; - uint16_t offset; - uint8_t ul_cqi; - uint16_t timing_advance; -} nfapi_rx_indication_rel8_t; -#define NFAPI_RX_INDICATION_REL8_TAG 0x2024 - -typedef struct { - nfapi_tl_t tl; - uint16_t timing_advance_r9; - } nfapi_rx_indication_rel9_t; -#define NFAPI_RX_INDICATION_REL9_TAG 0x2025 - -typedef struct { - nfapi_rx_ue_information rx_ue_information; - nfapi_rx_indication_rel8_t rx_indication_rel8; - nfapi_rx_indication_rel9_t rx_indication_rel9; - uint8_t* data; -} nfapi_rx_indication_pdu_t; - -#define NFAPI_RX_IND_MAX_PDU 100 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_pdus; - nfapi_rx_indication_pdu_t* rx_pdu_list; -} nfapi_rx_indication_body_t; -#define NFAPI_RX_INDICATION_BODY_TAG 0x2023 - -typedef struct { - nfapi_tl_t tl; - uint8_t harq_tb1; -} nfapi_nb_harq_indication_fdd_rel13_t; -#define NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG 0x2064 - -typedef struct { - uint16_t instance_length; - nfapi_rx_ue_information rx_ue_information; - nfapi_nb_harq_indication_fdd_rel13_t nb_harq_indication_fdd_rel13; - nfapi_ul_cqi_information_t ul_cqi_information; -} nfapi_nb_harq_indication_pdu_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_harqs; - nfapi_nb_harq_indication_pdu_t* nb_harq_pdu_list; -} nfapi_nb_harq_indication_body_t; -#define NFAPI_NB_HARQ_INDICATION_BODY_TAG 0x2063 - -typedef struct { - nfapi_tl_t tl; - uint16_t rnti; - uint8_t initial_sc; - uint16_t timing_advance; - uint8_t nrach_ce_level; -} nfapi_nrach_indication_pdu_rel13_t; -#define NFAPI_NRACH_INDICATION_REL13_TAG 0x2066 - -typedef struct { - nfapi_nrach_indication_pdu_rel13_t nrach_indication_rel13; -} nfapi_nrach_indication_pdu_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_initial_scs_detected; - nfapi_nrach_indication_pdu_t* nrach_pdu_list; -} nfapi_nrach_indication_body_t; -#define NFAPI_NRACH_INDICATION_BODY_TAG 0x2065 - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint32_t mp_cca; - uint32_t n_cca; - uint32_t offset; - uint32_t lte_txop_sf; - uint16_t txop_sfn_sf_end; - uint32_t lbt_mode; -} nfapi_lbt_pdsch_req_pdu_rel13_t; -#define NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG 0x2056 - -typedef struct { - nfapi_lbt_pdsch_req_pdu_rel13_t lbt_pdsch_req_pdu_rel13; -} nfapi_lbt_pdsch_req_pdu; - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint32_t offset; - uint16_t sfn_sf_end; - uint32_t lbt_mode; -} nfapi_lbt_drs_req_pdu_rel13_t; -#define NFAPI_LBT_DRS_REQ_PDU_REL13_TAG 0x2057 - -typedef struct { - nfapi_lbt_drs_req_pdu_rel13_t lbt_drs_req_pdu_rel13; -} nfapi_lbt_drs_req_pdu; - -typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - union { - nfapi_lbt_pdsch_req_pdu lbt_pdsch_req_pdu; - nfapi_lbt_drs_req_pdu lbt_drs_req_pdu; - }; -} nfapi_lbt_dl_config_request_pdu_t; - -#define NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU 16 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_pdus; - nfapi_lbt_dl_config_request_pdu_t* lbt_dl_config_req_pdu_list; -} nfapi_lbt_dl_config_request_body_t; -#define NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG 0x2055 - - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint32_t result; - uint32_t lte_txop_symbols; - uint32_t initial_partial_sf; -} nfapi_lbt_pdsch_rsp_pdu_rel13_t; -#define NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG 0x2059 - -typedef struct { - nfapi_lbt_pdsch_rsp_pdu_rel13_t lbt_pdsch_rsp_pdu_rel13; -} nfapi_lbt_pdsch_rsp_pdu; - -typedef struct { - nfapi_tl_t tl; - uint32_t handle; - uint32_t result; -} nfapi_lbt_drs_rsp_pdu_rel13_t; -#define NFAPI_LBT_DRS_RSP_PDU_REL13_TAG 0x205A - -typedef struct { - nfapi_lbt_drs_rsp_pdu_rel13_t lbt_drs_rsp_pdu_rel13; -} nfapi_lbt_drs_rsp_pdu; - - -typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - union { - nfapi_lbt_pdsch_rsp_pdu lbt_pdsch_rsp_pdu; - nfapi_lbt_drs_rsp_pdu lbt_drs_rsp_pdu; - }; -} nfapi_lbt_dl_indication_pdu_t; - -#define NFAPI_LBT_IND_MAX_PDU 16 -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_pdus; - nfapi_lbt_dl_indication_pdu_t* lbt_indication_pdu_list; -} nfapi_lbt_dl_indication_body_t; -#define NFAPI_LBT_DL_INDICATION_BODY_TAG 0x2058 - -typedef struct { -} nfapi_error_indication_msg_invalid_state; - -typedef struct { -} nfapi_error_indication_msg_bch_missing; - -typedef struct { - uint16_t recieved_sfn_sf; - uint16_t expected_sfn_sf; -} nfapi_error_indication_sfn_out_of_sync; - -typedef struct { - uint8_t sub_error_code; - uint8_t direction; - uint16_t rnti; - uint8_t pdu_type; -} nfapi_error_indication_msg_pdu_err; - -typedef struct { - uint16_t recieved_sfn_sf; - uint16_t expected_sfn_sf; -} nfapi_error_indication_msg_invalid_sfn; - -typedef struct { - uint8_t sub_error_code; - uint8_t phich_lowest_ul_rb_index; -} nfapi_error_indication_msg_hi_err; - -typedef struct { - uint8_t sub_error_code; - uint16_t pdu_index; -} nfapi_error_indication_msg_tx_err; - -// -// P4 Message Structures -// - -typedef struct { - nfapi_tl_t tl; - uint8_t frequency_band_indicator; - uint16_t measurement_period; - uint8_t bandwidth; - uint32_t timeout; - uint8_t number_of_earfcns; - uint16_t earfcn[NFAPI_MAX_CARRIER_LIST]; -} nfapi_lte_rssi_request_t; - -#define NFAPI_LTE_RSSI_REQUEST_TAG 0x3000 - -#define NFAPI_P4_START_TAG NFAPI_LTE_RSSI_REQUEST_TAG - -typedef struct { - nfapi_tl_t tl; - uint8_t frequency_band_indicator; - uint16_t measurement_period; - uint32_t timeout; - uint8_t number_of_uarfcns; - uint16_t uarfcn[NFAPI_MAX_CARRIER_LIST]; -} nfapi_utran_rssi_request_t; - -#define NFAPI_UTRAN_RSSI_REQUEST_TAG 0x3001 - -typedef struct { - uint16_t arfcn; - uint8_t direction; -} nfapi_arfcn_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t frequency_band_indicator; - uint16_t measurement_period; - uint32_t timeout; - uint8_t number_of_arfcns; - nfapi_arfcn_t arfcn[NFAPI_MAX_CARRIER_LIST]; -} nfapi_geran_rssi_request_t; - -#define NFAPI_GERAN_RSSI_REQUEST_TAG 0x3002 - - - -typedef struct { - uint16_t earfcn; - uint8_t number_of_ro_dl; - uint8_t ro_dl[NFAPI_MAX_RO_DL]; -} nfapi_earfcn_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t frequency_band_indicator; - uint16_t measurement_period; - uint32_t timeout; - uint8_t number_of_earfcns; - nfapi_earfcn_t earfcn[NFAPI_MAX_CARRIER_LIST]; -} nfapi_nb_iot_rssi_request_t; - -#define NFAPI_NB_IOT_RSSI_REQUEST_TAG 0x3020 - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_rssi; - int16_t rssi[NFAPI_MAX_RSSI]; -} nfapi_rssi_indication_body_t; - -#define NFAPI_RSSI_INDICATION_TAG 0x3003 - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint8_t measurement_bandwidth; - uint8_t exhaustive_search; - uint32_t timeout; - uint8_t number_of_pci; - uint16_t pci[NFAPI_MAX_PCI_LIST]; -} nfapi_lte_cell_search_request_t; - -#define NFAPI_LTE_CELL_SEARCH_REQUEST_TAG 0x3004 - -typedef struct { - nfapi_tl_t tl; - uint16_t uarfcn; - uint8_t exhaustive_search; - uint32_t timeout; - uint8_t number_of_psc; - uint16_t psc[NFAPI_MAX_PSC_LIST]; -} nfapi_utran_cell_search_request_t; - -#define NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG 0x3005 - -typedef struct { - nfapi_tl_t tl; - uint32_t timeout; - uint8_t number_of_arfcn; - uint16_t arfcn[NFAPI_MAX_ARFCN_LIST]; -} nfapi_geran_cell_search_request_t; - -#define NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG 0x3006 - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint8_t ro_dl; - uint8_t exhaustive_search; - uint32_t timeout; - uint8_t number_of_pci; - uint16_t pci[NFAPI_MAX_PCI_LIST]; -} nfapi_nb_iot_cell_search_request_t; - -#define NFAPI_NB_IOT_CELL_SEARCH_REQUEST_TAG 0x3021 - -typedef struct { - uint16_t pci; - uint8_t rsrp; - uint8_t rsrq; - int16_t frequency_offset; -} nfapi_lte_found_cell_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_lte_cells_found; - nfapi_lte_found_cell_t lte_found_cells[NFAPI_MAX_LTE_CELLS_FOUND]; -} nfapi_lte_cell_search_indication_t; - -#define NFAPI_LTE_CELL_SEARCH_INDICATION_TAG 0x3007 - -typedef struct { - uint16_t psc; - uint8_t rscp; - uint8_t ecno; - int16_t frequency_offset; -} nfapi_utran_found_cell_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_utran_cells_found; - nfapi_utran_found_cell_t utran_found_cells[NFAPI_MAX_UTRAN_CELLS_FOUND]; -} nfapi_utran_cell_search_indication_t; - -#define NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG 0x3008 - -typedef struct { - uint16_t arfcn; - uint8_t bsic; - uint8_t rxlev; - uint8_t rxqual; - int16_t frequency_offset; - uint32_t sfn_offset; -} nfapi_gsm_found_cell_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_gsm_cells_found; - nfapi_gsm_found_cell_t gsm_found_cells[NFAPI_MAX_GSM_CELLS_FOUND]; -} nfapi_geran_cell_search_indication_t; - -#define NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG 0x3009 - -typedef struct { - uint16_t pci; - uint8_t rsrp; - uint8_t rsrq; - int16_t frequency_offset; -} nfapi_nb_iot_found_cell_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t number_of_nb_iot_cells_found; - nfapi_nb_iot_found_cell_t nb_iot_found_cells[NFAPI_MAX_NB_IOT_CELLS_FOUND]; -} nfapi_nb_iot_cell_search_indication_t; - -#define NFAPI_NB_IOT_CELL_SEARCH_INDICATION_TAG 0x3022 - -typedef nfapi_opaqaue_data_t nfapi_pnf_cell_search_state_t; - -#define NFAPI_PNF_CELL_SEARCH_STATE_TAG 0x300A - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint16_t pci; - uint32_t timeout; -} nfapi_lte_broadcast_detect_request_t; - -#define NFAPI_LTE_BROADCAST_DETECT_REQUEST_TAG 0x300B - -typedef struct { - nfapi_tl_t tl; - uint16_t uarfcn; - uint16_t psc; - uint32_t timeout; -} nfapi_utran_broadcast_detect_request_t; - -#define NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG 0x300C - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint8_t ro_dl; - uint16_t pci; - uint32_t timeout; -} nfapi_nb_iot_broadcast_detect_request_t; - -#define NFAPI_NB_IOT_BROADCAST_DETECT_REQUEST_TAG 0x3023 - -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_tx_antenna; - uint16_t mib_length; - uint8_t mib[NFAPI_MAX_MIB_LENGTH]; - uint32_t sfn_offset; -} nfapi_lte_broadcast_detect_indication_t; - -#define NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG 0x300E - -typedef struct { - nfapi_tl_t tl; - uint16_t mib_length; - uint8_t mib[NFAPI_MAX_MIB_LENGTH]; - uint32_t sfn_offset; -} nfapi_utran_broadcast_detect_indication_t; - -#define NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG 0x300F - - -typedef struct { - nfapi_tl_t tl; - uint8_t number_of_tx_antenna; - uint16_t mib_length; - uint8_t mib[NFAPI_MAX_MIB_LENGTH]; - uint32_t sfn_offset; -} nfapi_nb_iot_broadcast_detect_indication_t; - -#define NFAPI_NB_IOT_BROADCAST_DETECT_INDICATION_TAG 0x3024 - -#define NFAPI_PNF_CELL_BROADCAST_STATE_TAG 0x3010 - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint16_t pci; - uint16_t downlink_channel_bandwidth; - uint8_t phich_configuration; - uint8_t number_of_tx_antenna; - uint8_t retry_count; - uint32_t timeout; -} nfapi_lte_system_information_schedule_request_t; - -#define NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG 0x3011 - - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint8_t ro_dl; - uint16_t pci; - uint8_t scheduling_info_sib1_nb; - uint32_t timeout; -} nfapi_nb_iot_system_information_schedule_request_t; - -#define NFAPI_NB_IOT_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG 0x3025 - -typedef nfapi_opaqaue_data_t nfapi_pnf_cell_broadcast_state_t; - -typedef struct { - uint8_t si_periodicity; - uint8_t si_index; -} nfapi_lte_system_information_si_periodicity_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint16_t pci; - uint16_t downlink_channel_bandwidth; - uint8_t phich_configuration; - uint8_t number_of_tx_antenna; - uint8_t number_of_si_periodicity; - nfapi_lte_system_information_si_periodicity_t si_periodicity[NFAPI_MAX_SI_PERIODICITY]; - uint8_t si_window_length; - uint32_t timeout; -} nfapi_lte_system_information_request_t; - -#define NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG 0x3014 - -typedef struct { - nfapi_tl_t tl; - uint16_t uarfcn; - uint16_t psc; - uint32_t timeout; -} nfapi_utran_system_information_request_t; - -#define NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG 0x3015 - -typedef struct { - nfapi_tl_t tl; - uint16_t arfcn; - uint8_t bsic; - uint32_t timeout; -} nfapi_geran_system_information_request_t; - -#define NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG 0x3016 - -typedef struct { - uint8_t si_periodicity; - uint8_t si_repetition_pattern; - uint8_t si_tb_size; - uint8_t number_of_si_index; - uint8_t si_index[NFAPI_MAX_SI_INDEX]; -} nfapi_nb_iot_system_information_si_periodicity_t; - -typedef struct { - nfapi_tl_t tl; - uint16_t earfcn; - uint8_t ro_dl; - uint16_t pci; - uint8_t number_of_si_periodicity; - nfapi_nb_iot_system_information_si_periodicity_t si_periodicity[NFAPI_MAX_SI_PERIODICITY]; - uint8_t si_window_length; - uint32_t timeout; -} nfapi_nb_iot_system_information_request_t; - -#define NFAPI_NB_IOT_SYSTEM_INFORMATION_REQUEST_TAG 0x3027 - -typedef struct { - nfapi_tl_t tl; - uint8_t sib_type; - uint16_t sib_length; - uint8_t sib[NFAPI_MAX_SIB_LENGTH]; -} nfapi_lte_system_information_indication_t; - -#define NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG 0x3018 - -typedef struct { - nfapi_tl_t tl; - uint16_t sib_length; - uint8_t sib[NFAPI_MAX_SIB_LENGTH]; -} nfapi_utran_system_information_indication_t; - -#define NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG 0x3019 - -typedef struct { - nfapi_tl_t tl; - uint16_t si_length; - uint8_t si[NFAPI_MAX_SI_LENGTH]; -} nfapi_geran_system_information_indication_t; - -#define NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG 0x301a - -typedef struct { - nfapi_tl_t tl; - uint8_t sib_type; - uint16_t sib_length; - uint8_t sib[NFAPI_MAX_SIB_LENGTH]; -} nfapi_nb_iot_system_information_indication_t; - -#define NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG 0x3026 - - -// -// Top level NFAP messages -// - -// -// P7 -// - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_dl_config_request_body_t dl_config_request_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_dl_config_request_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_ul_config_request_body_t ul_config_request_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_ul_config_request_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_hi_dci0_request_body_t hi_dci0_request_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_hi_dci0_request_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_tx_request_body_t tx_request_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_tx_request_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; -} nfapi_subframe_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_harq_indication_body_t harq_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_harq_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_crc_indication_body_t crc_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_crc_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_sr_indication_body_t sr_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_sr_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_cqi_indication_body_t cqi_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_cqi_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_rach_indication_body_t rach_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_rach_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_srs_indication_body_t srs_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_srs_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_rx_indication_body_t rx_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_rx_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_nb_harq_indication_body_t nb_harq_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_nb_harq_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_nrach_indication_body_t nrach_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_nrach_indication_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_lbt_dl_config_request_body_t lbt_dl_config_request_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_lbt_dl_config_request_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_lbt_dl_indication_body_t lbt_dl_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_lbt_dl_indication_t; - - -typedef struct { - nfapi_p7_message_header_t header; - uint8_t message_id; - uint8_t error_code; - union { - nfapi_error_indication_msg_invalid_state msg_invalid_state; - nfapi_error_indication_msg_bch_missing msg_bch_missing; - nfapi_error_indication_sfn_out_of_sync sfn_out_of_sync; - nfapi_error_indication_msg_pdu_err msg_pdu_err; - nfapi_error_indication_msg_invalid_sfn msg_invalid_sfn; - nfapi_error_indication_msg_hi_err msg_hi_err; - nfapi_error_indication_msg_tx_err msg_tx_err; - }; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_error_indication_t; - -// -// P4 Messages -// - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t rat_type; - union { - nfapi_lte_rssi_request_t lte_rssi_request; - nfapi_utran_rssi_request_t utran_rssi_request; - nfapi_geran_rssi_request_t geran_rssi_request; - nfapi_nb_iot_rssi_request_t nb_iot_rssi_request; - }; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_rssi_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_rssi_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_rssi_indication_body_t rssi_indication_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_rssi_indication_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t rat_type; - union { - nfapi_lte_cell_search_request_t lte_cell_search_request; - nfapi_utran_cell_search_request_t utran_cell_search_request; - nfapi_geran_cell_search_request_t geran_cell_search_request; - nfapi_nb_iot_cell_search_request_t nb_iot_cell_search_request; - }; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_cell_search_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_cell_search_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_lte_cell_search_indication_t lte_cell_search_indication; - nfapi_utran_cell_search_indication_t utran_cell_search_indication; - nfapi_geran_cell_search_indication_t geran_cell_search_indication; - nfapi_pnf_cell_search_state_t pnf_cell_search_state; - nfapi_nb_iot_cell_search_indication_t nb_iot_cell_search_indication; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_cell_search_indication_t; - - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t rat_type; - union { - nfapi_lte_broadcast_detect_request_t lte_broadcast_detect_request; - nfapi_utran_broadcast_detect_request_t utran_broadcast_detect_request; - nfapi_nb_iot_broadcast_detect_request_t nb_iot_broadcast_detect_request; - }; - nfapi_pnf_cell_search_state_t pnf_cell_search_state; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_broadcast_detect_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_broadcast_detect_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_lte_broadcast_detect_indication_t lte_broadcast_detect_indication; - nfapi_utran_broadcast_detect_indication_t utran_broadcast_detect_indication; - nfapi_nb_iot_broadcast_detect_indication_t nb_iot_broadcast_detect_indication; - nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_broadcast_detect_indication_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t rat_type; - union { - nfapi_lte_system_information_schedule_request_t lte_system_information_schedule_request; - nfapi_nb_iot_system_information_schedule_request_t nb_iot_system_information_schedule_request; - }; - nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_system_information_schedule_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_system_information_schedule_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_lte_system_information_indication_t lte_system_information_indication; - nfapi_nb_iot_system_information_indication_t nb_iot_system_information_indication; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_system_information_schedule_indication_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t rat_type; - union { - nfapi_lte_system_information_request_t lte_system_information_request; - nfapi_utran_system_information_request_t utran_system_information_request; - nfapi_geran_system_information_request_t geran_system_information_request; - nfapi_nb_iot_system_information_request_t nb_iot_system_information_request; - }; - nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_system_information_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_system_information_response_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_lte_system_information_indication_t lte_system_information_indication; - nfapi_utran_system_information_indication_t utran_system_information_indication; - nfapi_geran_system_information_indication_t geran_system_information_indication; - nfapi_nb_iot_system_information_indication_t nb_iot_system_information_indication; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_system_information_indication_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_nmm_stop_request_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint32_t error_code; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_nmm_stop_response_t; - -// -// Configuration options for the encode decode functions -// - -/*! Configuration options for the p7 pack unpack functions - * - */ -typedef struct nfapi_p7_codec_config { - - /*! Optional call back to allow the user to define the memory allocator. - * \param size The size of the memory to allocate - * \return a pointer to a valid memory block or 0 if it has failed. - * - * If not set the nfapi unpack functions will use malloc - */ - void* (*allocate)(size_t size); - - /*! Optional call back to allow the user to define the memory deallocator. - * \param ptr A poiner to a memory block allocated by the allocate callback - * - * If not set the client should use free - */ - void (*deallocate)(void* ptr); - - /*! Optional call back function to handle unpacking vendor extension tlv. - * \param tl A pointer to a decoded tag length structure - * \param ppReadPackedMsg A handle to the read buffer. - * \param end The end of the read buffer - * \param ve A handle to a vendor extention structure that the call back should allocate if the structure can be decoded - * \param config A pointer to the p7 codec configuration - * \return return 0 if packed successfully, -1 if failed. - * - * If not set the tlv will be skipped - * - * Client should use the help methods in nfapi.h to decode the vendor extention. - * - * \todo Add code example - */ - int (*unpack_vendor_extension_tlv)(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, void** ve, struct nfapi_p7_codec_config* config); - - /*! Optional call back function to handle packing vendor extension tlv. - * \param ve A pointer to a vendor extention structure. - * \param ppWritePackedMsg A handle to the write buffer - * \param end The end of the write buffer. The callee should make sure not to write beyond the end - * \param config A pointer to the p7 codec configuration - * \return return 0 if packed successfully, -1 if failed. - * - * If not set the the tlv will be skipped - * - * Client should use the help methods in nfapi.h to encode the vendor extention - * - * \todo Add code example - */ - int (*pack_vendor_extension_tlv)(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, struct nfapi_p7_codec_config* config); - - /*! Optional call back function to handle unpacking vendor extension messages. - * \param header A pointer to a decode P7 message header for the vendor extention message - * \param ppReadPackedMsg A handle to the encoded data buffer - * \param end A pointer to the end of the encoded data buffer - * \param config A pointer to the p7 codec configuration - * \return 0 if unpacked successfully, -1 if failed - * - * If not set the message will be ignored - * - * If the message if is unknown the function should return -1 - */ - int (*unpack_p7_vendor_extension)(nfapi_p7_message_header_t* header, uint8_t **ppReadPackedMsg, uint8_t *end, struct nfapi_p7_codec_config* config); - - /*! Optional call back function to handle packing vendor extension messages. - * \param header A poiner to a P7 message structure for the venfor extention message - * \param ppWritePackedmsg A handle to the buffer to write the encoded message into - * \param end A pointer to the end of the buffer - * \param cofig A pointer to the p7 codec configuration - * \return 0 if packed successfully, -1 if failed - * - * If not set the the message will be ingored - * - * If the message if is unknown the function should return -1 - */ - int (*pack_p7_vendor_extension)(nfapi_p7_message_header_t* header, uint8_t **ppWritePackedmsg, uint8_t *end, struct nfapi_p7_codec_config* config); - - /*! Optional user data that will be passed back with callbacks - */ - void* user_data; - -} nfapi_p7_codec_config_t; - -/*! Configuration options for the p4 & p5 pack unpack functions - * - */ -typedef struct nfapi_p4_p5_codec_config { - - /*! Optional call back to allow the user to define the memory allocator. - * \param size The size of the memory to allocate - * \return a pointer to a valid memory block or 0 if it has failed. - * - * If not set the nfapi unpack functions will use malloc - */ - void* (*allocate)(size_t size); - - /*! Optional call back to allow the user to define the memory deallocator. - * \param ptr A poiner to a memory block allocated by the allocate callback - * - * If not set free will be used - */ - void (*deallocate)(void* ptr); - - /*! Optional call back function to handle unpacking vendor extension tlv. - * \param tl A pointer to a decoded tag length structure - * \param ppReadPackedMsg A handle to the data buffer to decode - * \param end A pointer to the end of the buffer - * \param ve A handle to a vendor extention structure that will be allocated by this callback - * \param config A pointer to the P4/P5 codec configuration - * \return 0 if unpacked successfully, -1 if failed - * - * If not set the tlv will be skipped - */ - int (*unpack_vendor_extension_tlv)(nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, void** ve, struct nfapi_p4_p5_codec_config* config); - - /*! Optional call back function to handle packing vendor extension tlv. - * \param ve - * \param ppWritePackedMsg A handle to the data buffer pack the tlv into - * \param end A pointer to the end of the buffer - * \param config A pointer to the P4/P5 codec configuration - * \return 0 if packed successfully, -1 if failed - * - * If not set the the tlv will be skipped - */ - int (*pack_vendor_extension_tlv)(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, struct nfapi_p4_p5_codec_config* config); - - /*! Optional call back function to handle unpacking vendor extension messages. - * \param header A pointer to a decode P4/P5 message header - * \param ppReadPackgedMsg A handle to the data buffer to decode - * \param end A pointer to the end of the buffer - * \param config A pointer to the P4/P5 codec configuration - * \return 0 if packed successfully, -1 if failed - * - * If not set the message will be ignored - */ - int (*unpack_p4_p5_vendor_extension)(nfapi_p4_p5_message_header_t* header, uint8_t **ppReadPackedMsg, uint8_t *end, struct nfapi_p4_p5_codec_config* config); - - /*! Optional call back function to handle packing vendor extension messages. - * \param header A pointer to the P4/P5 message header to be encoded - * \param ppWritePackedMsg A handle to the data buffer pack the message into - * \param end A pointer to the end of the buffer - * \param config A pointer to the P4/P5 codec configuration - * \return 0 if packed successfully, -1 if failed - * - * If not set the the message will be ingored - */ - int (*pack_p4_p5_vendor_extension)(nfapi_p4_p5_message_header_t* header, uint8_t **ppwritepackedmsg, uint8_t *end, struct nfapi_p4_p5_codec_config* config); - - /*! Optional user data that will be passed back with callbacks - */ - void* user_data; - -} nfapi_p4_p5_codec_config_t; - -// -// Functions -// - -/*! \brief Encodes an NFAPI P4 message to a buffer - * \param pMessageBuf A pointer to a nfapi p4 message structure - * \param messageBufLen The size of the p4 message structure - * \param pPackedBuf A pointer to the buffer that the p4 message will be packed into - * \param packedBufLen The size of the buffer - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will encode a nFAPI P4 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. - * - */ -int nfapi_p4_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config); - -/*! \brief Decodes a NFAPI P4 message header - * \param pMessageBuf A pointer to an encoded P4 message header - * \param messageBufLen The size of the encoded P4 message header - * \param pUnpackedBuf A pointer to the nfapi_message_header - * \param unpackedBufLen The size of nfapi_message_header structure. - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will decode a byte stream pointed to by pMessageBuf into a nfapi_p4_p5_message_header structure pointer to by pUnpackedBuf - */ -int nfapi_p4_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); - -/*! \brief Decodes a NFAPI P4 message - * \param pMessageBuf A pointer to an encoded P4 message - * \param messageBufLen The size of the encoded P4 message - * \param pUnpackedBuf A pointer to the nfapi_message_header - * \param unpackedBufLen The size of nfapi_message_header structure. - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p4 message structure pointer to by pUnpackedBuf - */ -int nfapi_p4_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); - -/*! \brief Encodes an NFAPI P5 message to a buffer - * \param pMessageBuf A pointer to a nfapi p5 message structure - * \param messageBufLen The size of the p5 message structure - * \param pPackedBuf A pointer to the buffer that the p5 message will be packed into - * \param packedBufLen The size of the buffer - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will encode a nFAPI P5 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. - * - */ -int nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config); - -/*! \brief Decodes an NFAPI P5 message header - * \param pMessageBuf A pointer to an encoded P5 message header - * \param messageBufLen The size of the encoded P5 message header - * \param pUnpackedBuf A pointer to the nfapi_message_header - * \param unpackedBufLen The size of nfapi_message_header structure. - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will decode a byte stream pointed to by pMessageBuf into a nfapi_p4_p5_message_header structure pointer to by pUnpackedBuf - */ -int nfapi_p5_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); - -/*! \brief Decodes a NFAPI P5 message - * \param pMessageBuf A pointer to an encoded P5 message - * \param messageBufLen The size of the encoded P5 message - * \param pUnpackedBuf A pointer to the nfapi_message_header - * \param unpackedBufLen The size of nfapi_message_header structure. - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p5 message structure pointer to by pUnpackedBuf - */ -int nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config); - -/*! \brief Encodes an NFAPI P7 message to a buffer - * \param pMessageBuf A pointer to a nfapi p7 message structure - * \param pPackedBuf A pointer to the buffer that the p7 message will be packed into - * \param packedBufLen The size of the buffer - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will encode a nFAPI P7 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. - * - */ -int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config); - -/*! \brief Decodes an NFAPI P7 message header - * \param pMessageBuf A pointer to an encoded P7 message header - * \param messageBufLen The size of the encoded P7 message header - * \param pUnpackedBuf A pointer to the nfapi_message_header - * \param unpackedBufLen The size of nfapi_message_header structure. - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will decode a byte stream pointed to by pMessageBuf into a nfapi_p7_message_header structure pointer to by pUnpackedBuf - - */ -int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config); - -/*! \brief Decodes a NFAPI P7 message - * \param pMessageBuf A pointer to an encoded P7 message - * \param messageBufLen The size of the encoded P7 message - * \param pUnpackedBuf A pointer to the nfapi_message_header - * \param unpackedBufLen The size of nfapi_message_header structure. - * \param config A pointer to the nfapi configuration structure - * \return 0 means success, -1 means failure. - * - * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p7 message structure pointer to by pUnpackedBuf - */ -int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config); - -/*! \brief Calculates the checksum of a message - * - * \param buffer Pointer to the packed message - * \param len The length of the message - * \return The checksum. If there is an error the function with return -1 - */ -uint32_t nfapi_p7_calculate_checksum(uint8_t* buffer, uint32_t len); - -/*! \brief Calculates & updates the checksum in the message - * - * \param buffer Pointer to the packed message - * \param len The length of the message - * \return 0 means success, -1 means failure. - */ -int nfapi_p7_update_checksum(uint8_t* buffer, uint32_t len); - -/*! \brief Updates the transmition time stamp in the p7 message header - * - * \param buffer Pointer to the packed message - * \param timestamp The time stamp value - * \return 0 means success, -1 means failure. - */ -int nfapi_p7_update_transmit_timestamp(uint8_t* buffer, uint32_t timestamp); - -#endif /* _NFAPI_INTERFACE_H_ */ diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index c699ad5232..a08be4dead 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -29,98 +29,101 @@ * @ingroup _mac */ +#include "defs.h" +#include "proto.h" int nr_rrc_mac_config_req_ue( - module_id_t Mod_idP, - int CC_idP, - uint8_t eNB_index, - MAC_CellGroupConfig_t *mac_cell_group_config, - PhysicalCellGroupConfig_t *phy_cell_group_config, - SpCellConfig_t *spcell_config){ + module_id_t module_id, + int CC_idP, + uint8_t gNB_index, + NR_MIB_t *mibP, + NR_MAC_CellGroupConfig_t *mac_cell_group_configP, + NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, + NR_SpCellConfig_t *spcell_configP ){ - NR_UE_MAC_INST *mac = get_mac_inst(Mod_idP); + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); - ServingCellConfig_t *serving_cell_config = spcell_config->spCellConfigDedicated; +// NR_ServingCellConfig_t *serving_cell_config = spcell_configP->spCellConfigDedicated; // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. - if(mac_cell_group_config != (MAC_CellGroupConfig_t *)0){ - if(mac_cell_group_config->drx_Config != (drx_Config_t *)0 ){ - mac->drx_Config = mac_cell_group_config->drx_Config; + if(mibP != NULL){ + ; + } + + if(mac_cell_group_configP != NULL){ + if(mac_cell_group_configP->drx_Config != NULL ){ + mac->drx_Config = mac_cell_group_configP->drx_Config; } - if(mac_cell_group_config->SchedulingRequestConfig != (SchedulingRequestConfig_t *)0 ){ - mac->SchedulingRequestConfig = mac_cell_group_config->SchedulingRequestConfig; + if(mac_cell_group_configP->schedulingRequestConfig != NULL ){ + mac->schedulingRequestConfig = mac_cell_group_configP->schedulingRequestConfig; } - if(mac_cell_group_config->BSR_Config != (BSR_Config_t *)0 ){ - mac->BSR_Config = mac_cell_group_config->BSR_Config; + if(mac_cell_group_configP->bsr_Config != NULL ){ + mac->bsr_Config = mac_cell_group_configP->bsr_Config; } - if(mac_cell_group_config->TAG_Config != (TAG_Config_t *)0 ){ - mac->TAG_Config = mac_cell_group_config->TAG_Config; + if(mac_cell_group_configP->tag_Config != NULL ){ + mac->tag_Config = mac_cell_group_configP->tag_Config; } - if(mac_cell_group_config->phr_Config != (phr_Config_t *)0 ){ - mac->phr_Config = mac_cell_group_config->phr_Config; + if(mac_cell_group_configP->phr_Config != NULL ){ + mac->phr_Config = mac_cell_group_configP->phr_Config; } - if(mac_cell_group_config->cs_RNTI != (cs_RNTI_t *)0 ){ - mac->cs_RNTI = mac_cell_group_config->cs_RNTI; + if(mac_cell_group_configP->cs_RNTI != NULL ){ + mac->cs_RNTI = mac_cell_group_configP->cs_RNTI; } } - if(phy_cell_group_config != (PhysicalCellGroupConfig_t *)0){ - config_phy(phy_cell_group_config, NULL); + if(phy_cell_group_configP != NULL ){ + //config_phy(phy_cell_group_config, NULL); } - if(serving_cell_config_config != (SpCellConfig_t *)0){ - config_phy(NULL, spcell_config); +// TODO check +#if 0 + if(serving_cell_config_configP != NULL ){ + //config_phy(NULL, spcell_config); mac->servCellIndex = spcell_config->servCellIndex; } - if(serving_cell_config != (spCellConfigDedicated_t *)0){ - if(serving_cell_config->tdd_UL_DL_ConfigurationDedicated != (TDD_UL_DL_ConfigDedicated_t *)0){ + if(serving_cell_config != NULL ){ + if(serving_cell_config->tdd_UL_DL_ConfigurationDedicated != NULL ){ mac->tdd_UL_DL_ConfigurationDedicated = serving_cell_config->tdd_UL_DL_ConfigurationDedicated; } - if(spcell_config->initialDownlinkBWP != (BWP_DownlinkDedicated_t *)0){ + if(spcell_config->initialDownlinkBWP != NULL ){ mac->init_DL_BWP = spcell_config->initialDownlinkBWP; } // storage list of DL BWP config. TODO should be modify to maintain(add/release) a list inside MAC instance, this implementation just use for one-shot RRC configuration setting. - if(spcell_config->downlinkBWP_ToAddModList != (struct ServingCellConfig__downlinkBWP_ToAddModList *)0){ + if(spcell_config->downlinkBWP_ToAddModList != NULL ){ mac->BWP_Downlink_list = spcell_config->downlinkBWP_ToAddModList->list; mac->BWP_Downlink_count = spcell_config->downlinkBWP_ToAddModList->count; } - if(spcell_config->bwp_InactivityTimer != (long *)0){ + if(spcell_config->bwp_InactivityTimer != NULL ){ mac->bwp_InactivityTimer = spcell_config->bwp_InactivityTimer; } - if(spcell_config->defaultDownlinkBWP_Id != (BWP_Id_t *)0){ + if(spcell_config->defaultDownlinkBWP_Id != NULL ){ mac->defaultDownlinkBWP_Id = spcell_config->defaultDownlinkBWP_Id; } - if(spcell_config->pdsch_ServingCellConfig != (PDSCH_ServingCellConfig_t *)0){ + if(spcell_config->pdsch_ServingCellConfig != NULL ){ mac->pdsch_ServingCellConfig = spcell_config->pdsch_ServingCellConfig; } - if(spcell_config->csi_MeasConfig != (CSI_MeasConfig_t *)0){ + if(spcell_config->csi_MeasConfig != NULL ){ mac->csi_MeasConfig = spcell_config->csi_MeasConfig; } spcell_config->tag_Id = spcell_config.tag_Id; } - +#endif //scell config not yet - - - - - - - return (0); -} + return 0; +} \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_UE/defs.h b/openair2/LAYER2/NR_MAC_UE/defs.h index e7329616b7..61f83074d3 100644 --- a/openair2/LAYER2/NR_MAC_UE/defs.h +++ b/openair2/LAYER2/NR_MAC_UE/defs.h @@ -34,8 +34,8 @@ /*@}*/ -#ifndef __LAYER2_MAC_DEFS_H__ -#define __LAYER2_MAC_DEFS_H__ +#ifndef __LAYER2_NR_MAC_DEFS_H__ +#define __LAYER2_NR_MAC_DEFS_H__ @@ -43,66 +43,37 @@ #include #include -#include "PHY/defs.h" -#include "PHY/LTE_TRANSPORT/defs.h" -#include "COMMON/platform_constants.h" -#include "BCCH-BCH-Message.h" -#include "RadioResourceConfigCommon.h" -#include "RadioResourceConfigDedicated.h" -#include "MeasGapConfig.h" -#include "SchedulingInfoList.h" -#include "TDD-Config.h" -#include "RACH-ConfigCommon.h" -#include "MeasObjectToAddModList.h" -#include "MobilityControlInfo.h" -#if defined(Rel10) || defined(Rel14) -#include "MBSFN-AreaInfoList-r9.h" -#include "MBSFN-SubframeConfigList.h" -#include "PMCH-InfoList-r9.h" -#include "SCellToAddMod-r10.h" -#endif -#ifdef Rel14 -#include "SystemInformationBlockType1-v1310-IEs.h" -#endif +#include "platform_types.h" -#include "nfapi_interface.h" -#include "PHY_INTERFACE/IF_Module.h" +#include "NR_DRX-Config.h" +#include "NR_SchedulingRequestConfig.h" +#include "NR_BSR-Config.h" +#include "NR_TAG-Config.h" +#include "NR_PHR-Config.h" +#include "NR_RNTI-Value.h" +#include "NR_MIB.h" +#include "NR_MAC-CellGroupConfig.h" +#include "NR_PhysicalCellGroupConfig.h" +#include "NR_SpCellConfig.h" + +#include "NR_ServingCellConfig.h" + +#define NB_NR_UE_MAC_INST 1 /*!\brief Top level UE MAC structure */ typedef struct { //// MAC config - drx_Config_t *drx_config; - SchedulingRequestConfig_t *SchedulingRequestConfig; - BSR_Config_t *BSR_Config; - TAG_Config_t *TAG_Config; - phr_Config_t *phr_Config; - cs_RNTI_t *cs_RNTI; - ServCellIndex_t *servCellIndex; + NR_DRX_Config_t *drx_Config; /* OPTIONAL */ + NR_SchedulingRequestConfig_t *schedulingRequestConfig; /* OPTIONAL */ + NR_BSR_Config_t *bsr_Config; /* OPTIONAL */ + NR_TAG_Config_t *tag_Config; /* OPTIONAL */ + NR_PHR_Config_t *phr_Config; /* OPTIONAL */ + + NR_RNTI_Value_t *cs_RNTI; /* OPTIONAL */ - //// Serving cell config - TDD_UL_DL_ConfigDedicated_t *tdd_UL_DL_ConfigurationDedicated; - // init DL BWP - BWP_DownlinkDedicated_t *init_DL_BWP; - // DL BWP list, not default one - BWP_Downlink_t **BWP_Downlink_list; - int BWP_Downlink_count; - //BWP_Id_t *firstActiveDownlinkBWP_Id; - long *bwp_InactivityTimer; - BWP_Id_t *defaultDownlinkBWP_Id; - //struct UplinkConfig *uplinkConfig; - //struct UplinkConfig *supplementaryUplink; - PDSCH_ServingCellConfig_t *pdsch_ServingCellConfig; - CSI_MeasConfig_t *csi_MeasConfig; - //SRS_CarrierSwitching_t *carrierSwitching; - //long *sCellDeactivationTimer /* OPTIONAL */; - //struct CrossCarrierSchedulingConfig *crossCarrierSchedulingConfig /* OPTIONAL */; - TAG_Id_t tag_Id; - //long *ue_BeamLockFunction /* OPTIONAL */; - //long *pathlossReferenceLinking /* OPTIONAL */; +} NR_UE_MAC_INST_t; -} UE_MAC_INST; -#include "proto.h" /*@}*/ #endif /*__LAYER2_MAC_DEFS_H__ */ diff --git a/openair2/LAYER2/NR_MAC_UE/mac.h b/openair2/LAYER2/NR_MAC_UE/mac.h new file mode 100644 index 0000000000..253c855da8 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_UE/mac.h @@ -0,0 +1,92 @@ +/* + * 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 + */ + +/*! \file LAYER2/MAC/defs.h +* \brief MAC data structures, constant, and function prototype +* \author Navid Nikaein and Raymond Knopp +* \date 2011 +* \version 0.5 +* \email navid.nikaein@eurecom.fr + +*/ +/** @defgroup _oai2 openair2 Reference Implementation + * @ingroup _ref_implementation_ + * @{ + */ + +/*@}*/ + +#ifndef __LAYER2_MAC_DEFS_H__ +#define __LAYER2_MAC_DEFS_H__ + + + +#include +#include +#include + +#include "COMMON/platform_constants.h" +#include "BCCH-BCH-Message.h" +#include "RadioResourceConfigCommon.h" +#include "RadioResourceConfigCommonSIB.h" +#include "RadioResourceConfigDedicated.h" +#include "MeasGapConfig.h" +#include "SchedulingInfoList.h" +#include "TDD-Config.h" +#include "RACH-ConfigCommon.h" +#include "MeasObjectToAddModList.h" +#include "MobilityControlInfo.h" +#if defined(Rel10) || defined(Rel14) +#include "MBSFN-AreaInfoList-r9.h" +#include "MBSFN-SubframeConfigList.h" +#include "PMCH-InfoList-r9.h" +#include "SCellToAddMod-r10.h" +#endif +#ifdef Rel14 +#include "SystemInformationBlockType1-v1310-IEs.h" +#endif + +#include "nfapi_interface.h" +#include "PHY_INTERFACE/IF_Module.h" + +#include "PHY/TOOLS/time_meas.h" + +#include "PHY/defs_common.h" // for PRACH_RESOURCES_t + +#include "targets/ARCH/COMMON/common_lib.h" + +//solve implicit declaration +#include "PHY/LTE_ESTIMATION/lte_estimation.h" +#include "PHY/LTE_TRANSPORT/transport_proto.h" +#include "PHY/LTE_TRANSPORT/transport_common_proto.h" + +/** @defgroup _mac MAC + * @ingroup _oai2 + * @{ + */ + +/*!\brief Values of BCCH logical channel (fake)*/ +#define NR_BCCH_DL_SCH 3 // SI + +/*!\brief Values of PCCH logical channel (fake) */ +#define NR_BCCH_BCH 5 // MIB +/*@}*/ +#endif /*__LAYER2_MAC_DEFS_H__ */ diff --git a/openair2/LAYER2/NR_MAC_UE/vars.c b/openair2/LAYER2/NR_MAC_UE/mac_vars.c similarity index 94% rename from openair2/LAYER2/NR_MAC_UE/vars.c rename to openair2/LAYER2/NR_MAC_UE/mac_vars.c index 300917b3c1..4ce77e2b93 100644 --- a/openair2/LAYER2/NR_MAC_UE/vars.c +++ b/openair2/LAYER2/NR_MAC_UE/mac_vars.c @@ -29,6 +29,8 @@ */ -UE_MAC_INST_t UE_mac_inst; //[NB_MODULE_MAX]; +#include "defs.h" + +NR_UE_MAC_INST_t UE_mac_inst; //[NB_MODULE_MAX]; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index a1c3688fc4..8a4bdecd7a 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -31,17 +31,15 @@ #include "defs.h" #include "proto.h" -#include "extern.h" -#include "assertions.h" static NR_UE_MAC_INST_t *nr_ue_mac_inst; int nr_l2_init_ue(void) { - LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n"); + //LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n"); - LOG_I(MAC, "[MAIN] init UE MAC functions \n"); + //LOG_I(MAC, "[MAIN] init UE MAC functions \n"); //init mac here nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST); @@ -50,6 +48,6 @@ nr_l2_init_ue(void) return (1); } -NR_UE_MAC_INST_t *get_mac_inst(Module_id_t Mod_idP){ +NR_UE_MAC_INST_t *get_mac_inst(module_id_t Mod_idP){ return &nr_ue_mac_inst[(int)Mod_idP]; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c new file mode 100644 index 0000000000..23b586e914 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -0,0 +1,49 @@ +/* + * 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 + */ + +/*! \file ue_procedures.c + * \brief procedures related to UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \version 1 + * \email: navid.nikaein@eurecom.fr + * @ingroup _mac + + */ +#include "proto.h" +#include "RRC/NR_UE/rrc_proto.h" + +void +nr_ue_decode_mib( + module_id_t module_id, + int CC_id, + uint8_t gNB_index, + uint8_t extra_bits, + uint32_t ssb_index, + uint32_t *frameP, + void *pduP, + uint16_t pdu_len){ + + nr_mac_rrc_data_ind_ue( module_id, CC_id, gNB_index, frameP, + NR_BCCH_BCH, (uint8_t *) pduP, pdu_len ); + + // frame calculation +} diff --git a/openair2/LAYER2/NR_MAC_UE/proto.h b/openair2/LAYER2/NR_MAC_UE/proto.h new file mode 100644 index 0000000000..1545ca9e7d --- /dev/null +++ b/openair2/LAYER2/NR_MAC_UE/proto.h @@ -0,0 +1,61 @@ +/* + * 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 + */ + +/*! \file LAYER2/MAC/proto.h + * \brief MAC functions prototypes for eNB and UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email navid.nikaein@eurecom.fr + * \version 1.0 + */ +#ifndef __LAYER2_MAC_PROTO_H__ +#define __LAYER2_MAC_PROTO_H__ + +#include "defs.h" + +/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param extra_bits extra bits for frame calculation + \param ssb_index SSB index for frame calculation + \param frameP pointer to frame for revising after frame calculation + \param pduP pointer to pdu + \param pdu_length length of pdu*/ +void nr_ue_decode_mib(module_id_t module_id, int CC_id, uint8_t gNB_index, uint8_t extra_bits, uint32_t ssb_index, uint32_t *frameP, void *pduP, uint16_t pdu_len); + + +/**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config) + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param mibP pointer to RRC message MIB + \param mac_cell_group_configP pointer to RRC message MAC-related in cell group config + \param phy_cell_group_configP pointer to RRC message PHY-related in cell group config + \param spcell_configP pointer to RRC message serving cell config*/ +int nr_rrc_mac_config_req_ue( module_id_t module_id, int CC_id, uint8_t gNB_index, NR_MIB_t *mibP, NR_MAC_CellGroupConfig_t *mac_cell_group_configP, NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, NR_SpCellConfig_t *spcell_configP ); + +int nr_l2_init_ue(void); + +NR_UE_MAC_INST_t *get_mac_inst(module_id_t Mod_idP); + +#endif +/** @}*/ diff --git a/openair2/LAYER2/NR_MAC_UE/vars.h b/openair2/LAYER2/NR_MAC_UE/vars.h deleted file mode 100644 index 56a4ccba9d..0000000000 --- a/openair2/LAYER2/NR_MAC_UE/vars.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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 - */ - -/*! \file vars.h -* \brief mac vars -* \author Navid Nikaein and Raymond Knopp -* \date 2010 - 2014 -* \version 1.0 -* \email navid.nikaein@eurecom.fr -* @ingroup _mac - -*/ - - -#ifndef __MAC_VARS_H__ -#define __MAC_VARS_H__ -#ifdef USER_MODE -//#include "stdio.h" -#endif //USER_MODE -#include "PHY/defs.h" -#include "defs.h" -#include "PHY_INTERFACE/defs.h" -#include "COMMON/mac_rrc_primitives.h" - -const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57,67,78,91, - 105,125,146,171,200,234,274,321,376,440,515,603,706,826,967,1132, - 1326,1552,1817,2127,2490,2915,3413,3995,4677,5467,6411,7505,8787,10287,12043,14099, - 16507,19325,22624,26487,31009,36304,42502,49759,58255,68201,79846,93479,109439, 128125,150000, 300000 - }; -// extended bsr table--currently not used -const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = {0,10,13,16,19,23,29,35,43,53,65,80,98,120,147, - 181,223,274,337,414,509,625,769,945,1162,1429, - 1757,2161,2657,3267,4017,4940,6074,7469,9185, - 11294,13888,17077,20999,25822,31752,39045,48012, - 59039,72598,89272,109774,134986,165989,204111, - 250990,308634,379519,466683,573866,705666,867737, - 1067031,1312097,1613447,1984009,2439678,3000000, - 6000000}; - -//#define MAX_SIZE_OF_AGG3 576 -//#define MAX_SIZE_OF_AGG2 288 -//#define MAX_SIZE_OF_AGG1 144 -//#define MAX_SIZE_OF_AGG0 72 - -/* - * If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise - * this is also dependent to transmission mode, where an offset could be defined - */ -// the follwoing three tables are calibrated for TXMODE 1 and 2 -const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= { - {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits - //{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 - {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 - {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43 - {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44 -}; -const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= { - {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits - {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43 - {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47 - {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55 -}; -const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= { - {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits - {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55 - {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59 - {3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64 -}; - -//uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181}; - -MAC_xface *mac_xface; - -uint32_t RRC_CONNECTION_FLAG; - -UE_MAC_INST *UE_mac_inst; //[NB_MODULE_MAX]; -eNB_MAC_INST *eNB_mac_inst; //[NB_MODULE_MAX]; -MAC_RLC_XFACE *Mac_rlc_xface; - -/// Primary component carrier index of eNB -int pCC_id[NUMBER_OF_eNB_MAX]; - - - -eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8 -eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8 - -/* -#ifndef USER_MODE -RRC_XFACE *Rrc_xface; -MAC_xface *mac_xface; -#else -#include "PHY_INTERFACE/extern.h" -#include "RRC/LITE/extern.h" -#endif -*/ - -uint8_t Is_rrc_registered; - -#ifdef OPENAIR2 -unsigned char NB_eNB_INST=0; -unsigned char NB_UE_INST=0; -unsigned char NB_RN_INST=0; -unsigned char NB_INST=0; -#endif - - -DCI0_5MHz_TDD_1_6_t UL_alloc_pdu; - -DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A; -DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu; -DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu; - -DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu; -DCI1_5MHz_TDD_t DLSCH_alloc_pdu; - -#if defined(Rel10) || defined(Rel14) -DCI1C_5MHz_t MCCH_alloc_pdu; -#endif - -DCI0_5MHz_FDD_t UL_alloc_pdu_fdd; - -DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd; -DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd; -DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd; - -DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd; -DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd; - -DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1; -DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2; - -DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E; - -#endif - - diff --git a/openair2/RRC/NR_UE/L2_interface_ue.c b/openair2/RRC/NR_UE/L2_interface_ue.c new file mode 100644 index 0000000000..2c51fe4c6c --- /dev/null +++ b/openair2/RRC/NR_UE/L2_interface_ue.c @@ -0,0 +1,57 @@ +/* + * 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 + */ + +/*! \file l2_interface.c + * \brief layer 2 interface, used to support different RRC sublayer + * \author Raymond Knopp and Navid Nikaein + * \date 2010-2014 + * \version 1.0 + * \company Eurecom + * \email: raymond.knopp@eurecom.fr + */ + +#include "rrc_defs.h" +#include "rrc_proto.h" + +typedef uint32_t channel_t; + +int8_t +nr_mac_rrc_data_ind_ue( + const module_id_t module_id, + const int CC_id, + const uint8_t gNB_index, + const uint32_t* frameP, + const channel_t channel, + const uint8_t* pduP, + const sdu_size_t pdu_len){ + + switch(channel){ + case NR_BCCH_BCH: + nr_rrc_ue_decode_NR_BCCH_BCH_Message( module_id, gNB_index, (uint8_t*)pduP, pdu_len); + break; + default: + break; + } + + + return(0); + +} \ No newline at end of file diff --git a/openair2/RRC/NR_UE/defs.h b/openair2/RRC/NR_UE/defs.h deleted file mode 100644 index 37db3a9f02..0000000000 --- a/openair2/RRC/NR_UE/defs.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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 - */ - -/*! \file RRC/LITE/defs.h -* \brief RRC struct definitions and function prototypes -* \author Navid Nikaein and Raymond Knopp -* \date 2010 - 2014 -* \version 1.0 -* \company Eurecom -* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr -*/ - -#ifndef __OPENAIR_NR_RRC_DEFS_H__ -#define __OPENAIR_NR_RRC_DEFS_H__ - -#include -#include -#include - -#include "collection/tree.h" -#include "rrc_types.h" -#include "PHY/defs.h" -#include "LAYER2/RLC/rlc.h" - -#include "COMMON/platform_constants.h" -#include "COMMON/platform_types.h" - -#include "LAYER2/MAC/defs.h" - -#include "SystemInformationBlockType1.h" -#include "SystemInformation.h" -#include "RRCConnectionReconfiguration.h" -#include "RRCConnectionReconfigurationComplete.h" -#include "RRCConnectionSetup.h" -#include "RRCConnectionSetupComplete.h" -#include "RRCConnectionRequest.h" -#include "RRCConnectionReestablishmentRequest.h" -#include "BCCH-DL-SCH-Message.h" -#include "BCCH-BCH-Message.h" -#if defined(Rel10) || defined(Rel14) -#include "MCCH-Message.h" -#include "MBSFNAreaConfiguration-r9.h" -#include "SCellToAddMod-r10.h" -#endif -#include "AS-Config.h" -#include "AS-Context.h" -#include "UE-EUTRA-Capability.h" -#include "MeasResults.h" - -/* for ImsiMobileIdentity_t */ -#include "MobileIdentity.h" - - -typedef struct NR_UE_RRC_INST_s { - nr_rrc_state_t rrc_state; - nr_rrc_sub_state_t rrc_sub_state; -#if 0 - OAI_UECapability_t *UECap; - uint8_t *UECapability; - uint8_t UECapability_size; - UE_RRC_INFO Info[NB_SIG_CNX_UE]; - SRB_INFO Srb0[NB_SIG_CNX_UE]; - SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; - SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; - HANDOVER_INFO_UE HandoverInfoUe; - uint8_t *SIB1[NB_CNX_UE]; - uint8_t sizeof_SIB1[NB_CNX_UE]; - uint8_t *SI[NB_CNX_UE]; - uint8_t sizeof_SI[NB_CNX_UE]; - uint8_t SIB1Status[NB_CNX_UE]; - uint8_t SIStatus[NB_CNX_UE]; - SystemInformationBlockType1_t *sib1[NB_CNX_UE]; - SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI(). - SystemInformationBlockType2_t *sib2[NB_CNX_UE]; - SystemInformationBlockType3_t *sib3[NB_CNX_UE]; - SystemInformationBlockType4_t *sib4[NB_CNX_UE]; - SystemInformationBlockType5_t *sib5[NB_CNX_UE]; - SystemInformationBlockType6_t *sib6[NB_CNX_UE]; - SystemInformationBlockType7_t *sib7[NB_CNX_UE]; - SystemInformationBlockType8_t *sib8[NB_CNX_UE]; - SystemInformationBlockType9_t *sib9[NB_CNX_UE]; - SystemInformationBlockType10_t *sib10[NB_CNX_UE]; - SystemInformationBlockType11_t *sib11[NB_CNX_UE]; - -#if defined(Rel10) || defined(Rel14) - uint8_t MBMS_flag; - uint8_t *MCCH_MESSAGE[NB_CNX_UE]; - uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE]; - uint8_t MCCH_MESSAGEStatus[NB_CNX_UE]; - MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE]; - SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE]; - SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE]; -#endif -#ifdef CBA - uint8_t num_active_cba_groups; - uint16_t cba_rnti[NUM_MAX_CBA_GROUP]; -#endif - uint8_t num_srb; - struct SRB_ToAddMod *SRB1_config[NB_CNX_UE]; - struct SRB_ToAddMod *SRB2_config[NB_CNX_UE]; - struct DRB_ToAddMod *DRB_config[NB_CNX_UE][8]; - rb_id_t *defaultDRB; // remember the ID of the default DRB - MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ]; - struct ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG]; - struct QuantityConfig *QuantityConfig[NB_CNX_UE]; - struct MeasIdToAddMod *MeasId[NB_CNX_UE][MAX_MEAS_ID]; - MEAS_REPORT_LIST *measReportList[NB_CNX_UE][MAX_MEAS_ID]; - uint32_t measTimer[NB_CNX_UE][MAX_MEAS_ID][6]; // 6 neighboring cells - RSRP_Range_t s_measure; - struct MeasConfig__speedStatePars *speedStatePars; - struct PhysicalConfigDedicated *physicalConfigDedicated[NB_CNX_UE]; - struct SPS_Config *sps_Config[NB_CNX_UE]; - MAC_MainConfig_t *mac_MainConfig[NB_CNX_UE]; - MeasGapConfig_t *measGapConfig[NB_CNX_UE]; - double filter_coeff_rsrp; // [7] ??? - double filter_coeff_rsrq; // [7] ??? - float rsrp_db[7]; - float rsrq_db[7]; - float rsrp_db_filtered[7]; - float rsrq_db_filtered[7]; -#if defined(ENABLE_SECURITY) - /* KeNB as computed from parameters within USIM card */ - uint8_t kenb[32]; - uint8_t nh[32]; - int8_t nh_ncc; -#endif - - /* Used integrity/ciphering algorithms */ - CipheringAlgorithm_r12_t ciphering_algorithm; - e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm; -#endif - - MeasConfig_t *meas_config; - CellGroupConfig_t *cell_group_config; - RadioBearerConfig_t *radio_bearer_config; - -} NR_UE_RRC_INST_t; - -#include "proto.h" - -#endif -/** @} */ diff --git a/openair2/RRC/NR_UE/main_ue.c b/openair2/RRC/NR_UE/main_ue.c index 814e68717e..bbb3c0a64e 100644 --- a/openair2/RRC/NR_UE/main_ue.c +++ b/openair2/RRC/NR_UE/main_ue.c @@ -1,13 +1,7 @@ #include "defs.h" -#include "proto.h" -#include "extern.h" -#include "assertions.h" - - - - +#include "rrc_proto.h" int nr_l3_init_ue(void){ LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); diff --git a/openair2/RRC/NR_UE/proto.h b/openair2/RRC/NR_UE/proto.h deleted file mode 100644 index 6e876297f6..0000000000 --- a/openair2/RRC/NR_UE/proto.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 - */ - -/*! \file proto.h - * \brief RRC functions prototypes for eNB and UE - * \author Navid Nikaein and Raymond Knopp - * \date 2010 - 2014 - * \email navid.nikaein@eurecom.fr - * \version 1.0 - - */ -/** \addtogroup _rrc - * @{ - */ - -#include "defs.h" - -// -// main_rrc.c -// -/**\brief Layer 3 initialization*/ -int nr_l3_init_ue(void); - -// -// UE_rrc.c -// - -/**\brief Initial the top level RRC structure instance*/ -uint8_t openair_rrc_top_init_ue_nr(void); - -/**\brief Decode DCCH from gNB, sent from lower layer through SRB3 - \param buffer encoded DCCH bytes stream message - \param size length of buffer*/ -int8_t nr_rrc_ue_decode_dcch(const uint8_t *buffer, const uint32_t size); - -/**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config - \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. - \param size length of buffer*/ -//TODO check to use which one -int8_t nr_rrc_ue_decode_rrcReconfiguration(const uint8_t *buffer, const uint32_t size); -int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const uint8_t *buffer, const uint32_t size); - - -/**\brief Process NR RRC connection reconfiguration via SRB3 - \param rrcReconfiguration decoded rrc connection reconfiguration*/ -int8_t nr_rrc_ue_process_rrcReconfiguration(RRCReconfiguration_t *rrcReconfiguration); - -/**\prief Process measurement config from NR RRC connection reconfiguration message - \param meas_config measurement configuration*/ -int8_t nr_rrc_ue_process_meas_config(MeasConfig_t *meas_config); - -/**\prief Process secondary cell group config from NR RRC connection reconfiguration message or EN-DC primitives - \param cell_group_config secondary cell group configuration*/ -//TODO check EN-DC function call flow. -int8_t nr_rrc_ue_process_scg_config(CellGroupConfig_t *cell_group_config); - -/**\prief Process radio bearer config from NR RRC connection reconfiguration message - \param radio_bearer_config radio bearer configuration*/ -int8_t nr_rrc_ue_process_radio_bearer_config(RadioBearerConfig_t *radio_bearer_config); - -/** @}*/ diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 6e5bb3227c..a7d420ebfe 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -31,216 +31,159 @@ #define RRC_UE #define RRC_UE_C - -// header files for RRC message for NR might be change to add prefix in from of the file name. -#include "assertions.h" -#include "hashtable.h" -#include "asn1_conversions.h" -#include "defs.h" -#include "PHY/TOOLS/dB_routines.h" -#include "extern.h" -#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" -#include "LAYER2/RLC/rlc.h" -#include "COMMON/mac_rrc_primitives.h" -#include "UTIL/LOG/log.h" -#include "UTIL/LOG/vcd_signal_dumper.h" -#ifndef CELLULAR -#include "RRC/LITE/MESSAGES/asn1_msg.h" -#endif -#include "RRCConnectionRequest.h" -#include "RRCConnectionReconfiguration.h" -#include "UL-CCCH-Message.h" -#include "DL-CCCH-Message.h" -#include "UL-DCCH-Message.h" -#include "DL-DCCH-Message.h" -#include "BCCH-DL-SCH-Message.h" -#include "PCCH-Message.h" -#if defined(Rel10) || defined(Rel14) -#include "MCCH-Message.h" -#endif -#include "MeasConfig.h" -#include "MeasGapConfig.h" -#include "MeasObjectEUTRA.h" -#include "TDD-Config.h" -#include "UECapabilityEnquiry.h" -#include "UE-CapabilityRequest.h" -#include "RRC/NAS/nas_config.h" -#include "RRC/NAS/rb_config.h" -#if ENABLE_RAL -#include "rrc_UE_ral.h" -#endif - -#if defined(ENABLE_SECURITY) -# include "UTIL/OSA/osa_defs.h" -#endif - - -#if defined(ENABLE_ITTI) -#include "intertask_interface.h" -#endif - - - -// from NR SRB3 -uint8_t nr_rrc_ue_decode_dcch( - const uint8_t *buffer, - const uint32_t size -){ - // uper_decode by nr R15 rrc_connection_reconfiguration - - NR_RRC_DL_DCCH_Message_t *nr_dl_dcch_msg = (NR_RRC_DL_DCCH_Message_t *)0; - - uper_decode(NULL, - &asn_DEF_NR_RRC_DL_DCCH_Message, //might be added prefix later - (void**)&nr_dl_dcch_msg, - (uint8_t *)buffer, - size, 0, 0); - - if(nr_dl_dcch_msg != NULL){ - switch(nr_dl_dcch_msg->message.present){ - case DL_DCCH_MessageType_PR_c1: - - switch(nr_dl_dcch_msg->message.choice.c1.present){ - case DL_DCCH_MessageType__c1_PR_rrcReconfiguration: - nr_rrc_ue_process_rrcReconfiguration(&nr_dl_dcch_msg->message.choice.c1.choice.rrcReconfiguration); - break; - - case DL_DCCH_MessageType__c1_PR_NOTHING: - case DL_DCCH_MessageType__c1_PR_spare15: - case DL_DCCH_MessageType__c1_PR_spare14: - case DL_DCCH_MessageType__c1_PR_spare13: - case DL_DCCH_MessageType__c1_PR_spare12: - case DL_DCCH_MessageType__c1_PR_spare11: - case DL_DCCH_MessageType__c1_PR_spare10: - case DL_DCCH_MessageType__c1_PR_spare9: - case DL_DCCH_MessageType__c1_PR_spare8: - case DL_DCCH_MessageType__c1_PR_spare7: - case DL_DCCH_MessageType__c1_PR_spare6: - case DL_DCCH_MessageType__c1_PR_spare5: - case DL_DCCH_MessageType__c1_PR_spare4: - case DL_DCCH_MessageType__c1_PR_spare3: - case DL_DCCH_MessageType__c1_PR_spare2: - case DL_DCCH_MessageType__c1_PR_spare1: - default: - // not support or unuse - break; - } - break; - case DL_DCCH_MessageType_PR_NOTHING: - case DL_DCCH_MessageType_PR_messageClassExtension: - default: - // not support or unuse - break; - } - - // release memory allocation - free(nr_dl_dcch_msg); - }else{ - // log.. - } - - return 0; - -} +#include "rrc_list.h" +#include "rrc_defs.h" +#include "rrc_proto.h" +#include "rrc_vars.h" +#include "LAYER2/NR_MAC_UE/proto.h" // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded) -uint8_t nr_rrc_ue_decode_secondary_cellgroup_config( +int8_t nr_rrc_ue_decode_secondary_cellgroup_config( const uint8_t *buffer, const uint32_t size ){ - CellGroupConfig_t *cellGroupConfig = (CellGroupConfig_t *)0; + NR_CellGroupConfig_t *cellGroupConfig = NULL; uper_decode(NULL, - &asn_DEF_CellGroupConfig, //might be added prefix later + &asn_DEF_NR_CellGroupConfig, //might be added prefix later (void **)&cellGroupConfig, (uint8_t *)buffer, size, 0, 0); - if(NR_UE_rrc_inst->cell_group_config == (CellGroupConfig_t *)0){ + if(NR_UE_rrc_inst->cell_group_config == NULL){ NR_UE_rrc_inst->cell_group_config = cellGroupConfig; nr_rrc_ue_process_scg_config(cellGroupConfig); }else{ nr_rrc_ue_process_scg_config(cellGroupConfig); - asn_DEF_CellGroupConfig.free_struct(asn_DEF_CellGroupConfig, cellGroupConfig, 0); + //asn_DEF_NR_CellGroupConfig.free_struct(asn_DEF_NR_CellGroupConfig, cellGroupConfig, 0); + SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cellGroupConfig, 0); } - nr_rrc_mac_config_req_ue(); + //nr_rrc_mac_config_req_ue( module_id_t module_id, int CC_id, uint8_t gNB_index, NR_MIB_t *mibP, NR_MAC_CellGroupConfig_t *mac_cell_group_configP, NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, NR_SpCellConfig_t *spcell_configP ); + + return 0; } // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (decoded) // RRCReconfiguration -uint8_t nr_rrc_ue_process_rrcReconfiguration(RRCReconfiguration_t *rrcReconfiguration){ +int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfiguration){ - switch(rrcReconfiguration.criticalExtensions.present){ - case RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration: - if(rrcReconfiguration.criticalExtensions.rrcReconfiguration->radioBearerConfig != (RadioBearerConfig_t *)0){ - if(NR_UE_rrc_inst->radio_bearer_config == (RadioBearerConfig_t *)0){ - NR_UE_rrc_inst->radio_bearer_config = rrcReconfiguration->radioBearerConfig; + switch(rrcReconfiguration->criticalExtensions.present){ + case NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration: + if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.radioBearerConfig != NULL){ + if(NR_UE_rrc_inst->radio_bearer_config == NULL){ + NR_UE_rrc_inst->radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.radioBearerConfig; }else{ - nr_rrc_ue_process_radio_bearer_config(rrcReconfiguration->radioBearerConfig); + nr_rrc_ue_process_radio_bearer_config(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.radioBearerConfig); } } - if(rrcReconfiguration.criticalExtensions.rrcReconfiguration->secondaryCellGroup != (OCTET_STRING_t *)0){ - CellGroupConfig_t *cellGroupConfig = (CellGroupConfig_t *)0; + if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.secondaryCellGroup != NULL){ + NR_CellGroupConfig_t *cellGroupConfig = NULL; uper_decode(NULL, - &asn_DEF_CellGroupConfig, //might be added prefix later + &asn_DEF_NR_CellGroupConfig, //might be added prefix later (void **)&cellGroupConfig, - (uint8_t *)rrcReconfiguration->secondaryCellGroup->buffer, - rrcReconfiguration->secondaryCellGroup.size, 0, 0); + (uint8_t *)rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.secondaryCellGroup->buf, + rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.secondaryCellGroup->size, 0, 0); - if(NR_UE_rrc_inst->cell_group_config == (CellGroupConfig_t *)0){ + if(NR_UE_rrc_inst->cell_group_config == NULL){ // first time receive the configuration, just use the memory allocated from uper_decoder. TODO this is not good implementation, need to maintain RRC_INST own structure every time. NR_UE_rrc_inst->cell_group_config = cellGroupConfig; nr_rrc_ue_process_scg_config(cellGroupConfig); }else{ // after first time, update it and free the memory after. nr_rrc_ue_process_scg_config(cellGroupConfig); - asn_DEF_CellGroupConfig.free_struct(asn_DEF_CellGroupConfig, cellGroupConfig, 0); + //asn_DEF_NR_CellGroupConfig.free_struct(asn_DEF_NR_CellGroupConfig, cellGroupConfig, 0); + SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cellGroupConfig, 0); } } - if(rrcReconfiguration.criticalExtensions.rrcReconfiguration->measConfig != (MeasConfig *)0){ - if(NR_UE_rrc_inst->meas_config == (MeasConfig_t *)0){ - NR_UE_rrc_inst->meas_config = rrcReconfiguration->measConfig; + if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.measConfig != NULL){ + if(NR_UE_rrc_inst->meas_config == NULL){ + NR_UE_rrc_inst->meas_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.measConfig; }else{ // if some element need to be updated - nr_rrc_ue_process_meas_config(rrcReconfiguration->measConfig); + nr_rrc_ue_process_meas_config(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.measConfig); } } - if(rrcReconfiguration.criticalExtensions.rrcReconfiguration->lateNonCriticalExtension != (OCTET_STRING_t *)0){ + if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.lateNonCriticalExtension != NULL){ // unuse now } - if(rrcReconfiguration.criticalExtensions.rrcReconfiguration->nonCriticalExtension != (RRCReconfiguration_IEs__nonCriticalExtension *)0){ + if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration.nonCriticalExtension != NULL){ // unuse now } break; - case RRCReconfiguration__criticalExtensions_PR_NOTHING: - case RRCReconfiguration__criticalExtensions_PR_criticalExtensionsFuture: + case NR_RRCReconfiguration__criticalExtensions_PR_NOTHING: + case NR_RRCReconfiguration__criticalExtensions_PR_criticalExtensionsFuture: default: break; } - nr_rrc_mac_config_req_ue(); + //nr_rrc_mac_config_req_ue(); + + return 0; } -uint8_t nr_rrc_ue_process_meas_config(MeasConfig_t *meas_config){ +int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ + return 0; } -uint8_t nr_rrc_ue_process_scg_config(CellGroupConfig_t *cell_group_config){ +int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){ + int i; + if(NR_UE_rrc_inst->cell_group_config==NULL){ + // initial list + + if(cell_group_config->spCellConfig != NULL){ + if(cell_group_config->spCellConfig->spCellConfigDedicated != NULL){ + if(cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList != NULL){ + for(i=0; ispCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count; ++i){ + RRC_LIST_MOD_ADD(NR_UE_rrc_inst->BWP_Downlink_list, cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[i], bwp_Id); + } + } + } + } + + }else{ + // maintain list + if(cell_group_config->spCellConfig != NULL){ + if(cell_group_config->spCellConfig->spCellConfigDedicated != NULL){ + // process element of list to be add by RRC message + if(cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList != NULL){ + for(i=0; ispCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count; ++i){ + RRC_LIST_MOD_ADD(NR_UE_rrc_inst->BWP_Downlink_list, cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[i], bwp_Id); + } + } + + + // process element of list to be release by RRC message + if(cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToReleaseList != NULL){ + for(i=0; ispCellConfig->spCellConfigDedicated->downlinkBWP_ToReleaseList->list.count; ++i){ + NR_BWP_Downlink_t *freeP = NULL; + RRC_LIST_MOD_REL(NR_UE_rrc_inst->BWP_Downlink_list, bwp_Id, *cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToReleaseList->list.array[i], freeP); + if(freeP != NULL){ + SEQUENCE_free(&asn_DEF_NR_BWP_Downlink, (void *)freeP, 0); + } + } + } + } + } + } + + return 0; } -uint8_t nr_rrc_ue_process_radio_bearer_config(RadioBearerConfig_t *radio_bearer_config){ +int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config){ + return 0; } -uint8_t openair_rrc_top_init_ue_nr(void){ +int8_t openair_rrc_top_init_ue_nr(void){ if(NB_NR_UE_INST > 0){ NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); @@ -248,29 +191,206 @@ uint8_t openair_rrc_top_init_ue_nr(void){ // fill UE-NR-Capability @ UE-CapabilityRAT-Container here. - + // init RRC lists + RRC_LIST_INIT(NR_UE_rrc_inst->RLC_Bearer_Config_list, NR_maxLC_ID); + RRC_LIST_INIT(NR_UE_rrc_inst->SchedulingRequest_list, NR_maxNrofSR_ConfigPerCellGroup); + RRC_LIST_INIT(NR_UE_rrc_inst->TAG_list, NR_maxNrofTAGs); + RRC_LIST_INIT(NR_UE_rrc_inst->TDD_UL_DL_SlotConfig_list, NR_maxNrofSlots); + RRC_LIST_INIT(NR_UE_rrc_inst->BWP_Downlink_list, NR_maxNrofBWPs); + RRC_LIST_INIT(NR_UE_rrc_inst->ControlResourceSet_list[0], 3); // for init-dl-bwp + RRC_LIST_INIT(NR_UE_rrc_inst->ControlResourceSet_list[1], 3); // for dl-bwp id=0 + RRC_LIST_INIT(NR_UE_rrc_inst->ControlResourceSet_list[2], 3); // for dl-bwp id=1 + RRC_LIST_INIT(NR_UE_rrc_inst->ControlResourceSet_list[3], 3); // for dl-bwp id=2 + RRC_LIST_INIT(NR_UE_rrc_inst->ControlResourceSet_list[4], 3); // for dl-bwp id=3 + RRC_LIST_INIT(NR_UE_rrc_inst->SearchSpace_list[0], 10); + RRC_LIST_INIT(NR_UE_rrc_inst->SearchSpace_list[1], 10); + RRC_LIST_INIT(NR_UE_rrc_inst->SearchSpace_list[2], 10); + RRC_LIST_INIT(NR_UE_rrc_inst->SearchSpace_list[3], 10); + RRC_LIST_INIT(NR_UE_rrc_inst->SearchSpace_list[4], 10); + RRC_LIST_INIT(NR_UE_rrc_inst->SlotFormatCombinationsPerCell_list[0], NR_maxNrofAggregatedCellsPerCellGroup); + RRC_LIST_INIT(NR_UE_rrc_inst->SlotFormatCombinationsPerCell_list[1], NR_maxNrofAggregatedCellsPerCellGroup); + RRC_LIST_INIT(NR_UE_rrc_inst->SlotFormatCombinationsPerCell_list[2], NR_maxNrofAggregatedCellsPerCellGroup); + RRC_LIST_INIT(NR_UE_rrc_inst->SlotFormatCombinationsPerCell_list[3], NR_maxNrofAggregatedCellsPerCellGroup); + RRC_LIST_INIT(NR_UE_rrc_inst->SlotFormatCombinationsPerCell_list[4], NR_maxNrofAggregatedCellsPerCellGroup); + RRC_LIST_INIT(NR_UE_rrc_inst->TCI_State_list[0], NR_maxNrofTCI_States); + RRC_LIST_INIT(NR_UE_rrc_inst->TCI_State_list[1], NR_maxNrofTCI_States); + RRC_LIST_INIT(NR_UE_rrc_inst->TCI_State_list[2], NR_maxNrofTCI_States); + RRC_LIST_INIT(NR_UE_rrc_inst->TCI_State_list[3], NR_maxNrofTCI_States); + RRC_LIST_INIT(NR_UE_rrc_inst->TCI_State_list[4], NR_maxNrofTCI_States); + RRC_LIST_INIT(NR_UE_rrc_inst->RateMatchPattern_list[0], NR_maxNrofRateMatchPatterns); + RRC_LIST_INIT(NR_UE_rrc_inst->RateMatchPattern_list[1], NR_maxNrofRateMatchPatterns); + RRC_LIST_INIT(NR_UE_rrc_inst->RateMatchPattern_list[2], NR_maxNrofRateMatchPatterns); + RRC_LIST_INIT(NR_UE_rrc_inst->RateMatchPattern_list[3], NR_maxNrofRateMatchPatterns); + RRC_LIST_INIT(NR_UE_rrc_inst->RateMatchPattern_list[4], NR_maxNrofRateMatchPatterns); + RRC_LIST_INIT(NR_UE_rrc_inst->ZP_CSI_RS_Resource_list[0], NR_maxNrofZP_CSI_RS_Resources); + RRC_LIST_INIT(NR_UE_rrc_inst->ZP_CSI_RS_Resource_list[1], NR_maxNrofZP_CSI_RS_Resources); + RRC_LIST_INIT(NR_UE_rrc_inst->ZP_CSI_RS_Resource_list[2], NR_maxNrofZP_CSI_RS_Resources); + RRC_LIST_INIT(NR_UE_rrc_inst->ZP_CSI_RS_Resource_list[3], NR_maxNrofZP_CSI_RS_Resources); + RRC_LIST_INIT(NR_UE_rrc_inst->ZP_CSI_RS_Resource_list[4], NR_maxNrofZP_CSI_RS_Resources); + RRC_LIST_INIT(NR_UE_rrc_inst->Aperidic_ZP_CSI_RS_ResourceSet_list[0], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->Aperidic_ZP_CSI_RS_ResourceSet_list[1], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->Aperidic_ZP_CSI_RS_ResourceSet_list[2], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->Aperidic_ZP_CSI_RS_ResourceSet_list[3], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->Aperidic_ZP_CSI_RS_ResourceSet_list[4], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->SP_ZP_CSI_RS_ResourceSet_list[0], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->SP_ZP_CSI_RS_ResourceSet_list[1], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->SP_ZP_CSI_RS_ResourceSet_list[2], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->SP_ZP_CSI_RS_ResourceSet_list[3], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->SP_ZP_CSI_RS_ResourceSet_list[4], NR_maxNrofZP_CSI_RS_Sets); + RRC_LIST_INIT(NR_UE_rrc_inst->NZP_CSI_RS_Resource_list, NR_maxNrofNZP_CSI_RS_Resources); + RRC_LIST_INIT(NR_UE_rrc_inst->NZP_CSI_RS_ResourceSet_list, NR_maxNrofNZP_CSI_RS_ResourceSets); + RRC_LIST_INIT(NR_UE_rrc_inst->CSI_IM_Resource_list, NR_maxNrofCSI_IM_Resources); + RRC_LIST_INIT(NR_UE_rrc_inst->CSI_IM_ResourceSet_list, NR_maxNrofCSI_IM_ResourceSets); + RRC_LIST_INIT(NR_UE_rrc_inst->CSI_SSB_ResourceSet_list, NR_maxNrofCSI_SSB_ResourceSets); + RRC_LIST_INIT(NR_UE_rrc_inst->CSI_ResourceConfig_list, NR_maxNrofCSI_ResourceConfigurations); + RRC_LIST_INIT(NR_UE_rrc_inst->CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); }else{ - NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)0; + NR_UE_rrc_inst = NULL; } + + return 0; } -uint8_t nr_ue_process_rlc_bearer_list(CellGroupConfig_t *cell_group_config){ +int8_t nr_ue_process_rlc_bearer_list(NR_CellGroupConfig_t *cell_group_config){ + return 0; }; -uint8_t nr_ue_process_secondary_cell_list(CellGroupConfig_t *cell_group_config){ +int8_t nr_ue_process_secondary_cell_list(NR_CellGroupConfig_t *cell_group_config){ + return 0; }; -uint8_t nr_ue_process_mac_cell_group_config(MAC_CellGroupConfig_t *mac_cell_group_config){ +int8_t nr_ue_process_mac_cell_group_config(NR_MAC_CellGroupConfig_t *mac_cell_group_config){ + return 0; }; -uint8_t nr_ue_process_physical_cell_group_config(PhysicalCellGroupConfig_t *phy_cell_group_config){ +int8_t nr_ue_process_physical_cell_group_config(NR_PhysicalCellGroupConfig_t *phy_cell_group_config){ + return 0; }; -uint8_t nr_ue_process_spcell_config(SpCellConfig_t *spcell_config){ +int8_t nr_ue_process_spcell_config(NR_SpCellConfig_t *spcell_config){ + return 0; }; + +/*brief decode BCCH-BCH (MIB) message*/ +int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( + const module_id_t module_id, + const uint8_t gNB_index, + uint8_t *const bufferP, + const uint8_t buffer_len){ + int i; + NR_BCCH_BCH_Message_t *bcch_message = NULL; + NR_MIB_t *mib = NR_UE_rrc_inst->mib; + + asn_dec_rval_t dec_rval = uper_decode_complete( NULL, + &asn_DEF_NR_BCCH_BCH_Message, + (void **)&bcch_message, + (const void *)bufferP, + buffer_len ); + + if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) { + LOG_E( RRC, "[UE %"PRIu8"] Failed to decode BCCH_DLSCH_MESSAGE (%zu bits)\n", + module_id, + dec_rval.consumed ); + + for (i=0; imessage.choice.mib, + sizeof(NR_MIB_t) ); + + nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL); + + return 0; +} + + +// from NR SRB3 +int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message( + const module_id_t module_id, + const uint8_t gNB_index, + const uint8_t *bufferP, + const uint32_t buffer_len){ + // uper_decode by nr R15 rrc_connection_reconfiguration + int32_t i; + NR_DL_DCCH_Message_t *nr_dl_dcch_msg = NULL; + + asn_dec_rval_t dec_rval = uper_decode( NULL, + &asn_DEF_NR_DL_DCCH_Message, + (void**)&nr_dl_dcch_msg, + (uint8_t *)bufferP, + buffer_len, 0, 0); + + if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) { + LOG_E( RRC, "[UE %"PRIu8"] Failed to decode NR_DL_DCCH_Message (%zu bits)\n", + module_id, + dec_rval.consumed ); + + for (i=0; imessage.present){ + case NR_DL_DCCH_MessageType_PR_c1: + + switch(nr_dl_dcch_msg->message.choice.c1.present){ + case NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration: + nr_rrc_ue_process_rrcReconfiguration(&nr_dl_dcch_msg->message.choice.c1.choice.rrcReconfiguration); + break; + + case NR_DL_DCCH_MessageType__c1_PR_NOTHING: + case NR_DL_DCCH_MessageType__c1_PR_spare15: + case NR_DL_DCCH_MessageType__c1_PR_spare14: + case NR_DL_DCCH_MessageType__c1_PR_spare13: + case NR_DL_DCCH_MessageType__c1_PR_spare12: + case NR_DL_DCCH_MessageType__c1_PR_spare11: + case NR_DL_DCCH_MessageType__c1_PR_spare10: + case NR_DL_DCCH_MessageType__c1_PR_spare9: + case NR_DL_DCCH_MessageType__c1_PR_spare8: + case NR_DL_DCCH_MessageType__c1_PR_spare7: + case NR_DL_DCCH_MessageType__c1_PR_spare6: + case NR_DL_DCCH_MessageType__c1_PR_spare5: + case NR_DL_DCCH_MessageType__c1_PR_spare4: + case NR_DL_DCCH_MessageType__c1_PR_spare3: + case NR_DL_DCCH_MessageType__c1_PR_spare2: + case NR_DL_DCCH_MessageType__c1_PR_spare1: + default: + // not support or unuse + break; + } + break; + case NR_DL_DCCH_MessageType_PR_NOTHING: + case NR_DL_DCCH_MessageType_PR_messageClassExtension: + default: + // not support or unuse + break; + } + + // release memory allocation + SEQUENCE_free( &asn_DEF_NR_DL_DCCH_Message, (void *)nr_dl_dcch_msg, 1 ); + }else{ + // log.. + } + + return 0; + +} diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h new file mode 100644 index 0000000000..b999d88fe9 --- /dev/null +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -0,0 +1,116 @@ +/* + * 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 + */ + +/*! \file RRC/LITE/defs.h +* \brief RRC struct definitions and function prototypes +* \author Navid Nikaein and Raymond Knopp +* \date 2010 - 2014 +* \version 1.0 +* \company Eurecom +* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr +*/ + +#ifndef __OPENAIR_NR_RRC_DEFS_H__ +#define __OPENAIR_NR_RRC_DEFS_H__ + +#include +#include +#include + +#include "platform_types.h" + +#include "LAYER2/NR_MAC_UE/mac.h" +#include "rrc_list.h" +#include "NR_asn_constant.h" +#include "NR_MeasConfig.h" +#include "NR_CellGroupConfig.h" +#include "NR_RadioBearerConfig.h" +#include "NR_RLC-Bearer-Config.h" +#include "asn1_constants.h" +#include "NR_SchedulingRequestToAddMod.h" +#include "NR_MIB.h" +#include "NR_BCCH-BCH-Message.h" +#include "NR_DL-DCCH-Message.h" + +#define NB_NR_UE_INST 1 + +typedef uint32_t channel_t; + +typedef struct NR_UE_RRC_INST_s { + + NR_MeasConfig_t *meas_config; + NR_CellGroupConfig_t *cell_group_config; + NR_RadioBearerConfig_t *radio_bearer_config; + + NR_MIB_t *mib; + + // lists + // CellGroupConfig.rlc-BearerToAddModList + RRC_LIST_TYPE(NR_RLC_Bearer_Config_t, NR_maxLC_ID) RLC_Bearer_Config_list; + // CellGroupConfig.mac-CellGroupConfig.schedulingrequest + RRC_LIST_TYPE(NR_SchedulingRequestToAddMod_t, NR_maxNrofSR_ConfigPerCellGroup) SchedulingRequest_list; + // CellGroupConfig.mac-CellGroupConfig.TAG + RRC_LIST_TYPE(NR_TAG_ToAddMod_t, NR_maxNrofTAGs) TAG_list; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.tdduldlslotconfig + RRC_LIST_TYPE(NR_TDD_UL_DL_SlotConfig_t, NR_maxNrofSlots) TDD_UL_DL_SlotConfig_list; + + // CellGroupConfig.spCellConfig.spCellConfigDedicated.bwps + RRC_LIST_TYPE(NR_BWP_Downlink_t, NR_maxNrofBWPs) BWP_Downlink_list; + //BWP-DownlinkDedicated 0=INIT-DL-BWP, 1..4 for DL-BWPs + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.controlresourceset + RRC_LIST_TYPE(NR_ControlResourceSet_t, 3) ControlResourceSet_list[5]; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.searchspace + RRC_LIST_TYPE(NR_SearchSpace_t, 10) SearchSpace_list[5]; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.slotformatindicator + RRC_LIST_TYPE(NR_SlotFormatCombinationsPerCell_t, NR_maxNrofAggregatedCellsPerCellGroup) SlotFormatCombinationsPerCell_list[5]; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig + RRC_LIST_TYPE(NR_TCI_State_t, NR_maxNrofTCI_States) TCI_State_list[5]; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig + RRC_LIST_TYPE(NR_RateMatchPattern_t, NR_maxNrofRateMatchPatterns) RateMatchPattern_list[5]; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig + RRC_LIST_TYPE(NR_ZP_CSI_RS_Resource_t, NR_maxNrofZP_CSI_RS_Resources) ZP_CSI_RS_Resource_list[5]; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig + RRC_LIST_TYPE(NR_ZP_CSI_RS_ResourceSet_t, NR_maxNrofZP_CSI_RS_Sets) Aperidic_ZP_CSI_RS_ResourceSet_list[5]; + // CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig + RRC_LIST_TYPE(NR_ZP_CSI_RS_ResourceSet_t, NR_maxNrofZP_CSI_RS_Sets) SP_ZP_CSI_RS_ResourceSet_list[5]; + + // TODO check the way to implement mutiple list inside bwps + // uplink bwp also + + // CellGroupConfig.spCellConfig.spCellConfigDedicated + RRC_LIST_TYPE(NR_NZP_CSI_RS_Resource_t, NR_maxNrofNZP_CSI_RS_Resources) NZP_CSI_RS_Resource_list; + // CellGroupConfig.spCellConfig.spCellConfigDedicated + RRC_LIST_TYPE(NR_NZP_CSI_RS_ResourceSet_t, NR_maxNrofNZP_CSI_RS_ResourceSets) NZP_CSI_RS_ResourceSet_list; + // CellGroupConfig.spCellConfig.spCellConfigDedicated + RRC_LIST_TYPE(NR_CSI_IM_Resource_t, NR_maxNrofCSI_IM_Resources) CSI_IM_Resource_list; + // CellGroupConfig.spCellConfig.spCellConfigDedicated + RRC_LIST_TYPE(NR_CSI_IM_ResourceSet_t, NR_maxNrofCSI_IM_ResourceSets) CSI_IM_ResourceSet_list; + // CellGroupConfig.spCellConfig.spCellConfigDedicated + RRC_LIST_TYPE(NR_CSI_SSB_ResourceSet_t, NR_maxNrofCSI_SSB_ResourceSets) CSI_SSB_ResourceSet_list; + // CellGroupConfig.spCellConfig.spCellConfigDedicated + RRC_LIST_TYPE(NR_CSI_ResourceConfig_t, NR_maxNrofCSI_ResourceConfigurations) CSI_ResourceConfig_list; + // CellGroupConfig.spCellConfig.spCellConfigDedicated + RRC_LIST_TYPE(NR_CSI_ReportConfig_t, NR_maxNrofCSI_ReportConfigurations) CSI_ReportConfig_list; + +} NR_UE_RRC_INST_t; + +#endif +/** @} */ diff --git a/openair2/RRC/NR_UE/rrc_list.h b/openair2/RRC/NR_UE/rrc_list.h new file mode 100644 index 0000000000..5bad103dd4 --- /dev/null +++ b/openair2/RRC/NR_UE/rrc_list.h @@ -0,0 +1,82 @@ +#ifndef _RRC_LIST_H_ +#define _RRC_LIST_H_ + + +#define RRC_LIST_TYPE(T, N) \ + struct { \ + T *entries[N]; \ + int next[N]; \ + int prev[N]; \ + int start; \ + int count; \ + } + +// initial function for the certain list, storage number of entry, initial pointer and corresponding links +#define RRC_LIST_INIT(list, c) \ + do { \ + int iterator; \ + (list).count = (c); \ + for(iterator=0; iteratorid_name == (list).entries[iterator]->id_name){ \ + (list).entries[iterator] = (new); \ + break; \ + } \ + } \ + if(iterator==-1){ \ + for(iterator=0; iterator<(list).count; ++iterator){ \ + if((list).entries[iterator] == NULL){ \ + (list).next[iterator] = (list).start; \ + (list).prev[iterator] = -1; \ + if((list).start != -1){ \ + (list).prev[list.start] = iterator; \ + } \ + (list).start = iterator; \ + (list).entries[iterator] = (new); \ + break; \ + } \ + } \ + } \ + }while(0) + +// search entries by id, unlink from the list and output free pointer for upper function to release memory +#define RRC_LIST_MOD_REL(list, id_name, id, free) \ + do{ \ + int iterator; \ + for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \ + if(id == (list).entries[iterator]->id_name){ \ + if((list).prev[iterator] == -1){ \ + (list).start = (list).next[iterator]; \ + }else{ \ + (list).next[(list).prev[iterator]] = (list).next[iterator]; \ + } \ + if((list).next[iterator] != -1){ \ + (list).prev[(list).next[iterator]] = (list).prev[iterator]; \ + } \ + (free) = (list).entries[iterator]; \ + (list).entries[iterator] = NULL; \ + break; \ + } \ + } \ + }while(0) + + +#define RRC_LIST_FOREACH(list, i) \ + for((i)=(list).start; (i) != -1; (i)=(list).next[i]) + +#define RRC_LIST_ENTRY(list, i) \ + list.entries[i] + +#endif \ No newline at end of file diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h new file mode 100644 index 0000000000..e3ff9b0d3d --- /dev/null +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -0,0 +1,107 @@ +/* + * 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 + */ + +/*! \file proto.h + * \brief RRC functions prototypes for eNB and UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email navid.nikaein@eurecom.fr + * \version 1.0 + + */ +/** \addtogroup _rrc + * @{ + */ +#ifndef _RRC_PROTO_H_ +#define _RRC_PROTO_H_ + + +#include "rrc_defs.h" +#include "NR_RRCReconfiguration.h" +#include "NR_MeasConfig.h" +#include "NR_CellGroupConfig.h" +#include "NR_RadioBearerConfig.h" +// +// main_rrc.c +// +/**\brief Layer 3 initialization*/ +int nr_l3_init_ue(void); + +// +// UE_rrc.c +// + +/**\brief Initial the top level RRC structure instance*/ +int8_t openair_rrc_top_init_ue_nr(void); + + + +/**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config + \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. + \param size length of buffer*/ +//TODO check to use which one +int8_t nr_rrc_ue_decode_rrcReconfiguration(const uint8_t *buffer, const uint32_t size); +int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const uint8_t *buffer, const uint32_t size); + + +/**\brief Process NR RRC connection reconfiguration via SRB3 + \param rrcReconfiguration decoded rrc connection reconfiguration*/ +int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfiguration); + +/**\prief Process measurement config from NR RRC connection reconfiguration message + \param meas_config measurement configuration*/ +int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config); + +/**\prief Process secondary cell group config from NR RRC connection reconfiguration message or EN-DC primitives + \param cell_group_config secondary cell group configuration*/ +//TODO check EN-DC function call flow. +int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config); + +/**\prief Process radio bearer config from NR RRC connection reconfiguration message + \param radio_bearer_config radio bearer configuration*/ +int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config); + +/**\brief decode NR BCCH-BCH (MIB) message + \param module_idP module id + \param gNB_index gNB index + \param sduP pointer to buffer of ASN message BCCH-BCH + \param sdu_len length of buffer*/ +int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len); + +/**\brief Decode NR DCCH from gNB, sent from lower layer through SRB3 + \param module_id module id + \param gNB_index gNB index + \param buffer encoded DCCH bytes stream message + \param size length of buffer*/ +int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const uint8_t gNB_index, const uint8_t *buffer, const uint32_t size); + +/**\brief interface between MAC and RRC thru SRB0 (RLC TM/no PDCP) + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param frameP pointer to frame for calculation + \param channel indicator for channel of the pdu + \param pduP pointer to pdu + \param pdu_len data length of pdu*/ +int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const uint32_t *frameP, const channel_t channel, const uint8_t* pduP, const sdu_size_t pdu_len); + +/** @}*/ +#endif \ No newline at end of file diff --git a/openair2/RRC/NR_UE/rrc_types.h b/openair2/RRC/NR_UE/rrc_types.h deleted file mode 100644 index b5540145b0..0000000000 --- a/openair2/RRC/NR_UE/rrc_types.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 - */ - -/*! \file rrc_types.h -* \brief rrc types and subtypes -* \author Navid Nikaein and Raymond Knopp -* \date 2011 - 2014 -* \version 1.0 -* \company Eurecom -* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr -*/ - -#ifndef NR_RRC_TYPES_H_ -#define NR_RRC_TYPES_H_ - -typedef enum nr_rrc_state_e { - //RRC_STATE_INACTIVE=0, - //RRC_STATE_IDLE, - //RRC_STATE_CONNECTED, - - //RRC_STATE_FIRST = RRC_STATE_INACTIVE, - //RRC_STATE_LAST = RRC_STATE_CONNECTED, - RRC_STATE_IDLE = 0, - RRC_STATE_INACTIVE, - RRC_STATE_CONNECTED, - - RRC_STATE_FIRST = RRC_STATE_IDLE, - RRC_STATE_LAST = RRC_STATE_CONNECTED - -} nr_rrc_state_t; - -typedef enum nr_rrc_sub_state_e { - //RRC_SUB_STATE_INACTIVE=0, - - //RRC_SUB_STATE_IDLE_SEARCHING, - //RRC_SUB_STATE_IDLE_RECEIVING_SIB, - //RRC_SUB_STATE_IDLE_SIB_COMPLETE, - //RRC_SUB_STATE_IDLE_CONNECTING, - //RRC_SUB_STATE_IDLE, - - //RRC_SUB_STATE_CONNECTED, - - //RRC_SUB_STATE_INACTIVE_FIRST = RRC_SUB_STATE_INACTIVE, - //RRC_SUB_STATE_INACTIVE_LAST = RRC_SUB_STATE_INACTIVE, - - //RRC_SUB_STATE_IDLE_FIRST = RRC_SUB_STATE_IDLE_SEARCHING, - //RRC_SUB_STATE_IDLE_LAST = RRC_SUB_STATE_IDLE, - - //RRC_SUB_STATE_CONNECTED_FIRST = RRC_SUB_STATE_CONNECTED, - //RRC_SUB_STATE_CONNECTED_LAST = RRC_SUB_STATE_CONNECTED, -} nr_rrc_sub_state_t; - -#endif /* RRC_TYPES_H_ */ diff --git a/openair2/RRC/NR_UE/vars.h b/openair2/RRC/NR_UE/rrc_vars.h similarity index 92% rename from openair2/RRC/NR_UE/vars.h rename to openair2/RRC/NR_UE/rrc_vars.h index f21b49e916..8df7d7174b 100644 --- a/openair2/RRC/NR_UE/vars.h +++ b/openair2/RRC/NR_UE/rrc_vars.h @@ -32,10 +32,8 @@ #ifndef __OPENAIR_NR_RRC_VARS_H__ #define __OPENAIR_NR_RRC_VARS_H__ -#include "defs.h" -#include "LAYER2/RLC/rlc.h" -#include "COMMON/mac_rrc_primitives.h" -#include "LAYER2/MAC/defs.h" +#include "rrc_defs.h" NR_UE_RRC_INST_t *NR_UE_rrc_inst; + #endif diff --git a/openair2/UTIL/OMG/defs.h b/openair2/UTIL/OMG/defs.h index 96700e6e9c..06c9bf6e73 100644 --- a/openair2/UTIL/OMG/defs.h +++ b/openair2/UTIL/OMG/defs.h @@ -36,6 +36,7 @@ //typedef char bool; #include +#include "omg_constants.h" #ifdef STANDALONE typedef struct {