From 284d07c5ae39faf0673752fdea3f7096e643feb3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Jan 2024 13:50:26 +0100 Subject: [PATCH 1/3] nfapi_nr_interface cleanup --- .../nfapi/public_inc/nfapi_nr_interface.h | 515 +----------------- .../nfapi/public_inc/nfapi_nr_interface_scf.h | 8 - openair1/PHY/INIT/nr_init.c | 2 - openair1/PHY/NR_REFSIG/dmrs_nr.c | 14 +- openair1/PHY/NR_REFSIG/nr_dmrs_rx.c | 1 + openair1/PHY/NR_TRANSPORT/nr_dci.h | 1 + openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h | 1 + .../nr_dl_channel_estimation.c | 3 +- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 3 +- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 1 + openair1/SCHED_NR/fapi_nr_l1.h | 1 - openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 - openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 + openair2/LAYER2/NR_MAC_UE/mac_proto.h | 1 + .../NR_MAC_UE/nr_ue_dci_configuration.c | 1 - .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 - openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 6 - openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + openair2/NR_PHY_INTERFACE/NR_IF_Module.h | 1 - 19 files changed, 26 insertions(+), 538 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h index ad6a325848..a6ab614bde 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h @@ -9,19 +9,6 @@ #ifndef _NFAPI_NR_INTERFACE_H_ #define _NFAPI_NR_INTERFACE_H_ -#include "nfapi_interface.h" -#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h" - -#define NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS 5 -#define NFAPI_NR_MAX_NB_TCI_STATES_PDCCH 64 -#define NFAPI_NR_MAX_NB_CORESETS 12 -#define NFAPI_NR_MAX_NB_SEARCH_SPACES 40 - - - -// nFAPI enums - - //These TLVs are used exclusively by nFAPI #define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x0100 #define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x0101 @@ -37,510 +24,26 @@ #define NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG 0x011F #define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120 -/* -#define NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG 0x510A -#define NFAPI_NR_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG 0x510B -#define NFAPI_NR_NFAPI_RF_BANDS_TAG 0x5114 -#define NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x5128 -#define NFAPI_NR_NFAPI_NRARFCN_TAG 0x5129 -#define NFAPI_NR_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x5130 -#define NFAPI_NR_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x5131 -#define NFAPI_NR_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x5132 -#define NFAPI_NR_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG 0x5133 -*/ -// P5 Message Structures - -typedef struct { - nfapi_uint16_tlv_t numerology_index_mu; - nfapi_uint16_tlv_t duplex_mode; - nfapi_uint16_tlv_t dl_cyclic_prefix_type; - nfapi_uint16_tlv_t ul_cyclic_prefix_type; -} nfapi_nr_subframe_config_t; - -#define NFAPI_NR_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x5001 -#define NFAPI_NR_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x5002 -#define NFAPI_NR_SUBFRAME_CONFIG_PB_TAG 0x5003 -#define NFAPI_NR_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x5004 -#define NFAPI_NR_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x5005 -#define NFAPI_NR_SUBFRAME_CONFIG_NUMEROLOGY_INDEX_MU_TAG 0x5006 - -typedef struct { - nfapi_uint16_tlv_t dl_carrier_bandwidth; - nfapi_uint16_tlv_t ul_carrier_bandwidth; - nfapi_uint16_tlv_t dl_absolutefrequencypointA; - nfapi_uint16_tlv_t ul_absolutefrequencypointA; - nfapi_uint16_tlv_t dl_offsettocarrier; - nfapi_uint16_tlv_t ul_offsettocarrier; - nfapi_uint16_tlv_t dl_subcarrierspacing; - nfapi_uint16_tlv_t ul_subcarrierspacing; - nfapi_uint16_tlv_t dl_specificcarrier_k0; - nfapi_uint16_tlv_t ul_specificcarrier_k0; - nfapi_uint16_tlv_t NIA_subcarrierspacing; -} nfapi_nr_rf_config_t; - -#define NFAPI_NR_RF_CONFIG_DL_CARRIER_BANDWIDTH_TAG 0x500A -#define NFAPI_NR_RF_CONFIG_UL_CARRIER_BANDWIDTH_TAG 0x500B -#define NFAPI_NR_RF_CONFIG_DL_SUBCARRIERSPACING_TAG 0x500C -#define NFAPI_NR_RF_CONFIG_UL_SUBCARRIERSPACING_TAG 0x500D -#define NFAPI_NR_RF_CONFIG_DL_OFFSETTOCARRIER_TAG 0x500E -#define NFAPI_NR_RF_CONFIG_UL_OFFSETTOCARRIER_TAG 0x500F - -typedef struct { - nfapi_uint16_tlv_t physical_cell_id; - nfapi_uint16_tlv_t half_frame_index; - nfapi_uint16_tlv_t ssb_subcarrier_offset; - nfapi_uint16_tlv_t ssb_sib1_position_in_burst; // in sib1 - nfapi_uint64_tlv_t ssb_scg_position_in_burst; // in servingcellconfigcommon - nfapi_uint16_tlv_t ssb_periodicity; - nfapi_uint16_tlv_t ss_pbch_block_power; - nfapi_uint16_tlv_t n_ssb_crb; -} nfapi_nr_sch_config_t; - -typedef struct { - nfapi_uint16_tlv_t dl_bandwidth; - nfapi_uint16_tlv_t ul_bandwidth; - nfapi_uint16_tlv_t dl_offset; - nfapi_uint16_tlv_t ul_offset; - nfapi_uint16_tlv_t dl_subcarrierSpacing; - nfapi_uint16_tlv_t ul_subcarrierSpacing; -} nfapi_nr_initialBWP_config_t; - -#define NFAPI_INITIALBWP_DL_BANDWIDTH_TAG 0x5010 -#define NFAPI_INITIALBWP_DL_OFFSET_TAG 0x5011 -#define NFAPI_INITIALBWP_DL_SUBCARRIERSPACING_TAG 0x5012 -#define NFAPI_INITIALBWP_UL_BANDWIDTH_TAG 0x5013 -#define NFAPI_INITIALBWP_UL_OFFSET_TAG 0x5014 -#define NFAPI_INITIALBWP_UL_SUBCARRIERSPACING_TAG 0x5015 - - -#define NFAPI_NR_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x501E -#define NFAPI_NR_SCH_CONFIG_HALF_FRAME_INDEX_TAG 0x501F -#define NFAPI_NR_SCH_CONFIG_SSB_SUBCARRIER_OFFSET_TAG 0x5020 -#define NFAPI_NR_SCH_CONFIG_SSB_POSITION_IN_BURST 0x5021 -#define NFAPI_NR_SCH_CONFIG_SSB_PERIODICITY 0x5022 -#define NFAPI_NR_SCH_CONFIG_SS_PBCH_BLOCK_POWER 0x5023 -#define NFAPI_NR_SCH_CONFIG_N_SSB_CRB 0x5024 -#define NFAPI_NR_PDSCH_CONFIG_MAXALLOCATIONS 16 -#define NFAPI_NR_PUSCH_CONFIG_MAXALLOCATIONS 16 - -typedef struct { - nfapi_uint16_tlv_t dmrs_TypeA_Position; - nfapi_uint16_tlv_t num_PDSCHTimeDomainResourceAllocations; - nfapi_uint16_tlv_t PDSCHTimeDomainResourceAllocation_k0[NFAPI_NR_PDSCH_CONFIG_MAXALLOCATIONS]; - nfapi_uint16_tlv_t PDSCHTimeDomainResourceAllocation_mappingType[NFAPI_NR_PDSCH_CONFIG_MAXALLOCATIONS]; - nfapi_uint16_tlv_t PDSCHTimeDomainResourceAllocation_startSymbolAndLength[NFAPI_NR_PDSCH_CONFIG_MAXALLOCATIONS]; -} nfapi_nr_pdsch_config_t; -#define NFAPI_NR_PDSCH_CONFIG_TAG - - -typedef struct { - nfapi_uint16_tlv_t prach_RootSequenceIndex; ///// L1 parameter 'PRACHRootSequenceIndex' - nfapi_uint16_tlv_t prach_msg1_SubcarrierSpacing; ///// L1 parameter 'prach-Msg1SubcarrierSpacing' - nfapi_uint16_tlv_t restrictedSetConfig; - nfapi_uint16_tlv_t msg3_transformPrecoding; ///// L1 parameter 'msg3-tp' - nfapi_uint16_tlv_t ssb_perRACH_OccasionAndCB_PreamblesPerSSB; - nfapi_uint16_tlv_t ra_ContentionResolutionTimer; - nfapi_uint16_tlv_t rsrp_ThresholdSSB; - /////////////////--------------------NR RACH-ConfigGeneric--------------------///////////////// - nfapi_uint16_tlv_t prach_ConfigurationIndex; ///// L1 parameter 'PRACHConfigurationIndex' - nfapi_uint16_tlv_t prach_msg1_FDM; ///// L1 parameter 'prach-FDM' - nfapi_uint16_tlv_t prach_msg1_FrequencyStart; ///// L1 parameter 'prach-frequency-start' - nfapi_uint16_tlv_t zeroCorrelationZoneConfig; - nfapi_uint16_tlv_t preambleReceivedTargetPower; - nfapi_uint16_tlv_t preambleTransMax; - nfapi_uint16_tlv_t powerRampingStep; - nfapi_uint16_tlv_t ra_ResponseWindow; -} nfapi_nr_rach_config_t; - -typedef struct { - nfapi_uint16_tlv_t groupHoppingEnabledTransformPrecoding; ///// L1 parameter 'Group-hopping-enabled-Transform-precoding' - nfapi_uint16_tlv_t msg3_DeltaPreamble; ///// L1 parameter 'Delta-preamble-msg3' - nfapi_uint16_tlv_t p0_NominalWithGrant; ///// L1 parameter 'p0-nominal-pusch-withgrant' - nfapi_uint16_tlv_t dmrs_TypeA_Position; - nfapi_uint16_tlv_t num_PUSCHTimeDomainResourceAllocations; - nfapi_uint16_tlv_t PUSCHTimeDomainResourceAllocation_k2[NFAPI_NR_PUSCH_CONFIG_MAXALLOCATIONS]; ///// L1 parameter 'K2' - nfapi_uint16_tlv_t PUSCHTimeDomainResourceAllocation_mappingType[NFAPI_NR_PUSCH_CONFIG_MAXALLOCATIONS]; ///// L1 parameter 'Mapping-type' - nfapi_uint16_tlv_t PUSCHTimeDomainResourceAllocation_startSymbolAndLength[NFAPI_NR_PUSCH_CONFIG_MAXALLOCATIONS]; -} nfapi_nr_pusch_config_t; - -typedef struct { - uint8_t pucch_resource_common; - nfapi_uint16_tlv_t pucch_GroupHopping; ///// L1 parameter 'PUCCH-GroupHopping' - nfapi_uint16_tlv_t p0_nominal; ///// L1 parameter 'p0-nominal-pucch' -} nfapi_nr_pucch_config_t; - - - -typedef struct { - nfapi_tl_t tl; - - nfapi_uint16_tlv_t controlResourceSetZero; - nfapi_uint16_tlv_t searchSpaceZero; - - // nfapi_nr_SearchSpace_t sib1searchSpace; - // nfapi_nr_SearchSpace_t sibssearchSpace; - // nfapi_nr_SearchSpace_t ra_SearchSpace; -}nfapi_nr_pdcch_config_t; - -typedef struct { -//NR TDD-UL-DL-ConfigCommon ///// L1 parameter 'UL-DL-configuration-common' - nfapi_uint16_tlv_t referenceSubcarrierSpacing; ///// L1 parameter 'reference-SCS' - nfapi_uint16_tlv_t dl_ul_periodicity; ///// L1 parameter 'DL-UL-transmission-periodicity' - nfapi_uint16_tlv_t nrofDownlinkSlots; ///// L1 parameter 'number-of-DL-slots' - nfapi_uint16_tlv_t nrofDownlinkSymbols; ///// L1 parameter 'number-of-DL-symbols-common' - nfapi_uint16_tlv_t nrofUplinkSlots; ///// L1 parameter 'number-of-UL-slots' - nfapi_uint16_tlv_t nrofUplinkSymbols; ///// L1 parameter 'number-of-UL-symbols-common' - nfapi_uint16_tlv_t Pattern2Present; - nfapi_uint16_tlv_t Pattern2_dl_ul_periodicity; ///// L1 parameter 'DL-UL-transmission-periodicity' - nfapi_uint16_tlv_t Pattern2_nrofDownlinkSlots; ///// L1 parameter 'number-of-DL-slots' - nfapi_uint16_tlv_t Pattern2_nrofDownlinkSymbols; ///// L1 parameter 'number-of-DL-symbols-common' - nfapi_uint16_tlv_t Pattern2_nrofUplinkSlots; ///// L1 parameter 'number-of-UL-slots' - nfapi_uint16_tlv_t Pattern2_nrofUplinkSymbols; ///// L1 parameter 'number-of-UL-symbols-common' -} nfapi_nr_tdd_ul_dl_config_t; - -typedef struct { - //RateMatchPattern is used to configure one rate matching pattern for PDSCH ///// L1 parameter 'Resource-set-cekk' - nfapi_uint16_tlv_t Match_Id; - nfapi_uint16_tlv_t patternType; - nfapi_uint16_tlv_t symbolsInResourceBlock; ///// L1 parameter 'rate-match-PDSCH-bitmap2 - nfapi_uint16_tlv_t periodicityAndPattern; ///// L1 parameter 'rate-match-PDSCH-bitmap3' - nfapi_uint16_tlv_t controlResourceSet; - nfapi_uint16_tlv_t subcarrierSpacing; ///// L1 parameter 'resource-pattern-scs' - nfapi_uint16_tlv_t mode; -} nfapi_nr_ratematchpattern_t; - -typedef struct { - //NR RateMatchPatternLTE-CRS - nfapi_uint16_tlv_t carrierfreqDL; ///// L1 parameter 'center-subcarrier-location' - nfapi_uint16_tlv_t dl_bandwidth; ///// L1 parameter 'BW' - nfapi_uint16_tlv_t nrofcrs_Ports; ///// L1 parameter 'rate-match-resources-numb-LTE-CRS-antenna-port' - nfapi_uint16_tlv_t v_Shift; ///// L1 parameter 'rate-match-resources-LTE-CRS-v-shift' - nfapi_uint16_tlv_t frame_Period; - nfapi_uint16_tlv_t frame_Offset; -} nfapi_nr_ratematchpattern_lte_crs_t; - -typedef struct { - nfapi_p4_p5_message_header_t header; - uint8_t num_tlv; - nfapi_nr_subframe_config_t subframe_config; - nfapi_nr_rf_config_t rf_config; - nfapi_nr_sch_config_t sch_config; - nfapi_nr_initialBWP_config_t initialBWP_config; - nfapi_nr_pdsch_config_t pdsch_config; - nfapi_nr_rach_config_t rach_config; - nfapi_nr_pusch_config_t pusch_config; - nfapi_nr_pucch_config_t pucch_config; - nfapi_nr_pdcch_config_t pdcch_config; - nfapi_nr_tdd_ul_dl_config_t tdd_ul_dl_config; - nfapi_nr_ratematchpattern_t ratematchpattern; - nfapi_nr_ratematchpattern_lte_crs_t ratematchpattern_lte_crs; - nfapi_nr_nfapi_t nfapi_config; - - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_nr_config_request_t; - -typedef enum { - NFAPI_NR_USS_FORMAT_0_0_AND_1_0, - NFAPI_NR_USS_FORMAT_0_1_AND_1_1, -} nfapi_nr_uss_dci_formats_e; - -typedef enum { - NFAPI_NR_SEARCH_SPACE_TYPE_COMMON=0, - NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC -} nfapi_nr_search_space_type_e; - -typedef enum { - NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_0=0, - NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_0A, - NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_1, - NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_2 -} nfapi_nr_common_search_space_type_e; - -typedef enum { - NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1=0, - NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE2, - NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE3 -} nfapi_nr_ssb_and_cset_mux_pattern_type_e; - typedef enum { NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED=1, NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED=0 } nfapi_nr_cce_reg_mapping_type_e; typedef enum { - NFAPI_NR_CSET_CONFIG_MIB_SIB1=0, + NFAPI_NR_CSET_CONFIG_MIB_SIB1 = 0, NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG, // implicit assumption of coreset Id other than 0 } nfapi_nr_coreset_config_type_e; typedef enum { - NFAPI_NR_CSET_SAME_AS_REG_BUNDLE=0, - NFAPI_NR_CSET_ALL_CONTIGUOUS_RBS -} nfapi_nr_coreset_precoder_granularity_type_e; + NFAPI_NR_DMRS_TYPE1, + NFAPI_NR_DMRS_TYPE2 +} nfapi_nr_dmrs_type_e; typedef enum { - NFAPI_NR_QCL_TYPE_A=0, - NFAPI_NR_QCL_TYPE_B, - NFAPI_NR_QCL_TYPE_C, - NFAPI_NR_QCL_TYPE_D -} nfapi_nr_qcl_type_e; - -typedef enum { - NFAPI_NR_SS_PERIODICITY_SL1=1, - NFAPI_NR_SS_PERIODICITY_SL2=2, - NFAPI_NR_SS_PERIODICITY_SL4=4, - NFAPI_NR_SS_PERIODICITY_SL5=5, - NFAPI_NR_SS_PERIODICITY_SL8=8, - NFAPI_NR_SS_PERIODICITY_SL10=10, - NFAPI_NR_SS_PERIODICITY_SL16=16, - NFAPI_NR_SS_PERIODICITY_SL20=20, - NFAPI_NR_SS_PERIODICITY_SL40=40, - NFAPI_NR_SS_PERIODICITY_SL80=80, - NFAPI_NR_SS_PERIODICITY_SL160=160, - NFAPI_NR_SS_PERIODICITY_SL320=320, - NFAPI_NR_SS_PERIODICITY_SL640=640, - NFAPI_NR_SS_PERIODICITY_SL1280=1280, - NFAPI_NR_SS_PERIODICITY_SL2560=2560 -} nfapi_nr_search_space_monitoring_periodicity_e; - -typedef enum { - NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A=0, - NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_B, - NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C, - NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_ALLOC_LIST -} nfapi_nr_pdsch_time_domain_alloc_type_e; - -typedef enum { - NFAPI_NR_PDSCH_MAPPING_TYPE_A=0, - NFAPI_NR_PDSCH_MAPPING_TYPE_B -} nfapi_nr_pdsch_mapping_type_e; - -typedef enum { - NFAPI_NR_PDSCH_RBG_CONFIG_TYPE1=0, - NFAPI_NR_PDSCH_RBG_CONFIG_TYPE2 -} nfapi_nr_pdsch_rbg_config_type_e; - -typedef enum { - NFAPI_NR_PRG_GRANULARITY_2=2, - NFAPI_NR_PRG_GRANULARITY_4=4, - NFAPI_NR_PRG_GRANULARITY_WIDEBAND -} nfapi_nr_prg_granularity_e; - -typedef enum { - NFAPI_NR_PRB_BUNDLING_TYPE_STATIC=0, - NFAPI_NR_PRB_BUNDLING_TYPE_DYNAMIC -} nfapi_nr_prb_bundling_type_e; - -typedef enum { - NFAPI_NR_MCS_TABLE_QAM64_LOW_SE=0, - NFAPI_NR_MCS_TABLE_QAM256 -} nfapi_nr_pdsch_mcs_table_e; - -// P7 Sub Structures - -/* -typedef struct { - -nfapi_tl_t tl; - -uint8_t format_indicator; //1 bit -uint16_t frequency_domain_assignment; //up to 16 bits -uint8_t time_domain_assignment; // 4 bits -uint8_t frequency_hopping_flag; //1 bit - -uint8_t ra_preamble_index; //6 bits -uint8_t ss_pbch_index; //6 bits -uint8_t prach_mask_index; //4 bits - -uint8_t vrb_to_prb_mapping; //0 or 1 bit -uint8_t mcs; //5 bits -uint8_t ndi; //1 bit -uint8_t rv; //2 bits -uint8_t harq_pid; //4 bits -uint8_t dai; //0, 2 or 4 bits -uint8_t dai1; //1 or 2 bits -uint8_t dai2; //0 or 2 bits -uint8_t tpc; //2 bits -uint8_t pucch_resource_indicator; //3 bits -uint8_t pdsch_to_harq_feedback_timing_indicator; //0, 1, 2 or 3 bits - -uint8_t short_messages_indicator; //2 bits -uint8_t short_messages; //8 bits -uint8_t tb_scaling; //2 bits - -uint8_t carrier_indicator; //0 or 3 bits -uint8_t bwp_indicator; //0, 1 or 2 bits -uint8_t prb_bundling_size_indicator; //0 or 1 bits -uint8_t rate_matching_indicator; //0, 1 or 2 bits -uint8_t zp_csi_rs_trigger; //0, 1 or 2 bits -uint8_t transmission_configuration_indication; //0 or 3 bits -uint8_t srs_request; //2 bits -uint8_t cbgti; //CBG Transmission Information: 0, 2, 4, 6 or 8 bits -uint8_t cbgfi; //CBG Flushing Out Information: 0 or 1 bit -uint8_t dmrs_sequence_initialization; //0 or 1 bit - -uint8_t srs_resource_indicator; -uint8_t precoding_information; -uint8_t csi_request; -uint8_t ptrs_dmrs_association; -uint8_t beta_offset_indicator; //0 or 2 bits - -uint8_t slot_format_indicator_count; -uint8_t *slot_format_indicators; - -uint8_t pre_emption_indication_count; -uint16_t *pre_emption_indications; //14 bit - -uint8_t block_number_count; -uint8_t *block_numbers; - -uint8_t ul_sul_indicator; //0 or 1 bit -uint8_t antenna_ports; - -uint16_t reserved; //1_0/C-RNTI:10 bits, 1_0/P-RNTI: 6 bits, 1_0/SI-&RA-RNTI: 16 bits -uint16_t padding; - -} nfapi_nr_dl_config_dci_dl_pdu_rel15_t; -*/ -//#define NFAPI_NR_DL_CONFIG_REQUEST_DCI_DL_PDU_REL15_TAG 0x???? - - - -/* -typedef struct{ - nfapi_tl_t tl; - uint8_t coreset_id; - uint64_t frequency_domain_resources; - uint8_t duration; - uint8_t cce_reg_mapping_type; - uint8_t reg_bundle_size; - uint8_t interleaver_size; - uint8_t shift_index; - uint8_t precoder_granularity; - uint8_t tci_state_id; - uint8_t tci_present_in_dci; - uint32_t dmrs_scrambling_id; -} nfapi_nr_coreset_t; - -typedef struct{ - nfapi_tl_t tl; - uint8_t search_space_id; - uint8_t coreset_id; - uint8_t search_space_type; - uint8_t duration; - uint8_t css_formats_0_0_and_1_0; - uint8_t css_format_2_0; - uint8_t css_format_2_1; - uint8_t css_format_2_2; - uint8_t css_format_2_3; - uint8_t uss_dci_formats; - uint16_t srs_monitoring_periodicity; - uint16_t slot_monitoring_periodicity; - uint16_t slot_monitoring_offset; - uint32_t monitoring_symbols_in_slot; - uint16_t number_of_candidates[NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS]; -} nfapi_nr_search_space_t; - - -typedef struct { - nfapi_tl_t tl; - uint16_t rnti; - uint8_t rnti_type; - uint8_t dci_format; - uint16_t cce_index; - /// Number of CRB in BWP that this DCI configures - uint16_t n_RB_BWP; - uint8_t config_type; - uint8_t search_space_type; - uint8_t common_search_space_type; - uint8_t aggregation_level; - uint8_t n_rb; - uint8_t n_symb; - int8_t rb_offset; - uint8_t cr_mapping_type; - uint8_t reg_bundle_size; - uint8_t interleaver_size; - uint8_t shift_index; - uint8_t mux_pattern; - uint8_t precoder_granularity; - uint8_t first_slot; - uint8_t first_symbol; - uint8_t nb_ss_sets_per_slot; - uint8_t nb_slots; - uint8_t sfn_mod2; - uint16_t scrambling_id; - nfapi_bf_vector_t bf_vector; -} nfapi_nr_dl_config_pdcch_parameters_rel15_t; - -*/ - - -typedef enum {nr_pusch_freq_hopping_disabled = 0 , - nr_pusch_freq_hopping_enabled = 1 - } nr_pusch_freq_hopping_t; - -typedef struct{ - uint8_t aperiodicSRS_ResourceTrigger; -} nfapi_nr_ul_srs_config_t; - -typedef struct { - uint8_t bandwidth_part_ind; - uint16_t number_rbs; - uint16_t start_rb; - uint8_t frame_offset; - uint16_t number_symbols; - uint16_t start_symbol; - uint8_t length_dmrs; - nr_pusch_freq_hopping_t pusch_freq_hopping; - uint8_t mcs; - uint8_t Qm; - uint16_t R; - uint8_t ndi; - uint8_t rv; - int8_t accumulated_delta_PUSCH; - int8_t absolute_delta_PUSCH; - uint8_t n_layers; - uint8_t tpmi; - uint8_t n_dmrs_cdm_groups; - uint8_t dmrs_ports[4]; - uint8_t n_front_load_symb; - nfapi_nr_ul_srs_config_t srs_config; - uint8_t csi_reportTriggerSize; - uint8_t maxCodeBlockGroupsPerTransportBlock; - uint8_t ptrs_dmrs_association_port; - uint8_t beta_offset_ind; -} nfapi_nr_ul_config_ulsch_pdu_rel15_t; - - - - - -typedef struct { - uint16_t rnti; - nfapi_nr_ul_config_ulsch_pdu_rel15_t ulsch_pdu_rel15; -} nfapi_nr_ul_config_ulsch_pdu; - -typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - - union { - // nfapi_nr_ul_config_uci_pdu uci_pdu; - nfapi_nr_ul_config_ulsch_pdu ulsch_pdu; - // nfapi_nr_ul_config_srs_pdu srs_pdu; - }; -} nfapi_nr_ul_config_request_pdu_t; - -typedef struct { - nfapi_tl_t tl; - uint8_t number_pdu; - nfapi_nr_ul_config_request_pdu_t *ul_config_pdu_list; -} nfapi_nr_ul_config_request_body_t; - -typedef struct { - nfapi_p7_message_header_t header; - uint16_t sfn_sf; - nfapi_nr_ul_config_request_body_t ul_config_request_body; - nfapi_vendor_extension_tlv_t vendor_extension; -} nfapi_nr_ul_config_request_t; + NFAPI_NR_SRS_BEAMMANAGEMENT = 0, + NFAPI_NR_SRS_CODEBOOK = 1, + NFAPI_NR_SRS_NONCODEBOOK = 2, + NFAPI_NR_SRS_ANTENNASWITCH = 3 +} nfapi_nr_srs_usage_e; #endif diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index a70e18af11..ac5e915857 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -11,7 +11,6 @@ #include "stddef.h" #include "nfapi_interface.h" -#include "nfapi_nr_interface.h" #define NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS 5 #define NFAPI_NR_MAX_NB_TCI_STATES_PDCCH 64 @@ -26,13 +25,6 @@ // Extension to the generic structures for single tlv values - -typedef enum { - NFAPI_NR_DMRS_TYPE1=0, - NFAPI_NR_DMRS_TYPE2 -} nfapi_nr_dmrs_type_e; - - typedef struct { /// Value: 0 -> 1, 0: Payload is carried directly in the value field, 1: Pointer to payload is in the value field uint16_t tag; diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index c864a0366a..3214d3a5ac 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -39,8 +39,6 @@ #include "PHY/NR_TRANSPORT/nr_ulsch.h" #include "PHY/NR_REFSIG/nr_refsig.h" #include "SCHED_NR/fapi_nr_l1.h" -#include "nfapi_nr_interface.h" - #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" diff --git a/openair1/PHY/NR_REFSIG/dmrs_nr.c b/openair1/PHY/NR_REFSIG/dmrs_nr.c index 275df1a0d4..4576f322f3 100644 --- a/openair1/PHY/NR_REFSIG/dmrs_nr.c +++ b/openair1/PHY/NR_REFSIG/dmrs_nr.c @@ -32,29 +32,29 @@ #include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/NR_REFSIG/dmrs_nr.h" - - +#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" uint8_t allowed_xlsch_re_in_dmrs_symbol(uint16_t k, uint16_t start_sc, uint16_t ofdm_symbol_size, uint8_t numDmrsCdmGrpsNoData, - uint8_t dmrs_type) { + uint8_t dmrs_type) +{ uint8_t delta; uint16_t diff; - if (k>start_sc) + if (k > start_sc) diff = k-start_sc; else diff = (ofdm_symbol_size-start_sc)+k; for (int i = 0; i #include "SCHED_NR_UE/defs.h" #include "nr_estimation.h" @@ -34,6 +33,8 @@ #include "filt16a_32.h" #include "T.h" #include +#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" + extern openair0_config_t openair0_cfg[]; //#define DEBUG_PDSCH diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index b51a8b3b2d..d2a37ceb3c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -36,15 +36,14 @@ #include "PHY/phy_extern_nr_ue.h" #include "PHY/CODING/coding_extern.h" #include "PHY/CODING/coding_defs.h" -#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -#include "PHY/NR_TRANSPORT/nr_dlsch.h" #include "SCHED_NR_UE/defs.h" #include "SIMULATION/TOOLS/sim.h" #include "executables/nr-uesoftmodem.h" #include "PHY/CODING/nrLDPC_extern.h" #include "common/utils/nr/nr_common.h" #include "openair1/PHY/TOOLS/phy_scope_interface.h" +#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" //#define ENABLE_PHY_PAYLOAD_DEBUG 1 diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 1bea7b0a6d..e2b726e21f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -41,6 +41,7 @@ #include "common/utils/nr/nr_common.h" #include #include "openair1/PHY/TOOLS/phy_scope_interface.h" +#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" /* dynamic shift for LLR computation for TM3/4 * set as command line argument, see lte-softmodem.c diff --git a/openair1/SCHED_NR/fapi_nr_l1.h b/openair1/SCHED_NR/fapi_nr_l1.h index b845bad1c0..28a6d84b9f 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.h +++ b/openair1/SCHED_NR/fapi_nr_l1.h @@ -32,7 +32,6 @@ #include "PHY/defs_gNB.h" #include "SCHED_NR/sched_nr.h" -#include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h" // added diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index cfbd8d9c12..77514d0cfe 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -27,7 +27,6 @@ #include "PHY/NR_TRANSPORT/nr_dci.h" #include "PHY/NR_ESTIMATION/nr_ul_estimation.h" #include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h" -#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" #include "fapi_nr_l1.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index f1c9ce4066..82ccca43ee 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -53,6 +53,7 @@ #include "executables/nr-uesoftmodem.h" #include "SCHED_NR_UE/pucch_uci_ue_nr.h" #include +#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" //#define DEBUG_PHY_PROC //#define NR_PDCCH_SCHED_DEBUG diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 6dd91140b6..86ce0c348a 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -36,6 +36,7 @@ #include "mac_defs.h" #include "oai_asn1.h" #include "RRC/NR_UE/rrc_defs.h" +#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" #define NR_DL_MAX_DAI (4) /* TS 38.213 table 9.1.3-1 Value of counter DAI for DCI format 1_0 and 1_1 */ #define NR_DL_MAX_NB_CW (2) /* number of downlink code word */ diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 65e8dd3fc4..991328b18c 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -38,7 +38,6 @@ #include "common/utils/nr/nr_common.h" #include "executables/softmodem-common.h" #include -#include "nfapi_nr_interface.h" void fill_dci_search_candidates(const NR_SearchSpace_t *ss, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 97c42c57f0..38f4c41a07 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -37,8 +37,6 @@ #include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "LAYER2/RLC/rlc.h" -/*NFAPI*/ -#include "nfapi_nr_interface.h" /*TAG*/ #include "NR_TAG-Id.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 61ce2c49f9..e76e3cd091 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -317,12 +317,6 @@ void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti); int nr_get_default_pucch_res(int pucch_ResourceCommon); -int get_dlscs(nfapi_nr_config_request_t *cfg); - -int get_ulscs(nfapi_nr_config_request_t *cfg); - -int get_symbolsperslot(nfapi_nr_config_request_t *cfg); - int nr_write_ce_dlsch_pdu(module_id_t module_idP, const NR_UE_sched_ctrl_t *ue_sched_ctl, unsigned char *mac_pdu, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index f2c66bd99f..4724eac162 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -78,6 +78,7 @@ /* Interface */ #include "nfapi_nr_interface_scf.h" +#include "nfapi_nr_interface.h" #include "NR_PHY_INTERFACE/NR_IF_Module.h" #include "mac_rrc_ul.h" diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index 108e0afe7a..e7cbb331bc 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -35,7 +35,6 @@ #include #include -#include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h" #include "common/platform_constants.h" #include "common/platform_types.h" From 4f32110c72e3887c17a6df573cdde60ad5d9b22a Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Jan 2024 13:58:35 +0100 Subject: [PATCH 2/3] avoid usage of ASN1 structure at PHY for SRS --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 27 ++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 77514d0cfe..0062875fb3 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -37,10 +37,7 @@ #include "executables/nr-softmodem.h" #include "executables/softmodem-common.h" #include "nfapi/oai_integration/vendor_ext.h" -#include "NR_SRS-ResourceSet.h" - #include "assertions.h" - #include //#define DEBUG_RXDATA @@ -1039,17 +1036,17 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) case 0: LOG_W(NR_PHY, "SRS report was not requested by MAC\n"); return 0; - case 1 << NR_SRS_ResourceSet__usage_beamManagement: - srs_indication->srs_usage = NR_SRS_ResourceSet__usage_beamManagement; + case 1 << NFAPI_NR_SRS_BEAMMANAGEMENT: + srs_indication->srs_usage = NFAPI_NR_SRS_BEAMMANAGEMENT; break; - case 1 << NR_SRS_ResourceSet__usage_codebook: - srs_indication->srs_usage = NR_SRS_ResourceSet__usage_codebook; + case 1 << NFAPI_NR_SRS_CODEBOOK: + srs_indication->srs_usage = NFAPI_NR_SRS_CODEBOOK; break; - case 1 << NR_SRS_ResourceSet__usage_nonCodebook: - srs_indication->srs_usage = NR_SRS_ResourceSet__usage_nonCodebook; + case 1 << NFAPI_NR_SRS_NONCODEBOOK: + srs_indication->srs_usage = NFAPI_NR_SRS_NONCODEBOOK; break; - case 1 << NR_SRS_ResourceSet__usage_antennaSwitching: - srs_indication->srs_usage = NR_SRS_ResourceSet__usage_antennaSwitching; + case 1 << NFAPI_NR_SRS_ANTENNASWITCH: + srs_indication->srs_usage = NFAPI_NR_SRS_ANTENNASWITCH; break; default: LOG_E(NR_PHY, "Invalid srs_pdu->srs_parameters_v4.usage %i\n", srs_pdu->srs_parameters_v4.usage); @@ -1072,7 +1069,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) start_meas(&gNB->srs_report_tlv_stats); switch (srs_indication->srs_usage) { - case NR_SRS_ResourceSet__usage_beamManagement: { + case NFAPI_NR_SRS_BEAMMANAGEMENT: { start_meas(&gNB->srs_beam_report_stats); nfapi_nr_srs_beamforming_report_t nr_srs_bf_report; nr_srs_bf_report.prg_size = srs_pdu->beamforming.prg_size; @@ -1101,7 +1098,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) break; } - case NR_SRS_ResourceSet__usage_codebook: { + case NFAPI_NR_SRS_CODEBOOK: { start_meas(&gNB->srs_iq_matrix_stats); nfapi_nr_srs_normalized_channel_iq_matrix_t nr_srs_channel_iq_matrix; nr_srs_channel_iq_matrix.normalized_iq_representation = srs_pdu->srs_parameters_v4.iq_representation; @@ -1150,8 +1147,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) break; } - case NR_SRS_ResourceSet__usage_nonCodebook: - case NR_SRS_ResourceSet__usage_antennaSwitching: + case NFAPI_NR_SRS_NONCODEBOOK: + case NFAPI_NR_SRS_ANTENNASWITCH: LOG_W(NR_PHY, "PHY procedures for this SRS usage are not implemented yet!\n"); break; From c917825dab73238656f77a9193d0099862d58d05 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Jan 2024 15:26:14 +0100 Subject: [PATCH 3/3] remove calls to LTE mac.h in NR --- nfapi/oai_integration/nfapi_vnf.c | 1 + openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 2 +- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 8 +++++-- openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 8 +++---- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 14 ++++++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 4 ++-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 13 ++++++------ .../LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 21 ++++++++++++------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 10 --------- openair2/RRC/NR/nr_rrc_defs.h | 1 - openair2/RRC/NR_UE/L2_interface_ue.c | 9 ++------ 11 files changed, 42 insertions(+), 49 deletions(-) diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 71bda06800..c01637c558 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -46,6 +46,7 @@ #include "common/ran_context.h" #include "openair2/PHY_INTERFACE/queue_t.h" #include "gnb_ind_vars.h" +#include "LAYER2/MAC/mac.h" #define TEST diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index a39376ae25..dbdc437af8 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -59,7 +59,7 @@ // Definitions for MAC control and data #define NR_BCCH_DL_SCH 3 // SI #define NR_BCCH_BCH 5 // MIB -#define CCCH_PAYLOAD_SIZE_MAX 512 +#define NR_CCCH_PAYLOAD_SIZE_MAX 512 #define RAR_PAYLOAD_SIZE_MAX 128 #define MAX_CSI_REPORTCONFIG 48 diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 1b786af544..e98cd687be 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -45,7 +45,6 @@ /* MAC */ #include "LAYER2/NR_MAC_COMMON/nr_mac.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" -#include "LAYER2/MAC/mac.h" #include "NR_MAC_COMMON/nr_mac_extern.h" #include "mac_defs_sl.h" @@ -181,7 +180,7 @@ typedef struct { // after multiplexing buffer remain for each lcid int32_t LCID_buffer_remain; // buffer status for each lcid - uint8_t LCID_status; + bool LCID_buffer_with_data; // logical channel group id of this LCID long LCGID; // Bj bucket usage per lcid @@ -445,6 +444,11 @@ typedef struct nr_lcordered_info_s { uint32_t bucket_size; } nr_lcordered_info_t; + +typedef struct { + uint8_t payload[NR_CCCH_PAYLOAD_SIZE_MAX]; +} __attribute__ ((__packed__)) NR_CCCH_PDU; + typedef struct { NR_SearchSpace_t *otherSI_SS; NR_SearchSpace_t *ra_SS; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index f2f625b79c..c7e43e50f8 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -95,13 +95,13 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac) // set init value 0xFFFF, make sure periodic timer and retx time counters are NOT active, after bsr transmission set the value // configured by the NW. - mac->scheduling_info.periodicBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; - mac->scheduling_info.retxBSR_SF = MAC_UE_BSR_TIMER_NOT_RUNNING; - mac->BSR_reporting_active = BSR_TRIGGER_NONE; + mac->scheduling_info.periodicBSR_SF = NR_MAC_UE_BSR_TIMER_NOT_RUNNING; + mac->scheduling_info.retxBSR_SF = NR_MAC_UE_BSR_TIMER_NOT_RUNNING; + mac->BSR_reporting_active = NR_BSR_TRIGGER_NONE; for (int i = 0; i < NR_MAX_NUM_LCID; i++) { LOG_D(NR_MAC, "Applying default logical channel config for LCGID %d\n", i); - mac->scheduling_info.lc_sched_info[i].LCID_status = LCID_EMPTY; + mac->scheduling_info.lc_sched_info[i].LCID_buffer_with_data = false; mac->scheduling_info.lc_sched_info[i].LCID_buffer_remain = 0; mac->scheduling_info.lc_sched_info[i].Bj = 0; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index dc5da31ca9..02b4d38453 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1147,12 +1147,12 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) // First check ReTxBSR Timer because it is always configured // Decrement ReTxBSR Timer if it is running and not null - if ((mac->scheduling_info.retxBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) && (mac->scheduling_info.retxBSR_SF != 0)) { + if ((mac->scheduling_info.retxBSR_SF != NR_MAC_UE_BSR_TIMER_NOT_RUNNING) && (mac->scheduling_info.retxBSR_SF != 0)) { mac->scheduling_info.retxBSR_SF--; } // Decrement Periodic Timer if it is running and not null - if ((mac->scheduling_info.periodicBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) && (mac->scheduling_info.periodicBSR_SF != 0)) { + if ((mac->scheduling_info.periodicBSR_SF != NR_MAC_UE_BSR_TIMER_NOT_RUNNING) && (mac->scheduling_info.periodicBSR_SF != 0)) { mac->scheduling_info.periodicBSR_SF--; } @@ -1194,7 +1194,7 @@ bool nr_update_bsr(NR_UE_MAC_INST_t *mac, frame_t frameP, slot_t slotP, uint8_t for (int lcid = 1; lcid <= NR_MAX_NUM_LCID; lcid++) { // Reset transmission status lcid_bytes_in_buffer[lcid - 1] = 0; - mac->scheduling_info.lc_sched_info[lcid - 1].LCID_status = LCID_EMPTY; + mac->scheduling_info.lc_sched_info[lcid - 1].LCID_buffer_with_data = false; } for (int lcgid = 0; lcgid < NR_MAX_NUM_LCGID; lcgid++) { @@ -1235,7 +1235,7 @@ bool nr_update_bsr(NR_UE_MAC_INST_t *mac, frame_t frameP, slot_t slotP, uint8_t rlc_status.bytes_in_buffer, frameP, slotP); - mac->scheduling_info.lc_sched_info[lcid - 1].LCID_status = LCID_NOT_EMPTY; + mac->scheduling_info.lc_sched_info[lcid - 1].LCID_buffer_with_data = true; //Update BSR_bytes and position in lcid_reordered_array only if Group is defined if (lcgid < NR_MAX_NUM_LCGID) { @@ -2693,7 +2693,7 @@ static int nr_ue_get_sdu_mac_ce_pre(NR_UE_MAC_INST_t *mac, } //Restart ReTxBSR Timer at new grant indication (38.321) - if (mac->scheduling_info.retxBSR_SF != MAC_UE_BSR_TIMER_NOT_RUNNING) { + if (mac->scheduling_info.retxBSR_SF != NR_MAC_UE_BSR_TIMER_NOT_RUNNING) { mac->scheduling_info.retxBSR_SF = nr_get_sf_retxBSRTimer(mac->scheduling_info.retxBSR_Timer); } @@ -2918,7 +2918,7 @@ static void nr_ue_get_sdu_mac_ce_post(NR_UE_MAC_INST_t *mac, } // Reset BSR Trigger flags - mac->BSR_reporting_active = BSR_TRIGGER_NONE; + mac->BSR_reporting_active = NR_BSR_TRIGGER_NONE; } } @@ -3242,7 +3242,7 @@ uint8_t nr_ue_get_sdu(NR_UE_MAC_INST_t *mac, // skip the logical channel if no data in the buffer initially or the data in the buffer was zero because it was written in to // MAC PDU - if (!sched_info->lc_sched_info[lcid - 1].LCID_status || !lcids_data_status[lcid - 1]) { + if (!sched_info->lc_sched_info[lcid - 1].LCID_buffer_with_data || !lcids_data_status[lcid - 1]) { lcids_data_status[lcid - 1] = false; continue; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 161598ec2d..326ba5fce4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -617,7 +617,6 @@ void nr_initiate_ra_proc(module_id_t module_idP, } } LOG_D(NR_MAC, "Frame %d, Slot %d: Activating RA process \n", frameP, slotP); - ra->state = Msg2; ra->timing_offset = timing_offset; ra->preamble_slot = slotP; @@ -653,11 +652,12 @@ void nr_initiate_ra_proc(module_id_t module_idP, && !((find_nr_UE(&nr_mac->UE_info, ra->rnti) == NULL) && (find_nr_RA_id(module_idP, CC_id, ra->rnti) == -1) && ra->rnti >= 0x1 && ra->rnti <= 0xffef)); if (loop == 100) { - LOG_E(NR_MAC, "%s:%d:%s: [RAPROC] initialisation random access aborted\n", __FILE__, __LINE__, __FUNCTION__); + LOG_E(NR_MAC, "[RAPROC] initialisation random access aborted\n"); abort(); } } + ra->state = Msg2; ra->RA_rnti = ra_rnti; ra->preamble_index = preamble_index; ra->beam_id = cc->ssb_index[beam_index]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 9199327501..d5116385e3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1966,18 +1966,17 @@ NR_UE_info_t *find_nr_UE(NR_UEs_t *UEs, rnti_t rntiP) return NULL; } -int find_nr_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP) { -//------------------------------------------------------------------------------ - int RA_id; - RA_t *ra = (RA_t *) &RC.nrmac[mod_idP]->common_channels[CC_idP].ra[0]; +int find_nr_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP) +{ + NR_RA_t *ra = &RC.nrmac[mod_idP]->common_channels[CC_idP].ra[0]; - for (RA_id = 0; RA_id < NB_RA_PROC_MAX; RA_id++) { + for (int RA_id = 0; RA_id < NR_NB_RA_PROC_MAX; RA_id++) { LOG_D(NR_MAC, "Checking RA_id %d for %x : state %d\n", RA_id, rntiP, ra[RA_id].state); - if (ra[RA_id].state != IDLE && ra[RA_id].rnti == rntiP) + if (ra[RA_id].state != RA_IDLE && ra[RA_id].rnti == rntiP) return RA_id; } @@ -3047,7 +3046,7 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE) DevAssert(cellGroupConfig->rlc_BearerToAddModList->list.count == 1); const NR_RLC_BearerConfig_t *bearer = cellGroupConfig->rlc_BearerToAddModList->list.array[0]; DevAssert(bearer->servedRadioBearer->choice.srb_Identity == 1); - nr_rlc_add_srb(UE->rnti, DCCH, bearer); + nr_rlc_add_srb(UE->rnti, bearer->servedRadioBearer->choice.srb_Identity, bearer); } void nr_mac_trigger_release_timer(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing) diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index 13aa2a3546..04f2c2fdc9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -332,8 +332,10 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req) new_CellGroup); } - if (req->rrc_container != NULL) - nr_rlc_srb_recv_sdu(req->gNB_DU_ue_id, DCCH, req->rrc_container, req->rrc_container_length); + if (req->rrc_container != NULL) { + logical_chan_id_t id = 1; + nr_rlc_srb_recv_sdu(req->gNB_DU_ue_id, id, req->rrc_container, req->rrc_container_length); + } UE->capability = ue_cap; if (ue_cap != NULL) { @@ -424,8 +426,10 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req) handle_ue_context_drbs_release(req->gNB_DU_ue_id, req->drbs_to_be_released_length, req->drbs_to_be_released, new_CellGroup); } - if (req->rrc_container != NULL) - nr_rlc_srb_recv_sdu(req->gNB_DU_ue_id, DCCH, req->rrc_container, req->rrc_container_length); + if (req->rrc_container != NULL) { + logical_chan_id_t id = 1; + nr_rlc_srb_recv_sdu(req->gNB_DU_ue_id, id, req->rrc_container, req->rrc_container_length); + } if (req->ReconfigComplOutcome != RRCreconf_info_not_present && req->ReconfigComplOutcome != RRCreconf_success) { LOG_E(NR_MAC, @@ -498,9 +502,10 @@ void ue_context_modification_confirm(const f1ap_ue_context_modif_confirm_t *conf } NR_SCHED_UNLOCK(&mac->sched_lock); - if (confirm->rrc_container_length > 0) - nr_rlc_srb_recv_sdu(confirm->gNB_DU_ue_id, DCCH, confirm->rrc_container, confirm->rrc_container_length); - + if (confirm->rrc_container_length > 0) { + logical_chan_id_t id = 1; + nr_rlc_srb_recv_sdu(confirm->gNB_DU_ue_id, id, confirm->rrc_container, confirm->rrc_container_length); + } /* nothing else to be done? */ } @@ -589,7 +594,7 @@ void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc) du_add_f1_ue_data(dl_rrc->gNB_DU_ue_id, &new_ue_data); } - if (UE->expect_reconfiguration && dl_rrc->srb_id == DCCH) { + if (UE->expect_reconfiguration && dl_rrc->srb_id == 1) { /* we expected a reconfiguration, and this is on DCCH. We assume this is * the reconfiguration: nr_mac_prepare_cellgroup_update() already stored * the CellGroupConfig. Below, we trigger a timer, and the CellGroupConfig diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 4724eac162..9028dbc797 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -85,8 +85,6 @@ /* MAC */ #include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" -#include "LAYER2/MAC/mac.h" -#include "NR_TAG.h" #include @@ -251,14 +249,6 @@ typedef struct { /// Outgoing BCCH pdu for PHY uint8_t sib1_bcch_pdu[NR_MAX_SIB_LENGTH / 8]; int sib1_bcch_length; - /// Outgoing BCCH DCI allocation - uint32_t BCCH_alloc_pdu; - /// Outgoing CCCH pdu for PHY - CCCH_PDU CCCH_pdu; - /// Outgoing PCCH DCI allocation - uint32_t PCCH_alloc_pdu; - /// Outgoing PCCH pdu for PHY - PCCH_PDU PCCH_pdu; /// Template for RA computations NR_RA_t ra[NR_NB_RA_PROC_MAX]; /// VRB map for common channels diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 4dc17fd493..b92150e65b 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -40,7 +40,6 @@ #include "nr_rrc_common.h" #include "ds/byte_array.h" -#include "common/ngran_types.h" #include "common/platform_constants.h" #include "common/platform_types.h" #include "mac_rrc_dl.h" diff --git a/openair2/RRC/NR_UE/L2_interface_ue.c b/openair2/RRC/NR_UE/L2_interface_ue.c index 0b61f3fc82..b3eac63e4c 100644 --- a/openair2/RRC/NR_UE/L2_interface_ue.c +++ b/openair2/RRC/NR_UE/L2_interface_ue.c @@ -33,7 +33,6 @@ #include "rrc_defs.h" #include "rrc_proto.h" #include "assertions.h" -#include "MAC/mac.h" #include "LAYER2/NR_MAC_COMMON/nr_mac.h" #include "openair2/LAYER2/NR_MAC_UE/mac_proto.h" @@ -89,13 +88,9 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p); } break; - - case CCCH: - AssertFatal(false, "use RLC instead\n"); - break; - + case NR_SBCCH_SL_BCH: - if (pdu_len>0) { + if (pdu_len > 0) { LOG_T(NR_RRC, "[UE %d] Received SL-MIB for NR_SBCCH_SL_BCH.\n", module_id); MessageDef *message_p;