merge, compile ok, regular exe ok, ocp-gnb not
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
// overwrite the previous deinitions
|
||||
|
||||
# define MAX_MODULES NB_MODULES_MAX
|
||||
#define MAX_NR_RRC_UE_CONTEXTS 64
|
||||
|
||||
#ifndef UE_EXPANSION
|
||||
// TODO:L2 FAPI simulator.
|
||||
@@ -83,7 +84,7 @@
|
||||
#else
|
||||
#define MAX_MOBILES_PER_ENB 4
|
||||
#define MAX_MOBILES_PER_ENB_NB_IoT 4
|
||||
#define MAX_MOBILES_PER_GNB 4
|
||||
#define MAX_MOBILES_PER_GNB 2//16
|
||||
#define MAX_eNB 2
|
||||
#define MAX_gNB 2
|
||||
#endif
|
||||
@@ -96,8 +97,10 @@
|
||||
#define MAX_gNB 2
|
||||
#endif
|
||||
|
||||
#define NUMBER_OF_NR_DLSCH_MAX 4
|
||||
#define NUMBER_OF_NR_ULSCH_MAX 4
|
||||
#define NUMBER_OF_NR_DLSCH_MAX 2//16
|
||||
#define NUMBER_OF_NR_ULSCH_MAX 2//16
|
||||
#define NUMBER_OF_NR_SR_MAX 16
|
||||
|
||||
|
||||
#define MAX_MANAGED_ENB_PER_MOBILE 2
|
||||
#define MAX_MANAGED_GNB_PER_MOBILE 2
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "LTE_SL-PeriodComm-r12.h"
|
||||
#include "LTE_SL-DiscResourcePool-r12.h"
|
||||
#include "NR_RACH-ConfigCommon.h"
|
||||
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Messages for RRC logging
|
||||
#if defined(DISABLE_ITTI_XER_PRINT)
|
||||
@@ -400,194 +400,9 @@ typedef struct NRRrcConfigurationReq_s {
|
||||
uint16_t mcc[PLMN_LIST_MAX_SIZE];
|
||||
uint16_t mnc[PLMN_LIST_MAX_SIZE];
|
||||
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
|
||||
int16_t nb_cc;
|
||||
lte_frame_type_t frame_type[MAX_NUM_CCs];
|
||||
uint8_t tdd_config[MAX_NUM_CCs];
|
||||
uint8_t tdd_config_s[MAX_NUM_CCs];
|
||||
lte_prefix_type_t DL_prefix_type[MAX_NUM_CCs];
|
||||
lte_prefix_type_t UL_prefix_type[MAX_NUM_CCs];
|
||||
int16_t nr_band[MAX_NUM_CCs];
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs];
|
||||
int16_t Nid_cell[MAX_NUM_CCs];// for testing, change later
|
||||
int16_t N_RB_DL[MAX_NUM_CCs];// for testing, change later
|
||||
int nb_antenna_ports[MAX_NUM_CCs];
|
||||
|
||||
///NR
|
||||
//MIB
|
||||
long MIB_subCarrierSpacingCommon[MAX_NUM_CCs];
|
||||
uint32_t MIB_ssb_SubcarrierOffset[MAX_NUM_CCs];
|
||||
long MIB_dmrs_TypeA_Position[MAX_NUM_CCs];
|
||||
uint32_t pdcch_ConfigSIB1[MAX_NUM_CCs];
|
||||
|
||||
//SIB1
|
||||
long SIB1_frequencyOffsetSSB[MAX_NUM_CCs];
|
||||
long SIB1_ssb_PeriodicityServingCell[MAX_NUM_CCs];
|
||||
long SIB1_ss_PBCH_BlockPower[MAX_NUM_CCs];
|
||||
//NR FrequencyInfoDL
|
||||
long absoluteFrequencySSB[MAX_NUM_CCs];
|
||||
long DL_FreqBandIndicatorNR[MAX_NUM_CCs];
|
||||
long DL_absoluteFrequencyPointA[MAX_NUM_CCs];
|
||||
|
||||
//NR DL SCS-SpecificCarrier
|
||||
long DL_offsetToCarrier[MAX_NUM_CCs];
|
||||
long DL_SCS_SubcarrierSpacing[MAX_NUM_CCs];
|
||||
long DL_carrierBandwidth[MAX_NUM_CCs];
|
||||
|
||||
//NR BWP-DownlinkCommon
|
||||
uint32_t DL_locationAndBandwidth[MAX_NUM_CCs];
|
||||
long DL_BWP_SubcarrierSpacing[MAX_NUM_CCs];
|
||||
lte_prefix_type_t DL_BWP_prefix_type[MAX_NUM_CCs];
|
||||
|
||||
//NR FrequencyInfoUL
|
||||
long UL_FreqBandIndicatorNR[MAX_NUM_CCs];
|
||||
long UL_absoluteFrequencyPointA[MAX_NUM_CCs];
|
||||
long UL_additionalSpectrumEmission[MAX_NUM_CCs];
|
||||
long UL_p_Max[MAX_NUM_CCs];
|
||||
long UL_frequencyShift7p5khz[MAX_NUM_CCs];
|
||||
|
||||
//NR UL SCS-SpecificCarrier
|
||||
uint32_t UL_offsetToCarrier[MAX_NUM_CCs];
|
||||
long UL_SCS_SubcarrierSpacing[MAX_NUM_CCs];
|
||||
uint32_t UL_carrierBandwidth[MAX_NUM_CCs];
|
||||
|
||||
// NR BWP-UplinkCommon
|
||||
uint32_t UL_locationAndBandwidth[MAX_NUM_CCs];
|
||||
long UL_BWP_SubcarrierSpacing[MAX_NUM_CCs];
|
||||
lte_prefix_type_t UL_BWP_prefix_type[MAX_NUM_CCs];
|
||||
long UL_timeAlignmentTimerCommon[MAX_NUM_CCs];
|
||||
long ServingCellConfigCommon_n_TimingAdvanceOffset[MAX_NUM_CCs];
|
||||
uint64_t ServingCellConfigCommon_ssb_PositionsInBurst_PR[MAX_NUM_CCs];
|
||||
long ServingCellConfigCommon_ssb_periodicityServingCell[MAX_NUM_CCs]; //ServingCellConfigCommon
|
||||
long ServingCellConfigCommon_dmrs_TypeA_Position[MAX_NUM_CCs]; //ServingCellConfigCommon
|
||||
long NIA_SubcarrierSpacing[MAX_NUM_CCs]; //ServingCellConfigCommon Used only for non-initial access
|
||||
long ServingCellConfigCommon_ss_PBCH_BlockPower[MAX_NUM_CCs]; //ServingCellConfigCommon
|
||||
|
||||
|
||||
//NR TDD-UL-DL-ConfigCommon
|
||||
long referenceSubcarrierSpacing[MAX_NUM_CCs];
|
||||
long dl_UL_TransmissionPeriodicity[MAX_NUM_CCs];
|
||||
long nrofDownlinkSlots[MAX_NUM_CCs];
|
||||
long nrofDownlinkSymbols[MAX_NUM_CCs];
|
||||
long nrofUplinkSlots[MAX_NUM_CCs];
|
||||
long nrofUplinkSymbols[MAX_NUM_CCs];
|
||||
|
||||
//NR RACH-ConfigCommon
|
||||
long rach_totalNumberOfRA_Preambles[MAX_NUM_CCs];
|
||||
long rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[MAX_NUM_CCs];
|
||||
long rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[MAX_NUM_CCs];
|
||||
long rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[MAX_NUM_CCs];
|
||||
long rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[MAX_NUM_CCs];
|
||||
long rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[MAX_NUM_CCs];
|
||||
long rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[MAX_NUM_CCs];
|
||||
uint32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[MAX_NUM_CCs];
|
||||
uint32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[MAX_NUM_CCs];
|
||||
uint32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[MAX_NUM_CCs];
|
||||
BOOLEAN_t rach_groupBconfigured[MAX_NUM_CCs];
|
||||
long rach_ra_Msg3SizeGroupA[MAX_NUM_CCs];
|
||||
e_NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
|
||||
long rach_numberOfRA_PreamblesGroupA[MAX_NUM_CCs];
|
||||
long rach_ra_ContentionResolutionTimer[MAX_NUM_CCs];
|
||||
long rsrp_ThresholdSSB[MAX_NUM_CCs];
|
||||
long rsrp_ThresholdSSB_SUL[MAX_NUM_CCs];
|
||||
long prach_RootSequenceIndex_choice[MAX_NUM_CCs];
|
||||
uint32_t prach_RootSequenceIndex_l839[MAX_NUM_CCs];
|
||||
uint32_t prach_RootSequenceIndex_l139[MAX_NUM_CCs];
|
||||
long prach_msg1_SubcarrierSpacing[MAX_NUM_CCs];
|
||||
long restrictedSetConfig[MAX_NUM_CCs];
|
||||
long msg3_transformPrecoding[MAX_NUM_CCs];
|
||||
//ssb-perRACH-OccasionAndCB-PreamblesPerSSB not sure
|
||||
|
||||
//NR RACH-ConfigGeneric
|
||||
uint32_t prach_ConfigurationIndex[MAX_NUM_CCs];
|
||||
long prach_msg1_FDM[MAX_NUM_CCs];
|
||||
long prach_msg1_FrequencyStart[MAX_NUM_CCs];
|
||||
uint32_t zeroCorrelationZoneConfig[MAX_NUM_CCs];
|
||||
long preambleReceivedTargetPower[MAX_NUM_CCs];
|
||||
long preambleTransMax[MAX_NUM_CCs];
|
||||
long powerRampingStep[MAX_NUM_CCs];
|
||||
long ra_ResponseWindow[MAX_NUM_CCs];
|
||||
|
||||
//NR PUSCH-ConfigCommon
|
||||
BOOLEAN_t groupHoppingEnabledTransformPrecoding[MAX_NUM_CCs];
|
||||
long msg3_DeltaPreamble[MAX_NUM_CCs];
|
||||
long p0_NominalWithGrant[MAX_NUM_CCs];
|
||||
|
||||
///NR PUSCH-TimeDomainResourceAllocation
|
||||
uint32_t PUSCH_TimeDomainResourceAllocation_k2[MAX_NUM_CCs];
|
||||
long PUSCH_TimeDomainResourceAllocation_mappingType[MAX_NUM_CCs];
|
||||
uint32_t PUSCH_TimeDomainResourceAllocation_startSymbolAndLength[MAX_NUM_CCs];
|
||||
|
||||
//NR PUCCH-ConfigCommon
|
||||
uint32_t pucch_ResourceCommon[MAX_NUM_CCs];
|
||||
long pucch_GroupHopping[MAX_NUM_CCs];
|
||||
uint32_t hoppingId[MAX_NUM_CCs];
|
||||
long p0_nominal[MAX_NUM_CCs];
|
||||
|
||||
//NR PDSCH-ConfigCOmmon
|
||||
//NR PDSCH-TimeDomainResourceAllocation
|
||||
uint32_t PDSCH_TimeDomainResourceAllocation_k0[MAX_NUM_CCs];
|
||||
long PDSCH_TimeDomainResourceAllocation_mappingType[MAX_NUM_CCs];
|
||||
long PDSCH_TimeDomainResourceAllocation_startSymbolAndLength[MAX_NUM_CCs];
|
||||
|
||||
//NR RateMatchPattern is used to configure one rate matching pattern for PDSCH
|
||||
long rateMatchPatternId[MAX_NUM_CCs];
|
||||
long RateMatchPattern_patternType[MAX_NUM_CCs];
|
||||
long symbolsInResourceBlock[MAX_NUM_CCs];
|
||||
long periodicityAndPattern[MAX_NUM_CCs];
|
||||
long RateMatchPattern_controlResourceSet[MAX_NUM_CCs]; ///ControlResourceSetId
|
||||
long RateMatchPattern_subcarrierSpacing[MAX_NUM_CCs];
|
||||
long RateMatchPattern_mode[MAX_NUM_CCs];
|
||||
|
||||
//NR PDCCH-ConfigCommon
|
||||
uint32_t controlResourceSetZero[MAX_NUM_CCs];
|
||||
uint32_t searchSpaceZero[MAX_NUM_CCs];
|
||||
long searchSpaceSIB1[MAX_NUM_CCs];
|
||||
long searchSpaceOtherSystemInformation[MAX_NUM_CCs];
|
||||
long pagingSearchSpace[MAX_NUM_CCs];
|
||||
long ra_SearchSpace[MAX_NUM_CCs];
|
||||
//NR PDCCH-ConfigCommon commonControlResourcesSets
|
||||
long PDCCH_common_controlResourceSetId[MAX_NUM_CCs];
|
||||
long PDCCH_common_ControlResourceSet_duration[MAX_NUM_CCs];
|
||||
long PDCCH_cce_REG_MappingType[MAX_NUM_CCs];
|
||||
long PDCCH_reg_BundleSize[MAX_NUM_CCs];
|
||||
long PDCCH_interleaverSize[MAX_NUM_CCs];
|
||||
long PDCCH_shiftIndex[MAX_NUM_CCs];
|
||||
long PDCCH_precoderGranularity[MAX_NUM_CCs]; //Corresponds to L1 parameter 'CORESET-precoder-granuality'
|
||||
long PDCCH_TCI_StateId[MAX_NUM_CCs];
|
||||
BOOLEAN_t tci_PresentInDCI[MAX_NUM_CCs];
|
||||
uint32_t PDCCH_DMRS_ScramblingID[MAX_NUM_CCs];
|
||||
|
||||
//NR PDCCH-ConfigCommon commonSearchSpaces
|
||||
long SearchSpaceId[MAX_NUM_CCs];
|
||||
long commonSearchSpaces_controlResourceSetId[MAX_NUM_CCs];
|
||||
long SearchSpace_monitoringSlotPeriodicityAndOffset_choice[MAX_NUM_CCs];
|
||||
uint32_t SearchSpace_monitoringSlotPeriodicityAndOffset_value[MAX_NUM_CCs];
|
||||
uint32_t SearchSpace_duration[MAX_NUM_CCs];
|
||||
long SearchSpace_nrofCandidates_aggregationLevel1[MAX_NUM_CCs];
|
||||
long SearchSpace_nrofCandidates_aggregationLevel2[MAX_NUM_CCs];
|
||||
long SearchSpace_nrofCandidates_aggregationLevel4[MAX_NUM_CCs];
|
||||
long SearchSpace_nrofCandidates_aggregationLevel8[MAX_NUM_CCs];
|
||||
long SearchSpace_nrofCandidates_aggregationLevel16[MAX_NUM_CCs];
|
||||
long SearchSpace_searchSpaceType[MAX_NUM_CCs];
|
||||
long Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[MAX_NUM_CCs];
|
||||
long Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[MAX_NUM_CCs];
|
||||
long Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[MAX_NUM_CCs];
|
||||
long Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[MAX_NUM_CCs];
|
||||
long Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[MAX_NUM_CCs];
|
||||
long Common_dci_Format2_3_monitoringPeriodicity[MAX_NUM_CCs];
|
||||
long Common_dci_Format2_3_nrofPDCCH_Candidates[MAX_NUM_CCs];
|
||||
long ue_Specific__dci_Formats[MAX_NUM_CCs];
|
||||
|
||||
//RateMatchPatternLTE-CRS
|
||||
uint32_t RateMatchPatternLTE_CRS_carrierFreqDL[MAX_NUM_CCs];
|
||||
long RateMatchPatternLTE_CRS_carrierBandwidthDL[MAX_NUM_CCs];
|
||||
long RateMatchPatternLTE_CRS_nrofCRS_Ports[MAX_NUM_CCs];
|
||||
long RateMatchPatternLTE_CRS_v_Shift[MAX_NUM_CCs];
|
||||
long RateMatchPatternLTE_CRS_radioframeAllocationPeriod[MAX_NUM_CCs];
|
||||
uint32_t RateMatchPatternLTE_CRS_radioframeAllocationOffset[MAX_NUM_CCs];
|
||||
long RateMatchPatternLTE_CRS_subframeAllocation_choice[MAX_NUM_CCs];
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc;
|
||||
int ssb_SubcarrierOffset;
|
||||
int pdsch_AntennaPorts;
|
||||
} gNB_RrcConfigurationReq;
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,8 @@
|
||||
#ifndef OCP_FRAMEWORK
|
||||
typedef enum cell_type_e {
|
||||
CELL_MACRO_ENB,
|
||||
CELL_HOME_ENB
|
||||
CELL_HOME_ENB,
|
||||
CELL_MACRO_GNB
|
||||
} cell_type_t;
|
||||
|
||||
typedef enum paging_drx_e {
|
||||
@@ -272,6 +273,22 @@ typedef struct e_rab_setup_s {
|
||||
uint32_t gtp_teid;
|
||||
} e_rab_setup_t;
|
||||
|
||||
typedef struct e_rab_tobe_added_s {
|
||||
/* Unique e_rab_id for the UE. */
|
||||
uint8_t e_rab_id;
|
||||
|
||||
/* Unique drb_ID for the UE. */
|
||||
uint8_t drb_ID;
|
||||
|
||||
/* The transport layer address for the IP packets */
|
||||
transport_layer_addr_t eNB_addr;
|
||||
|
||||
/* S-GW Tunnel endpoint identifier */
|
||||
uint32_t gtp_teid;
|
||||
} e_rab_tobe_added_t;
|
||||
|
||||
|
||||
|
||||
typedef struct e_rab_tobeswitched_s {
|
||||
/* Unique e_rab_id for the UE. */
|
||||
uint8_t e_rab_id;
|
||||
|
||||
@@ -50,3 +50,8 @@ MESSAGE_DEF(X2AP_UE_CONTEXT_RELEASE , MESSAGE_PRIORITY_MED, x2ap_ue_
|
||||
|
||||
/*Senb bearer addition messages X2AP <-> RRC */
|
||||
MESSAGE_DEF(X2AP_SENB_ADDITION_REQ , MESSAGE_PRIORITY_MED, x2ap_senb_addition_req_t , x2ap_senb_addition_req)
|
||||
|
||||
/*SGnb bearer addition messages X2AP <-> RRC */
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_ADDITION_REQ , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_addition_req_t , x2ap_ENDC_sgnb_addition_req)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_ADDITION_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_addition_req_ACK_t , x2ap_ENDC_sgnb_addition_req_ACK)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_RECONF_COMPLETE , MESSAGE_PRIORITY_MED, x2ap_ENDC_reconf_complete_t , x2ap_ENDC_sgnb_reconf_complete)
|
||||
|
||||
@@ -28,16 +28,19 @@
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Defines to access message fields.
|
||||
|
||||
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
|
||||
#define X2AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_req
|
||||
#define X2AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_resp
|
||||
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
|
||||
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
|
||||
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
|
||||
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
|
||||
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
|
||||
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
|
||||
#define X2AP_SENB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_senb_addition_req
|
||||
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
|
||||
#define X2AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_req
|
||||
#define X2AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_resp
|
||||
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
|
||||
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
|
||||
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
|
||||
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
|
||||
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
|
||||
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
|
||||
#define X2AP_SENB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_senb_addition_req
|
||||
#define X2AP_ENDC_SGNB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_addition_req
|
||||
#define X2AP_ENDC_SGNB_ADDITION_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_addition_req_ACK
|
||||
#define X2AP_ENDC_SGNB_RECONF_COMPLETE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_reconf_complete
|
||||
|
||||
#define X2AP_MAX_NB_ENB_IP_ADDRESS 2
|
||||
|
||||
@@ -66,6 +69,13 @@ typedef enum {
|
||||
X2AP_TX2_RELOC_OVERALL_TIMEOUT
|
||||
} x2ap_handover_cancel_cause_t;
|
||||
|
||||
typedef enum {
|
||||
X2AP_RECONF_RESPONSE_SUCCESS,
|
||||
X2AP_RECONF_RESPONSE_REJECT
|
||||
/* Extensions may appear below */
|
||||
|
||||
} x2ap_sgNB_reconf_response_information_t;
|
||||
|
||||
typedef struct x2ap_handover_cancel_s {
|
||||
int rnti;
|
||||
x2ap_handover_cancel_cause_t cause;
|
||||
@@ -286,7 +296,7 @@ typedef struct x2ap_senb_addition_req_ack_s {
|
||||
|
||||
int MeNB_UE_X2_id;
|
||||
|
||||
int SeNB_UE_X2_id;
|
||||
int SgNB_UE_X2_id;
|
||||
|
||||
uint8_t nb_sCG_e_rabs_tobeadded;
|
||||
|
||||
@@ -303,4 +313,86 @@ typedef struct x2ap_senb_addition_req_ack_s {
|
||||
|
||||
} x2ap_senb_addition_req_ack_t;
|
||||
|
||||
typedef struct x2ap_ENDC_sgnb_addition_req_s {
|
||||
int ue_x2_id;
|
||||
|
||||
/* used for RRC->X2AP in source eNB */
|
||||
int rnti;
|
||||
|
||||
security_capabilities_t security_capabilities;
|
||||
|
||||
/* SgNB Security Key */
|
||||
uint8_t kgnb[32];
|
||||
|
||||
/*next_hop_chaining_coun */
|
||||
long int kgnb_ncc;
|
||||
|
||||
/* UE aggregate maximum bitrate */
|
||||
ambr_t ue_ambr;
|
||||
|
||||
uint8_t nb_e_rabs_tobeadded;
|
||||
|
||||
/* list of e_rab to be added by RRC layers */
|
||||
e_rab_tobe_added_t e_rabs_tobeadded[S1AP_MAX_E_RAB];
|
||||
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
e_rab_t e_rab_param[S1AP_MAX_E_RAB];
|
||||
|
||||
x2ap_lastvisitedcell_info_t lastvisitedcell_info;
|
||||
|
||||
uint8_t rrc_buffer[4096 /* arbitrary, big enough */];
|
||||
int rrc_buffer_size;
|
||||
|
||||
int target_assoc_id;
|
||||
|
||||
/*long int pDCPatSgNB = X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present;
|
||||
long int mCGresources = X2AP_EN_DC_ResourceConfiguration__mCGresources_not_present;
|
||||
long int sCGresources = X2AP_EN_DC_ResourceConfiguration__sCGresources_not_present;*/
|
||||
|
||||
|
||||
} x2ap_ENDC_sgnb_addition_req_t;
|
||||
|
||||
typedef struct x2ap_ENDC_sgnb_addition_req_ACK_s {
|
||||
int MeNB_ue_x2_id;
|
||||
|
||||
int SgNB_ue_x2_id;
|
||||
|
||||
/* used for X2AP->RRC in source eNB */
|
||||
int rnti;
|
||||
|
||||
uint8_t nb_e_rabs_admitted_tobeadded;
|
||||
|
||||
/* list of e_rab to be added by RRC layers */
|
||||
e_rab_tobe_added_t e_rabs_admitted_tobeadded[S1AP_MAX_E_RAB];
|
||||
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
e_rab_t e_rab_param[S1AP_MAX_E_RAB];
|
||||
|
||||
x2ap_lastvisitedcell_info_t lastvisitedcell_info;
|
||||
|
||||
uint8_t rrc_buffer[4096 /* arbitrary, big enough */];
|
||||
int rrc_buffer_size;
|
||||
|
||||
int target_assoc_id;
|
||||
|
||||
/*long int pDCPatSgNB = X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present;
|
||||
long int mCGresources = X2AP_EN_DC_ResourceConfiguration__mCGresources_not_present;
|
||||
long int sCGresources = X2AP_EN_DC_ResourceConfiguration__sCGresources_not_present;*/
|
||||
|
||||
|
||||
} x2ap_ENDC_sgnb_addition_req_ACK_t;
|
||||
|
||||
typedef struct x2ap_ENDC_reconf_complete_s {
|
||||
int MeNB_ue_x2_id;
|
||||
|
||||
int SgNB_ue_x2_id;
|
||||
|
||||
x2ap_sgNB_reconf_response_information_t reconf_response;
|
||||
|
||||
uint8_t rrc_buffer[4096 /* arbitrary, big enough */];
|
||||
int rrc_buffer_size;
|
||||
|
||||
} x2ap_ENDC_reconf_complete_t;
|
||||
|
||||
|
||||
#endif /* X2AP_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -2389,6 +2389,11 @@ int RCconfig_S1(
|
||||
S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_MACRO_ENB;
|
||||
} else if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_HOME_ENB") == 0) {
|
||||
S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB;
|
||||
// Temporary option to be able to parse an eNB configuration file which is treated as gNB from
|
||||
// the X2AP layer and test the setup of an ENDC X2AP connection. To be removed when we are ready to
|
||||
// parse an actual gNB configuration file wrt. the X2AP parameters instead.
|
||||
} else if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_MACRO_GNB") == 0) {
|
||||
S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_MACRO_GNB;
|
||||
} else {
|
||||
AssertFatal(0,
|
||||
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
|
||||
@@ -2618,7 +2623,7 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_MACRO_ENB;
|
||||
} else if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_HOME_ENB") == 0) {
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB;
|
||||
} else {
|
||||
}else {
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
|
||||
RC.config_file_name, i, *(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr));
|
||||
|
||||
@@ -94,6 +94,7 @@ typedef enum {
|
||||
#define CONFIG_STRING_RU_END_OF_BURST_DELAY "end_of_burst_delay"
|
||||
#define CONFIG_STRING_RU_OTA_SYNC_ENABLE "ota_sync_enabled"
|
||||
#define CONFIG_STRING_RU_BF_WEIGHTS_LIST "bf_weights"
|
||||
#define CONFIG_STRING_RU_IF_FREQUENCY "if_freq"
|
||||
|
||||
#define RU_LOCAL_IF_NAME_IDX 0
|
||||
#define RU_LOCAL_ADDRESS_IDX 1
|
||||
@@ -120,6 +121,7 @@ typedef enum {
|
||||
#define RU_END_OF_BURST_DELAY_IDX 22
|
||||
#define RU_OTA_SYNC_ENABLE_IDX 23
|
||||
#define RU_BF_WEIGHTS_LIST_IDX 24
|
||||
#define RU_IF_FREQUENCY 25
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RU configuration parameters */
|
||||
@@ -151,6 +153,7 @@ typedef enum {
|
||||
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, iptr:NULL, defintarrayval:DEFBFW, TYPE_INTARRAY, 0}, \
|
||||
{CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -32,63 +32,358 @@
|
||||
|
||||
#ifndef __NR_RRC_PARAMSVALUES__H__
|
||||
#define __NR_RRC_PARAMSVALUES__H__
|
||||
|
||||
#include "common/config/config_paramdesc.h"
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
|
||||
/* cell configuration section name */
|
||||
#define GNB_CONFIG_STRING_GNB_LIST "gNBs"
|
||||
/* component carriers configuration section name */
|
||||
#define GNB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
|
||||
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON "servingCellConfigCommon"
|
||||
#define GNB_CONFIG_STRING_PHYSCELLID "physCellId"
|
||||
#define GNB_CONFIG_STRING_NTIMINGADVANCEOFFSET "n_TimingAdvanceOffset"
|
||||
#define GNB_CONFIG_STRING_SUBCARRIERSPACING "subcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_ABSOLUTEFREQUENCYSSB "absoluteFrequencySSB"
|
||||
#define GNB_CONFIG_STRING_DLFREQUENCYBAND "dl_frequencyBand"
|
||||
#define GNB_CONFIG_STRING_DLABSOLUEFREQUENCYPOINTA "dl_absoluteFrequencyPointA"
|
||||
#define GNB_CONFIG_STRING_DLOFFSETTOCARRIER "dl_offstToCarrier"
|
||||
#define GNB_CONFIG_STRING_DLSUBCARRIERSPACING "dl_subcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_DLCARRIERBANDWIDTH "dl_carrierBandwidth"
|
||||
|
||||
#define GNB_CONFIG_STRING_FRAME_TYPE "frame_type"
|
||||
#define GNB_CONFIG_STRING_DL_PREFIX_TYPE "DL_prefix_type"
|
||||
#define GNB_CONFIG_STRING_UL_PREFIX_TYPE "UL_prefix_type"
|
||||
#define GNB_CONFIG_STRING_NR_BAND "nr_band"
|
||||
#define GNB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
|
||||
#define GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
|
||||
#define GNB_CONFIG_STRING_NID_CELL "Nid_cell"
|
||||
#define GNB_CONFIG_STRING_N_RB_DL "N_RB_DL"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPLOCATIONANDBANDWIDTH "initialDLBWPlocationAndBandwidth"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSUBCARRIERSPACING "initialDLBWPsubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPCYCLICPREFIX "initialDLBWPcyclicPrefix"
|
||||
|
||||
#define FRAMETYPE_OKVALUES {"FDD","TDD"}
|
||||
#define FRAMETYPE_MODVALUES { FDD, TDD}
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO "initialDLBWPcontrolResourceSetZero"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO "initialDLBWPsearchSpaceZero"
|
||||
|
||||
#define TDDCFG(A) TDD_Config__subframeAssignment_ ## A
|
||||
#define TDDCONFIG_OKRANGE { TDDCFG(sa0), TDDCFG(sa6)}
|
||||
|
||||
#define TDDCFGS(A) TDD_Config__specialSubframePatterns_ ## A
|
||||
#define TDDCONFIGS_OKRANGE { TDDCFGS(ssp0), TDDCFGS(ssp8)}
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_0 "initialDLBWPk0_0"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0 "initialDLBWPmappingType_0"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0 "initialDLBWPstartSymbolAndLength_0"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_1 "initialDLBWPk0_1"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1 "initialDLBWPmappingType_1"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1 "initialDLBWPstartSymbolAndLength_1"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_2 "initialDLBWPk0_2"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2 "initialDLBWPmappingType_2"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2 "initialDLBWPstartSymbolAndLength_2"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_3 "initialDLBWPk0_3"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3 "initialDLBWPmappingType_3"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3 "initialDLBWPstartSymbolAndLength_3"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_4 "initialDLBWPk0_4"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4 "initialDLBWPmappingType_4"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4 "initialDLBWPstartSymbolAndLength_4"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_5 "initialDLBWPk0_5"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5 "initialDLBWPmappingType_5"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5 "initialDLBWPstartSymbolAndLength_5"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_6 "initialDLBWPk0_6"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6 "initialDLBWPmappingType_6"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6 "initialDLBWPstartSymbolAndLength_6"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_7 "initialDLBWPk0_7"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7 "initialDLBWPmappingType_7"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7 "initialDLBWPstartSymbolAndLength_7"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_8 "initialDLBWPk0_8"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8 "initialDLBWPmappingType_8"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8 "initialDLBWPstartSymbolAndLength_8"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_9 "initialDLBWPk0_9"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9 "initialDLBWPmappingType_9"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9 "initialDLBWPstartSymbolAndLength_9"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_10 "initialDLBWPk0_10"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10 "initialDLBWPmappingType_10"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10 "initialDLBWPstartSymbolAndLength_10"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_11 "initialDLBWPk0_11"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11 "initialDLBWPmappingType_11"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11 "initialDLBWPstartSymbolAndLength_11"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_12 "initialDLBWPk0_12"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12 "initialDLBWPmappingType_12"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12 "initialDLBWPstartSymbolAndLength_12"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_13 "initialDLBWPk0_13"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13 "initialDLBWPmappingType_13"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13 "initialDLBWPstartSymbolAndLength_13"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_14 "initialDLBWPk0_14"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14 "initialDLBWPmappingType_14"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14 "initialDLBWPstartSymbolAndLength_14"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPK0_15 "initialDLBWPk0_15"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15 "initialDLBWPmappingType_15"
|
||||
#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15 "initialDLBWPstartSymbolAndLength_15"
|
||||
|
||||
#define PREFIX_OKVALUES {"NORMAL","EXTENDED"}
|
||||
#define PREFIX_MODVALUES { NORMAL, EXTENDED}
|
||||
#define GNB_CONFIG_STRING_ULFREQUENCYBAND "ul_frequencyBand"
|
||||
#define GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA "ul_absoluteFrequencyPointA"
|
||||
#define GNB_CONFIG_STRING_ULOFFSETTOCARRIER "ul_offstToCarrier"
|
||||
#define GNB_CONFIG_STRING_ULSUBCARRIERSPACING "ul_subcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_ULCARRIERBANDWIDTH "ul_carrierBandwidth"
|
||||
|
||||
#define PREFIXUL_OKVALUES {"NORMAL","EXTENDED"}
|
||||
#define PREFIXUL_MODVALUES { NORMAL, EXTENDED}
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPLOCATIONANDBANDWIDTH "initialULBWPlocationAndBandwidth"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSUBCARRIERSPACING "initialULBWPsubcarrierSpacing"
|
||||
|
||||
#define NRBDL_OKVALUES {6,15,25,50,75,100}
|
||||
#define GNB_CONFIG_STRING_PMAX "pMax"
|
||||
#define GNB_CONFIG_STRING_PRACHCONFIGURATIONINDEX "prach_ConfigurationIndex"
|
||||
#define GNB_CONFIG_STRING_PRACHMSG1FDM "prach_msg1_FDM"
|
||||
#define GNB_CONFIG_STRING_PRACHMSG1FREQUENCYSTART "prach_msg1_FrequencyStart"
|
||||
#define GNB_CONFIG_STRING_ZEROCORRELATIONZONECONFIG "zeroCorrelationZoneConfig"
|
||||
#define GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER "preambleReceivedTargetPower"
|
||||
#define GNB_CONFIG_STRING_PREAMBLETRANSMAX "preambleTransMax"
|
||||
#define GNB_CONFIG_STRING_POWERRAMPINGSTEP "powerRampingStep"
|
||||
#define GNB_CONFIG_STRING_RARESPONSEWINDOW "ra_ResponseWindow"
|
||||
#define GNB_CONFIG_STRING_SSBPERRACHOCCASIONANDCBPREAMBLESPERSSBPR "ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR"
|
||||
#define GNB_CONFIG_STRING_SSBPERRACHOCCASIONANDCBPREAMBLESPERSSB "ssb_perRACH_OccasionAndCB_PreamblesPerSSB"
|
||||
#define GNB_CONFIG_STRING_RACONTENTIONRESOLUTIONTIMER "ra_ContentionResolutionTimer"
|
||||
#define GNB_CONFIG_STRING_RSRPTHRESHOLDSSB "rsrp_ThresholdSSB"
|
||||
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEXPR "prach_RootSequenceIndex_PR"
|
||||
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX "prach_RootSequenceIndex"
|
||||
#define GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING "msg1_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_RESTRICTEDSETCONFIG "restrictedSetConfig"
|
||||
#define GNB_CONFIG_STRING_PUSCHTIMEDOMAINALLOCATIONLIST "puschTimeDomainAllocationList"
|
||||
#define GNB_CONFIG_STRING_MSG3DELTAPREABMLE "msg3_DeltaPreamble"
|
||||
#define GNB_CONFIG_STRING_P0NOMINALWITHGRANT "p0_NominalWithGrant"
|
||||
#define GNB_CONFIG_STRING_PUCCHGROUPHOPPING "pucchGroupHopping"
|
||||
#define GNB_CONFIG_STRING_HOPPINGID "hoppingId"
|
||||
#define GNB_CONFIG_STRING_P0NOMINAL "p0_nominal"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_0 "initialULBWPk2_0"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0 "initialULBWPmappingType_0"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0 "initialULBWPstartSymbolAndLength_0"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_1 "initialULBWPk2_1"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1 "initialULBWPmappingType_1"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1 "initialULBWPstartSymbolAndLength_1"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_2 "initialULBWPk2_2"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2 "initialULBWPmappingType_2"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2 "initialULBWPstartSymbolAndLength_2"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_3 "initialULBWPk2_3"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3 "initialULBWPmappingType_3"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3 "initialULBWPstartSymbolAndLength_3"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_4 "initialULBWPk2_4"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4 "initialULBWPmappingType_4"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4 "initialULBWPstartSymbolAndLength_4"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_5 "initialULBWPk2_5"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5 "initialULBWPmappingType_5"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5 "initialULBWPstartSymbolAndLength_5"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_6 "initialULBWPk2_6"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6 "initialULBWPmappingType_6"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6 "initialULBWPstartSymbolAndLength_6"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_7 "initialULBWPk2_7"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7 "initialULBWPmappingType_7"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7 "initialULBWPstartSymbolAndLength_7"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_8 "initialULBWPk2_8"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8 "initialULBWPmappingType_8"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8 "initialULBWPstartSymbolAndLength_8"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_9 "initialULBWPk2_9"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9 "initialULBWPmappingType_9"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9 "initialULBWPstartSymbolAndLength_9"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_10 "initialULBWPk2_10"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10 "initialULBWPmappingType_10"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10 "initialULBWPstartSymbolAndLength_10"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_11 "initialULBWPk2_11"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11 "initialULBWPmappingType_11"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11 "initialULBWPstartSymbolAndLength_11"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_12 "initialULBWPk2_12"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12 "initialULBWPmappingType_12"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12 "initialULBWPstartSymbolAndLength_12"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_13 "initialULBWPk2_13"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13 "initialULBWPmappingType_13"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13 "initialULBWPstartSymbolAndLength_13"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_14 "initialULBWPk2_14"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14 "initialULBWPmappingType_14"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14 "initialULBWPstartSymbolAndLength_14"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_15 "initialULBWPk2_15"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15 "initialULBWPmappingType_15"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15 "initialULBWPstartSymbolAndLength_15"
|
||||
|
||||
#define NRUETIMER_T300_OKVALUES {100,200,300,400,600,1000,1500,2000}
|
||||
#define NRUETT300(A) NR_UE_TimersAndConstants__t300_ ## A
|
||||
#define NRUETIMER_T300_MODVALUES { NRUETT300(ms100), NRUETT300(ms200), NRUETT300(ms300), NRUETT300(ms400), NRUETT300(ms600), NRUETT300(ms1000), NRUETT300(ms1500), NRUETT300(ms2000)}
|
||||
|
||||
#define NRUETIMER_T301_OKVALUES {100,200,300,400,600,1000,1500,2000}
|
||||
#define NRUETT301(A) NR_UE_TimersAndConstants__t301_ ## A
|
||||
#define NRUETIMER_T301_MODVALUES { NRUETT301(ms100), NRUETT301(ms200), NRUETT301(ms300), NRUETT301(ms400), NRUETT301(ms600), NRUETT301(ms1000), NRUETT301(ms1500), NRUETT301(ms2000)}
|
||||
#define GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR "ssb_PositionsInBurst_PR"
|
||||
#define GNB_CONFIG_STRING_SSBPOSITIONSINBURST "ssb_PositionsInBurst_Bitmap"
|
||||
#define GNB_CONFIG_STRING_SSBPERIODICITYSERVINGCELL "ssb_periodicityServingCell"
|
||||
#define GNB_CONFIG_STRING_DMRSTYPEAPOSITION "dmrs_TypeA_Position"
|
||||
#define GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING "referenceSubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_DLULTRANSMISSIONPERIODICITY "dl_UL_TransmissionPeriodicity"
|
||||
#define GNB_CONFIG_STRING_NROFDOWNLINKSLOTS "nrofDownlinkSlots"
|
||||
#define GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS "nrofDownlinkSymbols"
|
||||
#define GNB_CONFIG_STRING_NROFUPLINKSLOTS "nrofUplinkSlots"
|
||||
#define GNB_CONFIG_STRING_NROFUPLINKSYMBOLS "nrofUplinkSymbols"
|
||||
#define GNB_CONFIG_STRING_DLULTRANSMISSIONPERIODICITY2 "dl_UL_TransmissionPeriodicity2"
|
||||
#define GNB_CONFIG_STRING_NROFDOWNLINKSLOTS2 "nrofDownlinkSlots2"
|
||||
#define GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS2 "nrofDownlinkSymbols2"
|
||||
#define GNB_CONFIG_STRING_NROFUPLINKSLOTS2 "nrofUplinkSlots2"
|
||||
#define GNB_CONFIG_STRING_NROFUPLINKSYMBOLS2 "nrofUplinkSymbols2"
|
||||
#define GNB_CONFIG_STRING_SSPBCHBLOCKPOWER "ssPBCH_BlockPower"
|
||||
|
||||
|
||||
#define CARRIERBANDWIDTH_OKVALUES {11,18,24,25,31,32,38,51,52,65,66,78,79,93,106,107,121,132,133,135,160,162,189,216,217,245,264,270,273}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* Serving Cell Config Common configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#define GNB_CONFIG_PHYSCELLID_IDX 0
|
||||
#define GNB_CONFIG_ABSOLUTEFREQUENCYSSB_IDX 5
|
||||
#define GNB_CONFIG_DLFREQUENCYBAND_IDX 6
|
||||
#define GNB_CONFIG_ABSOLUTEFREQUENCYPOINTA_IDX 7
|
||||
#define GNB_CONFIG_DLCARRIERBANDWIDTH_IDX 10
|
||||
|
||||
|
||||
#define SSBPARAMS_DESC {{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET,NULL,0,iptr:&ssb_SubcarrierOffset,defintval:0,TYPE_INT,0}}
|
||||
#define PDSCHANTENNAPARAMS_DESC {{GNB_CONFIG_STRING_PDSCHANTENNAPORTS,NULL,0,iptr:&pdsch_AntennaPorts,defintval:1,TYPE_INT,0}}
|
||||
|
||||
#define SCCPARAMS_DESC(scc) { \
|
||||
{GNB_CONFIG_STRING_PHYSCELLID,NULL,0,i64ptr:scc->physCellId,defint64val:0,TYPE_INT64,0/*0*/}, \
|
||||
{GNB_CONFIG_STRING_NTIMINGADVANCEOFFSET,NULL,0,i64ptr:scc->n_TimingAdvanceOffset,defint64val:NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0,TYPE_INT64,0/*1*/},\
|
||||
{GNB_CONFIG_STRING_SSBPERIODICITYSERVINGCELL,NULL,0,i64ptr:scc->ssb_periodicityServingCell,defint64val:NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20,TYPE_INT64,0/*2*/},\
|
||||
{GNB_CONFIG_STRING_DMRSTYPEAPOSITION,NULL,0,i64ptr:&scc->dmrs_TypeA_Position,defint64val:NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2,TYPE_INT64,0/*3*/},\
|
||||
{GNB_CONFIG_STRING_SUBCARRIERSPACING,NULL,0,i64ptr:scc->ssbSubcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*4*/},\
|
||||
{GNB_CONFIG_STRING_ABSOLUTEFREQUENCYSSB,NULL,0,i64ptr:scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB,defint64val:660960,TYPE_INT64,0/*5*/},\
|
||||
{GNB_CONFIG_STRING_DLFREQUENCYBAND,NULL,0,i64ptr:scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],defint64val:78,TYPE_INT64,0/*6*/},\
|
||||
{GNB_CONFIG_STRING_DLABSOLUEFREQUENCYPOINTA,NULL,0,i64ptr:&scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA,defint64val:660000,TYPE_INT64,0/*7*/},\
|
||||
{GNB_CONFIG_STRING_DLOFFSETTOCARRIER,NULL,0,i64ptr:&scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier,defint64val:0,TYPE_INT64,0/*8*/},\
|
||||
{GNB_CONFIG_STRING_DLSUBCARRIERSPACING,NULL,0,i64ptr:&scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*9*/},\
|
||||
{GNB_CONFIG_STRING_DLCARRIERBANDWIDTH,NULL,0,i64ptr:&scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,defint64val:217,TYPE_INT64,0 /*10*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPLOCATIONANDBANDWIDTH,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,defint64val:13036,TYPE_INT64,0/*11*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSUBCARRIERSPACING,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*12*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero,defint64val:12,TYPE_INT64,0/*13*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero,defint64val:0,TYPE_INT64,0/*14*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_0,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0,defint64val:-1,TYPE_INT64,0/*15*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:-1,TYPE_INT64,0/*16*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:-1,TYPE_INT64,0/*17*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_1,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0,defint64val:-1,TYPE_INT64,0/*18*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*19*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*20*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_2,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0,defint64val:-1,TYPE_INT64,0/*21*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*22*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*23*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_3,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0,defint64val:-1,TYPE_INT64,0/*24*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*25*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*26*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_4,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0,defint64val:-1,TYPE_INT64,0/*27*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*28*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*29*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_5,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0,defint64val:-1,TYPE_INT64,0/*30*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*31*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*32*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_6,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0,defint64val:-1,TYPE_INT64,0/*33*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*34*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*35*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_7,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0,defint64val:-1,TYPE_INT64,0/*36*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*37*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*38*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_8,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0,defint64val:-1,TYPE_INT64,0/*39*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*40*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*41*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_9,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0,defint64val:-1,TYPE_INT64,0/*42*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*43*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*44*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_10,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0,defint64val:-1,TYPE_INT64,0/*45*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*46*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*47*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_11,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0,defint64val:-1,TYPE_INT64,0/*48*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*49*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*50*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_12,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0,defint64val:-1,TYPE_INT64,0/*51*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*52*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*53*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_13,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0,defint64val:-1,TYPE_INT64,0/*54*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*55*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*56*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_14,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0,defint64val:-1,TYPE_INT64,0/*57*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*58*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*59*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_15,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0,defint64val:-1,TYPE_INT64,0/*60*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*61*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*62*/},\
|
||||
{GNB_CONFIG_STRING_ULFREQUENCYBAND,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],defint64val:-1,TYPE_INT64,0/*63*/},\
|
||||
{GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA,defint64val:-1,TYPE_INT64,0/*64*/},\
|
||||
{GNB_CONFIG_STRING_ULOFFSETTOCARRIER,NULL,0,i64ptr:&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier,defint64val:0,TYPE_INT64,0/*65*/},\
|
||||
{GNB_CONFIG_STRING_ULSUBCARRIERSPACING,NULL,0,i64ptr:&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*66*/},\
|
||||
{GNB_CONFIG_STRING_ULCARRIERBANDWIDTH,NULL,0,i64ptr:&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,defint64val:217,TYPE_INT64,0/*67*/},\
|
||||
{GNB_CONFIG_STRING_PMAX,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->p_Max,defint64val:20,TYPE_INT64,0/*68*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPLOCATIONANDBANDWIDTH,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth,defint64val:13036,TYPE_INT64,0/*69*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSUBCARRIERSPACING,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0 /*70*/}, \
|
||||
{GNB_CONFIG_STRING_PRACHCONFIGURATIONINDEX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex,defint64val:98,TYPE_INT64,0/*71*/},\
|
||||
{GNB_CONFIG_STRING_PRACHMSG1FDM,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM,defint64val:NR_RACH_ConfigGeneric__msg1_FDM_one,TYPE_INT64,0/*72*/},\
|
||||
{GNB_CONFIG_STRING_PRACHMSG1FREQUENCYSTART,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart,defint64val:0,TYPE_INT64,0/*73*/},\
|
||||
{GNB_CONFIG_STRING_ZEROCORRELATIONZONECONFIG,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig,defint64val:13,TYPE_INT64,0/*74*/},\
|
||||
{GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower,defintval:-118,TYPE_INT64,0/*75*/},\
|
||||
{GNB_CONFIG_STRING_PREAMBLETRANSMAX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax,defint64val:NR_RACH_ConfigGeneric__preambleTransMax_n10,TYPE_INT64,0/*76*/},\
|
||||
{GNB_CONFIG_STRING_POWERRAMPINGSTEP,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep,defint64val:NR_RACH_ConfigGeneric__powerRampingStep_dB2,TYPE_INT64,0/*77*/},\
|
||||
{GNB_CONFIG_STRING_RARESPONSEWINDOW,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow,defint64val:NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20,TYPE_INT64,0/*78*/},\
|
||||
{GNB_CONFIG_STRING_SSBPERRACHOCCASIONANDCBPREAMBLESPERSSBPR,NULL,0,uptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present,defuintval:NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one,TYPE_UINT,0/*79*/},\
|
||||
{GNB_CONFIG_STRING_SSBPERRACHOCCASIONANDCBPREAMBLESPERSSB,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one,defint64val:NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64,TYPE_INT64,0 /*80*/}, \
|
||||
{GNB_CONFIG_STRING_RACONTENTIONRESOLUTIONTIMER,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer,defint64val:NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64,TYPE_INT64,0/*81*/},\
|
||||
{GNB_CONFIG_STRING_RSRPTHRESHOLDSSB,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB,defint64val:19,TYPE_INT64,0/*82*/},\
|
||||
{GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEXPR,NULL,0,uptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present,defuintval:NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139,TYPE_UINT,0/*83*/},\
|
||||
{GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139,defint64val:0,TYPE_INT64,0/*84*/},\
|
||||
{GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,defintval:NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_0,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2,defint64val:-1,TYPE_INT64,0/*86*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,/*87*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:55,TYPE_INT64,0/*88*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_1,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2,defint64val:-1,TYPE_INT64,0/*89*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_2,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_3,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_4,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*99*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_5,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_6,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_7,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*109*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_8,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_9,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_10,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_11,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2,defint64val:-1,TYPE_INT64,0/*119*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_12,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_13,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_14,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*129*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_15,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSG3DELTAPREABMLE, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble,defint64val:1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_P0NOMINALWITHGRANT, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant,defint64val:1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_PUCCHGROUPHOPPING, NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,defint64val:NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_HOPPINGID, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId,defint64val:40,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_P0NOMINAL, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal,defint64val:1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR,NULL,0,uptr:&scc->ssb_PositionsInBurst->present,defuintval:NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap,TYPE_UINT,0/*139*/}, \
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURST,NULL,0,u64ptr:&ssb_bitmap,defintval:0xff,TYPE_UINT64,0}, \
|
||||
{GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_DLULTRANSMISSIONPERIODICITY,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity,defint64val:NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms0p5,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFDOWNLINKSLOTS,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,defint64val:7,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols,defint64val:6,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSLOTS,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots,defint64val:2,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSYMBOLS,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols,defint64val:4,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_DLULTRANSMISSIONPERIODICITY2,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity,defintval:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFDOWNLINKSLOTS2,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS2,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSLOTS2,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSYMBOLS2,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_SSPBCHBLOCKPOWER,NULL,0,i64ptr:&scc->ss_PBCH_BlockPower,defint64val:20,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing,defintval:-1,TYPE_INT64,0/*86*/}}
|
||||
|
||||
#define NRUETIMER_T310_OKVALUES {0,50,100,200,500,1000,2000}
|
||||
#define NRUETT310(A) NR_UE_TimersAndConstants__t310_ ## A
|
||||
#define NRUETIMER_T310_MODVALUES { NRUETT310(ms0), NRUETT310(ms50), NRUETT310(ms100), NRUETT310(ms200), NRUETT310(ms500), NRUETT310(ms1000), NRUETT310(ms2000)}
|
||||
|
||||
#define NRUETIMER_T311_OKVALUES {1000,3000,5000,10000,15000,20000,30000}
|
||||
#define NRUETT311(A) NR_UE_TimersAndConstants__t311_ ## A
|
||||
#define NRUETIMER_T311_MODVALUES { NRUETT311(ms1000), NRUETT311(ms3000), NRUETT311(ms5000), NRUETT311(ms10000), NRUETT311(ms15000), NRUETT311(ms20000), NRUETT311(ms30000)}
|
||||
|
||||
#define NRUETIMER_T319_OKVALUES {100,200,300,400,600,1000,1500,2000}
|
||||
#define NRUETT319(A) NR_UE_TimersAndConstants__t319_ ## A
|
||||
#define NRUETIMER_T319_MODVALUES { NRUETT319(ms100), NRUETT319(ms200), NRUETT319(ms300), NRUETT319(ms400), NRUETT319(ms600), NRUETT319(ms1000), NRUETT319(ms1500), NRUETT319(ms2000}
|
||||
|
||||
#define NRUETIMER_N310_OKVALUES {1,2,3,4,6,8,10,20}
|
||||
#define NRUETN310(A) NR_UE_TimersAndConstants__n310_ ## A
|
||||
#define NRUETIMER_N310_MODVALUES { NRUETN310(n1), NRUETN310(n2), NRUETN310(n3), NRUETN310(n4), NRUETN310(n6), NRUETN310(n8), NRUETN310(n10), NRUETN310(n20)}
|
||||
|
||||
#define NRUETIMER_N311_OKVALUES {1,2,3,4,5,6,8,10}
|
||||
#define NRUETN311(A) NR_UE_TimersAndConstants__n311_ ## A
|
||||
#define NRUETIMER_N311_MODVALUES { NRUETN311(n1), NRUETN311(n2), NRUETN311(n3), NRUETN311(n4), NRUETN311(n5), NRUETN311(n6), NRUETN311(n8), NRUETN311(n10)}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
#include "x2ap_eNB.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
@@ -45,13 +46,10 @@
|
||||
|
||||
extern unsigned char NB_gNB_INST;
|
||||
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#define GNB_REGISTER_RETRY_DELAY 10
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static void configure_nr_rrc(uint32_t gnb_id)
|
||||
{
|
||||
@@ -106,13 +104,34 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//,
|
||||
}
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end) {
|
||||
uint32_t gnb_id;
|
||||
MessageDef *msg_p;
|
||||
uint32_t register_gnb_x2_pending = 0;
|
||||
|
||||
for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) {
|
||||
{
|
||||
msg_p = itti_alloc_new_message (TASK_GNB_APP, X2AP_REGISTER_ENB_REQ);
|
||||
LOG_I(X2AP, "GNB_ID: %d \n", gnb_id);
|
||||
RCconfig_NR_X2(msg_p, gnb_id);
|
||||
itti_send_msg_to_task (TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
register_gnb_x2_pending++;
|
||||
}
|
||||
}
|
||||
|
||||
return register_gnb_x2_pending;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void *gNB_app_task(void *args_p)
|
||||
{
|
||||
|
||||
uint32_t gnb_nb = RC.nb_nr_inst;
|
||||
uint32_t gnb_id_start = 0;
|
||||
uint32_t gnb_id_end = gnb_id_start + gnb_nb;
|
||||
uint32_t x2_register_gnb_pending = 0;
|
||||
uint32_t gnb_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
const char *msg_name = NULL;
|
||||
@@ -149,6 +168,11 @@ void *gNB_app_task(void *args_p)
|
||||
configure_nr_rrc(gnb_id);
|
||||
}
|
||||
|
||||
if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(RC.rrc[0]->node_type)
|
||||
LOG_I(X2AP, "X2AP enabled \n");
|
||||
x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end);
|
||||
}
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
/* Try to register each gNB */
|
||||
//registered_gnb = 0;
|
||||
|
||||
+484
-2295
File diff suppressed because it is too large
Load Diff
@@ -103,6 +103,7 @@ extern void NRRCConfig(void);
|
||||
|
||||
void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
|
||||
int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i);
|
||||
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
|
||||
|
||||
#endif /* GNB_CONFIG_H_ */
|
||||
/** @} */
|
||||
|
||||
+32
-654
@@ -111,6 +111,29 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd"
|
||||
#define GNB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd"
|
||||
|
||||
typedef struct ccparams_nr_x2 {
|
||||
char *frame_type;
|
||||
int32_t tdd_config;
|
||||
int32_t tdd_config_s;
|
||||
int32_t nr_band;
|
||||
long long int downlink_frequency;
|
||||
int32_t uplink_frequency_offset;
|
||||
int32_t Nid_cell;
|
||||
int32_t N_RB_DL;
|
||||
} ccparams_nr_x2_t;
|
||||
|
||||
|
||||
#define CCPARAMS_NR_X2_DESC(ccparams) { \
|
||||
{ENB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&ccparams.frame_type, defstrval:"TDD", TYPE_STRING, 0}, \
|
||||
{ENB_CONFIG_STRING_TDD_CONFIG, NULL, 0, iptr:&ccparams.tdd_config, defintval:3, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_TDD_CONFIG_S, NULL, 0, iptr:&ccparams.tdd_config_s, defintval:0, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_EUTRA_BAND, NULL, 0, iptr:&ccparams.nr_band, defintval:78, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&ccparams.downlink_frequency, defint64val:3600000000, TYPE_UINT64, 0}, \
|
||||
{ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&ccparams.uplink_frequency_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{ENB_CONFIG_STRING_NID_CELL, NULL, 0, iptr:&ccparams.Nid_cell, defintval:0, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_N_RB_DL, NULL, 0, iptr:&ccparams.N_RB_DL, defintval:106, TYPE_UINT, 0} \
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* cell configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -197,660 +220,7 @@ typedef enum {
|
||||
|
||||
|
||||
|
||||
/* component carries configuration parameters name */
|
||||
|
||||
#define GNB_CONFIG_STRING_NB_ANT_PORTS "nb_antenna_ports"
|
||||
#define GNB_CONFIG_STRING_NB_ANT_TX "nb_antennas_tx"
|
||||
#define GNB_CONFIG_STRING_NB_ANT_RX "nb_antennas_rx"
|
||||
#define GNB_CONFIG_STRING_TX_GAIN "tx_gain"
|
||||
#define GNB_CONFIG_STRING_RX_GAIN "rx_gain"
|
||||
|
||||
///NR
|
||||
//MIB
|
||||
#define GNB_CONFIG_STRING_MIB_SUBCARRIERSPACINGCOMMON "MIB_subCarrierSpacingCommon"
|
||||
#define GNB_CONFIG_STRING_MIB_SSB_SUBCARRIEROFFSET "MIB_ssb_SubcarrierOffset"
|
||||
#define GNB_CONFIG_STRING_MIB_DMRS_TYPEA_POSITION "MIB_dmrs_TypeA_Position"
|
||||
#define GNB_CONFIG_STRING_PDCCH_CONFIGSIB1 "pdcch_ConfigSIB1"
|
||||
|
||||
//SIB1
|
||||
#define GNB_CONFIG_STRING_SIB1_FREQUENCYOFFSETSSB "SIB1_frequencyOffsetSSB"
|
||||
#define GNB_CONFIG_STRING_SIB1_SSB_PERIODICITYSERVINGCELL "SIB1_ssb_PeriodicityServingCell"
|
||||
#define GNB_CONFIG_STRING_SIB1_SS_PBCH_BLOCKPOWER "SIB1_ss_PBCH_BlockPower"
|
||||
//NR FREQUENCYINFODL
|
||||
#define GNB_CONFIG_STRING_ABSOLUTEFREQUENCYSSB "absoluteFrequencySSB"
|
||||
#define GNB_CONFIG_STRING_DL_FREQBANDINDICATORNR "DL_FreqBandIndicatorNR"
|
||||
#define GNB_CONFIG_STRING_DL_ABSOLUTEFREQUENCYPOINTA "DL_absoluteFrequencyPointA"
|
||||
|
||||
//NR DL SCS-SPECIFICCARRIER
|
||||
#define GNB_CONFIG_STRING_DL_OFFSETTOCARRIER "DL_offsetToCarrier"
|
||||
#define GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING "DL_SCS_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH "DL_carrierBandwidth"
|
||||
|
||||
// NR BWP-DOWNLINKCOMMON
|
||||
#define GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH "DL_locationAndBandwidth"
|
||||
#define GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING "DL_BWP_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE "DL_BWP_prefix_type"
|
||||
|
||||
//NR FREQUENCYINFOUL
|
||||
#define GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR "UL_FreqBandIndicatorNR"
|
||||
#define GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA "UL_absoluteFrequencyPointA"
|
||||
#define GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION "UL_additionalSpectrumEmission"
|
||||
#define GNB_CONFIG_STRING_UL_P_MAX "UL_p_Max"
|
||||
#define GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ "UL_frequencyShift7p5khz"
|
||||
|
||||
//NR UL SCS-SPECIFICCARRIER
|
||||
#define GNB_CONFIG_STRING_UL_OFFSETTOCARRIER "UL_offsetToCarrier"
|
||||
#define GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING "UL_SCS_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH "UL_carrierBandwidth"
|
||||
|
||||
// NR BWP-UPLINKCOMMON
|
||||
#define GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH "UL_locationAndBandwidth"
|
||||
#define GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING "UL_BWP_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE "UL_BWP_prefix_type"
|
||||
#define GNB_CONFIG_STRING_UL_TIMEALIGNMENTTIMERCOMMON "UL_timeAlignmentTimerCommon"
|
||||
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_N_TIMINGADVANCEOFFSET "ServingCellConfigCommon_n_TimingAdvanceOffset"
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR "ServingCellConfigCommon_ssb_PositionsInBurst_PR"
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL "ServingCellConfigCommon_ssb_periodicityServingCell"
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION "ServingCellConfigCommon_dmrs_TypeA_Position"
|
||||
#define GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING "NIA_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER "ServingCellConfigCommon_ss_PBCH_BlockPower"
|
||||
|
||||
|
||||
//NR TDD-UL-DL-CONFIGCOMMON
|
||||
#define GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING "referenceSubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_DL_UL_TRANSMISSIONPERIODICITY "dl_UL_TransmissionPeriodicity"
|
||||
#define GNB_CONFIG_STRING_NROFDOWNLINKSLOTS "nrofDownlinkSlots"
|
||||
#define GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS "nrofDownlinkSymbols"
|
||||
#define GNB_CONFIG_STRING_NROFUPLINKSLOTS "nrofUplinkSlots"
|
||||
#define GNB_CONFIG_STRING_NROFUPLINKSYMBOLS "nrofUplinkSymbols"
|
||||
|
||||
//NR RACH-CONFIGCOMMON
|
||||
#define GNB_CONFIG_STRING_RACH_TOTALNUMBEROFRA_PREAMBLES "rach_totalNumberOfRA_Preambles"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight"
|
||||
#define GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN "rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen"
|
||||
#define GNB_CONFIG_STRING_RACH_GROUPBCONFIGURED "rach_groupBconfigured"
|
||||
#define GNB_CONFIG_STRING_RACH_RA_MSG3SIZEGROUPA "rach_ra_Msg3SizeGroupA"
|
||||
#define GNB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB "rach_messagePowerOffsetGroupB"
|
||||
#define GNB_CONFIG_STRING_RACH_NUMBEROFRA_PREAMBLESGROUPA "rach_numberOfRA_PreamblesGroupA"
|
||||
#define GNB_CONFIG_STRING_RACH_RA_CONTENTIONRESOLUTIONTIMER "rach_ra_ContentionResolutionTimer"
|
||||
#define GNB_CONFIG_STRING_RSRP_THRESHOLDSSB "rsrp_ThresholdSSB"
|
||||
#define GNB_CONFIG_STRING_RSRP_THRESHOLDSSB_SUL "rsrp_ThresholdSSB_SUL"
|
||||
#define GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_CHOICE "prach_RootSequenceIndex_choice"
|
||||
#define GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L839 "prach_RootSequenceIndex_l839"
|
||||
#define GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L139 "prach_RootSequenceIndex_l139"
|
||||
#define GNB_CONFIG_STRING_PRACH_MSG1_SUBCARRIERSPACING "prach_msg1_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_RESTRICTEDSETCONFIG "restrictedSetConfig"
|
||||
#define GNB_CONFIG_STRING_MSG3_TRANSFORMPRECODING "msg3_transformPrecoding"
|
||||
//SSB-PERRACH-OCCASIONANDCB-PREAMBLESPERSSB NOT SURE
|
||||
|
||||
//NR RACH-CONFIGGENERIC
|
||||
#define GNB_CONFIG_STRING_PRACH_CONFIGURATIONINDEX "prach_ConfigurationIndex"
|
||||
#define GNB_CONFIG_STRING_PRACH_MSG1_FDM "prach_msg1_FDM"
|
||||
#define GNB_CONFIG_STRING_PRACH_MSG1_FREQUENCYSTART "prach_msg1_FrequencyStart"
|
||||
#define GNB_CONFIG_STRING_ZEROCORRELATIONZONECONFIG "zeroCorrelationZoneConfig"
|
||||
#define GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER "preambleReceivedTargetPower"
|
||||
#define GNB_CONFIG_STRING_PREAMBLETRANSMAX "preambleTransMax"
|
||||
#define GNB_CONFIG_STRING_POWERRAMPINGSTEP "powerRampingStep"
|
||||
#define GNB_CONFIG_STRING_RA_RESPONSEWINDOW "ra_ResponseWindow"
|
||||
|
||||
//PUSCH-CONFIGCOMMON
|
||||
#define GNB_CONFIG_STRING_GROUPHOPPINGENABLEDTRANSFORMPRECODING "groupHoppingEnabledTransformPrecoding"
|
||||
#define GNB_CONFIG_STRING_MSG3_DELTAPREAMBLE "msg3_DeltaPreamble"
|
||||
#define GNB_CONFIG_STRING_P0_NOMINALWITHGRANT "p0_NominalWithGrant"
|
||||
|
||||
///PUSCH-TIMEDOMAINRESOURCEALLOCATION
|
||||
#define GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2 "PUSCH_TimeDomainResourceAllocation_k2"
|
||||
#define GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE "PUSCH_TimeDomainResourceAllocation_mappingType"
|
||||
#define GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_STARTSYMBOLANDLENGTH "PUSCH_TimeDomainResourceAllocation_startSymbolAndLength"
|
||||
|
||||
//PUCCH-CONFIGCOMMON
|
||||
#define GNB_CONFIG_STRING_PUCCH_RESOURCECOMMON "pucch_ResourceCommon"
|
||||
#define GNB_CONFIG_STRING_PUCCH_GROUPHOPPING "pucch_GroupHopping"
|
||||
#define GNB_CONFIG_STRING_HOPPINGID "hoppingId"
|
||||
#define GNB_CONFIG_STRING_P0_NOMINAL "p0_nominal"
|
||||
|
||||
//PDSCH-CONFIGCOMMON
|
||||
//PDSCH-TIMEDOMAINRESOURCEALLOCATION
|
||||
#define GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0 "PDSCH_TimeDomainResourceAllocation_k0"
|
||||
#define GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE "PDSCH_TimeDomainResourceAllocation_mappingType"
|
||||
#define GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_STARTSYMBOLANDLENGTH "PDSCH_TimeDomainResourceAllocation_startSymbolAndLength"
|
||||
//RATEMATCHPATTERN IS USED TO CONFIGURE ONE RATE MATCHING PATTERN FOR PDSCH
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNID "rateMatchPatternId"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERN_PATTERNTYPE "RateMatchPattern_patternType"
|
||||
#define GNB_CONFIG_STRING_SYMBOLSINRESOURCEBLOCK "symbolsInResourceBlock"
|
||||
#define GNB_CONFIG_STRING_PERIODICITYANDPATTERN "periodicityAndPattern"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERN_CONTROLRESOURCESET "RateMatchPattern_controlResourceSet"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERN_SUBCARRIERSPACING "RateMatchPattern_subcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERN_MODE "RateMatchPattern_mode"
|
||||
|
||||
//PDCCH-CONFIGCOMMON
|
||||
#define GNB_CONFIG_STRING_CONTROLRESOURCESETZERO "controlResourceSetZero"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACEZERO "searchSpaceZero"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACESIB1 "searchSpaceSIB1"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACEOTHERSYSTEMINFORMATION "searchSpaceOtherSystemInformation"
|
||||
#define GNB_CONFIG_STRING_PAGINGSEARCHSPACE "pagingSearchSpace"
|
||||
#define GNB_CONFIG_STRING_RA_SEARCHSPACE "ra_SearchSpace"
|
||||
//NR PDCCH-CONFIGCOMMON COMMONCONTROLRESOURCESSETS
|
||||
#define GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESETID "PDCCH_common_controlResourceSetId"
|
||||
#define GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESET_DURATION "PDCCH_common_ControlResourceSet_duration"
|
||||
#define GNB_CONFIG_STRING_PDCCH_CCE_REG_MAPPINGTYPE "PDCCH_cce_REG_MappingType"
|
||||
#define GNB_CONFIG_STRING_PDCCH_REG_BUNDLESIZE "PDCCH_reg_BundleSize"
|
||||
#define GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE "PDCCH_interleaverSize"
|
||||
#define GNB_CONFIG_STRING_PDCCH_SHIFTINDEX "PDCCH_shiftIndex"
|
||||
#define GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY "PDCCH_precoderGranularity"
|
||||
#define GNB_CONFIG_STRING_PDCCH_TCI_STATEID "PDCCH_TCI_StateId"
|
||||
#define GNB_CONFIG_STRING_TCI_PRESENTINDCI "tci_PresentInDCI"
|
||||
#define GNB_CONFIG_STRING_PDCCH_DMRS_SCRAMBLINGID "pdcch_DMRS_ScramblingID"
|
||||
|
||||
//NR PDCCH-ConfigCommon commonSearchSpaces
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACEID "SearchSpaceId"
|
||||
#define GNB_CONFIG_STRING_COMMONSEARCHSPACES_CONTROLRESOURCESETID "commonSearchSpaces_controlResourceSetId"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE "SearchSpace_monitoringSlotPeriodicityAndOffset_choice"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_VALUE "SearchSpace_monitoringSlotPeriodicityAndOffset_value"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_DURATION "SearchSpace_duration"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1 "SearchSpace_nrofCandidates_aggregationLevel1"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2 "SearchSpace_nrofCandidates_aggregationLevel2"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4 "SearchSpace_nrofCandidates_aggregationLevel4"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8 "SearchSpace_nrofCandidates_aggregationLevel8"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16 "SearchSpace_nrofCandidates_aggregationLevel16"
|
||||
#define GNB_CONFIG_STRING_SEARCHSPACE_SEARCHSPACETYPE "SearchSpace_searchSpaceType"
|
||||
#define GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1 "Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1"
|
||||
#define GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2 "Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2"
|
||||
#define GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4 "Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4"
|
||||
#define GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8 "Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8"
|
||||
#define GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16 "Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16"
|
||||
#define GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY "Common_dci_Format2_3_monitoringPeriodicity"
|
||||
#define GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES "Common_dci_Format2_3_nrofPDCCH_Candidates"
|
||||
#define GNB_CONFIG_STRING_UE_SPECIFIC__DCI_FORMATS "ue_Specific__dci_Formats"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL "RateMatchPatternLTE_CRS_carrierFreqDL"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL "RateMatchPatternLTE_CRS_carrierBandwidthDL"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS "RateMatchPatternLTE_CRS_nrofCRS_Ports"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_V_SHIFT "RateMatchPatternLTE_CRS_v_Shift"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD "RateMatchPatternLTE_CRS_radioframeAllocationPeriod"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET "RateMatchPatternLTE_CRS_radioframeAllocationOffset"
|
||||
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE "RateMatchPatternLTE_CRS_subframeAllocation_choice"
|
||||
|
||||
/* init for checkedparam_t structure */
|
||||
|
||||
#define NRCCPARAMS_CHECK { \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
{ .s5= {NULL }} , \
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* component carriers configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt checked_param */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define NRCCPARAMS_DESC { \
|
||||
{GNB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&frame_type, defstrval:"TDD", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_PREFIX_TYPE, NULL, 0, strptr:&DL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_PREFIX_TYPE, NULL, 0, strptr:&UL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_NR_BAND, NULL, 0, iptr:&nr_band, defintval:78, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:3600000000, TYPE_UINT64, 0}, \
|
||||
{GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&uplink_frequency_offset, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_NID_CELL, NULL, 0, iptr:&Nid_cell, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_N_RB_DL, NULL, 0, iptr:&N_RB_DL, defintval:25, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_NB_ANT_PORTS, NULL, 0, iptr:&nb_antenna_ports, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_MIB_SUBCARRIERSPACINGCOMMON, NULL, 0, iptr:&MIB_subCarrierSpacingCommon, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_MIB_SSB_SUBCARRIEROFFSET, NULL, 0, iptr:&MIB_ssb_SubcarrierOffset, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_MIB_DMRS_TYPEA_POSITION, NULL, 0, iptr:&MIB_dmrs_TypeA_Position, defintval:2, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_CONFIGSIB1, NULL, 0, iptr:&pdcch_ConfigSIB1, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SIB1_FREQUENCYOFFSETSSB, NULL, 0, strptr:&SIB1_frequencyOffsetSSB, defstrval:"khz5", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SIB1_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&SIB1_ssb_PeriodicityServingCell, defintval:5, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SIB1_SS_PBCH_BLOCKPOWER, NULL, 0, iptr:&SIB1_ss_PBCH_BlockPower, defintval:-60, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_ABSOLUTEFREQUENCYSSB, NULL, 0, iptr:&absoluteFrequencySSB, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_FREQBANDINDICATORNR, NULL, 0, iptr:&DL_FreqBandIndicatorNR, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&DL_absoluteFrequencyPointA, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_OFFSETTOCARRIER, NULL, 0, iptr:&DL_offsetToCarrier, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING, NULL, 0, strptr:&DL_SCS_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH, NULL, 0, iptr:&DL_carrierBandwidth, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&DL_locationAndBandwidth, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING, NULL, 0, strptr:&DL_BWP_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE, NULL, 0, strptr:&DL_BWP_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR, NULL, 0, iptr:&UL_FreqBandIndicatorNR, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&UL_absoluteFrequencyPointA, defintval:13, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION, NULL, 0, iptr:&UL_additionalSpectrumEmission, defintval:3, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_P_MAX, NULL, 0, iptr:&UL_p_Max, defintval:-1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ, NULL, 0, strptr:&UL_frequencyShift7p5khz, defstrval:"TRUE", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_OFFSETTOCARRIER, NULL, 0, iptr:&UL_offsetToCarrier, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING, NULL, 0, strptr:&UL_SCS_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH, NULL, 0, iptr:&UL_carrierBandwidth, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&UL_locationAndBandwidth, defintval:15, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING, NULL, 0, strptr:&UL_BWP_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, strptr:&UL_BWP_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_UL_TIMEALIGNMENTTIMERCOMMON, NULL, 0, strptr:&UL_timeAlignmentTimerCommon, defstrval:"infinity", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_N_TIMINGADVANCEOFFSET, NULL, 0, strptr:&ServingCellConfigCommon_n_TimingAdvanceOffset, defstrval:"n0", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, i64ptr:(int64_t *)&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defint64val:0, TYPE_UINT64, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, strptr:&NIA_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER, NULL, 0, iptr:&ServingCellConfigCommon_ss_PBCH_BlockPower, defintval:-60, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING, NULL, 0, strptr:&referenceSubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_DL_UL_TRANSMISSIONPERIODICITY, NULL, 0, strptr:&dl_UL_TransmissionPeriodicity, defstrval:"ms0p5", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_NROFDOWNLINKSLOTS, NULL, 0, iptr:&nrofDownlinkSlots, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS, NULL, 0, iptr:&nrofDownlinkSymbols, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSLOTS, NULL, 0, iptr:&nrofUplinkSlots, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSYMBOLS, NULL, 0, iptr:&nrofUplinkSymbols, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_TOTALNUMBEROFRA_PREAMBLES, NULL, 0, iptr:&rach_totalNumberOfRA_Preambles, defintval:63, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE, NULL, 0, strptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice, defstrval:"oneEighth", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth, defintval:4, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth, defintval:8, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf, defintval:16, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one, defintval:24, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two, defintval:32, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four, defintval:8, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight, defintval:4, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen, defintval:2, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_GROUPBCONFIGURED, NULL, 0, strptr:&rach_groupBconfigured, defstrval:"ENABLE", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_RA_MSG3SIZEGROUPA, NULL, 0, iptr:&rach_ra_Msg3SizeGroupA, defintval:56, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, NULL, 0, strptr:&rach_messagePowerOffsetGroupB, defstrval:"dB0", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_NUMBEROFRA_PREAMBLESGROUPA, NULL, 0, iptr:&rach_numberOfRA_PreamblesGroupA, defintval:32, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RACH_RA_CONTENTIONRESOLUTIONTIMER, NULL, 0, iptr:&rach_ra_ContentionResolutionTimer, defintval:8, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RSRP_THRESHOLDSSB, NULL, 0, iptr:&rsrp_ThresholdSSB, defintval:64, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RSRP_THRESHOLDSSB_SUL, NULL, 0, iptr:&rsrp_ThresholdSSB_SUL, defintval:64, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_CHOICE, NULL, 0, strptr:&prach_RootSequenceIndex_choice, defstrval:"l839", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L839, NULL, 0, iptr:&prach_RootSequenceIndex_l839, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L139, NULL, 0, iptr:&prach_RootSequenceIndex_l139, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PRACH_MSG1_SUBCARRIERSPACING, NULL, 0, strptr:&prach_msg1_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_RESTRICTEDSETCONFIG, NULL, 0, strptr:&restrictedSetConfig, defstrval:"unrestrictedSet", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_MSG3_TRANSFORMPRECODING, NULL, 0, strptr:&msg3_transformPrecoding, defstrval:"ENABLE", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PRACH_CONFIGURATIONINDEX, NULL, 0, iptr:&prach_ConfigurationIndex, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PRACH_MSG1_FDM, NULL, 0, strptr:&prach_msg1_FDM, defstrval:"one", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PRACH_MSG1_FREQUENCYSTART, NULL, 0, iptr:&prach_msg1_FrequencyStart, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_ZEROCORRELATIONZONECONFIG, NULL, 0, iptr:&zeroCorrelationZoneConfig, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER, NULL, 0, iptr:&preambleReceivedTargetPower, defintval:-150, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PREAMBLETRANSMAX, NULL, 0, iptr:&preambleTransMax, defintval:6, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_POWERRAMPINGSTEP, NULL, 0, strptr:&powerRampingStep, defstrval:"dB0", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_RA_RESPONSEWINDOW, NULL, 0, iptr:&ra_ResponseWindow, defintval:8, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_GROUPHOPPINGENABLEDTRANSFORMPRECODING, NULL, 0, strptr:&groupHoppingEnabledTransformPrecoding, defstrval:"ENABLE", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_MSG3_DELTAPREAMBLE, NULL, 0, iptr:&msg3_DeltaPreamble, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_P0_NOMINALWITHGRANT, NULL, 0, iptr:&p0_NominalWithGrant, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2, NULL, 0, iptr:&PUSCH_TimeDomainResourceAllocation_k2, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE, NULL, 0, strptr:&PUSCH_TimeDomainResourceAllocation_mappingType, defstrval:"typeA", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_STARTSYMBOLANDLENGTH, NULL, 0, iptr:&PUSCH_TimeDomainResourceAllocation_startSymbolAndLength, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUCCH_RESOURCECOMMON, NULL, 0, iptr:&pucch_ResourceCommon, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUCCH_GROUPHOPPING, NULL, 0, strptr:&pucch_GroupHopping, defstrval:"neither", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_HOPPINGID, NULL, 0, iptr:&hoppingId, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_P0_NOMINAL, NULL, 0, iptr:&p0_nominal, defintval:-30, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0, NULL, 0, iptr:&PDSCH_TimeDomainResourceAllocation_k0, defintval:2, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE, NULL, 0, strptr:&PDSCH_TimeDomainResourceAllocation_mappingType, defstrval:"typeA", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_STARTSYMBOLANDLENGTH, NULL, 0, iptr:&PDSCH_TimeDomainResourceAllocation_startSymbolAndLength, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNID, NULL, 0, iptr:&rateMatchPatternId, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERN_PATTERNTYPE, NULL, 0, strptr:&RateMatchPattern_patternType, defstrval:"bitmaps", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SYMBOLSINRESOURCEBLOCK, NULL, 0, strptr:&symbolsInResourceBlock, defstrval:"oneSlot", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PERIODICITYANDPATTERN, NULL, 0, iptr:&periodicityAndPattern, defintval:2, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERN_CONTROLRESOURCESET, NULL, 0, iptr:&RateMatchPattern_controlResourceSet, defintval:5, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERN_SUBCARRIERSPACING, NULL, 0, strptr:&RateMatchPattern_subcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERN_MODE, NULL, 0, strptr:&RateMatchPattern_mode, defstrval:"dynamic", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_CONTROLRESOURCESETZERO, NULL, 0, iptr:&controlResourceSetZero, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACEZERO, NULL, 0, iptr:&searchSpaceZero, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACESIB1, NULL, 0, iptr:&searchSpaceSIB1, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACEOTHERSYSTEMINFORMATION, NULL, 0, iptr:&searchSpaceOtherSystemInformation, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PAGINGSEARCHSPACE, NULL, 0, iptr:&pagingSearchSpace, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RA_SEARCHSPACE, NULL, 0, iptr:&ra_SearchSpace, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESETID, NULL, 0, iptr:&PDCCH_common_controlResourceSetId, defintval:5, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESET_DURATION, NULL, 0, iptr:&PDCCH_common_ControlResourceSet_duration, defintval:2, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_CCE_REG_MAPPINGTYPE, NULL, 0, strptr:&PDCCH_cce_REG_MappingType, defstrval:"nonInterleaved", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_REG_BUNDLESIZE, NULL, 0, iptr:&PDCCH_reg_BundleSize, defintval:3, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE, NULL, 0, iptr:&PDCCH_interleaverSize, defintval:3, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_SHIFTINDEX, NULL, 0, iptr:&PDCCH_shiftIndex, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY, NULL, 0, strptr:&PDCCH_precoderGranularity, defstrval:"sameAsREG-bundle", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_TCI_STATEID, NULL, 0, iptr:&PDCCH_TCI_StateId, defintval:32, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_TCI_PRESENTINDCI, NULL, 0, strptr:&tci_PresentInDCI, defstrval:"ENABLE", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_PDCCH_DMRS_SCRAMBLINGID, NULL, 0, iptr:&PDCCH_DMRS_ScramblingID, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACEID, NULL, 0, iptr:&SearchSpaceId, defintval:10, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMONSEARCHSPACES_CONTROLRESOURCESETID, NULL, 0, iptr:&commonSearchSpaces_controlResourceSetId, defintval:5, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE, NULL, 0, strptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_choice, defstrval:"sl1", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_VALUE, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_value, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_DURATION, NULL, 0, iptr:&SearchSpace_duration, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel1, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel2, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel4, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel8, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel16, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SEARCHSPACE_SEARCHSPACETYPE, NULL, 0, strptr:&SearchSpace_searchSpaceType, defstrval:"common", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY, NULL, 0, iptr:&Common_dci_Format2_3_monitoringPeriodicity, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES, NULL, 0, iptr:&Common_dci_Format2_3_nrofPDCCH_Candidates, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_UE_SPECIFIC__DCI_FORMATS, NULL, 0, strptr:&ue_Specific__dci_Formats, defstrval:"formats0-0-And-1-0", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL, NULL, 0, iptr:&RateMatchPatternLTE_CRS_carrierFreqDL, defintval:6, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL, NULL, 0, iptr:&RateMatchPatternLTE_CRS_carrierBandwidthDL, defintval:6, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS, NULL, 0, iptr:&RateMatchPatternLTE_CRS_nrofCRS_Ports, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_V_SHIFT, NULL, 0, iptr:&RateMatchPatternLTE_CRS_v_Shift, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD, NULL, 0, iptr:&RateMatchPatternLTE_CRS_radioframeAllocationPeriod, defintval:1, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET, NULL, 0, iptr:&RateMatchPatternLTE_CRS_radioframeAllocationOffset, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE, NULL, 0, strptr:&RateMatchPatternLTE_CRS_subframeAllocation_choice, defstrval:"oneFrame", TYPE_STRING, 0}, \
|
||||
}
|
||||
|
||||
|
||||
/* component carries configuration parameters name */
|
||||
#define GNB_CONFIG_FRAME_TYPE_IDX 0
|
||||
#define GNB_CONFIG_DL_PREFIX_TYPE_IDX 1
|
||||
#define GNB_CONFIG_UL_PREFIX_TYPE_IDX 2
|
||||
#define GNB_CONFIG_NR_BAND_IDX 3
|
||||
#define GNB_CONFIG_DOWNLINK_FREQUENCY_IDX 4
|
||||
#define GNB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 5
|
||||
#define GNB_CONFIG_NID_CELL_IDX 6
|
||||
#define GNB_CONFIG_N_RB_DL_IDX 7
|
||||
#define GNB_CONFIG_NB_ANT_PORTS_IDX 8
|
||||
#define GNB_CONFIG_NB_ANT_TX_IDX 9
|
||||
#define GNB_CONFIG_NB_ANT_RX_IDX 10
|
||||
#define GNB_CONFIG_TX_GAIN_IDX 11
|
||||
#define GNB_CONFIG_RX_GAIN_IDX 12
|
||||
#define GNB_CONFIG_MIB_SUBCARRIERSPACINGCOMMON_IDX 13
|
||||
#define GNB_CONFIG_MIB_SSB_SUBCARRIEROFFSET_IDX 14
|
||||
#define GNB_CONFIG_MIB_DMRS_TYPEA_POSITION_IDX 15
|
||||
#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX 16
|
||||
#define GNB_CONFIG_SIB1_FREQUENCYOFFSETSSB_IDX 17
|
||||
#define GNB_CONFIG_SIB1_SSB_PERIODICITYSERVINGCELL_IDX 18
|
||||
#define GNB_CONFIG_SIB1_SS_PBCH_BLOCKPOWER_IDX 19
|
||||
#define GNB_CONFIG_ABSOLUTEFREQUENCYSSB_IDX 20
|
||||
#define GNB_CONFIG_DL_FREQBANDINDICATORNR_IDX 22
|
||||
#define GNB_CONFIG_DL_ABSOLUTEFREQUENCYPOINTA_IDX 23
|
||||
#define GNB_CONFIG_DL_OFFSETTOCARRIER_IDX 24
|
||||
#define GNB_CONFIG_DL_SUBCARRIERSPACING_IDX 25
|
||||
#define GNB_CONFIG_DL_CARRIERBANDWIDTH_IDX 27
|
||||
#define GNB_CONFIG_DL_LOCATIONANDBANDWIDTH_IDX 28
|
||||
#define GNB_CONFIG_DL_BWP_SUBCARRIERSPACING_IDX 29
|
||||
#define GNB_CONFIG_DL_BWP_PREFIX_TYPE_IDX 30
|
||||
#define GNB_CONFIG_UL_FREQBANDINDICATORNR_IDX 31
|
||||
#define GNB_CONFIG_UL_ABSOLUTEFREQUENCYPOINTA_IDX 32
|
||||
#define GNB_CONFIG_UL_ADDITIONALSPECTRUMEMISSION_IDX 33
|
||||
#define GNB_CONFIG_UL_P_MAX_IDX 34
|
||||
#define GNB_CONFIG_UL_FREQUENCYSHIFT7P5KHZ_IDX 35
|
||||
#define GNB_CONFIG_UL_OFFSETTOCARRIER_IDX 36
|
||||
#define GNB_CONFIG_UL_SCS_SUBCARRIERSPACING_IDX 37
|
||||
#define GNB_CONFIG_UL_CARRIERBANDWIDTH_IDX 39
|
||||
#define GNB_CONFIG_UL_LOCATIONANDBANDWIDTH_IDX 41
|
||||
#define GNB_CONFIG_UL_BWP_SUBCARRIERSPACING_IDX 42
|
||||
#define GNB_CONFIG_UL_BWP_PREFIX_TYPE_IDX 43
|
||||
#define GNB_CONFIG_TIMEALIGNMENTTIMERCOMMON_IDX 44
|
||||
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_N_TIMINGADVANCEOFFSET_IDX
|
||||
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR_IDX 45
|
||||
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL_IDX 46
|
||||
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION_IDX 47
|
||||
#define GNB_CONFIG_NIA_SUBCARRIERSPACING_IDX 48
|
||||
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER_IDX 49
|
||||
#define GNB_CONFIG_REFERENCESUBCARRIERSPACING_IDX 50
|
||||
#define GNB_CONFIG_DL_UL_TRANSMISSIONPERIODICITY_IDX 51
|
||||
#define GNB_CONFIG_NROFDOWNLINKSLOTS_IDX 52
|
||||
#define GNB_CONFIG_NROFDOWNLINKSYMBOLS_IDX 53
|
||||
#define GNB_CONFIG_NROFUPLINKSLOTS_IDX 54
|
||||
#define GNB_CONFIG_NROFUPLINKSYMBOLS_IDX 55
|
||||
#define GNB_CONFIG_RACH_TOTALNUMBEROFRA_PREAMBLES_IDX 56
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE_IDX 57
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH_IDX 58
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH_IDX 59
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF_IDX 60
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE_IDX 61
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO_IDX 62
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR_IDX 63
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT_IDX 64
|
||||
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN_IDX 65
|
||||
#define GNB_CONFIG_RACH_GROUPBCONFIGURED_IDX 66
|
||||
#define GNB_CONFIG_RACH_RA_MSG3SIZEGROUPA_IDX 67
|
||||
#define GNB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX 68
|
||||
#define GNB_CONFIG_RACH_NUMBEROFRA_PREAMBLESGROUPA_IDX 69
|
||||
#define GNB_CONFIG_RACH_RA_CONTENTIONRESOLUTIONTIMER_IDX 70
|
||||
#define GNB_CONFIG_RSRP_THRESHOLDSSB_IDX 71
|
||||
#define GNB_CONFIG_RSRP_THRESHOLDSSB_SUL_IDX 72
|
||||
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_CHOICE_IDX 73
|
||||
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L839_IDX 74
|
||||
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L139_IDX 75
|
||||
#define GNB_CONFIG_PRACH_MSG1_SUBCARRIERSPACING_IDX 76
|
||||
#define GNB_CONFIG_RESTRICTEDSETCONFIG_IDX 77
|
||||
#define GNB_CONFIG_MSG3_TRANSFORMPRECODING_IDX 78
|
||||
#define GNB_CONFIG_PRACH_CONFIGURATIONINDEX_IDX 79
|
||||
#define GNB_CONFIG_PRACH_MSG1_FDM_IDX 80
|
||||
#define GNB_CONFIG_PRACH_MSG1_FREQUENCYSTART_IDX 81
|
||||
#define GNB_CONFIG_ZEROCORRELATIONZONECONFIG_IDX 82
|
||||
#define GNB_CONFIG_PREAMBLERECEIVEDTARGETPOWER_IDX 83
|
||||
#define GNB_CONFIG_PREAMBLETRANSMAX_IDX 84
|
||||
#define GNB_CONFIG_POWERRAMPINGSTEP_IDX 85
|
||||
#define GNB_CONFIG_RA_RESPONSEWINDOW_IDX 86
|
||||
#define GNB_CONFIG_GROUPHOPPINGENABLEDTRANSFORMPRECODING_IDX 87
|
||||
#define GNB_CONFIG_MSG3_DELTAPREAMBLE_IDX 88
|
||||
#define GNB_CONFIG_P0_NOMINALWITHGRANT_IDX 89
|
||||
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2_IDX 90
|
||||
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 91
|
||||
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_STARTSYMBOLANDLENGTH_IDX 92
|
||||
#define GNB_CONFIG_PUCCH_RESOURCECOMMON_IDX 93
|
||||
#define GNB_CONFIG_PUCCH_GROUPHOPPING_IDX 94
|
||||
#define GNB_CONFIG_HOPPINGID_IDX 95
|
||||
#define GNB_CONFIG_P0_NOMINAL_IDX 96
|
||||
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0_IDX 97
|
||||
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 98
|
||||
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_STARTSYMBOLANDLENGTH
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNID_IDX 99
|
||||
#define GNB_CONFIG_RATEMATCHPATTERN_PATTERNTYPE_IDX 100
|
||||
#define GNB_CONFIG_SYMBOLSINRESOURCEBLOCK_IDX 101
|
||||
#define GNB_CONFIG_PERIODICITYANDPATTERN_IDX 102
|
||||
#define GNB_CONFIG_RATEMATCHPATTERN_CONTROLRESOURCESET_IDX 103
|
||||
#define GNB_CONFIG_RATEMATCHPATTERN_SUBCARRIERSPACING_IDX 104
|
||||
#define GNB_CONFIG_RATEMATCHPATTERN_MODE_IDX 105
|
||||
#define GNB_CONFIG_CONTROLRESOURCESETZERO_IDX 106
|
||||
#define GNB_CONFIG_SEARCHSPACEZERO_IDX 107
|
||||
#define GNB_CONFIG_SEARCHSPACESIB1_IDX 108
|
||||
#define GNB_CONFIG_SEARCHSPACEOTHERSYSTEMINFORMATION_IDX 109
|
||||
#define GNB_CONFIG_PAGINGSEARCHSPACE_IDX 110
|
||||
#define GNB_CONFIG_RA_SEARCHSPACE_IDX 111
|
||||
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESETID_IDX 112
|
||||
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESET_DURATION_IDX 113
|
||||
#define GNB_CONFIG_PDCCH_CCE_REG_MAPPINGTYPE_IDX 114
|
||||
#define GNB_CONFIG_PDCCH_REG_BUNDLESIZE_IDX 115
|
||||
#define GNB_CONFIG_PDCCH_INTERLEAVERSIZE_IDX 116
|
||||
#define GNB_CONFIG_PDCCH_SHIFTINDEX_IDX 117
|
||||
#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX 118
|
||||
#define GNB_CONFIG_PDCCH_TCI_STATEID_IDX 119
|
||||
#define GNB_CONFIG_TCI_PRESENTINDCI_IDX 120
|
||||
#define GNB_CONFIG_PDCCH_DMRS_SCRAMBLINGID_IDX 121
|
||||
#define GNB_CONFIG_SEARCHSPACEID_IDX 122
|
||||
#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX 123
|
||||
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE_IDX 124
|
||||
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_VALUE_IDX 125
|
||||
#define GNB_CONFIG_SEARCHSPACE_DURATION_IDX 126
|
||||
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1_IDX 127
|
||||
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2_IDX 128
|
||||
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4_IDX 129
|
||||
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8_IDX 130
|
||||
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16_IDX 131
|
||||
#define GNB_CONFIG_SEARCHSPACE_SEARCHSPACETYPE_IDX 132
|
||||
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1_IDX 133
|
||||
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2_IDX 134
|
||||
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4_IDX 135
|
||||
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8_IDX 136
|
||||
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16_IDX 137
|
||||
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY_IDX 138
|
||||
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES_IDX 139
|
||||
#define GNB_CONFIG_UE_SPECIFIC__DCI_FORMATS_IDX 140
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL_IDX 141
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL_IDX 142
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS_IDX 143
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_V_SHIFT_IDX 144
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD_IDX 145
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET_IDX 146
|
||||
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE_IDX 147
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* SRB1 configuration parameters section name */
|
||||
#define GNB_CONFIG_STRING_SRB1 "srb1_parameters"
|
||||
|
||||
/* SRB1 configuration parameters names */
|
||||
#define GNB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit"
|
||||
#define GNB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering"
|
||||
#define GNB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT "timer_status_prohibit"
|
||||
#define GNB_CONFIG_STRING_SRB1_POLL_PDU "poll_pdu"
|
||||
#define GNB_CONFIG_STRING_SRB1_POLL_BYTE "poll_byte"
|
||||
#define GNB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD "max_retx_threshold"
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* SRB1 configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define GNBSRB1PARAMS_DESC { \
|
||||
{GNB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, NULL, 0, iptr:&srb1_timer_poll_retransmit, defintval:80, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SRB1_TIMER_REORDERING, NULL, 0, iptr:&srb1_timer_reordering, defintval:35, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, NULL, 0, iptr:&srb1_timer_status_prohibit, defintval:0, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SRB1_POLL_PDU, NULL, 0, iptr:&srb1_poll_pdu, defintval:4, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SRB1_POLL_BYTE, NULL, 0, iptr:&srb1_poll_byte, defintval:99999, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, NULL, 0, iptr:&srb1_max_retx_threshold, defintval:4, TYPE_UINT, 0} \
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* MME configuration parameters section name */
|
||||
#define GNB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address"
|
||||
@@ -913,6 +283,8 @@ typedef enum {
|
||||
#define GNB_INTERFACE_NAME_FOR_S1U_IDX 2
|
||||
#define GNB_IPV4_ADDR_FOR_S1U_IDX 3
|
||||
#define GNB_PORT_FOR_S1U_IDX 4
|
||||
#define GNB_IPV4_ADDR_FOR_X2C_IDX 5
|
||||
#define GNB_PORT_FOR_X2C_IDX 6
|
||||
|
||||
/* S1 interface configuration parameters names */
|
||||
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME "GNB_INTERFACE_NAME_FOR_S1_MME"
|
||||
@@ -921,6 +293,10 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U "GNB_IPV4_ADDRESS_FOR_S1U"
|
||||
#define GNB_CONFIG_STRING_GNB_PORT_FOR_S1U "GNB_PORT_FOR_S1U"
|
||||
|
||||
/* X2 interface configuration parameters names */
|
||||
#define GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C "GNB_IPV4_ADDRESS_FOR_X2C"
|
||||
#define GNB_CONFIG_STRING_ENB_PORT_FOR_X2C "GNB_PORT_FOR_X2C"
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* S1 interface configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -930,7 +306,9 @@ typedef enum {
|
||||
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \
|
||||
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1497,38 +1497,33 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
|
||||
if (status >= RRC_CONNECTED && UE_sched_ctrl_ptr->cqi_req_timer > 30) {
|
||||
if (UE_sched_ctrl_ptr->cqi_received == 0) {
|
||||
if (NFAPI_MODE != NFAPI_MONOLITHIC) {
|
||||
cqi_req = 0;
|
||||
} else {
|
||||
cqi_req = 1;
|
||||
LOG_D(MAC,"Setting CQI_REQ (timer %d)\n",UE_sched_ctrl_ptr->cqi_req_timer);
|
||||
cqi_req = 1;
|
||||
LOG_D(MAC,
|
||||
"Setting CQI_REQ (timer %d)\n",
|
||||
UE_sched_ctrl_ptr->cqi_req_timer);
|
||||
|
||||
/* TDD: to be safe, do not ask CQI in special Subframes:36.213/7.2.3 CQI definition */
|
||||
if (cc[CC_id].tdd_Config) {
|
||||
switch (cc[CC_id].tdd_Config->subframeAssignment) {
|
||||
case 1:
|
||||
if(subframeP == 1 || subframeP == 6) {
|
||||
cqi_req=0;
|
||||
}
|
||||
/* TDD: to be safe, do not ask CQI in special
|
||||
* Subframes:36.213/7.2.3 CQI definition */
|
||||
if (cc[CC_id].tdd_Config) {
|
||||
switch (cc[CC_id].tdd_Config->subframeAssignment) {
|
||||
case 1:
|
||||
if (subframeP == 1 || subframeP == 6)
|
||||
cqi_req = 0;
|
||||
break;
|
||||
|
||||
break;
|
||||
case 3:
|
||||
if (subframeP == 1)
|
||||
cqi_req = 0;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if(subframeP == 1) {
|
||||
cqi_req=0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(MAC," TDD config not supported\n");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_E(MAC, " TDD config not supported\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(cqi_req == 1) {
|
||||
UE_sched_ctrl_ptr->cqi_req_flag |= 1 << sched_subframeP;
|
||||
}
|
||||
if (cqi_req == 1) {
|
||||
UE_sched_ctrl_ptr->cqi_req_flag |= 1 << sched_subframeP;
|
||||
}
|
||||
} else {
|
||||
LOG_D(MAC,"Clearing CQI request timer\n");
|
||||
|
||||
@@ -1789,17 +1789,12 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
}
|
||||
|
||||
total_allocated_rbs[CC_id] += nb_allocated_rbs[CC_id][UE_id];
|
||||
LOG_D(MAC, "In ulsch_preprocessor: assigning %d RBs for UE %d/%x CCid %d, harq_pid %d, nb_rb_ul %d, %d ,%d, slice %d, round ul %d\n",
|
||||
LOG_D(MAC, "In ulsch_preprocessor: assigning %d RBs for UE %d/%x CCid %d, harq_pid %d\n",
|
||||
nb_allocated_rbs[CC_id][UE_id],
|
||||
UE_id,
|
||||
rntiTable[UE_id],
|
||||
CC_id,
|
||||
harq_pid,
|
||||
UE_list->UE_template[CC_id][UE_id].nb_rb_ul[harq_pid],
|
||||
UE_list->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul[slice_idx],
|
||||
average_rbs_per_user[CC_id],
|
||||
slice_idx,
|
||||
UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid]);
|
||||
harq_pid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1824,10 +1819,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
while (UE_template->pre_allocated_nb_rb_ul[slice_idx] > 0 &&
|
||||
nb_allocated_rbs[CC_id][UE_id] < UE_template->pre_allocated_nb_rb_ul[slice_idx] &&
|
||||
total_remaining_rbs[CC_id] > 0) {
|
||||
LOG_D(PHY,"in ulsch alloc: prealloc: %d, nb_allocated %d, total remain%d\n",
|
||||
UE_template->pre_allocated_nb_rb_ul[slice_idx],
|
||||
nb_allocated_rbs[CC_id][UE_id],
|
||||
total_remaining_rbs[CC_id]);
|
||||
nb_allocated_rbs[CC_id][UE_id] = cmin(nb_allocated_rbs[CC_id][UE_id] + 1, UE_template->pre_allocated_nb_rb_ul[slice_idx]);
|
||||
total_remaining_rbs[CC_id]--;
|
||||
total_allocated_rbs[CC_id]++;
|
||||
|
||||
@@ -2158,7 +2158,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) {
|
||||
if(NFAPI_MODE==NFAPI_UE_STUB_PNF) {
|
||||
//Substitute with a static value for the MAC layer abstraction (phy_stub mode)
|
||||
phr_p->PH = 40;
|
||||
phr_p->PH = 60;
|
||||
} else {
|
||||
phr_p->PH = get_phr_mapping(module_idP, CC_id, eNB_index);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/*! \file nr_mac_common.c
|
||||
* \brief Common MAC functions for NR UE and gNB
|
||||
* \brief Common MAC/PHY functions for NR UE and gNB
|
||||
* \author Florian Kaltenberger and Raymond Knopp
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
@@ -33,43 +33,55 @@
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
nr_bandentry_t nr_bandtable[] = {
|
||||
{1, 1920000, 1980000, 2110000, 2170000, 20, 422000},
|
||||
{2, 1850000, 1910000, 1930000, 1990000, 20, 386000},
|
||||
{3, 1710000, 1785000, 1805000, 1880000, 20, 361000},
|
||||
{5, 824000, 849000, 869000, 894000, 20, 173800},
|
||||
{7, 2500000, 2570000, 2620000, 2690000, 20, 524000},
|
||||
{8, 880000, 915000, 925000, 960000, 20, 185000},
|
||||
{12, 698000, 716000, 728000, 746000, 20, 145800},
|
||||
{20, 832000, 862000, 791000, 821000, 20, 158200},
|
||||
{25, 1850000, 1915000, 1930000, 1995000, 20, 386000},
|
||||
{28, 703000, 758000, 758000, 813000, 20, 151600},
|
||||
{34, 2010000, 2025000, 2010000, 2025000, 20, 402000},
|
||||
{38, 2570000, 2620000, 2570000, 2630000, 20, 514000},
|
||||
{39, 1880000, 1920000, 1880000, 1920000, 20, 376000},
|
||||
{40, 2300000, 2400000, 2300000, 2400000, 20, 460000},
|
||||
{41, 2496000, 2690000, 2496000, 2690000, 3, 499200},
|
||||
{50, 1432000, 1517000, 1432000, 1517000, 20, 286400},
|
||||
{51, 1427000, 1432000, 1427000, 1432000, 20, 285400},
|
||||
{66, 1710000, 1780000, 2110000, 2200000, 20, 422000},
|
||||
{70, 1695000, 1710000, 1995000, 2020000, 20, 399000},
|
||||
{71, 663000, 698000, 617000, 652000, 20, 123400},
|
||||
{74, 1427000, 1470000, 1475000, 1518000, 20, 295000},
|
||||
{75, 000, 000, 1432000, 1517000, 20, 286400},
|
||||
{76, 000, 000, 1427000, 1432000, 20, 285400},
|
||||
{77, 3300000, 4200000, 3300000, 4200000, 1, 620000},
|
||||
{78, 3300000, 3800000, 3300000, 3800000, 1, 620000},
|
||||
{79, 4400000, 5000000, 4400000, 5000000, 2, 693334},
|
||||
{80, 1710000, 1785000, 000, 000, 20, 342000},
|
||||
{81, 860000, 915000, 000, 000, 20, 176000},
|
||||
{82, 832000, 862000, 000, 000, 20, 166400},
|
||||
{83, 703000, 748000, 000, 000, 20, 140600},
|
||||
{84, 1920000, 1980000, 000, 000, 20, 384000},
|
||||
{86, 1710000, 1785000, 000, 000, 20, 342000}
|
||||
{1, 1920000, 1980000, 2110000, 2170000, 20, 422000, 100},
|
||||
{2, 1850000, 1910000, 1930000, 1990000, 20, 386000, 100},
|
||||
{3, 1710000, 1785000, 1805000, 1880000, 20, 361000, 100},
|
||||
{5, 824000, 849000, 869000, 894000, 20, 173800, 100},
|
||||
{7, 2500000, 2570000, 2620000, 2690000, 20, 524000, 100},
|
||||
{8, 880000, 915000, 925000, 960000, 20, 185000, 100},
|
||||
{12, 698000, 716000, 728000, 746000, 20, 145800, 100},
|
||||
{20, 832000, 862000, 791000, 821000, 20, 158200, 100},
|
||||
{25, 1850000, 1915000, 1930000, 1995000, 20, 386000, 100},
|
||||
{28, 703000, 758000, 758000, 813000, 20, 151600, 100},
|
||||
{34, 2010000, 2025000, 2010000, 2025000, 20, 402000, 100},
|
||||
{38, 2570000, 2620000, 2570000, 2630000, 20, 514000, 100},
|
||||
{39, 1880000, 1920000, 1880000, 1920000, 20, 376000, 100},
|
||||
{40, 2300000, 2400000, 2300000, 2400000, 20, 460000, 100},
|
||||
{41, 2496000, 2690000, 2496000, 2690000, 3, 499200, 15},
|
||||
{41, 2496000, 2690000, 2496000, 2690000, 6, 499200, 30},
|
||||
{50, 1432000, 1517000, 1432000, 1517000, 20, 286400, 100},
|
||||
{51, 1427000, 1432000, 1427000, 1432000, 20, 285400, 100},
|
||||
{66, 1710000, 1780000, 2110000, 2200000, 20, 422000, 100},
|
||||
{70, 1695000, 1710000, 1995000, 2020000, 20, 399000, 100},
|
||||
{71, 663000, 698000, 617000, 652000, 20, 123400, 100},
|
||||
{74, 1427000, 1470000, 1475000, 1518000, 20, 295000, 100},
|
||||
{75, 000, 000, 1432000, 1517000, 20, 286400, 100},
|
||||
{76, 000, 000, 1427000, 1432000, 20, 285400, 100},
|
||||
{77, 3300000, 4200000, 3300000, 4200000, 1, 620000, 15},
|
||||
{77, 3300000, 4200000, 3300000, 4200000, 2, 620000, 30},
|
||||
{78, 3300000, 3800000, 3300000, 3800000, 1, 620000, 15},
|
||||
{78, 3300000, 3800000, 3300000, 3800000, 2, 620000, 30},
|
||||
{79, 4400000, 5000000, 4400000, 5000000, 1, 693334, 15},
|
||||
{79, 4400000, 5000000, 4400000, 5000000, 2, 693334, 30},
|
||||
{80, 1710000, 1785000, 000, 000, 20, 342000, 100},
|
||||
{81, 860000, 915000, 000, 000, 20, 176000, 100},
|
||||
{82, 832000, 862000, 000, 000, 20, 166400, 100},
|
||||
{83, 703000, 748000, 000, 000, 20, 140600, 100},
|
||||
{84, 1920000, 1980000, 000, 000, 20, 384000, 100},
|
||||
{86, 1710000, 1785000, 000, 000, 20, 342000, 100},
|
||||
{257,26500000,29500000,26500000,29500000, 1,2054166, 60},
|
||||
{257,26500000,29500000,26500000,29500000, 2,2054167, 120},
|
||||
{258,24250000,27500000,24250000,27500000, 1,2016667, 60},
|
||||
{258,24250000,27500000,24250000,27500000, 2,2016667, 120},
|
||||
{260,37000000,40000000,37000000,40000000, 1,2229166, 60},
|
||||
{260,37000000,40000000,37000000,40000000, 2,2229167, 120},
|
||||
{261,27500000,28350000,27500000,28350000, 1,2070833, 60},
|
||||
{261,27500000,28350000,27500000,28350000, 2,2070833, 120}
|
||||
};
|
||||
|
||||
#define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t))
|
||||
|
||||
void get_band(uint32_t downlink_frequency,
|
||||
void get_band(uint64_t downlink_frequency,
|
||||
uint16_t *current_band,
|
||||
int32_t *current_offset,
|
||||
lte_frame_type_t *current_type)
|
||||
@@ -91,40 +103,157 @@ void get_band(uint32_t downlink_frequency,
|
||||
if ( nr_bandtable[ind].dl_min <= dl_freq_khz && nr_bandtable[ind].dl_max >= dl_freq_khz ) {
|
||||
|
||||
center_frequency_khz = (nr_bandtable[ind].dl_max + nr_bandtable[ind].dl_min)/2;
|
||||
|
||||
if (abs(dl_freq_khz - center_frequency_khz) < center_freq_diff_khz){
|
||||
|
||||
*current_band = nr_bandtable[ind].band;
|
||||
*current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000;
|
||||
*current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000;
|
||||
center_freq_diff_khz = abs(dl_freq_khz - center_frequency_khz);
|
||||
|
||||
if (*current_offset == 0)
|
||||
*current_type = TDD;
|
||||
else
|
||||
*current_type = FDD;
|
||||
if (*current_offset == 0)
|
||||
*current_type = TDD;
|
||||
else
|
||||
*current_type = FDD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I( PHY, "DL frequency %"PRIu32": band %d, frame_type %d, UL frequency %"PRIu32"\n",
|
||||
LOG_I( PHY, "DL frequency %"PRIu64": band %d, frame_type %d, UL frequency %"PRIu64"\n",
|
||||
downlink_frequency, *current_band, *current_type, downlink_frequency+*current_offset);
|
||||
|
||||
AssertFatal(*current_band != 0,
|
||||
"Can't find EUTRA band for frequency %u\n", downlink_frequency);
|
||||
"Can't find EUTRA band for frequency %lu\n", downlink_frequency);
|
||||
}
|
||||
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band)
|
||||
{
|
||||
|
||||
if (nr_band < 100) { //FR1
|
||||
switch(mu) {
|
||||
case 0 :
|
||||
if (nb_rb<=25)
|
||||
return 5;
|
||||
if (nb_rb<=52)
|
||||
return 10;
|
||||
if (nb_rb<=79)
|
||||
return 15;
|
||||
if (nb_rb<=106)
|
||||
return 20;
|
||||
if (nb_rb<=133)
|
||||
return 25;
|
||||
if (nb_rb<=160)
|
||||
return 30;
|
||||
if (nb_rb<=216)
|
||||
return 40;
|
||||
if (nb_rb<=270)
|
||||
return 50;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
case 1 :
|
||||
if (nb_rb<=11)
|
||||
return 5;
|
||||
if (nb_rb<=24)
|
||||
return 10;
|
||||
if (nb_rb<=38)
|
||||
return 15;
|
||||
if (nb_rb<=51)
|
||||
return 20;
|
||||
if (nb_rb<=65)
|
||||
return 25;
|
||||
if (nb_rb<=78)
|
||||
return 30;
|
||||
if (nb_rb<=106)
|
||||
return 40;
|
||||
if (nb_rb<=133)
|
||||
return 50;
|
||||
if (nb_rb<=162)
|
||||
return 60;
|
||||
if (nb_rb<=189)
|
||||
return 70;
|
||||
if (nb_rb<=217)
|
||||
return 80;
|
||||
if (nb_rb<=245)
|
||||
return 90;
|
||||
if (nb_rb<=273)
|
||||
return 100;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
case 2 :
|
||||
if (nb_rb<=11)
|
||||
return 10;
|
||||
if (nb_rb<=18)
|
||||
return 15;
|
||||
if (nb_rb<=24)
|
||||
return 20;
|
||||
if (nb_rb<=31)
|
||||
return 25;
|
||||
if (nb_rb<=38)
|
||||
return 30;
|
||||
if (nb_rb<=51)
|
||||
return 40;
|
||||
if (nb_rb<=65)
|
||||
return 50;
|
||||
if (nb_rb<=79)
|
||||
return 60;
|
||||
if (nb_rb<=93)
|
||||
return 70;
|
||||
if (nb_rb<=107)
|
||||
return 80;
|
||||
if (nb_rb<=121)
|
||||
return 90;
|
||||
if (nb_rb<=135)
|
||||
return 100;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch(mu) {
|
||||
case 2 :
|
||||
if (nb_rb<=66)
|
||||
return 50;
|
||||
if (nb_rb<=132)
|
||||
return 100;
|
||||
if (nb_rb<=264)
|
||||
return 200;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
case 3 :
|
||||
if (nb_rb<=32)
|
||||
return 50;
|
||||
if (nb_rb<=66)
|
||||
return 100;
|
||||
if (nb_rb<=132)
|
||||
return 200;
|
||||
if (nb_rb<=264)
|
||||
return 400;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP,
|
||||
uint64_t dl_CarrierFreq,
|
||||
uint8_t scs_index,
|
||||
uint32_t bw)
|
||||
{
|
||||
uint64_t dl_CarrierFreq_by_1k = dl_CarrierFreq / 1000;
|
||||
int bw_kHz = bw / 1000;
|
||||
|
||||
int scs_khz = 15<<scs_index;
|
||||
int i;
|
||||
uint32_t nrarfcn, delta_arfcn;
|
||||
|
||||
LOG_I(MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
|
||||
AssertFatal(nr_bandP < 86, "nr_band %d > 86\n", nr_bandP);
|
||||
for (i = 0; i < 30 && nr_bandtable[i].band != nr_bandP; i++);
|
||||
AssertFatal(nr_bandP <= 261, "nr_band %d > 260\n", nr_bandP);
|
||||
for (i = 0; i < NR_BANDTABLE_SIZE && nr_bandtable[i].band != nr_bandP; i++);
|
||||
|
||||
// selection of correct Deltaf raster according to SCS
|
||||
if ( (nr_bandtable[i].deltaf_raster != 100) && (nr_bandtable[i].deltaf_raster != scs_khz))
|
||||
i++;
|
||||
|
||||
AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
|
||||
@@ -135,31 +264,57 @@ uint32_t to_nrarfcn(int nr_bandP,
|
||||
nr_bandP, (long long unsigned int)dl_CarrierFreq,bw, (long long unsigned int)dl_CarrierFreq_by_1k,
|
||||
(long long unsigned int)(nr_bandtable[i].dl_max - bw_kHz));
|
||||
|
||||
int deltaFglobal;
|
||||
int deltaFglobal = 60;
|
||||
|
||||
if (dl_CarrierFreq < 3e9) deltaFglobal = 5;
|
||||
else deltaFglobal = 15;
|
||||
if (dl_CarrierFreq < 3e9) deltaFglobal = 15;
|
||||
if (dl_CarrierFreq < 24.25e9) deltaFglobal = 5;
|
||||
|
||||
// This is equation before Table 5.4.2.1-1 in 38101-1-f30
|
||||
// F_REF=F_REF_Offs + deltaF_Global(N_REF-NREF_REF_Offs)
|
||||
return (((dl_CarrierFreq_by_1k - nr_bandtable[i].dl_min)/deltaFglobal) +
|
||||
nr_bandtable[i].N_OFFs_DL);
|
||||
nrarfcn = (((dl_CarrierFreq_by_1k - nr_bandtable[i].dl_min)/deltaFglobal)+nr_bandtable[i].N_OFFs_DL);
|
||||
|
||||
delta_arfcn = nrarfcn - nr_bandtable[i].N_OFFs_DL;
|
||||
if(delta_arfcn%(nr_bandtable[i].step_size)!=0)
|
||||
AssertFatal(1==0,"dl_CarrierFreq %lu corresponds to %u which is not on the raster for step size %lu",
|
||||
dl_CarrierFreq,nrarfcn,nr_bandtable[i].step_size);
|
||||
|
||||
return nrarfcn;
|
||||
}
|
||||
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP,
|
||||
uint8_t scs_index,
|
||||
uint32_t dl_nrarfcn)
|
||||
{
|
||||
int i;
|
||||
int deltaFglobal;
|
||||
int deltaFglobal = 5;
|
||||
int scs_khz = 15<<scs_index;
|
||||
uint32_t delta_arfcn;
|
||||
|
||||
if (nr_bandP < 77 || nr_bandP > 79) deltaFglobal = 5;
|
||||
else deltaFglobal = 15;
|
||||
if (dl_nrarfcn > 599999 && dl_nrarfcn < 2016667)
|
||||
deltaFglobal = 15;
|
||||
if (dl_nrarfcn > 2016666 && dl_nrarfcn < 3279166)
|
||||
deltaFglobal = 60;
|
||||
|
||||
AssertFatal(nr_bandP < 87, "nr_band %d > 86\n", nr_bandP);
|
||||
for (i = 0; i < 31 && nr_bandtable[i].band != nr_bandP; i++);
|
||||
AssertFatal(dl_nrarfcn>=nr_bandtable[i].N_OFFs_DL,"dl_nrarfcn %u < N_OFFs_DL %llu\n",dl_nrarfcn, (long long unsigned int)nr_bandtable[i].N_OFFs_DL);
|
||||
AssertFatal(nr_bandP <= 261, "nr_band %d > 260\n", nr_bandP);
|
||||
for (i = 0; i < NR_BANDTABLE_SIZE && nr_bandtable[i].band != nr_bandP; i++);
|
||||
AssertFatal(dl_nrarfcn>=nr_bandtable[i].N_OFFs_DL,"dl_nrarfcn %u < N_OFFs_DL[%d] %llu\n",dl_nrarfcn, nr_bandtable[i].band,(long long unsigned int)nr_bandtable[i].N_OFFs_DL);
|
||||
|
||||
// selection of correct Deltaf raster according to SCS
|
||||
if ( (nr_bandtable[i].deltaf_raster != 100) && (nr_bandtable[i].deltaf_raster != scs_khz))
|
||||
i++;
|
||||
|
||||
delta_arfcn = dl_nrarfcn - nr_bandtable[i].N_OFFs_DL;
|
||||
if(delta_arfcn%(nr_bandtable[i].step_size)!=0)
|
||||
AssertFatal(1==0,"dl_nrarfcn %u is not on the raster for step size %lu",dl_nrarfcn,nr_bandtable[i].step_size);
|
||||
|
||||
LOG_I(PHY,"Computing dl_frequency (pointA %llu => %llu (dlmin %llu, nr_bandtable[%d].N_OFFs_DL %llu))\n",
|
||||
(unsigned long long)dl_nrarfcn,
|
||||
(unsigned long long)(1000*(nr_bandtable[i].dl_min + (dl_nrarfcn - nr_bandtable[i].N_OFFs_DL) * deltaFglobal)),
|
||||
(unsigned long long)nr_bandtable[i].dl_min,
|
||||
i,
|
||||
(unsigned long long)nr_bandtable[i].N_OFFs_DL);
|
||||
|
||||
return 1000*(nr_bandtable[i].dl_min + (dl_nrarfcn - nr_bandtable[i].N_OFFs_DL) * deltaFglobal);
|
||||
}
|
||||
|
||||
@@ -174,3 +329,420 @@ int32_t get_nr_uldl_offset(int nr_bandP)
|
||||
|
||||
return (nr_bandtable[i].dl_min - nr_bandtable[i].ul_min);
|
||||
}
|
||||
|
||||
|
||||
void nr_get_tbs_dl(nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
|
||||
int x_overhead) {
|
||||
|
||||
LOG_D(MAC, "TBS calculation\n");
|
||||
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_rel15 = &pdsch_pdu->pdsch_pdu_rel15;
|
||||
uint16_t N_PRB_oh = x_overhead;
|
||||
uint8_t N_PRB_DMRS = (pdsch_rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1)?6:4; //This only works for antenna port 1000
|
||||
uint8_t N_sh_symb = pdsch_rel15->NrOfSymbols;
|
||||
uint8_t Imcs = pdsch_rel15->mcsIndex[0];
|
||||
uint16_t N_RE_prime = NR_NB_SC_PER_RB*N_sh_symb - N_PRB_DMRS - N_PRB_oh;
|
||||
LOG_D(MAC, "N_RE_prime %d for %d symbols %d DMRS per PRB and %d overhead\n", N_RE_prime, N_sh_symb, N_PRB_DMRS, N_PRB_oh);
|
||||
|
||||
uint16_t R;
|
||||
uint32_t TBS=0;
|
||||
uint8_t table_idx, Qm;
|
||||
|
||||
/*uint8_t mcs_table = config.pdsch_config.mcs_table.value;
|
||||
uint8_t ss_type = params_rel15.search_space_type;
|
||||
uint8_t dci_format = params_rel15.dci_format;
|
||||
get_table_idx(mcs_table, dci_format, rnti_type, ss_type);*/
|
||||
table_idx = 0;
|
||||
R = nr_get_code_rate_dl(Imcs, table_idx);
|
||||
Qm = nr_get_Qm_dl(Imcs, table_idx);
|
||||
|
||||
TBS = nr_compute_tbs(Qm,
|
||||
R,
|
||||
pdsch_rel15->rbSize,
|
||||
N_sh_symb,
|
||||
N_PRB_DMRS,
|
||||
N_PRB_oh,
|
||||
pdsch_rel15->nrOfLayers)>>3;
|
||||
|
||||
pdsch_rel15->targetCodeRate[0] = R;
|
||||
pdsch_rel15->qamModOrder[0] = Qm;
|
||||
pdsch_rel15->TBSize[0] = TBS;
|
||||
// pdsch_rel15->nb_mod_symbols = N_RE_prime*pdsch_rel15->n_prb*pdsch_rel15->nb_codewords;
|
||||
pdsch_rel15->mcsTable[0] = table_idx;
|
||||
|
||||
LOG_D(MAC, "TBS %d bytes: N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d R %d Qm %d table %d nb_symbols %d\n",
|
||||
TBS, N_PRB_DMRS, N_sh_symb, N_PRB_oh, R, Qm, table_idx,N_RE_prime*pdsch_rel15->rbSize*pdsch_rel15->NrOfCodewords );
|
||||
}
|
||||
|
||||
//Table 5.1.3.1-1 of 38.214
|
||||
uint16_t Table_51311[29][2] = {{2,120},{2,157},{2,193},{2,251},{2,308},{2,379},{2,449},{2,526},{2,602},{2,679},{4,340},{4,378},{4,434},{4,490},{4,553},{4,616},
|
||||
{4,658},{6,438},{6,466},{6,517},{6,567},{6,616},{6,666},{6,719},{6,772},{6,822},{6,873}, {6,910}, {6,948}};
|
||||
|
||||
//Table 5.1.3.1-2 of 38.214
|
||||
// Imcs values 20 and 26 have been multiplied by 2 to avoid the floating point
|
||||
uint16_t Table_51312[28][2] = {{2,120},{2,193},{2,308},{2,449},{2,602},{4,378},{4,434},{4,490},{4,553},{4,616},{4,658},{6,466},{6,517},{6,567},{6,616},{6,666},
|
||||
{6,719},{6,772},{6,822},{6,873},{8,1365},{8,711},{8,754},{8,797},{8,841},{8,885},{8,1833},{8,948}};
|
||||
|
||||
//Table 5.1.3.1-3 of 38.214
|
||||
uint16_t Table_51313[29][2] = {{2,30},{2,40},{2,50},{2,64},{2,78},{2,99},{2,120},{2,157},{2,193},{2,251},{2,308},{2,379},{2,449},{2,526},{2,602},{4,340},
|
||||
{4,378},{4,434},{4,490},{4,553},{4,616},{6,438},{6,466},{6,517},{6,567},{6,616},{6,666}, {6,719}, {6,772}};
|
||||
|
||||
//Table 6.1.4.1-1 of 38.214 TODO fix for tp-pi2BPSK
|
||||
uint16_t Table_61411[28][2] = {{2,120},{2,157},{2,193},{2,251},{2,308},{2,379},{2,449},{2,526},{2,602},{2,679},{4,340},{4,378},{4,434},{4,490},{4,553},{4,616},
|
||||
{4,658},{6,466},{6,517},{6,567},{6,616},{6,666},{6,719},{6,772},{6,822},{6,873}, {6,910}, {6,948}};
|
||||
|
||||
//Table 6.1.4.1-2 of 38.214 TODO fix for tp-pi2BPSK
|
||||
uint16_t Table_61412[28][2] = {{2,30},{2,40},{2,50},{2,64},{2,78},{2,99},{2,120},{2,157},{2,193},{2,251},{2,308},{2,379},{2,449},{2,526},{2,602},{2,679},
|
||||
{4,378},{4,434},{4,490},{4,553},{4,616},{4,658},{4,699},{4,772},{6,567},{6,616},{6,666}, {6,772}};
|
||||
|
||||
|
||||
|
||||
uint8_t nr_get_Qm_dl(uint8_t Imcs, uint8_t table_idx) {
|
||||
switch(table_idx) {
|
||||
case 0:
|
||||
return (Table_51311[Imcs][0]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
return (Table_51312[Imcs][0]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return (Table_51313[Imcs][0]);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t nr_get_code_rate_dl(uint8_t Imcs, uint8_t table_idx) {
|
||||
switch(table_idx) {
|
||||
case 0:
|
||||
return (Table_51311[Imcs][1]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
return (Table_51312[Imcs][1]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return (Table_51313[Imcs][1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t nr_get_Qm_ul(uint8_t Imcs, uint8_t table_idx) {
|
||||
switch(table_idx) {
|
||||
case 0:
|
||||
return (Table_51311[Imcs][0]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
return (Table_51312[Imcs][0]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return (Table_51313[Imcs][0]);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
return (Table_61411[Imcs][0]);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
return (Table_61412[Imcs][0]);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,2])\n", table_idx);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t nr_get_code_rate_ul(uint8_t Imcs, uint8_t table_idx) {
|
||||
switch(table_idx) {
|
||||
case 0:
|
||||
return (Table_51311[Imcs][1]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
return (Table_51312[Imcs][1]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return (Table_51313[Imcs][1]);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
return (Table_61411[Imcs][1]);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
return (Table_61412[Imcs][1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,2])\n", table_idx);
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint8_t is_codeword_disabled(uint8_t format, uint8_t Imcs, uint8_t rv) {
|
||||
return ((format==NFAPI_NR_DL_DCI_FORMAT_1_1)&&(Imcs==26)&&(rv==1));
|
||||
}
|
||||
|
||||
static inline uint8_t get_table_idx(uint8_t mcs_table, uint8_t dci_format, uint8_t rnti_type, uint8_t ss_type) {
|
||||
if ((mcs_table == NFAPI_NR_MCS_TABLE_QAM256) && (dci_format == NFAPI_NR_DL_DCI_FORMAT_1_1) && ((rnti_type==NFAPI_NR_RNTI_C)||(rnti_type==NFAPI_NR_RNTI_CS)))
|
||||
return 2;
|
||||
else if ((mcs_table == NFAPI_NR_MCS_TABLE_QAM64_LOW_SE) && (rnti_type!=NFAPI_NR_RNTI_new) && (rnti_type==NFAPI_NR_RNTI_C) && (ss_type==NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC))
|
||||
return 3;
|
||||
else if (rnti_type==NFAPI_NR_RNTI_new)
|
||||
return 3;
|
||||
else if ((mcs_table == NFAPI_NR_MCS_TABLE_QAM256) && (rnti_type==NFAPI_NR_RNTI_CS) && (dci_format == NFAPI_NR_DL_DCI_FORMAT_1_1))
|
||||
return 2; // Condition mcs_table not configured in sps_config necessary here but not yet implemented
|
||||
/*else if((mcs_table == NFAPI_NR_MCS_TABLE_QAM64_LOW_SE) && (rnti_type==NFAPI_NR_RNTI_CS))
|
||||
* table_idx = 3;
|
||||
* Note: the commented block refers to the case where the mcs_table is from sps_config*/
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int get_num_dmrs(uint16_t dmrs_mask ) {
|
||||
|
||||
int num_dmrs=0;
|
||||
|
||||
for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1);
|
||||
return(num_dmrs);
|
||||
}
|
||||
|
||||
uint16_t nr_dci_size(nr_dci_format_t format,
|
||||
nr_rnti_type_t rnti_type,
|
||||
uint16_t N_RB) {
|
||||
|
||||
uint16_t size = 0;
|
||||
|
||||
switch(format) {
|
||||
/*Only sizes for 0_0 and 1_0 are correct at the moment*/
|
||||
case NR_UL_DCI_FORMAT_0_0:
|
||||
/// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 Time Domain assgnmt 4 --20
|
||||
size += 20;
|
||||
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment -- hopping scenario to be updated
|
||||
size += nr_dci_size(NR_DL_DCI_FORMAT_1_0, rnti_type, N_RB) - size; // Padding to match 1_0 size
|
||||
// UL/SUL indicator assumed to be 0
|
||||
break;
|
||||
|
||||
case NR_UL_DCI_FORMAT_0_1:
|
||||
/// fixed: Format identifier 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2, SRS request 2 --17
|
||||
size += 17;
|
||||
// Carrier indicator
|
||||
// UL/SUL indicator
|
||||
// BWP Indicator
|
||||
// Freq domain assignment
|
||||
// Time domain assignment
|
||||
// VRB to PRB mapping
|
||||
// Frequency Hopping flag
|
||||
// 1st DAI
|
||||
// 2nd DAI
|
||||
// SRS resource indicator
|
||||
// Precoding info and number of layers
|
||||
// Antenna ports
|
||||
// CSI request
|
||||
// CBGTI
|
||||
// PTRS - DMRS association
|
||||
// beta offset indicator
|
||||
// DMRS sequence init
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_1_0:
|
||||
/// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 Time Domain assgnmt 4 -- 28
|
||||
size += 28;
|
||||
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_1_1:
|
||||
// Carrier indicator
|
||||
size += 1; // Format identifier
|
||||
// BWP Indicator
|
||||
// Freq domain assignment
|
||||
// Time domain assignment
|
||||
// VRB to PRB mapping
|
||||
// PRB bundling size indicator
|
||||
// Rate matching indicator
|
||||
// ZP CSI-RS trigger
|
||||
/// TB1- MCS 5, NDI 1, RV 2
|
||||
size += 8;
|
||||
// TB2
|
||||
size += 4 ; // HARQ PID
|
||||
// DAI
|
||||
size += 2; // TPC PUCCH
|
||||
size += 3; // PUCCH resource indicator
|
||||
size += 3; // PDSCH to HARQ timing indicator
|
||||
// Antenna ports
|
||||
// Tx Config Indication
|
||||
size += 2; // SRS request
|
||||
// CBGTI
|
||||
// CBGFI
|
||||
size += 1; // DMRS sequence init
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_2_0:
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_2_1:
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_2_2:
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_2_3:
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid NR DCI format %d\n", format);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
int tdd_period_to_num[8] = {500,625,1000,1250,2000,2500,5000,10000};
|
||||
|
||||
int is_nr_DL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slot) {
|
||||
|
||||
int period,period1,period2=0;
|
||||
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon==NULL) return(1);
|
||||
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 &&
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530)
|
||||
period1 = 3000+*scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
else
|
||||
period1 = tdd_period_to_num[scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity];
|
||||
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2) {
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1 &&
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1->dl_UL_TransmissionPeriodicity_v1530)
|
||||
period2 = 3000+*scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
else
|
||||
period2 = tdd_period_to_num[scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity];
|
||||
}
|
||||
period = period1+period2;
|
||||
int scs=scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing;
|
||||
int slots=period*(1<<scs)/1000;
|
||||
int slots1=period1*(1<<scs)/1000;
|
||||
int slot_in_period = slot % slots;
|
||||
if (slot_in_period < slots1) return(slot_in_period <= scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots ? 1 : 0);
|
||||
else return(slot_in_period <= slots1+scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
||||
}
|
||||
|
||||
int is_nr_UL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slot) {
|
||||
|
||||
int period,period1,period2=0;
|
||||
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon==NULL) return(1);
|
||||
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 &&
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530)
|
||||
period1 = 3000+*scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
else
|
||||
period1 = tdd_period_to_num[scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity];
|
||||
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2) {
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1 &&
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1->dl_UL_TransmissionPeriodicity_v1530)
|
||||
period2 = 3000+*scc->tdd_UL_DL_ConfigurationCommon->pattern2->ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
else
|
||||
period2 = tdd_period_to_num[scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity];
|
||||
}
|
||||
period = period1+period2;
|
||||
int scs=scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing;
|
||||
int slots=period*(1<<scs)/1000;
|
||||
int slots1=period1*(1<<scs)/1000;
|
||||
int slot_in_period = slot % slots;
|
||||
if (slot_in_period < slots1) return(slot_in_period >= scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots ? 1 : 0);
|
||||
else return(slot_in_period >= slots1+scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
||||
}
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols) {
|
||||
|
||||
int l0;
|
||||
if (dmrs_TypeA_Position == NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2) l0=2;
|
||||
else if (dmrs_TypeA_Position == NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos3) l0=3;
|
||||
else AssertFatal(1==0,"Illegal dmrs_TypeA_Position %d\n",(int)dmrs_TypeA_Position);
|
||||
if (pdsch_Config == NULL) { // Initial BWP
|
||||
return(1<<l0);
|
||||
}
|
||||
else {
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA &&
|
||||
pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->present == NR_SetupRelease_DMRS_DownlinkConfig_PR_setup) {
|
||||
// Relative to start of slot
|
||||
NR_DMRS_DownlinkConfig_t *dmrs_config = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
|
||||
AssertFatal(NrOfSymbols>1 && NrOfSymbols < 15,"Illegal NrOfSymbols %d\n",NrOfSymbols);
|
||||
int pos2=0;
|
||||
if (dmrs_config->maxLength == NULL) {
|
||||
// this is Table 7.4.1.1.2-3: PDSCH DM-RS positions l for single-symbol DM-RS
|
||||
if (dmrs_config->dmrs_AdditionalPosition == NULL) pos2=1;
|
||||
else if (dmrs_config->dmrs_AdditionalPosition && *dmrs_config->dmrs_AdditionalPosition == NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0 )
|
||||
return(1<<l0);
|
||||
|
||||
|
||||
switch (NrOfSymbols) {
|
||||
case 2 :
|
||||
case 3 :
|
||||
case 4 :
|
||||
case 5 :
|
||||
case 6 :
|
||||
case 7 :
|
||||
AssertFatal(1==0,"Incoompatible NrOfSymbols %d and dmrs_Additional_Position %d\n",
|
||||
NrOfSymbols,(int)*dmrs_config->dmrs_AdditionalPosition);
|
||||
break;
|
||||
case 8 :
|
||||
case 9:
|
||||
return(1<<l0 | 1<<7);
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1)
|
||||
return(1<<l0 | 1<<9);
|
||||
else
|
||||
return(1<<l0 | 1<<6 | 1<<9);
|
||||
break;
|
||||
case 12:
|
||||
if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1)
|
||||
return(1<<l0 | 1<<9);
|
||||
else if (pos2==1)
|
||||
return(1<<l0 | 1<<6 | 1<<9);
|
||||
else if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos3)
|
||||
return(1<<l0 | 1<<5 | 1<<8 | 1<<11);
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1)
|
||||
return(1<<l0 | 1<<11);
|
||||
else if (pos2==1)
|
||||
return(1<<l0 | 1<<7 | 1<<11);
|
||||
else if (*dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos3)
|
||||
return(1<<l0 | 1<<5 | 1<<8 | 1<<11);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Table 7.4.1.1.2-4: PDSCH DM-RS positions l for double-symbol DM-RS.
|
||||
AssertFatal(NrOfSymbols>3,"Illegal NrOfSymbols %d for len2 DMRS\n",NrOfSymbols);
|
||||
if (NrOfSymbols < 10) return(1<<l0);
|
||||
if (NrOfSymbols < 13 && *dmrs_config->dmrs_AdditionalPosition==NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (NrOfSymbols < 13 && *dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0 | 1<<8);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0) return(1<<l0);
|
||||
if (*dmrs_config->dmrs_AdditionalPosition!=NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1) return(1<<l0 | 1<<10);
|
||||
}
|
||||
}
|
||||
else if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB &&
|
||||
pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->present == NR_SetupRelease_DMRS_DownlinkConfig_PR_setup) {
|
||||
// Relative to start of PDSCH resource
|
||||
AssertFatal(1==0,"TypeB DMRS not supported yet\n");
|
||||
}
|
||||
}
|
||||
AssertFatal(1==0,"Shouldn't get here\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -35,133 +35,340 @@
|
||||
|
||||
#include "NR_MAC-CellGroupConfig.h"
|
||||
|
||||
#include "../NR_MAC_gNB/nr_mac_common.h"
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
|
||||
int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
|
||||
int mu,
|
||||
int nrofDownlinkSlots, int nrofDownlinkSymbols,
|
||||
int nrofUplinkSlots, int nrofUplinkSymbols) {
|
||||
|
||||
int slot_number = 0;
|
||||
int nb_periods_per_frame;
|
||||
int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<<mu)*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||
|
||||
switch(cfg->tdd_table.tdd_period) {
|
||||
case 0:
|
||||
nb_periods_per_frame = 20; // 10ms/0p5ms
|
||||
break;
|
||||
|
||||
case 1:
|
||||
nb_periods_per_frame = 16; // 10ms/0p625ms
|
||||
break;
|
||||
|
||||
case 2:
|
||||
nb_periods_per_frame = 10; // 10ms/1ms
|
||||
break;
|
||||
|
||||
case 3:
|
||||
nb_periods_per_frame = 8; // 10ms/1p25ms
|
||||
break;
|
||||
|
||||
case 4:
|
||||
nb_periods_per_frame = 5; // 10ms/2ms
|
||||
break;
|
||||
|
||||
case 5:
|
||||
nb_periods_per_frame = 4; // 10ms/2p5ms
|
||||
break;
|
||||
|
||||
case 6:
|
||||
nb_periods_per_frame = 2; // 10ms/5ms
|
||||
break;
|
||||
|
||||
case 7:
|
||||
nb_periods_per_frame = 1; // 10ms/10ms
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Undefined tdd period %d\n", cfg->tdd_table.tdd_period);
|
||||
}
|
||||
|
||||
int nb_slots_per_period = ((1<<mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME)/nb_periods_per_frame;
|
||||
|
||||
if ( (nrofDownlinkSymbols + nrofUplinkSymbols) == 0 )
|
||||
AssertFatal(nb_slots_per_period == (nrofDownlinkSlots + nrofUplinkSlots),
|
||||
"set_tdd_configuration_nr: given period is inconsistent with current tdd configuration, nrofDownlinkSlots %d, nrofUplinkSlots %d, nb_slots_per_period %d \n",
|
||||
nrofDownlinkSlots,nrofUplinkSlots,nb_slots_per_period);
|
||||
else {
|
||||
AssertFatal(nrofDownlinkSymbols + nrofUplinkSymbols < 14,"illegal symbol configuration DL %d, UL %d\n",nrofDownlinkSymbols,nrofUplinkSymbols);
|
||||
AssertFatal(nb_slots_per_period == (nrofDownlinkSlots + nrofUplinkSlots + 1),
|
||||
"set_tdd_configuration_nr: given period is inconsistent with current tdd configuration, nrofDownlinkSlots %d, nrofUplinkSlots %d, nrofMixed slots 1, nb_slots_per_period %d \n",
|
||||
nrofDownlinkSlots,nrofUplinkSlots,nb_slots_per_period);
|
||||
}
|
||||
|
||||
cfg->tdd_table.max_tdd_periodicity_list = (fapi_nr_max_tdd_periodicity_t *) malloc(nb_slots_to_set*sizeof(fapi_nr_max_tdd_periodicity_t));
|
||||
|
||||
for(int memory_alloc =0 ; memory_alloc<nb_slots_to_set; memory_alloc++)
|
||||
cfg->tdd_table.max_tdd_periodicity_list[memory_alloc].max_num_of_symbol_per_slot_list = (fapi_nr_max_num_of_symbol_per_slot_t *) malloc(NR_NUMBER_OF_SYMBOLS_PER_SLOT*sizeof(
|
||||
fapi_nr_max_num_of_symbol_per_slot_t));
|
||||
|
||||
while(slot_number != nb_slots_to_set) {
|
||||
if(nrofDownlinkSlots != 0) {
|
||||
for (int number_of_symbol = 0; number_of_symbol < nrofDownlinkSlots*NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config= 0;
|
||||
|
||||
if((number_of_symbol+1)%NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
|
||||
slot_number++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nrofDownlinkSymbols != 0 || nrofUplinkSymbols != 0) {
|
||||
for(int number_of_symbol =0; number_of_symbol < nrofDownlinkSymbols; number_of_symbol++) {
|
||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config= 0;
|
||||
}
|
||||
|
||||
for(int number_of_symbol = nrofDownlinkSymbols; number_of_symbol < NR_NUMBER_OF_SYMBOLS_PER_SLOT-nrofUplinkSymbols; number_of_symbol++) {
|
||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config= 2;
|
||||
}
|
||||
|
||||
for(int number_of_symbol = NR_NUMBER_OF_SYMBOLS_PER_SLOT-nrofUplinkSymbols; number_of_symbol < NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol].slot_config= 1;
|
||||
}
|
||||
|
||||
slot_number++;
|
||||
}
|
||||
|
||||
if(nrofUplinkSlots != 0) {
|
||||
for (int number_of_symbol = 0; number_of_symbol < nrofUplinkSlots*NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
|
||||
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config= 1;
|
||||
|
||||
if((number_of_symbol+1)%NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
|
||||
slot_number++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
module_id_t module_id,
|
||||
int cc_idP) {
|
||||
|
||||
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
int i;
|
||||
|
||||
mac->phy_config.Mod_id = module_id;
|
||||
mac->phy_config.CC_id = cc_idP;
|
||||
|
||||
// carrier config
|
||||
|
||||
LOG_I(MAC,"UE Config Common\n");
|
||||
|
||||
cfg->carrier_config.dl_bandwidth = config_bandwidth(scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
|
||||
*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
|
||||
cfg->carrier_config.dl_frequency = from_nrarfcn(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],
|
||||
*scc->ssbSubcarrierSpacing,
|
||||
scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA)/1000; // freq in kHz
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
if (i==scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.dl_grid_size[i] = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.dl_k0[i] = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
}
|
||||
else {
|
||||
cfg->carrier_config.dl_grid_size[i] = 0;
|
||||
cfg->carrier_config.dl_k0[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
cfg->carrier_config.uplink_bandwidth = config_bandwidth(scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
|
||||
*scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]);
|
||||
|
||||
int UL_pointA;
|
||||
if (scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA == NULL)
|
||||
UL_pointA = scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
|
||||
else
|
||||
UL_pointA = *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
|
||||
|
||||
cfg->carrier_config.uplink_frequency = from_nrarfcn(*scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],
|
||||
*scc->ssbSubcarrierSpacing,
|
||||
UL_pointA)/1000; // freq in kHz
|
||||
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
if (i==scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.ul_grid_size[i] = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.ul_k0[i] = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
}
|
||||
else {
|
||||
cfg->carrier_config.ul_grid_size[i] = 0;
|
||||
cfg->carrier_config.ul_k0[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// cell config
|
||||
|
||||
cfg->cell_config.phy_cell_id = *scc->physCellId;
|
||||
cfg->cell_config.frame_duplex_type = 1;
|
||||
|
||||
|
||||
// SSB config
|
||||
cfg->ssb_config.ss_pbch_power = scc->ss_PBCH_BlockPower;
|
||||
cfg->ssb_config.scs_common = *scc->ssbSubcarrierSpacing;
|
||||
|
||||
// SSB Table config
|
||||
int scs_scaling = 1<<(cfg->ssb_config.scs_common);
|
||||
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000)
|
||||
scs_scaling = scs_scaling*3;
|
||||
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666)
|
||||
scs_scaling = scs_scaling>>2;
|
||||
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
cfg->ssb_table.ssb_offset_point_a = absolute_diff/(12*scs_scaling) - 10;
|
||||
cfg->ssb_table.ssb_period = *scc->ssb_periodicityServingCell;
|
||||
cfg->ssb_table.ssb_subcarrier_offset = 0; // TODO currently not in RRC?
|
||||
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1 :
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask = scc->ssb_PositionsInBurst->choice.shortBitmap.buf[0]<<24;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask = 0;
|
||||
break;
|
||||
case 2 :
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask = scc->ssb_PositionsInBurst->choice.mediumBitmap.buf[0]<<24;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask = 0;
|
||||
break;
|
||||
case 3 :
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask = 0;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask = 0;
|
||||
for (i=0; i<4; i++) {
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i+4]<<i*8);
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i]<<i*8);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"SSB bitmap size value %d undefined (allowed values 1,2,3) \n", scc->ssb_PositionsInBurst->present);
|
||||
}
|
||||
|
||||
// TDD Table Configuration
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL)
|
||||
cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
|
||||
else {
|
||||
AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL,
|
||||
"scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n");
|
||||
cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
}
|
||||
LOG_I(MAC,"Setting TDD configuration period to %d\n",cfg->tdd_table.tdd_period);
|
||||
if(cfg->cell_config.frame_duplex_type == TDD){
|
||||
int return_tdd = set_tdd_config_nr_ue(cfg,
|
||||
scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols
|
||||
);
|
||||
|
||||
if (return_tdd !=0)
|
||||
LOG_E(PHY,"TDD configuration can not be done\n");
|
||||
else
|
||||
LOG_I(PHY,"TDD has been properly configurated\n");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int nr_rrc_mac_config_req_ue(
|
||||
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_ServingCellConfigCommon_t *sccP,
|
||||
// NR_MAC_CellGroupConfig_t *mac_cell_group_configP,
|
||||
// NR_PhysicalCellGroupConfig_t *phy_cell_group_configP,
|
||||
NR_SpCellConfig_t *spCell_ConfigP ){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
|
||||
// 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.
|
||||
// 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(mibP != NULL){
|
||||
mac->mib = mibP; // update by every reception
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP != NULL){
|
||||
if(mac_cell_group_configP->drx_Config != NULL ){
|
||||
switch(mac_cell_group_configP->drx_Config->present){
|
||||
case NR_SetupRelease_DRX_Config_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_DRX_Config_PR_release:
|
||||
mac->drx_Config = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_DRX_Config_PR_setup:
|
||||
mac->drx_Config = mac_cell_group_configP->drx_Config->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->schedulingRequestConfig != NULL ){
|
||||
mac->schedulingRequestConfig = mac_cell_group_configP->schedulingRequestConfig;
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->bsr_Config != NULL ){
|
||||
mac->bsr_Config = mac_cell_group_configP->bsr_Config;
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->tag_Config != NULL ){
|
||||
mac->tag_Config = mac_cell_group_configP->tag_Config;
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->phr_Config != NULL ){
|
||||
switch(mac_cell_group_configP->phr_Config->present){
|
||||
case NR_SetupRelease_PHR_Config_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_PHR_Config_PR_release:
|
||||
mac->phr_Config = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_PHR_Config_PR_setup:
|
||||
mac->phr_Config = mac_cell_group_configP->phr_Config->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(phy_cell_group_configP->cs_RNTI != NULL ){
|
||||
switch(phy_cell_group_configP->cs_RNTI->present){
|
||||
case NR_SetupRelease_RNTI_Value_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_RNTI_Value_PR_release:
|
||||
mac->cs_RNTI = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_RNTI_Value_PR_setup:
|
||||
mac->cs_RNTI = &phy_cell_group_configP->cs_RNTI->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mac->mib = mibP; // update by every reception
|
||||
}
|
||||
|
||||
if(phy_cell_group_configP != NULL ){
|
||||
//config_phy(phy_cell_group_config, NULL);
|
||||
}
|
||||
|
||||
// TODO check
|
||||
#if 0
|
||||
if(serving_cell_config_configP != NULL ){
|
||||
//config_phy(NULL, spcell_config);
|
||||
mac->servCellIndex = spcell_config->servCellIndex;
|
||||
}
|
||||
|
||||
|
||||
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 != 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 != NULL ){
|
||||
mac->BWP_Downlink_list = spcell_config->downlinkBWP_ToAddModList->list;
|
||||
mac->BWP_Downlink_count = spcell_config->downlinkBWP_ToAddModList->count;
|
||||
}
|
||||
|
||||
if(spcell_config->bwp_InactivityTimer != NULL ){
|
||||
mac->bwp_InactivityTimer = spcell_config->bwp_InactivityTimer;
|
||||
}
|
||||
|
||||
if(spcell_config->defaultDownlinkBWP_Id != NULL ){
|
||||
mac->defaultDownlinkBWP_Id = spcell_config->defaultDownlinkBWP_Id;
|
||||
}
|
||||
|
||||
if(spcell_config->pdsch_ServingCellConfig != NULL ){
|
||||
mac->pdsch_ServingCellConfig = spcell_config->pdsch_ServingCellConfig;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if(spCell_ConfigP != NULL ){
|
||||
mac->servCellIndex = *spCell_ConfigP->servCellIndex;
|
||||
if (spCell_ConfigP->reconfigurationWithSync) {
|
||||
mac->scc = spCell_ConfigP->reconfigurationWithSync->spCellConfigCommon;
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = spCell_ConfigP->reconfigurationWithSync->newUE_Identity;
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
}
|
||||
mac->scd = spCell_ConfigP->spCellConfigDedicated;
|
||||
|
||||
/*
|
||||
if(mac_cell_group_configP != NULL){
|
||||
if(mac_cell_group_configP->drx_Config != NULL ){
|
||||
switch(mac_cell_group_configP->drx_Config->present){
|
||||
case NR_SetupRelease_DRX_Config_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_DRX_Config_PR_release:
|
||||
mac->drx_Config = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_DRX_Config_PR_setup:
|
||||
mac->drx_Config = mac_cell_group_configP->drx_Config->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->schedulingRequestConfig != NULL ){
|
||||
mac->schedulingRequestConfig = mac_cell_group_configP->schedulingRequestConfig;
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->bsr_Config != NULL ){
|
||||
mac->bsr_Config = mac_cell_group_configP->bsr_Config;
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->tag_Config != NULL ){
|
||||
mac->tag_Config = mac_cell_group_configP->tag_Config;
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->phr_Config != NULL ){
|
||||
switch(mac_cell_group_configP->phr_Config->present){
|
||||
case NR_SetupRelease_PHR_Config_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_PHR_Config_PR_release:
|
||||
mac->phr_Config = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_PHR_Config_PR_setup:
|
||||
mac->phr_Config = mac_cell_group_configP->phr_Config->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(phy_cell_group_configP != NULL ){
|
||||
if(phy_cell_group_configP->cs_RNTI != NULL ){
|
||||
switch(phy_cell_group_configP->cs_RNTI->present){
|
||||
case NR_SetupRelease_RNTI_Value_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_RNTI_Value_PR_release:
|
||||
mac->cs_RNTI = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_RNTI_Value_PR_setup:
|
||||
mac->cs_RNTI = &phy_cell_group_configP->cs_RNTI->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "NR_ServingCellConfig.h"
|
||||
#include "fapi_nr_ue_interface.h"
|
||||
#include "NR_IF_Module.h"
|
||||
#include "../NR_MAC_gNB/nr_mac_common.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
|
||||
@@ -129,33 +130,48 @@ typedef struct {
|
||||
} NR_UE_SCHEDULING_INFO;
|
||||
|
||||
|
||||
#define MAX_NUM_BWP 2
|
||||
|
||||
typedef enum {
|
||||
RA_IDLE=0,
|
||||
WAIT_RAR=1,
|
||||
WAIT_CONTENTION_RESOLUTION=2
|
||||
} RA_state_t;
|
||||
/*!\brief Top level UE MAC structure */
|
||||
typedef struct {
|
||||
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc;
|
||||
NR_ServingCellConfig_t *scd;
|
||||
int servCellIndex;
|
||||
//// MAC config
|
||||
NR_DRX_Config_t *drx_Config;
|
||||
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
|
||||
NR_BSR_Config_t *bsr_Config;
|
||||
NR_TAG_Config_t *tag_Config;
|
||||
NR_PHR_Config_t *phr_Config;
|
||||
NR_RNTI_Value_t *cs_RNTI;
|
||||
NR_MIB_t *mib;
|
||||
|
||||
NR_DRX_Config_t *drx_Config;
|
||||
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
|
||||
NR_BSR_Config_t *bsr_Config;
|
||||
NR_TAG_Config_t *tag_Config;
|
||||
NR_PHR_Config_t *phr_Config;
|
||||
NR_RNTI_Value_t *cs_RNTI;
|
||||
NR_MIB_t *mib;
|
||||
|
||||
NR_BWP_Downlink_t *DLbwp[MAX_NUM_BWP];
|
||||
NR_BWP_Uplink_t *ULbwp[MAX_NUM_BWP];
|
||||
NR_ControlResourceSet_t *coreset[MAX_NUM_BWP][FAPI_NR_MAX_CORESET_PER_BWP];
|
||||
NR_SearchSpace_t *SSpace[MAX_NUM_BWP][FAPI_NR_MAX_CORESET_PER_BWP][FAPI_NR_MAX_SS_PER_CORESET];
|
||||
|
||||
/// Type0-PDCCH seach space
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t type0_pdcch_dci_config;
|
||||
uint32_t type0_pdcch_ss_mux_pattern;
|
||||
SFN_C_TYPE type0_pdcch_ss_sfn_c;
|
||||
uint32_t type0_pdcch_ss_n_c;
|
||||
uint32_t type0_pdcch_consecutive_slots;
|
||||
|
||||
/// Random access parameter
|
||||
/// state of RA procedure
|
||||
RA_state_t ra_state;
|
||||
/// RA-rnti
|
||||
uint16_t ra_rnti;
|
||||
/// Temporary CRNTI
|
||||
uint16_t t_crnti;
|
||||
/// CRNTI
|
||||
uint16_t crnti;
|
||||
|
||||
//BWP params
|
||||
NR_BWP_PARMS initial_bwp_dl;
|
||||
NR_BWP_PARMS initial_bwp_ul;
|
||||
|
||||
//// FAPI-like interface message
|
||||
fapi_nr_tx_request_t tx_request;
|
||||
fapi_nr_ul_config_request_t ul_config_request;
|
||||
@@ -204,7 +220,139 @@ typedef enum frequency_range_e {
|
||||
FR2
|
||||
} frequency_range_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t identifier_dci_formats ; // 0 IDENTIFIER_DCI_FORMATS:
|
||||
uint8_t carrier_ind ; // 1 CARRIER_IND: 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213]
|
||||
uint8_t sul_ind_0_1 ; // 2 SUL_IND_0_1:
|
||||
uint8_t slot_format_ind ; // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213]
|
||||
uint8_t pre_emption_ind ; // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits
|
||||
uint8_t block_number ; // 5 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3
|
||||
uint8_t close_loop_ind ; // 6 CLOSE_LOOP_IND:
|
||||
uint8_t bandwidth_part_ind ; // 7 BANDWIDTH_PART_IND:
|
||||
uint8_t short_message_ind ; // 8 SHORT_MESSAGE_IND:
|
||||
uint8_t short_messages ; // 9 SHORT_MESSAGES:
|
||||
uint16_t freq_dom_resource_assignment_UL; // 10 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered
|
||||
// (NOTE 1) If DCI format 0_0 is monitored in common search space
|
||||
// and if the number of information bits in the DCI format 0_0 prior to padding
|
||||
// is larger than the payload size of the DCI format 1_0 monitored in common search space
|
||||
// the bitwidth of the frequency domain resource allocation field in the DCI format 0_0
|
||||
// is reduced such that the size of DCI format 0_0 equals to the size of the DCI format 1_0
|
||||
uint16_t freq_dom_resource_assignment_DL; // 11 FREQ_DOM_RESOURCE_ASSIGNMENT_DL:
|
||||
uint8_t time_dom_resource_assignment ; // 12 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits,
|
||||
// where I the number of entries in the higher layer parameter pusch-AllocationList
|
||||
uint8_t vrb_to_prb_mapping ; // 13 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0
|
||||
uint8_t prb_bundling_size_ind ; // 14 PRB_BUNDLING_SIZE_IND:0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214]
|
||||
uint8_t rate_matching_ind ; // 15 RATE_MATCHING_IND: 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set
|
||||
uint8_t zp_csi_rs_trigger ; // 16 ZP_CSI_RS_TRIGGER:
|
||||
uint8_t freq_hopping_flag ; // 17 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0
|
||||
uint8_t tb1_mcs ; // 18 TB1_MCS:
|
||||
uint8_t tb1_ndi ; // 19 TB1_NDI:
|
||||
uint8_t tb1_rv ; // 20 TB1_RV:
|
||||
uint8_t tb2_mcs ; // 21 TB2_MCS:
|
||||
uint8_t tb2_ndi ; // 22 TB2_NDI:
|
||||
uint8_t tb2_rv ; // 23 TB2_RV:
|
||||
uint8_t mcs ; // 24 MCS:
|
||||
uint8_t ndi ; // 25 NDI:
|
||||
uint8_t rv ; // 26 RV:
|
||||
uint8_t harq_process_number ; // 27 HARQ_PROCESS_NUMBER:
|
||||
uint8_t dai ; // 28 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI
|
||||
// 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI
|
||||
// 0 otherwise
|
||||
uint8_t first_dai ; // 29 FIRST_DAI: (1 or 2 bits) 1 bit for semi-static HARQ-ACK
|
||||
uint8_t second_dai ; // 30 SECOND_DAI: (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks
|
||||
uint8_t tb_scaling ; // 31 TB_SCALING:
|
||||
uint8_t tpc_pusch ; // 32 TPC_PUSCH:
|
||||
uint8_t tpc_pucch ; // 33 TPC_PUCCH:
|
||||
uint8_t pucch_resource_ind ; // 34 PUCCH_RESOURCE_IND:
|
||||
uint8_t pdsch_to_harq_feedback_time_ind ; // 35 PDSCH_TO_HARQ_FEEDBACK_TIME_IND:
|
||||
uint8_t srs_resource_ind ; // 36 SRS_RESOURCE_IND:
|
||||
uint8_t precod_nbr_layers ; // 37 PRECOD_NBR_LAYERS:
|
||||
uint8_t antenna_ports ; // 38 ANTENNA_PORTS:
|
||||
uint8_t tci ; // 39 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits
|
||||
uint8_t srs_request ; // 40 SRS_REQUEST:
|
||||
uint8_t tpc_cmd ; // 41 TPC_CMD:
|
||||
uint8_t csi_request ; // 42 CSI_REQUEST:
|
||||
uint8_t cbgti ; // 43 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH
|
||||
uint8_t cbgfi ; // 44 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator
|
||||
uint8_t ptrs_dmrs ; // 45 PTRS_DMRS:
|
||||
uint8_t beta_offset_ind ; // 46 BETA_OFFSET_IND:
|
||||
uint8_t dmrs_seq_ini ; // 47 DMRS_SEQ_INI: 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding
|
||||
// is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise
|
||||
uint8_t ul_sch_ind ; // 48 UL_SCH_IND: value of "1" indicates UL-SCH shall be transmitted on the PUSCH and a value of "0" indicates UL-SCH shall not be transmitted on the PUSCH
|
||||
uint16_t padding_nr_dci ; // 49 PADDING_NR_DCI: (Note 2) If DCI format 0_0 is monitored in common search space
|
||||
// and if the number of information bits in the DCI format 0_0 prior to padding
|
||||
// is less than the payload size of the DCI format 1_0 monitored in common search space
|
||||
// zeros shall be appended to the DCI format 0_0
|
||||
// until the payload size equals that of the DCI format 1_0
|
||||
uint8_t sul_ind_0_0 ; // 50 SUL_IND_0_0:
|
||||
uint8_t ra_preamble_index ; // 51 RA_PREAMBLE_INDEX:
|
||||
uint8_t sul_ind_1_0 ; // 52 SUL_IND_1_0:
|
||||
uint8_t ss_pbch_index ; // 53 SS_PBCH_INDEX
|
||||
uint8_t prach_mask_index ; // 54 PRACH_MASK_INDEX
|
||||
uint8_t reserved_nr_dci ; // 55 RESERVED_NR_DCI
|
||||
} nr_dci_pdu_rel15_t;
|
||||
|
||||
#define NUM_SLOT_FRAME 10
|
||||
|
||||
#define NBR_NR_FORMATS 8 // The number of formats is 8 (0_0, 0_1, 1_0, 1_1, 2_0, 2_1, 2_2, 2_3)
|
||||
#define NBR_NR_DCI_FIELDS 56 // The number of different dci fields defined in TS 38.212 subclause 7.3.1
|
||||
|
||||
#define IDENTIFIER_DCI_FORMATS 0
|
||||
#define CARRIER_IND 1
|
||||
#define SUL_IND_0_1 2
|
||||
#define SLOT_FORMAT_IND 3
|
||||
#define PRE_EMPTION_IND 4
|
||||
#define BLOCK_NUMBER 5
|
||||
#define CLOSE_LOOP_IND 6
|
||||
#define BANDWIDTH_PART_IND 7
|
||||
#define SHORT_MESSAGE_IND 8
|
||||
#define SHORT_MESSAGES 9
|
||||
#define FREQ_DOM_RESOURCE_ASSIGNMENT_UL 10
|
||||
#define FREQ_DOM_RESOURCE_ASSIGNMENT_DL 11
|
||||
#define TIME_DOM_RESOURCE_ASSIGNMENT 12
|
||||
#define VRB_TO_PRB_MAPPING 13
|
||||
#define PRB_BUNDLING_SIZE_IND 14
|
||||
#define RATE_MATCHING_IND 15
|
||||
#define ZP_CSI_RS_TRIGGER 16
|
||||
#define FREQ_HOPPING_FLAG 17
|
||||
#define TB1_MCS 18
|
||||
#define TB1_NDI 19
|
||||
#define TB1_RV 20
|
||||
#define TB2_MCS 21
|
||||
#define TB2_NDI 22
|
||||
#define TB2_RV 23
|
||||
#define MCS 24
|
||||
#define NDI 25
|
||||
#define RV 26
|
||||
#define HARQ_PROCESS_NUMBER 27
|
||||
#define DAI_ 28
|
||||
#define FIRST_DAI 29
|
||||
#define SECOND_DAI 30
|
||||
#define TB_SCALING 31
|
||||
#define TPC_PUSCH 32
|
||||
#define TPC_PUCCH 33
|
||||
#define PUCCH_RESOURCE_IND 34
|
||||
#define PDSCH_TO_HARQ_FEEDBACK_TIME_IND 35
|
||||
#define SRS_RESOURCE_IND 36
|
||||
#define PRECOD_NBR_LAYERS 37
|
||||
#define ANTENNA_PORTS 38
|
||||
#define TCI 39
|
||||
#define SRS_REQUEST 40
|
||||
#define TPC_CMD 41
|
||||
#define CSI_REQUEST 42
|
||||
#define CBGTI 43
|
||||
#define CBGFI 44
|
||||
#define PTRS_DMRS 45
|
||||
#define BETA_OFFSET_IND 46
|
||||
#define DMRS_SEQ_INI 47
|
||||
#define UL_SCH_IND 48
|
||||
#define PADDING_NR_DCI 49
|
||||
#define SUL_IND_0_0 50
|
||||
#define RA_PREAMBLE_INDEX 51
|
||||
#define SUL_IND_1_0 52
|
||||
#define SS_PBCH_INDEX 53
|
||||
#define PRACH_MASK_INDEX 54
|
||||
#define RESERVED_NR_DCI 55
|
||||
|
||||
/*@}*/
|
||||
#endif /*__LAYER2_MAC_DEFS_H__ */
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/* \file proto.h
|
||||
* \brief MAC functions prototypes for eNB and UE
|
||||
* \brief MAC functions prototypes for gNB and UE
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
@@ -35,7 +35,9 @@
|
||||
|
||||
#include "mac_defs.h"
|
||||
#include "mac.h"
|
||||
#include <openair1/PHY/defs_nr_UE.h>
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "RRC/NR_UE/rrc_defs.h"
|
||||
|
||||
|
||||
/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message
|
||||
\param module_id module id
|
||||
@@ -47,7 +49,6 @@
|
||||
\param pdu_length length of pdu
|
||||
\param cell_id cell id */
|
||||
int8_t nr_ue_decode_mib(
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
module_id_t module_id,
|
||||
int cc_id,
|
||||
uint8_t gNB_index,
|
||||
@@ -63,20 +64,18 @@ int8_t nr_ue_decode_mib(
|
||||
\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 sccP pointer to ServingCellConfigCommon structure,
|
||||
\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_rrc_mac_config_req_ue(
|
||||
module_id_t module_id,
|
||||
int cc_idP,
|
||||
uint8_t gNB_index,
|
||||
NR_MIB_t *mibP,
|
||||
//NR_ServingCellConfigCommon_t *sccP,
|
||||
NR_SpCellConfig_t *spCell_ConfigP);
|
||||
|
||||
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
|
||||
int nr_l2_init_ue(void);
|
||||
NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst);
|
||||
|
||||
/**\brief fetch MAC instance by module_id, within 0 - (NB_NR_UE_MAC_INST-1)
|
||||
\param module_id index of MAC instance(s)*/
|
||||
@@ -116,7 +115,8 @@ uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
|
||||
int8_t nr_ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP, uint8_t eNB_id, uint16_t rnti, sub_frame_t subframe);
|
||||
|
||||
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format);
|
||||
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, nr_dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format);
|
||||
int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_index,fapi_nr_dci_indication_pdu_t *dci);
|
||||
|
||||
uint32_t get_ssb_frame(uint32_t test);
|
||||
uint32_t get_ssb_slot(uint32_t ssb_index);
|
||||
@@ -130,38 +130,50 @@ uint32_t mr_ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP, uint8_t
|
||||
@param module_idP Instance id of UE in machine
|
||||
@param CC_id Component Carrier index
|
||||
@param frameP Current Rx frame
|
||||
@param ttiP Current Rx tti subframe
|
||||
@param slotP Current Rx slot
|
||||
@param pdu Pointer to the MAC PDU
|
||||
@param pdu_len Length of the MAC PDU
|
||||
@param eNB_id Index of eNB that UE is attached to
|
||||
@param gNB_id Index of gNB that UE is attached to
|
||||
@param ul_time_alignment of struct handling the timing advance parameters
|
||||
@returns void
|
||||
*/
|
||||
void nr_ue_send_sdu(module_id_t module_idP,uint8_t CC_id, frame_t frameP, uint8_t ttiP,
|
||||
uint8_t * pdu, uint16_t pdu_len, uint8_t gNB_index, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
void nr_ue_send_sdu(module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
int slotP,
|
||||
uint8_t * pdu,
|
||||
uint16_t pdu_len,
|
||||
uint8_t gNB_index,
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
|
||||
void nr_ue_process_mac_pdu(
|
||||
module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
uint8_t *pduP,
|
||||
uint16_t mac_pdu_len,
|
||||
uint8_t eNB_index,
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
void nr_ue_process_mac_pdu(module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
uint8_t *pduP,
|
||||
uint16_t mac_pdu_len,
|
||||
uint8_t gNB_index,
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
|
||||
int8_t nr_ue_process_dlsch(module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_indication_t *dci_ind, void *pduP, uint32_t pdu_len);
|
||||
|
||||
uint8_t nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
sub_frame_t subframe, uint8_t eNB_index,
|
||||
uint8_t *ulsch_buffer, uint16_t buflen, uint8_t *access_mode);
|
||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac,fapi_nr_dl_config_request_t *dl_config,int frame,int slot);
|
||||
|
||||
uint16_t
|
||||
nr_generate_ulsch_pdu(uint8_t *mac_pdu,
|
||||
uint8_t *sdus_payload,
|
||||
uint8_t num_sdus,
|
||||
uint16_t *sdu_lengths,
|
||||
uint8_t *sdu_lcids,
|
||||
uint16_t *crnti,
|
||||
uint16_t buflen);
|
||||
void nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
int dci_format,
|
||||
uint8_t dci_length,
|
||||
uint16_t rnti,
|
||||
uint64_t *dci_pdu,
|
||||
nr_dci_pdu_rel15_t *nr_pdci_info_extracted);
|
||||
|
||||
|
||||
uint8_t
|
||||
nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
sub_frame_t subframe, uint8_t eNB_index,
|
||||
uint8_t *ulsch_buffer, uint16_t buflen, uint8_t *access_mode) ;
|
||||
|
||||
int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu,
|
||||
int nrofDownlinkSlots, int nrofDownlinkSymbols,
|
||||
int nrofUplinkSlots, int nrofUplinkSymbols);
|
||||
|
||||
#endif
|
||||
/** @}*/
|
||||
|
||||
@@ -43,8 +43,7 @@
|
||||
|
||||
static NR_UE_MAC_INST_t *nr_ue_mac_inst;
|
||||
|
||||
int
|
||||
nr_l2_init_ue(void)
|
||||
NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst)
|
||||
{
|
||||
//LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
|
||||
|
||||
@@ -52,17 +51,20 @@ nr_l2_init_ue(void)
|
||||
|
||||
//init mac here
|
||||
nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST);
|
||||
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
if (rrc_inst) {
|
||||
nr_rrc_mac_config_req_ue(0,0,0,NULL,rrc_inst->cell_group_config->spCellConfig);
|
||||
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
if (rlc_module_init(0) != 0) {
|
||||
LOG_I(RLC, "Problem at RLC initiation \n");
|
||||
LOG_I(RLC, "Problem at RLC initiation \n");
|
||||
}
|
||||
pdcp_layer_init();
|
||||
nr_ip_over_LTE_DRB_preconfiguration();
|
||||
}
|
||||
}
|
||||
else LOG_I(MAC,"Running without RRC instance\n");
|
||||
|
||||
|
||||
return (1);
|
||||
return (nr_ue_mac_inst);
|
||||
}
|
||||
|
||||
NR_UE_MAC_INST_t *get_mac_inst(module_id_t module_id){
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* 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 nr_ue_dci_configuration.c
|
||||
* \brief functions for generating dci search procedures based on RRC Serving Cell Group Configuration
|
||||
* \author R. Knopp
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "mac_proto.h"
|
||||
#include "mac_defs.h"
|
||||
#include "assertions.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_extern.h"
|
||||
#include "mac_defs.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
|
||||
#define LOG_DCI_D(a...) printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) ->" a)
|
||||
#else
|
||||
#define LOG_DCI_D(a...)
|
||||
#endif
|
||||
#define LOG_DCI_PARM(a...) LOG_D(PHY,"\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_generate_ue_ul_dlsch_params_from_dci)" a)
|
||||
|
||||
|
||||
void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) {
|
||||
|
||||
LOG_D(MAC,"Filling search candidates for DCI\n");
|
||||
|
||||
rel15->number_of_candidates=3;
|
||||
rel15->CCE[0]=0;
|
||||
rel15->L[0]=4;
|
||||
rel15->CCE[1]=4;
|
||||
rel15->L[1]=4;
|
||||
rel15->CCE[2]=8;
|
||||
rel15->L[2]=4;
|
||||
|
||||
}
|
||||
|
||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac,fapi_nr_dl_config_request_t *dl_config,int frame,int slot) {
|
||||
|
||||
// check if DL slot
|
||||
if (is_nr_DL_slot(mac->scc,slot)==1) {
|
||||
|
||||
// get BWP 1, Coreset 0, SearchSpace 0
|
||||
if (mac->DLbwp[0]==NULL) {
|
||||
AssertFatal(mac->scd->downlinkBWP_ToAddModList!=NULL,"downlinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(mac->scd->downlinkBWP_ToAddModList->list.count==1,"downlinkBWP_ToAddModList->list->count is %d\n",
|
||||
mac->scd->downlinkBWP_ToAddModList->list.count);
|
||||
mac->DLbwp[0] = mac->scd->downlinkBWP_ToAddModList->list.array[0];
|
||||
AssertFatal(mac->DLbwp[0]->bwp_Dedicated!=NULL,"bwp_Dedicated is null\n");
|
||||
AssertFatal(mac->DLbwp[0]->bwp_Dedicated->pdcch_Config!=NULL,"pdcch_Config is null\n");
|
||||
AssertFatal(mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList!=NULL,"controlResourceSetToAddModList is null\n");
|
||||
AssertFatal(mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.count==1,"controlResourceSetToAddModList->list.count=%d\n",
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.count);
|
||||
mac->coreset[0][0] = mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[0];
|
||||
AssertFatal(mac->coreset[0][0]!=NULL,"coreset[0][0] is null\n");
|
||||
|
||||
AssertFatal(mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList!=NULL,"searchPsacesToAddModList is null\n");
|
||||
AssertFatal(mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count>0,
|
||||
"searchPsacesToAddModList is empty\n");
|
||||
NR_SearchSpace_t *ss;
|
||||
int ss_id=0;
|
||||
AssertFatal(mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count<FAPI_NR_MAX_SS_PER_CORESET,
|
||||
"too many searchpaces per coreset %d\n",
|
||||
mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count);
|
||||
for (int i=0;i<mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count;i++) {
|
||||
ss=mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i];
|
||||
AssertFatal(ss->controlResourceSetId != NULL,"ss->controlResourceSetId is null\n");
|
||||
AssertFatal(ss->searchSpaceType != NULL,"ss->searchSpaceType is null\n");
|
||||
AssertFatal(*ss->controlResourceSetId == mac->coreset[0][0]->controlResourceSetId,"ss->controlResourceSetId is unknown\n");
|
||||
mac->SSpace[0][0][ss_id] = ss;
|
||||
ss_id++;
|
||||
}
|
||||
}
|
||||
if (mac->ULbwp[0]==NULL) {
|
||||
AssertFatal(mac->scd->uplinkConfig->uplinkBWP_ToAddModList!=NULL,"uplinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(mac->scd->uplinkConfig->uplinkBWP_ToAddModList->list.count==1,"uplinkBWP_ToAddModList->list->count is %d\n",
|
||||
mac->scd->uplinkConfig->uplinkBWP_ToAddModList->list.count);
|
||||
mac->ULbwp[0] = mac->scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0];
|
||||
AssertFatal(mac->ULbwp[0]->bwp_Dedicated!=NULL,"bwp_Dedicated is null\n");
|
||||
}
|
||||
// check search spaces
|
||||
|
||||
int ss_id=0;
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15;
|
||||
int sps =mac->DLbwp[0]->bwp_Common->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
|
||||
while(mac->SSpace[0][0][ss_id]!=NULL &&
|
||||
ss_id < mac->DLbwp[0]->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count) {
|
||||
|
||||
AssertFatal(mac->SSpace[0][0][ss_id]->monitoringSymbolsWithinSlot!=NULL,"ss->monitoringSymbolsWithinSlot is null\n");
|
||||
AssertFatal(mac->SSpace[0][0][ss_id]->monitoringSymbolsWithinSlot->buf!=NULL,"ss->monitoringSymbolsWithinSlot->buf is null\n");
|
||||
|
||||
ss_id++;
|
||||
}
|
||||
if (mac->ra_state == WAIT_RAR) {
|
||||
// check for RAR
|
||||
rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
rel15->rnti = 2;//get_RA_RNTI(mac,frame,slot);
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
}
|
||||
else if (mac->ra_state == WAIT_CONTENTION_RESOLUTION) {
|
||||
rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
rel15->rnti = mac->t_crnti;
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
}
|
||||
if (mac->crnti>0) {
|
||||
rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
rel15->rnti = mac->crnti;
|
||||
rel15->BWPSize = NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth,275);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth,275);
|
||||
rel15->SubcarrierSpacing = mac->DLbwp[0]->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
// get UE-specific search space
|
||||
for (ss_id=0;ss_id<FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[0][0][ss_id]!=NULL;ss_id++)
|
||||
if (mac->SSpace[0][0][ss_id]->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) break;
|
||||
AssertFatal(ss_id<FAPI_NR_MAX_SS_PER_CORESET,"couldn't find a UE-specific SS\n");
|
||||
// for SPS=14 8 MSBs in positions 13 downto 6,
|
||||
uint16_t monitoringSymbolsWithinSlot = (mac->SSpace[0][0][ss_id]->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) |
|
||||
(mac->SSpace[0][0][ss_id]->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
|
||||
for (int i=0; i<sps; i++)
|
||||
if ((monitoringSymbolsWithinSlot>>(sps-1-i))&1) {
|
||||
rel15->coreset.StartSymbolIndex=i;
|
||||
break;
|
||||
}
|
||||
rel15->coreset.duration = mac->coreset[0][0]->duration;
|
||||
for (int i=0;i<6;i++)
|
||||
rel15->coreset.frequency_domain_resource[i] = mac->coreset[0][0]->frequencyDomainResources.buf[i];
|
||||
|
||||
rel15->coreset.CceRegMappingType = mac->coreset[0][0]->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved?
|
||||
FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED : FAPI_NR_CCE_REG_MAPPING_TYPE_NON_INTERLEAVED;
|
||||
if (rel15->coreset.CceRegMappingType == FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED) {
|
||||
rel15->coreset.RegBundleSize = (mac->coreset[0][0]->cce_REG_MappingType.choice.interleaved->reg_BundleSize == NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2+mac->coreset[0][0]->cce_REG_MappingType.choice.interleaved->reg_BundleSize);
|
||||
rel15->coreset.InterleaverSize = (mac->coreset[0][0]->cce_REG_MappingType.choice.interleaved->interleaverSize==NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2+mac->coreset[0][0]->cce_REG_MappingType.choice.interleaved->interleaverSize);
|
||||
AssertFatal(mac->scc->physCellId != NULL,"mac->scc->physCellId is null\n");
|
||||
rel15->coreset.ShiftIndex = mac->coreset[0][0]->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *mac->coreset[0][0]->cce_REG_MappingType.choice.interleaved->shiftIndex : *mac->scc->physCellId;
|
||||
}
|
||||
else {
|
||||
rel15->coreset.RegBundleSize = 0;
|
||||
rel15->coreset.InterleaverSize = 0;
|
||||
rel15->coreset.ShiftIndex = 0;
|
||||
}
|
||||
rel15->coreset.CoreSetType = 1;
|
||||
rel15->coreset.precoder_granularity = mac->coreset[0][0]->precoderGranularity;
|
||||
if (mac->coreset[0][0]->pdcch_DMRS_ScramblingID)
|
||||
rel15->coreset.pdcch_dmrs_scrambling_id = *mac->coreset[0][0]->pdcch_DMRS_ScramblingID;
|
||||
else
|
||||
rel15->coreset.pdcch_dmrs_scrambling_id = *mac->scc->physCellId;
|
||||
fill_dci_search_candidates(mac->SSpace[0][0][ss_id],rel15);
|
||||
rel15->dci_format = NR_DL_DCI_FORMAT_1_0;
|
||||
rel15->dci_length = nr_dci_size(rel15->dci_format,NR_RNTI_C,rel15->BWPSize);
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DCI;
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+307
-152
@@ -41,8 +41,10 @@
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
|
||||
#include "NR_MIB.h"
|
||||
#include "nr_mac_common.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
//extern int l2_init_gNB(void);
|
||||
@@ -50,170 +52,323 @@ extern void mac_top_init_gNB(void);
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
|
||||
void config_nr_mib(int Mod_idP,
|
||||
int CC_idP,
|
||||
int p_gNBP,
|
||||
int subCarrierSpacingCommon,
|
||||
uint32_t ssb_SubcarrierOffset,
|
||||
int dmrs_TypeA_Position,
|
||||
uint32_t pdcch_ConfigSIB1,
|
||||
int cellBarred,
|
||||
int intraFreqReselection
|
||||
){
|
||||
nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
|
||||
void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
|
||||
|
||||
cfg->num_tlv=0;
|
||||
|
||||
cfg->rf_config.dl_subcarrierspacing.value = subCarrierSpacingCommon;
|
||||
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0];
|
||||
RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon = scc;
|
||||
int i;
|
||||
|
||||
cfg->rf_config.dl_subcarrierspacing.tl.tag = NFAPI_NR_RF_CONFIG_DL_SUBCARRIERSPACING_TAG;
|
||||
// Carrier configuration
|
||||
|
||||
cfg->carrier_config.dl_bandwidth.value = config_bandwidth(scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
|
||||
*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
cfg->carrier_config.dl_bandwidth.tl.tag = NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG; //temporary
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->rf_config.ul_subcarrierspacing.value = subCarrierSpacingCommon;
|
||||
cfg->rf_config.ul_subcarrierspacing.tl.tag = NFAPI_NR_RF_CONFIG_UL_SUBCARRIERSPACING_TAG;
|
||||
LOG_I(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, cfg->carrier_config.dl_bandwidth.value);
|
||||
|
||||
cfg->carrier_config.dl_frequency.value = from_nrarfcn(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],
|
||||
*scc->ssbSubcarrierSpacing,
|
||||
scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA)/1000; // freq in kHz
|
||||
cfg->carrier_config.dl_frequency.tl.tag = NFAPI_NR_CONFIG_DL_FREQUENCY_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->sch_config.ssb_subcarrier_offset.value = ssb_SubcarrierOffset;
|
||||
cfg->sch_config.ssb_subcarrier_offset.tl.tag = NFAPI_NR_SCH_CONFIG_SSB_SUBCARRIER_OFFSET_TAG;
|
||||
cfg->num_tlv++;
|
||||
}
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int CC_idP,
|
||||
int cellid,
|
||||
int nr_bandP,
|
||||
uint64_t ssb_pattern,
|
||||
uint16_t ssb_periodicity,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
uint32_t dl_BandwidthP)
|
||||
{
|
||||
nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
|
||||
|
||||
int mu = 1;
|
||||
|
||||
cfg->sch_config.physical_cell_id.value = cellid;
|
||||
cfg->sch_config.ssb_scg_position_in_burst.value = ssb_pattern;
|
||||
cfg->sch_config.ssb_periodicity.value = ssb_periodicity;
|
||||
|
||||
// FDD
|
||||
cfg->subframe_config.duplex_mode.value = 1;
|
||||
cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
/// In NR DL and UL will be different band
|
||||
cfg->nfapi_config.rf_bands.number_rf_bands = 1;
|
||||
cfg->nfapi_config.rf_bands.rf_band[0] = nr_bandP;
|
||||
cfg->nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->nfapi_config.nrarfcn.value = to_nrarfcn(nr_bandP,dl_CarrierFreqP,dl_BandwidthP*180000*(1+mu));
|
||||
cfg->nfapi_config.nrarfcn.tl.tag = NFAPI_NR_NFAPI_NRARFCN_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->subframe_config.numerology_index_mu.value = mu;
|
||||
//cfg->subframe_config.tl.tag =
|
||||
//cfg->num_tlv++;
|
||||
|
||||
cfg->rf_config.dl_carrier_bandwidth.value = dl_BandwidthP;
|
||||
cfg->rf_config.dl_carrier_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; //temporary
|
||||
cfg->num_tlv++;
|
||||
LOG_I(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
|
||||
|
||||
cfg->rf_config.ul_carrier_bandwidth.value = dl_BandwidthP;
|
||||
cfg->rf_config.ul_carrier_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG; //temporary
|
||||
cfg->num_tlv++;
|
||||
|
||||
//cfg->sch_config.half_frame_index.value = 0; Fix in PHY
|
||||
//cfg->sch_config.n_ssb_crb.value = 86; Fix in PHY
|
||||
|
||||
}
|
||||
|
||||
/*void config_servingcellconfigcommon(){
|
||||
|
||||
}*/
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
int cellid,
|
||||
int p_gNB,
|
||||
int nr_bandP,
|
||||
uint64_t ssb_pattern,
|
||||
uint16_t ssb_enum_periodicity,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
int dl_BandwidthP,
|
||||
NR_BCCH_BCH_Message_t *mib,
|
||||
NR_ServingCellConfigCommon_t *servingcellconfigcommon)
|
||||
{
|
||||
uint16_t ssb_periodicity=0;
|
||||
|
||||
switch (ssb_enum_periodicity) {
|
||||
case 0:
|
||||
ssb_periodicity = 5;
|
||||
break;
|
||||
case 1:
|
||||
ssb_periodicity = 10;
|
||||
break;
|
||||
case 2:
|
||||
ssb_periodicity = 20;
|
||||
break;
|
||||
case 3:
|
||||
ssb_periodicity = 40;
|
||||
break;
|
||||
case 4:
|
||||
ssb_periodicity = 80;
|
||||
break;
|
||||
case 5:
|
||||
ssb_periodicity = 160;
|
||||
break;
|
||||
}
|
||||
|
||||
if( mib != NULL ){
|
||||
config_nr_mib(Mod_idP,
|
||||
CC_idP,
|
||||
p_gNB,
|
||||
mib->message.choice.mib->subCarrierSpacingCommon,
|
||||
mib->message.choice.mib->ssb_SubcarrierOffset,
|
||||
mib->message.choice.mib->dmrs_TypeA_Position,
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero * 16 + mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero,
|
||||
mib->message.choice.mib->cellBarred,
|
||||
mib->message.choice.mib->intraFreqReselection
|
||||
);
|
||||
}// END if( mib != NULL )
|
||||
|
||||
|
||||
if( servingcellconfigcommon != NULL ){
|
||||
config_common(Mod_idP,
|
||||
CC_idP,
|
||||
cellid,
|
||||
nr_bandP,
|
||||
ssb_pattern,
|
||||
ssb_periodicity,
|
||||
dl_CarrierFreqP,
|
||||
dl_BandwidthP
|
||||
);
|
||||
}//END if( servingcellconfigcommon != NULL )
|
||||
|
||||
LOG_E(MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
|
||||
|
||||
// if in nFAPI mode
|
||||
if ( (nfapi_mode == 1 || nfapi_mode == 2) && (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) ){
|
||||
while(RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) {
|
||||
// DJP AssertFatal(RC.nrmac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n");
|
||||
usleep(100 * 1000);
|
||||
printf("Waiting for PHY_config_req\n");
|
||||
for (i=0; i<5; i++) {
|
||||
if (i==scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.dl_grid_size[i].value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.dl_k0[i].value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
cfg->carrier_config.dl_grid_size[i].tl.tag = NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG;
|
||||
cfg->carrier_config.dl_k0[i].tl.tag = NFAPI_NR_CONFIG_DL_K0_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->num_tlv++;
|
||||
}
|
||||
else {
|
||||
cfg->carrier_config.dl_grid_size[i].value = 0;
|
||||
cfg->carrier_config.dl_k0[i].value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (servingcellconfigcommon != NULL){
|
||||
cfg->carrier_config.uplink_bandwidth.value = config_bandwidth(scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
|
||||
*scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]);
|
||||
cfg->carrier_config.uplink_bandwidth.tl.tag = NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG; //temporary
|
||||
cfg->num_tlv++;
|
||||
LOG_I(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, cfg->carrier_config.uplink_bandwidth.value);
|
||||
|
||||
int UL_pointA;
|
||||
if (scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA == NULL)
|
||||
UL_pointA = scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
|
||||
else
|
||||
UL_pointA = *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
|
||||
|
||||
cfg->carrier_config.uplink_frequency.value = from_nrarfcn(*scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],
|
||||
*scc->ssbSubcarrierSpacing,
|
||||
UL_pointA)/1000; // freq in kHz
|
||||
cfg->carrier_config.uplink_frequency.tl.tag = NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
if (i==scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.ul_grid_size[i].value = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.ul_k0[i].value = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
cfg->carrier_config.ul_grid_size[i].tl.tag = NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG;
|
||||
cfg->carrier_config.ul_k0[i].tl.tag = NFAPI_NR_CONFIG_UL_K0_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->num_tlv++;
|
||||
}
|
||||
else {
|
||||
cfg->carrier_config.ul_grid_size[i].value = 0;
|
||||
cfg->carrier_config.ul_k0[i].value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Cell configuration
|
||||
cfg->cell_config.phy_cell_id.value = *scc->physCellId;
|
||||
cfg->cell_config.phy_cell_id.tl.tag = NFAPI_NR_CONFIG_PHY_CELL_ID_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->cell_config.frame_duplex_type.value = 1;
|
||||
cfg->cell_config.frame_duplex_type.tl.tag = NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
|
||||
// SSB configuration
|
||||
cfg->ssb_config.ss_pbch_power.value = scc->ss_PBCH_BlockPower;
|
||||
cfg->ssb_config.ss_pbch_power.tl.tag = NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->ssb_config.scs_common.value = *scc->ssbSubcarrierSpacing;
|
||||
cfg->ssb_config.scs_common.tl.tag = NFAPI_NR_CONFIG_SCS_COMMON_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
// PRACH configuration
|
||||
|
||||
cfg->prach_config.prach_sequence_length.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present;
|
||||
cfg->prach_config.prach_sequence_length.tl.tag = NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing)
|
||||
cfg->prach_config.prach_sub_c_spacing.value = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
cfg->prach_config.prach_sub_c_spacing.value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
cfg->prach_config.prach_sub_c_spacing.tl.tag = NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->prach_config.restricted_set_config.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig;
|
||||
cfg->prach_config.restricted_set_config.tl.tag = NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
switch (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM) {
|
||||
case 0 :
|
||||
cfg->prach_config.num_prach_fd_occasions.value = 1;
|
||||
break;
|
||||
case 1 :
|
||||
cfg->prach_config.num_prach_fd_occasions.value = 2;
|
||||
break;
|
||||
case 2 :
|
||||
cfg->prach_config.num_prach_fd_occasions.value = 4;
|
||||
break;
|
||||
case 3 :
|
||||
cfg->prach_config.num_prach_fd_occasions.value = 8;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"msg1 FDM identifier %ld undefined (0,1,2,3) \n", scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM);
|
||||
}
|
||||
cfg->prach_config.num_prach_fd_occasions.tl.tag = NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list = (nfapi_nr_num_prach_fd_occasions_t *) malloc(cfg->prach_config.num_prach_fd_occasions.value*sizeof(nfapi_nr_num_prach_fd_occasions_t));
|
||||
for (i=0; i<cfg->prach_config.num_prach_fd_occasions.value; i++) {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_prach_fd_occasions = i;
|
||||
if (cfg->prach_config.prach_sequence_length.value)
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
|
||||
else
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.tl.tag = NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.tl.tag = NFAPI_NR_CONFIG_K1_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf.tl.tag = NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG;
|
||||
cfg->num_tlv++;
|
||||
//cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences.value = ???
|
||||
}
|
||||
|
||||
cfg->prach_config.ssb_per_rach.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
|
||||
cfg->prach_config.ssb_per_rach.tl.tag = NFAPI_NR_CONFIG_SSB_PER_RACH_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
// SSB Table Configuration
|
||||
int scs_scaling = 1<<(cfg->ssb_config.scs_common.value);
|
||||
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000)
|
||||
scs_scaling = scs_scaling*3;
|
||||
if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666)
|
||||
scs_scaling = scs_scaling>>2;
|
||||
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
uint16_t sco = absolute_diff%(12*scs_scaling);
|
||||
AssertFatal(sco==0,"absoluteFrequencySSB has a subcarrier offset of %d while it should be alligned with CRBs\n",sco);
|
||||
cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
|
||||
cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->ssb_table.ssb_period.value = *scc->ssb_periodicityServingCell;
|
||||
cfg->ssb_table.ssb_period.tl.tag = NFAPI_NR_CONFIG_SSB_PERIOD_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1 :
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.value = scc->ssb_PositionsInBurst->choice.shortBitmap.buf[0]<<24;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.value = 0;
|
||||
break;
|
||||
case 2 :
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.value = scc->ssb_PositionsInBurst->choice.mediumBitmap.buf[0]<<24;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.value = 0;
|
||||
break;
|
||||
case 3 :
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.value = 0;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.value = 0;
|
||||
for (i=0; i<4; i++) {
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.value += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i+4]<<i*8);
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.value += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i]<<i*8);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"SSB bitmap size value %d undefined (allowed values 1,2,3) \n", scc->ssb_PositionsInBurst->present);
|
||||
}
|
||||
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->carrier_config.num_tx_ant.value = pdsch_AntennaPorts;
|
||||
AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 13, "pdsch_AntennaPorts in 1...12\n");
|
||||
cfg->carrier_config.num_tx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_TX_ANT_TAG;
|
||||
int num_ssb=0;
|
||||
for (int i=0;i<32;i++) {
|
||||
num_ssb += (cfg->ssb_table.ssb_mask_list[0].ssb_mask.value>>i)&1;
|
||||
num_ssb += (cfg->ssb_table.ssb_mask_list[1].ssb_mask.value>>i)&1;
|
||||
}
|
||||
|
||||
cfg->carrier_config.num_rx_ant.value = cfg->carrier_config.num_tx_ant.value;
|
||||
cfg->carrier_config.num_rx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_RX_ANT_TAG;
|
||||
LOG_I(MAC,"Set TX/RX antenna number to %d (num ssb %d: %x,%x)\n",cfg->carrier_config.num_tx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value);
|
||||
AssertFatal(cfg->carrier_config.num_tx_ant.value > 0,"carrier_config.num_tx_ant.value %d !\n",cfg->carrier_config.num_tx_ant.value );
|
||||
cfg->num_tlv++;
|
||||
cfg->num_tlv++;
|
||||
|
||||
// TDD Table Configuration
|
||||
//cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
|
||||
cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG;
|
||||
cfg->num_tlv++;
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL)
|
||||
cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
|
||||
else {
|
||||
AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL,
|
||||
"scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n");
|
||||
cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
}
|
||||
LOG_I(MAC,"Setting TDD configuration period to %d\n",cfg->tdd_table.tdd_period.value);
|
||||
if(cfg->cell_config.frame_duplex_type.value == TDD){
|
||||
int return_tdd = set_tdd_config_nr(cfg,
|
||||
scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots,
|
||||
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols
|
||||
);
|
||||
|
||||
if (return_tdd !=0){
|
||||
LOG_E(PHY,"TDD configuration can not be done\n");
|
||||
}
|
||||
else LOG_I(PHY,"TDD has been properly configurated\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// PDCCH-ConfigCommon
|
||||
cfg->pdcch_config.controlResourceSetZero.value = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero;
|
||||
cfg->pdcch_config.searchSpaceZero.value = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero;
|
||||
|
||||
// PDSCH-ConfigCommon
|
||||
cfg->pdsch_config.num_PDSCHTimeDomainResourceAllocations.value = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;
|
||||
cfg->pdsch_config.dmrs_TypeA_Position.value = scc->dmrs_TypeA_Position;
|
||||
AssertFatal(cfg->pdsch_config.num_PDSCHTimeDomainResourceAllocations.value<=NFAPI_NR_PDSCH_CONFIG_MAXALLOCATIONS,"illegal TimeDomainAllocation count %d\n",cfg->pdsch_config.num_PDSCHTimeDomainResourceAllocations.value);
|
||||
for (int i=0;i<cfg->pdsch_config.num_PDSCHTimeDomainResourceAllocations.value;i++) {
|
||||
cfg->pdsch_config.PDSCHTimeDomainResourceAllocation_k0[i].value=*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0;
|
||||
cfg->pdsch_config.PDSCHTimeDomainResourceAllocation_mappingType[i].value=scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType;
|
||||
cfg->pdsch_config.PDSCHTimeDomainResourceAllocation_startSymbolAndLength[i].value=scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength;
|
||||
}
|
||||
|
||||
// PUSCH-ConfigCommon
|
||||
cfg->pusch_config.num_PUSCHTimeDomainResourceAllocations.value = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.count;
|
||||
cfg->pusch_config.dmrs_TypeA_Position.value = scc->dmrs_TypeA_Position+2;
|
||||
AssertFatal(cfg->pusch_config.num_PUSCHTimeDomainResourceAllocations.value<=NFAPI_NR_PUSCH_CONFIG_MAXALLOCATIONS,"illegal TimeDomainAllocation count %d\n",cfg->pusch_config.num_PUSCHTimeDomainResourceAllocations.value);
|
||||
for (int i=0;i<cfg->pusch_config.num_PUSCHTimeDomainResourceAllocations.value;i++) {
|
||||
cfg->pusch_config.PUSCHTimeDomainResourceAllocation_k2[i].value=*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2;
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int add_ue,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup
|
||||
){
|
||||
|
||||
if (scc != NULL ) {
|
||||
AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present);
|
||||
|
||||
LOG_I(MAC,"Configuring common parameters from NR ServingCellConfig\n");
|
||||
|
||||
config_common(Mod_idP,
|
||||
pdsch_AntennaPorts,
|
||||
scc);
|
||||
LOG_E(MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
|
||||
|
||||
// if in nFAPI mode
|
||||
if ( (nfapi_mode == 1 || nfapi_mode == 2) && (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) ){
|
||||
while(RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) {
|
||||
// DJP AssertFatal(RC.nrmac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n");
|
||||
usleep(100 * 1000);
|
||||
printf("Waiting for PHY_config_req\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NR_PHY_Config_t phycfg;
|
||||
phycfg.Mod_id = Mod_idP;
|
||||
phycfg.CC_id = CC_idP;
|
||||
phycfg.cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
|
||||
|
||||
phycfg.CC_id = 0;
|
||||
phycfg.cfg = &RC.nrmac[Mod_idP]->config[0];
|
||||
|
||||
phycfg.cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset;
|
||||
phycfg.cfg->ssb_table.ssb_subcarrier_offset.tl.tag = NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG;
|
||||
phycfg.cfg->num_tlv++;
|
||||
|
||||
if (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req) RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req(&phycfg);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
if (secondaryCellGroup) {
|
||||
|
||||
NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list;
|
||||
int UE_id;
|
||||
if (add_ue == 1) {
|
||||
UE_id = add_new_nr_ue(Mod_idP,rnti);
|
||||
UE_list->secondaryCellGroup[UE_id] = secondaryCellGroup;
|
||||
LOG_I(PHY,"Added new UE_id %d/%x with initial secondaryCellGroup\n",UE_id,rnti);
|
||||
}
|
||||
else { // secondaryCellGroup has been updated
|
||||
UE_id = find_nr_UE_id(Mod_idP,rnti);
|
||||
UE_list->secondaryCellGroup[UE_id] = secondaryCellGroup;
|
||||
LOG_I(PHY,"Modified UE_id %d/%x with secondaryCellGroup\n",UE_id,rnti);
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
|
||||
|
||||
return(0);
|
||||
|
||||
|
||||
@@ -57,11 +57,7 @@
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include <openair1/PHY/LTE_TRANSPORT/transport_proto.h>
|
||||
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
#define DEBUG_eNB_SCHEDULER 1
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
|
||||
|
||||
@@ -70,30 +66,33 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP){
|
||||
|
||||
nfapi_nr_dl_config_request_t *DL_req = &gNB->DL_req[0];
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = &gNB->UL_tti_req[0];
|
||||
nfapi_hi_dci0_request_t * HI_DCI0_req = &gNB->HI_DCI0_req[0];
|
||||
nfapi_tx_request_t *TX_req = &gNB->TX_req[0];
|
||||
nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0];
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = &gNB->UL_tti_req[0];
|
||||
nfapi_nr_ul_dci_request_t *UL_dci_req = &gNB->UL_dci_req[0];
|
||||
nfapi_nr_tx_data_request_t *TX_req = &gNB->TX_req[0];
|
||||
|
||||
gNB->pdu_index[CC_idP] = 0;
|
||||
|
||||
if (nfapi_mode==0 || nfapi_mode == 1) { // monolithic or PNF
|
||||
|
||||
DL_req[CC_idP].dl_config_request_body.number_dci = 0;
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdu = 0;
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0;
|
||||
//DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000;
|
||||
|
||||
HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = slotP + (frameP<<7);
|
||||
HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0;
|
||||
DL_req[CC_idP].SFN = frameP;
|
||||
DL_req[CC_idP].Slot = slotP;
|
||||
DL_req[CC_idP].dl_tti_request_body.nPDUs = 0;
|
||||
DL_req[CC_idP].dl_tti_request_body.nGroup = 0;
|
||||
//DL_req[CC_idP].dl_tti_request_body.transmission_power_pcfich = 6000;
|
||||
|
||||
UL_dci_req[CC_idP].SFN = frameP;
|
||||
UL_dci_req[CC_idP].Slot = slotP;
|
||||
UL_dci_req[CC_idP].numPdus = 0;
|
||||
|
||||
UL_tti_req[CC_idP].SFN = frameP;
|
||||
UL_tti_req[CC_idP].Slot = slotP;
|
||||
UL_tti_req[CC_idP].n_pdus = 0;
|
||||
UL_tti_req[CC_idP].n_ulsch = 0;
|
||||
UL_tti_req[CC_idP].n_ulcch = 0;
|
||||
UL_tti_req[CC_idP].n_group = 0;
|
||||
|
||||
TX_req[CC_idP].tx_request_body.number_of_pdus = 0;
|
||||
TX_req[CC_idP].Number_of_PDUs = 0;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -105,7 +104,7 @@ void check_nr_ul_failure(module_id_t module_idP,
|
||||
sub_frame_t slotP) {
|
||||
|
||||
UE_list_t *UE_list = &RC.nrmac[module_idP]->UE_list;
|
||||
nfapi_nr_dl_config_request_t *DL_req = &RC.nrmac[module_idP]->DL_req[0];
|
||||
nfapi_nr_dl_dci_request_t *DL_req = &RC.nrmac[module_idP]->DL_req[0];
|
||||
uint16_t rnti = UE_RNTI(module_idP, UE_id);
|
||||
NR_COMMON_channels_t *cc = RC.nrmac[module_idP]->common_channels;
|
||||
|
||||
@@ -118,11 +117,11 @@ void check_nr_ul_failure(module_id_t module_idP,
|
||||
UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1;
|
||||
|
||||
// add a format 1A dci for this UE to request an RA procedure (only one UE per subframe)
|
||||
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu];
|
||||
memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
nfapi_nr_dl_dci_request_pdu_t *dl_config_pdu = &DL_req[CC_id].dl_tti_request_body.dl_config_pdu_list[DL_req[CC_id].dl_tti_request_body.number_pdu];
|
||||
memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_dci_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_DCI_REQUEST_DCI_DL_PDU_REL8_TAG;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id),
|
||||
UE_list->UE_sched_ctrl[UE_id].
|
||||
@@ -135,9 +134,9 @@ void check_nr_ul_failure(module_id_t module_idP,
|
||||
"illegal dl_Bandwidth %d\n",
|
||||
(int) cc[CC_id].mib->message.dl_Bandwidth);
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = nr_pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth];
|
||||
DL_req[CC_id].dl_config_request_body.number_dci++;
|
||||
DL_req[CC_id].dl_config_request_body.number_pdu++;
|
||||
DL_req[CC_id].dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
|
||||
DL_req[CC_id].dl_tti_request_body.number_dci++;
|
||||
DL_req[CC_id].dl_tti_request_body.number_pdu++;
|
||||
DL_req[CC_id].dl_tti_request_body.tl.tag = NFAPI_DL_TTI_REQUEST_BODY_TAG;
|
||||
LOG_I(MAC,
|
||||
"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n",
|
||||
UE_id, rnti,
|
||||
@@ -258,6 +257,19 @@ void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subfram
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) {
|
||||
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
|
||||
// schedule PRACH for iniital BWP
|
||||
|
||||
if (is_initialBWP_prach_subframe(frameP,subframeP)<0) return;
|
||||
|
||||
// fill FAPI
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
{
|
||||
@@ -266,9 +278,7 @@ void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
nfapi_ul_config_request_t *ul_req_tmp = &mac->UL_req_tmp[CC_id][slotP];
|
||||
nfapi_ul_config_request_t *ul_req = &mac->UL_req[CC_id];
|
||||
nfapi_ul_config_request_pdu_t *ul_req_pdu = ul_req->ul_config_request_body.ul_config_pdu_list;
|
||||
nfapi_ul_config_request_t *ul_req = &mac->UL_tti_req[CC_id];
|
||||
|
||||
*ul_req = *ul_req_tmp;
|
||||
|
||||
@@ -294,23 +304,30 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
sub_frame_t slot_rxP,
|
||||
frame_t frame_txP,
|
||||
sub_frame_t slot_txP){
|
||||
|
||||
//printf("gNB_dlsch_ulsch_scheduler frameRX %d slotRX %d frameTX %d slotTX %d\n",frame_rxP,slot_rxP,frame_txP,slot_txP);
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
int CC_id, i = -1, UE_id = 0;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame_txP, slot_txP,module_idP);
|
||||
int CC_id, UE_id = 0;
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
UE_list_t *UE_list = &gNB->UE_list;
|
||||
rnti_t rnti;
|
||||
NR_UE_list_t *UE_list = &gNB->UE_list;
|
||||
UE_sched_ctrl_t *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
NR_COMMON_channels_t *cc = gNB->common_channels;
|
||||
|
||||
start_meas(&RC.nrmac[module_idP]->eNB_scheduler);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
|
||||
|
||||
pdcp_run(&ctxt);
|
||||
//rrc_rx_tx(&ctxt, CC_id);
|
||||
|
||||
RC.nrmac[module_idP]->frame = frame_rxP;
|
||||
RC.nrmac[module_idP]->slot = slot_rxP;
|
||||
|
||||
// Check if there are downlink symbols in the slot,
|
||||
if (is_nr_DL_slot(cc->ServingCellConfigCommon,slot_txP)) {
|
||||
|
||||
memset(RC.nrmac[module_idP]->cce_list[1][0],0,MAX_NUM_CCE*sizeof(int));
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
//mbsfn_status[CC_id] = 0;
|
||||
|
||||
@@ -322,55 +339,26 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
}
|
||||
|
||||
// refresh UE list based on UEs dropped by PHY in previous subframe
|
||||
/*
|
||||
for (i = 0; i < MAX_MOBILES_PER_GNB; i++) {
|
||||
if (0 /*UE_list->active[i]*/) {
|
||||
if (UE_list->active[i]) {
|
||||
|
||||
nfapi_nr_config_request_t *cfg = &RC.nrmac[module_idP]->config[CC_id];
|
||||
|
||||
nfapi_nr_coreset_t coreset = RC.nrmac[module_idP]->coreset[CC_id][1];
|
||||
nfapi_nr_search_space_t search_space = RC.nrmac[module_idP]->search_space[CC_id][1];
|
||||
|
||||
if (nr_is_dci_opportunity(search_space,
|
||||
coreset,
|
||||
frame_txP,
|
||||
slot_txP,
|
||||
*cfg)){
|
||||
nr_schedule_uss_dlsch_phytest(module_idP, frame_txP, slot_txP, NULL);
|
||||
}
|
||||
|
||||
rnti = UE_RNTI(module_idP, i);
|
||||
CC_id = UE_PCCID(module_idP, i);
|
||||
//int spf = get_spf(cfg);
|
||||
|
||||
if (((frame_txP&127) == 0) && (slot_txP == 0)) {
|
||||
LOG_I(MAC,
|
||||
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n",
|
||||
rnti,
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync ==
|
||||
0 ? "in synch" : "out of sync",
|
||||
UE_list->UE_template[CC_id][i].phr_info,
|
||||
UE_list->UE_sched_ctrl[i].dl_cqi[CC_id],
|
||||
(UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 128) / 2,
|
||||
(UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 128) / 2);
|
||||
}
|
||||
|
||||
|
||||
rnti = 0;//UE_RNTI(module_idP, i);
|
||||
CC_id = 0;//UE_PCCID(module_idP, i);
|
||||
|
||||
} //END if (UE_list->active[i])
|
||||
} //END for (i = 0; i < MAX_MOBILES_PER_GNB; i++)
|
||||
*/
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES,NOT_A_RNTI, frame_txP, slot_txP,module_idP);
|
||||
|
||||
pdcp_run(&ctxt);
|
||||
|
||||
//rrc_rx_tx(&ctxt, CC_id);
|
||||
|
||||
// This schedules MIB
|
||||
if((slot_txP == 0) && (frame_txP & 7) == 0){
|
||||
schedule_nr_mib(module_idP, frame_txP, slot_txP);
|
||||
}
|
||||
|
||||
// Phytest scheduling
|
||||
|
||||
// TODO once RACH is available, start ta_timer when UE is connected
|
||||
// TbD once RACH is available, start ta_timer when UE is connected
|
||||
if (ue_sched_ctl->ta_timer) ue_sched_ctl->ta_timer--;
|
||||
|
||||
if (ue_sched_ctl->ta_timer == 0) {
|
||||
@@ -384,11 +372,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
gNB->ta_len = 2;
|
||||
}
|
||||
|
||||
if (slot_rxP == NR_UPLINK_SLOT){
|
||||
nr_schedule_uss_ulsch_phytest(&RC.nrmac[module_idP]->UL_tti_req[0], frame_rxP, slot_rxP);
|
||||
}
|
||||
|
||||
if (slot_txP == NR_DOWNLINK_SLOT){
|
||||
// Phytest scheduling
|
||||
if (get_softmodem_params()->phy_test && slot_txP==1){
|
||||
nr_schedule_uss_dlsch_phytest(module_idP, frame_txP, slot_txP,NULL);
|
||||
// resetting ta flag
|
||||
gNB->ta_len = 0;
|
||||
@@ -400,6 +385,14 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
allocate_CCEs(module_idP, CC_id, subframeP, 0);
|
||||
*/
|
||||
|
||||
} //is_nr_DL_slot
|
||||
|
||||
if (is_nr_UL_slot(cc->ServingCellConfigCommon,slot_rxP)) {
|
||||
if (get_softmodem_params()->phy_test && slot_rxP==8){
|
||||
nr_schedule_uss_ulsch_phytest(module_idP, frame_rxP, slot_rxP);
|
||||
}
|
||||
}
|
||||
|
||||
stop_meas(&RC.nrmac[module_idP]->eNB_scheduler);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -60,23 +60,20 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
NR_COMMON_channels_t *cc;
|
||||
|
||||
nfapi_nr_dl_config_request_t *dl_config_request;
|
||||
nfapi_nr_dl_config_request_body_t *dl_req;
|
||||
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu;
|
||||
nfapi_tx_request_pdu_t *TX_req;
|
||||
nfapi_nr_dl_tti_request_t *dl_tti_request;
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req;
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_config_pdu;
|
||||
|
||||
int mib_sdu_length;
|
||||
int CC_id;
|
||||
|
||||
uint16_t sfn_sf = frameP << 7 | slotP;
|
||||
|
||||
AssertFatal(slotP == 0, "Subframe must be 0\n");
|
||||
AssertFatal((frameP & 7) == 0, "Frame must be a multiple of 8\n");
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
dl_config_request = &gNB->DL_req[CC_id];
|
||||
dl_req = &dl_config_request->dl_config_request_body;
|
||||
dl_tti_request = &gNB->DL_req[CC_id];
|
||||
dl_req = &dl_tti_request->dl_tti_request_body;
|
||||
cc = &gNB->common_channels[CC_id];
|
||||
|
||||
mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 1, &cc->MIB_pdu.payload[0]); // not used in this case
|
||||
@@ -85,38 +82,61 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
|
||||
|
||||
if (mib_sdu_length > 0) {
|
||||
|
||||
LOG_D(MAC, "Frame %d, slot %d: Adding BCH PDU in position %d (length %d)\n", frameP, slotP, dl_req->number_pdu, mib_sdu_length);
|
||||
LOG_I(MAC, "Frame %d, slot %d: Adding BCH PDU in position %d (length %d)\n", frameP, slotP, dl_req->nPDUs, mib_sdu_length);
|
||||
|
||||
if ((frameP & 1023) < 80){
|
||||
LOG_D(MAC,"[gNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes\n",module_idP, frameP, CC_id, mib_sdu_length);
|
||||
LOG_I(MAC,"[gNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes\n",module_idP, frameP, CC_id, mib_sdu_length);
|
||||
}
|
||||
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void *) dl_config_pdu, 0,sizeof(nfapi_nr_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_NR_DL_CONFIG_BCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size =2 + sizeof(nfapi_nr_dl_config_bch_pdu_rel15_t);
|
||||
dl_config_pdu->bch_pdu_rel15.tl.tag = NFAPI_NR_DL_CONFIG_REQUEST_BCH_PDU_REL15_TAG;
|
||||
dl_config_pdu->bch_pdu_rel15.length = mib_sdu_length;
|
||||
dl_config_pdu->bch_pdu_rel15.pdu_index = gNB->pdu_index[CC_id];
|
||||
dl_config_pdu->bch_pdu_rel15.transmission_power = 6000;
|
||||
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
|
||||
dl_req->number_pdu++;
|
||||
dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
|
||||
dl_config_request->sfn_sf = sfn_sf;
|
||||
dl_config_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||
memset((void *) dl_config_pdu, 0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||
dl_config_pdu->PDUType = NFAPI_NR_DL_TTI_SSB_PDU_TYPE;
|
||||
dl_config_pdu->PDUSize =2 + sizeof(nfapi_nr_dl_tti_ssb_pdu_rel15_t);
|
||||
|
||||
LOG_D(MAC, "gNB->DL_req[0].number_pdu %d (%p)\n", dl_req->number_pdu, &dl_req->number_pdu);
|
||||
// DL request
|
||||
|
||||
TX_req = &gNB->TX_req[CC_id].tx_request_body.tx_pdu_list[gNB->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
TX_req->pdu_length = 3;
|
||||
TX_req->pdu_index = gNB->pdu_index[CC_id]++;
|
||||
TX_req->num_segments = 1;
|
||||
TX_req->segments[0].segment_length = 3;
|
||||
TX_req->segments[0].segment_data = cc[CC_id].MIB_pdu.payload;
|
||||
gNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
gNB->TX_req[CC_id].sfn_sf = sfn_sf;
|
||||
gNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
|
||||
gNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
|
||||
AssertFatal(cc->ServingCellConfigCommon->physCellId!=NULL,"cc->ServingCellConfigCommon->physCellId is null\n");
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.PhysCellId = *cc->ServingCellConfigCommon->physCellId;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.BetaPss = 0;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = 0;
|
||||
AssertFatal(cc->ServingCellConfigCommon->downlinkConfigCommon!=NULL,"scc->downlinkConfigCommonL is null\n");
|
||||
AssertFatal(cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL!=NULL,"scc->downlinkConfigCommon->frequencyInfoDL is null\n");
|
||||
AssertFatal(cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB!=NULL,"scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB is null\n");
|
||||
AssertFatal(cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.count==1,"Frequency Band list does not have 1 element (%d)\n",cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.count);
|
||||
AssertFatal(cc->ServingCellConfigCommon->ssbSubcarrierSpacing,"ssbSubcarrierSpacing is null\n");
|
||||
AssertFatal(cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],"band is null\n");
|
||||
long band = *cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
uint32_t ssb_offset0 = *cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
|
||||
int ratio;
|
||||
switch (*cc->ServingCellConfigCommon->ssbSubcarrierSpacing) {
|
||||
case NR_SubcarrierSpacing_kHz15:
|
||||
AssertFatal(band <= 79, "Band %ld is not possible for SSB with 15 kHz SCS\n",band);
|
||||
if (band<77) // below 3GHz
|
||||
ratio=3; // NRARFCN step is 5 kHz
|
||||
else
|
||||
ratio=1; // NRARFCN step is 15 kHz
|
||||
break;
|
||||
case NR_SubcarrierSpacing_kHz30:
|
||||
AssertFatal(band <= 79, "Band %ld is not possible for SSB with 15 kHz SCS\n",band);
|
||||
if (band<77) // below 3GHz
|
||||
ratio=6; // NRARFCN step is 5 kHz
|
||||
else
|
||||
ratio=2; // NRARFCN step is 15 kHz
|
||||
break;
|
||||
case NR_SubcarrierSpacing_kHz120:
|
||||
AssertFatal(band >= 257, "Band %ld is not possible for SSB with 120 kHz SCS\n",band);
|
||||
ratio=2; // NRARFCN step is 15 kHz
|
||||
break;
|
||||
case NR_SubcarrierSpacing_kHz240:
|
||||
AssertFatal(band >= 257, "Band %ld is not possible for SSB with 240 kHz SCS\n",band);
|
||||
ratio=4; // NRARFCN step is 15 kHz
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"SCS %ld not allowed for SSB \n", *cc->ServingCellConfigCommon->ssbSubcarrierSpacing);
|
||||
}
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = 0; //kSSB
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA = ssb_offset0/(ratio*12) - 10; // absoluteFrequencySSB is the center of SSB
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag = 1;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload = (*(uint32_t*)cc->MIB_pdu.payload) & ((1<<24)-1);
|
||||
dl_req->nPDUs++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -222,7 +222,10 @@ void nr_process_mac_pdu(
|
||||
pdu_ptr += ( mac_subheader_len + mac_ce_len + mac_sdu_len );
|
||||
pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len );
|
||||
|
||||
AssertFatal(pdu_len >= 0, "[MAC] nr_process_mac_pdu, residual mac pdu length < 0!\n");
|
||||
if (pdu_len < 0) {
|
||||
LOG_E(MAC, "%s() residual mac pdu length < 0!\n", __func__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,20 +244,18 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
const uint8_t ul_cqi){
|
||||
int current_rnti = 0, UE_id = -1, harq_pid = 0;
|
||||
gNB_MAC_INST *gNB_mac = NULL;
|
||||
UE_list_t *UE_list = NULL;
|
||||
NR_UE_list_t *UE_list = NULL;
|
||||
UE_sched_ctrl_t *UE_scheduling_control = NULL;
|
||||
|
||||
current_rnti = rntiP;
|
||||
UE_id = find_nrUE_id(gnb_mod_idP, current_rnti);
|
||||
UE_id = find_nr_UE_id(gnb_mod_idP, current_rnti);
|
||||
gNB_mac = RC.nrmac[gnb_mod_idP];
|
||||
UE_list = &gNB_mac->UE_list;
|
||||
|
||||
UE_id = 0;
|
||||
|
||||
if (UE_id != -1) {
|
||||
UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]);
|
||||
|
||||
LOG_D(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
|
||||
LOG_D(MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
|
||||
gnb_mod_idP,
|
||||
harq_pid,
|
||||
CC_idP,
|
||||
|
||||
@@ -40,27 +40,18 @@ void set_cset_offset(uint16_t);
|
||||
void mac_top_init_gNB(void);
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int CC_idP,
|
||||
int Nid_cell,
|
||||
int nr_bandP,
|
||||
uint64_t ssb_pattern,
|
||||
uint16_t ssb_periodicity,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
uint32_t dl_BandwidthP);
|
||||
int pdsch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc
|
||||
);
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int CC_id,
|
||||
int cellid,
|
||||
int p_gNB,
|
||||
int nr_bandP,
|
||||
uint64_t ssb_pattern,
|
||||
uint16_t ssb_periodicity,
|
||||
uint64_t dl_CarrierFreqP,
|
||||
int dl_BandwidthP,
|
||||
NR_BCCH_BCH_Message_t *mib,
|
||||
NR_ServingCellConfigCommon_t *servingcellconfigcommon);
|
||||
|
||||
int is_nr_UL_slot(NR_COMMON_channels_t * ccP, int slotP);
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int nsa_flag,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup
|
||||
);
|
||||
|
||||
void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
int CC_idP,
|
||||
@@ -89,27 +80,33 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP);
|
||||
|
||||
int configure_fapi_dl_pdu(nfapi_nr_dl_config_request_body_t *dl_req,
|
||||
nfapi_nr_config_request_t *cfg,
|
||||
nfapi_nr_coreset_t* coreset,
|
||||
nfapi_nr_search_space_t* search_space,
|
||||
nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config);
|
||||
int configure_fapi_dl_pdu(int Mod_id,
|
||||
int *CCEIndeces,
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req,
|
||||
uint8_t *mcsIndex,
|
||||
uint16_t *rbSize,
|
||||
uint16_t *rbStart);
|
||||
|
||||
void configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req,
|
||||
nfapi_tx_request_pdu_t *tx_req,
|
||||
void config_uldci(NR_BWP_Uplink_t *ubwp,nfapi_nr_pusch_pdu_t *pusch_pdu,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, dci_pdu_rel15_t *dci_pdu_rel15, int *dci_formats, int *rnti_types);
|
||||
|
||||
void configure_fapi_dl_Tx(module_id_t Mod_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP,
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req,
|
||||
nfapi_nr_pdu_t *tx_req,
|
||||
int tbs_bytes,
|
||||
int16_t pdu_index);
|
||||
|
||||
void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP,
|
||||
nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config);
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_config);
|
||||
|
||||
void nr_schedule_uss_ulsch_phytest(nfapi_nr_ul_tti_request_t *UL_tti_req,
|
||||
void nr_schedule_uss_ulsch_phytest(int Mod_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP);
|
||||
|
||||
void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
|
||||
void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu,
|
||||
nr_scs_e scs_common,
|
||||
nr_scs_e pdcch_scs,
|
||||
nr_frequency_range_e freq_range,
|
||||
@@ -120,41 +117,76 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* p
|
||||
uint8_t n_ssb,
|
||||
uint16_t nb_slots_per_frame,
|
||||
uint16_t N_RB);
|
||||
|
||||
/*
|
||||
int nr_is_dci_opportunity(nfapi_nr_search_space_t search_space,
|
||||
nfapi_nr_coreset_t coreset,
|
||||
uint16_t frame,
|
||||
uint16_t slot,
|
||||
nfapi_nr_config_request_t cfg);
|
||||
nfapi_nr_config_request_scf_t cfg);
|
||||
*/
|
||||
|
||||
void nr_configure_dci_from_pdcch_config(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
|
||||
nfapi_nr_coreset_t* coreset,
|
||||
nfapi_nr_search_space_t* search_space,
|
||||
nfapi_nr_config_request_t cfg,
|
||||
uint16_t N_RB);
|
||||
void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu,
|
||||
int ss_type,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
NR_BWP_Downlink_t *bwp);
|
||||
|
||||
void fill_dci_pdu_rel15(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
|
||||
dci_pdu_rel15_t *dci_pdu_rel15,
|
||||
int *dci_formats,
|
||||
int *rnti_types);
|
||||
|
||||
int get_spf(nfapi_nr_config_request_scf_t *cfg);
|
||||
|
||||
int to_absslot(nfapi_nr_config_request_scf_t *cfg,int frame,int slot);
|
||||
|
||||
void get_band(uint64_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
|
||||
|
||||
void nr_get_tbs_dl(nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
|
||||
int x_overhead);
|
||||
/** \brief Computes Q based on I_MCS PDSCH and table_idx for downlink. Implements MCS Tables from 38.214. */
|
||||
uint8_t nr_get_Qm_dl(uint8_t Imcs, uint8_t table_idx);
|
||||
uint32_t nr_get_code_rate_dl(uint8_t Imcs, uint8_t table_idx);
|
||||
|
||||
/** \brief Computes Q based on I_MCS PDSCH and table_idx for uplink. Implements MCS Tables from 38.214. */
|
||||
uint8_t nr_get_Qm_ul(uint8_t Imcs, uint8_t table_idx);
|
||||
uint32_t nr_get_code_rate_ul(uint8_t Imcs, uint8_t table_idx);
|
||||
|
||||
int NRRIV2BW(int locationAndBandwidth,int N_RB);
|
||||
|
||||
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
|
||||
|
||||
void dump_nr_ue_list(NR_UE_list_t *listP, int ul_flag);
|
||||
|
||||
int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP);
|
||||
|
||||
int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP);
|
||||
|
||||
int get_num_dmrs(uint16_t dmrs_mask );
|
||||
|
||||
uint16_t nr_dci_size(nr_dci_format_t format,
|
||||
nr_rnti_type_t rnti_type,
|
||||
uint16_t N_RB);
|
||||
|
||||
int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
int bwp_id,
|
||||
int coreset_id,
|
||||
int aggregation,
|
||||
int search_space, // 0 common, 1 ue-specific
|
||||
int UE_id,
|
||||
int m
|
||||
);
|
||||
|
||||
int is_nr_DL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
int is_nr_UL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
|
||||
int get_dlscs(nfapi_nr_config_request_t *cfg);
|
||||
|
||||
int get_ulscs(nfapi_nr_config_request_t *cfg);
|
||||
|
||||
int get_spf(nfapi_nr_config_request_t *cfg);
|
||||
|
||||
int to_absslot(nfapi_nr_config_request_t *cfg,int frame,int slot);
|
||||
|
||||
int get_symbolsperslot(nfapi_nr_config_request_t *cfg);
|
||||
|
||||
void get_band(uint32_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw);
|
||||
|
||||
int32_t get_nr_uldl_offset(int nr_bandP);
|
||||
|
||||
int find_nrUE_id(module_id_t mod_idP, rnti_t rntiP);
|
||||
|
||||
int nrUE_PCCID(module_id_t mod_idP, int ue_idP);
|
||||
|
||||
void config_nr_mib(int Mod_idP,
|
||||
int CC_idP,
|
||||
int p_gNBP,
|
||||
@@ -183,12 +215,12 @@ void nr_process_mac_pdu(
|
||||
@param ul_cqi Uplink CQI estimate after this pdu (SNR quantized to 8 bits, -64 ... 63.5 dB in .5dB steps)
|
||||
*/
|
||||
void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP,
|
||||
uint8_t * sduP,
|
||||
const uint16_t sdu_lenP,
|
||||
const uint16_t timing_advance, const uint8_t ul_cqi);
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP,
|
||||
uint8_t * sduP,
|
||||
const uint16_t sdu_lenP,
|
||||
const uint16_t timing_advance, const uint8_t ul_cqi);
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
|
||||
|
||||
@@ -44,43 +44,12 @@
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
void set_cset_offset(uint16_t offset_bits) {
|
||||
RC.nrmac[0]->coreset[0][1].frequency_domain_resources >>= offset_bits;
|
||||
}
|
||||
|
||||
void nr_init_coreset(nfapi_nr_coreset_t *coreset) {
|
||||
|
||||
coreset->coreset_id = 1;
|
||||
coreset->frequency_domain_resources = 0x1E0000000000;//0x1FFFE0000000; // 96 RB starting from CRB0
|
||||
coreset->duration = 2;
|
||||
coreset->cce_reg_mapping_type = NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED;
|
||||
coreset->reg_bundle_size = 6;
|
||||
coreset->interleaver_size = 2;
|
||||
coreset->precoder_granularity = NFAPI_NR_CSET_SAME_AS_REG_BUNDLE;
|
||||
coreset->tci_present_in_dci = 0;
|
||||
coreset->dmrs_scrambling_id = 0;
|
||||
}
|
||||
|
||||
void nr_init_search_space(nfapi_nr_search_space_t *search_space)
|
||||
{
|
||||
search_space->search_space_id = 1;
|
||||
search_space->coreset_id = 1;
|
||||
search_space->search_space_type = NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC;
|
||||
search_space->duration = 5;
|
||||
search_space->slot_monitoring_periodicity = NFAPI_NR_SS_PERIODICITY_SL10;
|
||||
search_space->slot_monitoring_offset = 1;
|
||||
search_space->monitoring_symbols_in_slot = 0x3000; // 14 bits field
|
||||
search_space->css_formats_0_0_and_1_0 = 1;
|
||||
search_space->uss_dci_formats = 0; // enum to be defined-- formats 0.0 and 1.0
|
||||
for (int i=0; i<NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS; i++)
|
||||
search_space->number_of_candidates[i] = 4; // TODO
|
||||
}
|
||||
|
||||
void mac_top_init_gNB(void)
|
||||
{
|
||||
module_id_t i,j;
|
||||
module_id_t i;
|
||||
int list_el;
|
||||
UE_list_t *UE_list;
|
||||
NR_UE_list_t *UE_list;
|
||||
gNB_MAC_INST *nrmac;
|
||||
|
||||
LOG_I(MAC, "[MAIN] Init function start:nb_nr_macrlc_inst=%d\n",RC.nb_nr_macrlc_inst);
|
||||
@@ -88,58 +57,41 @@ void mac_top_init_gNB(void)
|
||||
if (RC.nb_nr_macrlc_inst > 0) {
|
||||
|
||||
RC.nrmac = (gNB_MAC_INST **) malloc16(RC.nb_nr_macrlc_inst *sizeof(gNB_MAC_INST *));
|
||||
|
||||
|
||||
AssertFatal(RC.nrmac != NULL,"can't ALLOCATE %zu Bytes for %d gNB_MAC_INST with size %zu \n",
|
||||
RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *),
|
||||
RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST));
|
||||
|
||||
for (i = 0; i < RC.nb_nr_macrlc_inst; i++) {
|
||||
RC.nrmac[i] = (gNB_MAC_INST *) malloc16(sizeof(gNB_MAC_INST));
|
||||
|
||||
AssertFatal(RC.nrmac != NULL,"can't ALLOCATE %zu Bytes for %d gNB_MAC_INST with size %zu \n",
|
||||
RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *),
|
||||
RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST));
|
||||
RC.nrmac[i] = (gNB_MAC_INST *) malloc16(sizeof(gNB_MAC_INST));
|
||||
|
||||
AssertFatal(RC.nrmac != NULL,"can't ALLOCATE %zu Bytes for %d gNB_MAC_INST with size %zu \n",
|
||||
RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *),
|
||||
RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST));
|
||||
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d gNB_MAC_INST @ %p\n",sizeof(gNB_MAC_INST), RC.nb_nr_macrlc_inst, RC.mac);
|
||||
|
||||
bzero(RC.nrmac[i], sizeof(gNB_MAC_INST));
|
||||
|
||||
RC.nrmac[i]->Mod_id = i;
|
||||
|
||||
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d gNB_MAC_INST @ %p\n",sizeof(gNB_MAC_INST), RC.nb_nr_macrlc_inst, RC.mac);
|
||||
|
||||
bzero(RC.nrmac[i], sizeof(gNB_MAC_INST));
|
||||
|
||||
RC.nrmac[i]->Mod_id = i;
|
||||
|
||||
RC.nrmac[i]->tag = (NR_TAG_t*)malloc(sizeof(NR_TAG_t));
|
||||
memset((void*)RC.nrmac[i]->tag,0,sizeof(NR_TAG_t));
|
||||
|
||||
|
||||
for (j = 0; j < MAX_NUM_CCs; j++) {
|
||||
RC.nrmac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = RC.nrmac[i]->dl_config_pdu_list[j];
|
||||
|
||||
//FK changed UL_req to UL_tti_req, which does not contain a pointer to the pdu_list
|
||||
//RC.nrmac[i]->UL_req[j].ul_config_request_body.ul_config_pdu_list = RC.nrmac[i]->ul_config_pdu_list[j];
|
||||
|
||||
//for (int k = 0; k < 10; k++)
|
||||
// RC.nrmac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list =RC.nrmac[i]->ul_config_pdu_list_tmp[j][k];
|
||||
RC.nrmac[i]->tag = (NR_TAG_t*)malloc(sizeof(NR_TAG_t));
|
||||
memset((void*)RC.nrmac[i]->tag,0,sizeof(NR_TAG_t));
|
||||
|
||||
RC.nrmac[i]->HI_DCI0_req[j].hi_dci0_request_body.hi_dci0_pdu_list = RC.nrmac[i]->hi_dci0_pdu_list[j];
|
||||
RC.nrmac[i]->TX_req[j].tx_request_body.tx_pdu_list = RC.nrmac[i]->tx_request_pdu[j];
|
||||
RC.nrmac[i]->ul_handle = 0;
|
||||
|
||||
// Init PDCCH structures
|
||||
nr_init_coreset(&RC.nrmac[i]->coreset[j][1]);
|
||||
nr_init_search_space(&RC.nrmac[i]->search_space[j][1]);
|
||||
}
|
||||
|
||||
RC.nrmac[i]->ul_handle = 0;
|
||||
|
||||
}//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
|
||||
|
||||
AssertFatal(rlc_module_init(1) == 0,"Could not initialize RLC layer\n");
|
||||
AssertFatal(rlc_module_init(1) == 0,"Could not initialize RLC layer\n");
|
||||
|
||||
// These should be out of here later
|
||||
pdcp_layer_init();
|
||||
// These should be out of here later
|
||||
pdcp_layer_init();
|
||||
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
nr_ip_over_LTE_DRB_preconfiguration();
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
nr_ip_over_LTE_DRB_preconfiguration();
|
||||
|
||||
rrc_init_nr_global_param();
|
||||
rrc_init_nr_global_param();
|
||||
|
||||
}else {
|
||||
RC.nrmac = NULL;
|
||||
@@ -150,25 +102,23 @@ void mac_top_init_gNB(void)
|
||||
|
||||
nrmac = RC.nrmac[i];
|
||||
nrmac->if_inst = NR_IF_Module_init(i);
|
||||
|
||||
|
||||
UE_list = &nrmac->UE_list;
|
||||
UE_list->num_UEs = 0;
|
||||
UE_list->head = -1;
|
||||
UE_list->head_ul = -1;
|
||||
UE_list->avail = 0;
|
||||
|
||||
for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) {
|
||||
UE_list->next[list_el] = list_el + 1;
|
||||
for (list_el = 0; list_el < MAX_MOBILES_PER_GNB - 1; list_el++) {
|
||||
UE_list->next[list_el] = list_el + 1;
|
||||
UE_list->next_ul[list_el] = list_el + 1;
|
||||
UE_list->active[list_el] = FALSE;
|
||||
}
|
||||
|
||||
UE_list->next[list_el] = -1;
|
||||
UE_list->next_ul[list_el] = -1;
|
||||
/*memset(UE_list->DLSCH_pdu, 0, sizeof(UE_list->DLSCH_pdu));
|
||||
memset(UE_list->UE_template, 0, sizeof(UE_list->UE_template));
|
||||
memset(UE_list->eNB_UE_stats, 0, sizeof(UE_list->eNB_UE_stats));
|
||||
memset(UE_list->UE_sched_ctrl, 0, sizeof(UE_list->UE_sched_ctrl));
|
||||
memset(UE_list->active, 0, sizeof(UE_list->active));*/
|
||||
UE_list->active[list_el] = FALSE;
|
||||
}
|
||||
|
||||
srand48(0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* 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: nr_compute_tbs.c
|
||||
purpose: Compute NR TBS
|
||||
author: Hongzhi WANG (TCL)
|
||||
*/
|
||||
#define INDEX_MAX_TBS_TABLE (93)
|
||||
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include <math.h>
|
||||
|
||||
//Table 5.1.2.2-2
|
||||
uint16_t Tbstable_nr[INDEX_MAX_TBS_TABLE] = {24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,208,224,240,256,272,288,304,320,336,352,368,384,408,432,456,480,504,528,552,576,608,640,672,704,736,768,808,848,888,928,984,1032,1064,1128,1160,1192,1224,1256,1288,1320,1352,1416,1480,1544,1608,1672,1736,1800,1864,1928,2024,2088,2152,2216,2280,2408,2472,2536,2600,2664,2728,2792,2856,2976,3104,3240,3368,3496,3624,3752,3824};
|
||||
|
||||
uint16_t NPRB_LBRM[7] = {32,66,107,135,162,217,273};
|
||||
|
||||
uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint16_t nb_rb,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint16_t nb_rb_oh,
|
||||
uint8_t Nl)
|
||||
{
|
||||
|
||||
uint16_t nbp_re, nb_re;
|
||||
uint32_t nr_tbs=0;
|
||||
uint32_t Ninfo, Np_info, C;
|
||||
uint8_t n, scale;
|
||||
|
||||
nbp_re = 12 * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
|
||||
|
||||
nb_re = min(156, nbp_re) * nb_rb;
|
||||
|
||||
scale = (R>1024)?11:10;
|
||||
|
||||
// Intermediate number of information bits
|
||||
Ninfo = (nb_re * R * Qm * Nl)>>scale;
|
||||
|
||||
if (Ninfo <=3824) {
|
||||
n = max(3, floor(log2(Ninfo)) - 6);
|
||||
Np_info = max(24, (Ninfo>>n)<<n);
|
||||
for (int i=0; i<INDEX_MAX_TBS_TABLE; i++) {
|
||||
if (Tbstable_nr[i] >= Np_info){
|
||||
nr_tbs = Tbstable_nr[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
n = log2(Ninfo-24)-5;
|
||||
Np_info = max(3840, (ROUNDIDIV((Ninfo-24),(1<<n)))<<n);
|
||||
|
||||
if (R <= 256) {
|
||||
C = CEILIDIV((Np_info+24),3816);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
if (Np_info > 8424){
|
||||
C = CEILIDIV((Np_info+24),8424);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
nr_tbs = ((CEILIDIV((Np_info+24),8))<<3) - 24;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//printf("Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
|
||||
return nr_tbs;
|
||||
}
|
||||
|
||||
|
||||
//tbslbrm calculation according to 5.4.2.1 of 38.212
|
||||
uint32_t nr_compute_tbslbrm(uint16_t table,
|
||||
uint16_t nb_rb,
|
||||
uint8_t Nl,
|
||||
uint8_t C)
|
||||
{
|
||||
|
||||
uint16_t R, nb_re;
|
||||
uint16_t nb_rb_lbrm=0;
|
||||
uint8_t Qm;
|
||||
int i;
|
||||
uint32_t nr_tbs=0;
|
||||
uint32_t Ninfo, Np_info;
|
||||
uint8_t n;
|
||||
|
||||
for (i=0; i<7; i++) {
|
||||
if (NPRB_LBRM[i] >= nb_rb){
|
||||
nb_rb_lbrm = NPRB_LBRM[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Qm = ((table == 1)? 8 : 6);
|
||||
R = 948;
|
||||
nb_re = 156 * nb_rb_lbrm;
|
||||
|
||||
// Intermediate number of information bits
|
||||
Ninfo = (nb_re * R * Qm * Nl)>>10;
|
||||
|
||||
if (Ninfo <=3824) {
|
||||
n = max(3, floor(log2(Ninfo)) - 6);
|
||||
Np_info = max(24, (Ninfo>>n)<<n);
|
||||
for (int i=0; i<INDEX_MAX_TBS_TABLE; i++) {
|
||||
if (Tbstable_nr[i] >= Np_info){
|
||||
nr_tbs = Tbstable_nr[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
n = log2(Ninfo-24)-5;
|
||||
Np_info = max(3840, (ROUNDIDIV((Ninfo-24),(1<<n)))<<n);
|
||||
|
||||
if (R <= 256) {
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
if (Np_info > 8424){
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
nr_tbs = ((CEILIDIV((Np_info+24),8))<<3) - 24;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return nr_tbs;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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 mac.h
|
||||
* \brief MAC data structures, constant, and function prototype
|
||||
* \author Navid Nikaein and Raymond Knopp, WIE-TAI CHEN
|
||||
* \date Dec. 2019
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email raymond.knopp@eurecom.fr
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __LAYER2_NR_MAC_COMMON_H__
|
||||
#define __LAYER2_NR_MAC_COMMON_H__
|
||||
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
|
||||
|
||||
typedef enum {
|
||||
NR_DL_DCI_FORMAT_1_0 = 0,
|
||||
NR_DL_DCI_FORMAT_1_1,
|
||||
NR_DL_DCI_FORMAT_2_0,
|
||||
NR_DL_DCI_FORMAT_2_1,
|
||||
NR_DL_DCI_FORMAT_2_2,
|
||||
NR_DL_DCI_FORMAT_2_3,
|
||||
NR_UL_DCI_FORMAT_0_0,
|
||||
NR_UL_DCI_FORMAT_0_1
|
||||
} nr_dci_format_t;
|
||||
|
||||
typedef enum {
|
||||
NR_RNTI_new = 0,
|
||||
NR_RNTI_C,
|
||||
NR_RNTI_RA,
|
||||
NR_RNTI_P,
|
||||
NR_RNTI_CS,
|
||||
NR_RNTI_TC,
|
||||
NR_RNTI_SP_CSI,
|
||||
NR_RNTI_SI,
|
||||
NR_RNTI_SFI,
|
||||
NR_RNTI_INT,
|
||||
NR_RNTI_TPC_PUSCH,
|
||||
NR_RNTI_TPC_PUCCH,
|
||||
NR_RNTI_TPC_SRS
|
||||
} nr_rnti_type_t;
|
||||
|
||||
#endif
|
||||
@@ -47,7 +47,6 @@
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
#include "NR_MeasConfig.h"
|
||||
|
||||
#include "nfapi_nr_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
|
||||
@@ -60,44 +59,71 @@
|
||||
#include "PHY/TOOLS/time_meas.h"
|
||||
#include "targets/ARCH/COMMON/common_lib.h"
|
||||
|
||||
#include "nr_mac_common.h"
|
||||
|
||||
#define MAX_NUM_BWP 2
|
||||
#define MAX_NUM_CORESET 2
|
||||
#define MAX_NUM_CCE 90
|
||||
|
||||
#include "NR_TAG.h"
|
||||
|
||||
/*! \brief gNB common channels */
|
||||
typedef struct {
|
||||
int physCellId;
|
||||
int p_gNB;
|
||||
int Ncp;
|
||||
int nr_band;
|
||||
uint32_t dl_CarrierFreq;
|
||||
NR_BCCH_BCH_Message_t *mib;
|
||||
NR_TDD_UL_DL_ConfigCommon_t *tdd_Config;
|
||||
NR_ARFCN_ValueEUTRA_t ul_CarrierFreq;
|
||||
long ul_Bandwidth;
|
||||
/// Outgoing MIB PDU for PHY
|
||||
MIB_PDU MIB_pdu;
|
||||
/// Outgoing BCCH pdu for PHY
|
||||
BCCH_PDU BCCH_pdu;
|
||||
/// 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;
|
||||
/// Outgoing RAR pdu for PHY
|
||||
RAR_PDU RAR_pdu;
|
||||
/// Template for RA computations
|
||||
RA_t ra[NB_RA_PROC_MAX];
|
||||
/// VRB map for common channels
|
||||
uint8_t vrb_map[100];
|
||||
/// VRB map for common channels and retransmissions by PHICH
|
||||
uint8_t vrb_map_UL[100];
|
||||
/// number of subframe allocation pattern available for MBSFN sync area
|
||||
uint8_t num_sf_allocation_pattern;
|
||||
int physCellId;
|
||||
int p_gNB;
|
||||
int Ncp;
|
||||
int nr_band;
|
||||
uint64_t dl_CarrierFreq;
|
||||
NR_BCCH_BCH_Message_t *mib;
|
||||
NR_ServingCellConfigCommon_t *ServingCellConfigCommon;
|
||||
NR_ARFCN_ValueEUTRA_t ul_CarrierFreq;
|
||||
long ul_Bandwidth;
|
||||
/// Outgoing MIB PDU for PHY
|
||||
MIB_PDU MIB_pdu;
|
||||
/// Outgoing BCCH pdu for PHY
|
||||
BCCH_PDU BCCH_pdu;
|
||||
/// 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;
|
||||
/// Outgoing RAR pdu for PHY
|
||||
RAR_PDU RAR_pdu;
|
||||
/// Template for RA computations
|
||||
RA_t ra[NB_RA_PROC_MAX];
|
||||
/// VRB map for common channels
|
||||
uint8_t vrb_map[100];
|
||||
/// VRB map for common channels and retransmissions by PHICH
|
||||
uint8_t vrb_map_UL[100];
|
||||
/// number of subframe allocation pattern available for MBSFN sync area
|
||||
uint8_t num_sf_allocation_pattern;
|
||||
} NR_COMMON_channels_t;
|
||||
|
||||
/*! \brief scheduling control information set through an API (not used)*/
|
||||
typedef struct {
|
||||
int dummy;
|
||||
} NR_UE_sched_ctrl_t;
|
||||
|
||||
/*! \brief UE list used by eNB to order UEs/CC for scheduling*/
|
||||
typedef struct {
|
||||
|
||||
DLSCH_PDU DLSCH_pdu[4][MAX_MOBILES_PER_GNB];
|
||||
/// scheduling control info
|
||||
UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_GNB];
|
||||
int next[MAX_MOBILES_PER_GNB];
|
||||
int head;
|
||||
int next_ul[MAX_MOBILES_PER_GNB];
|
||||
int head_ul;
|
||||
int avail;
|
||||
int num_UEs;
|
||||
boolean_t active[MAX_MOBILES_PER_GNB];
|
||||
rnti_t rnti[MAX_MOBILES_PER_GNB];
|
||||
NR_CellGroupConfig_t *secondaryCellGroup[MAX_MOBILES_PER_GNB];
|
||||
} NR_UE_list_t;
|
||||
|
||||
/*! \brief top level eNB MAC structure */
|
||||
typedef struct gNB_MAC_INST_s {
|
||||
/// Ethernet parameters for northbound midhaul interface
|
||||
@@ -124,28 +150,17 @@ typedef struct gNB_MAC_INST_s {
|
||||
uint16_t pdu_index[NFAPI_CC_MAX];
|
||||
|
||||
/// NFAPI Config Request Structure
|
||||
nfapi_nr_config_request_t config[NFAPI_CC_MAX];
|
||||
nfapi_nr_config_request_scf_t config[NFAPI_CC_MAX];
|
||||
/// NFAPI DL Config Request Structure
|
||||
nfapi_nr_dl_config_request_t DL_req[NFAPI_CC_MAX];
|
||||
nfapi_nr_dl_tti_request_t DL_req[NFAPI_CC_MAX];
|
||||
/// NFAPI UL TTI Request Structure (this is from the new SCF specs)
|
||||
nfapi_nr_ul_tti_request_t UL_tti_req[NFAPI_CC_MAX];
|
||||
/// Preallocated DL pdu list
|
||||
nfapi_nr_dl_config_request_pdu_t dl_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_DL_PDU];
|
||||
/// Preallocated HI_DCI0 pdu list
|
||||
nfapi_hi_dci0_request_pdu_t hi_dci0_pdu_list[NFAPI_CC_MAX][MAX_NUM_HI_DCI0_PDU];
|
||||
/// NFAPI HI/DCI0 Config Request Structure
|
||||
nfapi_hi_dci0_request_t HI_DCI0_req[NFAPI_CC_MAX];
|
||||
/// Prealocated TX pdu list
|
||||
nfapi_tx_request_pdu_t tx_request_pdu[NFAPI_CC_MAX][MAX_NUM_TX_REQUEST_PDU];
|
||||
nfapi_nr_ul_dci_request_t UL_dci_req[NFAPI_CC_MAX];
|
||||
/// NFAPI DL PDU structure
|
||||
nfapi_tx_request_t TX_req[NFAPI_CC_MAX];
|
||||
/// NFAPI coreset structure
|
||||
nfapi_nr_coreset_t coreset[NFAPI_CC_MAX][NFAPI_NR_MAX_NB_CORESETS];
|
||||
/// NFAPI search space structure
|
||||
nfapi_nr_search_space_t search_space[NFAPI_CC_MAX][NFAPI_NR_MAX_NB_SEARCH_SPACES];
|
||||
nfapi_nr_tx_data_request_t TX_req[NFAPI_CC_MAX];
|
||||
|
||||
/// this is an LTE structure and needs to be urgenly updated
|
||||
UE_list_t UE_list;
|
||||
NR_UE_list_t UE_list;
|
||||
|
||||
/// UL handle
|
||||
uint32_t ul_handle;
|
||||
@@ -171,6 +186,72 @@ typedef struct gNB_MAC_INST_s {
|
||||
time_stats_t rx_ulsch_sdu; // include rlc_data_ind
|
||||
/// processing time of eNB PCH scheduler
|
||||
time_stats_t schedule_pch;
|
||||
/// CCE lists
|
||||
int cce_list[MAX_NUM_BWP][MAX_NUM_CORESET][MAX_NUM_CCE];
|
||||
} gNB_MAC_INST;
|
||||
|
||||
typedef struct {
|
||||
|
||||
|
||||
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;
|
||||
|
||||
} dci_pdu_rel15_t;
|
||||
|
||||
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_GNB_H__ */
|
||||
|
||||
@@ -2299,14 +2299,14 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
|
||||
netlink_init_tun("ue",num_if);
|
||||
if (IS_SOFTMODEM_NOS1)
|
||||
nas_config(1, 1, 2, "ue");
|
||||
netlink_init_mbms_tun("uem",num_if);
|
||||
netlink_init_mbms_tun("uem");
|
||||
nas_config_mbms(1, 2, 2, "uem");
|
||||
LOG_I(PDCP, "UE pdcp will use tun interface\n");
|
||||
} else if(ENB_NAS_USE_TUN) {
|
||||
netlink_init_tun("enb",1);
|
||||
nas_config(1, 1, 1, "enb");
|
||||
if(pdcp_optmask & ENB_NAS_USE_TUN_W_MBMS_BIT){
|
||||
netlink_init_mbms_tun("enm",1);
|
||||
netlink_init_mbms_tun("enm");
|
||||
nas_config_mbms(1, 2, 1, "enm");
|
||||
LOG_I(PDCP, "ENB pdcp will use mbms tun interface\n");
|
||||
}
|
||||
@@ -2318,7 +2318,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
|
||||
}else{
|
||||
if(pdcp_optmask & ENB_NAS_USE_TUN_W_MBMS_BIT){
|
||||
LOG_W(PDCP, "ENB pdcp will use tun interface for MBMS\n");
|
||||
netlink_init_mbms_tun("enm",1);
|
||||
netlink_init_mbms_tun("enm");
|
||||
nas_config_mbms_s1(1, 2, 1, "enm");
|
||||
}else
|
||||
LOG_E(PDCP, "ENB pdcp will not use tun interface\n");
|
||||
|
||||
@@ -77,7 +77,7 @@ extern struct iovec nas_iov_rx;
|
||||
|
||||
extern int nas_sock_fd[MAX_MOBILES_PER_ENB];
|
||||
|
||||
extern int nas_sock_mbms_fd[8];
|
||||
extern int nas_sock_mbms_fd;
|
||||
|
||||
extern int mbms_rab_id;
|
||||
|
||||
@@ -133,7 +133,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
|
||||
} else if (UE_NAS_USE_TUN) {
|
||||
//ret = write(nas_sock_fd[ctxt_pP->module_id], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite );
|
||||
if(rb_id == mbms_rab_id){
|
||||
ret = write(nas_sock_mbms_fd[0], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite );
|
||||
ret = write(nas_sock_mbms_fd, &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite );
|
||||
LOG_I(PDCP,"[PDCP_FIFOS] ret %d TRIED TO PUSH MBMS DATA TO rb_id %d handle %d sizeToWrite %d\n",ret,rb_id,nas_sock_fd[ctxt_pP->module_id],sizeToWrite);
|
||||
}
|
||||
else
|
||||
@@ -299,7 +299,7 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p
|
||||
do {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_MBMS_FIFO_READ, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_MBMS_FIFO_READ_BUFFER, 1 );
|
||||
len = read(UE_NAS_USE_TUN?nas_sock_mbms_fd[0]:nas_sock_mbms_fd[0], &nl_rx_buf, NL_MAX_PAYLOAD);
|
||||
len = read(nas_sock_mbms_fd, &nl_rx_buf, NL_MAX_PAYLOAD);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_MBMS_FIFO_READ_BUFFER, 0 );
|
||||
|
||||
if (len<=0) continue;
|
||||
|
||||
@@ -51,106 +51,100 @@ extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
|
||||
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
|
||||
extern uint8_t nfapi_mode;
|
||||
extern uint16_t sf_ahead;
|
||||
extern uint16_t sl_ahead;
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info) {
|
||||
if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
|
||||
AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
|
||||
UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->slot, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf));
|
||||
/*
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti,0
|
||||
);
|
||||
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) || (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
//#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
#endif
|
||||
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) {
|
||||
AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n");
|
||||
|
||||
for (int i=0; i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles; i++) {
|
||||
AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0,
|
||||
"Got regular PRACH preamble, not BL/CE\n");
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->slot,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type-1);
|
||||
initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti,
|
||||
UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type);
|
||||
}
|
||||
|
||||
UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_nr_sr(NR_UL_IND_t *UL_info) {
|
||||
if (nfapi_mode == 1) { // PNF
|
||||
if (UL_info->sr_ind.sr_indication_body.number_of_srs>0) {
|
||||
oai_nfapi_sr_indication(&UL_info->sr_ind);
|
||||
|
||||
|
||||
if (nfapi_mode == 1) // PNF
|
||||
{
|
||||
if (UL_info->sr_ind.sr_indication_body.number_of_srs>0)
|
||||
{
|
||||
// oai_nfapi_sr_indication(&UL_info->sr_ind);
|
||||
}
|
||||
} else {
|
||||
for (int i=0; i<UL_info->sr_ind.sr_indication_body.number_of_srs; i++)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
for (int i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
|
||||
SR_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
UL_info->sr_ind.sr_indication_body.number_of_srs=0;
|
||||
}
|
||||
|
||||
void handle_nr_cqi(NR_UL_IND_t *UL_info) {
|
||||
if (nfapi_mode == 1) {
|
||||
if (UL_info->cqi_ind.number_of_cqis>0) {
|
||||
LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis);
|
||||
nfapi_cqi_indication_t ind;
|
||||
ind.header.message_id = NFAPI_RX_CQI_INDICATION;
|
||||
ind.sfn_sf = UL_info->frame<<4 | UL_info->slot;
|
||||
ind.cqi_indication_body = UL_info->cqi_ind;
|
||||
oai_nfapi_cqi_indication(&ind);
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
}
|
||||
} else {
|
||||
for (int i=0; i<UL_info->cqi_ind.number_of_cqis; i++)
|
||||
cqi_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
|
||||
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
|
||||
|
||||
/*
|
||||
for (int i=0;i<UL_info->cqi_ind.number_of_cqis;i++)
|
||||
cqi_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
|
||||
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
|
||||
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
|
||||
*/
|
||||
UL_info->cqi_ind.number_of_cqis=0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void handle_nr_harq(NR_UL_IND_t *UL_info) {
|
||||
if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) { // PNF
|
||||
//LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
|
||||
int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
|
||||
/* int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
|
||||
|
||||
if (retval!=0) {
|
||||
LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval);
|
||||
}
|
||||
|
||||
*/
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs = 0;
|
||||
} else {
|
||||
for (int i=0; i<UL_info->harq_ind.harq_indication_body.number_of_harqs; i++)
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
for (int i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
|
||||
harq_indication(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
|
||||
&UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
|
||||
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
|
||||
NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
|
||||
&UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
|
||||
*/
|
||||
UL_info->harq_ind.harq_indication_body.number_of_harqs=0;
|
||||
}
|
||||
}
|
||||
@@ -159,17 +153,18 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
if(nfapi_mode == 1) {
|
||||
if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
||||
oai_nfapi_crc_indication(&UL_info->crc_ind);
|
||||
// oai_nfapi_crc_indication(&UL_info->crc_ind);
|
||||
|
||||
UL_info->crc_ind.crc_indication_body.number_of_crcs = 0;
|
||||
}
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0) {
|
||||
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
|
||||
oai_nfapi_rx_ind(&UL_info->rx_ind);
|
||||
// oai_nfapi_rx_ind(&UL_info->rx_ind);
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
}
|
||||
} else {
|
||||
// printf("UL_info->rx_ind.rx_indication_body.number_of_pdus %d UL_info->crc_ind.crc_indication_body.number_of_crcs %d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->crc_ind.crc_indication_body.number_of_crcs);
|
||||
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
for (int i=0; i<UL_info->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
for (int j=0; j<UL_info->crc_ind.crc_indication_body.number_of_crcs; j++) {
|
||||
@@ -182,27 +177,28 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
|
||||
LOG_I(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->slot);
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->slot);
|
||||
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
} else {
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC ok), received length: %d \n",UL_info->frame,UL_info->slot, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length);
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->slot);
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
//printf("rx_indication_rel8.timing_advance %d\n", UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance);
|
||||
break;
|
||||
@@ -259,35 +255,37 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
handle_nr_cqi(UL_info);
|
||||
handle_nr_harq(UL_info);
|
||||
// clear HI prior to handling ULSCH
|
||||
mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0;
|
||||
mac->UL_dci_req[CC_id].numPdus = 0;
|
||||
handle_nr_ulsch(UL_info);
|
||||
|
||||
if (nfapi_mode != 1) {
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
/*
|
||||
eNB_dlsch_ulsch_scheduler(module_id,
|
||||
(UL_info->frame+((UL_info->slot>(9-sf_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sf_ahead)%10);
|
||||
(UL_info->frame+((UL_info->slot>(9-sl_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sl_ahead)%10);
|
||||
*/
|
||||
nfapi_nr_config_request_t *cfg = &mac->config[CC_id];
|
||||
nfapi_nr_config_request_scf_t *cfg = &mac->config[CC_id];
|
||||
int spf = get_spf(cfg);
|
||||
gNB_dlsch_ulsch_scheduler(module_id,
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
(UL_info->frame+((UL_info->slot>(spf-1-sf_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sf_ahead)%spf);
|
||||
(UL_info->frame+((UL_info->slot>(spf-1-sl_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sl_ahead)%spf);
|
||||
|
||||
ifi->CC_mask = 0;
|
||||
sched_info->module_id = module_id;
|
||||
sched_info->CC_id = CC_id;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-sf_ahead)) ? 1 : 0)) % 1024;
|
||||
sched_info->slot = (UL_info->slot+sf_ahead)%spf;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-sl_ahead)) ? 1 : 0)) % 1024;
|
||||
sched_info->slot = (UL_info->slot+sl_ahead)%spf;
|
||||
sched_info->DL_req = &mac->DL_req[CC_id];
|
||||
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
|
||||
sched_info->UL_dci_req = &mac->UL_dci_req[CC_id];
|
||||
|
||||
if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
|
||||
(is_nr_UL_slot(&mac->common_channels[CC_id],(sched_info->slot+sf_ahead)%spf)>0))
|
||||
if ((mac->common_channels[CC_id].ServingCellConfigCommon->tdd_UL_DL_ConfigurationCommon==NULL) ||
|
||||
(is_nr_UL_slot(mac->common_channels[CC_id].ServingCellConfigCommon,UL_info->slot)>0)) {
|
||||
//printf("NR_UL_indication: this is an UL slot. UL_info: frame %d, slot %d. UL_tti_req: frame %d, slot %d\n",UL_info->frame,UL_info->slot,mac->UL_tti_req[CC_id].SFN,mac->UL_tti_req[CC_id].Slot);
|
||||
sched_info->UL_tti_req = &mac->UL_tti_req[CC_id];
|
||||
}
|
||||
else
|
||||
sched_info->UL_tti_req = NULL;
|
||||
|
||||
@@ -304,18 +302,24 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
ifi->NR_Schedule_response(sched_info);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->slot,sched_info->DL_req->dl_config_request_body.number_pdu);
|
||||
LOG_D(PHY,"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",
|
||||
sched_info->frame,
|
||||
sched_info->slot,
|
||||
sched_info->DL_req->dl_tti_request_body.nPDUs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {
|
||||
AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
|
||||
LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
|
||||
LOG_I(PHY,"Installing callbacks for IF_Module - UL_indication\n");
|
||||
|
||||
if (if_inst[Mod_id]==NULL) {
|
||||
if_inst[Mod_id] = (NR_IF_Module_t *)malloc(sizeof(NR_IF_Module_t));
|
||||
memset((void *)if_inst[Mod_id],0,sizeof(NR_IF_Module_t));
|
||||
if_inst[Mod_id] = (NR_IF_Module_t*)malloc(sizeof(NR_IF_Module_t));
|
||||
memset((void*)if_inst[Mod_id],0,sizeof(NR_IF_Module_t));
|
||||
|
||||
LOG_I(MAC,"Allocating shared L1/L2 interface structure for instance %d @ %p\n",Mod_id,if_inst[Mod_id]);
|
||||
|
||||
if_inst[Mod_id]->CC_mask=0;
|
||||
if_inst[Mod_id]->NR_UL_indication = NR_UL_indication;
|
||||
AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
|
||||
|
||||
@@ -100,19 +100,19 @@ typedef struct {
|
||||
/// slot
|
||||
slot_t slot;
|
||||
/// nFAPI DL Config Request
|
||||
nfapi_nr_dl_config_request_t *DL_req;
|
||||
nfapi_nr_dl_tti_request_t *DL_req;
|
||||
/// nFAPI UL Config Request
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req;
|
||||
/// nFAPI HI_DCI Request
|
||||
nfapi_hi_dci0_request_t *HI_DCI0_req;
|
||||
/// nFAPI UL_DCI Request
|
||||
nfapi_nr_ul_dci_request_t *UL_dci_req;
|
||||
/// Pointers to DL SDUs
|
||||
nfapi_tx_request_t *TX_req;
|
||||
nfapi_nr_tx_data_request_t *TX_req;
|
||||
} NR_Sched_Rsp_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t Mod_id;
|
||||
int CC_id;
|
||||
nfapi_nr_config_request_t *cfg;
|
||||
nfapi_nr_config_request_scf_t *cfg;
|
||||
} NR_PHY_Config_t;
|
||||
|
||||
typedef struct NR_IF_Module_s {
|
||||
|
||||
@@ -45,17 +45,16 @@
|
||||
static nr_ue_if_module_t *nr_ue_if_module_inst[MAX_IF_MODULES];
|
||||
|
||||
// L2 Abstraction Layer
|
||||
int handle_bcch_bch(UE_nr_rxtx_proc_t *proc, module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t *pduP, unsigned int additional_bits, uint32_t ssb_index, uint32_t ssb_length, uint16_t cell_id){
|
||||
int handle_bcch_bch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t *pduP, unsigned int additional_bits, uint32_t ssb_index, uint32_t ssb_length, uint16_t cell_id){
|
||||
|
||||
return nr_ue_decode_mib( proc,
|
||||
module_id,
|
||||
cc_id,
|
||||
gNB_index,
|
||||
additional_bits,
|
||||
ssb_length, // Lssb = 64 is not support
|
||||
ssb_index,
|
||||
pduP,
|
||||
cell_id);
|
||||
return nr_ue_decode_mib(module_id,
|
||||
cc_id,
|
||||
gNB_index,
|
||||
additional_bits,
|
||||
ssb_length, // Lssb = 64 is not support
|
||||
ssb_index,
|
||||
pduP,
|
||||
cell_id);
|
||||
|
||||
}
|
||||
|
||||
@@ -65,22 +64,23 @@ int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index,
|
||||
return 0;
|
||||
}
|
||||
// L2 Abstraction Layer
|
||||
int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, fapi_nr_dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_type){
|
||||
int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, fapi_nr_dci_indication_pdu_t *dci){
|
||||
|
||||
//printf("handle_dci: rnti %x,dci_type %d\n",rnti,dci_type);
|
||||
return nr_ue_process_dci(module_id, cc_id, gNB_index, dci, rnti, dci_type);
|
||||
return nr_ue_process_dci_indication_pdu(module_id, cc_id, gNB_index, dci);
|
||||
|
||||
}
|
||||
// L2 Abstraction Layer
|
||||
int8_t handle_dlsch (module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_indication_t *dci_ind, uint8_t *pduP, uint32_t pdu_len, frame_t frame, int slot, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment){
|
||||
|
||||
LOG_D(MAC, "handle_dlsch at MAC layer \n");
|
||||
//if (IS_SOFTMODEM_NOS1 || IS_SOFTMODEM_RFSIM)
|
||||
// sdu should be processed even when is S1 mode because data and timing advance updates are transmitted by the UE
|
||||
nr_ue_send_sdu(module_id, cc_id, frame, slot,
|
||||
pduP,
|
||||
pdu_len,
|
||||
gNB_index,
|
||||
ul_time_alignment);
|
||||
nr_ue_send_sdu(module_id, cc_id, frame, slot,
|
||||
pduP,
|
||||
pdu_len,
|
||||
gNB_index,
|
||||
ul_time_alignment);
|
||||
|
||||
return 0;
|
||||
/*
|
||||
@@ -157,15 +157,12 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
|
||||
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n");
|
||||
for(i=0; i<dl_info->dci_ind->number_of_dcis; ++i){
|
||||
LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis);
|
||||
fapi_nr_dci_pdu_rel15_t *dci = &dl_info->dci_ind->dci_list[i].dci;
|
||||
// fapi_nr_dci_pdu_rel15_t *dci = &dl_info->dci_ind->dci_list[i].dci;
|
||||
|
||||
ret_mask |= (handle_dci(
|
||||
dl_info->module_id,
|
||||
dl_info->cc_id,
|
||||
dl_info->gNB_index,
|
||||
dci,
|
||||
(dl_info->dci_ind->dci_list+i)->rnti,
|
||||
(dl_info->dci_ind->dci_list+i)->dci_format)) << FAPI_NR_DCI_IND;
|
||||
ret_mask |= (handle_dci(dl_info->module_id,
|
||||
dl_info->cc_id,
|
||||
dl_info->gNB_index,
|
||||
dl_info->dci_ind->dci_list+i)<< FAPI_NR_DCI_IND);
|
||||
|
||||
AssertFatal( nr_ue_if_module_inst[module_id] != NULL, "IF module is void!\n" );
|
||||
nr_ue_if_module_inst[module_id]->scheduled_response(&mac->scheduled_response);
|
||||
@@ -211,28 +208,22 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
|
||||
}*/
|
||||
|
||||
//(dl_info->dci_list+i)->rnti
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(dl_info->rx_ind != NULL){
|
||||
LOG_I(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
|
||||
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
|
||||
for(i=0; i<dl_info->rx_ind->number_pdus; ++i){
|
||||
switch(dl_info->rx_ind->rx_indication_body[i].pdu_type){
|
||||
case FAPI_NR_RX_PDU_TYPE_MIB:
|
||||
ret_mask |= (handle_bcch_bch( dl_info->proc,
|
||||
dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
|
||||
ret_mask |= (handle_bcch_bch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.pdu,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.additional_bits,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.ssb_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.ssb_length,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->mib_pdu.cell_id )) << FAPI_NR_RX_PDU_TYPE_MIB;
|
||||
LOG_I(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], MIB case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
|
||||
/*ret_mask |= (handle_bcch_bch( dl_info->proc,
|
||||
dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
|
||||
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], MIB case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
|
||||
/*ret_mask |= (handle_bcch_bch( dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
|
||||
dl_info->rx_ind->rx_indication_body[i].mib_pdu.pdu,
|
||||
dl_info->rx_ind->rx_indication_body[i].mib_pdu.additional_bits,
|
||||
dl_info->rx_ind->rx_indication_body[i].mib_pdu.ssb_index,
|
||||
@@ -249,9 +240,9 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
|
||||
// ret_mask |= (0) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
ret_mask |= (handle_dlsch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, dl_info->dci_ind,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length, dl_info->frame, dl_info->slot,ul_time_alignment)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length, dl_info->frame, dl_info->slot, ul_time_alignment)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
|
||||
LOG_I(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], DLSCH case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
|
||||
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], DLSCH case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
|
||||
|
||||
/*
|
||||
// dl_config structure just stores what was received - not really needed
|
||||
@@ -310,49 +301,11 @@ int nr_ue_dcireq(nr_dcireq_t *dcireq) {
|
||||
|
||||
fapi_nr_dl_config_request_t *dl_config=&dcireq->dl_config_req;
|
||||
NR_UE_MAC_INST_t *UE_mac = get_mac_inst(0);
|
||||
|
||||
// Type0 PDCCH search space
|
||||
dl_config->number_pdus = 1;
|
||||
dl_config->dl_config_list[0].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DCI;
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.rnti = 0x1234; // to be set
|
||||
|
||||
uint64_t mask = 0x0;
|
||||
uint16_t num_rbs=24;
|
||||
uint16_t rb_offset=0;
|
||||
uint16_t cell_id=0;
|
||||
uint16_t num_symbols=2;
|
||||
for(int i=0; i<(num_rbs/6); ++i){ // 38.331 Each bit corresponds a group of 6 RBs
|
||||
mask = mask >> 1;
|
||||
mask = mask | 0x100000000000;
|
||||
}
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.frequency_domain_resource = mask;
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.rb_offset = rb_offset; // additional parameter other than coreset
|
||||
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.duration = num_symbols;
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.cce_reg_mapping_type =CCE_REG_MAPPING_TYPE_NON_INTERLEAVED;
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.cce_reg_interleaved_reg_bundle_size = 0; // L 38.211 7.3.2.2
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.cce_reg_interleaved_interleaver_size = 0; // R 38.211 7.3.2.2
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.cce_reg_interleaved_shift_index = cell_id;
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.precoder_granularity = PRECODER_GRANULARITY_SAME_AS_REG_BUNDLE;
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.pdcch_dmrs_scrambling_id = cell_id;
|
||||
|
||||
uint32_t number_of_search_space_per_slot=1;
|
||||
uint32_t first_symbol_index=0;
|
||||
uint32_t search_space_duration=0; // element of search space
|
||||
uint32_t coreset_duration; // element of coreset
|
||||
|
||||
coreset_duration = num_symbols * number_of_search_space_per_slot;
|
||||
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.number_of_candidates[0] = table_38213_10_1_1_c2[0];
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.number_of_candidates[1] = table_38213_10_1_1_c2[1];
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.number_of_candidates[2] = table_38213_10_1_1_c2[2]; // CCE aggregation level = 4
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.number_of_candidates[3] = table_38213_10_1_1_c2[3]; // CCE aggregation level = 8
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.number_of_candidates[4] = table_38213_10_1_1_c2[4]; // CCE aggregation level = 16
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.duration = search_space_duration;
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.monitoring_symbols_within_slot = (0x3fff << first_symbol_index) & (0x3fff >> (14-coreset_duration-first_symbol_index)) & 0x3fff;
|
||||
|
||||
dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15.N_RB_BWP = UE_mac->initial_bwp_dl.N_RB;
|
||||
|
||||
|
||||
dl_config->sfn=UE_mac->dl_config_request.sfn;
|
||||
dl_config->slot=UE_mac->dl_config_request.slot;
|
||||
dl_config->number_pdus=0;
|
||||
|
||||
ue_dci_configuration(UE_mac,dl_config,dcireq->frame,dcireq->slot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -106,8 +106,6 @@ typedef struct {
|
||||
int CC_id;
|
||||
/// frame
|
||||
frame_t frame;
|
||||
/// subframe
|
||||
sub_frame_t subframe;
|
||||
/// slot
|
||||
int slot;
|
||||
|
||||
@@ -215,7 +213,7 @@ int nr_ue_dcireq(nr_dcireq_t *dcireq);
|
||||
\param ssb_index SSB index within 0 - (L_ssb-1) corresponding to 38.331 ch.13 parameter i
|
||||
\param ssb_length corresponding to L1 parameter L_ssb
|
||||
\param cell_id cell id */
|
||||
int handle_bcch_bch(UE_nr_rxtx_proc_t *proc, module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t *pduP, unsigned int additional_bits, uint32_t ssb_index, uint32_t ssb_length, uint16_t cell_id);
|
||||
int handle_bcch_bch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t *pduP, unsigned int additional_bits, uint32_t ssb_index, uint32_t ssb_length, uint16_t cell_id);
|
||||
|
||||
// TODO check
|
||||
/**\brief handle BCCH-DL-SCH message from dl_indication
|
||||
@@ -223,7 +221,7 @@ int handle_bcch_bch(UE_nr_rxtx_proc_t *proc, module_id_t module_id, int cc_id, u
|
||||
\param pduP pointer to pdu*/
|
||||
int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint32_t sibs_mask, uint8_t *pduP, uint32_t pdu_len);
|
||||
|
||||
int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, fapi_nr_dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_type);
|
||||
int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, fapi_nr_dci_indication_pdu_t *dci);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -194,7 +194,6 @@ typedef struct IF_Module_s{
|
||||
void (*UL_indication)(UL_IND_t *UL_INFO, L1_rxtx_proc_t *proc);
|
||||
void (*schedule_response)(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc);
|
||||
void (*PHY_config_req)(PHY_Config_t* config_INFO);
|
||||
|
||||
void (*PHY_config_update_sib2_req)(PHY_Config_t* config_INFO);
|
||||
void (*PHY_config_update_sib13_req)(PHY_Config_t* config_INFO);
|
||||
uint32_t CC_mask;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3230,6 +3230,98 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
|
||||
uint8_t *const buffer,
|
||||
const uint8_t Transaction_id)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
LTE_DL_DCCH_Message_t dl_dcch_msg;
|
||||
LTE_RAT_Type_t rat_nr=LTE_RAT_Type_nr;
|
||||
LTE_RAT_Type_t rat_eutra_nr=LTE_RAT_Type_eutra_nr;
|
||||
asn_enc_rval_t enc_rval;
|
||||
memset(&dl_dcch_msg,0,sizeof(LTE_DL_DCCH_Message_t));
|
||||
dl_dcch_msg.message.present = LTE_DL_DCCH_MessageType_PR_c1;
|
||||
dl_dcch_msg.message.choice.c1.present = LTE_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry;
|
||||
dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.rrc_TransactionIdentifier = Transaction_id;
|
||||
dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.present = LTE_UECapabilityEnquiry__criticalExtensions_PR_c1;
|
||||
dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.present =
|
||||
LTE_UECapabilityEnquiry__criticalExtensions__c1_PR_ueCapabilityEnquiry_r8;
|
||||
dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count=0;
|
||||
ASN_SEQUENCE_ADD(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list,
|
||||
&rat_nr);
|
||||
ASN_SEQUENCE_ADD(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list,
|
||||
&rat_eutra_nr);
|
||||
|
||||
/* request NR configuration */
|
||||
LTE_UECapabilityEnquiry_r8_IEs_t *r8 = &dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8;
|
||||
LTE_UECapabilityEnquiry_v8a0_IEs_t r8_a0;
|
||||
LTE_UECapabilityEnquiry_v1180_IEs_t r11_80;
|
||||
LTE_UECapabilityEnquiry_v1310_IEs_t r13_10;
|
||||
LTE_UECapabilityEnquiry_v1430_IEs_t r14_30;
|
||||
LTE_UECapabilityEnquiry_v1510_IEs_t r15_10;
|
||||
|
||||
memset(&r8_a0, 0, sizeof(r8_a0));
|
||||
memset(&r11_80, 0, sizeof(r11_80));
|
||||
memset(&r13_10, 0, sizeof(r13_10));
|
||||
memset(&r14_30, 0, sizeof(r14_30));
|
||||
memset(&r15_10, 0, sizeof(r15_10));
|
||||
|
||||
r8->nonCriticalExtension = &r8_a0;
|
||||
r8_a0.nonCriticalExtension = &r11_80;
|
||||
r11_80.nonCriticalExtension = &r13_10;
|
||||
r13_10.nonCriticalExtension = &r14_30;
|
||||
r14_30.nonCriticalExtension = &r15_10;
|
||||
|
||||
/* TODO: no hardcoded values here */
|
||||
|
||||
OCTET_STRING_t req_freq;
|
||||
//unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x02, 0x68 }; // bands 7 & nr78
|
||||
//unsigned char req_freq_buf[5] = { 0x00, 0x20, 0x1a, 0x08, 0x18 }; // bands 7 & nr260
|
||||
|
||||
//unsigned char req_freq_buf[13] = { 0x00, 0xc0, 0x18, 0x01, 0x01, 0x30, 0x4b, 0x04, 0x0e, 0x08, 0x24, 0x04, 0xd0 };
|
||||
unsigned char req_freq_buf[21] = {
|
||||
0x01, 0x60, 0x18, 0x05, 0x80, 0xc0, 0x04, 0x04, 0xc1, 0x2c, 0x10, 0x08, 0x20, 0x30, 0x40, 0xe0, 0x82, 0x40, 0x28, 0x80, 0x9a
|
||||
};
|
||||
|
||||
req_freq.buf = req_freq_buf;
|
||||
req_freq.size = 5;
|
||||
req_freq.size = 21;
|
||||
|
||||
r15_10.requestedFreqBandsNR_MRDC_r15 = &req_freq;
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_LTE_DL_DCCH_Message, (void *)&dl_dcch_msg);
|
||||
}
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_DL_DCCH_Message,
|
||||
NULL,
|
||||
(void *)&dl_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
|
||||
if(enc_rval.encoded == -1) {
|
||||
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG_D(RRC,"[eNB %d] NR UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->rnti,
|
||||
enc_rval.encoded,
|
||||
(enc_rval.encoded+7)/8);
|
||||
|
||||
if (enc_rval.encoded==-1) {
|
||||
LOG_E(RRC,"[eNB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %x\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->rnti);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
|
||||
uint16_t do_RRCConnectionReconfiguration_BR(const protocol_ctxt_t *const ctxt_pP,
|
||||
uint8_t *buffer,
|
||||
|
||||
@@ -358,6 +358,13 @@ do_UECapabilityEnquiry(
|
||||
const uint8_t Transaction_id
|
||||
);
|
||||
|
||||
uint8_t
|
||||
do_NR_UECapabilityEnquiry(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
uint8_t *const buffer,
|
||||
const uint8_t Transaction_id
|
||||
);
|
||||
|
||||
uint8_t do_SecurityModeCommand(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
uint8_t *const buffer,
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
|
||||
#define PC5_DISCOVERY_PAYLOAD_SIZE 29
|
||||
|
||||
#define DEBUG_SCG_CONFIG 1
|
||||
|
||||
typedef enum {
|
||||
UE_STATE_OFF_NETWORK,
|
||||
@@ -264,7 +265,8 @@ typedef enum UE_STATE_e {
|
||||
RRC_SI_RECEIVED,
|
||||
RRC_CONNECTED,
|
||||
RRC_RECONFIGURED,
|
||||
RRC_HO_EXECUTION
|
||||
RRC_HO_EXECUTION,
|
||||
RRC_NR_NSA,
|
||||
} UE_STATE_t;
|
||||
|
||||
typedef enum HO_STATE_e {
|
||||
@@ -644,6 +646,8 @@ typedef struct eNB_RRC_UE_s {
|
||||
uint32_t ue_rrc_inactivity_timer;
|
||||
uint8_t e_rab_release_command_flag;
|
||||
int8_t reestablishment_xid;
|
||||
int does_nr;
|
||||
int nr_capabilities_requested;
|
||||
} eNB_RRC_UE_t;
|
||||
|
||||
typedef uid_t ue_uid_t;
|
||||
|
||||
+317
-17
@@ -113,6 +113,8 @@ extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t
|
||||
extern int rrc_eNB_process_security(const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, security_capabilities_t *security_capabilities_pP);
|
||||
extern void process_eNB_security_key (const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t *security_key_pP);
|
||||
extern int derive_keNB_star(const uint8_t *kenb_32, const uint16_t pci, const uint32_t earfcn_dl, const bool is_rel8_only, uint8_t *kenb_star);
|
||||
extern int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, rrc_eNB_ue_context_t *ue_context, unsigned char *buffer, int buffer_size, OCTET_STRING_t *scg_group_config, OCTET_STRING_t *scg_RB_config);
|
||||
extern struct rrc_eNB_ue_context_s * get_first_ue_context(eNB_RRC_INST *rrc_instance_pP);
|
||||
|
||||
pthread_mutex_t rrc_release_freelist;
|
||||
RRC_release_list_t rrc_release_info;
|
||||
@@ -1277,6 +1279,52 @@ rrc_eNB_generate_UECapabilityEnquiry(
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_eNB_generate_NR_UECapabilityEnquiry(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
uint8_t buffer[100];
|
||||
uint8_t size;
|
||||
T(T_ENB_RRC_UE_CAPABILITY_ENQUIRY, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
|
||||
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
|
||||
size = do_NR_UECapabilityEnquiry(
|
||||
ctxt_pP,
|
||||
buffer,
|
||||
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id));
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
size);
|
||||
LOG_D(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" --- PDCP_DATA_REQ/%d Bytes (NR UECapabilityEnquiry MUI %d) --->[PDCP][RB %02d]\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
size,
|
||||
rrc_eNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" rrcNRUECapabilityEnquiry UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_eNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionReject(
|
||||
@@ -2808,11 +2856,14 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
LTE_MAC_MainConfig_t *mac_MainConfig = NULL;
|
||||
LTE_MeasObjectToAddModList_t *MeasObj_list = NULL;
|
||||
LTE_MeasObjectToAddMod_t *MeasObj = NULL;
|
||||
LTE_MeasObjectToAddMod_t *MeasObj2 = NULL;
|
||||
LTE_ReportConfigToAddModList_t *ReportConfig_list = NULL;
|
||||
LTE_ReportConfigToAddMod_t *ReportConfig_per, *ReportConfig_A1,
|
||||
*ReportConfig_A2, *ReportConfig_A3, *ReportConfig_A4, *ReportConfig_A5;
|
||||
LTE_ReportConfigToAddMod_t *ReportConfig_NR = NULL;
|
||||
LTE_MeasIdToAddModList_t *MeasId_list = NULL;
|
||||
LTE_MeasIdToAddMod_t *MeasId0, *MeasId1, *MeasId2, *MeasId3, *MeasId4, *MeasId5;
|
||||
LTE_MeasIdToAddMod_t *MeasId6;
|
||||
long *sr_ProhibitTimer_r9 = NULL;
|
||||
long *logicalchannelgroup = NULL;
|
||||
long *logicalchannelgroup_drb = NULL;
|
||||
@@ -3094,6 +3145,16 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
MeasId5->measObjectId = 1;
|
||||
MeasId5->reportConfigId = 6;
|
||||
ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId5);
|
||||
|
||||
if (ue_context_pP->ue_context.does_nr) {
|
||||
MeasId6 = calloc(1, sizeof(LTE_MeasIdToAddMod_t));
|
||||
if (MeasId6 == NULL) exit(1);
|
||||
MeasId6->measId = 7;
|
||||
MeasId6->measObjectId = 2;
|
||||
MeasId6->reportConfigId = 7;
|
||||
ASN_SEQUENCE_ADD(&MeasId_list->list, MeasId6);
|
||||
}
|
||||
|
||||
// LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measIdToAddModList = MeasId_list;
|
||||
// Add one EUTRA Measurement Object
|
||||
MeasObj_list = CALLOC(1, sizeof(*MeasObj_list));
|
||||
@@ -3143,6 +3204,27 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
ASN_SEQUENCE_ADD(&MeasObj_list->list, MeasObj);
|
||||
// LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measObjectToAddModList = MeasObj_list;
|
||||
|
||||
if (ue_context_pP->ue_context.does_nr) {
|
||||
MeasObj2 = calloc(1, sizeof(LTE_MeasObjectToAddMod_t));
|
||||
if (MeasObj2 == NULL) exit(1);
|
||||
MeasObj2->measObjectId = 2;
|
||||
MeasObj2->measObject.present = LTE_MeasObjectToAddMod__measObject_PR_measObjectNR_r15;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.carrierFreq_r15 = 642256; //634000; //(634000 = 3.51GHz) (640000 = 3.6GHz) (641272 = 3619.08MHz = 3600 + 30/1000*106*12/2) (642256 is for 3.6GHz and absoluteFrequencySSB = 642016)
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.measTimingConfig_r15.periodicityAndOffset_r15.present = LTE_MTC_SSB_NR_r15__periodicityAndOffset_r15_PR_sf20_r15;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.measTimingConfig_r15.periodicityAndOffset_r15.choice.sf20_r15 = 0;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.measTimingConfig_r15.ssb_Duration_r15 = LTE_MTC_SSB_NR_r15__ssb_Duration_r15_sf4;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.rs_ConfigSSB_r15.subcarrierSpacingSSB_r15 = LTE_RS_ConfigSSB_NR_r15__subcarrierSpacingSSB_r15_kHz30;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.quantityConfigSet_r15 = 1;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.ext1 = calloc(1, sizeof(struct LTE_MeasObjectNR_r15__ext1));
|
||||
if (MeasObj2->measObject.choice.measObjectNR_r15.ext1 == NULL) exit(1);
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.ext1->bandNR_r15 = calloc(1, sizeof(struct LTE_MeasObjectNR_r15__ext1__bandNR_r15));
|
||||
if (MeasObj2->measObject.choice.measObjectNR_r15.ext1->bandNR_r15 == NULL) exit(1);
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.ext1->bandNR_r15->present = LTE_MeasObjectNR_r15__ext1__bandNR_r15_PR_setup;
|
||||
MeasObj2->measObject.choice.measObjectNR_r15.ext1->bandNR_r15->choice.setup = 78;
|
||||
|
||||
ASN_SEQUENCE_ADD(&MeasObj_list->list, MeasObj2);
|
||||
}
|
||||
|
||||
if (!ue_context_pP->ue_context.measurement_info->events) {
|
||||
ue_context_pP->ue_context.measurement_info->events = CALLOC(1,sizeof(*(ue_context_pP->ue_context.measurement_info->events)));
|
||||
}
|
||||
@@ -3155,6 +3237,9 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
ReportConfig_A3 = CALLOC(1, sizeof(*ReportConfig_A3));
|
||||
ReportConfig_A4 = CALLOC(1, sizeof(*ReportConfig_A4));
|
||||
ReportConfig_A5 = CALLOC(1, sizeof(*ReportConfig_A5));
|
||||
if (ue_context_pP->ue_context.does_nr) {
|
||||
ReportConfig_NR = CALLOC(1, sizeof(*ReportConfig_NR));
|
||||
}
|
||||
ReportConfig_per->reportConfigId = 1;
|
||||
ReportConfig_per->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA;
|
||||
ReportConfig_per->reportConfig.choice.reportConfigEUTRA.triggerType.present =
|
||||
@@ -3260,6 +3345,30 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportInterval = LTE_ReportInterval_ms120;
|
||||
ReportConfig_A5->reportConfig.choice.reportConfigEUTRA.reportAmount = LTE_ReportConfigEUTRA__reportAmount_infinity;
|
||||
ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A5);
|
||||
|
||||
if (ue_context_pP->ue_context.does_nr) {
|
||||
ReportConfig_NR->reportConfigId = 7;
|
||||
ReportConfig_NR->reportConfig.present = LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigInterRAT;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.triggerType.present = LTE_ReportConfigInterRAT__triggerType_PR_event;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.eventId.present = LTE_ReportConfigInterRAT__triggerType__event__eventId_PR_eventB1_NR_r15;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.eventId.choice.eventB1_NR_r15.b1_ThresholdNR_r15.present = LTE_ThresholdNR_r15_PR_nr_RSRP_r15;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.eventId.choice.eventB1_NR_r15.b1_ThresholdNR_r15.choice.nr_RSRP_r15 = 46;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.eventId.choice.eventB1_NR_r15.reportOnLeave_r15 = FALSE;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.hysteresis = 2;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.timeToTrigger = LTE_TimeToTrigger_ms80;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.maxReportCells = 4;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.reportInterval = LTE_ReportInterval_ms120;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.reportAmount = LTE_ReportConfigInterRAT__reportAmount_infinity;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7 = calloc(1, sizeof(struct LTE_ReportConfigInterRAT__ext7));
|
||||
if (ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7 == NULL) exit(1);
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15 = calloc(1, sizeof(struct LTE_ReportQuantityNR_r15));
|
||||
if (ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15 == NULL) exit(1);
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15->ss_rsrp = TRUE;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15->ss_rsrq = TRUE;
|
||||
ReportConfig_NR->reportConfig.choice.reportConfigInterRAT.ext7->reportQuantityCellNR_r15->ss_sinr = TRUE;
|
||||
ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_NR);
|
||||
}
|
||||
|
||||
// LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->reportConfigToAddModList = ReportConfig_list;
|
||||
|
||||
/* A3 event update */
|
||||
@@ -4230,6 +4339,10 @@ rrc_eNB_process_MeasurementReport(
|
||||
ctxt_pP->subframe);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
LOG_D(RRC, "NR event frame %d subframe %d\n", ctxt_pP->frame, ctxt_pP->subframe);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_D(RRC,"Other event report frame %d and subframe %d \n", ctxt_pP->frame, ctxt_pP->subframe);
|
||||
break;
|
||||
@@ -4243,6 +4356,22 @@ rrc_eNB_process_MeasurementReport(
|
||||
ue_context_pP->ue_context.measResults->measResultPCell.rsrqResult/2 - 20);
|
||||
}
|
||||
|
||||
/* TODO: improve NR triggering */
|
||||
if (measResults2->measId == 7) {
|
||||
if (ue_context_pP->ue_context.Status != RRC_NR_NSA) {
|
||||
MessageDef *msg;
|
||||
ue_context_pP->ue_context.Status = RRC_NR_NSA;
|
||||
|
||||
msg = itti_alloc_new_message(TASK_RRC_ENB, X2AP_ENDC_SGNB_ADDITION_REQ);
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).rnti = ctxt_pP->rnti;
|
||||
LOG_I(RRC,
|
||||
"[eNB %d] frame %d subframe %d: UE rnti %x switching to NSA mode\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->subframe, ctxt_pP->rnti);
|
||||
itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (measResults2->measResultNeighCells == NULL)
|
||||
return;
|
||||
|
||||
@@ -6298,6 +6427,16 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
free(DRB_Release_configList2);
|
||||
ue_context_pP->ue_context.DRB_Release_configList2[xid] = NULL;
|
||||
}
|
||||
|
||||
/* let's request NR capabilities if the UE supports NR
|
||||
* maybe not the right place/time to request
|
||||
*/
|
||||
if (ue_context_pP->ue_context.does_nr &&
|
||||
!ue_context_pP->ue_context.nr_capabilities_requested) {
|
||||
ue_context_pP->ue_context.nr_capabilities_requested = 1;
|
||||
rrc_eNB_generate_NR_UECapabilityEnquiry(ctxt_pP, ue_context_pP);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -7116,6 +7255,48 @@ rrc_eNB_decode_ccch(
|
||||
return rval;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static int
|
||||
is_en_dc_supported(
|
||||
LTE_UE_EUTRA_Capability_t *c
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
/* to be refined - check that the eNB is connected to a gNB, check that
|
||||
* the bands supported by the UE include the band of the gNB
|
||||
*/
|
||||
#define NCE nonCriticalExtension
|
||||
return c != NULL
|
||||
&& c->NCE != NULL
|
||||
&& c->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->irat_ParametersNR_r15 != NULL
|
||||
&& c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->irat_ParametersNR_r15->en_DC_r15 != NULL
|
||||
&& *c->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->NCE->irat_ParametersNR_r15->en_DC_r15 == LTE_IRAT_ParametersNR_r15__en_DC_r15_supported;
|
||||
#undef NCE
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
rrc_eNB_decode_dcch(
|
||||
@@ -7645,6 +7826,22 @@ rrc_eNB_decode_dcch(
|
||||
|
||||
LOG_I(RRC, "got UE capabilities for UE %x\n", ctxt_pP->rnti);
|
||||
|
||||
int eutra_index = -1;
|
||||
|
||||
for (i = 0; i < ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.count; i++) {
|
||||
if (ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.array[i]->rat_Type == LTE_RAT_Type_eutra) {
|
||||
if (eutra_index != -1) {
|
||||
LOG_E(RRC, "fatal: more than 1 eutra capability\n");
|
||||
exit(1);
|
||||
}
|
||||
eutra_index = i;
|
||||
}
|
||||
}
|
||||
|
||||
/* do nothing if no EUTRA capabilities (TODO: may be NR capabilities, to be processed somehow) */
|
||||
if (eutra_index == -1)
|
||||
break;
|
||||
|
||||
if (ue_context_p->ue_context.UE_Capability) {
|
||||
LOG_I(RRC, "freeing old UE capabilities for UE %x\n", ctxt_pP->rnti);
|
||||
ASN_STRUCT_FREE(asn_DEF_LTE_UE_EUTRA_Capability,
|
||||
@@ -7655,15 +7852,10 @@ rrc_eNB_decode_dcch(
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_LTE_UE_EUTRA_Capability,
|
||||
(void **)&ue_context_p->ue_context.UE_Capability,
|
||||
ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.
|
||||
choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.
|
||||
array[0]->ueCapabilityRAT_Container.buf,
|
||||
ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.
|
||||
choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.
|
||||
array[0]->ueCapabilityRAT_Container.size, 0, 0);
|
||||
ue_context_p->ue_context.UE_Capability_size = ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.
|
||||
choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.
|
||||
array[0]->ueCapabilityRAT_Container.size;
|
||||
ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.array[eutra_index]->ueCapabilityRAT_Container.buf,
|
||||
ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.array[eutra_index]->ueCapabilityRAT_Container.size,
|
||||
0, 0);
|
||||
ue_context_p->ue_context.UE_Capability_size = ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.array[eutra_index]->ueCapabilityRAT_Container.size;
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_LTE_UE_EUTRA_Capability, ue_context_p->ue_context.UE_Capability);
|
||||
@@ -7678,6 +7870,9 @@ rrc_eNB_decode_dcch(
|
||||
ue_context_p->ue_context.UE_Capability = 0;
|
||||
}
|
||||
|
||||
if (dec_rval.code == RC_OK)
|
||||
ue_context_p->ue_context.does_nr = is_en_dc_supported(ue_context_p->ue_context.UE_Capability);
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(ctxt_pP,
|
||||
ue_context_p,
|
||||
@@ -8241,6 +8436,100 @@ void rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX, VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
void rrc_eNB_process_AdditionResponseInformation(const module_id_t enb_mod_idP, x2ap_ENDC_sgnb_addition_req_ACK_t *m) {
|
||||
|
||||
|
||||
NR_CG_Config_t *CG_Config = NULL;
|
||||
|
||||
{
|
||||
int i;
|
||||
printf("%d: ", m->rrc_buffer_size);
|
||||
for (i=0; i<m->rrc_buffer_size; i++) printf("%2.2x", (unsigned char)m->rrc_buffer[i]);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_CG_Config,
|
||||
(void **)&CG_Config,
|
||||
(uint8_t *)m->rrc_buffer,
|
||||
(int) m->rrc_buffer_size);//m->rrc_buffer_size);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_CG_Config, CG_Config, 1 );
|
||||
return;
|
||||
}
|
||||
xer_fprint(stdout,&asn_DEF_NR_CG_Config, CG_Config);
|
||||
// recreate enough of X2 EN-DC Container
|
||||
|
||||
AssertFatal(CG_Config->criticalExtensions.choice.c1->present == NR_CG_Config__criticalExtensions__c1_PR_cg_Config,
|
||||
"CG_Config not present\n");
|
||||
|
||||
OCTET_STRING_t *scg_CellGroupConfig = NULL;
|
||||
OCTET_STRING_t *nr1_conf = NULL;
|
||||
|
||||
if(CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig){
|
||||
scg_CellGroupConfig = CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig;
|
||||
#ifdef DEBUG_SCG_CONFIG
|
||||
{
|
||||
int size_s = CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig->size;
|
||||
int i;
|
||||
LOG_I(RRC, "Dumping scg_CellGroupConfig: %d", size_s);
|
||||
for (i=0; i<size_s; i++) printf("%2.2x", (unsigned char)CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig->buf[i]);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else{
|
||||
LOG_W(RRC, "SCG Cell group configuration is not present in the Addition Response message \n");
|
||||
return;
|
||||
}
|
||||
if(CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config){
|
||||
nr1_conf = CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config;
|
||||
#ifdef DEBUG_SCG_CONFIG
|
||||
{
|
||||
int size_s = CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config->size;
|
||||
int i;
|
||||
LOG_I(RRC, "Dumping scg_RB_Config: %d", size_s);
|
||||
for (i=0; i<size_s; i++) printf("%2.2x", (unsigned char)CG_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config->buf[i]);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else{
|
||||
LOG_W(RRC, "SCG RB configuration is not present in the Addition Response message \n");
|
||||
return;
|
||||
}
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
rrc_eNB_ue_context_t *ue_context;
|
||||
unsigned char buffer[8192];
|
||||
int size;
|
||||
|
||||
ue_context = rrc_eNB_get_ue_context(RC.rrc[enb_mod_idP], m->rnti);
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
|
||||
0,
|
||||
ENB_FLAG_YES,
|
||||
m->rnti,
|
||||
0, 0);
|
||||
|
||||
size = rrc_eNB_generate_RRCConnectionReconfiguration_endc(&ctxt, ue_context, buffer, 8192, scg_CellGroupConfig, nr1_conf);
|
||||
|
||||
rrc_data_req(&ctxt,
|
||||
DCCH,
|
||||
rrc_eNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void *rrc_enb_process_itti_msg(void *notUsed) {
|
||||
MessageDef *msg_p;
|
||||
@@ -8519,6 +8808,12 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
|
||||
break;
|
||||
}
|
||||
|
||||
case X2AP_ENDC_SGNB_ADDITION_REQ_ACK: {
|
||||
rrc_eNB_process_AdditionResponseInformation(ENB_INSTANCE_TO_MODULE_ID(instance), &X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg_p));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Messages from eNB app */
|
||||
case RRC_CONFIGURATION_REQ:
|
||||
LOG_I(RRC, "[eNB %d] Received %s : %p\n", instance, msg_name_p, &RRC_CONFIGURATION_REQ(msg_p));
|
||||
@@ -8590,24 +8885,29 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
|
||||
}
|
||||
|
||||
// as there are race conditions, no rrc thread
|
||||
#if 0
|
||||
//-----------------------------------------------------------------------------
|
||||
void *
|
||||
rrc_enb_task(
|
||||
rrc_enb_process_msg(
|
||||
void *args_p
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
rrc_enb_init();
|
||||
itti_mark_task_ready(TASK_RRC_ENB);
|
||||
LOG_I(RRC,"Entering main loop of RRC message task\n");
|
||||
//rrc_enb_init(); called once in place of thread startup
|
||||
|
||||
//itti_mark_task_ready(TASK_RRC_ENB);
|
||||
//LOG_I(RRC,"Entering main loop of RRC message task\n");
|
||||
|
||||
|
||||
//while (1) {
|
||||
//(void) rrc_enb_process_itti_msg(NULL);
|
||||
(void) rrc_enb_process_itti_msg(NULL);
|
||||
{
|
||||
//extern volatile int go_nr;
|
||||
void rrc_go_nr(void);
|
||||
//if (go_nr) rrc_go_nr();
|
||||
}
|
||||
//}
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "rrc_defs.h"
|
||||
#include "rrc_extern.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "LTE_DL-DCCH-Message.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern mui_t rrc_eNB_mui;
|
||||
|
||||
int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt,
|
||||
rrc_eNB_ue_context_t *ue_context,
|
||||
unsigned char *buffer,
|
||||
int buffer_size,
|
||||
OCTET_STRING_t *scg_group_config,
|
||||
OCTET_STRING_t *scg_RB_config)
|
||||
{
|
||||
asn_enc_rval_t enc_rval;
|
||||
LTE_DL_DCCH_Message_t dl_dcch_msg;
|
||||
LTE_RRCConnectionReconfiguration_t *r;
|
||||
int trans_id;
|
||||
LTE_RadioResourceConfigDedicated_t rrcd;
|
||||
#if 0
|
||||
LTE_DRB_ToAddModList_t drb_list;
|
||||
struct LTE_DRB_ToAddMod drb;
|
||||
long eps_bearer_id;
|
||||
struct LTE_RLC_Config rlc;
|
||||
long lcid;
|
||||
struct LTE_LogicalChannelConfig lc;
|
||||
#endif
|
||||
LTE_DRB_ToReleaseList_t drb_list;
|
||||
LTE_DRB_Identity_t drb;
|
||||
struct LTE_LogicalChannelConfig__ul_SpecificParameters ul_params;
|
||||
long lcg;
|
||||
struct LTE_RadioResourceConfigDedicated__mac_MainConfig mac;
|
||||
struct LTE_MAC_MainConfig__ext4 mac_ext4;
|
||||
struct LTE_MAC_MainConfig__ext4__dualConnectivityPHR dc_phr;
|
||||
|
||||
memset(&rrcd, 0, sizeof(rrcd));
|
||||
memset(&drb_list, 0, sizeof(drb_list));
|
||||
memset(&drb, 0, sizeof(drb));
|
||||
#if 0
|
||||
memset(&rlc, 0, sizeof(rlc));
|
||||
memset(&lc, 0, sizeof(lc));
|
||||
#endif
|
||||
memset(&ul_params, 0, sizeof(ul_params));
|
||||
memset(&mac, 0, sizeof(mac));
|
||||
memset(&mac_ext4, 0, sizeof(mac_ext4));
|
||||
memset(&dc_phr, 0, sizeof(dc_phr));
|
||||
|
||||
trans_id = rrc_eNB_get_next_transaction_identifier(ctxt->module_id);
|
||||
|
||||
memset(&dl_dcch_msg,0,sizeof(LTE_DL_DCCH_Message_t));
|
||||
|
||||
dl_dcch_msg.message.present = LTE_DL_DCCH_MessageType_PR_c1;
|
||||
dl_dcch_msg.message.choice.c1.present = LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration;
|
||||
|
||||
r = &dl_dcch_msg.message.choice.c1.choice.rrcConnectionReconfiguration;
|
||||
|
||||
r->rrc_TransactionIdentifier = trans_id;
|
||||
r->criticalExtensions.present = LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1;
|
||||
r->criticalExtensions.choice.c1.present = LTE_RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8;
|
||||
r->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated = &rrcd;
|
||||
|
||||
#if 0
|
||||
rrcd.drb_ToAddModList = &drb_list;
|
||||
|
||||
eps_bearer_id = 5;
|
||||
drb.eps_BearerIdentity = &eps_bearer_id;
|
||||
drb.drb_Identity = 5;
|
||||
drb.rlc_Config = &rlc;
|
||||
lcid = 4;
|
||||
drb.logicalChannelIdentity = &lcid;
|
||||
drb.logicalChannelConfig = &lc;
|
||||
|
||||
ASN_SEQUENCE_ADD(&drb_list.list, &drb);
|
||||
|
||||
rlc.present = LTE_RLC_Config_PR_am;
|
||||
rlc.choice.am.ul_AM_RLC.t_PollRetransmit = LTE_T_PollRetransmit_ms50;
|
||||
rlc.choice.am.ul_AM_RLC.pollPDU = LTE_PollPDU_p16;
|
||||
rlc.choice.am.ul_AM_RLC.pollByte = LTE_PollByte_kBinfinity;
|
||||
rlc.choice.am.ul_AM_RLC.maxRetxThreshold = LTE_UL_AM_RLC__maxRetxThreshold_t8;
|
||||
rlc.choice.am.dl_AM_RLC.t_Reordering = LTE_T_Reordering_ms35;
|
||||
rlc.choice.am.dl_AM_RLC.t_StatusProhibit = LTE_T_StatusProhibit_ms25;
|
||||
|
||||
lc.ul_SpecificParameters = &ul_params;
|
||||
#endif
|
||||
|
||||
/* release drb 1 */
|
||||
drb = 1;
|
||||
ASN_SEQUENCE_ADD(&drb_list.list, &drb);
|
||||
rrcd.drb_ToReleaseList = &drb_list;
|
||||
|
||||
ul_params.priority = 12;
|
||||
ul_params.prioritisedBitRate = LTE_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8;
|
||||
ul_params.bucketSizeDuration = LTE_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms300;
|
||||
lcg = 3;
|
||||
ul_params.logicalChannelGroup = &lcg;
|
||||
|
||||
rrcd.mac_MainConfig = &mac;
|
||||
|
||||
mac.present = LTE_RadioResourceConfigDedicated__mac_MainConfig_PR_explicitValue;
|
||||
mac.choice.explicitValue.timeAlignmentTimerDedicated = LTE_TimeAlignmentTimer_sf10240;
|
||||
mac.choice.explicitValue.ext4 = &mac_ext4;
|
||||
|
||||
mac_ext4.dualConnectivityPHR = &dc_phr;
|
||||
|
||||
dc_phr.present = LTE_MAC_MainConfig__ext4__dualConnectivityPHR_PR_setup;
|
||||
dc_phr.choice.setup.phr_ModeOtherCG_r12 = LTE_MAC_MainConfig__ext4__dualConnectivityPHR__setup__phr_ModeOtherCG_r12_virtual;
|
||||
|
||||
/* NR config */
|
||||
struct LTE_RRCConnectionReconfiguration_v890_IEs cr_890;
|
||||
struct LTE_RRCConnectionReconfiguration_v920_IEs cr_920;
|
||||
struct LTE_RRCConnectionReconfiguration_v1020_IEs cr_1020;
|
||||
struct LTE_RRCConnectionReconfiguration_v1130_IEs cr_1130;
|
||||
struct LTE_RRCConnectionReconfiguration_v1250_IEs cr_1250;
|
||||
struct LTE_RRCConnectionReconfiguration_v1310_IEs cr_1310;
|
||||
struct LTE_RRCConnectionReconfiguration_v1430_IEs cr_1430;
|
||||
struct LTE_RRCConnectionReconfiguration_v1510_IEs cr_1510;
|
||||
struct LTE_RRCConnectionReconfiguration_v1510_IEs__nr_Config_r15 nr;
|
||||
|
||||
memset(&cr_890, 0, sizeof(cr_890));
|
||||
memset(&cr_920, 0, sizeof(cr_920));
|
||||
memset(&cr_1020, 0, sizeof(cr_1020));
|
||||
memset(&cr_1130, 0, sizeof(cr_1130));
|
||||
memset(&cr_1250, 0, sizeof(cr_1250));
|
||||
memset(&cr_1310, 0, sizeof(cr_1310));
|
||||
memset(&cr_1430, 0, sizeof(cr_1430));
|
||||
memset(&cr_1510, 0, sizeof(cr_1510));
|
||||
memset(&nr, 0, sizeof(nr));
|
||||
|
||||
r->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.nonCriticalExtension = &cr_890;
|
||||
cr_890.nonCriticalExtension = &cr_920;
|
||||
cr_920.nonCriticalExtension = &cr_1020;
|
||||
cr_1020.nonCriticalExtension = &cr_1130;
|
||||
cr_1130.nonCriticalExtension = &cr_1250;
|
||||
cr_1250.nonCriticalExtension = &cr_1310;
|
||||
cr_1310.nonCriticalExtension = &cr_1430;
|
||||
cr_1430.nonCriticalExtension = &cr_1510;
|
||||
|
||||
cr_1510.nr_Config_r15 = &nr;
|
||||
nr.present = LTE_RRCConnectionReconfiguration_v1510_IEs__nr_Config_r15_PR_setup;
|
||||
nr.choice.setup.endc_ReleaseAndAdd_r15 = 0; /* FALSE */
|
||||
|
||||
OCTET_STRING_t dummy_scg_conf;
|
||||
unsigned char scg_conf_buf[4] = { 0, 0, 0, 0 };
|
||||
if (scg_group_config!=NULL)
|
||||
nr.choice.setup.nr_SecondaryCellGroupConfig_r15 = scg_group_config; //&scg_conf;
|
||||
else{
|
||||
nr.choice.setup.nr_SecondaryCellGroupConfig_r15 = &dummy_scg_conf;
|
||||
dummy_scg_conf.buf = scg_conf_buf;
|
||||
dummy_scg_conf.size = 4;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SCG_CONFIG
|
||||
{
|
||||
int size_s = nr.choice.setup.nr_SecondaryCellGroupConfig_r15->size;
|
||||
int i;
|
||||
LOG_I(RRC, "Dumping nr_SecondaryCellGroupConfig: %d", size_s);
|
||||
for (i=0; i<size_s; i++) printf("%2.2x", (unsigned char)nr.choice.setup.nr_SecondaryCellGroupConfig_r15->buf[i]);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
long sk_counter = 0;
|
||||
cr_1510.sk_Counter_r15 = &sk_counter;
|
||||
|
||||
OCTET_STRING_t dummy_nr1_conf;
|
||||
unsigned char nr1_buf[4] = { 0, 0, 0, 0 };
|
||||
|
||||
if(scg_RB_config!=NULL)
|
||||
cr_1510.nr_RadioBearerConfig1_r15 = scg_RB_config;
|
||||
else{
|
||||
cr_1510.nr_RadioBearerConfig1_r15 = &dummy_nr1_conf;
|
||||
dummy_nr1_conf.buf = nr1_buf;
|
||||
dummy_nr1_conf.size = 4;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SCG_CONFIG
|
||||
{
|
||||
int size_s = cr_1510.nr_RadioBearerConfig1_r15->size;
|
||||
int i;
|
||||
LOG_I(RRC, "Dumping nr_RadioBearerConfig1: %d", size_s);
|
||||
for (i=0; i<size_s; i++) printf("%2.2x", (unsigned char)cr_1510.nr_RadioBearerConfig1_r15->buf[i]);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
OCTET_STRING_t nr2_conf;
|
||||
unsigned char nr2_buf[4] = { 0, 0, 0, 0 };
|
||||
cr_1510.nr_RadioBearerConfig2_r15 = &nr2_conf;
|
||||
nr2_conf.buf = nr2_buf;
|
||||
nr2_conf.size = 4;
|
||||
#endif
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_DL_DCCH_Message,
|
||||
NULL,
|
||||
(void *)&dl_dcch_msg,
|
||||
buffer,
|
||||
buffer_size);
|
||||
|
||||
{
|
||||
int len = (enc_rval.encoded + 7) / 8;
|
||||
int i;
|
||||
printf("len = %d\n", len);
|
||||
for (i = 0; i < len; i++) printf(" %2.2x", buffer[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
return (enc_rval.encoded + 7) / 8;
|
||||
}
|
||||
@@ -584,6 +584,12 @@ rrc_eNB_generate_UECapabilityEnquiry(
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_NR_UECapabilityEnquiry(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_SecurityModeCommand(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
@@ -64,7 +64,7 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
NR_BCCH_BCH_Message_t *mib;
|
||||
|
||||
rrc = RC.nrrrc[Mod_idP];
|
||||
carrier = &rrc->carrier[0];
|
||||
carrier = &rrc->carrier;
|
||||
mib = &carrier->mib;
|
||||
|
||||
if( (Srb_id & RAB_OFFSET ) == MIBCH) {
|
||||
|
||||
@@ -129,16 +129,6 @@ extern unsigned char NB_gNB_INST;
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
uint16_t two_tier_hexagonal_nr_cellIds[7] = {0,1,2,4,5,7,8};
|
||||
uint16_t two_tier_hexagonal_adjacent_nr_cellIds[7][6] = {{1,2,4,5,7,8}, // CellId 0
|
||||
{11,18,2,0,8,15}, // CellId 1
|
||||
{18,13,3,4,0,1}, // CellId 2
|
||||
{2,3,14,6,5,0}, // CellId 4
|
||||
{0,4,6,16,9,7}, // CellId 5
|
||||
{8,0,5,9,17,12}, // CellId 7
|
||||
{15,1,0,7,12,10}
|
||||
};// CellId 8
|
||||
|
||||
/*
|
||||
* This is a helper function for xer_sprint, which directs all incoming data
|
||||
* into the provided string.
|
||||
@@ -180,34 +170,16 @@ int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td,
|
||||
return er.encoded;
|
||||
}
|
||||
|
||||
uint16_t get_adjacent_cell_id_NR(uint8_t Mod_id,uint8_t index) {
|
||||
return(two_tier_hexagonal_adjacent_nr_cellIds[Mod_id][index]);
|
||||
}
|
||||
/* This only works for the hexagonal topology...need a more general function for other topologies */
|
||||
|
||||
uint8_t get_adjacent_cell_mod_id_NR(uint16_t phyCellId) {
|
||||
uint8_t i;
|
||||
|
||||
for(i=0; i<7; i++) {
|
||||
if(two_tier_hexagonal_nr_cellIds[i] == phyCellId) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_E(RRC,"\nCannot get adjacent cell mod id! Fatal error!\n");
|
||||
return 0xFF; //error!
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
uint32_t frame,
|
||||
uint32_t ssb_SubcarrierOffset,
|
||||
uint32_t pdcch_ConfigSIB1,
|
||||
uint32_t subCarrierSpacingCommon,
|
||||
uint32_t dmrs_TypeA_Position) {
|
||||
uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
rrc_gNB_carrier_data_t *carrier = &rrc->carrier;
|
||||
|
||||
NR_BCCH_BCH_Message_t *mib = &carrier->mib;
|
||||
NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
|
||||
|
||||
memset(mib,0,sizeof(NR_BCCH_BCH_Message_t));
|
||||
mib->message.present = NR_BCCH_BCH_MessageType_PR_mib;
|
||||
mib->message.choice.mib = CALLOC(1,sizeof(struct NR_MIB));
|
||||
@@ -226,44 +198,47 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
mib->message.choice.mib->spare.buf = (uint8_t *)spare;
|
||||
mib->message.choice.mib->spare.size = 1;
|
||||
mib->message.choice.mib->spare.bits_unused = 7; // This makes a spare of 1 bits
|
||||
mib->message.choice.mib->ssb_SubcarrierOffset = ssb_SubcarrierOffset;
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero = (pdcch_ConfigSIB1 / 16);
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero = (pdcch_ConfigSIB1 % 16);
|
||||
|
||||
switch (subCarrierSpacingCommon) {
|
||||
case 15:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60;
|
||||
break;
|
||||
|
||||
case 30:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120;
|
||||
break;
|
||||
|
||||
case 60:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60;
|
||||
break;
|
||||
|
||||
case 120:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0, "Unknown subCarrierSpacingCommon %u\n", subCarrierSpacingCommon);
|
||||
mib->message.choice.mib->ssb_SubcarrierOffset = (carrier->ssb_SubcarrierOffset)&15;
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero;
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero;
|
||||
AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n");
|
||||
switch (*scc->ssbSubcarrierSpacing) {
|
||||
case NR_SubcarrierSpacing_kHz15:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz30:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz60:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz120:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz240:
|
||||
AssertFatal(1==0,"Unknown subCarrierSpacingCommon %d\n",(int)*scc->ssbSubcarrierSpacing);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Unknown subCarrierSpacingCommon %d\n",(int)*scc->ssbSubcarrierSpacing);
|
||||
}
|
||||
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = 1;
|
||||
|
||||
switch (dmrs_TypeA_Position) {
|
||||
case 2:
|
||||
mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos2;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos3;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0, "Unknown dmrs_TypeA_Position %u\n", dmrs_TypeA_Position);
|
||||
switch (scc->dmrs_TypeA_Position) {
|
||||
case NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2:
|
||||
mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos2;
|
||||
break;
|
||||
|
||||
case NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos3:
|
||||
mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos3;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Unknown dmrs_TypeA_Position %d\n",(int)scc->dmrs_TypeA_Position);
|
||||
}
|
||||
|
||||
// assign_enum
|
||||
@@ -286,7 +261,6 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
|
||||
uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
gNB_RrcConfigurationReq *configuration
|
||||
) {
|
||||
@@ -382,519 +356,6 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
}
|
||||
|
||||
|
||||
void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
gNB_RrcConfigurationReq *configuration,
|
||||
int initial_flag
|
||||
) {
|
||||
NR_ServingCellConfigCommon_t **servingcellconfigcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon;
|
||||
NR_FreqBandIndicatorNR_t *dl_frequencyBandList;
|
||||
NR_SCS_SpecificCarrier_t *dl_scs_SpecificCarrierList;
|
||||
NR_TCI_StateId_t *TCI_StateId;
|
||||
NR_ControlResourceSet_t *bwp_dl_controlresourceset;
|
||||
NR_SearchSpace_t *bwp_dl_searchspace;
|
||||
NR_PDSCH_TimeDomainResourceAllocation_t *bwp_dl_timedomainresourceallocation;
|
||||
NR_FreqBandIndicatorNR_t *ul_frequencyBandList;
|
||||
NR_SCS_SpecificCarrier_t *ul_scs_SpecificCarrierList;
|
||||
NR_PUSCH_TimeDomainResourceAllocation_t *pusch_configcommontimedomainresourceallocation;
|
||||
NR_RateMatchPattern_t *ratematchpattern;
|
||||
NR_RateMatchPatternId_t *ratematchpatternid;
|
||||
dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t));
|
||||
ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t));
|
||||
dl_scs_SpecificCarrierList = CALLOC(1,sizeof(NR_SCS_SpecificCarrier_t));
|
||||
ul_scs_SpecificCarrierList = CALLOC(1,sizeof(NR_SCS_SpecificCarrier_t));
|
||||
TCI_StateId = CALLOC(1,sizeof(NR_TCI_StateId_t));
|
||||
bwp_dl_searchspace = CALLOC(1,sizeof(NR_SearchSpace_t));
|
||||
bwp_dl_timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
|
||||
pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(NR_PUSCH_TimeDomainResourceAllocation_t));
|
||||
ratematchpattern = CALLOC(1,sizeof(NR_RateMatchPattern_t));
|
||||
ratematchpatternid = CALLOC(1,sizeof(NR_RateMatchPatternId_t));
|
||||
|
||||
if(initial_flag == 1) {
|
||||
(*servingcellconfigcommon) = CALLOC(1,sizeof(NR_ServingCellConfigCommon_t));
|
||||
(*servingcellconfigcommon)->physCellId = CALLOC(1,sizeof(NR_PhysCellId_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon = CALLOC(1,sizeof(struct NR_DownlinkConfigCommon));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL = CALLOC(1,sizeof(struct NR_FrequencyInfoDL));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP = CALLOC(1,sizeof(struct NR_BWP_DownlinkCommon));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon = CALLOC(1,sizeof(struct NR_UplinkConfigCommon));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL = CALLOC(1,sizeof(struct NR_FrequencyInfoUL));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP = CALLOC(1,sizeof(struct NR_BWP_UplinkCommon));
|
||||
//(*servingcellconfigcommon)->supplementaryUplinkConfig = CALLOC(1,sizeof(struct NR_UplinkConfigCommon));
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__ssb_PositionsInBurst));
|
||||
(*servingcellconfigcommon)->ssb_periodicityServingCell = CALLOC(1,sizeof(long));
|
||||
//(*servingcellconfigcommon)->lte_CRS_ToMatchAround = CALLOC(1,sizeof(struct NR_SetupRelease_RateMatchPatternLTE_CRS));
|
||||
(*servingcellconfigcommon)->rateMatchPatternToAddModList = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToAddModList));
|
||||
(*servingcellconfigcommon)->rateMatchPatternToReleaseList = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToReleaseList));
|
||||
(*servingcellconfigcommon)->ssbSubcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
|
||||
(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDCCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = CALLOC(1,sizeof(NR_ControlResourceSet_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList = CALLOC(1,
|
||||
sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->pagingSearchSpace = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_SearchSpace = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDSCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList = CALLOC(1,
|
||||
sizeof(struct NR_PDSCH_TimeDomainResourceAllocationList));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(NR_MultiFrequencyBandListNR_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->additionalSpectrumEmission = CALLOC(1,sizeof(NR_AdditionalSpectrumEmission_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->p_Max = CALLOC(1,sizeof(NR_P_Max_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyShift7p5khz = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_RACH_ConfigCommon_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_RACH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB = CALLOC(1,
|
||||
sizeof(struct NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured = CALLOC(1,
|
||||
sizeof(struct NR_RACH_ConfigCommon__groupBconfigured));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB = CALLOC(1,sizeof(NR_RSRP_Range_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB_SUL = CALLOC(1,sizeof(NR_RSRP_Range_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_PUSCH_ConfigCommon_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList = CALLOC(1,sizeof(NR_PUSCH_TimeDomainResourceAllocationList_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PUCCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUCCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon = CALLOC(1,sizeof(BIT_STRING_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf = MALLOC(1);
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf = MALLOC(1);
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf = MALLOC(8);
|
||||
bwp_dl_controlresourceset =(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet;
|
||||
bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved = CALLOC(1,sizeof(struct NR_ControlResourceSet__cce_REG_MappingType__interleaved));
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.buf = MALLOC(6);
|
||||
bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved->shiftIndex = CALLOC(1,sizeof(long));
|
||||
bwp_dl_controlresourceset->tci_StatesPDCCH_ToAddList = CALLOC(1,sizeof(struct NR_ControlResourceSet__tci_StatesPDCCH_ToAddList));
|
||||
bwp_dl_controlresourceset->tci_PresentInDCI = CALLOC(1,sizeof(long));
|
||||
bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->controlResourceSetId = CALLOC(1,sizeof(NR_ControlResourceSetId_t));
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset = CALLOC(1,sizeof(struct NR_SearchSpace__monitoringSlotPeriodicityAndOffset));
|
||||
bwp_dl_searchspace->duration = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->monitoringSymbolsWithinSlot = CALLOC(1,sizeof(BIT_STRING_t));
|
||||
bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf = MALLOC(2);
|
||||
bwp_dl_searchspace->nrofCandidates = CALLOC(1,sizeof(struct NR_SearchSpace__nrofCandidates));
|
||||
bwp_dl_searchspace->searchSpaceType = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType));
|
||||
bwp_dl_timedomainresourceallocation->k0 = CALLOC(1,sizeof(long));
|
||||
pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(NR_PUSCH_TimeDomainResourceAllocation_t));
|
||||
pusch_configcommontimedomainresourceallocation->k2 = CALLOC(1,sizeof(long));
|
||||
ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps));
|
||||
ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35);
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf = MALLOC(2);
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf = MALLOC(4);
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern));
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.buf = MALLOC(1);
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.buf = MALLOC(1);
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.buf = MALLOC(1);
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.buf = MALLOC(1);
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf = MALLOC(2);
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf = MALLOC(3);
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf = MALLOC(5);
|
||||
ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
|
||||
} else {
|
||||
bwp_dl_controlresourceset =(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet;
|
||||
}
|
||||
|
||||
//------------------------------------Start Fill ServingCellConfigCommon------------------------------------//
|
||||
//physCellId
|
||||
*((*servingcellconfigcommon)->physCellId) = configuration->Nid_cell[CC_id];
|
||||
//NR_DownlinkConfigCommon
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB) = configuration->absoluteFrequencySSB[CC_id];
|
||||
*(dl_frequencyBandList) = configuration->DL_FreqBandIndicatorNR[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list,&dl_frequencyBandList);
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA = configuration->DL_absoluteFrequencyPointA[CC_id];
|
||||
dl_scs_SpecificCarrierList->offsetToCarrier = configuration->DL_offsetToCarrier[CC_id];
|
||||
dl_scs_SpecificCarrierList->subcarrierSpacing = configuration->DL_SCS_SubcarrierSpacing[CC_id];
|
||||
dl_scs_SpecificCarrierList->carrierBandwidth = configuration->DL_carrierBandwidth[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list,&dl_scs_SpecificCarrierList);
|
||||
//initialDownlinkBWP
|
||||
//initialDownlinkBWP ----- genericParameters
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth = configuration->DL_locationAndBandwidth[CC_id];
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing = configuration->DL_BWP_SubcarrierSpacing[CC_id];
|
||||
|
||||
if(configuration->DL_BWP_prefix_type[CC_id]) {
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix = NR_BWP__cyclicPrefix_extended;
|
||||
}
|
||||
|
||||
//initialDownlinkBWP ----- pdcch_ConfigCommon
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->present = NR_SetupRelease_PDCCH_ConfigCommon_PR_setup;
|
||||
//Fill initialDownlinkBWP -> pdcch_ConfigCommon -> ControlResourceSet list //
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero) = configuration->controlResourceSetZero[CC_id];
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero) = configuration->searchSpaceZero[CC_id];
|
||||
bwp_dl_controlresourceset->controlResourceSetId = configuration->PDCCH_common_controlResourceSetId[CC_id];
|
||||
//BIT STRING (SIZE (45))
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.size = 6;
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.bits_unused = 3;
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.buf[0] = 0x1f;
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.buf[1] = 0xff;
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.buf[2] = 0xff;
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.buf[3] = 0xff;
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.buf[4] = 0xff;
|
||||
bwp_dl_controlresourceset->frequencyDomainResources.buf[5] = 0xff;
|
||||
bwp_dl_controlresourceset->duration = configuration->PDCCH_common_ControlResourceSet_duration[CC_id];
|
||||
bwp_dl_controlresourceset->cce_REG_MappingType.present = configuration->PDCCH_cce_REG_MappingType[CC_id];
|
||||
|
||||
if(bwp_dl_controlresourceset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved ) {
|
||||
bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved->reg_BundleSize = configuration->PDCCH_reg_BundleSize[CC_id];
|
||||
bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved->interleaverSize = configuration->PDCCH_interleaverSize[CC_id];
|
||||
*(bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved->shiftIndex) = configuration->PDCCH_shiftIndex[CC_id];
|
||||
} else if(bwp_dl_controlresourceset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved) {
|
||||
bwp_dl_controlresourceset->cce_REG_MappingType.choice.nonInterleaved = 0;
|
||||
}
|
||||
|
||||
bwp_dl_controlresourceset->precoderGranularity = configuration->PDCCH_precoderGranularity[CC_id];
|
||||
*(TCI_StateId) = configuration->PDCCH_TCI_StateId[CC_id];
|
||||
ASN_SEQUENCE_ADD(&bwp_dl_controlresourceset->tci_StatesPDCCH_ToAddList->list,&TCI_StateId);
|
||||
|
||||
if(configuration->tci_PresentInDCI[CC_id]) {
|
||||
bwp_dl_controlresourceset->tci_PresentInDCI = NR_ControlResourceSet__tci_PresentInDCI_enabled;
|
||||
}
|
||||
|
||||
*(bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID) = configuration->PDCCH_DMRS_ScramblingID[CC_id];;
|
||||
//Fill downlinkConfigCommon -> initialDownlinkBWP -> pdcch_ConfigCommon -> SearchSpace list //
|
||||
bwp_dl_searchspace->searchSpaceId = configuration->SearchSpaceId[CC_id];
|
||||
*(bwp_dl_searchspace->controlResourceSetId) = configuration->commonSearchSpaces_controlResourceSetId[CC_id];
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_choice[CC_id];
|
||||
|
||||
if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl1 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl2 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl4 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl5 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl8 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl10 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl16 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl20 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl40) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl40 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl80) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl80 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl160) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl160 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl320) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl320 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl640) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl640 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1280) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl1280 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
} else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2560) {
|
||||
bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl2560 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id];
|
||||
}
|
||||
|
||||
*(bwp_dl_searchspace->duration) = configuration->SearchSpace_duration[CC_id];
|
||||
bwp_dl_searchspace->monitoringSymbolsWithinSlot->size = 2;
|
||||
bwp_dl_searchspace->monitoringSymbolsWithinSlot->bits_unused = 2;
|
||||
bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[0] = 0x3f;
|
||||
bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[1] = 0xff;
|
||||
bwp_dl_searchspace->nrofCandidates->aggregationLevel1 = configuration->SearchSpace_nrofCandidates_aggregationLevel1[CC_id];
|
||||
bwp_dl_searchspace->nrofCandidates->aggregationLevel2 = configuration->SearchSpace_nrofCandidates_aggregationLevel2[CC_id];
|
||||
bwp_dl_searchspace->nrofCandidates->aggregationLevel4 = configuration->SearchSpace_nrofCandidates_aggregationLevel4[CC_id];
|
||||
bwp_dl_searchspace->nrofCandidates->aggregationLevel8 = configuration->SearchSpace_nrofCandidates_aggregationLevel8[CC_id];
|
||||
bwp_dl_searchspace->nrofCandidates->aggregationLevel16 = configuration->SearchSpace_nrofCandidates_aggregationLevel16[CC_id];
|
||||
bwp_dl_searchspace->searchSpaceType->present = configuration->SearchSpace_searchSpaceType[CC_id];
|
||||
|
||||
if(bwp_dl_searchspace->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common) {
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_0));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_3));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1 = CALLOC(1,sizeof(long));
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1) = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id];
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy2 = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id];
|
||||
} else if (bwp_dl_searchspace->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) {
|
||||
bwp_dl_searchspace->searchSpaceType->choice.ue_Specific = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__ue_Specific));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.ue_Specific->dci_Formats = configuration->ue_Specific__dci_Formats[CC_id];
|
||||
}
|
||||
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list,&bwp_dl_searchspace);
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1) = configuration->searchSpaceSIB1[CC_id];
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation) = configuration->searchSpaceOtherSystemInformation[CC_id];
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->pagingSearchSpace) = configuration->pagingSearchSpace[CC_id];
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_SearchSpace) = configuration->ra_SearchSpace[CC_id];
|
||||
//initialDownlinkBWP ----- pdsch_ConfigCommon
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup;
|
||||
*(bwp_dl_timedomainresourceallocation->k0) = configuration->PDSCH_TimeDomainResourceAllocation_k0[CC_id];
|
||||
bwp_dl_timedomainresourceallocation->mappingType = configuration->PDSCH_TimeDomainResourceAllocation_mappingType[CC_id];
|
||||
bwp_dl_timedomainresourceallocation->startSymbolAndLength = configuration->PDSCH_TimeDomainResourceAllocation_startSymbolAndLength[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,&bwp_dl_timedomainresourceallocation);
|
||||
//uplinkConfigCommon
|
||||
//uplinkConfigCommon frequencyInfoUL //
|
||||
*(ul_frequencyBandList) = configuration->UL_FreqBandIndicatorNR[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list,&ul_frequencyBandList);
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA) = configuration->UL_absoluteFrequencyPointA[CC_id];
|
||||
ul_scs_SpecificCarrierList->offsetToCarrier = configuration->UL_offsetToCarrier[CC_id];
|
||||
ul_scs_SpecificCarrierList->subcarrierSpacing = configuration->UL_SCS_SubcarrierSpacing[CC_id];
|
||||
ul_scs_SpecificCarrierList->carrierBandwidth = configuration->UL_carrierBandwidth[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,&ul_scs_SpecificCarrierList);
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->additionalSpectrumEmission) = configuration->UL_additionalSpectrumEmission[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->p_Max) = configuration->UL_p_Max[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyShift7p5khz) = configuration->UL_frequencyShift7p5khz[CC_id];
|
||||
//uplinkConfigCommon initialUplinkBWP //
|
||||
//Fill initialUplinkBWP -> BWP-UplinkCommon -> genericParameters//
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth = configuration->UL_locationAndBandwidth[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing = configuration->UL_BWP_SubcarrierSpacing[CC_id];
|
||||
|
||||
if(configuration->UL_BWP_prefix_type[CC_id]) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.cyclicPrefix = NR_BWP__cyclicPrefix_extended;
|
||||
}
|
||||
|
||||
//Fill initialUplinkBWP -> BWP-UplinkCommon -> rach_ConfigCommon//
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->present = NR_SetupRelease_RACH_ConfigCommon_PR_setup;
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles) = configuration->rach_totalNumberOfRA_Preambles[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[CC_id];
|
||||
|
||||
if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[CC_id];
|
||||
} else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[CC_id];
|
||||
} else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[CC_id];
|
||||
} else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[CC_id];
|
||||
} else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[CC_id];
|
||||
} else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[CC_id];
|
||||
} else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[CC_id];
|
||||
} else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present ==
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen =
|
||||
configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[CC_id];
|
||||
}
|
||||
|
||||
if(configuration->rach_groupBconfigured[CC_id]) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->ra_Msg3SizeGroupA = configuration->rach_ra_Msg3SizeGroupA[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->messagePowerOffsetGroupB = configuration->rach_messagePowerOffsetGroupB[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->numberOfRA_PreamblesGroupA =
|
||||
configuration->rach_numberOfRA_PreamblesGroupA[CC_id];
|
||||
}
|
||||
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer = configuration->rach_ra_ContentionResolutionTimer[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB) = configuration->rsrp_ThresholdSSB[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB_SUL) = configuration->rsrp_ThresholdSSB_SUL[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present = configuration->prach_RootSequenceIndex_choice[CC_id];
|
||||
|
||||
if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present == NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839 = configuration->prach_RootSequenceIndex_l839[CC_id];
|
||||
} else if ((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present ==
|
||||
NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139 = configuration->prach_RootSequenceIndex_l139[CC_id];
|
||||
}
|
||||
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing) = configuration->prach_msg1_SubcarrierSpacing[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig = configuration->restrictedSetConfig[CC_id];
|
||||
|
||||
if(configuration->msg3_transformPrecoding[CC_id]) {
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder) = NR_RACH_ConfigCommon__msg3_transformPrecoder_enabled;
|
||||
}
|
||||
|
||||
//Fill initialUplinkBWP -> BWP-UplinkCommon -> rach_ConfigCommon -> rach_ConfigGeneric//
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex = configuration->prach_ConfigurationIndex[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM = configuration->prach_msg1_FDM[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart = configuration->prach_msg1_FrequencyStart[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig = configuration->zeroCorrelationZoneConfig[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower =
|
||||
configuration->preambleReceivedTargetPower[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax = configuration->preambleTransMax[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep = configuration->powerRampingStep[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow = configuration->ra_ResponseWindow[CC_id];
|
||||
//Fill initialUplinkBWP -> BWP-UplinkCommon -> pusch_ConfigCommon//
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->present = NR_SetupRelease_PUSCH_ConfigCommon_PR_setup;
|
||||
|
||||
if(configuration->groupHoppingEnabledTransformPrecoding[CC_id]) {
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding =
|
||||
NR_PUSCH_ConfigCommon__groupHoppingEnabledTransformPrecoding_enabled;
|
||||
}
|
||||
|
||||
*(pusch_configcommontimedomainresourceallocation->k2) = configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id];
|
||||
pusch_configcommontimedomainresourceallocation->mappingType = configuration->PUSCH_TimeDomainResourceAllocation_mappingType[CC_id];
|
||||
pusch_configcommontimedomainresourceallocation->startSymbolAndLength = configuration->PUSCH_TimeDomainResourceAllocation_startSymbolAndLength[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,
|
||||
&pusch_configcommontimedomainresourceallocation);
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) = configuration->msg3_DeltaPreamble[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant) = configuration->p0_NominalWithGrant[CC_id];
|
||||
//Fill initialUplinkBWP -> BWP-UplinkCommon -> pucch_ConfigCommon//
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->present = NR_SetupRelease_PUCCH_ConfigCommon_PR_setup;
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping = configuration->pucch_GroupHopping[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal) = configuration->p0_nominal[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon) = configuration->pucch_ResourceCommon[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId) = configuration->hoppingId[CC_id];
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->dummy = configuration->UL_timeAlignmentTimerCommon[CC_id];
|
||||
(*servingcellconfigcommon)->n_TimingAdvanceOffset = CALLOC(1,sizeof(long));
|
||||
*((*servingcellconfigcommon)->n_TimingAdvanceOffset)=configuration->ServingCellConfigCommon_n_TimingAdvanceOffset[CC_id];
|
||||
//ssb_PositionsInBurst
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->present = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
|
||||
uint64_t t_freq;
|
||||
|
||||
if(configuration->nr_band[CC_id] == 41 || (configuration->nr_band[CC_id] > 76 && configuration->nr_band[CC_id] < 80))
|
||||
t_freq = 2400000000;
|
||||
else
|
||||
t_freq = 3000000000;
|
||||
|
||||
if(configuration->downlink_frequency[CC_id]<t_freq) {
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.size = 1;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.bits_unused = 4;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf[0] = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
|
||||
} else if(configuration->downlink_frequency[CC_id]<6000000000) {
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.size = 1;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.bits_unused = 0;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id];
|
||||
} else {
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.size = 8;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.bits_unused = 0;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[0] = 0xff;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[1] = 0xff;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[2] = 0xff;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[3] = 0xff;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[4] = 0xff;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[5] = 0xff;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[6] = 0xff;
|
||||
(*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[7] = 0xff;
|
||||
}
|
||||
|
||||
//ssb_periodicityServingCell
|
||||
*(*servingcellconfigcommon)->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id];
|
||||
//dmrs_TypeA_Position
|
||||
(*servingcellconfigcommon)->dmrs_TypeA_Position = configuration->ServingCellConfigCommon_dmrs_TypeA_Position[CC_id];
|
||||
//lte_CRS_ToMatchAround
|
||||
//rateMatchPatternToAddModList
|
||||
ratematchpattern->rateMatchPatternId = configuration->rateMatchPatternId[CC_id];
|
||||
ratematchpattern->patternType.present = configuration->RateMatchPattern_patternType[CC_id];
|
||||
|
||||
if(ratematchpattern->patternType.present == NR_RateMatchPattern__patternType_PR_bitmaps) {
|
||||
ratematchpattern->patternType.choice.bitmaps->resourceBlocks.size = 35;
|
||||
ratematchpattern->patternType.choice.bitmaps->resourceBlocks.bits_unused = 5;
|
||||
ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf[0] = 0x07;
|
||||
|
||||
for (int i =1; i<=34; i++ ) {
|
||||
ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf[i] =0xff;
|
||||
}
|
||||
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.present = configuration->symbolsInResourceBlock[CC_id];
|
||||
|
||||
if(ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.present == NR_RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_oneSlot) {
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.size=2;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.bits_unused=2;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf[0]=0x3f;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf[1]=0xff;
|
||||
} else if(ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.present == NR_RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_twoSlots) {
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.size=4;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.bits_unused=4;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[0]=0x0f;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[1]=0xff;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[2]=0xff;
|
||||
ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[3]=0xff;
|
||||
}
|
||||
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present = configuration->periodicityAndPattern[CC_id];
|
||||
|
||||
if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n2) {
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.size = 1;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.bits_unused = 6;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.buf[0] =0x03;
|
||||
} else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n4) {
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.size = 1;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.bits_unused = 4;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.buf[0] = 0x0f;
|
||||
} else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n5) {
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.size = 1;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.bits_unused = 3;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.buf[0] = 0x1f;
|
||||
} else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n8) {
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.size = 1;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.bits_unused = 0;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.buf[0] = 0xff;
|
||||
} else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n10) {
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.size = 2;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.bits_unused = 6;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf[0] = 0x03;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf[1] = 0xff;
|
||||
} else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n20) {
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.size = 3;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.bits_unused = 4;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf[0] = 0x0f;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf[1] = 0xff;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf[2] = 0xff;
|
||||
} else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n40) {
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.size = 5;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.bits_unused = 0;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[0] = 0xff;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[1] = 0xff;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[2] = 0xff;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[3] = 0xff;
|
||||
ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[4] = 0xff;
|
||||
}
|
||||
} else if(ratematchpattern->patternType.present == NR_RateMatchPattern__patternType_PR_controlResourceSet) {
|
||||
ratematchpattern->patternType.choice.controlResourceSet = configuration->RateMatchPattern_controlResourceSet[CC_id];
|
||||
}
|
||||
|
||||
*(ratematchpattern->subcarrierSpacing) = configuration->RateMatchPattern_subcarrierSpacing[CC_id];
|
||||
ratematchpattern->dummy = configuration->RateMatchPattern_mode[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->rateMatchPatternToAddModList->list,&ratematchpattern);
|
||||
//rateMatchPatternToReleaseList
|
||||
*(ratematchpatternid) = configuration->rateMatchPatternId[CC_id];
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->rateMatchPatternToReleaseList->list,&ratematchpatternid);
|
||||
//subcarrierSpacing
|
||||
*(*servingcellconfigcommon)->ssbSubcarrierSpacing = configuration->NIA_SubcarrierSpacing[CC_id];
|
||||
//tdd_UL_DL_ConfigurationCommon
|
||||
(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = configuration->referenceSubcarrierSpacing[CC_id];
|
||||
(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity = configuration->dl_UL_TransmissionPeriodicity[CC_id];
|
||||
(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots = configuration->nrofDownlinkSlots[CC_id];
|
||||
(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols = configuration->nrofDownlinkSymbols[CC_id];
|
||||
(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots = configuration->nrofUplinkSlots[CC_id];
|
||||
(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols = configuration->nrofUplinkSymbols[CC_id];
|
||||
//ss_PBCH_BlockPower
|
||||
(*servingcellconfigcommon)->ss_PBCH_BlockPower = configuration->ServingCellConfigCommon_ss_PBCH_BlockPower[CC_id];
|
||||
}
|
||||
|
||||
|
||||
void do_RLC_BEARER(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList,
|
||||
@@ -1106,28 +567,14 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id,
|
||||
}
|
||||
|
||||
|
||||
void do_SpCellConfig(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
NR_SpCellConfig_t *spconfig) {
|
||||
//spconfig->servCellIndex = CALLOC(1,sizeof(NR_ServCellIndex_t));
|
||||
//*(spconfig->servCellIndex)=
|
||||
|
||||
void do_SpCellConfig(gNB_RRC_INST *rrc,
|
||||
struct NR_SpCellConfig *spconfig){
|
||||
gNB_RrcConfigurationReq *common_configuration;
|
||||
common_configuration = CALLOC(1,sizeof(gNB_RrcConfigurationReq));
|
||||
//Fill servingcellconfigcommon config value
|
||||
rrc_config_servingcellconfigcommon(Mod_id,
|
||||
CC_id,
|
||||
common_configuration
|
||||
);
|
||||
//Fill common config to structure
|
||||
do_SERVINGCELLCONFIGCOMMON(Mod_id,
|
||||
CC_id,
|
||||
common_configuration,
|
||||
0
|
||||
);
|
||||
// rrc->configuration = common_configuration;
|
||||
spconfig->reconfigurationWithSync = CALLOC(1,sizeof(struct NR_ReconfigurationWithSync));
|
||||
/*
|
||||
memcpy( spconfig->reconfigurationWithSync,
|
||||
RC.nrrrc[Mod_id]->carrier[0].servingcellconfigcommon,
|
||||
sizeof(struct NR_ServingCellConfigCommon));
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -53,24 +53,9 @@
|
||||
*/
|
||||
int xer_sprint_NR(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr);
|
||||
|
||||
uint16_t get_adjacent_cell_id_NR(uint8_t Mod_id,uint8_t index);
|
||||
uint8_t do_MIB_NR(gNB_RRC_INST *rrc,
|
||||
uint32_t frame);
|
||||
|
||||
uint8_t get_adjacent_cell_mod_id_NR(uint16_t phyCellId);
|
||||
|
||||
/**
|
||||
\brief Generate configuration for SIB1 (eNB).
|
||||
@param carrier pointer to Carrier information
|
||||
@param N_RB_DL Number of downlink PRBs
|
||||
@param phich_Resource PHICH resoure parameter
|
||||
@param phich_duration PHICH duration parameter
|
||||
@param frame radio frame number
|
||||
@return size of encoded bit stream in bytes*/
|
||||
uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
uint32_t frame,
|
||||
uint32_t ssb_SubcarrierOffset,
|
||||
uint32_t pdcch_ConfigSIB1,
|
||||
uint32_t subCarrierSpacingCommon,
|
||||
uint32_t dmrs_TypeA_Position);
|
||||
/**
|
||||
\brief Generate configuration for SIB1 (gNB).
|
||||
@param carrier pointer to Carrier information
|
||||
@@ -80,16 +65,10 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
gNB_RrcConfigurationReq *configuration
|
||||
);
|
||||
|
||||
void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
gNB_RrcConfigurationReq *configuration,
|
||||
int initial_flag);
|
||||
|
||||
void do_RLC_BEARER(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList,
|
||||
rlc_bearer_config_t *rlc_config);
|
||||
|
||||
int CC_id,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList,
|
||||
rlc_bearer_config_t *rlc_config);
|
||||
void do_MAC_CELLGROUP(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
|
||||
@@ -100,6 +79,6 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id,
|
||||
NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig,
|
||||
physicalcellgroup_t *physicalcellgroup_config);
|
||||
|
||||
void do_SpCellConfig(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
NR_SpCellConfig_t *spconfig);
|
||||
|
||||
void do_SpCellConfig(gNB_RRC_INST *rrc,
|
||||
struct NR_SpCellConfig *spconfig);
|
||||
|
||||
@@ -30,142 +30,6 @@
|
||||
|
||||
#include "nr_rrc_config.h"
|
||||
|
||||
void rrc_config_servingcellconfigcommon(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
gNB_RrcConfigurationReq *common_configuration
|
||||
){
|
||||
|
||||
common_configuration->MIB_subCarrierSpacingCommon[CC_id] = 0;
|
||||
common_configuration->MIB_ssb_SubcarrierOffset[CC_id] = 0;
|
||||
common_configuration->MIB_dmrs_TypeA_Position[CC_id] = 0;
|
||||
common_configuration->pdcch_ConfigSIB1[CC_id] = 0;
|
||||
common_configuration->absoluteFrequencySSB[CC_id] = 0;
|
||||
common_configuration->DL_FreqBandIndicatorNR[CC_id] = 0;
|
||||
common_configuration->DL_absoluteFrequencyPointA[CC_id] = 0;
|
||||
common_configuration->DL_offsetToCarrier[CC_id] = 0;
|
||||
common_configuration->DL_SCS_SubcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->DL_carrierBandwidth[CC_id] = 0;
|
||||
common_configuration->DL_locationAndBandwidth[CC_id] = 0;
|
||||
common_configuration->DL_BWP_SubcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->DL_BWP_prefix_type[CC_id] = 0;
|
||||
common_configuration->UL_FreqBandIndicatorNR[CC_id] = 0;
|
||||
common_configuration->UL_absoluteFrequencyPointA[CC_id] = 0;
|
||||
common_configuration->UL_additionalSpectrumEmission[CC_id] = 0;
|
||||
common_configuration->UL_p_Max[CC_id] = 0;
|
||||
common_configuration->UL_frequencyShift7p5khz[CC_id] = 0;
|
||||
common_configuration->UL_offsetToCarrier[CC_id] = 0;
|
||||
common_configuration->UL_SCS_SubcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->UL_carrierBandwidth[CC_id] = 0;
|
||||
common_configuration->UL_locationAndBandwidth[CC_id] = 0;
|
||||
common_configuration->UL_BWP_SubcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->UL_BWP_prefix_type[CC_id] = 0;
|
||||
common_configuration->UL_timeAlignmentTimerCommon[CC_id] = 0;
|
||||
common_configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id] = 0;
|
||||
common_configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id] = 0;
|
||||
common_configuration->ServingCellConfigCommon_dmrs_TypeA_Position[CC_id] = 0;
|
||||
common_configuration->NIA_SubcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->ServingCellConfigCommon_ss_PBCH_BlockPower[CC_id] = 0;
|
||||
common_configuration->referenceSubcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->dl_UL_TransmissionPeriodicity[CC_id] = 0;
|
||||
common_configuration->nrofDownlinkSlots[CC_id] = 0;
|
||||
common_configuration->nrofDownlinkSymbols[CC_id] = 0;
|
||||
common_configuration->nrofUplinkSlots[CC_id] = 0;
|
||||
common_configuration->nrofUplinkSymbols[CC_id] = 0;
|
||||
common_configuration->rach_totalNumberOfRA_Preambles[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[CC_id] = 0;
|
||||
common_configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[CC_id] = 0;
|
||||
common_configuration->rach_groupBconfigured[CC_id] = 0;
|
||||
common_configuration->rach_ra_Msg3SizeGroupA[CC_id] = 0;
|
||||
common_configuration->rach_messagePowerOffsetGroupB[CC_id] = 0;
|
||||
common_configuration->rach_numberOfRA_PreamblesGroupA[CC_id] = 0;
|
||||
common_configuration->rach_ra_ContentionResolutionTimer[CC_id] = 0;
|
||||
common_configuration->rsrp_ThresholdSSB[CC_id] = 0;
|
||||
common_configuration->rsrp_ThresholdSSB_SUL[CC_id] = 0;
|
||||
common_configuration->prach_RootSequenceIndex_choice[CC_id] = 0;
|
||||
common_configuration->prach_RootSequenceIndex_l839[CC_id] = 0;
|
||||
common_configuration->prach_RootSequenceIndex_l139[CC_id] = 0;
|
||||
common_configuration->prach_msg1_SubcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->restrictedSetConfig[CC_id] = 0;
|
||||
common_configuration->msg3_transformPrecoding[CC_id] = 0;
|
||||
common_configuration->prach_ConfigurationIndex[CC_id] = 0;
|
||||
common_configuration->prach_msg1_FDM[CC_id] = 0;
|
||||
common_configuration->prach_msg1_FrequencyStart[CC_id] = 0;
|
||||
common_configuration->zeroCorrelationZoneConfig[CC_id] = 0;
|
||||
common_configuration->preambleReceivedTargetPower[CC_id] = 0;
|
||||
common_configuration->preambleTransMax[CC_id] = 0;
|
||||
common_configuration->powerRampingStep[CC_id] = 0;
|
||||
common_configuration->ra_ResponseWindow[CC_id] = 0;
|
||||
common_configuration->groupHoppingEnabledTransformPrecoding[CC_id] = 0;
|
||||
common_configuration->msg3_DeltaPreamble[CC_id] = 0;
|
||||
common_configuration->p0_NominalWithGrant[CC_id] = 0;
|
||||
common_configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id] = 0;
|
||||
common_configuration->PUSCH_TimeDomainResourceAllocation_mappingType[CC_id] = 0;
|
||||
common_configuration->PUSCH_TimeDomainResourceAllocation_startSymbolAndLength[CC_id] = 0;
|
||||
common_configuration->pucch_ResourceCommon[CC_id] = 0;
|
||||
common_configuration->pucch_GroupHopping[CC_id] = 0;
|
||||
common_configuration->hoppingId[CC_id] = 0;
|
||||
common_configuration->p0_nominal[CC_id] = 0;
|
||||
common_configuration->PDSCH_TimeDomainResourceAllocation_k0[CC_id] = 0;
|
||||
common_configuration->PDSCH_TimeDomainResourceAllocation_mappingType[CC_id] = 0;
|
||||
common_configuration->PDSCH_TimeDomainResourceAllocation_startSymbolAndLength[CC_id] = 0;
|
||||
common_configuration->rateMatchPatternId[CC_id] = 0;
|
||||
common_configuration->RateMatchPattern_patternType[CC_id] = 0;
|
||||
common_configuration->symbolsInResourceBlock[CC_id] = 0;
|
||||
common_configuration->periodicityAndPattern[CC_id] = 0;
|
||||
common_configuration->RateMatchPattern_controlResourceSet[CC_id] = 0;
|
||||
common_configuration->RateMatchPattern_subcarrierSpacing[CC_id] = 0;
|
||||
common_configuration->RateMatchPattern_mode[CC_id] = 0;
|
||||
common_configuration->controlResourceSetZero[CC_id] = 0;
|
||||
common_configuration->searchSpaceZero[CC_id] = 0;
|
||||
common_configuration->searchSpaceSIB1[CC_id] = 0;
|
||||
common_configuration->searchSpaceOtherSystemInformation[CC_id] = 0;
|
||||
common_configuration->pagingSearchSpace[CC_id] = 0;
|
||||
common_configuration->ra_SearchSpace[CC_id] = 0;
|
||||
common_configuration->PDCCH_common_controlResourceSetId[CC_id] = 0;
|
||||
common_configuration->PDCCH_common_ControlResourceSet_duration[CC_id] = 0;
|
||||
common_configuration->PDCCH_cce_REG_MappingType[CC_id] = 0;
|
||||
common_configuration->PDCCH_reg_BundleSize[CC_id] = 0;
|
||||
common_configuration->PDCCH_interleaverSize[CC_id] = 0;
|
||||
common_configuration->PDCCH_shiftIndex[CC_id] = 0;
|
||||
common_configuration->PDCCH_precoderGranularity[CC_id] = 0;
|
||||
common_configuration->PDCCH_TCI_StateId[CC_id] = 0;
|
||||
common_configuration->tci_PresentInDCI[CC_id] = 0;
|
||||
common_configuration->PDCCH_DMRS_ScramblingID[CC_id] = 0;
|
||||
common_configuration->SearchSpaceId[CC_id] = 0;
|
||||
common_configuration->commonSearchSpaces_controlResourceSetId[CC_id] = 0;
|
||||
common_configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_choice[CC_id] = 0;
|
||||
common_configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id] = 0;
|
||||
common_configuration->SearchSpace_duration[CC_id] = 0;
|
||||
common_configuration->SearchSpace_nrofCandidates_aggregationLevel1[CC_id] = 0;
|
||||
common_configuration->SearchSpace_nrofCandidates_aggregationLevel2[CC_id] = 0;
|
||||
common_configuration->SearchSpace_nrofCandidates_aggregationLevel4[CC_id] = 0;
|
||||
common_configuration->SearchSpace_nrofCandidates_aggregationLevel8[CC_id] = 0;
|
||||
common_configuration->SearchSpace_nrofCandidates_aggregationLevel16[CC_id] = 0;
|
||||
common_configuration->SearchSpace_searchSpaceType[CC_id] = 0;
|
||||
common_configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[CC_id] = 0;
|
||||
common_configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[CC_id] = 0;
|
||||
common_configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[CC_id] = 0;
|
||||
common_configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[CC_id] = 0;
|
||||
common_configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[CC_id] = 0;
|
||||
common_configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id] = 0;
|
||||
common_configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id] = 0;
|
||||
common_configuration->ue_Specific__dci_Formats[CC_id] = 0;
|
||||
common_configuration->RateMatchPatternLTE_CRS_carrierFreqDL[CC_id] = 0;
|
||||
common_configuration->RateMatchPatternLTE_CRS_carrierBandwidthDL[CC_id] = 0;
|
||||
common_configuration->RateMatchPatternLTE_CRS_nrofCRS_Ports[CC_id] = 0;
|
||||
common_configuration->RateMatchPatternLTE_CRS_v_Shift[CC_id] = 0;
|
||||
common_configuration->RateMatchPatternLTE_CRS_radioframeAllocationPeriod[CC_id] = 0;
|
||||
common_configuration->RateMatchPatternLTE_CRS_radioframeAllocationOffset[CC_id] = 0;
|
||||
common_configuration->RateMatchPatternLTE_CRS_subframeAllocation_choice[CC_id] = 0;
|
||||
}
|
||||
|
||||
void rrc_config_rlc_bearer(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
rlc_bearer_config_t *rlc_config
|
||||
|
||||
@@ -46,16 +46,10 @@
|
||||
//#include "COMMON/mac_rrc_primitives.h"
|
||||
|
||||
#include "NR_SIB1.h"
|
||||
//#include "SystemInformation.h"
|
||||
//#include "RRCConnectionReconfiguration.h"
|
||||
#include "NR_RRCReconfigurationComplete.h"
|
||||
#include "NR_RRCReconfiguration.h"
|
||||
//#include "RRCConnectionReconfigurationComplete.h"
|
||||
//#include "RRCConnectionSetup.h"
|
||||
//#include "RRCConnectionSetupComplete.h"
|
||||
//#include "RRCConnectionRequest.h"
|
||||
//#include "RRCConnectionReestablishmentRequest.h"
|
||||
#include "NR_RRCReestablishmentRequest.h"
|
||||
#include "NR_BCCH-BCH-Message.h"
|
||||
#include "NR_BCCH-DL-SCH-Message.h"
|
||||
#include "NR_BCCH-BCH-Message.h"
|
||||
#include "NR_PLMN-IdentityInfo.h"
|
||||
@@ -66,6 +60,7 @@
|
||||
//#include "AS-Config.h"
|
||||
//#include "AS-Context.h"
|
||||
#include "NR_UE-NR-Capability.h"
|
||||
#include "NR_UE-MRDC-Capability.h"
|
||||
#include "NR_MeasResults.h"
|
||||
#include "NR_CellGroupConfig.h"
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
@@ -86,12 +81,12 @@
|
||||
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
|
||||
|
||||
typedef unsigned int uid_nr_t;
|
||||
#define NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((NUMBER_OF_NR_UE_MAX/8)/sizeof(unsigned int)) + 1)
|
||||
#define NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((MAX_MOBILES_PER_GNB/8)/sizeof(unsigned int)) + 1)
|
||||
|
||||
/*typedef struct nr_uid_linear_allocator_s {
|
||||
typedef struct nr_uid_linear_allocator_s {
|
||||
unsigned int bitmap[NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE];
|
||||
} nr_uid_allocator_t;*/
|
||||
|
||||
} nr_uid_allocator_t;
|
||||
|
||||
|
||||
#define PROTOCOL_NR_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
|
||||
#define PROTOCOL_NR_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
|
||||
@@ -121,7 +116,6 @@ typedef enum UE_STATE_NR_e {
|
||||
} NR_UE_STATE_t;
|
||||
|
||||
|
||||
//#define NUMBER_OF_NR_UE_MAX MAX_MOBILES_PER_RG
|
||||
#define RRM_FREE(p) if ( (p) != NULL) { free(p) ; p=NULL ; }
|
||||
#define RRM_MALLOC(t,n) (t *) malloc16( sizeof(t) * n )
|
||||
#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n)
|
||||
@@ -271,7 +265,14 @@ typedef struct gNB_RRC_UE_s {
|
||||
HANDOVER_INFO *handover_info;
|
||||
NR_MeasResults_t *measResults;
|
||||
|
||||
NR_UE_NR_Capability_t *UE_Capability;
|
||||
|
||||
NR_UE_NR_Capability_t* UE_Capability_nr;
|
||||
NR_UE_MRDC_Capability_t* UE_Capability_MRDC;
|
||||
|
||||
NR_CellGroupConfig_t *secondaryCellGroup;
|
||||
NR_RRCReconfiguration_t *reconfig;
|
||||
NR_RadioBearerConfig_t *rb_config;
|
||||
|
||||
ImsiMobileIdentity_t imsi;
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
@@ -374,24 +375,15 @@ typedef struct {
|
||||
uint8_t *ServingCellConfigCommon;
|
||||
uint8_t sizeof_servingcellconfigcommon;
|
||||
|
||||
//implicit parameters needed
|
||||
int physCellId;
|
||||
int Ncp; //cyclic prefix for DL
|
||||
int Ncp_UL; //cyclic prefix for UL
|
||||
int p_gNB; //number of tx antenna port
|
||||
int p_rx_gNB; //number of receiving antenna ports
|
||||
uint64_t dl_CarrierFreq; //detected by the UE
|
||||
uint64_t ul_CarrierFreq; //detected by the UE
|
||||
|
||||
//are the only static one (memory has been already allocated)
|
||||
NR_BCCH_BCH_Message_t mib;
|
||||
int ssb_SubcarrierOffset;
|
||||
int pdsch_AntennaPorts;
|
||||
NR_BCCH_DL_SCH_Message_t *siblock1;
|
||||
|
||||
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
|
||||
|
||||
|
||||
NR_CellGroupConfig_t *secondaryCellGroup[MAX_NR_RRC_UE_CONTEXTS];
|
||||
NR_SRB_INFO SI;
|
||||
NR_SRB_INFO Srb0;
|
||||
int initial_csi_index[MAX_NR_RRC_UE_CONTEXTS];
|
||||
|
||||
} rrc_gNB_carrier_data_t;
|
||||
//---------------------------------------------------
|
||||
@@ -401,19 +393,15 @@ typedef struct {
|
||||
//---NR---(completely change)---------------------
|
||||
typedef struct gNB_RRC_INST_s {
|
||||
|
||||
int module_id;
|
||||
eth_params_t eth_params_s;
|
||||
rrc_gNB_carrier_data_t carrier[MAX_NUM_CCs];
|
||||
uid_allocator_t uid_allocator; // for rrc_ue_head
|
||||
rrc_gNB_carrier_data_t carrier;
|
||||
nr_uid_allocator_t uid_allocator; // for rrc_ue_head
|
||||
RB_HEAD(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti
|
||||
|
||||
uint8_t Nb_ue;
|
||||
|
||||
int Nb_ue;
|
||||
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
|
||||
hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t
|
||||
|
||||
//RRC configuration
|
||||
gNB_RrcConfigurationReq configuration;//rrc_messages_types.h
|
||||
|
||||
// other PLMN parameters
|
||||
/// Mobile country code
|
||||
int mcc;
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
|
||||
#include "RRC/NR/nr_rrc_defs.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "NR_RRCReconfiguration.h"
|
||||
#include "NR_UE-NR-Capability.h"
|
||||
#include "NR_UE-CapabilityRAT-ContainerList.h"
|
||||
#include "LTE_UE-CapabilityRAT-ContainerList.h"
|
||||
#include "NR_CG-Config.h"
|
||||
#include "NR_CG-ConfigInfo.h"
|
||||
|
||||
int rrc_init_nr_global_param(void);
|
||||
|
||||
@@ -57,6 +63,35 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
|
||||
rrc_gNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
struct rrc_gNB_ue_context_s *rrc_gNB_allocate_new_UE_context(gNB_RRC_INST *rrc_instance_pP);
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc,LTE_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList);
|
||||
|
||||
void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_p);
|
||||
|
||||
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
int n_physical_antenna_ports,
|
||||
int initial_csi_index);
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_RRCReconfiguration_IEs_t *reconfig,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
int n_physical_antenna_ports,
|
||||
int initial_csi_index);
|
||||
|
||||
void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig);
|
||||
|
||||
int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
NR_CG_Config_t *cg_Config,
|
||||
NR_RRCReconfiguration_t *reconfig,
|
||||
NR_RadioBearerConfig_t *rbconfig);
|
||||
|
||||
int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo);
|
||||
|
||||
|
||||
|
||||
/**\brief RRC eNB task.
|
||||
\param void *args_p Pointer on arguments to start the task. */
|
||||
|
||||
+171
-86
@@ -49,6 +49,8 @@
|
||||
#include "NR_DL-DCCH-Message.h"
|
||||
#include "NR_CellGroupConfig.h"
|
||||
#include "NR_MeasResults.h"
|
||||
#include "LTE_UECapabilityInformation.h"
|
||||
#include "LTE_UL-DCCH-Message.h"
|
||||
|
||||
#include "rlc.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
@@ -74,31 +76,18 @@
|
||||
#include "pdcp.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
|
||||
#if ENABLE_RAL
|
||||
#include "rrc_eNB_ral.h"
|
||||
#endif
|
||||
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
|
||||
#include "executables/softmodem-common.h"
|
||||
#include <openair2/RRC/NR/rrc_gNB_UE_context.h>
|
||||
|
||||
//#define XER_PRINT
|
||||
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#ifdef PHY_EMUL
|
||||
extern EMULATION_VARS *Emul_vars;
|
||||
#endif
|
||||
//extern eNB_MAC_INST *eNB_mac_inst;
|
||||
//extern UE_MAC_INST *UE_mac_inst;
|
||||
#ifdef BIGPHYSAREA
|
||||
extern void *bigphys_malloc(int);
|
||||
#endif
|
||||
|
||||
extern uint16_t two_tier_hexagonal_cellIds[7];
|
||||
|
||||
mui_t rrc_gNB_mui = 0;
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
@@ -107,12 +96,11 @@ mui_t rrc_gNB_mui = 0;
|
||||
void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) {
|
||||
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",PROTOCOL_NR_RRC_CTXT_ARGS(ctxt_pP));
|
||||
|
||||
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
|
||||
rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
|
||||
}
|
||||
rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier.SI, BCCH, 1);
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier.SI.Active = 1;
|
||||
rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier.Srb0, CCCH, 1);
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier.Srb0.Active = 1;
|
||||
|
||||
}
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
@@ -185,95 +173,181 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
|
||||
ue_context_pP->ue_context.primaryCC_id,
|
||||
physicalCellGroupConfig,
|
||||
physicalcellgroup_config);
|
||||
do_SpCellConfig(ctxt_pP->module_id,
|
||||
ue_context_pP->ue_context.primaryCC_id,
|
||||
|
||||
do_SpCellConfig(RC.nrrrc[ctxt_pP->module_id],
|
||||
spCellConfig);
|
||||
}
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
|
||||
static void init_NR_SI(const protocol_ctxt_t *const ctxt_pP,
|
||||
const int CC_id,
|
||||
gNB_RrcConfigurationReq *configuration
|
||||
static void init_NR_SI(gNB_RRC_INST *rrc) {
|
||||
|
||||
|
||||
) {
|
||||
//int i;
|
||||
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
|
||||
// copy basic parameters
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB = configuration->nb_antenna_ports[CC_id];
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->DL_prefix_type[CC_id];
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp_UL = configuration->UL_prefix_type[CC_id];
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
|
||||
///MIB
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB = 0;
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].MIB = (uint8_t *) malloc16(4);
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB = do_MIB_NR(&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id],0,
|
||||
configuration->MIB_ssb_SubcarrierOffset[CC_id],
|
||||
configuration->pdcch_ConfigSIB1[CC_id],
|
||||
configuration->MIB_subCarrierSpacingCommon[CC_id],
|
||||
configuration->MIB_dmrs_TypeA_Position[CC_id]
|
||||
);
|
||||
do_SERVINGCELLCONFIGCOMMON(ctxt_pP->module_id,
|
||||
CC_id,
|
||||
configuration,
|
||||
1
|
||||
);
|
||||
|
||||
|
||||
|
||||
rrc->carrier.MIB = (uint8_t*) malloc16(4);
|
||||
rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0);
|
||||
|
||||
|
||||
LOG_I(NR_RRC,"Done init_NR_SI\n");
|
||||
rrc_mac_config_req_gNB(ctxt_pP->module_id,
|
||||
CC_id,
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB,
|
||||
configuration->nr_band[CC_id],
|
||||
configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id],
|
||||
configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id],
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
|
||||
configuration->N_RB_DL[CC_id],
|
||||
(NR_BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
|
||||
(NR_ServingCellConfigCommon_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].servingcellconfigcommon
|
||||
);
|
||||
|
||||
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.pdsch_AntennaPorts,
|
||||
(NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon,
|
||||
0,
|
||||
0,
|
||||
(NR_CellGroupConfig_t *)NULL
|
||||
);
|
||||
|
||||
|
||||
if (get_softmodem_params()->phy_test > 0) {
|
||||
// This is for phytest only, emulate first X2 message if uecap.raw file is present
|
||||
FILE *fd;
|
||||
|
||||
fd = fopen("uecap.raw","r");
|
||||
if (fd != NULL) {
|
||||
char buffer[4096];
|
||||
int msg_len=fread(buffer,1,4096,fd);
|
||||
LOG_I(RRC,"Read in %d bytes for uecap\n",msg_len);
|
||||
LTE_UL_DCCH_Message_t *LTE_UL_DCCH_Message;
|
||||
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_LTE_UL_DCCH_Message,
|
||||
(void **)<E_UL_DCCH_Message,
|
||||
(uint8_t *)buffer,
|
||||
msg_len);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message, 1 );
|
||||
return;
|
||||
}
|
||||
fclose(fd);
|
||||
xer_fprint(stdout,&asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message);
|
||||
// recreate enough of X2 EN-DC Container
|
||||
AssertFatal(LTE_UL_DCCH_Message->message.choice.c1.present == LTE_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation,
|
||||
"ueCapabilityInformation not present\n");
|
||||
NR_CG_ConfigInfo_t *CG_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo));
|
||||
CG_ConfigInfo->criticalExtensions.present = NR_CG_ConfigInfo__criticalExtensions_PR_c1;
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1 = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1));
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1->present = NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo;
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo));
|
||||
NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo;
|
||||
cg_ConfigInfo->ue_CapabilityInfo = calloc(1,sizeof(*cg_ConfigInfo->ue_CapabilityInfo));
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,NULL,(void*)<E_UL_DCCH_Message->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList,buffer,4096);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
OCTET_STRING_fromBuf(cg_ConfigInfo->ue_CapabilityInfo,
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
parse_CG_ConfigInfo(rrc,CG_ConfigInfo);
|
||||
}
|
||||
else {
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(rrc);
|
||||
|
||||
LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p);
|
||||
rrc_add_nsa_user(rrc,ue_context_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigurationReq *configuration) {
|
||||
protocol_ctxt_t ctxt={0};
|
||||
int CC_id;
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
gNB_RRC_INST *rrc=RC.nrrrc[gnb_mod_idP];
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, GNB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP);
|
||||
AssertFatal(RC.nrrrc[gnb_mod_idP] != NULL, "RC.nrrrc not initialized!");
|
||||
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_FMT" Init...\n",
|
||||
PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
|
||||
#if OCP_FRAMEWORK
|
||||
|
||||
while (rrc == NULL ) {
|
||||
LOG_E(NR_RRC, "RC.nrrrc not yet initialized, waiting 1 second\n");
|
||||
sleep(1);
|
||||
}
|
||||
#endif
|
||||
AssertFatal(rrc != NULL, "RC.nrrrc not initialized!");
|
||||
AssertFatal(NUMBER_OF_UE_MAX < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
|
||||
AssertFatal(configuration!=NULL,"configuration input is null\n");
|
||||
rrc->module_id = gnb_mod_idP;
|
||||
rrc->Nb_ue = 0;
|
||||
|
||||
rrc->carrier.Srb0.Active = 0;
|
||||
|
||||
RC.nrrrc[ctxt.module_id]->Nb_ue = 0;
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
RC.nrrrc[ctxt.module_id]->carrier[CC_id].Srb0.Active = 0;
|
||||
}
|
||||
|
||||
uid_linear_allocator_init(&RC.nrrrc[ctxt.module_id]->uid_allocator);
|
||||
RB_INIT(&RC.nrrrc[ctxt.module_id]->rrc_ue_head);
|
||||
RC.nrrrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
RC.nrrrc[ctxt.module_id]->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
memcpy(&RC.nrrrc[ctxt.module_id]->configuration,configuration,sizeof(gNB_RrcConfigurationReq));
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
init_NR_SI(&ctxt,
|
||||
CC_id,
|
||||
configuration
|
||||
);
|
||||
}//END for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
|
||||
nr_uid_linear_allocator_init(&rrc->uid_allocator);
|
||||
RB_INIT(&rrc->rrc_ue_head);
|
||||
rrc->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
rrc->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
rrc->carrier.servingcellconfigcommon = configuration->scc;
|
||||
rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset;
|
||||
rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts;
|
||||
/// System Information INIT
|
||||
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" Checking release \n",PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
|
||||
|
||||
init_NR_SI(rrc);
|
||||
rrc_init_nr_global_param();
|
||||
openair_nr_rrc_on(&ctxt);
|
||||
return 0;
|
||||
}//END openair_rrc_gNB_configuration
|
||||
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
void rrc_gNB_process_AdditionRequestInformation(const module_id_t gnb_mod_idP, x2ap_ENDC_sgnb_addition_req_t *m) {
|
||||
|
||||
|
||||
LTE_UL_DCCH_Message_t *LTE_UL_DCCH_Message = NULL;
|
||||
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_LTE_UL_DCCH_Message,
|
||||
(void **)<E_UL_DCCH_Message,
|
||||
(uint8_t *)m->rrc_buffer,
|
||||
(int) m->rrc_buffer_size);//m->rrc_buffer_size);
|
||||
|
||||
/* asn_dec_rval_t dec_rval = uper_decode( NULL,
|
||||
&asn_DEF_LTE_UL_DCCH_Message,
|
||||
(void **)<E_UL_DCCH_Message,
|
||||
(uint8_t *)m->rrc_buffer,
|
||||
(int) m->rrc_buffer_size, 0, 0);//m->rrc_buffer_size);
|
||||
*/
|
||||
gNB_RRC_INST *rrc=RC.nrrrc[gnb_mod_idP];
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message, 1 );
|
||||
return;
|
||||
}
|
||||
xer_fprint(stdout,&asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message);
|
||||
// recreate enough of X2 EN-DC Container
|
||||
AssertFatal(LTE_UL_DCCH_Message->message.choice.c1.present == LTE_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation,
|
||||
"ueCapabilityInformation not present\n");
|
||||
NR_CG_ConfigInfo_t *CG_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo));
|
||||
CG_ConfigInfo->criticalExtensions.present = NR_CG_ConfigInfo__criticalExtensions_PR_c1;
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1 = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1));
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1->present = NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo;
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo));
|
||||
NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo;
|
||||
cg_ConfigInfo->ue_CapabilityInfo = calloc(1,sizeof(*cg_ConfigInfo->ue_CapabilityInfo));
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,NULL,(void*)<E_UL_DCCH_Message->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList,m->rrc_buffer,m->rrc_buffer_size);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
OCTET_STRING_fromBuf(cg_ConfigInfo->ue_CapabilityInfo,
|
||||
(const char *)m->rrc_buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
parse_CG_ConfigInfo(rrc,CG_ConfigInfo);
|
||||
|
||||
}
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
void *rrc_gnb_task(void *args_p) {
|
||||
MessageDef *msg_p;
|
||||
const char *msg_name_p;
|
||||
@@ -367,6 +441,17 @@ void *rrc_gnb_task(void *args_p) {
|
||||
openair_rrc_gNB_configuration(GNB_INSTANCE_TO_MODULE_ID(instance), &NRRRC_CONFIGURATION_REQ(msg_p));
|
||||
break;
|
||||
|
||||
/* Messages from X2AP */
|
||||
case X2AP_ENDC_SGNB_ADDITION_REQ:
|
||||
LOG_I(NR_RRC, "Received ENDC sgNB addition request from X2AP \n");
|
||||
rrc_gNB_process_AdditionRequestInformation(GNB_INSTANCE_TO_MODULE_ID(instance), &X2AP_ENDC_SGNB_ADDITION_REQ(msg_p));
|
||||
break;
|
||||
|
||||
case X2AP_ENDC_SGNB_RECONF_COMPLETE:
|
||||
LOG_I(NR_RRC, "Handling of reconfiguration complete message at RRC gNB is pending \n");
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
LOG_E(NR_RRC, "[gNB %d] Received unexpected message %s\n", instance, msg_name_p);
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* 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_gNB_UE_context.h
|
||||
* \brief rrc procedures for UE context
|
||||
* \author Lionel GAUTHIER
|
||||
* \date 2015
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: lionel.gauthier@eurecom.fr
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "rrc_gNB_UE_context.h"
|
||||
#include "msc.h"
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void nr_uid_linear_allocator_init(
|
||||
nr_uid_allocator_t *const uid_pP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
memset(uid_pP, 0, sizeof(nr_uid_allocator_t));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
uid_nr_t nr_uid_linear_allocator_new(gNB_RRC_INST *const rrc_instance_pP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int bit_index = 1;
|
||||
uid_nr_t uid = 0;
|
||||
nr_uid_allocator_t *uia_p = &rrc_instance_pP->uid_allocator;
|
||||
|
||||
for (i=0; i < UID_LINEAR_ALLOCATOR_BITMAP_SIZE; i++) {
|
||||
if (uia_p->bitmap[i] != UINT_MAX) {
|
||||
bit_index = 1;
|
||||
uid = 0;
|
||||
|
||||
while ((uia_p->bitmap[i] & bit_index) == bit_index) {
|
||||
bit_index = bit_index << 1;
|
||||
uid += 1;
|
||||
}
|
||||
|
||||
uia_p->bitmap[i] |= bit_index;
|
||||
return uid + (i*sizeof(unsigned int)*8);
|
||||
}
|
||||
}
|
||||
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
nr_uid_linear_allocator_free(
|
||||
gNB_RRC_INST *rrc_instance_pP,
|
||||
uid_nr_t uidP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
unsigned int i = uidP/sizeof(unsigned int)/8;
|
||||
unsigned int bit = uidP % (sizeof(unsigned int) * 8);
|
||||
unsigned int value = ~(0x00000001 << bit);
|
||||
|
||||
if (i < UID_LINEAR_ALLOCATOR_BITMAP_SIZE) {
|
||||
rrc_instance_pP->uid_allocator.bitmap[i] &= value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int rrc_gNB_compare_ue_rnti_id(
|
||||
struct rrc_gNB_ue_context_s *c1_pP, struct rrc_gNB_ue_context_s *c2_pP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
if (c1_pP->ue_id_rnti > c2_pP->ue_id_rnti) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (c1_pP->ue_id_rnti < c2_pP->ue_id_rnti) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Generate the tree management functions */
|
||||
RB_GENERATE(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s, entries,
|
||||
rrc_gNB_compare_ue_rnti_id);
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
struct rrc_gNB_ue_context_s *
|
||||
rrc_gNB_allocate_new_UE_context(
|
||||
gNB_RRC_INST *rrc_instance_pP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
struct rrc_gNB_ue_context_s *new_p;
|
||||
new_p = (struct rrc_gNB_ue_context_s * )malloc(sizeof(struct rrc_gNB_ue_context_s));
|
||||
|
||||
if (new_p == NULL) {
|
||||
LOG_E(RRC, "Cannot allocate new ue context\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(new_p, 0, sizeof(struct rrc_gNB_ue_context_s));
|
||||
new_p->local_uid = nr_uid_linear_allocator_new(rrc_instance_pP);
|
||||
|
||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||
new_p->ue_context.e_rab[i].xid = -1;
|
||||
new_p->ue_context.modify_e_rab[i].xid = -1;
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC,"Returning new UE context at %p\n",new_p);
|
||||
return(new_p);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
struct rrc_gNB_ue_context_s *
|
||||
rrc_gNB_get_ue_context(
|
||||
gNB_RRC_INST *rrc_instance_pP,
|
||||
rnti_t rntiP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
rrc_gNB_ue_context_t temp;
|
||||
memset(&temp, 0, sizeof(struct rrc_gNB_ue_context_s));
|
||||
/* gNB ue rrc id = 24 bits wide */
|
||||
temp.ue_id_rnti = rntiP;
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
|
||||
ue_context_p = RB_FIND(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, &temp);
|
||||
|
||||
if ( ue_context_p != NULL) {
|
||||
return ue_context_p;
|
||||
} else {
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(rrc_instance_pP->rrc_ue_head)) {
|
||||
if (ue_context_p->ue_context.rnti == rntiP) {
|
||||
return ue_context_p;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void rrc_gNB_free_mem_UE_context(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
struct rrc_gNB_ue_context_s *const ue_context_pP
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
LOG_T(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Clearing UE context 0x%p (free internal structs)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context_pP);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_LTE_SCellToAddMod_r10, &ue_context_pP->ue_context.sCell_config[0]);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_LTE_SCellToAddMod_r10, &ue_context_pP->ue_context.sCell_config[1]);
|
||||
|
||||
// empty the internal fields of the UE context here
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void rrc_gNB_remove_ue_context(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
gNB_RRC_INST *rrc_instance_pP,
|
||||
struct rrc_gNB_ue_context_s *ue_context_pP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
if (rrc_instance_pP == NULL) {
|
||||
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Bad RRC instance\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ue_context_pP == NULL) {
|
||||
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Trying to free a NULL UE context\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
return;
|
||||
}
|
||||
|
||||
RB_REMOVE(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP);
|
||||
MSC_LOG_EVENT(
|
||||
MSC_RRC_ENB,
|
||||
"0 Removed UE %"PRIx16" ",
|
||||
ue_context_pP->ue_context.rnti);
|
||||
rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_pP);
|
||||
nr_uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid);
|
||||
free(ue_context_pP);
|
||||
rrc_instance_pP->Nb_ue --;
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Removed UE context\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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_eNB_UE_context.h
|
||||
* \brief rrc procedures for UE context
|
||||
* \author Lionel GAUTHIER
|
||||
* \date 2015
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: lionel.gauthier@eurecom.fr
|
||||
*/
|
||||
#ifndef __RRC_ENB_UE_CONTEXT_H__
|
||||
#define __RRC_ENB_UE_CONTEXT_H__
|
||||
#include "collection/tree.h"
|
||||
#include "COMMON/platform_types.h"
|
||||
#include "nr_rrc_defs.h"
|
||||
|
||||
|
||||
void
|
||||
nr_uid_linear_allocator_init(
|
||||
nr_uid_allocator_t* const uid_pP
|
||||
);
|
||||
|
||||
uid_t
|
||||
nr_uid_linear_allocator_new(
|
||||
gNB_RRC_INST* rrc_instance_pP
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
nr_uid_linear_allocator_free(
|
||||
gNB_RRC_INST* rrc_instance_pP,
|
||||
uid_t uidP
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
int rrc_gNB_compare_ue_rnti_id(
|
||||
struct rrc_gNB_ue_context_s* c1_pP,
|
||||
struct rrc_gNB_ue_context_s* c2_pP
|
||||
);
|
||||
|
||||
RB_PROTOTYPE(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s, entries, rrc_gNB_compare_ue_rnti_id);
|
||||
|
||||
struct rrc_gNB_ue_context_s*
|
||||
rrc_gNB_allocate_new_UE_context(
|
||||
gNB_RRC_INST* rrc_instance_pP
|
||||
);
|
||||
|
||||
struct rrc_gNB_ue_context_s*
|
||||
rrc_gNB_get_ue_context(
|
||||
gNB_RRC_INST* rrc_instance_pP,
|
||||
rnti_t rntiP
|
||||
);
|
||||
|
||||
void rrc_gNB_remove_ue_context(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
gNB_RRC_INST* rrc_instance_pP,
|
||||
struct rrc_gNB_ue_context_s* ue_context_pP
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* 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_gNB_internode.c
|
||||
* \brief rrc internode procedures for gNB
|
||||
* \author Raymond Knopp
|
||||
* \date 2019
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: raymond.knopp@eurecom.fr
|
||||
*/
|
||||
#ifndef RRC_GNB_INTERNODE_C
|
||||
#define RRC_GNB_INTERNODE_C
|
||||
|
||||
#include "nr_rrc_defs.h"
|
||||
#include "NR_RRCReconfiguration.h"
|
||||
#include "NR_UE-NR-Capability.h"
|
||||
#include "NR_CG-ConfigInfo.h"
|
||||
#include "NR_UE-CapabilityRAT-ContainerList.h"
|
||||
#include "LTE_UE-CapabilityRAT-ContainerList.h"
|
||||
#include "NR_CG-Config.h"
|
||||
|
||||
int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo) {
|
||||
|
||||
if (CG_ConfigInfo->criticalExtensions.present == NR_CG_ConfigInfo__criticalExtensions_PR_c1) {
|
||||
if (CG_ConfigInfo->criticalExtensions.choice.c1) {
|
||||
if (CG_ConfigInfo->criticalExtensions.choice.c1->present == NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo) {
|
||||
NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo;
|
||||
if (cg_ConfigInfo->ue_CapabilityInfo) {
|
||||
// Decode UE-CapabilityRAT-ContainerList
|
||||
LTE_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList=NULL;
|
||||
asn_dec_rval_t dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,
|
||||
(void**)&UE_CapabilityRAT_ContainerList,
|
||||
cg_ConfigInfo->ue_CapabilityInfo->buf,
|
||||
cg_ConfigInfo->ue_CapabilityInfo->size, 0, 0);
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"[InterNode] Failed to decode NR_UE_CapabilityRAT_ContainerList (%zu bits), size of OCTET_STRING %lu\n",
|
||||
dec_rval.consumed, cg_ConfigInfo->ue_CapabilityInfo->size);
|
||||
}
|
||||
rrc_parse_ue_capabilities(rrc,UE_CapabilityRAT_ContainerList);
|
||||
}
|
||||
if (cg_ConfigInfo->candidateCellInfoListMN) AssertFatal(1==0,"Can't handle candidateCellInfoListMN yet\n");
|
||||
}
|
||||
else AssertFatal(1==0,"c1 extension is not cg_ConfigInfo, returning\n");
|
||||
}
|
||||
else {
|
||||
LOG_E(RRC,"c1 extension not found, returning\n");
|
||||
return(-1);
|
||||
}
|
||||
} else {
|
||||
LOG_E(RRC,"Ignoring unknown CG_ConfigInfo extensions\n");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
NR_CG_Config_t *cg_Config,
|
||||
NR_RRCReconfiguration_t *reconfig,
|
||||
NR_RadioBearerConfig_t *rbconfig) {
|
||||
|
||||
|
||||
cg_Config->criticalExtensions.present = NR_CG_Config__criticalExtensions_PR_c1;
|
||||
cg_Config->criticalExtensions.choice.c1 = calloc(1,sizeof(*cg_Config->criticalExtensions.choice.c1));
|
||||
cg_Config->criticalExtensions.choice.c1->present = NR_CG_Config__criticalExtensions__c1_PR_cg_Config;
|
||||
cg_Config->criticalExtensions.choice.c1->choice.cg_Config = calloc(1,sizeof(NR_CG_Config_IEs_t));
|
||||
char buffer[1024];
|
||||
int total_size;
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_RRCReconfiguration, NULL, (void *)reconfig, buffer, 1024);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig = calloc(1,sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig,
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
total_size = (enc_rval.encoded+7)>>3;
|
||||
|
||||
LOG_I(RRC,"Dumping NR_RRCReconfiguration message (%jd bytes)\n",(enc_rval.encoded+7)>>3);
|
||||
for (int i=0;i<(enc_rval.encoded+7)>>3;i++) {
|
||||
printf("%02x",((uint8_t *)buffer)[i]);
|
||||
}
|
||||
printf("\n");
|
||||
FILE *fd = fopen("reconfig.raw","w");
|
||||
fwrite((void*)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
|
||||
fclose(fd);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_RadioBearerConfig, NULL, (void *)rbconfig, buffer, 1024);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config = calloc(1,sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config,
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
LOG_I(RRC,"Dumping scg_RB_Config message (%jd bytes)\n",(enc_rval.encoded+7)>>3);
|
||||
for (int i=0;i<(enc_rval.encoded+7)>>3;i++) {
|
||||
printf("%02x",((uint8_t*)buffer)[i]);
|
||||
}
|
||||
printf("\n");
|
||||
fd = fopen("rbconfig.raw","w");
|
||||
fwrite((void*)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
|
||||
fclose(fd);
|
||||
total_size = total_size + ((enc_rval.encoded+7)>>3);
|
||||
|
||||
return(total_size);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* 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_gNB_nsa.c
|
||||
* \brief rrc NSA procedures for gNB
|
||||
* \author Raymond Knopp
|
||||
* \date 2019
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: raymond.knopp@eurecom.fr
|
||||
*/
|
||||
#ifndef RRC_GNB_NSA_C
|
||||
#define RRC_GNB_NSA_C
|
||||
|
||||
#include "nr_rrc_defs.h"
|
||||
#include "NR_RRCReconfiguration.h"
|
||||
#include "NR_UE-NR-Capability.h"
|
||||
//#include "NR_UE-CapabilityRAT-ContainerList.h"
|
||||
#include "LTE_UE-CapabilityRAT-ContainerList.h"
|
||||
#include "NR_CG-Config.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc,LTE_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList) {
|
||||
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
|
||||
OCTET_STRING_t *ueCapabilityRAT_Container_nr=NULL;
|
||||
OCTET_STRING_t *ueCapabilityRAT_Container_MRDC=NULL;
|
||||
int list_size=0;
|
||||
AssertFatal(UE_CapabilityRAT_ContainerList!=NULL,"UE_CapabilityRAT_ContainerList is null\n");
|
||||
AssertFatal((list_size=UE_CapabilityRAT_ContainerList->list.count) >= 2, "UE_CapabilityRAT_ContainerList->list.size %d < 2\n",UE_CapabilityRAT_ContainerList->list.count);
|
||||
for (int i=0;i<list_size;i++) {
|
||||
if (UE_CapabilityRAT_ContainerList->list.array[i]->rat_Type == LTE_RAT_Type_nr) ueCapabilityRAT_Container_nr = &UE_CapabilityRAT_ContainerList->list.array[i]->ueCapabilityRAT_Container;
|
||||
else if (UE_CapabilityRAT_ContainerList->list.array[i]->rat_Type == LTE_RAT_Type_eutra_nr) ueCapabilityRAT_Container_MRDC = &UE_CapabilityRAT_ContainerList->list.array[i]->ueCapabilityRAT_Container;
|
||||
}
|
||||
|
||||
AssertFatal(ueCapabilityRAT_Container_nr!=NULL,"ueCapabilityRAT_Container_nr is NULL\n");
|
||||
AssertFatal(ueCapabilityRAT_Container_MRDC!=NULL,"ueCapabilityRAT_Container_MRDC is NULL\n");
|
||||
// decode and store capabilities
|
||||
ue_context_p = rrc_gNB_allocate_new_UE_context(rrc);
|
||||
|
||||
asn_dec_rval_t dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_UE_NR_Capability,
|
||||
(void **)&ue_context_p->ue_context.UE_Capability_nr,
|
||||
ueCapabilityRAT_Container_nr->buf,
|
||||
ueCapabilityRAT_Container_nr->size, 0, 0);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC, "Failed to decode UE NR capabilities (%zu bytes) container size %lu\n", dec_rval.consumed,ueCapabilityRAT_Container_nr->size);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,
|
||||
ue_context_p->ue_context.UE_Capability_nr);
|
||||
ue_context_p->ue_context.UE_Capability_nr = 0;
|
||||
AssertFatal(1==0,"exiting\n");
|
||||
}
|
||||
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_UE_MRDC_Capability,
|
||||
(void **)&ue_context_p->ue_context.UE_Capability_MRDC,
|
||||
ueCapabilityRAT_Container_MRDC->buf,
|
||||
ueCapabilityRAT_Container_MRDC->size, 0, 0);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC, "Failed to decode UE MRDC capabilities (%zu bytes)\n", dec_rval.consumed);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_MRDC_Capability,
|
||||
ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
ue_context_p->ue_context.UE_Capability_MRDC = 0;
|
||||
AssertFatal(1==0,"exiting\n");
|
||||
}
|
||||
|
||||
// dump ue_capabilities
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_UE_NR_Capability, ue_context_p->ue_context.UE_Capability_nr);
|
||||
}
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_UE_MRDC_Capability, ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
}
|
||||
|
||||
rrc_add_nsa_user(rrc,ue_context_p);
|
||||
}
|
||||
|
||||
void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_p) {
|
||||
|
||||
// generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331)
|
||||
|
||||
rrc_gNB_carrier_data_t *carrier=&rrc->carrier;
|
||||
|
||||
MessageDef *msg;
|
||||
msg = itti_alloc_new_message(TASK_RRC_ENB, X2AP_ENDC_SGNB_ADDITION_REQ_ACK);
|
||||
|
||||
// NR RRCReconfiguration
|
||||
|
||||
AssertFatal(rrc->Nb_ue < MAX_NR_RRC_UE_CONTEXTS,"cannot add another UE\n");
|
||||
|
||||
ue_context_p->ue_context.reconfig = calloc(1,sizeof(NR_RRCReconfiguration_t));
|
||||
ue_context_p->ue_context.secondaryCellGroup = calloc(1,sizeof(NR_CellGroupConfig_t));
|
||||
memset((void*)ue_context_p->ue_context.reconfig,0,sizeof(NR_RRCReconfiguration_t));
|
||||
ue_context_p->ue_context.reconfig->rrc_TransactionIdentifier=0;
|
||||
ue_context_p->ue_context.reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
|
||||
NR_RRCReconfiguration_IEs_t *reconfig_ies=calloc(1,sizeof(NR_RRCReconfiguration_IEs_t));
|
||||
ue_context_p->ue_context.reconfig->criticalExtensions.choice.rrcReconfiguration = reconfig_ies;
|
||||
carrier->initial_csi_index[rrc->Nb_ue] = 0;
|
||||
fill_default_reconfig(carrier->servingcellconfigcommon,
|
||||
reconfig_ies,
|
||||
ue_context_p->ue_context.secondaryCellGroup,
|
||||
carrier->pdsch_AntennaPorts,
|
||||
carrier->initial_csi_index[rrc->Nb_ue]);
|
||||
|
||||
ue_context_p->ue_context.rb_config = calloc(1,sizeof(NR_RRCReconfiguration_t));
|
||||
|
||||
fill_default_rbconfig(ue_context_p->ue_context.rb_config);
|
||||
ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config));
|
||||
memset((void*)CG_Config,0,sizeof(*CG_Config));
|
||||
int CG_Config_size = generate_CG_Config(rrc,CG_Config,ue_context_p->ue_context.reconfig,ue_context_p->ue_context.rb_config);
|
||||
|
||||
//X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = CG_Config_size; //Need to verify correct value for the buffer_size
|
||||
// Send to X2 entity to transport to MeNB
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CG_Config,
|
||||
NULL,
|
||||
(void *)CG_Config,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer,
|
||||
1024);
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = (enc_rval.encoded+7)>>3;
|
||||
|
||||
itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(0), msg); //Check right id instead of hardcoding
|
||||
|
||||
rrc->Nb_ue++;
|
||||
// configure MAC and RLC
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.pdsch_AntennaPorts,
|
||||
NULL,
|
||||
1, // add_ue flag
|
||||
ue_context_p->ue_id_rnti,
|
||||
ue_context_p->ue_context.secondaryCellGroup);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,11 +34,8 @@
|
||||
#include "rrc_proto.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
int nr_l3_init_ue(void){
|
||||
LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n");
|
||||
|
||||
openair_rrc_top_init_ue_nr();
|
||||
|
||||
return 0;
|
||||
NR_UE_RRC_INST_t* nr_l3_init_ue(char* rrc_config_path){
|
||||
//LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n");
|
||||
|
||||
return openair_rrc_top_init_ue_nr(rrc_config_path);
|
||||
}
|
||||
|
||||
+101
-14
@@ -44,7 +44,7 @@
|
||||
#include "rrc_vars.h"
|
||||
#include "mac_proto.h"
|
||||
|
||||
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
|
||||
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
|
||||
@@ -80,11 +80,19 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
|
||||
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cell_group_config, 0);
|
||||
}
|
||||
|
||||
//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 );
|
||||
//nr_rrc_mac_config_req_ue( 0,0,0,NULL, cell_group_config->mac_CellGroupConfig, cell_group_config->physicalCellGroupConfig, cell_group_config->spCellConfig );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_rrc_ue_process_RadioBearerConfig(NR_RadioBearerConfig_t *RadioBearerConfig){
|
||||
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
|
||||
// Configure PDCP
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (decoded)
|
||||
// RRCReconfiguration
|
||||
@@ -96,7 +104,7 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
|
||||
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->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig);
|
||||
nr_rrc_ue_process_RadioBearerConfig(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,14 +116,17 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
|
||||
(uint8_t *)rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->buf,
|
||||
rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->size, 0, 0);
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)cellGroupConfig);
|
||||
|
||||
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.
|
||||
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)NR_UE_rrc_inst->cell_group_config, 0);
|
||||
NR_UE_rrc_inst->cell_group_config = cellGroupConfig;
|
||||
nr_rrc_ue_process_scg_config(cellGroupConfig);
|
||||
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cellGroupConfig, 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -148,6 +159,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){
|
||||
|
||||
return 0;
|
||||
@@ -156,8 +169,7 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_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
|
||||
|
||||
// initial list
|
||||
if(cell_group_config->spCellConfig != NULL){
|
||||
if(cell_group_config->spCellConfig->spCellConfigDedicated != NULL){
|
||||
if(cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList != NULL){
|
||||
@@ -167,8 +179,6 @@ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
// maintain list
|
||||
if(cell_group_config->spCellConfig != NULL){
|
||||
@@ -197,13 +207,57 @@ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){
|
||||
|
||||
return 0;
|
||||
}
|
||||
int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config){
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
|
||||
void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message,int msg_len) {
|
||||
|
||||
switch (nsa_message_type) {
|
||||
case nr_SecondaryCellGroupConfig_r15:
|
||||
{
|
||||
NR_RRCReconfiguration_t *RRCReconfiguration=NULL;
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_RRCReconfiguration,
|
||||
(void **)&RRCReconfiguration,
|
||||
(uint8_t *)message,
|
||||
msg_len);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC,"NR_RRCReconfiguration decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_RRCReconfiguration, RRCReconfiguration, 1 );
|
||||
return;
|
||||
}
|
||||
nr_rrc_ue_process_rrcReconfiguration(RRCReconfiguration);
|
||||
}
|
||||
break;
|
||||
case nr_RadioBearerConfigX_r15:
|
||||
{
|
||||
NR_RadioBearerConfig_t *RadioBearerConfig=NULL;
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_RadioBearerConfig,
|
||||
(void **)&RadioBearerConfig,
|
||||
(uint8_t *)message,
|
||||
msg_len);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC,"NR_RadioBearerConfig decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_RadioBearerConfig, RadioBearerConfig, 1 );
|
||||
return;
|
||||
}
|
||||
nr_rrc_ue_process_RadioBearerConfig(RadioBearerConfig);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Unknown message %d\n",nsa_message_type);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int8_t openair_rrc_top_init_ue_nr(void){
|
||||
NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){
|
||||
|
||||
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));
|
||||
@@ -264,11 +318,44 @@ int8_t openair_rrc_top_init_ue_nr(void){
|
||||
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);
|
||||
|
||||
if (get_softmodem_params()->phy_test==1) {
|
||||
// read in files for RRCReconfiguration and RBconfig
|
||||
FILE *fd;
|
||||
char filename[1024];
|
||||
if (rrc_config_path)
|
||||
sprintf(filename,"%s/reconfig.raw",rrc_config_path);
|
||||
else
|
||||
sprintf(filename,"reconfig.raw");
|
||||
fd = fopen(filename,"r");
|
||||
char buffer[1024];
|
||||
AssertFatal(fd,
|
||||
"cannot read file %s: errno %d, %s\n",
|
||||
filename,
|
||||
errno,
|
||||
strerror(errno));
|
||||
int msg_len=fread(buffer,1,1024,fd);
|
||||
fclose(fd);
|
||||
process_nsa_message(NR_UE_rrc_inst, nr_SecondaryCellGroupConfig_r15, buffer,msg_len);
|
||||
if (rrc_config_path)
|
||||
sprintf(filename,"%s/rbconfig.raw",rrc_config_path);
|
||||
else
|
||||
sprintf(filename,"rbconfig.raw");
|
||||
fd = fopen(filename,"r");
|
||||
AssertFatal(fd,
|
||||
"cannot read file %s: errno %d, %s\n",
|
||||
filename,
|
||||
errno,
|
||||
strerror(errno));
|
||||
msg_len=fread(buffer,1,1024,fd);
|
||||
fclose(fd);
|
||||
process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len);
|
||||
}
|
||||
}else{
|
||||
NR_UE_rrc_inst = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NR_UE_rrc_inst;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,7 +426,7 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
|
||||
// (void *)&bcch_message->message.choice.mib,
|
||||
// sizeof(NR_MIB_t) );
|
||||
|
||||
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL);
|
||||
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -58,12 +58,17 @@
|
||||
|
||||
typedef uint32_t channel_t;
|
||||
|
||||
typedef enum {
|
||||
nr_SecondaryCellGroupConfig_r15=0,
|
||||
nr_RadioBearerConfigX_r15=1
|
||||
} nsa_message_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
|
||||
|
||||
@@ -43,14 +43,14 @@
|
||||
// main_rrc.c
|
||||
//
|
||||
/**\brief Layer 3 initialization*/
|
||||
int nr_l3_init_ue(void);
|
||||
NR_UE_RRC_INST_t* nr_l3_init_ue(char*);
|
||||
|
||||
//
|
||||
// UE_rrc.c
|
||||
//
|
||||
|
||||
/**\brief Initial the top level RRC structure instance*/
|
||||
int8_t openair_rrc_top_init_ue_nr(void);
|
||||
NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*);
|
||||
|
||||
|
||||
|
||||
|
||||
+97
-10
@@ -101,7 +101,6 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_enb_data_p;
|
||||
DevAssert(sctp_new_association_resp != NULL);
|
||||
printf("x2ap_eNB_handle_sctp_association_resp at 1\n");
|
||||
dump_trees();
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
@@ -129,7 +128,6 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
x2ap_enb_data_p = x2ap_get_eNB(instance_p, -1,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
DevAssert(x2ap_enb_data_p != NULL);
|
||||
printf("x2ap_eNB_handle_sctp_association_resp at 2\n");
|
||||
dump_trees();
|
||||
|
||||
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
|
||||
@@ -142,17 +140,17 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
return;
|
||||
}
|
||||
|
||||
printf("x2ap_eNB_handle_sctp_association_resp at 3\n");
|
||||
dump_trees();
|
||||
/* Update parameters */
|
||||
x2ap_enb_data_p->assoc_id = sctp_new_association_resp->assoc_id;
|
||||
x2ap_enb_data_p->in_streams = sctp_new_association_resp->in_streams;
|
||||
x2ap_enb_data_p->out_streams = sctp_new_association_resp->out_streams;
|
||||
printf("x2ap_eNB_handle_sctp_association_resp at 4\n");
|
||||
dump_trees();
|
||||
/* Prepare new x2 Setup Request */
|
||||
x2ap_eNB_generate_x2_setup_request(instance_p, x2ap_enb_data_p);
|
||||
//x2ap_eNB_generate_ENDC_x2_setup_request(instance_p, x2ap_enb_data_p);
|
||||
if(instance_p->cell_type == CELL_MACRO_GNB)
|
||||
x2ap_gNB_generate_ENDC_x2_setup_request(instance_p, x2ap_enb_data_p);
|
||||
else
|
||||
x2ap_eNB_generate_x2_setup_request(instance_p, x2ap_enb_data_p);
|
||||
}
|
||||
|
||||
static
|
||||
@@ -448,6 +446,78 @@ void x2ap_eNB_handle_handover_req_ack(instance_t instance,
|
||||
x2ap_eNB_generate_x2_handover_request_ack(instance_p, target, x2ap_handover_req_ack);
|
||||
}
|
||||
|
||||
static
|
||||
void x2ap_eNB_handle_sgNB_add_req(instance_t instance,
|
||||
x2ap_ENDC_sgnb_addition_req_t *x2ap_ENDC_sgnb_addition_req)
|
||||
{
|
||||
x2ap_id_manager *id_manager;
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
int ue_id;
|
||||
|
||||
/* TODO: remove hardcoded value */
|
||||
x2ap_eNB_data = x2ap_is_eNB_id_in_list(3584);
|
||||
DevAssert(x2ap_eNB_data != NULL);
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
/* allocate x2ap ID */
|
||||
id_manager = &instance_p->id_manager;
|
||||
ue_id = x2ap_allocate_new_id(id_manager);
|
||||
if (ue_id == -1) {
|
||||
X2AP_ERROR("could not allocate a new X2AP UE ID\n");
|
||||
/* TODO: cancel NSA: send (to be defined) message to RRC */
|
||||
exit(1);
|
||||
}
|
||||
/* id_source is ue_id, id_target is unknown yet */
|
||||
x2ap_set_ids(id_manager, ue_id, x2ap_ENDC_sgnb_addition_req->rnti, ue_id, -1);
|
||||
x2ap_id_set_state(id_manager, ue_id, X2ID_STATE_NSA_PREPARE);
|
||||
|
||||
x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(instance_p, x2ap_eNB_data, ue_id);
|
||||
}
|
||||
|
||||
static
|
||||
void x2ap_gNB_trigger_sgNB_add_req_ack(instance_t instance,
|
||||
x2ap_ENDC_sgnb_addition_req_ACK_t *x2ap_ENDC_sgnb_addition_req_ACK)
|
||||
{
|
||||
/* TODO: remove this hack (the goal is to find the correct
|
||||
* eNodeB structure for the other end) - we need a proper way for RRC
|
||||
* and X2AP to identify eNodeBs
|
||||
* RRC knows about mod_id and X2AP knows about eNB_id (eNB_ID in
|
||||
* the configuration file)
|
||||
* as far as I understand.. CROUX
|
||||
*/
|
||||
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *target;
|
||||
/*int source_assoc_id = x2ap_ENDC_sgnb_addition_req_ACK->source_assoc_id;
|
||||
int ue_id;
|
||||
int id_source;
|
||||
int id_target;*/
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
/*target = x2ap_get_eNB(NULL, source_assoc_id, 0);
|
||||
DevAssert(target != NULL);*/
|
||||
|
||||
// rnti is a new information, save it
|
||||
|
||||
/*ue_id = x2ap_handover_req_ack->x2_id_target;
|
||||
id_source = x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
|
||||
id_target = ue_id;
|
||||
x2ap_set_ids(&instance_p->id_manager, ue_id, x2ap_handover_req_ack->rnti, id_source, id_target);*/
|
||||
|
||||
|
||||
//target = x2ap_get_eNB(NULL, 17, 0);
|
||||
target = x2ap_is_eNB_id_in_list (3585); //Currently hardcoded. Need to extract it differently
|
||||
DevAssert(target != NULL);
|
||||
x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK(instance_p, target, x2ap_ENDC_sgnb_addition_req_ACK, 0);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
void x2ap_eNB_ue_context_release(instance_t instance,
|
||||
x2ap_ue_context_release_t *x2ap_ue_context_release)
|
||||
@@ -513,6 +583,17 @@ void *x2ap_task(void *arg) {
|
||||
&X2AP_UE_CONTEXT_RELEASE(received_msg));
|
||||
break;
|
||||
|
||||
case X2AP_ENDC_SGNB_ADDITION_REQ:
|
||||
x2ap_eNB_handle_sgNB_add_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
&X2AP_ENDC_SGNB_ADDITION_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case X2AP_ENDC_SGNB_ADDITION_REQ_ACK:
|
||||
x2ap_gNB_trigger_sgNB_add_req_ack(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
&X2AP_ENDC_SGNB_ADDITION_REQ_ACK(received_msg));
|
||||
LOG_I(X2AP, "Received elements for X2AP_ENDC_SGNB_ADDITION_REQ_ACK \n");
|
||||
break;
|
||||
|
||||
case SCTP_INIT_MSG_MULTI_CNF:
|
||||
x2ap_eNB_handle_sctp_init_msg_multi_cnf(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_init_msg_multi_cnf);
|
||||
@@ -556,7 +637,6 @@ int is_x2ap_enabled(void)
|
||||
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
if (pthread_mutex_lock(&mutex)) goto mutex_error;
|
||||
|
||||
if (config_loaded) {
|
||||
if (pthread_mutex_unlock(&mutex)) goto mutex_error;
|
||||
return enabled;
|
||||
@@ -569,13 +649,20 @@ int is_x2ap_enabled(void)
|
||||
|
||||
/* TODO: do it per module - we check only first eNB */
|
||||
config_get(p, sizeof(p)/sizeof(paramdef_t), "eNBs.[0]");
|
||||
if (enable_x2 != NULL && strcmp(enable_x2, "yes") == 0)
|
||||
enabled = 1;
|
||||
if (enable_x2 != NULL && strcmp(enable_x2, "yes") == 0){
|
||||
enabled = 1;
|
||||
}
|
||||
|
||||
/*Consider also the case of enabling X2AP for a gNB by parsing a gNB configuration file*/
|
||||
|
||||
config_get(p, sizeof(p)/sizeof(paramdef_t), "gNBs.[0]");
|
||||
if (enable_x2 != NULL && strcmp(enable_x2, "yes") == 0){
|
||||
enabled = 1;
|
||||
}
|
||||
|
||||
config_loaded = 1;
|
||||
|
||||
if (pthread_mutex_unlock(&mutex)) goto mutex_error;
|
||||
|
||||
return enabled;
|
||||
|
||||
mutex_error:
|
||||
|
||||
@@ -60,8 +60,14 @@ static int x2ap_eNB_decode_initiating_message(X2AP_X2AP_PDU_t *pdu)
|
||||
break;
|
||||
|
||||
case X2AP_ProcedureCode_id_endcX2Setup:
|
||||
X2AP_INFO("X2AP_ProcedureCode_id_endcX2Setup message!\n");
|
||||
break;
|
||||
X2AP_INFO("X2AP_ProcedureCode_id_endcX2Setup message!\n");
|
||||
break;
|
||||
case X2AP_ProcedureCode_id_sgNBAdditionPreparation:
|
||||
X2AP_INFO("X2AP_ProcedureCode_id_sgNBAdditionPreparation message!\n");
|
||||
break;
|
||||
case X2AP_ProcedureCode_id_sgNBReconfigurationCompletion:
|
||||
X2AP_INFO("X2AP_ProcedureCode_id_sgNBReconfigurationCompletion message!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
X2AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
|
||||
@@ -93,6 +99,10 @@ static int x2ap_eNB_decode_successful_outcome(X2AP_X2AP_PDU_t *pdu)
|
||||
X2AP_INFO("x2ap_eNB_decode_successfuloutcome_message!\n");
|
||||
break;
|
||||
|
||||
case X2AP_ProcedureCode_id_sgNBAdditionPreparation:
|
||||
X2AP_INFO("x2ap_eNB_decode_successfuloutcome_message!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
X2AP_ERROR("Unknown procedure ID (%d) for successfull outcome message\n",
|
||||
(int)pdu->choice.successfulOutcome.procedureCode);
|
||||
@@ -134,9 +144,9 @@ int x2ap_eNB_decode_pdu(X2AP_X2AP_PDU_t *pdu, const uint8_t *const buffer, uint3
|
||||
length,
|
||||
0,
|
||||
0);
|
||||
if (asn1_xer_print) {
|
||||
//if (asn1_xer_print) {
|
||||
xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
}
|
||||
//}
|
||||
|
||||
if (dec_ret.code != RC_OK) {
|
||||
X2AP_ERROR("Failed to decode pdu\n");
|
||||
|
||||
@@ -44,9 +44,9 @@ int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
|
||||
DevAssert(buffer != NULL);
|
||||
DevAssert(len != NULL);
|
||||
|
||||
if (asn1_xer_print) {
|
||||
//if (asn1_xer_print) {
|
||||
xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)pdu);
|
||||
}
|
||||
//}
|
||||
|
||||
encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, pdu, (void **)buffer);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "x2ap_ids.h"
|
||||
|
||||
#include "x2ap_eNB_itti_messaging.h"
|
||||
#include "X2AP_SupportedSULFreqBandItem.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
@@ -1097,7 +1098,6 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2
|
||||
return ret;
|
||||
}
|
||||
|
||||
//Panos:
|
||||
int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
|
||||
x2ap_senb_addition_req_ack_t *x2ap_addition_req_ack)
|
||||
{
|
||||
@@ -1118,8 +1118,6 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
//Panos: The fact that we have separate IDs here is because the ID for a specific UE might be different
|
||||
//between the 2 eNBs?
|
||||
//ue_id = x2ap_addition_req_ack->x2_id_target; //Panos: change name to master_x2...
|
||||
//id_source = x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
|
||||
//id_target = ue_id;
|
||||
@@ -1128,7 +1126,6 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome.procedureCode = X2AP_ProcedureCode_id_seNBAdditionPreparation;
|
||||
//Panos: What does the criticality indicate here?
|
||||
pdu.choice.successfulOutcome.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.successfulOutcome.value.present = X2AP_SuccessfulOutcome__value_PR_SeNBAdditionRequestAcknowledge;
|
||||
out = &pdu.choice.successfulOutcome.value.choice.SeNBAdditionRequestAcknowledge;
|
||||
@@ -1144,7 +1141,6 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p
|
||||
/* mandatory */
|
||||
ie = (X2AP_SeNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequestAcknowledge_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_SeNB_UE_X2AP_ID;
|
||||
//Panos: Why for the X2_HANDOVER_REQ_ACK here the criticality is ignore whereas in the specs it is reject?
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SeNBAdditionRequestAcknowledge_IEs__value_PR_UE_X2AP_ID_1;
|
||||
ie->value.choice.UE_X2AP_ID_1 = 0;
|
||||
@@ -1230,17 +1226,17 @@ int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*setup request message from an eNB to a gNB*/
|
||||
int x2ap_eNB_generate_ENDC_x2_setup_request(
|
||||
/*setup request message from a gNB to an eNB*/
|
||||
int x2ap_gNB_generate_ENDC_x2_setup_request(
|
||||
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p)
|
||||
{
|
||||
printf("In x2ap_eNB_generate_ENDC_x2_setup_request \n");
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_ENDCX2SetupRequest_t *out;
|
||||
X2AP_ENDCX2SetupRequest_IEs_t *ie;
|
||||
X2AP_ENB_ENDCX2SetupReqIEs_t *ie_ENB_ENDC;
|
||||
X2AP_En_gNB_ENDCX2SetupReqIEs_t *ie_GNB_ENDC;
|
||||
X2AP_PLMN_Identity_t *plmn;
|
||||
ServedEUTRAcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
ServedNRcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
X2AP_SupportedSULFreqBandItem_t *SULFreqBandItem;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
@@ -1262,24 +1258,166 @@ int x2ap_eNB_generate_ENDC_x2_setup_request(
|
||||
ie = (X2AP_ENDCX2SetupRequest_IEs_t *)calloc(1, sizeof(X2AP_ENDCX2SetupRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_InitiatingNodeType_EndcX2Setup;
|
||||
ie->value.present = X2AP_ENDCX2SetupRequest_IEs__value_PR_InitiatingNodeType_EndcX2Setup;
|
||||
ie->value.choice.InitiatingNodeType_EndcX2Setup.present = X2AP_InitiatingNodeType_EndcX2Setup_PR_init_eNB;
|
||||
ie->value.choice.InitiatingNodeType_EndcX2Setup.present = X2AP_InitiatingNodeType_EndcX2Setup_PR_init_en_gNB;
|
||||
|
||||
ie_ENB_ENDC = (X2AP_ENB_ENDCX2SetupReqIEs_t *)calloc(1, sizeof(X2AP_ENB_ENDCX2SetupReqIEs_t));
|
||||
ie_GNB_ENDC = (X2AP_En_gNB_ENDCX2SetupReqIEs_t *)calloc(1, sizeof(X2AP_En_gNB_ENDCX2SetupReqIEs_t));
|
||||
ie_GNB_ENDC->id = X2AP_ProtocolIE_ID_id_Globalen_gNB_ID;
|
||||
ie_GNB_ENDC->criticality = X2AP_Criticality_reject;
|
||||
ie_GNB_ENDC->value.present = X2AP_En_gNB_ENDCX2SetupReqAckIEs__value_PR_GlobalGNB_ID;
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.present = X2AP_GNB_ID_PR_gNB_ID;
|
||||
INT32_TO_OCTET_STRING(instance_p->eNB_id,
|
||||
&ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID);
|
||||
|
||||
X2AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id,
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[0],
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[1],
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[2]);
|
||||
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&ie_GNB_ENDC->value.choice.GlobalGNB_ID.pLMN_Identity);
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list, ie_GNB_ENDC);
|
||||
|
||||
ie_GNB_ENDC = (X2AP_En_gNB_ENDCX2SetupReqIEs_t *)calloc(1, sizeof(X2AP_En_gNB_ENDCX2SetupReqIEs_t));
|
||||
ie_GNB_ENDC->id = X2AP_ProtocolIE_ID_id_ServedNRcellsENDCX2ManagementList;
|
||||
ie_GNB_ENDC->criticality = X2AP_Criticality_reject;
|
||||
ie_GNB_ENDC->value.present = X2AP_En_gNB_ENDCX2SetupReqIEs__value_PR_ServedNRcellsENDCX2ManagementList;
|
||||
|
||||
{
|
||||
for (int i = 0; i<instance_p->num_cc; i++){
|
||||
servedCellMember = (ServedNRcellsENDCX2ManagementList__Member *)calloc(1,sizeof(ServedNRcellsENDCX2ManagementList__Member));
|
||||
{
|
||||
servedCellMember->servedNRCellInfo.nrpCI = instance_p->Nid_cell[i];
|
||||
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&servedCellMember->servedNRCellInfo.nrCellID.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(instance_p->eNB_id,
|
||||
&servedCellMember->servedNRCellInfo.nrCellID.nRcellIdentifier);
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC = calloc(1, sizeof(X2AP_FiveGS_TAC_t));
|
||||
if (servedCellMember->servedNRCellInfo.fiveGS_TAC == NULL)
|
||||
exit(1);
|
||||
NR_FIVEGS_TAC_ID_TO_BIT_STRING(instance_p->tac, servedCellMember->servedNRCellInfo.fiveGS_TAC);
|
||||
|
||||
X2AP_INFO("TAC: %d -> %02x%02x%02x\n", instance_p->tac,
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC->buf[0],
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC->buf[1],
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC->buf[2]);
|
||||
|
||||
plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t));
|
||||
{
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn);
|
||||
ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.broadcastPLMNs.list, plmn);
|
||||
}
|
||||
|
||||
if (instance_p->frame_type[i] == TDD) {
|
||||
X2AP_FreqBandNrItem_t *freq_band;
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.present = X2AP_ServedNRCell_Information__nrModeInfo_PR_tdd;
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nRFreqInfo.nRARFCN = 0; //instance_p->tdd_nRARFCN[i];
|
||||
/* addition of Frequency Band List */
|
||||
freq_band = calloc(1, sizeof(X2AP_FreqBandNrItem_t));
|
||||
if (freq_band == NULL)
|
||||
exit(1);
|
||||
freq_band->freqBandIndicatorNr = 1; /* TODO: put correct value */
|
||||
|
||||
SULFreqBandItem = calloc(1, sizeof(X2AP_SupportedSULFreqBandItem_t));
|
||||
SULFreqBandItem->freqBandIndicatorNr=80; /* TODO: put correct value */
|
||||
ASN_SEQUENCE_ADD(&freq_band->supportedSULBandList.list, SULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nRFreqInfo.freqBandListNr, freq_band);
|
||||
switch (instance_p->N_RB_DL[i]) {
|
||||
case 50:
|
||||
//This is not correct. Just to be able to test X2 only using an eNB instead of gNB
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb51;
|
||||
break;
|
||||
case 93 :
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb93;
|
||||
break;
|
||||
case 106:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb106;
|
||||
break;
|
||||
case 121:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb121;
|
||||
break;
|
||||
/*More cases to be added */
|
||||
default:
|
||||
AssertFatal(0,"Failed: Check value for N_RB_DL/N_RB_UL");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
AssertFatal(0,"ENDC_X2Setuprequest not supported for FDD!");
|
||||
}
|
||||
/*Don't know where to extract the value of measurementTimingConfiguration from. Set it to 0 for now */
|
||||
INT8_TO_OCTET_STRING(0, &servedCellMember->servedNRCellInfo.measurementTimingConfiguration);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie_GNB_ENDC->value.choice.ServedNRcellsENDCX2ManagementList.list, servedCellMember);
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list, ie_GNB_ENDC);
|
||||
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode ENDC X2 setup request\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int x2ap_eNB_generate_ENDC_x2_setup_response(
|
||||
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_ENDCX2SetupResponse_t *out;
|
||||
X2AP_ENDCX2SetupResponse_IEs_t *ie;
|
||||
X2AP_ENB_ENDCX2SetupReqAckIEs_t *ie_ENB_ENDC;
|
||||
X2AP_PLMN_Identity_t *plmn;
|
||||
ServedEUTRAcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_WAITING;
|
||||
|
||||
/* Prepare the X2AP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome.procedureCode = X2AP_ProcedureCode_id_endcX2Setup;
|
||||
pdu.choice.successfulOutcome.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.successfulOutcome.value.present = X2AP_SuccessfulOutcome__value_PR_ENDCX2SetupResponse;
|
||||
out = &pdu.choice.successfulOutcome.value.choice.ENDCX2SetupResponse;
|
||||
|
||||
ie = (X2AP_ENDCX2SetupResponse_IEs_t *)calloc(1, sizeof(X2AP_ENDCX2SetupResponse_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_RespondingNodeType_EndcX2Setup;
|
||||
ie->value.present = X2AP_ENDCX2SetupResponse_IEs__value_PR_RespondingNodeType_EndcX2Setup;
|
||||
ie->value.choice.RespondingNodeType_EndcX2Setup.present = X2AP_RespondingNodeType_EndcX2Setup_PR_respond_eNB;
|
||||
|
||||
ie_ENB_ENDC = (X2AP_ENB_ENDCX2SetupReqAckIEs_t *)calloc(1, sizeof(X2AP_ENB_ENDCX2SetupReqAckIEs_t));
|
||||
ie_ENB_ENDC->id = X2AP_ProtocolIE_ID_id_GlobalENB_ID;
|
||||
ie_ENB_ENDC->criticality = X2AP_Criticality_reject;
|
||||
ie_ENB_ENDC->value.present = X2AP_ENB_ENDCX2SetupReqIEs__value_PR_GlobalENB_ID;
|
||||
ie_ENB_ENDC->value.present = X2AP_ENB_ENDCX2SetupReqAckIEs__value_PR_GlobalENB_ID;
|
||||
ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.present = X2AP_ENB_ID_PR_macro_eNB_ID;
|
||||
MACRO_ENB_ID_TO_BIT_STRING(instance_p->eNB_id,
|
||||
&ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID);
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&ie_ENB_ENDC->value.choice.GlobalENB_ID.pLMN_Identity);
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_eNB.list, ie_ENB_ENDC);
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list, ie_ENB_ENDC);
|
||||
|
||||
ie_ENB_ENDC = (X2AP_ENB_ENDCX2SetupReqIEs_t *)calloc(1, sizeof(X2AP_ENB_ENDCX2SetupReqIEs_t));
|
||||
ie_ENB_ENDC = (X2AP_ENB_ENDCX2SetupReqAckIEs_t *)calloc(1, sizeof(X2AP_ENB_ENDCX2SetupReqAckIEs_t));
|
||||
ie_ENB_ENDC->id = X2AP_ProtocolIE_ID_id_ServedEUTRAcellsENDCX2ManagementList;
|
||||
ie_ENB_ENDC->criticality = X2AP_Criticality_reject;
|
||||
ie_ENB_ENDC->value.present = X2AP_ENB_ENDCX2SetupReqIEs__value_PR_ServedEUTRAcellsENDCX2ManagementList;
|
||||
ie_ENB_ENDC->value.present = X2AP_ENB_ENDCX2SetupReqAckIEs__value_PR_ServedEUTRAcellsENDCX2ManagementList;
|
||||
|
||||
{
|
||||
for (int i = 0; i<instance_p->num_cc; i++){
|
||||
@@ -1299,11 +1437,11 @@ int x2ap_eNB_generate_ENDC_x2_setup_request(
|
||||
ASN_SEQUENCE_ADD(&servedCellMember->servedEUTRACellInfo.broadcastPLMNs.list, plmn);
|
||||
}
|
||||
|
||||
if (instance_p->frame_type[i] == FDD) {
|
||||
servedCellMember->servedEUTRACellInfo.eUTRA_Mode_Info.present = X2AP_EUTRA_Mode_Info_PR_fDD;
|
||||
if (instance_p->frame_type[i] == FDD) {
|
||||
servedCellMember->servedEUTRACellInfo.eUTRA_Mode_Info.present = X2AP_EUTRA_Mode_Info_PR_fDD;
|
||||
servedCellMember->servedEUTRACellInfo.eUTRA_Mode_Info.choice.fDD.dL_EARFCN = instance_p->fdd_earfcn_DL[i];
|
||||
servedCellMember->servedEUTRACellInfo.eUTRA_Mode_Info.choice.fDD.uL_EARFCN = instance_p->fdd_earfcn_UL[i];
|
||||
switch (instance_p->N_RB_DL[i]) {
|
||||
switch (instance_p->N_RB_DL[i]) {
|
||||
case 6:
|
||||
servedCellMember->servedEUTRACellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw6;
|
||||
servedCellMember->servedEUTRACellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw6;
|
||||
@@ -1334,177 +1472,13 @@ int x2ap_eNB_generate_ENDC_x2_setup_request(
|
||||
}
|
||||
}
|
||||
else {
|
||||
AssertFatal(0,"X2Setuprequest not supported for TDD!");
|
||||
AssertFatal(0,"X2Setupresponse not supported for TDD!");
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list, servedCellMember);
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_eNB.list, ie_ENB_ENDC);
|
||||
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode ENDC X2 setup request\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*setup request message from an eNB to a gNB*/
|
||||
int x2ap_gNB_generate_ENDC_x2_setup_response(
|
||||
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p)
|
||||
{
|
||||
X2AP_INFO("In x2ap_gNB_generate_ENDC_x2_setup_response ()!\n");
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_ENDCX2SetupResponse_t *out;
|
||||
X2AP_ENDCX2SetupResponse_IEs_t *ie;
|
||||
X2AP_En_gNB_ENDCX2SetupReqAckIEs_t *ie_GNB_ENDC;
|
||||
X2AP_PLMN_Identity_t *plmn;
|
||||
ServedNRcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_WAITING;
|
||||
|
||||
/* Prepare the X2AP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome.procedureCode = X2AP_ProcedureCode_id_endcX2Setup;
|
||||
pdu.choice.successfulOutcome.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.successfulOutcome.value.present = X2AP_SuccessfulOutcome__value_PR_ENDCX2SetupResponse;
|
||||
out = &pdu.choice.successfulOutcome.value.choice.ENDCX2SetupResponse;
|
||||
|
||||
ie = (X2AP_ENDCX2SetupResponse_IEs_t *)calloc(1, sizeof(X2AP_ENDCX2SetupResponse_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_RespondingNodeType_EndcX2Setup;
|
||||
ie->value.present = X2AP_ENDCX2SetupResponse_IEs__value_PR_RespondingNodeType_EndcX2Setup;
|
||||
ie->value.choice.RespondingNodeType_EndcX2Setup.present = X2AP_RespondingNodeType_EndcX2Setup_PR_respond_en_gNB;
|
||||
|
||||
ie_GNB_ENDC = (X2AP_En_gNB_ENDCX2SetupReqAckIEs_t *)calloc(1, sizeof(X2AP_En_gNB_ENDCX2SetupReqAckIEs_t));
|
||||
ie_GNB_ENDC->id = X2AP_ProtocolIE_ID_id_Globalen_gNB_ID;
|
||||
ie_GNB_ENDC->criticality = X2AP_Criticality_reject;
|
||||
ie_GNB_ENDC->value.present = X2AP_En_gNB_ENDCX2SetupReqAckIEs__value_PR_GlobalGNB_ID;
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.present = X2AP_GNB_ID_PR_gNB_ID;
|
||||
|
||||
INT32_TO_OCTET_STRING(instance_p->eNB_id,
|
||||
&ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID);
|
||||
|
||||
X2AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id,
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[0],
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[1],
|
||||
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[2]);
|
||||
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&ie_GNB_ENDC->value.choice.GlobalGNB_ID.pLMN_Identity);
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_en_gNB.list, ie_GNB_ENDC);
|
||||
|
||||
ie_GNB_ENDC = (X2AP_En_gNB_ENDCX2SetupReqAckIEs_t *)calloc(1, sizeof(X2AP_En_gNB_ENDCX2SetupReqAckIEs_t));
|
||||
ie_GNB_ENDC->id = X2AP_ProtocolIE_ID_id_ServedNRcellsENDCX2ManagementList;
|
||||
ie_GNB_ENDC->criticality = X2AP_Criticality_reject;
|
||||
ie_GNB_ENDC->value.present = X2AP_En_gNB_ENDCX2SetupReqAckIEs__value_PR_ServedNRcellsENDCX2ManagementList;
|
||||
|
||||
{
|
||||
for (int i = 0; i<instance_p->num_cc; i++){
|
||||
servedCellMember = (ServedNRcellsENDCX2ManagementList__Member *)calloc(1,sizeof(ServedNRcellsENDCX2ManagementList__Member));
|
||||
{
|
||||
servedCellMember->servedNRCellInfo.nrpCI = instance_p->Nid_cell[i];
|
||||
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&servedCellMember->servedNRCellInfo.nrCellID.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(instance_p->eNB_id,
|
||||
&servedCellMember->servedNRCellInfo.nrCellID.nRcellIdentifier);
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC = calloc(1, sizeof(X2AP_FiveGS_TAC_t));
|
||||
if (servedCellMember->servedNRCellInfo.fiveGS_TAC == NULL)
|
||||
exit(1);
|
||||
NR_FIVEGS_TAC_ID_TO_BIT_STRING(instance_p->tac, servedCellMember->servedNRCellInfo.fiveGS_TAC);
|
||||
|
||||
X2AP_INFO("TAC: %d -> %02x%02x%02x\n", instance_p->tac,
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC->buf[0],
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC->buf[1],
|
||||
servedCellMember->servedNRCellInfo.fiveGS_TAC->buf[2]);
|
||||
|
||||
plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t));
|
||||
{
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn);
|
||||
ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.broadcastPLMNs.list, plmn);
|
||||
}
|
||||
|
||||
if (instance_p->frame_type[i] == TDD) { // Panos: Remember to change that to TDD
|
||||
X2AP_FreqBandNrItem_t *freq_band;
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.present = X2AP_ServedNRCell_Information__nrModeInfo_PR_tdd;
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nRFreqInfo.nRARFCN = 0; //instance_p->tdd_nRARFCN[i];
|
||||
|
||||
/* addition of Frequency Band List */
|
||||
freq_band = calloc(1, sizeof(X2AP_FreqBandNrItem_t));
|
||||
if (freq_band == NULL)
|
||||
exit(1);
|
||||
freq_band->freqBandIndicatorNr = 1; /* TODO: put correct value */
|
||||
ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nRFreqInfo.freqBandListNr, freq_band);
|
||||
|
||||
switch (instance_p->N_RB_DL[i]) {
|
||||
case 50:
|
||||
//This is not correct. Just to be able to test X2 only using an eNB instead of gNB
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb51;
|
||||
break;
|
||||
case 93 :
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb93;
|
||||
break;
|
||||
case 106:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb106;
|
||||
break;
|
||||
case 121:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRNRB = X2AP_NRNRB_nrb121;
|
||||
break;
|
||||
|
||||
/*More cases to be added */
|
||||
|
||||
default:
|
||||
AssertFatal(0,"Failed: Check value for N_RB_DL/N_RB_UL");
|
||||
break;
|
||||
}
|
||||
|
||||
instance_p->nr_SCS[i] = 30; // Hardcoded for now. Normally this should originate from the gNB config file
|
||||
switch (instance_p->nr_SCS[i]) {
|
||||
case 15:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRSCS = X2AP_NRSCS_scs15;
|
||||
break;
|
||||
case 30:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRSCS = X2AP_NRSCS_scs30;
|
||||
break;
|
||||
case 60:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRSCS = X2AP_NRSCS_scs60;
|
||||
break;
|
||||
case 120:
|
||||
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_TxBW.nRSCS = X2AP_NRSCS_scs120;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0,"Failed: Check value for nr_SCS");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
AssertFatal(0,"nr_X2Setupresponse not supported for FDD!");
|
||||
}
|
||||
/*Don't know where to extract the value of measurementTimingConfiguration from. Set it to 0 for now */
|
||||
INT8_TO_OCTET_STRING(0, &servedCellMember->servedNRCellInfo.measurementTimingConfiguration);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie_GNB_ENDC->value.choice.ServedNRcellsENDCX2ManagementList.list, servedCellMember);
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_en_gNB.list, ie_GNB_ENDC);
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list, ie_ENB_ENDC);
|
||||
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
@@ -1521,3 +1495,360 @@ int x2ap_gNB_generate_ENDC_x2_setup_response(
|
||||
return ret;
|
||||
}
|
||||
|
||||
int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
|
||||
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p, int ue_id)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_SgNBAdditionRequest_t *out;
|
||||
X2AP_SgNBAdditionRequest_IEs_t *ie;
|
||||
X2AP_E_RABs_ToBeAdded_SgNBAddReq_ItemIEs_t *e_RABS_ToBeAdded_SgNBAddReq_ItemIEs;
|
||||
X2AP_E_RABs_ToBeAdded_SgNBAddReq_Item_t *e_RABS_ToBeAdded_SgNBAddReq_Item;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
// Currently hardcoded (dummy) values filling the fields of SgNB_addition_request message. To be substituted
|
||||
// with values coming from RRC.
|
||||
uint16_t nRencryptionAlgorithms = 0;
|
||||
uint16_t nRintegrityProtectionAlgorithms = 0;
|
||||
uint8_t SgNBSecurityKey[32] = { 0 };
|
||||
int uEaggregateMaximumBitRateDownlink = 100000000;
|
||||
int uEaggregateMaximumBitRateUplink = 100000000;
|
||||
int e_rabs_tobeadded = 1;
|
||||
int e_RAB_ID = 1;
|
||||
int drb_ID = 2;
|
||||
long int pDCPatSgNB = X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present;
|
||||
long int mCGresources = X2AP_EN_DC_ResourceConfiguration__mCGresources_not_present;
|
||||
long int sCGresources = X2AP_EN_DC_ResourceConfiguration__sCGresources_not_present;
|
||||
long qCI = 1;
|
||||
X2AP_Pre_emptionCapability_t pre_emptionCapability = X2AP_Pre_emptionCapability_shall_not_trigger_pre_emption;
|
||||
X2AP_Pre_emptionVulnerability_t pre_emptionVulnerability = X2AP_Pre_emptionVulnerability_not_pre_emptable;
|
||||
priority_level_t priority_level = PRIORITY_LEVEL_NO_PRIORITY;
|
||||
e_rab_tobe_added_t e_MCG_rabs_tobeadded;
|
||||
e_MCG_rabs_tobeadded.gtp_teid = 0;
|
||||
e_MCG_rabs_tobeadded.eNB_addr.length = 24;
|
||||
uint8_t buf[20] = { 0 };
|
||||
memcpy(e_MCG_rabs_tobeadded.eNB_addr.buffer, buf, 20*sizeof(uint8_t));
|
||||
|
||||
FILE *fd;
|
||||
fd = fopen("../../../executables/uecap.raw","r");
|
||||
if (fd != NULL) {
|
||||
OCTET_STRING_t CG_Config_Info;
|
||||
CG_Config_Info.size = 4096;
|
||||
CG_Config_Info.buf = (uint8_t *)calloc(4096, sizeof(uint8_t));
|
||||
int msg_len=fread(CG_Config_Info.buf,1,CG_Config_Info.size,fd);
|
||||
CG_Config_Info.size = msg_len;
|
||||
|
||||
/*char buffer[4096];
|
||||
int msg_len=fread(buffer,1,4096,fd);*/
|
||||
LOG_I(RRC,"Read in %d bytes for uecap\n",msg_len);
|
||||
|
||||
|
||||
/*OCTET_STRING_t CG_Config_Info;
|
||||
CG_Config_Info.size = 4096;
|
||||
CG_Config_Info.buf = (uint8_t *)calloc(4096, sizeof(uint8_t));*/
|
||||
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_WAITING;
|
||||
|
||||
|
||||
|
||||
/* Prepare the X2AP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage.procedureCode = X2AP_ProcedureCode_id_sgNBAdditionPreparation;
|
||||
pdu.choice.initiatingMessage.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.initiatingMessage.value.present = X2AP_InitiatingMessage__value_PR_SgNBAdditionRequest;
|
||||
out = &pdu.choice.initiatingMessage.value.choice.SgNBAdditionRequest;
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID; //Not sure about that
|
||||
ie->criticality= X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_UE_X2AP_ID;
|
||||
ie->value.choice.UE_X2AP_ID = x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_NRUESecurityCapabilities;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_NRUESecurityCapabilities;
|
||||
INT16_TO_BIT_STRING(nRencryptionAlgorithms, &ie->value.choice.NRUESecurityCapabilities.nRencryptionAlgorithms);
|
||||
INT16_TO_BIT_STRING(nRintegrityProtectionAlgorithms, &ie->value.choice.NRUESecurityCapabilities.nRintegrityProtectionAlgorithms);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_SgNBSecurityKey;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_SgNBSecurityKey;
|
||||
KENB_STAR_TO_BIT_STRING(SgNBSecurityKey, &ie->value.choice.SgNBSecurityKey);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_SgNBUEAggregateMaximumBitRate;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_UEAggregateMaximumBitRate;
|
||||
ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateDownlink.buf = (uint8_t *)calloc(4, sizeof(uint8_t));
|
||||
INT32_TO_BUFFER(uEaggregateMaximumBitRateDownlink, ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateDownlink.buf);
|
||||
ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateDownlink.size = 4;
|
||||
|
||||
ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink.buf = (uint8_t *)calloc(4, sizeof(uint8_t));
|
||||
INT32_TO_BUFFER(uEaggregateMaximumBitRateUplink, ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink.buf);
|
||||
ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink.size = 4;
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t));
|
||||
//Not sure if id should be X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_List or X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList
|
||||
ie->id = X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_E_RABs_ToBeAdded_SgNBAddReqList;
|
||||
|
||||
for (int i=0;i<e_rabs_tobeadded;i++) {
|
||||
e_RABS_ToBeAdded_SgNBAddReq_ItemIEs = (X2AP_E_RABs_ToBeAdded_SgNBAddReq_ItemIEs_t *)calloc(1,sizeof(X2AP_E_RABs_ToBeAdded_SgNBAddReq_ItemIEs_t));
|
||||
e_RABS_ToBeAdded_SgNBAddReq_ItemIEs->id = X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReq_Item;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_ItemIEs->criticality = X2AP_Criticality_ignore;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_ItemIEs->value.present = X2AP_E_RABs_ToBeAdded_SgNBAddReq_ItemIEs__value_PR_E_RABs_ToBeAdded_SgNBAddReq_Item;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item = &e_RABS_ToBeAdded_SgNBAddReq_ItemIEs->value.choice.E_RABs_ToBeAdded_SgNBAddReq_Item;
|
||||
{
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->drb_ID = drb_ID;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->e_RAB_ID = e_RAB_ID;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->en_DC_ResourceConfiguration.pDCPatSgNB = pDCPatSgNB;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->en_DC_ResourceConfiguration.mCGresources = mCGresources;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->en_DC_ResourceConfiguration.sCGresources = sCGresources;
|
||||
if (pDCPatSgNB == X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present){
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.present = X2AP_E_RABs_ToBeAdded_SgNBAddReq_Item__resource_configuration_PR_sgNBPDCPpresent;
|
||||
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.qCI = qCI;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.pre_emptionCapability = pre_emptionCapability;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.allocationAndRetentionPriority. pre_emptionVulnerability = pre_emptionVulnerability;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.priorityLevel = priority_level;
|
||||
|
||||
//Continue from filling the UL_GTPtunnelEndpointInformation inspired from how it is done for the HO case
|
||||
INT32_TO_OCTET_STRING(e_MCG_rabs_tobeadded.gtp_teid, &e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.gTP_TEID);
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.size = e_MCG_rabs_tobeadded.eNB_addr.length/8;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.bits_unused = e_MCG_rabs_tobeadded.eNB_addr.length%8;
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.buf =
|
||||
calloc(1, e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.size);
|
||||
|
||||
memcpy (e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.buf,
|
||||
e_MCG_rabs_tobeadded.eNB_addr.buffer,
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.size);
|
||||
}
|
||||
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_ToBeAdded_SgNBAddReqList.list, e_RABS_ToBeAdded_SgNBAddReq_ItemIEs);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_MeNBtoSgNBContainer;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequest_IEs__value_PR_MeNBtoSgNBContainer;
|
||||
ie->value.choice.MeNBtoSgNBContainer.buf = (uint8_t *)calloc(CG_Config_Info.size, sizeof(uint8_t));
|
||||
memcpy(ie->value.choice.MeNBtoSgNBContainer.buf, CG_Config_Info.buf, CG_Config_Info.size);
|
||||
ie->value.choice.MeNBtoSgNBContainer.size = CG_Config_Info.size; //4096;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
fclose(fd);
|
||||
}
|
||||
else {
|
||||
LOG_I(RRC, "uecap.raw file could not be opened... \n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
|
||||
x2ap_ENDC_sgnb_addition_req_ACK_t *x2ap_sgnb_addition_req_ACK, int ue_id)
|
||||
{
|
||||
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_SgNBAdditionRequestAcknowledge_t *out;
|
||||
X2AP_SgNBAdditionRequestAcknowledge_IEs_t *ie;
|
||||
X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t *e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs;
|
||||
X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item_t *e_RABS_AdmittedToBeAdded_SgNBAddReq_Item;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
int MeNB_UE_X2AP_id = ue_id;
|
||||
int SgNB_UE_X2AP_id = 0;
|
||||
|
||||
// Currently hardcoded (dummy) values filling the fields of SgNB_addition_request message. To be substituted
|
||||
// with values coming from RRC.
|
||||
uint16_t nRencryptionAlgorithms = 0;
|
||||
uint16_t nRintegrityProtectionAlgorithms = 0;
|
||||
uint8_t SgNBSecurityKey[32] = { 0 };
|
||||
int uEaggregateMaximumBitRateDownlink = 100000000;
|
||||
int uEaggregateMaximumBitRateUplink = 100000000;
|
||||
int e_rabs_admitted_tobeadded = 1;
|
||||
int e_RAB_ID = 1;
|
||||
long int pDCPatSgNB = X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present;
|
||||
long int mCGresources = X2AP_EN_DC_ResourceConfiguration__mCGresources_not_present;
|
||||
long int sCGresources = X2AP_EN_DC_ResourceConfiguration__sCGresources_not_present;
|
||||
e_rab_setup_t e_SCG_rabs_tobeadded;
|
||||
e_SCG_rabs_tobeadded.gtp_teid = 0;
|
||||
e_SCG_rabs_tobeadded.eNB_addr.length = 24;
|
||||
uint8_t buf[20] = { 0 };
|
||||
memcpy(e_SCG_rabs_tobeadded.eNB_addr.buffer, buf, 20*sizeof(uint8_t));
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_WAITING;
|
||||
|
||||
// Prepare the X2AP message to encode
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome.procedureCode = X2AP_ProcedureCode_id_sgNBAdditionPreparation;
|
||||
pdu.choice.successfulOutcome.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.successfulOutcome.value.present = X2AP_SuccessfulOutcome__value_PR_SgNBAdditionRequestAcknowledge;
|
||||
out = &pdu.choice.successfulOutcome.value.choice.SgNBAdditionRequestAcknowledge;
|
||||
|
||||
// MeNB_UE_X2AP_id
|
||||
ie = (X2AP_SgNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequestAcknowledge_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID;
|
||||
ie->criticality= X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequestAcknowledge_IEs__value_PR_UE_X2AP_ID;
|
||||
ie->value.choice.UE_X2AP_ID = MeNB_UE_X2AP_id; //x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
// SgNB_UE_X2AP_id
|
||||
ie = (X2AP_SgNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequestAcknowledge_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID;
|
||||
ie->criticality= X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequestAcknowledge_IEs__value_PR_SgNB_UE_X2AP_ID;
|
||||
ie->value.choice.UE_X2AP_ID = SgNB_UE_X2AP_id; //x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequestAcknowledge_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList;
|
||||
ie->criticality = X2AP_Criticality_ignore;
|
||||
ie->value.present = X2AP_SgNBAdditionRequestAcknowledge_IEs__value_PR_E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList;
|
||||
|
||||
for (int i=0;i<e_rabs_admitted_tobeadded;i++) {
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs = (X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t *)calloc(1,sizeof(X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t));
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs->id = X2AP_ProtocolIE_ID_id_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs->criticality = X2AP_Criticality_ignore;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs->value.present = X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs__value_PR_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item = &e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item;
|
||||
{
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->e_RAB_ID = e_RAB_ID;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->en_DC_ResourceConfiguration.pDCPatSgNB = pDCPatSgNB;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->en_DC_ResourceConfiguration.mCGresources = mCGresources;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->en_DC_ResourceConfiguration.sCGresources = sCGresources;
|
||||
if (pDCPatSgNB == X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present){
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.present = X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item__resource_configuration_PR_sgNBPDCPpresent;
|
||||
|
||||
INT32_TO_OCTET_STRING(e_SCG_rabs_tobeadded.gtp_teid, &e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.gTP_TEID);
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.size = e_SCG_rabs_tobeadded.eNB_addr.length/8;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.bits_unused = e_SCG_rabs_tobeadded.eNB_addr.length%8;
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.buf =
|
||||
calloc(1, e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.size);
|
||||
|
||||
memcpy (e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.buf,
|
||||
e_SCG_rabs_tobeadded.eNB_addr.buffer,
|
||||
e_RABS_AdmittedToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.size);
|
||||
}
|
||||
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList.list, e_RABS_AdmittedToBeAdded_SgNBAddReq_ItemIEs);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBAdditionRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_SgNBAdditionRequestAcknowledge_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_SgNBtoMeNBContainer;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBAdditionRequestAcknowledge_IEs__value_PR_SgNBtoMeNBContainer;
|
||||
ie->value.choice.SgNBtoMeNBContainer.buf = (uint8_t *)calloc(x2ap_sgnb_addition_req_ACK->rrc_buffer_size, sizeof(uint8_t));
|
||||
memcpy(ie->value.choice.SgNBtoMeNBContainer.buf, x2ap_sgnb_addition_req_ACK->rrc_buffer, x2ap_sgnb_addition_req_ACK->rrc_buffer_size);
|
||||
ie->value.choice.SgNBtoMeNBContainer.size = x2ap_sgnb_addition_req_ACK->rrc_buffer_size; //4096;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int x2ap_eNB_generate_ENDC_x2_SgNB_reconfiguration_complete(
|
||||
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p, int ue_id, int SgNB_ue_id)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_SgNBReconfigurationComplete_t *out;
|
||||
X2AP_SgNBReconfigurationComplete_IEs_t *ie;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_WAITING;
|
||||
|
||||
|
||||
/* Prepare the X2AP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage.procedureCode = X2AP_ProcedureCode_id_sgNBReconfigurationCompletion;
|
||||
pdu.choice.initiatingMessage.criticality = X2AP_Criticality_ignore;
|
||||
pdu.choice.initiatingMessage.value.present = X2AP_InitiatingMessage__value_PR_SgNBReconfigurationComplete;
|
||||
out = &pdu.choice.initiatingMessage.value.choice.SgNBReconfigurationComplete;
|
||||
|
||||
ie = (X2AP_SgNBReconfigurationComplete_IEs_t *)calloc(1, sizeof(X2AP_SgNBReconfigurationComplete_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID;
|
||||
ie->criticality= X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBReconfigurationComplete_IEs__value_PR_UE_X2AP_ID;
|
||||
ie->value.choice.UE_X2AP_ID = ue_id; //x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBReconfigurationComplete_IEs_t *)calloc(1, sizeof(X2AP_SgNBReconfigurationComplete_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_SgNBReconfigurationComplete_IEs__value_PR_SgNB_UE_X2AP_ID;
|
||||
ie->value.choice.SgNB_UE_X2AP_ID = SgNB_ue_id;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
ie = (X2AP_SgNBReconfigurationComplete_IEs_t *)calloc(1, sizeof(X2AP_SgNBReconfigurationComplete_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_ResponseInformationSgNBReconfComp;
|
||||
ie->criticality = X2AP_Criticality_ignore;
|
||||
ie->value.present = X2AP_SgNBReconfigurationComplete_IEs__value_PR_ResponseInformationSgNBReconfComp;
|
||||
ie->value.choice.ResponseInformationSgNBReconfComp.present = X2AP_ResponseInformationSgNBReconfComp_PR_success_SgNBReconfComp;
|
||||
// meNBtoSgNBContainer should contain the RRCReconfigurationComplete message from the UE but in the specs 36.423(9.1.4.4) its presence is not mandatory
|
||||
ie->value.choice.ResponseInformationSgNBReconfComp.choice.success_SgNBReconfComp.meNBtoSgNBContainer = NULL;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
@@ -66,8 +66,15 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2
|
||||
int x2ap_eNB_generate_senb_addition_request_ack (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
|
||||
x2ap_senb_addition_req_ack_t *x2ap_addition_req_ack);
|
||||
|
||||
int x2ap_eNB_generate_ENDC_x2_setup_request(x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p);
|
||||
int x2ap_gNB_generate_ENDC_x2_setup_request(x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p);
|
||||
|
||||
int x2ap_gNB_generate_ENDC_x2_setup_response( x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p);
|
||||
int x2ap_eNB_generate_ENDC_x2_setup_response( x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p);
|
||||
|
||||
int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p, int ue_id);
|
||||
|
||||
int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p, x2ap_ENDC_sgnb_addition_req_ACK_t *x2ap_sgnb_addition_req_ACK, int ue_id);
|
||||
|
||||
int x2ap_eNB_generate_ENDC_x2_SgNB_reconfiguration_complete(
|
||||
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p, int ue_id, int SgNB_ue_id);
|
||||
|
||||
#endif /* X2AP_ENB_GENERATE_MESSAGES_H_ */
|
||||
|
||||
+544
-157
@@ -103,7 +103,7 @@ int x2ap_eNB_handle_senb_addition_request_reject (instance_t instance,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
int x2ap_gNB_handle_ENDC_x2_setup_request(instance_t instance,
|
||||
int x2ap_eNB_handle_ENDC_x2_setup_request(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
@@ -114,8 +114,26 @@ x2ap_gNB_handle_ENDC_x2_setup_response(instance_t instance,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
static
|
||||
int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
/* Handlers matrix. Only eNB related procedure present here */
|
||||
static
|
||||
int x2ap_eNB_handle_ENDC_sGNB_addition_response (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
static
|
||||
int x2ap_gNB_handle_ENDC_sGNB_reconfiguration_complete (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
|
||||
/* Handlers matrix. Only eNB related procedure present here. Placement of callback functions according to X2AP_ProcedureCode.h */
|
||||
x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
|
||||
{ x2ap_eNB_handle_handover_preparation, x2ap_eNB_handle_handover_response, 0 }, /* handoverPreparation */
|
||||
{ x2ap_eNB_handle_handover_cancel, 0, 0 }, /* handoverCancel */
|
||||
@@ -144,6 +162,8 @@ x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
|
||||
{ 0, 0, 0 }, /* seNBinitiatedSeNBRelease */
|
||||
{ 0, 0, 0 }, /* seNBCounterCheck */
|
||||
{ 0, 0, 0 }, /* retrieveUEContext */
|
||||
{ x2ap_gNB_handle_ENDC_sGNB_addition_request, x2ap_eNB_handle_ENDC_sGNB_addition_response, 0 }, /*X2AP_ProcedureCode_id_sgNBAdditionPreparation*/
|
||||
{ x2ap_gNB_handle_ENDC_sGNB_reconfiguration_complete, 0, 0 }, /*X2AP_ProcedureCode_id_sgNBReconfigurationCompletion*/
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
@@ -151,9 +171,7 @@ x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
{ x2ap_gNB_handle_ENDC_x2_setup_request, x2ap_gNB_handle_ENDC_x2_setup_response, 0 },
|
||||
{ x2ap_eNB_handle_ENDC_x2_setup_request, x2ap_gNB_handle_ENDC_x2_setup_response, 0 }, /*X2AP_ProcedureCode_id_endcX2Setup*/
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 }
|
||||
@@ -1324,7 +1342,7 @@ int x2ap_eNB_handle_senb_addition_request_reject (instance_t instance,
|
||||
}
|
||||
|
||||
int
|
||||
x2ap_gNB_handle_ENDC_x2_setup_request(instance_t instance,
|
||||
x2ap_eNB_handle_ENDC_x2_setup_request(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
@@ -1332,12 +1350,12 @@ x2ap_gNB_handle_ENDC_x2_setup_request(instance_t instance,
|
||||
|
||||
X2AP_ENDCX2SetupRequest_t *x2_ENDC_SetupRequest;
|
||||
X2AP_ENDCX2SetupRequest_IEs_t *ie;
|
||||
X2AP_ENB_ENDCX2SetupReqIEs_t *ie_ENB_ENDC;
|
||||
ServedEUTRAcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
X2AP_En_gNB_ENDCX2SetupReqIEs_t *ie_GNB_ENDC;
|
||||
ServedNRcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
uint32_t eNB_id = 0;
|
||||
uint32_t gNB_id = 0;
|
||||
|
||||
x2ap_eNB_data = NULL;
|
||||
DevAssert (pdu != NULL);
|
||||
@@ -1372,156 +1390,11 @@ x2ap_gNB_handle_ENDC_x2_setup_request(instance_t instance,
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
} else {
|
||||
if (ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_eNB.list.count > 0) {
|
||||
//Panos: Here the container parameter in X2AP_FIND_PROTOCOLIE_BY_ID should be the x2_ENDC_SetupRequest
|
||||
//message or the ie to which there are more nested information elements?
|
||||
for (int i=0; i<ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_eNB.list.count;i++) {
|
||||
if (ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list.count > 0) {
|
||||
|
||||
ie_ENB_ENDC = (X2AP_ENB_ENDCX2SetupReqIEs_t*) ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_eNB.list.array[i];
|
||||
if (ie_ENB_ENDC == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
for (int i=0; i<ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_en_gNB.list.count;i++) {
|
||||
|
||||
else if (ie_ENB_ENDC->id == X2AP_ProtocolIE_ID_id_GlobalENB_ID) {
|
||||
if (ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) {
|
||||
// Home eNB ID = 28 bits
|
||||
uint8_t *eNB_id_buf = ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf;
|
||||
if (ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 28) {
|
||||
//TODO: handle case were size != 28 -> notify ? reject ?
|
||||
}
|
||||
eNB_id = (eNB_id_buf[0] << 20) + (eNB_id_buf[1] << 12) + (eNB_id_buf[2] << 4) + ((eNB_id_buf[3] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("Home eNB id: %07x\n", eNB_id);
|
||||
} else {
|
||||
// Macro eNB = 20 bits
|
||||
uint8_t *eNB_id_buf = ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf;
|
||||
if (ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 20) {
|
||||
//TODO: handle case were size != 20 -> notify ? reject ?
|
||||
}
|
||||
eNB_id = (eNB_id_buf[0] << 12) + (eNB_id_buf[1] << 4) + ((eNB_id_buf[2] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("macro eNB id: %05x\n", eNB_id);
|
||||
}
|
||||
X2AP_DEBUG("Adding eNB to the list of associated eNBs\n");
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_id_in_list (eNB_id)) == NULL) {
|
||||
/*
|
||||
* eNB has not been found in list of associated eNB,
|
||||
* * * * Add it to the tail of list and initialize data
|
||||
*/
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_assoc_id_in_list (assoc_id)) == NULL) {
|
||||
/*
|
||||
* ??
|
||||
*/
|
||||
return -1;
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
x2ap_eNB_data->eNB_id = eNB_id;
|
||||
}
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
|
||||
/*
|
||||
* eNB has been found in list, consider the x2 setup request as a reset connection,
|
||||
* * * * reseting any previous UE state if sctp association is != than the previous one
|
||||
*/
|
||||
if (x2ap_eNB_data->assoc_id != assoc_id) {
|
||||
/*
|
||||
* ??: Send an overload cause...
|
||||
*/
|
||||
X2AP_ERROR("Rejecting x2 setup request as eNB id %d is already associated to an active sctp association" "Previous known: %d, new one: %d\n", eNB_id, x2ap_eNB_data->assoc_id, assoc_id);
|
||||
|
||||
// Panos: Here we should be calling an ENDC specific setup_failure function instead
|
||||
x2ap_eNB_generate_x2_setup_failure (instance,
|
||||
assoc_id,
|
||||
X2AP_Cause_PR_protocol,
|
||||
X2AP_CauseProtocol_unspecified,
|
||||
-1);
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* * TODO: call the reset procedure
|
||||
*/
|
||||
}
|
||||
}
|
||||
else if (ie_ENB_ENDC->id == X2AP_ProtocolIE_ID_id_ServedEUTRAcellsENDCX2ManagementList){
|
||||
if (ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.count > 0) {
|
||||
x2ap_eNB_data->num_cc = ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.count;
|
||||
for (int i=0; i<ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.count;i++) {
|
||||
servedCellMember = (ServedEUTRAcellsENDCX2ManagementList__Member *)ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.array[i];
|
||||
x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedEUTRACellInfo.pCI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
X2AP_ERROR("%s %d: init_eNB list is empty \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
// Panos: Here we should be calling an ENDC specific setup response function
|
||||
return x2ap_gNB_generate_ENDC_x2_setup_response(instance_p, x2ap_eNB_data);
|
||||
//return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data);
|
||||
}
|
||||
|
||||
int
|
||||
x2ap_gNB_handle_ENDC_x2_setup_response(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
X2AP_ENDCX2SetupResponse_t *x2_ENDC_SetupResponse;
|
||||
X2AP_ENDCX2SetupResponse_IEs_t *ie;
|
||||
X2AP_En_gNB_ENDCX2SetupReqAckIEs_t *ie_GNB_ENDC;
|
||||
ServedNRcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
uint32_t gNB_id = 0;
|
||||
|
||||
x2ap_eNB_data = NULL;
|
||||
DevAssert (pdu != NULL);
|
||||
x2_ENDC_SetupResponse = &pdu->choice.successfulOutcome.value.choice.ENDCX2SetupResponse;
|
||||
|
||||
/*
|
||||
* We received a new valid X2 Setup Request on a stream != 0.
|
||||
* * * * This should not happen -> reject eNB x2 setup request.
|
||||
*/
|
||||
|
||||
if (stream != 0) {
|
||||
X2AP_ERROR("Received new x2 setup request on stream != 0\n");
|
||||
/*
|
||||
* Send a x2 setup failure with protocol cause unspecified
|
||||
*/
|
||||
// Panos: Here we should be calling an ENDC specific setup_failure function instead
|
||||
return x2ap_eNB_generate_x2_setup_failure (instance,
|
||||
assoc_id,
|
||||
X2AP_Cause_PR_protocol,
|
||||
X2AP_CauseProtocol_unspecified,
|
||||
-1);
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Received a new X2 setup request\n");
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_ENDCX2SetupResponse_IEs_t, ie, x2_ENDC_SetupResponse,
|
||||
X2AP_ProtocolIE_ID_id_RespondingNodeType_EndcX2Setup, true);
|
||||
|
||||
|
||||
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
} else {
|
||||
if (ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_en_gNB.list.count > 0) {
|
||||
//Panos: Here the container parameter in X2AP_FIND_PROTOCOLIE_BY_ID should be the x2_ENDC_SetupRequest
|
||||
//message or the ie to which there are more nested information elements?
|
||||
for (int i=0; i<ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_en_gNB.list.count;i++) {
|
||||
|
||||
ie_GNB_ENDC = (X2AP_En_gNB_ENDCX2SetupReqAckIEs_t*) ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_en_gNB.list.array[i];
|
||||
ie_GNB_ENDC = (X2AP_En_gNB_ENDCX2SetupReqIEs_t*) ie->value.choice.InitiatingNodeType_EndcX2Setup.choice.init_eNB.list.array[i];
|
||||
if (ie_GNB_ENDC == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
@@ -1606,6 +1479,146 @@ x2ap_gNB_handle_ENDC_x2_setup_response(instance_t instance,
|
||||
}
|
||||
}
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
return x2ap_eNB_generate_ENDC_x2_setup_response(instance_p, x2ap_eNB_data);
|
||||
}
|
||||
|
||||
int
|
||||
x2ap_gNB_handle_ENDC_x2_setup_response(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
X2AP_ENDCX2SetupResponse_t *x2_ENDC_SetupResponse;
|
||||
X2AP_ENDCX2SetupResponse_IEs_t *ie;
|
||||
X2AP_ENB_ENDCX2SetupReqAckIEs_t *ie_ENB_ENDC;
|
||||
ServedEUTRAcellsENDCX2ManagementList__Member *servedCellMember;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
uint32_t eNB_id = 0;
|
||||
|
||||
x2ap_eNB_data = NULL;
|
||||
DevAssert (pdu != NULL);
|
||||
x2_ENDC_SetupResponse = &pdu->choice.successfulOutcome.value.choice.ENDCX2SetupResponse;
|
||||
|
||||
/*
|
||||
* We received a new valid X2 Setup Request on a stream != 0.
|
||||
* * * * This should not happen -> reject eNB x2 setup request.
|
||||
*/
|
||||
|
||||
if (stream != 0) {
|
||||
X2AP_ERROR("Received new x2 setup request on stream != 0\n");
|
||||
/*
|
||||
* Send a x2 setup failure with protocol cause unspecified
|
||||
*/
|
||||
// Here we should be calling an ENDC specific setup_failure function instead
|
||||
return x2ap_eNB_generate_x2_setup_failure (instance,
|
||||
assoc_id,
|
||||
X2AP_Cause_PR_protocol,
|
||||
X2AP_CauseProtocol_unspecified,
|
||||
-1);
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Received a new X2 setup request\n");
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_ENDCX2SetupResponse_IEs_t, ie, x2_ENDC_SetupResponse,
|
||||
X2AP_ProtocolIE_ID_id_RespondingNodeType_EndcX2Setup, true);
|
||||
|
||||
|
||||
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
} else {
|
||||
if (ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list.count > 0) {
|
||||
for (int i=0; i<ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list.count;i++) {
|
||||
|
||||
ie_ENB_ENDC = (X2AP_ENB_ENDCX2SetupReqAckIEs_t*) ie->value.choice.RespondingNodeType_EndcX2Setup.choice.respond_eNB.list.array[i];
|
||||
if (ie_ENB_ENDC == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
else if (ie_ENB_ENDC->id == X2AP_ProtocolIE_ID_id_GlobalENB_ID) {
|
||||
if (ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) {
|
||||
// Home eNB ID = 28 bits
|
||||
uint8_t *eNB_id_buf = ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf;
|
||||
if (ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 28) {
|
||||
//TODO: handle case were size != 28 -> notify ? reject ?
|
||||
}
|
||||
eNB_id = (eNB_id_buf[0] << 20) + (eNB_id_buf[1] << 12) + (eNB_id_buf[2] << 4) + ((eNB_id_buf[3] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("Home eNB id: %07x\n", eNB_id);
|
||||
} else {
|
||||
// Macro eNB = 20 bits
|
||||
uint8_t *eNB_id_buf = ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf;
|
||||
if (ie_ENB_ENDC->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 20) {
|
||||
//TODO: handle case were size != 20 -> notify ? reject ?
|
||||
}
|
||||
eNB_id = (eNB_id_buf[0] << 12) + (eNB_id_buf[1] << 4) + ((eNB_id_buf[2] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("macro eNB id: %05x\n", eNB_id);
|
||||
}
|
||||
X2AP_DEBUG("Adding eNB to the list of associated eNBs\n");
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_id_in_list (eNB_id)) == NULL) {
|
||||
/*
|
||||
* eNB has not been found in list of associated eNB,
|
||||
* * * * Add it to the tail of list and initialize data
|
||||
*/
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_assoc_id_in_list (assoc_id)) == NULL) {
|
||||
/*
|
||||
* ??
|
||||
*/
|
||||
return -1;
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
x2ap_eNB_data->eNB_id = eNB_id;
|
||||
}
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
|
||||
/*
|
||||
* eNB has been found in list, consider the x2 setup request as a reset connection,
|
||||
* * * * reseting any previous UE state if sctp association is != than the previous one
|
||||
*/
|
||||
if (x2ap_eNB_data->assoc_id != assoc_id) {
|
||||
/*
|
||||
* ??: Send an overload cause...
|
||||
*/
|
||||
X2AP_ERROR("Rejecting x2 setup request as eNB id %d is already associated to an active sctp association" "Previous known: %d, new one: %d\n", eNB_id, x2ap_eNB_data->assoc_id, assoc_id);
|
||||
|
||||
// Here we should be calling an ENDC specific setup_failure function instead
|
||||
x2ap_eNB_generate_x2_setup_failure (instance,
|
||||
assoc_id,
|
||||
X2AP_Cause_PR_protocol,
|
||||
X2AP_CauseProtocol_unspecified,
|
||||
-1);
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* * TODO: call the reset procedure
|
||||
*/
|
||||
}
|
||||
}
|
||||
else if (ie_ENB_ENDC->id == X2AP_ProtocolIE_ID_id_ServedEUTRAcellsENDCX2ManagementList){
|
||||
if (ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.count > 0) {
|
||||
x2ap_eNB_data->num_cc = ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.count;
|
||||
for (int i=0; i<ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.count;i++) {
|
||||
servedCellMember = (ServedEUTRAcellsENDCX2ManagementList__Member *)ie_ENB_ENDC->value.choice.ServedEUTRAcellsENDCX2ManagementList.list.array[i];
|
||||
x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedEUTRACellInfo.pCI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
X2AP_ERROR("%s %d: init_eNB list is empty \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Optionaly set the target eNB name */
|
||||
|
||||
/* The association is now ready as source and target eNBs know parameters of each other.
|
||||
@@ -1622,4 +1635,378 @@ x2ap_gNB_handle_ENDC_x2_setup_response(instance_t instance,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
|
||||
X2AP_SgNBAdditionRequest_t *x2SgNBAdditionRequest;
|
||||
X2AP_SgNBAdditionRequest_IEs_t *ie;
|
||||
|
||||
X2AP_E_RABs_ToBeAdded_SgNBAddReq_ItemIEs_t *e_RABS_ToBeAdded_SgNBAddReq_ItemIEs;
|
||||
X2AP_E_RABs_ToBeAdded_SgNBAddReq_Item_t *e_RABS_ToBeAdded_SgNBAddReq_Item;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
MessageDef *msg;
|
||||
int ue_id;
|
||||
|
||||
DevAssert (pdu != NULL);
|
||||
x2SgNBAdditionRequest = &pdu->choice.initiatingMessage.value.choice.SgNBAdditionRequest;
|
||||
|
||||
/*if (stream == 0) {
|
||||
X2AP_ERROR ("Received new x2 SgNB Addition request on stream == 0\n");
|
||||
// TODO: send a x2 failure response
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
X2AP_DEBUG ("Received a new X2 SgNB Addition request\n");
|
||||
|
||||
x2ap_eNB_data = x2ap_get_eNB(NULL, assoc_id, 0);
|
||||
DevAssert(x2ap_eNB_data != NULL);
|
||||
|
||||
X2AP_INFO("X2AP Association id: %d \n",assoc_id);
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
//Allocate an ITTI X2AP_SGNB_ADDITION_REQ message instead
|
||||
msg = itti_alloc_new_message(TASK_X2AP, X2AP_ENDC_SGNB_ADDITION_REQ);
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequest_IEs_t, ie, x2SgNBAdditionRequest,
|
||||
X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID, true);
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// allocate a new X2AP UE ID
|
||||
ue_id = x2ap_allocate_new_id(&instance_p->id_manager);
|
||||
if (ue_id == -1) {
|
||||
X2AP_ERROR("could not allocate a new X2AP UE ID\n");
|
||||
// TODO: cancel handover: send HO preparation failure to source eNB
|
||||
exit(1);
|
||||
}
|
||||
// rnti is unknown yet, must not be set to -1, 0 is fine
|
||||
x2ap_set_ids(&instance_p->id_manager, ue_id, 0, ie->value.choice.UE_X2AP_ID, ue_id);
|
||||
x2ap_id_set_state(&instance_p->id_manager, ue_id, X2ID_STATE_TARGET);
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).ue_x2_id = ue_id;
|
||||
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_NRUESecurityCapabilities */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequest_IEs_t, ie, x2SgNBAdditionRequest,
|
||||
X2AP_ProtocolIE_ID_id_NRUESecurityCapabilities, true);
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).security_capabilities.encryption_algorithms =
|
||||
BIT_STRING_to_uint16(&ie->value.choice.NRUESecurityCapabilities.nRencryptionAlgorithms);
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).security_capabilities.integrity_algorithms =
|
||||
BIT_STRING_to_uint16(&ie->value.choice.NRUESecurityCapabilities.nRintegrityProtectionAlgorithms);
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_SgNBSecurityKey */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequest_IEs_t, ie, x2SgNBAdditionRequest,
|
||||
X2AP_ProtocolIE_ID_id_SgNBSecurityKey, true);
|
||||
|
||||
if ((ie->value.choice.SgNBSecurityKey.buf) &&
|
||||
(ie->value.choice.SgNBSecurityKey.size == 32)) {
|
||||
memcpy(X2AP_ENDC_SGNB_ADDITION_REQ(msg).kgnb, ie->value.choice.SgNBSecurityKey.buf, 32);
|
||||
} else {
|
||||
X2AP_WARN ("Size of eNB key star does not match the expected value\n");
|
||||
}
|
||||
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_SgNBUEAggregateMaximumBitRate */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequest_IEs_t, ie, x2SgNBAdditionRequest,
|
||||
X2AP_ProtocolIE_ID_id_SgNBUEAggregateMaximumBitRate, true);
|
||||
|
||||
//X2AP_ENDC_SGNB_ADDITION_REQ(msg).ue_ambr.br_dl =ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateDownlink;
|
||||
//X2AP_ENDC_SGNB_ADDITION_REQ(msg).ue_ambr.br_ul = ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink;
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequest_IEs_t, ie, x2SgNBAdditionRequest,
|
||||
X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList, true);
|
||||
|
||||
|
||||
if (ie->value.choice.E_RABs_ToBeAdded_SgNBAddReqList.list.count > 0) {
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).nb_e_rabs_tobeadded = ie->value.choice.E_RABs_ToBeAdded_SgNBAddReqList.list.count;
|
||||
|
||||
for (int i=0;i<ie->value.choice.E_RABs_ToBeAdded_SgNBAddReqList.list.count;i++) {
|
||||
e_RABS_ToBeAdded_SgNBAddReq_ItemIEs = (X2AP_E_RABs_ToBeAdded_SgNBAddReq_ItemIEs_t *) ie->value.choice.E_RABs_ToBeAdded_SgNBAddReqList.list.array[i];
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item = &e_RABS_ToBeAdded_SgNBAddReq_ItemIEs->value.choice.E_RABs_ToBeAdded_SgNBAddReq_Item;
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rabs_tobeadded[i].e_rab_id = e_RABS_ToBeAdded_SgNBAddReq_Item->e_RAB_ID ;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rabs_tobeadded[i].drb_ID = e_RABS_ToBeAdded_SgNBAddReq_Item->drb_ID;
|
||||
if(e_RABS_ToBeAdded_SgNBAddReq_Item->en_DC_ResourceConfiguration.pDCPatSgNB == X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present){
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rab_param[i].qos.qci = e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.qCI;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rab_param[i].qos.allocation_retention_priority.pre_emp_vulnerability = e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.pre_emptionVulnerability;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rab_param[i].qos.allocation_retention_priority.pre_emp_capability = e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.pre_emptionCapability;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rab_param[i].qos.allocation_retention_priority.priority_level = e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.full_E_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.priorityLevel;
|
||||
|
||||
memcpy(X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rabs_tobeadded[i].eNB_addr.buffer,
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.buf,
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.size);
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rabs_tobeadded[i].eNB_addr.length =
|
||||
e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.size * 8 - e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.transportLayerAddress.bits_unused;
|
||||
|
||||
OCTET_STRING_TO_INT32(&e_RABS_ToBeAdded_SgNBAddReq_Item->resource_configuration.choice.sgNBPDCPpresent.s1_UL_GTPtunnelEndpoint.gTP_TEID,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).e_rabs_tobeadded[i].gtp_teid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
X2AP_ERROR ("Can't decode the e_RABs_ToBeSetup_List \n");
|
||||
}
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_MeNBtoSgNBContainer */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequest_IEs_t, ie, x2SgNBAdditionRequest,
|
||||
X2AP_ProtocolIE_ID_id_MeNBtoSgNBContainer, true);
|
||||
|
||||
//X2AP_MeNBtoSgNBContainer_t *container = &ie->value.choice.MeNBtoSgNBContainer;
|
||||
|
||||
if (ie->value.choice.MeNBtoSgNBContainer.size > 8192 ) // TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s
|
||||
{ printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); }
|
||||
|
||||
memcpy(X2AP_ENDC_SGNB_ADDITION_REQ(msg).rrc_buffer, ie->value.choice.MeNBtoSgNBContainer.buf, ie->value.choice.MeNBtoSgNBContainer.size);
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ(msg).rrc_buffer_size = ie->value.choice.MeNBtoSgNBContainer.size;
|
||||
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, instance_p->instance, msg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_ENDC_sGNB_addition_response (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
X2AP_SgNBAdditionRequestAcknowledge_t *x2SgNBAdditionRequest_ack;
|
||||
X2AP_SgNBAdditionRequestAcknowledge_IEs_t *ie;
|
||||
|
||||
X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t *e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs;
|
||||
X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item_t *e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
MessageDef *msg;
|
||||
int ue_id;
|
||||
int id_source;
|
||||
int id_target;
|
||||
int rnti;
|
||||
|
||||
DevAssert (pdu != NULL);
|
||||
x2SgNBAdditionRequest_ack = &pdu->choice.successfulOutcome.value.choice.SgNBAdditionRequestAcknowledge;
|
||||
|
||||
/*if (stream == 0) {
|
||||
X2AP_ERROR ("Received new x2 SgNB Addition request on stream == 0\n");
|
||||
// TODO: send a x2 failure response
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
X2AP_DEBUG ("Received a new X2 SgNB Addition request\n");
|
||||
|
||||
x2ap_eNB_data = x2ap_get_eNB(NULL, assoc_id, 0);
|
||||
DevAssert(x2ap_eNB_data != NULL);
|
||||
|
||||
X2AP_INFO("X2AP Association id: %d \n",assoc_id);
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
//Allocate an ITTI X2AP_SGNB_ADDITION_REQ message instead
|
||||
msg = itti_alloc_new_message(TASK_X2AP, X2AP_ENDC_SGNB_ADDITION_REQ_ACK);
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequestAcknowledge_IEs_t, ie, x2SgNBAdditionRequest_ack,
|
||||
X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID, true);
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
id_source = ie->value.choice.UE_X2AP_ID;
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).MeNB_ue_x2_id = ie->value.choice.UE_X2AP_ID;
|
||||
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequestAcknowledge_IEs_t, ie, x2SgNBAdditionRequest_ack,
|
||||
X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID, true);
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
id_target = ie->value.choice.SgNB_UE_X2AP_ID;
|
||||
|
||||
ue_id = id_source;
|
||||
|
||||
if (ue_id != x2ap_find_id_from_id_source(&instance_p->id_manager, id_source)) {
|
||||
X2AP_WARN("incorrect/unknown X2AP IDs for UE (old ID %d new ID %d), ignoring sGNB addition response\n",
|
||||
id_source, id_target);
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
rnti = x2ap_id_get_rnti(&instance_p->id_manager, ue_id);
|
||||
|
||||
/* id_target is a new information, store it */
|
||||
x2ap_set_ids(&instance_p->id_manager, ue_id, rnti, id_source, id_target);
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rnti = rnti;
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).SgNB_ue_x2_id = ie->value.choice.SgNB_UE_X2AP_ID;
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequestAcknowledge_IEs_t, ie, x2SgNBAdditionRequest_ack,
|
||||
X2AP_ProtocolIE_ID_id_E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList, true);
|
||||
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (ie->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList.list.count > 0) {
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).nb_e_rabs_admitted_tobeadded = ie->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList.list.count;
|
||||
|
||||
for (int i=0;i<ie->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList.list.count;i++) {
|
||||
|
||||
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs = (X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t *) ie->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList.list.array[i];
|
||||
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item = &e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs->value.choice.E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item;
|
||||
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].e_rab_id = e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item->e_RAB_ID ;
|
||||
if(e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item->en_DC_ResourceConfiguration.pDCPatSgNB == X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present){
|
||||
|
||||
memcpy(X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].eNB_addr.buffer,
|
||||
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.buf,
|
||||
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.size);
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].eNB_addr.length =
|
||||
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.size * 8 - e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.transportLayerAddress.bits_unused;
|
||||
|
||||
OCTET_STRING_TO_INT32(&e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item->resource_configuration.choice.sgNBPDCPpresent.s1_DL_GTPtunnelEndpoint.gTP_TEID,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
X2AP_ERROR ("Can't decode the e_RABs_ToBeSetup_List \n");
|
||||
}
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_SgNBtoMeNBContainer */
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBAdditionRequestAcknowledge_IEs_t, ie, x2SgNBAdditionRequest_ack,
|
||||
X2AP_ProtocolIE_ID_id_SgNBtoMeNBContainer, true);
|
||||
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//X2AP_MeNBtoSgNBContainer_t *container = &ie->value.choice.MeNBtoSgNBContainer;
|
||||
|
||||
if (ie->value.choice.SgNBtoMeNBContainer.size > 8192 ) // TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s
|
||||
{ printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); }
|
||||
|
||||
memcpy(X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer, ie->value.choice.SgNBtoMeNBContainer.buf, ie->value.choice.SgNBtoMeNBContainer.size);
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = ie->value.choice.SgNBtoMeNBContainer.size;
|
||||
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int x2ap_gNB_handle_ENDC_sGNB_reconfiguration_complete (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu) {
|
||||
|
||||
X2AP_SgNBReconfigurationComplete_t *x2SgNBReconfigurationComplete;
|
||||
X2AP_SgNBReconfigurationComplete_IEs_t *ie;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
MessageDef *msg;
|
||||
|
||||
DevAssert (pdu != NULL);
|
||||
x2SgNBReconfigurationComplete = &pdu->choice.initiatingMessage.value.choice.SgNBReconfigurationComplete;
|
||||
|
||||
/*if (stream == 0) {
|
||||
X2AP_ERROR ("Received new x2 SgNB Addition request on stream == 0\n");
|
||||
// TODO: send a x2 failure response
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
X2AP_DEBUG ("Received X2 SgNB Reconfiguration complete message\n");
|
||||
|
||||
x2ap_eNB_data = x2ap_get_eNB(NULL, assoc_id, 0);
|
||||
DevAssert(x2ap_eNB_data != NULL);
|
||||
|
||||
X2AP_INFO("X2AP Association id: %d \n",assoc_id);
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
//Allocate an ITTI X2AP_SGNB_ADDITION_REQ message instead
|
||||
msg = itti_alloc_new_message(TASK_X2AP, X2AP_ENDC_SGNB_RECONF_COMPLETE);
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBReconfigurationComplete_IEs_t, ie, x2SgNBReconfigurationComplete,
|
||||
X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID, true);
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
X2AP_ENDC_SGNB_RECONF_COMPLETE(msg).MeNB_ue_x2_id = ie->value.choice.UE_X2AP_ID;
|
||||
|
||||
|
||||
/* X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID */
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBReconfigurationComplete_IEs_t, ie, x2SgNBReconfigurationComplete,
|
||||
X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID, true);
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
X2AP_ENDC_SGNB_RECONF_COMPLETE(msg).SgNB_ue_x2_id = ie->value.choice.SgNB_UE_X2AP_ID;
|
||||
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_SgNBReconfigurationComplete_IEs_t, ie, x2SgNBReconfigurationComplete,
|
||||
X2AP_ProtocolIE_ID_id_ResponseInformationSgNBReconfComp, true);
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(ie->value.choice.ResponseInformationSgNBReconfComp.present == X2AP_ResponseInformationSgNBReconfComp_PR_success_SgNBReconfComp){
|
||||
X2AP_ENDC_SGNB_RECONF_COMPLETE(msg).reconf_response = X2AP_RECONF_RESPONSE_SUCCESS;
|
||||
}
|
||||
else {
|
||||
X2AP_ENDC_SGNB_RECONF_COMPLETE(msg).reconf_response = X2AP_RECONF_RESPONSE_REJECT;
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, instance_p->instance, msg);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
typedef enum {
|
||||
X2ID_STATE_SOURCE_PREPARE,
|
||||
X2ID_STATE_SOURCE_OVERALL,
|
||||
X2ID_STATE_TARGET
|
||||
X2ID_STATE_TARGET,
|
||||
X2ID_STATE_NSA_PREPARE,
|
||||
} x2id_state_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user