Merge branch 'eurecom-develop' into episys/merge_nsa_w_develop
At this point we are successfully able to build. Additionally, we can run the scenario, however, it does not pass. It seems that the gNB is not connecting to the proxy correctly. Just wanted to push the progress so far. FYI, the items that had to be changed to correct the linking issues were the following: - mac_rrc_data_ind_ue vs. nr_mac_rrc_data_ind_ue - rrc_data_req vs. nr_rrc_data_req - mac_rrc_data_req_ue vs. nr_mac_rrc_data_req_ue - rrc_data_req_ue vs. rrc_data_req_nr_ue - rrc_data_req vs. nr_rrc_data_req The listed functions should be declard in the LTE/NR UE directory depending on the functionality. Several were mixed. i.e.: LTE functions being called in NR UE. Also, removing siWindowLength, siWindowLength_int, SIBType, SIBPeriod, and siPeriod_int from the NR UE RRC. These variable were not used in the NR UE and are defined for LTE only. Lastly, in the NR_IF_Module.c of the NR UE, the global variable def_dci_pdu_rel15 is not accessible. Need to revisit this. For not it is commented out.
This commit is contained in:
@@ -24,10 +24,13 @@ MESSAGE_DEF(F1AP_CU_SCTP_REQ , MESSAGE_PRIORITY_MED, f1ap_cu_setup_req_t
|
||||
|
||||
/* eNB_DU application layer -> F1AP messages or CU F1AP -> RRC*/
|
||||
MESSAGE_DEF(F1AP_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_setup_req_t , f1ap_setup_req)
|
||||
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_acknowledge_t , f1ap_gnb_cu_configuration_update_acknowledge)
|
||||
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_failure_t , f1ap_gnb_cu_configuration_update_failure)
|
||||
|
||||
/* F1AP -> eNB_DU or eNB_CU_RRC -> F1AP application layer messages */
|
||||
MESSAGE_DEF(F1AP_SETUP_RESP , MESSAGE_PRIORITY_MED, f1ap_setup_resp_t , f1ap_setup_resp)
|
||||
MESSAGE_DEF(F1AP_SETUP_FAILURE , MESSAGE_PRIORITY_MED, f1ap_setup_failure_t , f1ap_setup_failure)
|
||||
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_t , f1ap_gnb_cu_configuration_update)
|
||||
|
||||
/* MAC -> F1AP messages */
|
||||
MESSAGE_DEF(F1AP_INITIAL_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_initial_ul_rrc_message_t , f1ap_initial_ul_rrc_message)
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
|
||||
#define F1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_req
|
||||
#define F1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_resp
|
||||
#define F1AP_GNB_CU_CONFIGURATION_UPDATE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update
|
||||
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_acknowledge
|
||||
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_failure
|
||||
#define F1AP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_failure
|
||||
|
||||
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
|
||||
@@ -55,6 +58,8 @@
|
||||
// Note this should be 512 from maxval in 38.473
|
||||
#define F1AP_MAX_NB_CELLS 2
|
||||
|
||||
#define F1AP_MAX_NO_OF_TNL_ASSOCIATIONS 32
|
||||
#define F1AP_MAX_NO_UE_ID 1024
|
||||
typedef struct f1ap_net_ip_address_s {
|
||||
unsigned ipv4:1;
|
||||
unsigned ipv6:1;
|
||||
@@ -98,7 +103,7 @@ typedef struct f1ap_setup_req_s {
|
||||
|
||||
// Served Cell Information
|
||||
/* Tracking area code */
|
||||
uint16_t tac[F1AP_MAX_NB_CELLS];
|
||||
uint32_t tac[F1AP_MAX_NB_CELLS];
|
||||
|
||||
/* Mobile Country Codes
|
||||
* Mobile Network Codes
|
||||
@@ -174,6 +179,24 @@ typedef struct f1ap_setup_req_s {
|
||||
|
||||
} f1ap_setup_req_t;
|
||||
|
||||
typedef struct served_cells_to_activate_s {
|
||||
/// mcc of DU cells
|
||||
uint16_t mcc;
|
||||
/// mnc of DU cells
|
||||
uint16_t mnc;
|
||||
/// mnc digit length of DU cells
|
||||
uint8_t mnc_digit_length;
|
||||
// NR Global Cell Id
|
||||
uint64_t nr_cellid;
|
||||
/// NRPCI
|
||||
uint16_t nrpci;
|
||||
/// num SI messages per DU cell
|
||||
uint8_t num_SI;
|
||||
/// SI message containers (up to 21 messages per cell)
|
||||
uint8_t *SI_container[21];
|
||||
int SI_container_length[21];
|
||||
} served_cells_to_activate_t;
|
||||
|
||||
typedef struct f1ap_setup_resp_s {
|
||||
/* Connexion id used between SCTP/F1AP */
|
||||
uint16_t cnx_id;
|
||||
@@ -189,29 +212,62 @@ typedef struct f1ap_setup_resp_s {
|
||||
char *gNB_CU_name;
|
||||
/// number of DU cells to activate
|
||||
uint16_t num_cells_to_activate; //0< num_cells_to_activate <= 512;
|
||||
/// mcc of DU cells
|
||||
uint16_t mcc[F1AP_MAX_NB_CELLS];
|
||||
/// mnc of DU cells
|
||||
uint16_t mnc[F1AP_MAX_NB_CELLS];
|
||||
/// mnc digit length of DU cells
|
||||
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];
|
||||
// NR Global Cell Id
|
||||
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
|
||||
/// NRPCI
|
||||
uint16_t nrpci[F1AP_MAX_NB_CELLS];
|
||||
/// num SI messages per DU cell
|
||||
uint8_t num_SI[F1AP_MAX_NB_CELLS];
|
||||
/// SI message containers (up to 21 messages per cell)
|
||||
uint8_t *SI_container[F1AP_MAX_NB_CELLS][21];
|
||||
int SI_container_length[F1AP_MAX_NB_CELLS][21];
|
||||
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
|
||||
} f1ap_setup_resp_t;
|
||||
|
||||
typedef struct f1ap_gnb_cu_configuration_update_s {
|
||||
/* Connexion id used between SCTP/F1AP */
|
||||
uint16_t cnx_id;
|
||||
|
||||
/* SCTP association id */
|
||||
int32_t assoc_id;
|
||||
|
||||
/* Number of SCTP streams used for a mme association */
|
||||
uint16_t sctp_in_streams;
|
||||
uint16_t sctp_out_streams;
|
||||
|
||||
/// string holding gNB_CU_name
|
||||
char *gNB_CU_name;
|
||||
/// number of DU cells to activate
|
||||
uint16_t num_cells_to_activate; //0< num_cells_to_activate/mod <= 512;
|
||||
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
|
||||
} f1ap_gnb_cu_configuration_update_t;
|
||||
|
||||
typedef struct f1ap_setup_failure_s {
|
||||
uint16_t cause;
|
||||
uint16_t time_to_wait;
|
||||
uint16_t criticality_diagnostics;
|
||||
} f1ap_setup_failure_t;
|
||||
|
||||
typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
|
||||
uint16_t num_cells_failed_to_be_activated;
|
||||
uint16_t mcc[F1AP_MAX_NB_CELLS];
|
||||
uint16_t mnc[F1AP_MAX_NB_CELLS];
|
||||
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];
|
||||
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
|
||||
uint16_t cause[F1AP_MAX_NB_CELLS];
|
||||
int have_criticality;
|
||||
uint16_t criticality_diagnostics;
|
||||
uint16_t noofTNLAssociations_to_setup;
|
||||
uint16_t have_port[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
|
||||
in_addr_t tl_address[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
|
||||
uint16_t noofTNLAssociations_failed;
|
||||
in_addr_t tl_address_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
|
||||
uint16_t cause_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
|
||||
uint16_t noofDedicatedSIDeliveryNeededUEs;
|
||||
uint32_t gNB_CU_ue_id[F1AP_MAX_NO_UE_ID];
|
||||
uint16_t ue_mcc[F1AP_MAX_NO_UE_ID];
|
||||
uint16_t ue_mnc[F1AP_MAX_NO_UE_ID];
|
||||
uint8_t ue_mnc_digit_length[F1AP_MAX_NO_UE_ID];
|
||||
uint64_t ue_nr_cellid[F1AP_MAX_NO_UE_ID];
|
||||
} f1ap_gnb_cu_configuration_update_acknowledge_t;
|
||||
|
||||
typedef struct f1ap_gnb_cu_configuration_update_failure_s {
|
||||
uint16_t cause;
|
||||
uint16_t time_to_wait;
|
||||
uint16_t criticality_diagnostics;
|
||||
} f1ap_gnb_cu_configuration_update_failure_t;
|
||||
|
||||
typedef struct f1ap_dl_rrc_message_s {
|
||||
|
||||
uint32_t gNB_CU_ue_id;
|
||||
@@ -243,7 +299,7 @@ typedef struct f1ap_initial_ul_rrc_message_s {
|
||||
uint16_t crnti;
|
||||
uint8_t *rrc_container;
|
||||
int rrc_container_length;
|
||||
uint8_t *du2cu_rrc_container;
|
||||
int8_t *du2cu_rrc_container;
|
||||
int du2cu_rrc_container_length;
|
||||
} f1ap_initial_ul_rrc_message_t;
|
||||
|
||||
|
||||
@@ -33,4 +33,5 @@ MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv
|
||||
|
||||
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq)
|
||||
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp)
|
||||
MESSAGE_DEF(GTPV1U_GNB_NG_REQ, MESSAGE_PRIORITY_MED, Gtpv1uNGReq, gtpv1uNGReq)
|
||||
MESSAGE_DEF(GTPV1U_GNB_NG_REQ, MESSAGE_PRIORITY_MED, Gtpv1uNGReq, gtpv1uNGReq)
|
||||
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq
|
||||
#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp
|
||||
#define GTPV1U_GNB_NG_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uNGReq
|
||||
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
|
||||
|
||||
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
|
||||
|
||||
@@ -167,19 +168,23 @@ typedef struct gtpv1u_enb_end_marker_ind_s {
|
||||
uint32_t sdu_size;
|
||||
uint8_t *sdu_p;
|
||||
uint8_t mode;
|
||||
uint16_t rnti;
|
||||
uint8_t module_id;
|
||||
uint16_t rnti;
|
||||
uint8_t module_id;
|
||||
uint8_t eNB_index;
|
||||
} gtpv1u_enb_end_marker_ind_t;
|
||||
|
||||
typedef struct {
|
||||
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
|
||||
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
|
||||
char addrStr[256];
|
||||
char portStr[256];
|
||||
} Gtpv1uS1Req;
|
||||
|
||||
typedef struct {
|
||||
in_addr_t gnb_ip_address_for_NGu_up;
|
||||
tcp_udp_port_t gnb_port_for_NGu_up;
|
||||
char addrStr[256];
|
||||
char portStr[256];
|
||||
} Gtpv1uNGReq;
|
||||
typedef struct gtpv1u_gnb_create_tunnel_req_s {
|
||||
rnti_t rnti;
|
||||
@@ -210,4 +215,12 @@ typedef struct gtpv1u_gnb_delete_tunnel_resp_s {
|
||||
teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted
|
||||
} gtpv1u_gnb_delete_tunnel_resp_t;
|
||||
|
||||
typedef struct gtpv1u_gnb_tunnel_data_req_s {
|
||||
uint8_t *buffer;
|
||||
uint32_t length;
|
||||
uint32_t offset; ///< start of message offset in buffer
|
||||
rnti_t rnti;
|
||||
pdusessionid_t pdusession_id;
|
||||
} gtpv1u_gnb_tunnel_data_req_t;
|
||||
|
||||
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#define MAC_MESSAGES_TYPES_H_
|
||||
|
||||
#include <LTE_DRX-Config.h>
|
||||
#include "OCTET_STRING.h"
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Defines to access message fields.
|
||||
@@ -143,6 +144,7 @@ typedef struct NRRrcMacCcchDataInd_s {
|
||||
uint16_t rnti;
|
||||
uint32_t sdu_size;
|
||||
uint8_t sdu[CCCH_SDU_SIZE];
|
||||
OCTET_STRING_t *du_to_cu_rrc_container;
|
||||
uint8_t gnb_index;
|
||||
int CC_id;
|
||||
} NRRrcMacCcchDataInd;
|
||||
|
||||
@@ -189,7 +189,7 @@ typedef struct MEAS_REQ_TABLE_ENTRY {
|
||||
MAC_MEAS_REQ Mac_meas_req;
|
||||
unsigned int Last_report_frame;
|
||||
unsigned int Next_check_frame;
|
||||
uint8_t Status;
|
||||
uint8_t StatusMeas;
|
||||
uint8_t Meas_req_status;
|
||||
uint8_t Rx_activity;
|
||||
//uint8_t Meas_Direction;//???
|
||||
@@ -269,7 +269,7 @@ typedef struct {
|
||||
char Wideband_sinr;
|
||||
uint8_t Forg_fact;
|
||||
unsigned short Rep_interval;
|
||||
uint8_t Status;
|
||||
uint8_t StatusMeas;
|
||||
unsigned int Last_report_frame;
|
||||
unsigned int Next_check_frame;
|
||||
uint8_t Active;
|
||||
@@ -299,7 +299,7 @@ typedef struct {
|
||||
unsigned short Rep_interval;
|
||||
unsigned int Last_report_frame;
|
||||
unsigned int Next_check_frame;
|
||||
uint8_t Status; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok
|
||||
uint8_t StatusMeas; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok
|
||||
uint8_t Active;
|
||||
} __attribute__ ((__packed__)) DEFAULT_CH_MEAS;
|
||||
#define DEFAULT_eNB_MEAS_SIZE sizeof(DEFAULT_eNB_MEAS)
|
||||
|
||||
@@ -35,4 +35,5 @@ MESSAGE_DEF(RRC_NRUE_CAP_INFO_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataIn
|
||||
MESSAGE_DEF(RRC_DCCH_DATA_COPY_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataInd, rrc_dcch_data_copy_ind)
|
||||
|
||||
// gNB
|
||||
MESSAGE_DEF(NR_RRC_DCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, NRRrcDcchDataReq, nr_rrc_dcch_data_req)
|
||||
MESSAGE_DEF(NR_RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcDcchDataInd, nr_rrc_dcch_data_ind)
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define RRC_DCCH_DATA_COPY_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_dcch_data_copy_ind
|
||||
|
||||
// gNB
|
||||
#define NR_RRC_DCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_dcch_data_req
|
||||
#define NR_RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_dcch_data_ind
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
@@ -73,6 +74,20 @@ typedef struct RrcDcchDataCopyInd_s {
|
||||
uint8_t eNB_index;
|
||||
} RrcDcchDataCopyInd;
|
||||
|
||||
typedef struct NRRrcDcchDataReq_s {
|
||||
uint32_t frame;
|
||||
uint8_t gnb_flag;
|
||||
rb_id_t rb_id;
|
||||
uint32_t muip;
|
||||
uint32_t confirmp;
|
||||
uint32_t sdu_size;
|
||||
uint8_t *sdu_p;
|
||||
uint8_t mode;
|
||||
uint16_t rnti;
|
||||
uint8_t module_id;
|
||||
uint8_t gNB_index;
|
||||
} NRRrcDcchDataReq;
|
||||
|
||||
typedef struct NRRrcDcchDataInd_s {
|
||||
uint32_t frame;
|
||||
uint8_t dcch_index;
|
||||
|
||||
@@ -28,12 +28,14 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "LTE_asn_constant.h"
|
||||
#include "NR_asn_constant.h"
|
||||
|
||||
#ifndef __PLATFORM_CONSTANTS_H__
|
||||
# define __PLATFORM_CONSTANTS_H__
|
||||
|
||||
#include "LTE_asn_constant.h"
|
||||
#include "NR_asn_constant.h"
|
||||
#define NR_MAXDRB 14
|
||||
|
||||
#ifdef JUMBO_FRAME
|
||||
#define NL_MAX_PAYLOAD 18000 /* this should cover the max mtu size*/
|
||||
#else
|
||||
@@ -87,13 +89,7 @@
|
||||
#define MAX_gNB 2
|
||||
#endif
|
||||
|
||||
#define NUMBER_OF_NR_DLSCH_MAX 2//16
|
||||
#define NUMBER_OF_NR_ULSCH_MAX 2//16
|
||||
#define NUMBER_OF_NR_SCH_STATS_MAX 16
|
||||
#define NUMBER_OF_NR_PUCCH_MAX 16
|
||||
#define NUMBER_OF_NR_SR_MAX 16
|
||||
#define NUMBER_OF_NR_PDCCH_MAX 16
|
||||
|
||||
#define NUMBER_OF_NR_UCI_STATS_MAX 16
|
||||
#define MAX_MANAGED_ENB_PER_MOBILE 2
|
||||
#define MAX_MANAGED_GNB_PER_MOBILE 2
|
||||
|
||||
|
||||
@@ -195,21 +195,13 @@ typedef uint8_t mme_code_t;
|
||||
typedef uint32_t m_tmsi_t;
|
||||
|
||||
//Random UE identity length = 40 bits
|
||||
#if ! defined(NOT_A_RANDOM_UE_IDENTITY)
|
||||
#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
|
||||
#endif
|
||||
#if ! defined(NOT_A_RNTI)
|
||||
#define NOT_A_RNTI (rnti_t)0
|
||||
#endif
|
||||
#if ! defined(M_RNTI)
|
||||
#define M_RNTI (rnti_t)0xFFFD
|
||||
#endif
|
||||
#if ! defined(P_RNTI)
|
||||
#define P_RNTI (rnti_t)0xFFFE
|
||||
#endif
|
||||
#if ! defined(SI_RNTI)
|
||||
#define SI_RNTI (rnti_t)0xFFFF
|
||||
#endif
|
||||
#define CBA_RNTI (rnti_t)0xfff4
|
||||
#define OAI_C_RNTI (rnti_t)0x1234
|
||||
typedef enum config_action_e {
|
||||
CONFIG_ACTION_NULL = 0,
|
||||
CONFIG_ACTION_ADD = 1,
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "LTE_SL-DiscResourcePool-r12.h"
|
||||
#include "NR_RACH-ConfigCommon.h"
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
#include "NR_ServingCellConfig.h"
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Messages for RRC logging
|
||||
#if defined(DISABLE_ITTI_XER_PRINT)
|
||||
@@ -406,9 +407,12 @@ 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];
|
||||
uint8_t num_plmn;
|
||||
NR_ServingCellConfigCommon_t *scc;
|
||||
NR_ServingCellConfig_t *scd;
|
||||
int ssb_SubcarrierOffset;
|
||||
int pdsch_AntennaPorts;
|
||||
int pusch_AntennaPorts;
|
||||
int pusch_TargetSNRx10;
|
||||
int pucch_TargetSNRx10;
|
||||
} gNB_RrcConfigurationReq;
|
||||
|
||||
@@ -398,6 +398,11 @@ typedef struct s1ap_register_enb_req_s {
|
||||
/* Number of SCTP streams used for a mme association */
|
||||
uint16_t sctp_in_streams;
|
||||
uint16_t sctp_out_streams;
|
||||
uint16_t s1_setuprsp_wait_timer;
|
||||
uint16_t s1_setupreq_wait_timer;
|
||||
uint16_t s1_setupreq_count;
|
||||
uint16_t sctp_req_timer;
|
||||
uint16_t sctp_req_count;
|
||||
} s1ap_register_enb_req_t;
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
// This task is mandatory and must always be placed in first position
|
||||
TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
|
||||
|
||||
// Other possible tasks in the process
|
||||
|
||||
// Common tasks:
|
||||
|
||||
/// Bearers Manager task
|
||||
TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
|
||||
|
||||
// eNodeB tasks and sub-tasks:
|
||||
|
||||
/// Radio Resource Control task
|
||||
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
|
||||
|
||||
// Define here for now
|
||||
TASK_DEF(TASK_RRC_ENB_NB_IoT, TASK_PRIORITY_MED, 200)
|
||||
|
||||
TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200)
|
||||
|
||||
/// S1ap task
|
||||
/// RAL task for ENB
|
||||
TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200)
|
||||
|
||||
// UDP TASK
|
||||
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000)
|
||||
// GTP_V1U task
|
||||
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000)
|
||||
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200)
|
||||
/// M3ap task, acts as both source and target
|
||||
TASK_DEF(TASK_M3AP, TASK_PRIORITY_MED, 200)
|
||||
/// M3ap task, acts as both source and target
|
||||
TASK_DEF(TASK_M3AP_MME, TASK_PRIORITY_MED, 200)
|
||||
/// M3ap task, acts as both source and target
|
||||
TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200)
|
||||
/// M2ap task, acts as both source and target
|
||||
TASK_DEF(TASK_M2AP_MCE, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_M2AP_ENB, TASK_PRIORITY_MED, 200)
|
||||
/// X2ap task, acts as both source and target
|
||||
TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200)
|
||||
/// Sctp task (Used by both S1AP and X2AP)
|
||||
TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200)
|
||||
/// eNB APP task
|
||||
TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
|
||||
/// gNB APP task
|
||||
TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200)
|
||||
/// eNB Agent task
|
||||
TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_PROTO_AGENT, TASK_PRIORITY_MED, 200)
|
||||
// UE tasks and sub-tasks:
|
||||
|
||||
/// Radio Resource Control task
|
||||
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_RRC_NSA_NRUE, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_RRC_NSA_UE, TASK_PRIORITY_MED, 200)
|
||||
/// Non Access Stratum task
|
||||
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200)
|
||||
|
||||
//MESSAGE GENERATOR TASK
|
||||
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200)
|
||||
|
||||
#ifdef ITTI_SIM
|
||||
TASK_DEF(TASK_RRC_GNB_SIM, TASK_PRIORITY_MED, 200)
|
||||
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200)
|
||||
#endif
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
/*Array containing the Agent-MAC interfaces*/
|
||||
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#include "flexran_agent_mac_internal.h"
|
||||
#include "flexran_agent_mac_slice_verification.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
extern SLIST_HEAD(flexran_so_handle,
|
||||
flexran_agent_so_handle_s) flexran_handles[NUM_MAX_ENB];
|
||||
|
||||
|
||||
@@ -51,8 +51,6 @@ typedef struct {
|
||||
pthread_mutex_t *mutex;
|
||||
} mac_stats_updates_context_t;
|
||||
|
||||
/*Array holding the last stats reports for each eNB. Used for continuous reporting*/
|
||||
mac_stats_updates_context_t mac_stats_context[NUM_MAX_ENB];
|
||||
|
||||
/*Functions to initialize and destroy the struct required for the
|
||||
*continuous stats update report*/
|
||||
|
||||
@@ -49,8 +49,6 @@ typedef struct
|
||||
/*To Be Extended*/
|
||||
}rrc_meas_stats;
|
||||
|
||||
/* RRC CMI statistics */
|
||||
rrc_meas_stats * meas_stats;
|
||||
|
||||
|
||||
/* FLEXRAN AGENT-RRC Interface */
|
||||
|
||||
@@ -56,10 +56,14 @@
|
||||
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd"
|
||||
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd"
|
||||
#define CONFIG_STRING_MACRLC_SCHED_MODE "scheduler_mode"
|
||||
#define CONFIG_MACRLC_PUSCH10xSNR "puSch10xSnr"
|
||||
#define CONFIG_MACRLC_PUCCH10xSNR "puCch10xSnr"
|
||||
#define CONFIG_STRING_MACRLC_PUSCH10xSNR "puSch10xSnr"
|
||||
#define CONFIG_STRING_MACRLC_PUCCH10xSNR "puCch10xSnr"
|
||||
#define CONFIG_STRING_MACRLC_DEFAULT_SCHED_DL_ALGO "default_sched_dl_algo"
|
||||
|
||||
#define CONFIG_STRING_MACRLC_UE_MULTIPLE_MAX "ue_multiple_max"
|
||||
#define CONFIG_STRING_MACRLC_USE_MCS_OFFSET "use_mcs_offset"
|
||||
#define CONFIG_STRING_MACRLC_BLER_TARGET_LOWER "bler_target_lower"
|
||||
#define CONFIG_STRING_MACRLC_BLER_TARGET_UPPER "bler_target_upper"
|
||||
#define CONFIG_STRING_MACRLC_MAX_UL_RB_INDEX "max_ul_rb_index"
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* MacRLC configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -83,10 +87,15 @@
|
||||
{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_SCHED_MODE, NULL, 0, strptr:NULL, defstrval:"default", TYPE_STRING, 0}, \
|
||||
{CONFIG_MACRLC_PUSCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_MACRLC_PUCCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_DEFAULT_SCHED_DL_ALGO, NULL, 0, strptr:NULL, defstrval:"round_robin_dl", TYPE_STRING, 0}, \
|
||||
}
|
||||
{CONFIG_STRING_MACRLC_PUSCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_PUCCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_DEFAULT_SCHED_DL_ALGO, NULL, 0, strptr:NULL, defstrval:"round_robin_dl", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_MACRLC_UE_MULTIPLE_MAX, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_USE_MCS_OFFSET, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_BLER_TARGET_LOWER, NULL, 0, dblptr:NULL, defdblval:.5, TYPE_DOUBLE, 0}, \
|
||||
{CONFIG_STRING_MACRLC_BLER_TARGET_UPPER, NULL, 0, dblptr:NULL, defdblval:2, TYPE_DOUBLE, 0}, \
|
||||
{CONFIG_STRING_MACRLC_MAX_UL_RB_INDEX, NULL, 0, iptr:NULL, defintval:22, TYPE_INT, 0}}
|
||||
|
||||
#define MACRLC_CC_IDX 0
|
||||
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
|
||||
#define MACRLC_LOCAL_N_IF_NAME_IDX 2
|
||||
@@ -108,6 +117,11 @@
|
||||
#define MACRLC_PUSCH10xSNR_IDX 18
|
||||
#define MACRLC_PUCCH10xSNR_IDX 19
|
||||
#define MACRLC_DEFAULT_SCHED_DL_ALGO_IDX 20
|
||||
#define MACRLC_UE_MULTIPLE_MAX_IDX 21
|
||||
#define MACRLC_USE_MCS_OFFSET_IDX 22
|
||||
#define MACRLC_BLER_TARGET_LOWER_IDX 23
|
||||
#define MACRLC_BLER_TARGET_UPPER_IDX 24
|
||||
#define MACRLC_MAX_UL_RB_INDEX_IDX 25
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
#define NBIOT_INTERFACE_SOURCE
|
||||
#include "NB_IoT_interface.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
|
||||
#define NBIOT_MODULENAME "NB_IoT"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
typedef void(*RCConfig_NbIoT_f_t)(RAN_CONTEXT_t *RC);
|
||||
#define NBIOT_RCCONFIG_FNAME "RCConfig_NbIoT"
|
||||
|
||||
@@ -244,6 +244,8 @@ void *eNB_app_task(void *args_p) {
|
||||
|
||||
}
|
||||
|
||||
LOG_I(ENB_APP,"TASK_ENB_APP is ready\n");
|
||||
|
||||
do {
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_ENB_APP, &msg_p);
|
||||
|
||||
+101
-19
@@ -57,12 +57,15 @@
|
||||
#include "enb_paramdef.h"
|
||||
#include "proto_agent.h"
|
||||
#include "executables/thread-common.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw);
|
||||
extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t bw);
|
||||
extern char *parallel_config;
|
||||
extern char *worker_config;
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
|
||||
void RCconfig_flexran() {
|
||||
/* get number of eNBs */
|
||||
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
|
||||
@@ -217,13 +220,26 @@ void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
|
||||
for (j = 0; j < RC.nb_macrlc_inst; j++) {
|
||||
RC.mac[j]->puSch10xSnr = *(MacRLC_ParamList.paramarray[j][MACRLC_PUSCH10xSNR_IDX ].iptr);
|
||||
RC.mac[j]->puCch10xSnr = *(MacRLC_ParamList.paramarray[j][MACRLC_PUCCH10xSNR_IDX ].iptr);
|
||||
RC.mac[j]->ue_multiple_max = *(MacRLC_ParamList.paramarray[j][MACRLC_UE_MULTIPLE_MAX_IDX ].iptr);
|
||||
RC.mac[j]->use_mcs_offset = *(MacRLC_ParamList.paramarray[j][MACRLC_USE_MCS_OFFSET_IDX ].iptr);
|
||||
RC.mac[j]->bler_lower = *(MacRLC_ParamList.paramarray[j][MACRLC_BLER_TARGET_LOWER_IDX ].dblptr);
|
||||
RC.mac[j]->bler_upper = *(MacRLC_ParamList.paramarray[j][MACRLC_BLER_TARGET_UPPER_IDX ].dblptr);
|
||||
RC.mac[j]->max_ul_rb_index = *(MacRLC_ParamList.paramarray[j][MACRLC_MAX_UL_RB_INDEX_IDX ].iptr);
|
||||
RC.nb_mac_CC[j] = *(MacRLC_ParamList.paramarray[j][MACRLC_CC_IDX].iptr);
|
||||
|
||||
LOG_I(ENB_APP,"MAC instance %d parameters : pusch_snr %lf, pucch_snr %lf, ue_multiple_max %d, use_mcs_offset %d, bler_lower %lf, bler_upper %lf,max_ul_rb_index %d\n",
|
||||
j,
|
||||
RC.mac[j]->puSch10xSnr/10.0,
|
||||
RC.mac[j]->puCch10xSnr/10.0,
|
||||
RC.mac[j]->ue_multiple_max,
|
||||
RC.mac[j]->use_mcs_offset,
|
||||
RC.mac[j]->bler_lower,
|
||||
RC.mac[j]->bler_upper,
|
||||
RC.mac[j]->max_ul_rb_index);
|
||||
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) {
|
||||
// check number of instances is same as RRC/PDCP
|
||||
printf("Configuring local RRC for MACRLC\n");
|
||||
LOG_I(ENB_APP,"Configuring local RRC for MACRLC\n");
|
||||
} else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) {
|
||||
printf("Configuring F1 interfaces for MACRLC\n");
|
||||
LOG_I(ENB_APP,"Configuring F1 interfaces for MACRLC\n");
|
||||
RC.mac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
|
||||
RC.mac[j]->eth_params_n.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr));
|
||||
RC.mac[j]->eth_params_n.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr));
|
||||
@@ -1992,7 +2008,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nrb = rrc->carrier[0].mib.message.dl_Bandwidth;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.num_frequency_bands = 1;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.sul_active = 0;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.sul_active = 0;
|
||||
} else {
|
||||
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k);
|
||||
F1AP_SETUP_REQ (msg_p).fdd_flag = 1;
|
||||
@@ -2058,7 +2074,9 @@ int RCconfig_gtpu(void ) {
|
||||
IPV4_STR_ADDR_TO_INT_NWBO ( address, GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
|
||||
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up);
|
||||
GTPV1U_ENB_S1_REQ(message).enb_port_for_S1u_S12_S4_up = enb_port_for_S1U;
|
||||
itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
strcpy(GTPV1U_ENB_S1_REQ(message).addrStr,address);
|
||||
sprintf(GTPV1U_ENB_S1_REQ(message).portStr,"%d", enb_port_for_S1U);
|
||||
itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
} else
|
||||
LOG_E(GTPU,"invalid address for S1U\n");
|
||||
|
||||
@@ -2429,6 +2447,65 @@ int RCconfig_S1(
|
||||
"to\n"
|
||||
" tracking_area_code = 1; // no string!!\n"
|
||||
" plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } )\n");
|
||||
if(*ENBParamList.paramarray[k][ENB_S1SETUP_RSP_TIMER_IDX].uptr <= 0xffff)
|
||||
{
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).s1_setuprsp_wait_timer = *ENBParamList.paramarray[k][ENB_S1SETUP_RSP_TIMER_IDX].uptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E(S1AP,
|
||||
"s1setup_rsp_timer value in conf file is invalid (%d). Default value is set.\n",
|
||||
*ENBParamList.paramarray[k][ENB_S1SETUP_RSP_TIMER_IDX].uptr);
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).s1_setuprsp_wait_timer = 5;
|
||||
}
|
||||
|
||||
if(*ENBParamList.paramarray[k][ENB_S1SETUP_REQ_TIMER_IDX].uptr <= 0xffff)
|
||||
{
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).s1_setupreq_wait_timer = *ENBParamList.paramarray[k][ENB_S1SETUP_REQ_TIMER_IDX].uptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E(S1AP,
|
||||
"s1setup_req_timer value in conf file is invalid (%d). Default value is set.\n",
|
||||
*ENBParamList.paramarray[k][ENB_S1SETUP_REQ_TIMER_IDX].uptr);
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).s1_setupreq_wait_timer = 5;
|
||||
}
|
||||
|
||||
if(*ENBParamList.paramarray[k][ENB_S1SETUP_REQ_COUNT_IDX].uptr <= 0xffff)
|
||||
{
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).s1_setupreq_count = *ENBParamList.paramarray[k][ENB_S1SETUP_REQ_COUNT_IDX].uptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E(S1AP,
|
||||
"s1setup_req_count value in conf file is invalid (%d). Default value is set.\n",
|
||||
*ENBParamList.paramarray[k][ENB_S1SETUP_REQ_COUNT_IDX].uptr);
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).s1_setupreq_count = 0xffff;
|
||||
}
|
||||
|
||||
if(*ENBParamList.paramarray[k][ENB_SCTP_REQ_TIMER_IDX].uptr <= 0xffff)
|
||||
{
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).sctp_req_timer = *ENBParamList.paramarray[k][ENB_SCTP_REQ_TIMER_IDX].uptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E(S1AP,
|
||||
"sctp_req_timer value in conf file is invalid (%d). Default value is set.\n",
|
||||
*ENBParamList.paramarray[k][ENB_SCTP_REQ_TIMER_IDX].uptr);
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).sctp_req_timer = 180;
|
||||
}
|
||||
|
||||
if(*ENBParamList.paramarray[k][ENB_SCTP_REQ_COUNT_IDX].uptr <= 0xffff)
|
||||
{
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).sctp_req_count = *ENBParamList.paramarray[k][ENB_SCTP_REQ_COUNT_IDX].uptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E(S1AP,
|
||||
"sctp_req_count value in conf file is invalid (%d). Default value is set.\n",
|
||||
*ENBParamList.paramarray[k][ENB_SCTP_REQ_COUNT_IDX].uptr);
|
||||
S1AP_REGISTER_ENB_REQ(msg_p).sctp_req_count = 0xffff;
|
||||
}
|
||||
config_getlist(&PLMNParamList, PLMNParams, sizeof(PLMNParams)/sizeof(paramdef_t), aprefix);
|
||||
|
||||
if (PLMNParamList.numelt < 1 || PLMNParamList.numelt > 6) {
|
||||
@@ -2717,12 +2794,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
"value of X2ParamList.numelt %d must be lower than X2AP_MAX_NB_ENB_IP_ADDRESS %d value: reconsider to increase X2AP_MAX_NB_ENB_IP_ADDRESS\n",
|
||||
X2ParamList.numelt,X2AP_MAX_NB_ENB_IP_ADDRESS);
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 = 0;
|
||||
|
||||
LOG_I(X2AP,"X2ParamList.numelt %d\n",X2ParamList.numelt);
|
||||
for (l = 0; l < X2ParamList.numelt; l++) {
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 += 1;
|
||||
strcpy(X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4_address,*(X2ParamList.paramarray[l][ENB_X2_IPV4_ADDRESS_IDX].strptr));
|
||||
strcpy(X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6_address,*(X2ParamList.paramarray[l][ENB_X2_IPV6_ADDRESS_IDX].strptr));
|
||||
|
||||
LOG_I(X2AP,"registering with ip : %s\n",*(X2ParamList.paramarray[l][ENB_X2_IPV4_ADDRESS_IDX].strptr));
|
||||
if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) {
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 0;
|
||||
@@ -2902,7 +2980,7 @@ void extract_and_decode_SI(int inst,int si_ind,uint8_t *si_container,int si_cont
|
||||
eNB_RRC_INST *rrc = RC.rrc[inst];
|
||||
rrc_eNB_carrier_data_t *carrier = &rrc->carrier[0];
|
||||
LTE_BCCH_DL_SCH_Message_t *bcch_message ;
|
||||
AssertFatal(si_ind==0,"Can only handle a single SI block for now\n");
|
||||
AssertFatal(si_ind==2,"Can only handle a single SI block for now\n");
|
||||
LOG_I(ENB_APP, "rrc inst %d: Trying to decode SI block %d @ %p, length %d\n",inst,si_ind,si_container,si_container_length);
|
||||
// point to first SI block
|
||||
bcch_message = &carrier->systemInformation;
|
||||
@@ -3083,21 +3161,25 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
|
||||
rrc_eNB_carrier_data_t *carrier = &RC.rrc[i]->carrier[0];
|
||||
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID
|
||||
LOG_I(ENB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n",
|
||||
j,i,RC.rrc[i]->nr_cellid,resp->nr_cellid[j]);
|
||||
j,i,RC.rrc[i]->nr_cellid,resp->cells_to_activate[j].nr_cellid);
|
||||
|
||||
if (RC.rrc[i]->nr_cellid == resp->nr_cellid[j] &&
|
||||
(check_plmn_identity(carrier, resp->mcc[j], resp->mnc[j], resp->mnc_digit_length[j])>0 &&
|
||||
resp->nrpci[j] == carrier->physCellId)) {
|
||||
if (RC.rrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid &&
|
||||
(check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
|
||||
resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
|
||||
// copy system information and decode it
|
||||
for (si_ind=0; si_ind<resp->num_SI[j]; si_ind++) {
|
||||
//printf("SI %d size %d: ", si_ind, resp->SI_container_length[j][si_ind]);
|
||||
//for (int n=0;n<resp->SI_container_length[j][si_ind];n++)
|
||||
// printf("%02x ",resp->SI_container[j][si_ind][n]);
|
||||
for (si_ind=2; si_ind<resp->cells_to_activate[j].num_SI + 2; si_ind++) {
|
||||
//printf("SI %d size %d: ", si_ind, resp->cells_to_activate[j].SI_container_length[si_ind]);
|
||||
//for (int n=0;n<resp->cells_to_activate[j].SI_container_length[si_ind];n++)
|
||||
// printf("%02x ",resp->cells_to_activate[j].SI_container[si_ind][n]);
|
||||
//printf("\n");
|
||||
extract_and_decode_SI(i,
|
||||
si_ind,
|
||||
resp->SI_container[j][si_ind],
|
||||
resp->SI_container_length[j][si_ind]);
|
||||
if (si_ind==6) si_ind=9;
|
||||
if (resp->cells_to_activate[j].SI_container[si_ind] != NULL) {
|
||||
extract_and_decode_SI(i,
|
||||
si_ind,
|
||||
resp->cells_to_activate[j].SI_container[si_ind],
|
||||
resp->cells_to_activate[j].SI_container_length[si_ind]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// perform MAC/L1 common configuration
|
||||
|
||||
@@ -100,7 +100,6 @@ typedef struct ru_config_s {
|
||||
uint8_t if_compress;
|
||||
} ru_config_t;
|
||||
|
||||
extern void RCconfig_RU(void);
|
||||
extern void RCconfig_flexran(void);
|
||||
extern void RCconfig_L1(void);
|
||||
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
|
||||
|
||||
@@ -98,6 +98,7 @@ typedef enum {
|
||||
#define CONFIG_STRING_RU_BF_WEIGHTS_LIST "bf_weights"
|
||||
#define CONFIG_STRING_RU_IF_FREQUENCY "if_freq"
|
||||
#define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset"
|
||||
#define CONFIG_STRING_RU_DO_PRECODING "do_precoding"
|
||||
|
||||
#define RU_LOCAL_IF_NAME_IDX 0
|
||||
#define RU_LOCAL_ADDRESS_IDX 1
|
||||
@@ -127,7 +128,7 @@ typedef enum {
|
||||
#define RU_BF_WEIGHTS_LIST_IDX 25
|
||||
#define RU_IF_FREQUENCY 26
|
||||
#define RU_IF_FREQ_OFFSET 27
|
||||
|
||||
#define RU_DO_PRECODING 28
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RU configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -160,7 +161,8 @@ typedef enum {
|
||||
{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}, \
|
||||
{CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
@@ -214,6 +216,11 @@ typedef enum {
|
||||
#define ENB_CONFIG_STRING_X2 "enable_x2"
|
||||
#define ENB_CONFIG_STRING_ENB_M2 "enable_enb_m2"
|
||||
#define ENB_CONFIG_STRING_MCE_M2 "enable_mce_m2"
|
||||
#define ENB_CONFIG_STRING_S1SETUP_RSP_TIMER "s1setup_rsp_timer"
|
||||
#define ENB_CONFIG_STRING_S1SETUP_REQ_TIMER "s1setup_req_timer"
|
||||
#define ENB_CONFIG_STRING_S1SETUP_REQ_COUNT "s1setup_req_count"
|
||||
#define ENB_CONFIG_STRING_SCTP_REQ_TIMER "sctp_req_timer"
|
||||
#define ENB_CONFIG_STRING_SCTP_REQ_COUNT "sctp_req_count"
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* cell configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -239,6 +246,11 @@ typedef enum {
|
||||
{ENB_CONFIG_STRING_X2, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{ENB_CONFIG_STRING_ENB_M2, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{ENB_CONFIG_STRING_MCE_M2, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{ENB_CONFIG_STRING_S1SETUP_RSP_TIMER, NULL, 0, uptr:NULL, defuintval:5, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_S1SETUP_REQ_TIMER, NULL, 0, uptr:NULL, defuintval:5, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_S1SETUP_REQ_COUNT, NULL, 0, uptr:NULL, defuintval:65535, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_SCTP_REQ_TIMER, NULL, 0, uptr:NULL, defuintval:180, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_SCTP_REQ_COUNT, NULL, 0, uptr:NULL, defuintval:65535, TYPE_UINT, 0}, \
|
||||
}
|
||||
|
||||
#define ENB_ENB_ID_IDX 0
|
||||
@@ -261,6 +273,11 @@ typedef enum {
|
||||
#define ENB_ENABLE_X2 17
|
||||
#define ENB_ENABLE_ENB_M2 18
|
||||
#define ENB_ENABLE_MCE_M2 19
|
||||
#define ENB_S1SETUP_RSP_TIMER_IDX 20
|
||||
#define ENB_S1SETUP_REQ_TIMER_IDX 21
|
||||
#define ENB_S1SETUP_REQ_COUNT_IDX 22
|
||||
#define ENB_SCTP_REQ_TIMER_IDX 23
|
||||
#define ENB_SCTP_REQ_COUNT_IDX 24
|
||||
|
||||
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
|
||||
#define ENBPARAMS_CHECK { \
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#include <pthread.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int agent_task_created = 0;
|
||||
/*
|
||||
* enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
/*
|
||||
* message primitives
|
||||
*/
|
||||
@@ -648,18 +651,6 @@ error:
|
||||
* ************************************
|
||||
*/
|
||||
|
||||
int sort_ue_config(const void *a, const void *b) {
|
||||
const Protocol__FlexUeConfig *fa = a;
|
||||
const Protocol__FlexUeConfig *fb = b;
|
||||
|
||||
if (fa->rnti < fb->rnti)
|
||||
return -1;
|
||||
else if (fa->rnti < fb->rnti)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
|
||||
xid_t xid;
|
||||
Protocol__FlexHeader *header = NULL;
|
||||
|
||||
@@ -70,7 +70,6 @@ typedef struct {
|
||||
pthread_mutex_t *mutex;
|
||||
} stats_updates_context_t;
|
||||
|
||||
stats_updates_context_t stats_context[NUM_MAX_ENB];
|
||||
|
||||
/**********************************
|
||||
* FlexRAN protocol messages helper
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
flexran_agent_channel_t *agent_channel[NUM_MAX_ENB][FLEXRAN_AGENT_MAX];
|
||||
flexran_agent_channel_instance_t channel_instance;
|
||||
static flexran_agent_channel_instance_t channel_instance;
|
||||
int flexran_agent_channel_id = 0;
|
||||
|
||||
int flexran_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size, int priority) {
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
#include "s1ap_eNB_management_procedures.h"
|
||||
#include "openair2/LAYER2/MAC/slicing/slicing.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
static inline int phy_is_present(mid_t mod_id, uint8_t cc_id) {
|
||||
return RC.eNB && RC.eNB[mod_id] && RC.eNB[mod_id][cc_id];
|
||||
}
|
||||
@@ -885,7 +888,7 @@ uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti) {
|
||||
|
||||
if (!ue_context_p) return RRC_INACTIVE;
|
||||
|
||||
return ue_context_p->ue_context.Status;
|
||||
return ue_context_p->ue_context.StatusRrc;
|
||||
}
|
||||
|
||||
uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id) {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include <stdint.h>
|
||||
#include <openair2/COMMON/platform_constants.h>
|
||||
#include <openair2/LAYER2/PDCP_v10.1.0/pdcp.h>
|
||||
pdcp_enb_t pdcp_enb[MAX_NUM_CCs];
|
||||
uint32_t Pdcp_stats_tx_window_ms[MAX_eNB][MAX_MOBILES_PER_ENB];
|
||||
uint32_t Pdcp_stats_tx_bytes[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_bytes_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_bytes_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_sn[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_throughput_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_aiat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_aiat_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_aiat_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_iat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
|
||||
uint32_t Pdcp_stats_rx_window_ms[MAX_eNB][MAX_MOBILES_PER_ENB];
|
||||
uint32_t Pdcp_stats_rx[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_bytes[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_bytes_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_bytes_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_sn[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_goodput_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_aiat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_aiat_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_iat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_outoforder[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Common definitions
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-CommonDataTypes {
|
||||
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
|
||||
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-CommonDataTypes (3) }
|
||||
|
||||
DEFINITIONS AUTOMATIC TAGS ::=
|
||||
|
||||
BEGIN
|
||||
|
||||
Criticality ::= ENUMERATED { reject, ignore, notify }
|
||||
|
||||
Presence ::= ENUMERATED { optional, conditional, mandatory }
|
||||
|
||||
PrivateIE-ID ::= CHOICE {
|
||||
local INTEGER (0..65535),
|
||||
global OBJECT IDENTIFIER
|
||||
}
|
||||
|
||||
ProcedureCode ::= INTEGER (0..255)
|
||||
|
||||
ProtocolExtensionID ::= INTEGER (0..65535)
|
||||
|
||||
ProtocolIE-ID ::= INTEGER (0..65535)
|
||||
|
||||
TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessful-outcome }
|
||||
|
||||
END
|
||||
@@ -0,0 +1,622 @@
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Constant definitions
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-Constants {
|
||||
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
|
||||
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Constants (4) }
|
||||
|
||||
DEFINITIONS AUTOMATIC TAGS ::=
|
||||
|
||||
BEGIN
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- IE parameter types from other modules.
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
IMPORTS
|
||||
ProcedureCode,
|
||||
ProtocolIE-ID
|
||||
|
||||
FROM F1AP-CommonDataTypes;
|
||||
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Elementary Procedures
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
id-Reset ProcedureCode ::= 0
|
||||
id-F1Setup ProcedureCode ::= 1
|
||||
id-ErrorIndication ProcedureCode ::= 2
|
||||
id-gNBDUConfigurationUpdate ProcedureCode ::= 3
|
||||
id-gNBCUConfigurationUpdate ProcedureCode ::= 4
|
||||
id-UEContextSetup ProcedureCode ::= 5
|
||||
id-UEContextRelease ProcedureCode ::= 6
|
||||
id-UEContextModification ProcedureCode ::= 7
|
||||
id-UEContextModificationRequired ProcedureCode ::= 8
|
||||
id-UEMobilityCommand ProcedureCode ::= 9
|
||||
id-UEContextReleaseRequest ProcedureCode ::= 10
|
||||
id-InitialULRRCMessageTransfer ProcedureCode ::= 11
|
||||
id-DLRRCMessageTransfer ProcedureCode ::= 12
|
||||
id-ULRRCMessageTransfer ProcedureCode ::= 13
|
||||
id-privateMessage ProcedureCode ::= 14
|
||||
id-UEInactivityNotification ProcedureCode ::= 15
|
||||
id-GNBDUResourceCoordination ProcedureCode ::= 16
|
||||
id-SystemInformationDeliveryCommand ProcedureCode ::= 17
|
||||
id-Paging ProcedureCode ::= 18
|
||||
id-Notify ProcedureCode ::= 19
|
||||
id-WriteReplaceWarning ProcedureCode ::= 20
|
||||
id-PWSCancel ProcedureCode ::= 21
|
||||
id-PWSRestartIndication ProcedureCode ::= 22
|
||||
id-PWSFailureIndication ProcedureCode ::= 23
|
||||
id-GNBDUStatusIndication ProcedureCode ::= 24
|
||||
id-RRCDeliveryReport ProcedureCode ::= 25
|
||||
id-F1Removal ProcedureCode ::= 26
|
||||
id-NetworkAccessRateReduction ProcedureCode ::= 27
|
||||
id-TraceStart ProcedureCode ::= 28
|
||||
id-DeactivateTrace ProcedureCode ::= 29
|
||||
id-DUCURadioInformationTransfer ProcedureCode ::= 30
|
||||
id-CUDURadioInformationTransfer ProcedureCode ::= 31
|
||||
id-BAPMappingConfiguration ProcedureCode ::= 32
|
||||
id-GNBDUResourceConfiguration ProcedureCode ::= 33
|
||||
id-IABTNLAddressAllocation ProcedureCode ::= 34
|
||||
id-IABUPConfigurationUpdate ProcedureCode ::= 35
|
||||
id-resourceStatusReportingInitiation ProcedureCode ::= 36
|
||||
id-resourceStatusReporting ProcedureCode ::= 37
|
||||
id-accessAndMobilityIndication ProcedureCode ::= 38
|
||||
id-accessSuccess ProcedureCode ::= 39
|
||||
id-cellTrafficTrace ProcedureCode ::= 40
|
||||
id-PositioningMeasurementExchange ProcedureCode ::= 41
|
||||
id-PositioningAssistanceInformationControl ProcedureCode ::= 42
|
||||
id-PositioningAssistanceInformationFeedback ProcedureCode ::= 43
|
||||
id-PositioningMeasurementReport ProcedureCode ::= 44
|
||||
id-PositioningMeasurementAbort ProcedureCode ::= 45
|
||||
id-PositioningMeasurementFailureIndication ProcedureCode ::= 46
|
||||
id-PositioningMeasurementUpdate ProcedureCode ::= 47
|
||||
id-TRPInformationExchange ProcedureCode ::= 48
|
||||
id-PositioningInformationExchange ProcedureCode ::= 49
|
||||
id-PositioningActivation ProcedureCode ::= 50
|
||||
id-PositioningDeactivation ProcedureCode ::= 51
|
||||
id-E-CIDMeasurementInitiation ProcedureCode ::= 52
|
||||
id-E-CIDMeasurementFailureIndication ProcedureCode ::= 53
|
||||
id-E-CIDMeasurementReport ProcedureCode ::= 54
|
||||
id-E-CIDMeasurementTermination ProcedureCode ::= 55
|
||||
id-PositioningInformationUpdate ProcedureCode ::= 56
|
||||
id-ReferenceTimeInformationReport ProcedureCode ::= 57
|
||||
id-ReferenceTimeInformationReportingControl ProcedureCode ::= 58
|
||||
|
||||
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Extension constants
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
maxPrivateIEs INTEGER ::= 65535
|
||||
maxProtocolExtensions INTEGER ::= 65535
|
||||
maxProtocolIEs INTEGER ::= 65535
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Lists
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
maxNRARFCN INTEGER ::= 3279165
|
||||
maxnoofErrors INTEGER ::= 256
|
||||
maxnoofIndividualF1ConnectionsToReset INTEGER ::= 65536
|
||||
maxCellingNBDU INTEGER ::= 512
|
||||
maxnoofSCells INTEGER ::= 32
|
||||
maxnoofSRBs INTEGER ::= 8
|
||||
maxnoofDRBs INTEGER ::= 64
|
||||
maxnoofULUPTNLInformation INTEGER ::= 2
|
||||
maxnoofDLUPTNLInformation INTEGER ::= 2
|
||||
maxnoofBPLMNs INTEGER ::= 6
|
||||
maxnoofCandidateSpCells INTEGER ::= 64
|
||||
maxnoofPotentialSpCells INTEGER ::= 64
|
||||
maxnoofNrCellBands INTEGER ::= 32
|
||||
maxnoofSIBTypes INTEGER ::= 32
|
||||
maxnoofSITypes INTEGER ::= 32
|
||||
maxnoofPagingCells INTEGER ::= 512
|
||||
maxnoofTNLAssociations INTEGER ::= 32
|
||||
maxnoofQoSFlows INTEGER ::= 64
|
||||
maxnoofSliceItems INTEGER ::= 1024
|
||||
maxCellineNB INTEGER ::= 256
|
||||
maxnoofExtendedBPLMNs INTEGER ::= 6
|
||||
maxnoofUEIDs INTEGER ::= 65536
|
||||
maxnoofBPLMNsNR INTEGER ::= 12
|
||||
maxnoofUACPLMNs INTEGER ::= 12
|
||||
maxnoofUACperPLMN INTEGER ::= 64
|
||||
maxnoofAdditionalSIBs INTEGER ::= 63
|
||||
maxnoofslots INTEGER ::= 5120
|
||||
maxnoofTLAs INTEGER ::= 16
|
||||
maxnoofGTPTLAs INTEGER ::= 16
|
||||
maxnoofBHRLCChannels INTEGER ::= 65536
|
||||
maxnoofRoutingEntries INTEGER ::= 1024
|
||||
maxnoofIABSTCInfo INTEGER ::= 45
|
||||
maxnoofSymbols INTEGER ::= 14
|
||||
maxnoofServingCells INTEGER ::= 32
|
||||
maxnoofDUFSlots INTEGER ::= 320
|
||||
maxnoofHSNASlots INTEGER ::= 5120
|
||||
maxnoofServedCellsIAB INTEGER ::= 512
|
||||
maxnoofChildIABNodes INTEGER ::= 1024
|
||||
maxnoofNonUPTrafficMappings INTEGER ::= 32
|
||||
maxnoofTLAsIAB INTEGER ::= 1024
|
||||
maxnoofMappingEntries INTEGER ::= 67108864
|
||||
maxnoofDSInfo INTEGER ::= 64
|
||||
maxnoofEgressLinks INTEGER ::= 2
|
||||
maxnoofULUPTNLInformationforIAB INTEGER ::= 32678
|
||||
maxnoofUPTNLAddresses INTEGER ::= 8
|
||||
maxnoofSLDRBs INTEGER ::= 512
|
||||
maxnoofQoSParaSets INTEGER ::= 8
|
||||
maxnoofPC5QoSFlows INTEGER ::= 2048
|
||||
maxnoofSSBAreas INTEGER ::= 64
|
||||
maxnoofPhysicalResourceBlocks INTEGER ::= 275
|
||||
maxnoofPhysicalResourceBlocks-1 INTEGER ::= 274
|
||||
maxnoofPRACHconfigs INTEGER ::= 16
|
||||
maxnoofRACHReports INTEGER ::= 64
|
||||
maxnoofRLFReports INTEGER ::= 64
|
||||
maxnoofAdditionalPDCPDuplicationTNL INTEGER ::= 2
|
||||
maxnoofRLCDuplicationState INTEGER ::= 3
|
||||
maxnoofCHOcells INTEGER ::= 8
|
||||
maxnoofMDTPLMNs INTEGER ::= 16
|
||||
maxnoofCAGsupported INTEGER ::= 12
|
||||
maxnoofNIDsupported INTEGER ::= 12
|
||||
maxnoofNRSCSs INTEGER ::= 5
|
||||
maxnoofExtSliceItems INTEGER ::= 65535
|
||||
maxnoofPosMeas INTEGER ::= 16384
|
||||
maxnoofTRPInfoTypes INTEGER ::= 64
|
||||
maxnoofTRPs INTEGER ::= 65535
|
||||
maxnoofSRSTriggerStates INTEGER ::= 3
|
||||
maxnoofSpatialRelations INTEGER ::= 64
|
||||
maxnoBcastCell INTEGER ::= 16384
|
||||
maxnoofAngleInfo INTEGER ::= 65535
|
||||
maxnooflcs-gcs-translation INTEGER ::= 3
|
||||
maxnoofPath INTEGER ::= 2
|
||||
maxnoofMeasE-CID INTEGER ::= 64
|
||||
maxnoofSSBs INTEGER ::= 255
|
||||
maxnoSRS-ResourceSets INTEGER ::= 16
|
||||
maxnoSRS-ResourcePerSet INTEGER ::= 16
|
||||
maxnoSRS-Carriers INTEGER ::= 32
|
||||
maxnoSCSs INTEGER ::= 5
|
||||
maxnoSRS-Resources INTEGER ::= 64
|
||||
maxnoSRS-PosResources INTEGER ::= 64
|
||||
maxnoSRS-PosResourceSets INTEGER ::= 16
|
||||
maxnoSRS-PosResourcePerSet INTEGER ::= 16
|
||||
maxnoofPRS-ResourceSets INTEGER ::= 2
|
||||
maxnoofPRS-ResourcesPerSet INTEGER ::= 64
|
||||
maxNoOfMeasTRPs INTEGER ::= 64
|
||||
maxnoofPRSresourceSets INTEGER ::= 8
|
||||
maxnoofPRSresources INTEGER ::= 64
|
||||
|
||||
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- IEs
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
id-Cause ProtocolIE-ID ::= 0
|
||||
id-Cells-Failed-to-be-Activated-List ProtocolIE-ID ::= 1
|
||||
id-Cells-Failed-to-be-Activated-List-Item ProtocolIE-ID ::= 2
|
||||
id-Cells-to-be-Activated-List ProtocolIE-ID ::= 3
|
||||
id-Cells-to-be-Activated-List-Item ProtocolIE-ID ::= 4
|
||||
id-Cells-to-be-Deactivated-List ProtocolIE-ID ::= 5
|
||||
id-Cells-to-be-Deactivated-List-Item ProtocolIE-ID ::= 6
|
||||
id-CriticalityDiagnostics ProtocolIE-ID ::= 7
|
||||
id-CUtoDURRCInformation ProtocolIE-ID ::= 9
|
||||
id-DRBs-FailedToBeModified-Item ProtocolIE-ID ::= 12
|
||||
id-DRBs-FailedToBeModified-List ProtocolIE-ID ::= 13
|
||||
id-DRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 14
|
||||
id-DRBs-FailedToBeSetup-List ProtocolIE-ID ::= 15
|
||||
id-DRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 16
|
||||
id-DRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 17
|
||||
id-DRBs-ModifiedConf-Item ProtocolIE-ID ::= 18
|
||||
id-DRBs-ModifiedConf-List ProtocolIE-ID ::= 19
|
||||
id-DRBs-Modified-Item ProtocolIE-ID ::= 20
|
||||
id-DRBs-Modified-List ProtocolIE-ID ::= 21
|
||||
id-DRBs-Required-ToBeModified-Item ProtocolIE-ID ::= 22
|
||||
id-DRBs-Required-ToBeModified-List ProtocolIE-ID ::= 23
|
||||
id-DRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 24
|
||||
id-DRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 25
|
||||
id-DRBs-Setup-Item ProtocolIE-ID ::= 26
|
||||
id-DRBs-Setup-List ProtocolIE-ID ::= 27
|
||||
id-DRBs-SetupMod-Item ProtocolIE-ID ::= 28
|
||||
id-DRBs-SetupMod-List ProtocolIE-ID ::= 29
|
||||
id-DRBs-ToBeModified-Item ProtocolIE-ID ::= 30
|
||||
id-DRBs-ToBeModified-List ProtocolIE-ID ::= 31
|
||||
id-DRBs-ToBeReleased-Item ProtocolIE-ID ::= 32
|
||||
id-DRBs-ToBeReleased-List ProtocolIE-ID ::= 33
|
||||
id-DRBs-ToBeSetup-Item ProtocolIE-ID ::= 34
|
||||
id-DRBs-ToBeSetup-List ProtocolIE-ID ::= 35
|
||||
id-DRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 36
|
||||
id-DRBs-ToBeSetupMod-List ProtocolIE-ID ::= 37
|
||||
id-DRXCycle ProtocolIE-ID ::= 38
|
||||
id-DUtoCURRCInformation ProtocolIE-ID ::= 39
|
||||
id-gNB-CU-UE-F1AP-ID ProtocolIE-ID ::= 40
|
||||
id-gNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 41
|
||||
id-gNB-DU-ID ProtocolIE-ID ::= 42
|
||||
id-GNB-DU-Served-Cells-Item ProtocolIE-ID ::= 43
|
||||
id-gNB-DU-Served-Cells-List ProtocolIE-ID ::= 44
|
||||
id-gNB-DU-Name ProtocolIE-ID ::= 45
|
||||
id-NRCellID ProtocolIE-ID ::= 46
|
||||
id-oldgNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 47
|
||||
id-ResetType ProtocolIE-ID ::= 48
|
||||
id-ResourceCoordinationTransferContainer ProtocolIE-ID ::= 49
|
||||
id-RRCContainer ProtocolIE-ID ::= 50
|
||||
id-SCell-ToBeRemoved-Item ProtocolIE-ID ::= 51
|
||||
id-SCell-ToBeRemoved-List ProtocolIE-ID ::= 52
|
||||
id-SCell-ToBeSetup-Item ProtocolIE-ID ::= 53
|
||||
id-SCell-ToBeSetup-List ProtocolIE-ID ::= 54
|
||||
id-SCell-ToBeSetupMod-Item ProtocolIE-ID ::= 55
|
||||
id-SCell-ToBeSetupMod-List ProtocolIE-ID ::= 56
|
||||
id-Served-Cells-To-Add-Item ProtocolIE-ID ::= 57
|
||||
id-Served-Cells-To-Add-List ProtocolIE-ID ::= 58
|
||||
id-Served-Cells-To-Delete-Item ProtocolIE-ID ::= 59
|
||||
id-Served-Cells-To-Delete-List ProtocolIE-ID ::= 60
|
||||
id-Served-Cells-To-Modify-Item ProtocolIE-ID ::= 61
|
||||
id-Served-Cells-To-Modify-List ProtocolIE-ID ::= 62
|
||||
id-SpCell-ID ProtocolIE-ID ::= 63
|
||||
id-SRBID ProtocolIE-ID ::= 64
|
||||
id-SRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 65
|
||||
id-SRBs-FailedToBeSetup-List ProtocolIE-ID ::= 66
|
||||
id-SRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 67
|
||||
id-SRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 68
|
||||
id-SRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 69
|
||||
id-SRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 70
|
||||
id-SRBs-ToBeReleased-Item ProtocolIE-ID ::= 71
|
||||
id-SRBs-ToBeReleased-List ProtocolIE-ID ::= 72
|
||||
id-SRBs-ToBeSetup-Item ProtocolIE-ID ::= 73
|
||||
id-SRBs-ToBeSetup-List ProtocolIE-ID ::= 74
|
||||
id-SRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 75
|
||||
id-SRBs-ToBeSetupMod-List ProtocolIE-ID ::= 76
|
||||
id-TimeToWait ProtocolIE-ID ::= 77
|
||||
id-TransactionID ProtocolIE-ID ::= 78
|
||||
id-TransmissionActionIndicator ProtocolIE-ID ::= 79
|
||||
id-UE-associatedLogicalF1-ConnectionItem ProtocolIE-ID ::= 80
|
||||
id-UE-associatedLogicalF1-ConnectionListResAck ProtocolIE-ID ::= 81
|
||||
id-gNB-CU-Name ProtocolIE-ID ::= 82
|
||||
id-SCell-FailedtoSetup-List ProtocolIE-ID ::= 83
|
||||
id-SCell-FailedtoSetup-Item ProtocolIE-ID ::= 84
|
||||
id-SCell-FailedtoSetupMod-List ProtocolIE-ID ::= 85
|
||||
id-SCell-FailedtoSetupMod-Item ProtocolIE-ID ::= 86
|
||||
id-RRCReconfigurationCompleteIndicator ProtocolIE-ID ::= 87
|
||||
id-Cells-Status-Item ProtocolIE-ID ::= 88
|
||||
id-Cells-Status-List ProtocolIE-ID ::= 89
|
||||
id-Candidate-SpCell-List ProtocolIE-ID ::= 90
|
||||
id-Candidate-SpCell-Item ProtocolIE-ID ::= 91
|
||||
id-Potential-SpCell-List ProtocolIE-ID ::= 92
|
||||
id-Potential-SpCell-Item ProtocolIE-ID ::= 93
|
||||
id-FullConfiguration ProtocolIE-ID ::= 94
|
||||
id-C-RNTI ProtocolIE-ID ::= 95
|
||||
id-SpCellULConfigured ProtocolIE-ID ::= 96
|
||||
id-InactivityMonitoringRequest ProtocolIE-ID ::= 97
|
||||
id-InactivityMonitoringResponse ProtocolIE-ID ::= 98
|
||||
id-DRB-Activity-Item ProtocolIE-ID ::= 99
|
||||
id-DRB-Activity-List ProtocolIE-ID ::= 100
|
||||
id-EUTRA-NR-CellResourceCoordinationReq-Container ProtocolIE-ID ::= 101
|
||||
id-EUTRA-NR-CellResourceCoordinationReqAck-Container ProtocolIE-ID ::= 102
|
||||
id-Protected-EUTRA-Resources-List ProtocolIE-ID ::= 105
|
||||
id-RequestType ProtocolIE-ID ::= 106
|
||||
id-ServCellIndex ProtocolIE-ID ::= 107
|
||||
id-RAT-FrequencyPriorityInformation ProtocolIE-ID ::= 108
|
||||
id-ExecuteDuplication ProtocolIE-ID ::= 109
|
||||
id-NRCGI ProtocolIE-ID ::= 111
|
||||
id-PagingCell-Item ProtocolIE-ID ::= 112
|
||||
id-PagingCell-List ProtocolIE-ID ::= 113
|
||||
id-PagingDRX ProtocolIE-ID ::= 114
|
||||
id-PagingPriority ProtocolIE-ID ::= 115
|
||||
id-SItype-List ProtocolIE-ID ::= 116
|
||||
id-UEIdentityIndexValue ProtocolIE-ID ::= 117
|
||||
id-gNB-CUSystemInformation ProtocolIE-ID ::= 118
|
||||
id-HandoverPreparationInformation ProtocolIE-ID ::= 119
|
||||
id-GNB-CU-TNL-Association-To-Add-Item ProtocolIE-ID ::= 120
|
||||
id-GNB-CU-TNL-Association-To-Add-List ProtocolIE-ID ::= 121
|
||||
id-GNB-CU-TNL-Association-To-Remove-Item ProtocolIE-ID ::= 122
|
||||
id-GNB-CU-TNL-Association-To-Remove-List ProtocolIE-ID ::= 123
|
||||
id-GNB-CU-TNL-Association-To-Update-Item ProtocolIE-ID ::= 124
|
||||
id-GNB-CU-TNL-Association-To-Update-List ProtocolIE-ID ::= 125
|
||||
id-MaskedIMEISV ProtocolIE-ID ::= 126
|
||||
id-PagingIdentity ProtocolIE-ID ::= 127
|
||||
id-DUtoCURRCContainer ProtocolIE-ID ::= 128
|
||||
id-Cells-to-be-Barred-List ProtocolIE-ID ::= 129
|
||||
id-Cells-to-be-Barred-Item ProtocolIE-ID ::= 130
|
||||
id-TAISliceSupportList ProtocolIE-ID ::= 131
|
||||
id-GNB-CU-TNL-Association-Setup-List ProtocolIE-ID ::= 132
|
||||
id-GNB-CU-TNL-Association-Setup-Item ProtocolIE-ID ::= 133
|
||||
id-GNB-CU-TNL-Association-Failed-To-Setup-List ProtocolIE-ID ::= 134
|
||||
id-GNB-CU-TNL-Association-Failed-To-Setup-Item ProtocolIE-ID ::= 135
|
||||
id-DRB-Notify-Item ProtocolIE-ID ::= 136
|
||||
id-DRB-Notify-List ProtocolIE-ID ::= 137
|
||||
id-NotficationControl ProtocolIE-ID ::= 138
|
||||
id-RANAC ProtocolIE-ID ::= 139
|
||||
id-PWSSystemInformation ProtocolIE-ID ::= 140
|
||||
id-RepetitionPeriod ProtocolIE-ID ::= 141
|
||||
id-NumberofBroadcastRequest ProtocolIE-ID ::= 142
|
||||
id-Cells-To-Be-Broadcast-List ProtocolIE-ID ::= 144
|
||||
id-Cells-To-Be-Broadcast-Item ProtocolIE-ID ::= 145
|
||||
id-Cells-Broadcast-Completed-List ProtocolIE-ID ::= 146
|
||||
id-Cells-Broadcast-Completed-Item ProtocolIE-ID ::= 147
|
||||
id-Broadcast-To-Be-Cancelled-List ProtocolIE-ID ::= 148
|
||||
id-Broadcast-To-Be-Cancelled-Item ProtocolIE-ID ::= 149
|
||||
id-Cells-Broadcast-Cancelled-List ProtocolIE-ID ::= 150
|
||||
id-Cells-Broadcast-Cancelled-Item ProtocolIE-ID ::= 151
|
||||
id-NR-CGI-List-For-Restart-List ProtocolIE-ID ::= 152
|
||||
id-NR-CGI-List-For-Restart-Item ProtocolIE-ID ::= 153
|
||||
id-PWS-Failed-NR-CGI-List ProtocolIE-ID ::= 154
|
||||
id-PWS-Failed-NR-CGI-Item ProtocolIE-ID ::= 155
|
||||
id-ConfirmedUEID ProtocolIE-ID ::= 156
|
||||
id-Cancel-all-Warning-Messages-Indicator ProtocolIE-ID ::= 157
|
||||
id-GNB-DU-UE-AMBR-UL ProtocolIE-ID ::= 158
|
||||
id-DRXConfigurationIndicator ProtocolIE-ID ::= 159
|
||||
id-RLC-Status ProtocolIE-ID ::= 160
|
||||
id-DLPDCPSNLength ProtocolIE-ID ::= 161
|
||||
id-GNB-DUConfigurationQuery ProtocolIE-ID ::= 162
|
||||
id-MeasurementTimingConfiguration ProtocolIE-ID ::= 163
|
||||
id-DRB-Information ProtocolIE-ID ::= 164
|
||||
id-ServingPLMN ProtocolIE-ID ::= 165
|
||||
id-Protected-EUTRA-Resources-Item ProtocolIE-ID ::= 168
|
||||
id-GNB-CU-RRC-Version ProtocolIE-ID ::= 170
|
||||
id-GNB-DU-RRC-Version ProtocolIE-ID ::= 171
|
||||
id-GNBDUOverloadInformation ProtocolIE-ID ::= 172
|
||||
id-CellGroupConfig ProtocolIE-ID ::= 173
|
||||
id-RLCFailureIndication ProtocolIE-ID ::= 174
|
||||
id-UplinkTxDirectCurrentListInformation ProtocolIE-ID ::= 175
|
||||
id-DC-Based-Duplication-Configured ProtocolIE-ID ::= 176
|
||||
id-DC-Based-Duplication-Activation ProtocolIE-ID ::= 177
|
||||
id-SULAccessIndication ProtocolIE-ID ::= 178
|
||||
id-AvailablePLMNList ProtocolIE-ID ::= 179
|
||||
id-PDUSessionID ProtocolIE-ID ::= 180
|
||||
id-ULPDUSessionAggregateMaximumBitRate ProtocolIE-ID ::= 181
|
||||
id-ServingCellMO ProtocolIE-ID ::= 182
|
||||
id-QoSFlowMappingIndication ProtocolIE-ID ::= 183
|
||||
id-RRCDeliveryStatusRequest ProtocolIE-ID ::= 184
|
||||
id-RRCDeliveryStatus ProtocolIE-ID ::= 185
|
||||
id-BearerTypeChange ProtocolIE-ID ::= 186
|
||||
id-RLCMode ProtocolIE-ID ::= 187
|
||||
id-Duplication-Activation ProtocolIE-ID ::= 188
|
||||
id-Dedicated-SIDelivery-NeededUE-List ProtocolIE-ID ::= 189
|
||||
id-Dedicated-SIDelivery-NeededUE-Item ProtocolIE-ID ::= 190
|
||||
id-DRX-LongCycleStartOffset ProtocolIE-ID ::= 191
|
||||
id-ULPDCPSNLength ProtocolIE-ID ::= 192
|
||||
id-SelectedBandCombinationIndex ProtocolIE-ID ::= 193
|
||||
id-SelectedFeatureSetEntryIndex ProtocolIE-ID ::= 194
|
||||
id-ResourceCoordinationTransferInformation ProtocolIE-ID ::= 195
|
||||
id-ExtendedServedPLMNs-List ProtocolIE-ID ::= 196
|
||||
id-ExtendedAvailablePLMN-List ProtocolIE-ID ::= 197
|
||||
id-Associated-SCell-List ProtocolIE-ID ::= 198
|
||||
id-latest-RRC-Version-Enhanced ProtocolIE-ID ::= 199
|
||||
id-Associated-SCell-Item ProtocolIE-ID ::= 200
|
||||
id-Cell-Direction ProtocolIE-ID ::= 201
|
||||
id-SRBs-Setup-List ProtocolIE-ID ::= 202
|
||||
id-SRBs-Setup-Item ProtocolIE-ID ::= 203
|
||||
id-SRBs-SetupMod-List ProtocolIE-ID ::= 204
|
||||
id-SRBs-SetupMod-Item ProtocolIE-ID ::= 205
|
||||
id-SRBs-Modified-List ProtocolIE-ID ::= 206
|
||||
id-SRBs-Modified-Item ProtocolIE-ID ::= 207
|
||||
id-Ph-InfoSCG ProtocolIE-ID ::= 208
|
||||
id-RequestedBandCombinationIndex ProtocolIE-ID ::= 209
|
||||
id-RequestedFeatureSetEntryIndex ProtocolIE-ID ::= 210
|
||||
id-RequestedP-MaxFR2 ProtocolIE-ID ::= 211
|
||||
id-DRX-Config ProtocolIE-ID ::= 212
|
||||
id-IgnoreResourceCoordinationContainer ProtocolIE-ID ::= 213
|
||||
id-UEAssistanceInformation ProtocolIE-ID ::= 214
|
||||
id-NeedforGap ProtocolIE-ID ::= 215
|
||||
id-PagingOrigin ProtocolIE-ID ::= 216
|
||||
id-new-gNB-CU-UE-F1AP-ID ProtocolIE-ID ::= 217
|
||||
id-RedirectedRRCmessage ProtocolIE-ID ::= 218
|
||||
id-new-gNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 219
|
||||
id-NotificationInformation ProtocolIE-ID ::= 220
|
||||
id-PLMNAssistanceInfoForNetShar ProtocolIE-ID ::= 221
|
||||
id-UEContextNotRetrievable ProtocolIE-ID ::= 222
|
||||
id-BPLMN-ID-Info-List ProtocolIE-ID ::= 223
|
||||
id-SelectedPLMNID ProtocolIE-ID ::= 224
|
||||
id-UAC-Assistance-Info ProtocolIE-ID ::= 225
|
||||
id-RANUEID ProtocolIE-ID ::= 226
|
||||
id-GNB-DU-TNL-Association-To-Remove-Item ProtocolIE-ID ::= 227
|
||||
id-GNB-DU-TNL-Association-To-Remove-List ProtocolIE-ID ::= 228
|
||||
id-TNLAssociationTransportLayerAddressgNBDU ProtocolIE-ID ::= 229
|
||||
id-portNumber ProtocolIE-ID ::= 230
|
||||
id-AdditionalSIBMessageList ProtocolIE-ID ::= 231
|
||||
id-Cell-Type ProtocolIE-ID ::= 232
|
||||
id-IgnorePRACHConfiguration ProtocolIE-ID ::= 233
|
||||
id-CG-Config ProtocolIE-ID ::= 234
|
||||
id-PDCCH-BlindDetectionSCG ProtocolIE-ID ::= 235
|
||||
id-Requested-PDCCH-BlindDetectionSCG ProtocolIE-ID ::= 236
|
||||
id-Ph-InfoMCG ProtocolIE-ID ::= 237
|
||||
id-MeasGapSharingConfig ProtocolIE-ID ::= 238
|
||||
id-systemInformationAreaID ProtocolIE-ID ::= 239
|
||||
id-areaScope ProtocolIE-ID ::= 240
|
||||
id-RRCContainer-RRCSetupComplete ProtocolIE-ID ::= 241
|
||||
id-TraceActivation ProtocolIE-ID ::= 242
|
||||
id-TraceID ProtocolIE-ID ::= 243
|
||||
id-Neighbour-Cell-Information-List ProtocolIE-ID ::= 244
|
||||
id-SymbolAllocInSlot ProtocolIE-ID ::= 246
|
||||
id-NumDLULSymbols ProtocolIE-ID ::= 247
|
||||
id-AdditionalRRMPriorityIndex ProtocolIE-ID ::= 248
|
||||
id-DUCURadioInformationType ProtocolIE-ID ::= 249
|
||||
id-CUDURadioInformationType ProtocolIE-ID ::= 250
|
||||
id-AggressorgNBSetID ProtocolIE-ID ::= 251
|
||||
id-VictimgNBSetID ProtocolIE-ID ::= 252
|
||||
id-LowerLayerPresenceStatusChange ProtocolIE-ID ::= 253
|
||||
id-Transport-Layer-Address-Info ProtocolIE-ID ::= 254
|
||||
id-Neighbour-Cell-Information-Item ProtocolIE-ID ::= 255
|
||||
id-IntendedTDD-DL-ULConfig ProtocolIE-ID ::= 256
|
||||
id-QosMonitoringRequest ProtocolIE-ID ::= 257
|
||||
id-BHChannels-ToBeSetup-List ProtocolIE-ID ::= 258
|
||||
id-BHChannels-ToBeSetup-Item ProtocolIE-ID ::= 259
|
||||
id-BHChannels-Setup-List ProtocolIE-ID ::= 260
|
||||
id-BHChannels-Setup-Item ProtocolIE-ID ::= 261
|
||||
id-BHChannels-ToBeModified-Item ProtocolIE-ID ::= 262
|
||||
id-BHChannels-ToBeModified-List ProtocolIE-ID ::= 263
|
||||
id-BHChannels-ToBeReleased-Item ProtocolIE-ID ::= 264
|
||||
id-BHChannels-ToBeReleased-List ProtocolIE-ID ::= 265
|
||||
id-BHChannels-ToBeSetupMod-Item ProtocolIE-ID ::= 266
|
||||
id-BHChannels-ToBeSetupMod-List ProtocolIE-ID ::= 267
|
||||
id-BHChannels-FailedToBeModified-Item ProtocolIE-ID ::= 268
|
||||
id-BHChannels-FailedToBeModified-List ProtocolIE-ID ::= 269
|
||||
id-BHChannels-FailedToBeSetupMod-Item ProtocolIE-ID ::= 270
|
||||
id-BHChannels-FailedToBeSetupMod-List ProtocolIE-ID ::= 271
|
||||
id-BHChannels-Modified-Item ProtocolIE-ID ::= 272
|
||||
id-BHChannels-Modified-List ProtocolIE-ID ::= 273
|
||||
id-BHChannels-SetupMod-Item ProtocolIE-ID ::= 274
|
||||
id-BHChannels-SetupMod-List ProtocolIE-ID ::= 275
|
||||
id-BHChannels-Required-ToBeReleased-Item ProtocolIE-ID ::= 276
|
||||
id-BHChannels-Required-ToBeReleased-List ProtocolIE-ID ::= 277
|
||||
id-BHChannels-FailedToBeSetup-Item ProtocolIE-ID ::= 278
|
||||
id-BHChannels-FailedToBeSetup-List ProtocolIE-ID ::= 279
|
||||
id-BHInfo ProtocolIE-ID ::= 280
|
||||
id-BAPAddress ProtocolIE-ID ::= 281
|
||||
id-ConfiguredBAPAddress ProtocolIE-ID ::= 282
|
||||
id-BH-Routing-Information-Added-List ProtocolIE-ID ::= 283
|
||||
id-BH-Routing-Information-Added-List-Item ProtocolIE-ID ::= 284
|
||||
id-BH-Routing-Information-Removed-List ProtocolIE-ID ::= 285
|
||||
id-BH-Routing-Information-Removed-List-Item ProtocolIE-ID ::= 286
|
||||
id-UL-BH-Non-UP-Traffic-Mapping ProtocolIE-ID ::= 287
|
||||
id-Activated-Cells-to-be-Updated-List ProtocolIE-ID ::= 288
|
||||
id-Child-Nodes-List ProtocolIE-ID ::= 289
|
||||
id-IAB-Info-IAB-DU ProtocolIE-ID ::= 290
|
||||
id-IAB-Info-IAB-donor-CU ProtocolIE-ID ::= 291
|
||||
id-IAB-TNL-Addresses-To-Remove-List ProtocolIE-ID ::= 292
|
||||
id-IAB-TNL-Addresses-To-Remove-Item ProtocolIE-ID ::= 293
|
||||
id-IAB-Allocated-TNL-Address-List ProtocolIE-ID ::= 294
|
||||
id-IAB-Allocated-TNL-Address-Item ProtocolIE-ID ::= 295
|
||||
id-IABIPv6RequestType ProtocolIE-ID ::= 296
|
||||
id-IABv4AddressesRequested ProtocolIE-ID ::= 297
|
||||
id-IAB-Barred ProtocolIE-ID ::= 298
|
||||
id-TrafficMappingInformation ProtocolIE-ID ::= 299
|
||||
id-UL-UP-TNL-Information-to-Update-List ProtocolIE-ID ::= 300
|
||||
id-UL-UP-TNL-Information-to-Update-List-Item ProtocolIE-ID ::= 301
|
||||
id-UL-UP-TNL-Address-to-Update-List ProtocolIE-ID ::= 302
|
||||
id-UL-UP-TNL-Address-to-Update-List-Item ProtocolIE-ID ::= 303
|
||||
id-DL-UP-TNL-Address-to-Update-List ProtocolIE-ID ::= 304
|
||||
id-DL-UP-TNL-Address-to-Update-List-Item ProtocolIE-ID ::= 305
|
||||
id-NRV2XServicesAuthorized ProtocolIE-ID ::= 306
|
||||
id-LTEV2XServicesAuthorized ProtocolIE-ID ::= 307
|
||||
id-NRUESidelinkAggregateMaximumBitrate ProtocolIE-ID ::= 308
|
||||
id-LTEUESidelinkAggregateMaximumBitrate ProtocolIE-ID ::= 309
|
||||
id-SIB12-message ProtocolIE-ID ::= 310
|
||||
id-SIB13-message ProtocolIE-ID ::= 311
|
||||
id-SIB14-message ProtocolIE-ID ::= 312
|
||||
id-SLDRBs-FailedToBeModified-Item ProtocolIE-ID ::= 313
|
||||
id-SLDRBs-FailedToBeModified-List ProtocolIE-ID ::= 314
|
||||
id-SLDRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 315
|
||||
id-SLDRBs-FailedToBeSetup-List ProtocolIE-ID ::= 316
|
||||
id-SLDRBs-Modified-Item ProtocolIE-ID ::= 317
|
||||
id-SLDRBs-Modified-List ProtocolIE-ID ::= 318
|
||||
id-SLDRBs-Required-ToBeModified-Item ProtocolIE-ID ::= 319
|
||||
id-SLDRBs-Required-ToBeModified-List ProtocolIE-ID ::= 320
|
||||
id-SLDRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 321
|
||||
id-SLDRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 322
|
||||
id-SLDRBs-Setup-Item ProtocolIE-ID ::= 323
|
||||
id-SLDRBs-Setup-List ProtocolIE-ID ::= 324
|
||||
id-SLDRBs-ToBeModified-Item ProtocolIE-ID ::= 325
|
||||
id-SLDRBs-ToBeModified-List ProtocolIE-ID ::= 326
|
||||
id-SLDRBs-ToBeReleased-Item ProtocolIE-ID ::= 327
|
||||
id-SLDRBs-ToBeReleased-List ProtocolIE-ID ::= 328
|
||||
id-SLDRBs-ToBeSetup-Item ProtocolIE-ID ::= 329
|
||||
id-SLDRBs-ToBeSetup-List ProtocolIE-ID ::= 330
|
||||
id-SLDRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 331
|
||||
id-SLDRBs-ToBeSetupMod-List ProtocolIE-ID ::= 332
|
||||
id-SLDRBs-SetupMod-List ProtocolIE-ID ::= 333
|
||||
id-SLDRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 334
|
||||
id-SLDRBs-SetupMod-Item ProtocolIE-ID ::= 335
|
||||
id-SLDRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 336
|
||||
id-SLDRBs-ModifiedConf-List ProtocolIE-ID ::= 337
|
||||
id-SLDRBs-ModifiedConf-Item ProtocolIE-ID ::= 338
|
||||
id-UEAssistanceInformationEUTRA ProtocolIE-ID ::= 339
|
||||
id-PC5LinkAMBR ProtocolIE-ID ::= 340
|
||||
id-SL-PHY-MAC-RLC-Config ProtocolIE-ID ::= 341
|
||||
id-SL-ConfigDedicatedEUTRA ProtocolIE-ID ::= 342
|
||||
id-AlternativeQoSParaSetList ProtocolIE-ID ::= 343
|
||||
id-CurrentQoSParaSetIndex ProtocolIE-ID ::= 344
|
||||
id-gNBCUMeasurementID ProtocolIE-ID ::= 345
|
||||
id-gNBDUMeasurementID ProtocolIE-ID ::= 346
|
||||
id-RegistrationRequest ProtocolIE-ID ::= 347
|
||||
id-ReportCharacteristics ProtocolIE-ID ::= 348
|
||||
id-CellToReportList ProtocolIE-ID ::= 349
|
||||
id-CellMeasurementResultList ProtocolIE-ID ::= 350
|
||||
id-HardwareLoadIndicator ProtocolIE-ID ::= 351
|
||||
id-ReportingPeriodicity ProtocolIE-ID ::= 352
|
||||
id-TNLCapacityIndicator ProtocolIE-ID ::= 353
|
||||
id-CarrierList ProtocolIE-ID ::= 354
|
||||
id-ULCarrierList ProtocolIE-ID ::= 355
|
||||
id-FrequencyShift7p5khz ProtocolIE-ID ::= 356
|
||||
id-SSB-PositionsInBurst ProtocolIE-ID ::= 357
|
||||
id-NRPRACHConfig ProtocolIE-ID ::= 358
|
||||
id-RACHReportInformationList ProtocolIE-ID ::= 359
|
||||
id-RLFReportInformationList ProtocolIE-ID ::= 360
|
||||
id-TDD-UL-DLConfigCommonNR ProtocolIE-ID ::= 361
|
||||
id-CNPacketDelayBudgetDownlink ProtocolIE-ID ::= 362
|
||||
id-ExtendedPacketDelayBudget ProtocolIE-ID ::= 363
|
||||
id-TSCTrafficCharacteristics ProtocolIE-ID ::= 364
|
||||
id-ReportingRequestType ProtocolIE-ID ::= 365
|
||||
id-TimeReferenceInformation ProtocolIE-ID ::= 366
|
||||
id-CNPacketDelayBudgetUplink ProtocolIE-ID ::= 369
|
||||
id-AdditionalPDCPDuplicationTNL-List ProtocolIE-ID ::= 370
|
||||
id-RLCDuplicationInformation ProtocolIE-ID ::= 371
|
||||
id-AdditionalDuplicationIndication ProtocolIE-ID ::= 372
|
||||
id-ConditionalInterDUMobilityInformation ProtocolIE-ID ::= 373
|
||||
id-ConditionalIntraDUMobilityInformation ProtocolIE-ID ::= 374
|
||||
id-targetCellsToCancel ProtocolIE-ID ::= 375
|
||||
id-requestedTargetCellGlobalID ProtocolIE-ID ::= 376
|
||||
id-ManagementBasedMDTPLMNList ProtocolIE-ID ::= 377
|
||||
id-TraceCollectionEntityIPAddress ProtocolIE-ID ::= 378
|
||||
id-PrivacyIndicator ProtocolIE-ID ::= 379
|
||||
id-TraceCollectionEntityURI ProtocolIE-ID ::= 380
|
||||
id-mdtConfiguration ProtocolIE-ID ::= 381
|
||||
id-ServingNID ProtocolIE-ID ::= 382
|
||||
id-NPNBroadcastInformation ProtocolIE-ID ::= 383
|
||||
id-NPNSupportInfo ProtocolIE-ID ::= 384
|
||||
id-NID ProtocolIE-ID ::= 385
|
||||
id-AvailableSNPN-ID-List ProtocolIE-ID ::= 386
|
||||
id-SIB10-message ProtocolIE-ID ::= 387
|
||||
id-DLCarrierList ProtocolIE-ID ::= 389
|
||||
id-ExtendedTAISliceSupportList ProtocolIE-ID ::= 390
|
||||
id-RequestedSRSTransmissionCharacteristics ProtocolIE-ID ::= 391
|
||||
id-PosAssistance-Information ProtocolIE-ID ::= 392
|
||||
id-PosBroadcast ProtocolIE-ID ::= 393
|
||||
id-RoutingID ProtocolIE-ID ::= 394
|
||||
id-PosAssistanceInformationFailureList ProtocolIE-ID ::= 395
|
||||
id-PosMeasurementQuantities ProtocolIE-ID ::= 396
|
||||
id-PosMeasurementResultList ProtocolIE-ID ::= 397
|
||||
id-TRPInformationTypeListTRPReq ProtocolIE-ID ::= 398
|
||||
id-TRPInformationTypeItem ProtocolIE-ID ::= 399
|
||||
id-TRPInformationListTRPResp ProtocolIE-ID ::= 400
|
||||
id-TRPInformationItem ProtocolIE-ID ::= 401
|
||||
id-LMF-MeasurementID ProtocolIE-ID ::= 402
|
||||
id-SRSType ProtocolIE-ID ::= 403
|
||||
id-ActivationTime ProtocolIE-ID ::= 404
|
||||
id-AbortTransmission ProtocolIE-ID ::= 405
|
||||
id-PositioningBroadcastCells ProtocolIE-ID ::= 406
|
||||
id-SRSConfiguration ProtocolIE-ID ::= 407
|
||||
id-PosReportCharacteristics ProtocolIE-ID ::= 408
|
||||
id-PosMeasurementPeriodicity ProtocolIE-ID ::= 409
|
||||
id-TRPList ProtocolIE-ID ::= 410
|
||||
id-RAN-MeasurementID ProtocolIE-ID ::= 411
|
||||
id-LMF-UE-MeasurementID ProtocolIE-ID ::= 412
|
||||
id-RAN-UE-MeasurementID ProtocolIE-ID ::= 413
|
||||
id-E-CID-MeasurementQuantities ProtocolIE-ID ::= 414
|
||||
id-E-CID-MeasurementQuantities-Item ProtocolIE-ID ::= 415
|
||||
id-E-CID-MeasurementPeriodicity ProtocolIE-ID ::= 416
|
||||
id-E-CID-MeasurementResult ProtocolIE-ID ::= 417
|
||||
id-Cell-Portion-ID ProtocolIE-ID ::= 418
|
||||
id-SFNInitialisationTime ProtocolIE-ID ::= 419
|
||||
id-SystemFrameNumber ProtocolIE-ID ::= 420
|
||||
id-SlotNumber ProtocolIE-ID ::= 421
|
||||
id-TRP-MeasurementRequestList ProtocolIE-ID ::= 422
|
||||
id-MeasurementBeamInfoRequest ProtocolIE-ID ::= 423
|
||||
id-E-CID-ReportCharacteristics ProtocolIE-ID ::= 424
|
||||
id-ConfiguredTACIndication ProtocolIE-ID ::= 425
|
||||
id-Extended-GNB-DU-Name ProtocolIE-ID ::= 426
|
||||
id-Extended-GNB-CU-Name ProtocolIE-ID ::= 427
|
||||
|
||||
|
||||
END
|
||||
@@ -0,0 +1,178 @@
|
||||
F1AP-Containers {
|
||||
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
|
||||
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Containers (5) }
|
||||
|
||||
DEFINITIONS AUTOMATIC TAGS ::=
|
||||
|
||||
BEGIN
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- IE parameter types from other modules.
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
IMPORTS
|
||||
Criticality,
|
||||
Presence,
|
||||
PrivateIE-ID,
|
||||
ProtocolExtensionID,
|
||||
ProtocolIE-ID
|
||||
|
||||
FROM F1AP-CommonDataTypes
|
||||
maxPrivateIEs,
|
||||
maxProtocolExtensions,
|
||||
maxProtocolIEs
|
||||
|
||||
FROM F1AP-Constants;
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Class Definition for Protocol IEs
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-PROTOCOL-IES ::= CLASS {
|
||||
&id ProtocolIE-ID UNIQUE,
|
||||
&criticality Criticality,
|
||||
&Value,
|
||||
&presence Presence
|
||||
}
|
||||
WITH SYNTAX {
|
||||
ID &id
|
||||
CRITICALITY &criticality
|
||||
TYPE &Value
|
||||
PRESENCE &presence
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Class Definition for Protocol IEs
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-PROTOCOL-IES-PAIR ::= CLASS {
|
||||
&id ProtocolIE-ID UNIQUE,
|
||||
&firstCriticality Criticality,
|
||||
&FirstValue,
|
||||
&secondCriticality Criticality,
|
||||
&SecondValue,
|
||||
&presence Presence
|
||||
}
|
||||
WITH SYNTAX {
|
||||
ID &id
|
||||
FIRST CRITICALITY &firstCriticality
|
||||
FIRST TYPE &FirstValue
|
||||
SECOND CRITICALITY &secondCriticality
|
||||
SECOND TYPE &SecondValue
|
||||
PRESENCE &presence
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Class Definition for Protocol Extensions
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-PROTOCOL-EXTENSION ::= CLASS {
|
||||
&id ProtocolExtensionID UNIQUE,
|
||||
&criticality Criticality,
|
||||
&Extension,
|
||||
&presence Presence
|
||||
}
|
||||
WITH SYNTAX {
|
||||
ID &id
|
||||
CRITICALITY &criticality
|
||||
EXTENSION &Extension
|
||||
PRESENCE &presence
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Class Definition for Private IEs
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-PRIVATE-IES ::= CLASS {
|
||||
&id PrivateIE-ID,
|
||||
&criticality Criticality,
|
||||
&Value,
|
||||
&presence Presence
|
||||
}
|
||||
WITH SYNTAX {
|
||||
ID &id
|
||||
CRITICALITY &criticality
|
||||
TYPE &Value
|
||||
PRESENCE &presence
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Container for Protocol IEs
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
ProtocolIE-Container {F1AP-PROTOCOL-IES : IEsSetParam} ::=
|
||||
SEQUENCE (SIZE (0..maxProtocolIEs)) OF
|
||||
ProtocolIE-Field {{IEsSetParam}}
|
||||
|
||||
ProtocolIE-SingleContainer {F1AP-PROTOCOL-IES : IEsSetParam} ::=
|
||||
ProtocolIE-Field {{IEsSetParam}}
|
||||
|
||||
ProtocolIE-Field {F1AP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE {
|
||||
id F1AP-PROTOCOL-IES.&id ({IEsSetParam}),
|
||||
criticality F1AP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}),
|
||||
value F1AP-PROTOCOL-IES.&Value ({IEsSetParam}{@id})
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Container for Protocol IE Pairs
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
ProtocolIE-ContainerPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::=
|
||||
SEQUENCE (SIZE (0..maxProtocolIEs)) OF
|
||||
ProtocolIE-FieldPair {{IEsSetParam}}
|
||||
|
||||
ProtocolIE-FieldPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE {
|
||||
id F1AP-PROTOCOL-IES-PAIR.&id ({IEsSetParam}),
|
||||
firstCriticality F1AP-PROTOCOL-IES-PAIR.&firstCriticality ({IEsSetParam}{@id}),
|
||||
firstValue F1AP-PROTOCOL-IES-PAIR.&FirstValue ({IEsSetParam}{@id}),
|
||||
secondCriticality F1AP-PROTOCOL-IES-PAIR.&secondCriticality ({IEsSetParam}{@id}),
|
||||
secondValue F1AP-PROTOCOL-IES-PAIR.&SecondValue ({IEsSetParam}{@id})
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Container for Protocol Extensions
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
ProtocolExtensionContainer {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::=
|
||||
SEQUENCE (SIZE (1..maxProtocolExtensions)) OF
|
||||
ProtocolExtensionField {{ExtensionSetParam}}
|
||||
|
||||
ProtocolExtensionField {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= SEQUENCE {
|
||||
id F1AP-PROTOCOL-EXTENSION.&id ({ExtensionSetParam}),
|
||||
criticality F1AP-PROTOCOL-EXTENSION.&criticality ({ExtensionSetParam}{@id}),
|
||||
extensionValue F1AP-PROTOCOL-EXTENSION.&Extension ({ExtensionSetParam}{@id})
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Container for Private IEs
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
PrivateIE-Container {F1AP-PRIVATE-IES : IEsSetParam } ::=
|
||||
SEQUENCE (SIZE (1.. maxPrivateIEs)) OF
|
||||
PrivateIE-Field {{IEsSetParam}}
|
||||
|
||||
PrivateIE-Field {F1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE {
|
||||
id F1AP-PRIVATE-IES.&id ({IEsSetParam}),
|
||||
criticality F1AP-PRIVATE-IES.&criticality ({IEsSetParam}{@id}),
|
||||
value F1AP-PRIVATE-IES.&Value ({IEsSetParam}{@id})
|
||||
}
|
||||
|
||||
END
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,723 @@
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Elementary Procedure definitions
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-PDU-Descriptions {
|
||||
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
|
||||
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-PDU-Descriptions (0)}
|
||||
|
||||
DEFINITIONS AUTOMATIC TAGS ::=
|
||||
|
||||
BEGIN
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- IE parameter types from other modules.
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
IMPORTS
|
||||
Criticality,
|
||||
ProcedureCode
|
||||
|
||||
FROM F1AP-CommonDataTypes
|
||||
Reset,
|
||||
ResetAcknowledge,
|
||||
F1SetupRequest,
|
||||
F1SetupResponse,
|
||||
F1SetupFailure,
|
||||
GNBDUConfigurationUpdate,
|
||||
GNBDUConfigurationUpdateAcknowledge,
|
||||
GNBDUConfigurationUpdateFailure,
|
||||
GNBCUConfigurationUpdate,
|
||||
GNBCUConfigurationUpdateAcknowledge,
|
||||
GNBCUConfigurationUpdateFailure,
|
||||
UEContextSetupRequest,
|
||||
UEContextSetupResponse,
|
||||
UEContextSetupFailure,
|
||||
UEContextReleaseCommand,
|
||||
UEContextReleaseComplete,
|
||||
UEContextModificationRequest,
|
||||
UEContextModificationResponse,
|
||||
UEContextModificationFailure,
|
||||
UEContextModificationRequired,
|
||||
UEContextModificationConfirm,
|
||||
ErrorIndication,
|
||||
UEContextReleaseRequest,
|
||||
DLRRCMessageTransfer,
|
||||
ULRRCMessageTransfer,
|
||||
GNBDUResourceCoordinationRequest,
|
||||
GNBDUResourceCoordinationResponse,
|
||||
PrivateMessage,
|
||||
UEInactivityNotification,
|
||||
InitialULRRCMessageTransfer,
|
||||
SystemInformationDeliveryCommand,
|
||||
Paging,
|
||||
Notify,
|
||||
WriteReplaceWarningRequest,
|
||||
WriteReplaceWarningResponse,
|
||||
PWSCancelRequest,
|
||||
PWSCancelResponse,
|
||||
PWSRestartIndication,
|
||||
PWSFailureIndication,
|
||||
GNBDUStatusIndication,
|
||||
RRCDeliveryReport,
|
||||
UEContextModificationRefuse,
|
||||
F1RemovalRequest,
|
||||
F1RemovalResponse,
|
||||
F1RemovalFailure,
|
||||
NetworkAccessRateReduction,
|
||||
TraceStart,
|
||||
DeactivateTrace,
|
||||
DUCURadioInformationTransfer,
|
||||
CUDURadioInformationTransfer,
|
||||
BAPMappingConfiguration,
|
||||
BAPMappingConfigurationAcknowledge,
|
||||
GNBDUResourceConfiguration,
|
||||
GNBDUResourceConfigurationAcknowledge,
|
||||
IABTNLAddressRequest,
|
||||
IABTNLAddressResponse,
|
||||
IABUPConfigurationUpdateRequest,
|
||||
IABUPConfigurationUpdateResponse,
|
||||
IABUPConfigurationUpdateFailure,
|
||||
ResourceStatusRequest,
|
||||
ResourceStatusResponse,
|
||||
ResourceStatusFailure,
|
||||
ResourceStatusUpdate,
|
||||
AccessAndMobilityIndication,
|
||||
ReferenceTimeInformationReportingControl,
|
||||
ReferenceTimeInformationReport,
|
||||
AccessSuccess,
|
||||
CellTrafficTrace,
|
||||
PositioningMeasurementRequest,
|
||||
PositioningMeasurementResponse,
|
||||
PositioningMeasurementFailure,
|
||||
PositioningAssistanceInformationControl,
|
||||
PositioningAssistanceInformationFeedback,
|
||||
PositioningMeasurementReport,
|
||||
PositioningMeasurementAbort,
|
||||
PositioningMeasurementFailureIndication,
|
||||
PositioningMeasurementUpdate,
|
||||
TRPInformationRequest,
|
||||
TRPInformationResponse,
|
||||
TRPInformationFailure,
|
||||
PositioningInformationRequest,
|
||||
PositioningInformationResponse,
|
||||
PositioningInformationFailure,
|
||||
PositioningActivationRequest,
|
||||
PositioningActivationResponse,
|
||||
PositioningActivationFailure,
|
||||
PositioningDeactivation,
|
||||
PositioningInformationUpdate,
|
||||
E-CIDMeasurementInitiationRequest,
|
||||
E-CIDMeasurementInitiationResponse,
|
||||
E-CIDMeasurementInitiationFailure,
|
||||
E-CIDMeasurementFailureIndication,
|
||||
E-CIDMeasurementReport,
|
||||
E-CIDMeasurementTerminationCommand
|
||||
|
||||
|
||||
|
||||
FROM F1AP-PDU-Contents
|
||||
id-Reset,
|
||||
id-F1Setup,
|
||||
id-gNBDUConfigurationUpdate,
|
||||
id-gNBCUConfigurationUpdate,
|
||||
id-UEContextSetup,
|
||||
id-UEContextRelease,
|
||||
id-UEContextModification,
|
||||
id-UEContextModificationRequired,
|
||||
id-ErrorIndication,
|
||||
id-UEContextReleaseRequest,
|
||||
id-DLRRCMessageTransfer,
|
||||
id-ULRRCMessageTransfer,
|
||||
id-GNBDUResourceCoordination,
|
||||
id-privateMessage,
|
||||
id-UEInactivityNotification,
|
||||
id-InitialULRRCMessageTransfer,
|
||||
id-SystemInformationDeliveryCommand,
|
||||
id-Paging,
|
||||
id-Notify,
|
||||
id-WriteReplaceWarning,
|
||||
id-PWSCancel,
|
||||
id-PWSRestartIndication,
|
||||
id-PWSFailureIndication,
|
||||
id-GNBDUStatusIndication,
|
||||
id-RRCDeliveryReport,
|
||||
id-F1Removal,
|
||||
id-NetworkAccessRateReduction,
|
||||
id-TraceStart,
|
||||
id-DeactivateTrace,
|
||||
id-DUCURadioInformationTransfer,
|
||||
id-CUDURadioInformationTransfer,
|
||||
id-BAPMappingConfiguration,
|
||||
id-GNBDUResourceConfiguration,
|
||||
id-IABTNLAddressAllocation,
|
||||
id-IABUPConfigurationUpdate,
|
||||
id-resourceStatusReportingInitiation,
|
||||
id-resourceStatusReporting,
|
||||
id-accessAndMobilityIndication,
|
||||
id-ReferenceTimeInformationReportingControl,
|
||||
id-ReferenceTimeInformationReport,
|
||||
id-accessSuccess,
|
||||
id-cellTrafficTrace,
|
||||
id-PositioningMeasurementExchange,
|
||||
id-PositioningAssistanceInformationControl,
|
||||
id-PositioningAssistanceInformationFeedback,
|
||||
id-PositioningMeasurementReport,
|
||||
id-PositioningMeasurementAbort,
|
||||
id-PositioningMeasurementFailureIndication,
|
||||
id-PositioningMeasurementUpdate,
|
||||
id-TRPInformationExchange,
|
||||
id-PositioningInformationExchange,
|
||||
id-PositioningActivation,
|
||||
id-PositioningDeactivation,
|
||||
id-PositioningInformationUpdate,
|
||||
id-E-CIDMeasurementInitiation,
|
||||
id-E-CIDMeasurementFailureIndication,
|
||||
id-E-CIDMeasurementReport,
|
||||
id-E-CIDMeasurementTermination
|
||||
|
||||
|
||||
FROM F1AP-Constants
|
||||
|
||||
ProtocolIE-SingleContainer{},
|
||||
F1AP-PROTOCOL-IES
|
||||
|
||||
FROM F1AP-Containers;
|
||||
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Interface Elementary Procedure Class
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-ELEMENTARY-PROCEDURE ::= CLASS {
|
||||
&InitiatingMessage ,
|
||||
&SuccessfulOutcome OPTIONAL,
|
||||
&UnsuccessfulOutcome OPTIONAL,
|
||||
&procedureCode ProcedureCode UNIQUE,
|
||||
&criticality Criticality DEFAULT ignore
|
||||
}
|
||||
WITH SYNTAX {
|
||||
INITIATING MESSAGE &InitiatingMessage
|
||||
[SUCCESSFUL OUTCOME &SuccessfulOutcome]
|
||||
[UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome]
|
||||
PROCEDURE CODE &procedureCode
|
||||
[CRITICALITY &criticality]
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Interface PDU Definition
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-PDU ::= CHOICE {
|
||||
initiatingMessage InitiatingMessage,
|
||||
successfulOutcome SuccessfulOutcome,
|
||||
unsuccessfulOutcome UnsuccessfulOutcome,
|
||||
choice-extension ProtocolIE-SingleContainer { { F1AP-PDU-ExtIEs} }
|
||||
}
|
||||
|
||||
F1AP-PDU-ExtIEs F1AP-PROTOCOL-IES ::= { -- this extension is not used
|
||||
...
|
||||
}
|
||||
|
||||
InitiatingMessage ::= SEQUENCE {
|
||||
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
|
||||
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
|
||||
value F1AP-ELEMENTARY-PROCEDURE.&InitiatingMessage ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
|
||||
}
|
||||
|
||||
SuccessfulOutcome ::= SEQUENCE {
|
||||
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
|
||||
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
|
||||
value F1AP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
|
||||
}
|
||||
|
||||
UnsuccessfulOutcome ::= SEQUENCE {
|
||||
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
|
||||
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
|
||||
value F1AP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
|
||||
}
|
||||
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Interface Elementary Procedure List
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
F1AP-ELEMENTARY-PROCEDURES F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
F1AP-ELEMENTARY-PROCEDURES-CLASS-1 |
|
||||
F1AP-ELEMENTARY-PROCEDURES-CLASS-2,
|
||||
...
|
||||
}
|
||||
|
||||
|
||||
F1AP-ELEMENTARY-PROCEDURES-CLASS-1 F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
reset |
|
||||
f1Setup |
|
||||
gNBDUConfigurationUpdate |
|
||||
gNBCUConfigurationUpdate |
|
||||
uEContextSetup |
|
||||
uEContextRelease |
|
||||
uEContextModification |
|
||||
uEContextModificationRequired |
|
||||
writeReplaceWarning |
|
||||
pWSCancel |
|
||||
gNBDUResourceCoordination |
|
||||
f1Removal |
|
||||
bAPMappingConfiguration |
|
||||
gNBDUResourceConfiguration |
|
||||
iABTNLAddressAllocation |
|
||||
iABUPConfigurationUpdate |
|
||||
resourceStatusReportingInitiation |
|
||||
positioningMeasurementExchange |
|
||||
tRPInformationExchange |
|
||||
positioningInformationExchange |
|
||||
positioningActivation |
|
||||
e-CIDMeasurementInitiation,
|
||||
...
|
||||
}
|
||||
|
||||
F1AP-ELEMENTARY-PROCEDURES-CLASS-2 F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
errorIndication |
|
||||
uEContextReleaseRequest |
|
||||
dLRRCMessageTransfer |
|
||||
uLRRCMessageTransfer |
|
||||
uEInactivityNotification |
|
||||
privateMessage |
|
||||
initialULRRCMessageTransfer |
|
||||
systemInformationDelivery |
|
||||
paging |
|
||||
notify |
|
||||
pWSRestartIndication |
|
||||
pWSFailureIndication |
|
||||
gNBDUStatusIndication |
|
||||
rRCDeliveryReport |
|
||||
networkAccessRateReduction |
|
||||
traceStart |
|
||||
deactivateTrace |
|
||||
dUCURadioInformationTransfer |
|
||||
cUDURadioInformationTransfer |
|
||||
resourceStatusReporting |
|
||||
accessAndMobilityIndication |
|
||||
referenceTimeInformationReportingControl|
|
||||
referenceTimeInformationReport |
|
||||
accessSuccess |
|
||||
cellTrafficTrace |
|
||||
positioningAssistanceInformationControl |
|
||||
positioningAssistanceInformationFeedback |
|
||||
positioningMeasurementReport |
|
||||
positioningMeasurementAbort |
|
||||
positioningMeasurementFailureIndication |
|
||||
positioningMeasurementUpdate |
|
||||
positioningDeactivation |
|
||||
e-CIDMeasurementFailureIndication |
|
||||
e-CIDMeasurementReport |
|
||||
e-CIDMeasurementTermination |
|
||||
positioningInformationUpdate,
|
||||
...
|
||||
}
|
||||
-- **************************************************************
|
||||
--
|
||||
-- Interface Elementary Procedures
|
||||
--
|
||||
-- **************************************************************
|
||||
|
||||
reset F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE Reset
|
||||
SUCCESSFUL OUTCOME ResetAcknowledge
|
||||
PROCEDURE CODE id-Reset
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
f1Setup F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE F1SetupRequest
|
||||
SUCCESSFUL OUTCOME F1SetupResponse
|
||||
UNSUCCESSFUL OUTCOME F1SetupFailure
|
||||
PROCEDURE CODE id-F1Setup
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
gNBDUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE GNBDUConfigurationUpdate
|
||||
SUCCESSFUL OUTCOME GNBDUConfigurationUpdateAcknowledge
|
||||
UNSUCCESSFUL OUTCOME GNBDUConfigurationUpdateFailure
|
||||
PROCEDURE CODE id-gNBDUConfigurationUpdate
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
gNBCUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE GNBCUConfigurationUpdate
|
||||
SUCCESSFUL OUTCOME GNBCUConfigurationUpdateAcknowledge
|
||||
UNSUCCESSFUL OUTCOME GNBCUConfigurationUpdateFailure
|
||||
PROCEDURE CODE id-gNBCUConfigurationUpdate
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
uEContextSetup F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE UEContextSetupRequest
|
||||
SUCCESSFUL OUTCOME UEContextSetupResponse
|
||||
UNSUCCESSFUL OUTCOME UEContextSetupFailure
|
||||
PROCEDURE CODE id-UEContextSetup
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
uEContextRelease F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE UEContextReleaseCommand
|
||||
SUCCESSFUL OUTCOME UEContextReleaseComplete
|
||||
PROCEDURE CODE id-UEContextRelease
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
uEContextModification F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE UEContextModificationRequest
|
||||
SUCCESSFUL OUTCOME UEContextModificationResponse
|
||||
UNSUCCESSFUL OUTCOME UEContextModificationFailure
|
||||
PROCEDURE CODE id-UEContextModification
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
uEContextModificationRequired F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE UEContextModificationRequired
|
||||
SUCCESSFUL OUTCOME UEContextModificationConfirm
|
||||
UNSUCCESSFUL OUTCOME UEContextModificationRefuse
|
||||
PROCEDURE CODE id-UEContextModificationRequired
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
writeReplaceWarning F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE WriteReplaceWarningRequest
|
||||
SUCCESSFUL OUTCOME WriteReplaceWarningResponse
|
||||
PROCEDURE CODE id-WriteReplaceWarning
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
pWSCancel F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PWSCancelRequest
|
||||
SUCCESSFUL OUTCOME PWSCancelResponse
|
||||
PROCEDURE CODE id-PWSCancel
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
errorIndication F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE ErrorIndication
|
||||
PROCEDURE CODE id-ErrorIndication
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
uEContextReleaseRequest F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE UEContextReleaseRequest
|
||||
PROCEDURE CODE id-UEContextReleaseRequest
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
|
||||
initialULRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE InitialULRRCMessageTransfer
|
||||
PROCEDURE CODE id-InitialULRRCMessageTransfer
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
dLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE DLRRCMessageTransfer
|
||||
PROCEDURE CODE id-DLRRCMessageTransfer
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
uLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE ULRRCMessageTransfer
|
||||
PROCEDURE CODE id-ULRRCMessageTransfer
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
|
||||
uEInactivityNotification F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE UEInactivityNotification
|
||||
PROCEDURE CODE id-UEInactivityNotification
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
gNBDUResourceCoordination F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE GNBDUResourceCoordinationRequest
|
||||
SUCCESSFUL OUTCOME GNBDUResourceCoordinationResponse
|
||||
PROCEDURE CODE id-GNBDUResourceCoordination
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
privateMessage F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PrivateMessage
|
||||
PROCEDURE CODE id-privateMessage
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
systemInformationDelivery F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE SystemInformationDeliveryCommand
|
||||
PROCEDURE CODE id-SystemInformationDeliveryCommand
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
|
||||
paging F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE Paging
|
||||
PROCEDURE CODE id-Paging
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
notify F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE Notify
|
||||
PROCEDURE CODE id-Notify
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
networkAccessRateReduction F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE NetworkAccessRateReduction
|
||||
PROCEDURE CODE id-NetworkAccessRateReduction
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
|
||||
pWSRestartIndication F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PWSRestartIndication
|
||||
PROCEDURE CODE id-PWSRestartIndication
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
pWSFailureIndication F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PWSFailureIndication
|
||||
PROCEDURE CODE id-PWSFailureIndication
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
gNBDUStatusIndication F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE GNBDUStatusIndication
|
||||
PROCEDURE CODE id-GNBDUStatusIndication
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
|
||||
rRCDeliveryReport F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE RRCDeliveryReport
|
||||
PROCEDURE CODE id-RRCDeliveryReport
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
f1Removal F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE F1RemovalRequest
|
||||
SUCCESSFUL OUTCOME F1RemovalResponse
|
||||
UNSUCCESSFUL OUTCOME F1RemovalFailure
|
||||
PROCEDURE CODE id-F1Removal
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
traceStart F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE TraceStart
|
||||
PROCEDURE CODE id-TraceStart
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
deactivateTrace F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE DeactivateTrace
|
||||
PROCEDURE CODE id-DeactivateTrace
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
dUCURadioInformationTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE DUCURadioInformationTransfer
|
||||
PROCEDURE CODE id-DUCURadioInformationTransfer
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
cUDURadioInformationTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE CUDURadioInformationTransfer
|
||||
PROCEDURE CODE id-CUDURadioInformationTransfer
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
bAPMappingConfiguration F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE BAPMappingConfiguration
|
||||
SUCCESSFUL OUTCOME BAPMappingConfigurationAcknowledge
|
||||
PROCEDURE CODE id-BAPMappingConfiguration
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
gNBDUResourceConfiguration F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE GNBDUResourceConfiguration
|
||||
SUCCESSFUL OUTCOME GNBDUResourceConfigurationAcknowledge
|
||||
PROCEDURE CODE id-GNBDUResourceConfiguration
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
iABTNLAddressAllocation F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE IABTNLAddressRequest
|
||||
SUCCESSFUL OUTCOME IABTNLAddressResponse
|
||||
PROCEDURE CODE id-IABTNLAddressAllocation
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
iABUPConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE IABUPConfigurationUpdateRequest
|
||||
SUCCESSFUL OUTCOME IABUPConfigurationUpdateResponse
|
||||
UNSUCCESSFUL OUTCOME IABUPConfigurationUpdateFailure
|
||||
PROCEDURE CODE id-IABUPConfigurationUpdate
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
resourceStatusReportingInitiation F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE ResourceStatusRequest
|
||||
SUCCESSFUL OUTCOME ResourceStatusResponse
|
||||
UNSUCCESSFUL OUTCOME ResourceStatusFailure
|
||||
PROCEDURE CODE id-resourceStatusReportingInitiation
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
resourceStatusReporting F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE ResourceStatusUpdate
|
||||
PROCEDURE CODE id-resourceStatusReporting
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
accessAndMobilityIndication F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE AccessAndMobilityIndication
|
||||
PROCEDURE CODE id-accessAndMobilityIndication
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
referenceTimeInformationReportingControl F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE ReferenceTimeInformationReportingControl
|
||||
PROCEDURE CODE id-ReferenceTimeInformationReportingControl
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
referenceTimeInformationReport F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE ReferenceTimeInformationReport
|
||||
PROCEDURE CODE id-ReferenceTimeInformationReport
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
accessSuccess F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE AccessSuccess
|
||||
PROCEDURE CODE id-accessSuccess
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
cellTrafficTrace F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE CellTrafficTrace
|
||||
PROCEDURE CODE id-cellTrafficTrace
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
positioningAssistanceInformationControl F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningAssistanceInformationControl
|
||||
PROCEDURE CODE id-PositioningAssistanceInformationControl
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
positioningAssistanceInformationFeedback F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningAssistanceInformationFeedback
|
||||
PROCEDURE CODE id-PositioningAssistanceInformationFeedback
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
positioningMeasurementExchange F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningMeasurementRequest
|
||||
SUCCESSFUL OUTCOME PositioningMeasurementResponse
|
||||
UNSUCCESSFUL OUTCOME PositioningMeasurementFailure
|
||||
PROCEDURE CODE id-PositioningMeasurementExchange
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
positioningMeasurementReport F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningMeasurementReport
|
||||
PROCEDURE CODE id-PositioningMeasurementReport
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
positioningMeasurementAbort F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningMeasurementAbort
|
||||
PROCEDURE CODE id-PositioningMeasurementAbort
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
positioningMeasurementFailureIndication F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningMeasurementFailureIndication
|
||||
PROCEDURE CODE id-PositioningMeasurementFailureIndication
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
positioningMeasurementUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningMeasurementUpdate
|
||||
PROCEDURE CODE id-PositioningMeasurementUpdate
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
|
||||
tRPInformationExchange F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE TRPInformationRequest
|
||||
SUCCESSFUL OUTCOME TRPInformationResponse
|
||||
UNSUCCESSFUL OUTCOME TRPInformationFailure
|
||||
PROCEDURE CODE id-TRPInformationExchange
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
positioningInformationExchange F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningInformationRequest
|
||||
SUCCESSFUL OUTCOME PositioningInformationResponse
|
||||
UNSUCCESSFUL OUTCOME PositioningInformationFailure
|
||||
PROCEDURE CODE id-PositioningInformationExchange
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
positioningActivation F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningActivationRequest
|
||||
SUCCESSFUL OUTCOME PositioningActivationResponse
|
||||
UNSUCCESSFUL OUTCOME PositioningActivationFailure
|
||||
PROCEDURE CODE id-PositioningActivation
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
positioningDeactivation F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningDeactivation
|
||||
PROCEDURE CODE id-PositioningDeactivation
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
e-CIDMeasurementInitiation F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE E-CIDMeasurementInitiationRequest
|
||||
SUCCESSFUL OUTCOME E-CIDMeasurementInitiationResponse
|
||||
UNSUCCESSFUL OUTCOME E-CIDMeasurementInitiationFailure
|
||||
PROCEDURE CODE id-E-CIDMeasurementInitiation
|
||||
CRITICALITY reject
|
||||
}
|
||||
|
||||
e-CIDMeasurementFailureIndication F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE E-CIDMeasurementFailureIndication
|
||||
PROCEDURE CODE id-E-CIDMeasurementFailureIndication
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
e-CIDMeasurementReport F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE E-CIDMeasurementReport
|
||||
PROCEDURE CODE id-E-CIDMeasurementReport
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
e-CIDMeasurementTermination F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE E-CIDMeasurementTerminationCommand
|
||||
PROCEDURE CODE id-E-CIDMeasurementTermination
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
positioningInformationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
|
||||
INITIATING MESSAGE PositioningInformationUpdate
|
||||
PROCEDURE CODE id-PositioningInformationUpdate
|
||||
CRITICALITY ignore
|
||||
}
|
||||
|
||||
|
||||
END
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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 "COMMON/platform_types.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "NR_BCCH-BCH-Message.h"
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
#include "NR_MIB.h"
|
||||
|
||||
void apply_macrlc_config(gNB_RRC_INST *rrc,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP ) {
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#include "F1AP_Active-Cells-List.h"
|
||||
#include "F1AP_RAT-FrequencyPriorityInformation.h"
|
||||
#include "F1AP_DLUPTNLInformation-ToBeSetup-Item.h"
|
||||
#include "F1AP_PrivateMessage.h"
|
||||
@@ -55,6 +54,7 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_NRPCI.h"
|
||||
#include "F1AP_Transmission-Bandwidth.h"
|
||||
#include "F1AP_SIB1-message.h"
|
||||
#include "F1AP_SibtypetobeupdatedListItem.h"
|
||||
#include "F1AP_GNBCUConfigurationUpdateAcknowledge.h"
|
||||
#include "F1AP_DRBs-Setup-Item.h"
|
||||
#include "F1AP_EUTRA-NR-CellResourceCoordinationReqAck-Container.h"
|
||||
@@ -75,7 +75,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_DRBs-Required-ToBeModified-Item.h"
|
||||
#include "F1AP_BitRate.h"
|
||||
#include "F1AP_SRBs-ToBeSetup-List.h"
|
||||
#include "F1AP_ConcurrentWarningMessageIndicator.h"
|
||||
#include "F1AP_CriticalityDiagnostics-IE-Item.h"
|
||||
#include "F1AP_GNB-CU-TNL-Association-To-Update-List.h"
|
||||
#include "F1AP_DRB-Notify-List.h"
|
||||
@@ -85,6 +84,7 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_PWS-Failed-NR-CGI-List.h"
|
||||
#include "F1AP_InitialULRRCMessageTransfer.h"
|
||||
#include "F1AP_Served-Cell-Information.h"
|
||||
#include "F1AP_ServedPLMNs-Item.h"
|
||||
#include "F1AP_Served-EUTRA-Cells-Information.h"
|
||||
#include "F1AP_Cells-Broadcast-Cancelled-Item.h"
|
||||
#include "F1AP_F1SetupRequest.h"
|
||||
@@ -128,13 +128,11 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_TransactionID.h"
|
||||
#include "F1AP_AllocationAndRetentionPriority.h"
|
||||
#include "F1AP_ShortDRXCycleLength.h"
|
||||
#include "F1AP_BroadcastPLMNs-Item.h"
|
||||
#include "F1AP_DRB-Information.h"
|
||||
#include "F1AP_TimeToWait.h"
|
||||
#include "F1AP_NonDynamic5QIDescriptor.h"
|
||||
#include "F1AP_C-RNTI.h"
|
||||
#include "F1AP_MIB-message.h"
|
||||
#include "F1AP_SIBtype-Item.h"
|
||||
#include "F1AP_Served-Cells-To-Modify-List.h"
|
||||
#include "F1AP_NRCGI.h"
|
||||
#include "F1AP_DuplicationActivation.h"
|
||||
@@ -187,6 +185,7 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_CellULConfigured.h"
|
||||
#include "F1AP_DRB-Activity.h"
|
||||
#include "F1AP_GNB-CU-TNL-Association-Failed-To-Setup-Item.h"
|
||||
#include "F1AP_ProtocolIE-ID.h"
|
||||
#include "F1AP_PrivateIE-ID.h"
|
||||
#include "F1AP_WriteReplaceWarningResponse.h"
|
||||
#include "F1AP_CauseMisc.h"
|
||||
@@ -231,9 +230,7 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_SUL-Information.h"
|
||||
#include "F1AP_CriticalityDiagnostics-IE-List.h"
|
||||
#include "F1AP_EUTRA-FDD-Info.h"
|
||||
#include "F1AP_BroadcastPLMNs-List.h"
|
||||
#include "F1AP_Served-Cells-To-Delete-Item.h"
|
||||
#include "F1AP_ListofEUTRACellsinGNBDUCoordination.h"
|
||||
#include "F1AP_Candidate-SpCell-Item.h"
|
||||
#include "F1AP_Cells-To-Be-Broadcast-List.h"
|
||||
#include "F1AP_ULRRCMessageTransfer.h"
|
||||
@@ -255,7 +252,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_SRBs-ToBeReleased-List.h"
|
||||
#include "F1AP_MeasGapConfig.h"
|
||||
#include "F1AP_NR-Mode-Info.h"
|
||||
#include "F1AP_Active-Cells-Item.h"
|
||||
#include "F1AP_Protected-EUTRA-Resources-List.h"
|
||||
#include "F1AP_SRBs-FailedToBeSetup-Item.h"
|
||||
#include "F1AP_ResetAll.h"
|
||||
@@ -287,7 +283,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_UEContextReleaseRequest.h"
|
||||
#include "F1AP_GNB-DU-Name.h"
|
||||
#include "F1AP_DRBs-ToBeModified-Item.h"
|
||||
#include "F1AP_SIBtype-List.h"
|
||||
#include "F1AP_EUTRA-NR-CellResourceCoordinationReq-Container.h"
|
||||
#include "F1AP_DRBs-SetupMod-List.h"
|
||||
#include "F1AP_DRBs-Required-ToBeModified-List.h"
|
||||
@@ -296,7 +291,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_PacketDelayBudget.h"
|
||||
#include "F1AP_GNBCUConfigurationUpdate.h"
|
||||
#include "F1AP_Cells-Broadcast-Completed-Item.h"
|
||||
#include "F1AP_RRCRconfigurationCompleteIndicator.h"
|
||||
#include "F1AP_PagingPriority.h"
|
||||
#include "F1AP_Cells-Failed-to-be-Activated-List.h"
|
||||
#include "F1AP_Endpoint-IP-address-and-port.h"
|
||||
@@ -306,7 +300,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_ResetType.h"
|
||||
#include "F1AP_FDD-Info.h"
|
||||
#include "F1AP_DLUPTNLInformation-ToBeSetup-List.h"
|
||||
#include "F1AP_QoSFlowIndicator.h"
|
||||
#include "F1AP_NR-CGI-List-For-Restart-List.h"
|
||||
#include "F1AP_F1SetupResponse.h"
|
||||
#include "F1AP_UEContextSetupResponse.h"
|
||||
@@ -325,7 +318,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_Cells-to-be-Barred-List.h"
|
||||
#include "F1AP_Presence.h"
|
||||
#include "F1AP_CellBarred.h"
|
||||
#include "F1AP_SIBtype.h"
|
||||
#include "F1AP_RequestType.h"
|
||||
#include "F1AP_NRFreqInfo.h"
|
||||
#include "F1AP_Potential-SpCell-Item.h"
|
||||
@@ -348,7 +340,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "F1AP_GBR-QoSFlowInformation.h"
|
||||
#include "F1AP_SCellIndex.h"
|
||||
#include "F1AP_DRBs-SetupMod-Item.h"
|
||||
#include "F1AP_TransmissionStopIndicator.h"
|
||||
#include "F1AP_UEContextSetupFailure.h"
|
||||
#include "F1AP_DRBs-FailedToBeModified-List.h"
|
||||
#include "F1AP_DRBs-FailedToBeSetupMod-Item.h"
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "f1ap_cu_interface_management.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data_from_du;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
@@ -102,8 +103,12 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
|
||||
assoc_id, stream);
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_RRC_ENB, 0, F1AP_SETUP_REQ);
|
||||
|
||||
if(RC.nrrrc) {
|
||||
message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
|
||||
} else {
|
||||
message_p = itti_alloc_new_message(TASK_RRC_ENB, 0, F1AP_SETUP_REQ);
|
||||
}
|
||||
|
||||
/* assoc_id */
|
||||
F1AP_SETUP_REQ(message_p).assoc_id = assoc_id;
|
||||
|
||||
@@ -134,57 +139,57 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
|
||||
int num_cells_available = F1AP_SETUP_REQ(message_p).num_cells_available;
|
||||
|
||||
for (i=0; i<num_cells_available; i++) {
|
||||
F1AP_GNB_DU_Served_Cells_Item_t *served_celles_item_p;
|
||||
F1AP_GNB_DU_Served_Cells_Item_t *served_cells_item_p;
|
||||
|
||||
served_celles_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item);
|
||||
served_cells_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item);
|
||||
|
||||
/* tac */
|
||||
OCTET_STRING_TO_INT16(&(served_celles_item_p->served_Cell_Information.fiveGS_TAC), F1AP_SETUP_REQ(message_p).tac[i]);
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n",
|
||||
i, F1AP_SETUP_REQ(message_p).tac[i]);
|
||||
|
||||
if (served_cells_item_p->served_Cell_Information.fiveGS_TAC) {
|
||||
OCTET_STRING_TO_INT16(served_cells_item_p->served_Cell_Information.fiveGS_TAC, F1AP_SETUP_REQ(message_p).tac[i]);
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]);
|
||||
}
|
||||
/* - nRCGI */
|
||||
TBCD_TO_MCC_MNC(&(served_celles_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
|
||||
TBCD_TO_MCC_MNC(&(served_cells_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
|
||||
F1AP_SETUP_REQ(message_p).mnc[i],
|
||||
F1AP_SETUP_REQ(message_p).mnc_digit_length[i]);
|
||||
|
||||
|
||||
// NR cellID
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity,
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity,
|
||||
F1AP_SETUP_REQ(message_p).nr_cellid[i]);
|
||||
LOG_D(F1AP, "[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n", assoc_id,
|
||||
F1AP_SETUP_REQ(message_p).mcc[i],
|
||||
F1AP_SETUP_REQ(message_p).mnc[i],
|
||||
(long long unsigned int)F1AP_SETUP_REQ(message_p).nr_cellid[i]);
|
||||
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
|
||||
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0],
|
||||
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1],
|
||||
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2],
|
||||
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[3],
|
||||
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]);
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0],
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1],
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2],
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[3],
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]);
|
||||
/* - nRPCI */
|
||||
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_celles_item_p->served_Cell_Information.nRPCI;
|
||||
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_cells_item_p->served_Cell_Information.nRPCI;
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n",
|
||||
i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
|
||||
|
||||
// System Information
|
||||
/* mib */
|
||||
F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_celles_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
|
||||
memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_celles_item_p->gNB_DU_System_Information->mIB_message.buf,
|
||||
served_celles_item_p->gNB_DU_System_Information->mIB_message.size);
|
||||
F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_cells_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
|
||||
memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_cells_item_p->gNB_DU_System_Information->mIB_message.buf,
|
||||
served_cells_item_p->gNB_DU_System_Information->mIB_message.size);
|
||||
/* Convert the mme name to a printable string */
|
||||
F1AP_SETUP_REQ(message_p).mib[i][served_celles_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
|
||||
F1AP_SETUP_REQ(message_p).mib_length[i] = served_celles_item_p->gNB_DU_System_Information->mIB_message.size;
|
||||
F1AP_SETUP_REQ(message_p).mib[i][served_cells_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
|
||||
F1AP_SETUP_REQ(message_p).mib_length[i] = served_cells_item_p->gNB_DU_System_Information->mIB_message.size;
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).mib[%d] %s , len = %d \n",
|
||||
i, F1AP_SETUP_REQ(message_p).mib[i], F1AP_SETUP_REQ(message_p).mib_length[i]);
|
||||
|
||||
/* sib1 */
|
||||
F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_celles_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
|
||||
memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_celles_item_p->gNB_DU_System_Information->sIB1_message.buf,
|
||||
served_celles_item_p->gNB_DU_System_Information->sIB1_message.size);
|
||||
F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_cells_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
|
||||
memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_cells_item_p->gNB_DU_System_Information->sIB1_message.buf,
|
||||
served_cells_item_p->gNB_DU_System_Information->sIB1_message.size);
|
||||
/* Convert the mme name to a printable string */
|
||||
F1AP_SETUP_REQ(message_p).sib1[i][served_celles_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
|
||||
F1AP_SETUP_REQ(message_p).sib1_length[i] = served_celles_item_p->gNB_DU_System_Information->sIB1_message.size;
|
||||
F1AP_SETUP_REQ(message_p).sib1[i][served_cells_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
|
||||
F1AP_SETUP_REQ(message_p).sib1_length[i] = served_cells_item_p->gNB_DU_System_Information->sIB1_message.size;
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).sib1[%d] %s , len = %d \n",
|
||||
i, F1AP_SETUP_REQ(message_p).sib1[i], F1AP_SETUP_REQ(message_p).sib1_length[i]);
|
||||
}
|
||||
@@ -245,10 +250,18 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
|
||||
);
|
||||
|
||||
if (num_cells_available > 0) {
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
|
||||
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p);
|
||||
} else {
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
|
||||
}
|
||||
} else {
|
||||
CU_send_F1_SETUP_FAILURE(instance);
|
||||
itti_free(TASK_RRC_ENB,message_p);
|
||||
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
|
||||
itti_free(TASK_RRC_GNB,message_p);
|
||||
} else {
|
||||
itti_free(TASK_RRC_ENB,message_p);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@@ -305,45 +318,51 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
|
||||
|
||||
/* mandatory */
|
||||
/* c3. cells to be Activated list */
|
||||
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
|
||||
|
||||
int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate;
|
||||
LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
|
||||
for (i=0;
|
||||
i<num_cells_to_activate;
|
||||
i++) {
|
||||
if (num_cells_to_activate >0) {
|
||||
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
|
||||
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
|
||||
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
|
||||
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
|
||||
for (i=0; i<num_cells_to_activate; i++) {
|
||||
|
||||
/* 3.1 cells to be Activated list item */
|
||||
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
|
||||
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
|
||||
LOG_D(F1AP, "[c3] (cell %d) mcc = %d, mnc = %d, mnc_digit_length = %d, nr_cellid = %lu\n",
|
||||
i,
|
||||
f1ap_setup_resp->cells_to_activate[i].mcc,
|
||||
f1ap_setup_resp->cells_to_activate[i].mnc,
|
||||
f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
|
||||
f1ap_setup_resp->cells_to_activate[i].nr_cellid);
|
||||
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i],
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity);
|
||||
cells_to_be_activated_list_item.nRCGI = nRCGI;
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
|
||||
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
|
||||
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
|
||||
|
||||
/* optional */
|
||||
/* - nRPCI */
|
||||
if (1) {
|
||||
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
|
||||
*cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->nrpci[i]; // int 0..1007
|
||||
}
|
||||
/* 3.1 cells to be Activated list item */
|
||||
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
|
||||
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
|
||||
|
||||
/* optional */
|
||||
/* - gNB-CU System Information */
|
||||
if (1) {
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_resp->cells_to_activate[i].mcc, f1ap_setup_resp->cells_to_activate[i].mnc, f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
|
||||
cells_to_be_activated_list_item.nRCGI = nRCGI;
|
||||
|
||||
/* optional */
|
||||
/* - nRPCI */
|
||||
if (1) {
|
||||
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
|
||||
*cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* - gNB-CU System Information */
|
||||
if (1) {
|
||||
/* 3.1.2 gNB-CUSystem Information */
|
||||
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
|
||||
cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
|
||||
@@ -355,35 +374,44 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
|
||||
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
|
||||
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
|
||||
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
|
||||
//printf("\n");
|
||||
OCTET_STRING_fromBuf(&gNB_CUSystemInformation->sImessage,
|
||||
(const char*)f1ap_setup_resp->SI_container[i][0],
|
||||
f1ap_setup_resp->SI_container_length[i][0]);
|
||||
//printf("\n");
|
||||
|
||||
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length = %d \n", f1ap_setup_resp->SI_container_length[0][0]);
|
||||
// for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
|
||||
for (int sIBtype=2;sIBtype<21;sIBtype++) {
|
||||
if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
|
||||
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
|
||||
F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
|
||||
memset((void*)sib_item,0,sizeof(*sib_item));
|
||||
sib_item->sIBtype = sIBtype;
|
||||
OCTET_STRING_fromBuf(&sib_item->sIBmessage,
|
||||
(const char*)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
|
||||
f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
|
||||
|
||||
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
|
||||
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
|
||||
}
|
||||
}
|
||||
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
|
||||
|
||||
F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
|
||||
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
|
||||
|
||||
F1AP_ProtocolExtensionContainer_160P9_t p_160P9_t;
|
||||
memset((void *)&p_160P9_t, 0, sizeof(F1AP_ProtocolExtensionContainer_160P9_t));
|
||||
|
||||
ASN_SEQUENCE_ADD(&p_160P9_t.list,
|
||||
cells_to_be_activated_list_itemExtIEs);
|
||||
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_160P9_t;
|
||||
ASN_SEQUENCE_ADD(&p_154P112_t.list, cells_to_be_activated_list_itemExtIEs);
|
||||
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
|
||||
|
||||
free(gNB_CUSystemInformation);
|
||||
gNB_CUSystemInformation = NULL;
|
||||
}
|
||||
/* ADD */
|
||||
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list, cells_to_be_activated_list_item_ies);
|
||||
}
|
||||
/* ADD */
|
||||
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
|
||||
cells_to_be_activated_list_item_ies);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 setup response\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -469,7 +497,7 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 setup failure\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -508,7 +536,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
*/
|
||||
|
||||
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
|
||||
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP) {
|
||||
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update) {
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_GNBCUConfigurationUpdate_t *out;
|
||||
F1AP_GNBCUConfigurationUpdateIEs_t *ie;
|
||||
@@ -517,10 +545,6 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
|
||||
uint32_t len;
|
||||
int i = 0;
|
||||
|
||||
// for test
|
||||
int mcc = 208;
|
||||
int mnc = 93;
|
||||
int mnc_digit_length = 8;
|
||||
|
||||
/* Create */
|
||||
/* 0. Message Type */
|
||||
@@ -538,308 +562,355 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
|
||||
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP);
|
||||
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, 0);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c2. Cells_to_be_Activated_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
|
||||
// mandatory
|
||||
// c2. Cells_to_be_Activated_List
|
||||
if (f1ap_gnb_cu_configuration_update->num_cells_to_activate > 0) {
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
for (i=0; i<f1ap_gnb_cu_configuration_update->num_cells_to_activate; i++) {
|
||||
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
|
||||
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
|
||||
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
|
||||
LOG_D(F1AP, "[c2] (cell %d) mcc = %d, mnc = %d, mnc_digit_length = %d, nr_cellid = %lu\n",
|
||||
i,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid);
|
||||
|
||||
/* 2.1 cells to be Activated list item */
|
||||
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
|
||||
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
|
||||
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
|
||||
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
|
||||
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
|
||||
cells_to_be_activated_list_item.nRCGI = nRCGI;
|
||||
// 2.1 cells to be Activated list item
|
||||
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
|
||||
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
|
||||
|
||||
/* optional */
|
||||
/* - nRPCI */
|
||||
if (0) {
|
||||
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
|
||||
*cells_to_be_activated_list_item.nRPCI = 321L; // int 0..1007
|
||||
}
|
||||
// - nRCGI
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
|
||||
&nRCGI.nRCellIdentity);
|
||||
cells_to_be_activated_list_item.nRCGI = nRCGI;
|
||||
|
||||
/* optional */
|
||||
/* - gNB-CU System Information */
|
||||
//if (1) {
|
||||
if(RC.nrrrc) {
|
||||
|
||||
//}
|
||||
/* ADD */
|
||||
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
|
||||
cells_to_be_activated_list_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
// optional
|
||||
// -nRPCI
|
||||
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
|
||||
*cells_to_be_activated_list_item.nRPCI = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
|
||||
|
||||
// optional
|
||||
// 3.1.2 gNB-CUSystem Information
|
||||
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
|
||||
cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
|
||||
cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
|
||||
cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
|
||||
|
||||
if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
|
||||
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
|
||||
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
|
||||
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
|
||||
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
|
||||
//printf("\n");
|
||||
|
||||
// for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
|
||||
for (int sIBtype=2;sIBtype<21;sIBtype++) {
|
||||
if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
|
||||
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
|
||||
F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
|
||||
memset((void*)sib_item,0,sizeof(*sib_item));
|
||||
sib_item->sIBtype = sIBtype;
|
||||
OCTET_STRING_fromBuf(&sib_item->sIBmessage,
|
||||
(const char*)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype],
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
|
||||
|
||||
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
|
||||
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
|
||||
}
|
||||
}
|
||||
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
|
||||
|
||||
|
||||
F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
|
||||
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
|
||||
|
||||
/* mandatory */
|
||||
/* c3. Cells_to_be_Deactivated_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
|
||||
ASN_SEQUENCE_ADD(&p_154P112_t.list,
|
||||
cells_to_be_activated_list_itemExtIEs);
|
||||
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
free(gNB_CUSystemInformation);
|
||||
gNB_CUSystemInformation = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *cells_to_be_deactivated_list_item_ies;
|
||||
cells_to_be_deactivated_list_item_ies = (F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Deactivated_List_ItemIEs_t));
|
||||
cells_to_be_deactivated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
|
||||
// ADD
|
||||
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
|
||||
cells_to_be_activated_list_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* 3.1 cells to be Deactivated list item */
|
||||
F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
|
||||
memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
|
||||
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
|
||||
cells_to_be_deactivated_list_item.nRCGI = nRCGI;
|
||||
|
||||
//}
|
||||
/* ADD */
|
||||
cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
|
||||
cells_to_be_deactivated_list_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c4. GNB_CU_TNL_Association_To_Add_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *gnb_cu_tnl_association_to_add_item_ies;
|
||||
gnb_cu_tnl_association_to_add_item_ies = (F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t));
|
||||
gnb_cu_tnl_association_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
|
||||
gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
|
||||
gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
|
||||
|
||||
/* 4.1 GNB_CU_TNL_Association_To_Add_Item */
|
||||
F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item;
|
||||
memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
|
||||
|
||||
|
||||
/* 4.1.1 tNLAssociationTransportLayerAddress */
|
||||
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
|
||||
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
|
||||
|
||||
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
|
||||
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
|
||||
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
|
||||
|
||||
gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
|
||||
|
||||
/* 4.1.2 tNLAssociationUsage */
|
||||
gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
|
||||
|
||||
|
||||
/* ADD */
|
||||
gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
|
||||
gnb_cu_tnl_association_to_add_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c5. GNB_CU_TNL_Association_To_Remove_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *gnb_cu_tnl_association_to_remove_item_ies;
|
||||
gnb_cu_tnl_association_to_remove_item_ies = (F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t));
|
||||
gnb_cu_tnl_association_to_remove_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
|
||||
gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject;
|
||||
gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
|
||||
|
||||
/* 4.1 GNB_CU_TNL_Association_To_Remove_Item */
|
||||
F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item;
|
||||
memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
|
||||
|
||||
|
||||
/* 4.1.1 tNLAssociationTransportLayerAddress */
|
||||
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
|
||||
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
|
||||
|
||||
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
|
||||
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
|
||||
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
|
||||
|
||||
gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
|
||||
|
||||
|
||||
/* ADD */
|
||||
gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
|
||||
gnb_cu_tnl_association_to_remove_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c6. GNB_CU_TNL_Association_To_Update_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *gnb_cu_tnl_association_to_update_item_ies;
|
||||
gnb_cu_tnl_association_to_update_item_ies = (F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t));
|
||||
gnb_cu_tnl_association_to_update_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
|
||||
gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
|
||||
gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
|
||||
|
||||
/* 4.1 GNB_CU_TNL_Association_To_Update_Item */
|
||||
F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
|
||||
memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
|
||||
|
||||
|
||||
/* 4.1.1 tNLAssociationTransportLayerAddress */
|
||||
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
|
||||
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
|
||||
|
||||
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
|
||||
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
|
||||
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
|
||||
|
||||
gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
|
||||
|
||||
|
||||
/* 4.1.2 tNLAssociationUsage */
|
||||
if (1) {
|
||||
gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
|
||||
*gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
|
||||
}
|
||||
|
||||
/* ADD */
|
||||
gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
|
||||
gnb_cu_tnl_association_to_update_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c7. Cells_to_be_Barred_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_Cells_to_be_Barred_ItemIEs_t *cells_to_be_barred_item_ies;
|
||||
cells_to_be_barred_item_ies = (F1AP_Cells_to_be_Barred_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Barred_ItemIEs_t));
|
||||
cells_to_be_barred_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
|
||||
|
||||
/* 7.1 cells to be Deactivated list item */
|
||||
F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
|
||||
memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
|
||||
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI,0,sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
|
||||
cells_to_be_barred_item.nRCGI = nRCGI;
|
||||
|
||||
/* 7.2 cellBarred*/
|
||||
cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
|
||||
|
||||
/* ADD */
|
||||
cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
|
||||
cells_to_be_barred_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
if(!RC.nrrrc) {
|
||||
|
||||
/* mandatory */
|
||||
/* c3. Cells_to_be_Deactivated_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *cells_to_be_deactivated_list_item_ies;
|
||||
cells_to_be_deactivated_list_item_ies = (F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Deactivated_List_ItemIEs_t));
|
||||
cells_to_be_deactivated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
|
||||
|
||||
// 3.1 cells to be Deactivated list item
|
||||
F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
|
||||
memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
|
||||
|
||||
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
|
||||
cells_to_be_deactivated_list_item.nRCGI = nRCGI;
|
||||
|
||||
cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
|
||||
cells_to_be_deactivated_list_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c4. GNB_CU_TNL_Association_To_Add_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *gnb_cu_tnl_association_to_add_item_ies;
|
||||
gnb_cu_tnl_association_to_add_item_ies = (F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t));
|
||||
gnb_cu_tnl_association_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
|
||||
gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
|
||||
gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
|
||||
|
||||
// 4.1 GNB_CU_TNL_Association_To_Add_Item
|
||||
F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item;
|
||||
memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
|
||||
|
||||
|
||||
// 4.1.1 tNLAssociationTransportLayerAddress
|
||||
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
|
||||
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
|
||||
|
||||
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
|
||||
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
|
||||
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
|
||||
|
||||
gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
|
||||
|
||||
// 4.1.2 tNLAssociationUsage
|
||||
gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
|
||||
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c8. Protected_EUTRA_Resources_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
|
||||
gnb_cu_tnl_association_to_add_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
|
||||
/* mandatory */
|
||||
/* c5. GNB_CU_TNL_Association_To_Remove_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
/* 8.1 SpectrumSharingGroupID */
|
||||
protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
|
||||
protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
|
||||
protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
|
||||
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_SpectrumSharingGroupID;
|
||||
protected_eutra_resources_item_ies->value.choice.SpectrumSharingGroupID = 1L;
|
||||
F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *gnb_cu_tnl_association_to_remove_item_ies;
|
||||
gnb_cu_tnl_association_to_remove_item_ies = (F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t));
|
||||
gnb_cu_tnl_association_to_remove_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
|
||||
gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject;
|
||||
gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
|
||||
// 4.1 GNB_CU_TNL_Association_To_Remove_Item
|
||||
F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item;
|
||||
memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
|
||||
|
||||
/* 8.2 ListofEUTRACellsinGNBDUCoordination */
|
||||
protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
|
||||
protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
|
||||
protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
|
||||
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_ListofEUTRACellsinGNBDUCoordination;
|
||||
|
||||
// 4.1.1 tNLAssociationTransportLayerAddress
|
||||
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
|
||||
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
|
||||
|
||||
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
|
||||
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
|
||||
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
|
||||
|
||||
gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
|
||||
|
||||
|
||||
|
||||
gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
|
||||
gnb_cu_tnl_association_to_remove_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c6. GNB_CU_TNL_Association_To_Update_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *gnb_cu_tnl_association_to_update_item_ies;
|
||||
gnb_cu_tnl_association_to_update_item_ies = (F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t));
|
||||
gnb_cu_tnl_association_to_update_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
|
||||
gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
|
||||
gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
|
||||
|
||||
// 4.1 GNB_CU_TNL_Association_To_Update_Item
|
||||
F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
|
||||
memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
|
||||
|
||||
|
||||
// 4.1.1 tNLAssociationTransportLayerAddress
|
||||
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
|
||||
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
|
||||
|
||||
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
|
||||
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
|
||||
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
|
||||
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
|
||||
|
||||
gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
|
||||
|
||||
|
||||
// 4.1.2 tNLAssociationUsage
|
||||
if (1) {
|
||||
gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
|
||||
*gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
|
||||
}
|
||||
|
||||
|
||||
gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
|
||||
gnb_cu_tnl_association_to_update_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c7. Cells_to_be_Barred_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_Cells_to_be_Barred_ItemIEs_t *cells_to_be_barred_item_ies;
|
||||
cells_to_be_barred_item_ies = (F1AP_Cells_to_be_Barred_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Barred_ItemIEs_t));
|
||||
cells_to_be_barred_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
|
||||
|
||||
// 7.1 cells to be Deactivated list item
|
||||
F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
|
||||
memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
|
||||
|
||||
// - nRCGI
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI,0,sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
|
||||
cells_to_be_barred_item.nRCGI = nRCGI;
|
||||
|
||||
// 7.2 cellBarred
|
||||
cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
|
||||
|
||||
cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
|
||||
cells_to_be_barred_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c8. Protected_EUTRA_Resources_List */
|
||||
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
|
||||
F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
|
||||
|
||||
// 8.1 SpectrumSharingGroupID
|
||||
protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
|
||||
protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
|
||||
protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
|
||||
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item;
|
||||
((F1AP_Protected_EUTRA_Resources_Item_t*)&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L;
|
||||
memset(&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item,0,
|
||||
sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
|
||||
|
||||
/*
|
||||
F1AP_Served_EUTRA_Cells_Information_t served_eutra_cells_information;
|
||||
memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
|
||||
|
||||
@@ -870,16 +941,22 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
|
||||
ASN_SEQUENCE_ADD(&protected_eutra_resources_item_ies->value.choice.ListofEUTRACellsinGNBDUCoordination.list, &served_eutra_cells_information);
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
|
||||
*/
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 gNB-CU CONFIGURATION UPDATE\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG_D(F1AP, "F1AP gNB-CU CONFIGURATION UPDATE\n");
|
||||
//for (int i=0;i<len;i++) printf("%02x ",buffer[i]);
|
||||
//printf("\n");
|
||||
|
||||
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -895,7 +972,8 @@ int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
LOG_D(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -85,8 +85,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
/*
|
||||
* gNB-CU Configuration Update
|
||||
*/
|
||||
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP);
|
||||
|
||||
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update);
|
||||
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
|
||||
@@ -38,13 +38,6 @@
|
||||
#include "common/ran_context.h"
|
||||
#include "openair3/UTILS/conversions.h"
|
||||
|
||||
// undefine C_RNTI from
|
||||
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
|
||||
// replaces in ie->value.choice.C_RNTI, causing
|
||||
// a compile error
|
||||
#undef C_RNTI
|
||||
|
||||
|
||||
// Bing Kai: create CU and DU context, and put all the information there.
|
||||
uint64_t du_ue_f1ap_id = 0;
|
||||
uint32_t f1ap_assoc_id = 0;
|
||||
@@ -109,33 +102,67 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
/* RNTI */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_C_RNTI, true);
|
||||
BUFFER_TO_INT16(ie->value.choice.C_RNTI.buf, rnti);
|
||||
rnti = ie->value.choice.C_RNTI;
|
||||
|
||||
/* RRC Container */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_RRCContainer, true);
|
||||
|
||||
AssertFatal(ie!=NULL,"RRCContainer is missing\n");
|
||||
// create an ITTI message and copy SDU
|
||||
message_p = itti_alloc_new_message (TASK_CU_F1, 0, RRC_MAC_CCCH_DATA_IND);
|
||||
memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
|
||||
ccch_sdu_len = ie->value.choice.RRCContainer.size;
|
||||
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
|
||||
ccch_sdu_len);
|
||||
if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
message_p = itti_alloc_new_message (TASK_CU_F1, 0, NR_RRC_MAC_CCCH_DATA_IND);
|
||||
memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
|
||||
ccch_sdu_len = ie->value.choice.RRCContainer.size;
|
||||
memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
|
||||
ccch_sdu_len);
|
||||
} else {
|
||||
message_p = itti_alloc_new_message (TASK_CU_F1, 0, RRC_MAC_CCCH_DATA_IND);
|
||||
memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
|
||||
ccch_sdu_len = ie->value.choice.RRCContainer.size;
|
||||
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
|
||||
ccch_sdu_len);
|
||||
}
|
||||
|
||||
//LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__,
|
||||
// ie->value.choice.RRCContainer.size);
|
||||
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
// printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
|
||||
//printf("\n");
|
||||
if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
|
||||
LOG_D(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, ie->value.choice.RRCContainer.size);
|
||||
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
// printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
|
||||
//printf("\n");
|
||||
|
||||
/* DUtoCURRCContainer */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, true);
|
||||
if (ie) {
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(
|
||||
ie->value.choice.DUtoCURRCContainer.size);
|
||||
memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
|
||||
ie->value.choice.DUtoCURRCContainer.buf,
|
||||
ie->value.choice.DUtoCURRCContainer.size);
|
||||
}
|
||||
}
|
||||
|
||||
// Find instance from nr_cellid
|
||||
int rrc_inst = -1;
|
||||
for (int i=0;i<RC.nb_inst;i++) {
|
||||
if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
for (int i=0;i<RC.nb_nr_inst;i++) {
|
||||
// first get RRC instance (note, no the ITTI instance)
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[i];
|
||||
if (rrc->nr_cellid == nr_cellid) {
|
||||
rrc_inst = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i=0;i<RC.nb_inst;i++) {
|
||||
// first get RRC instance (note, no the ITTI instance)
|
||||
eNB_RRC_INST *rrc = RC.rrc[i];
|
||||
if (rrc->nr_cellid == nr_cellid) {
|
||||
rrc_inst = i;
|
||||
break;
|
||||
eNB_RRC_INST *rrc = RC.rrc[i];
|
||||
if (rrc->nr_cellid == nr_cellid) {
|
||||
rrc_inst = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(rrc_inst>=0,"couldn't find an RRC instance for nr_cell %llu\n",(unsigned long long int)nr_cellid);
|
||||
@@ -148,15 +175,23 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
}
|
||||
f1ap_cu_inst[rrc_inst].f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
|
||||
|
||||
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
|
||||
|
||||
if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).gnb_index = rrc_inst; // CU instance
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
|
||||
itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p);
|
||||
} else {
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -171,7 +206,8 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
f1ap_dl_rrc_message_t *f1ap_dl_rrc)
|
||||
{
|
||||
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
LOG_D(F1AP, "CU send DL_RRC_MESSAGE_TRANSFER \n");
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_DLRRCMessageTransfer_t *out;
|
||||
F1AP_DLRRCMessageTransferIEs_t *ie;
|
||||
|
||||
@@ -252,31 +288,36 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
//LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
|
||||
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
// printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
|
||||
//printf("\n");
|
||||
if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
|
||||
for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c7. RAT_FrequencyPriorityInformation */
|
||||
/* TODO */
|
||||
if (0) {
|
||||
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
|
||||
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP = 123L;
|
||||
|
||||
int endc=1;
|
||||
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
|
||||
if (endc==1) {
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 123L;
|
||||
}
|
||||
else {
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
|
||||
}
|
||||
//ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
|
||||
//ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 DL RRC MESSAGE TRANSFER \n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -299,7 +340,6 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
F1AP_ULRRCMessageTransfer_t *container;
|
||||
F1AP_ULRRCMessageTransferIEs_t *ie;
|
||||
|
||||
|
||||
uint64_t cu_ue_f1ap_id;
|
||||
uint64_t du_ue_f1ap_id;
|
||||
uint64_t srb_id;
|
||||
@@ -348,6 +388,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
// print message in debug mode
|
||||
|
||||
// create an ITTI message and copy SDU
|
||||
|
||||
/*
|
||||
|
||||
message_p = itti_alloc_new_message (TASK_CU_F1, 0, RRC_DCCH_DATA_IND);
|
||||
@@ -370,6 +411,8 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
ctxt.instance = instance;
|
||||
ctxt.rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id);
|
||||
ctxt.enb_flag = 1;
|
||||
ctxt.eNB_index = 0;
|
||||
ctxt.configured = 1;
|
||||
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
|
||||
memcpy((void*)mb->data,(void*)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
|
||||
LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %x srb_id %lu with size %ld (DCCH) \n", ctxt.rnti, srb_id, ie->value.choice.RRCContainer.size);
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "proto_agent.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern uint8_t proto_agent_flag;
|
||||
|
||||
f1ap_setup_req_t *f1ap_du_data_from_du;
|
||||
f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
|
||||
@@ -71,7 +72,12 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
|
||||
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
|
||||
|
||||
/* setup parameters for F1U and start the server */
|
||||
const cudu_params_t params = {
|
||||
const cudu_params_t params = (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_CU) ? (cudu_params_t){
|
||||
.local_ipv4_address = RC.nrrrc[instance]->eth_params_s.my_addr,
|
||||
.local_port = RC.nrrrc[instance]->eth_params_s.my_portd,
|
||||
.remote_ipv4_address = RC.nrrrc[instance]->eth_params_s.remote_addr,
|
||||
.remote_port = RC.nrrrc[instance]->eth_params_s.remote_portd
|
||||
} : (cudu_params_t){
|
||||
.local_ipv4_address = RC.rrc[instance]->eth_params_s.my_addr,
|
||||
.local_port = RC.rrc[instance]->eth_params_s.my_portd,
|
||||
.remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr,
|
||||
@@ -79,6 +85,7 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
|
||||
};
|
||||
AssertFatal(proto_agent_start(instance, ¶ms) == 0,
|
||||
"could not start PROTO_AGENT for F1U on instance %ld!\n", instance);
|
||||
proto_agent_flag = 1;
|
||||
}
|
||||
|
||||
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
|
||||
@@ -107,7 +114,11 @@ void cu_task_send_sctp_init_req(instance_t enb_id) {
|
||||
message_p->ittiMsg.sctp_init.ipv4 = 1;
|
||||
message_p->ittiMsg.sctp_init.ipv6 = 0;
|
||||
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
|
||||
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.rrc[enb_id]->eth_params_s.my_addr);
|
||||
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
|
||||
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.nrrrc[enb_id]->eth_params_s.my_addr);
|
||||
} else{
|
||||
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.rrc[enb_id]->eth_params_s.my_addr);
|
||||
}
|
||||
/*
|
||||
* SR WARNING: ipv6 multi-homing fails sometimes for localhost.
|
||||
* * * * Disable it for now.
|
||||
@@ -166,13 +177,27 @@ void *F1AP_CU_task(void *arg) {
|
||||
&F1AP_SETUP_RESP(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_DL_RRC_MESSAGE: // from rrc
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc
|
||||
LOG_I(F1AP, "CU Task Received F1AP_GNB_CU_CONFIGURAITON_UPDATE\n");
|
||||
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &F1AP_SETUP_RESP(received_msg));
|
||||
CU_send_gNB_CU_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_DL_RRC_MESSAGE: // from rrc
|
||||
LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
|
||||
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_DL_RRC_MESSAGE(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
|
||||
case F1AP_UE_CONTEXT_SETUP_REQ: // from rrc
|
||||
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_SETUP_REQ\n");
|
||||
CU_send_UE_CONTEXT_SETUP_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
|
||||
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_RELEASE_CMD\n");
|
||||
CU_send_UE_CONTEXT_RELEASE_COMMAND(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UE_CONTEXT_RELEASE_CMD(received_msg));
|
||||
|
||||
@@ -39,12 +39,15 @@
|
||||
|
||||
#include "rrc_extern.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
#include "rrc_eNB_S1AP.h"
|
||||
#include "rrc_eNB_GTPV1U.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data_from_du;
|
||||
extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern uint32_t f1ap_assoc_id;
|
||||
|
||||
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req) {
|
||||
@@ -108,7 +111,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
/* mandatory */
|
||||
/* c4. ServCellIndex */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ServCellndex;
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ServCellIndex;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex;
|
||||
ie->value.choice.ServCellIndex = 2;
|
||||
@@ -263,7 +266,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
f1ap_ue_context_setup_req->mnc,
|
||||
f1ap_ue_context_setup_req->mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
|
||||
NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
|
||||
scell_toBeSetup_item.sCell_ID = nRCGI;
|
||||
|
||||
/* 10.1.2 sCellIndex */
|
||||
@@ -379,75 +382,86 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
}
|
||||
|
||||
} else {
|
||||
/* 12.1.2 dRB_Information */
|
||||
drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_dRB_Information;
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information = (F1AP_DRB_Information_t *)calloc(1, sizeof(F1AP_DRB_Information_t));
|
||||
|
||||
/* 12.1.2 DRB_Information */
|
||||
drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_choice_extension;
|
||||
|
||||
F1AP_QoSInformation_ExtIEs_t *ie;
|
||||
ie = (F1AP_QoSInformation_ExtIEs_t *)calloc(1, sizeof(F1AP_QoS_Characteristics_ExtIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DRB_Information;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_QoSInformation_ExtIEs__value_PR_DRB_Information;
|
||||
F1AP_DRB_Information_t *DRB_Information = &ie->value.choice.DRB_Information;
|
||||
|
||||
drbs_toBeSetup_item.qoSInformation.choice.choice_extension = (struct F1AP_ProtocolIE_SingleContainer*)ie;
|
||||
|
||||
|
||||
/* 12.1.2.1 dRB_QoS */
|
||||
{
|
||||
/* qoS_Characteristics */
|
||||
{
|
||||
int some_decide_qoS_characteristics = 1; // BK: Need Check
|
||||
if (some_decide_qoS_characteristics) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI = (F1AP_NonDynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_NonDynamic5QIDescriptor_t));
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI = (F1AP_NonDynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_NonDynamic5QIDescriptor_t));
|
||||
|
||||
/* fiveQI */
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI = 1L;
|
||||
|
||||
/* OPTIONAL */
|
||||
/* qoSPriorityLevel */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = (long *)calloc(1, sizeof(long));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = (long *)calloc(1, sizeof(long));
|
||||
*DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = 1L;
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
/* averagingWindow */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
|
||||
*DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = 1L;
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
/* maxDataBurstVolume */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
|
||||
*DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = 1L;
|
||||
}
|
||||
|
||||
} else {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI = (F1AP_Dynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_Dynamic5QIDescriptor_t));
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI = (F1AP_Dynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_Dynamic5QIDescriptor_t));
|
||||
|
||||
/* qoSPriorityLevel */
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->qoSPriorityLevel = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->qoSPriorityLevel = 1L;
|
||||
|
||||
/* packetDelayBudget */
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetDelayBudget = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetDelayBudget = 1L;
|
||||
|
||||
/* packetErrorRate */
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Scalar = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Exponent = 6L;
|
||||
|
||||
|
||||
/* OPTIONAL */
|
||||
/* delayCritical */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical = (long *)calloc(1, sizeof(long));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical = (long *)calloc(1, sizeof(long));
|
||||
*DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical = 1L;
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
/* averagingWindow */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
|
||||
*DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = 1L;
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
/* maxDataBurstVolume */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = 1L;
|
||||
DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
|
||||
*DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = 1L;
|
||||
}
|
||||
|
||||
} // if some_decide_qoS_characteristics
|
||||
@@ -456,32 +470,32 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
|
||||
/* nGRANallocationRetentionPriority */
|
||||
{
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
|
||||
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
|
||||
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
|
||||
DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
|
||||
} // nGRANallocationRetentionPriority
|
||||
|
||||
/* OPTIONAL */
|
||||
/* gBR_QoS_Flow_Information */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information = (F1AP_GBR_QoSFlowInformation_t *)calloc(1, sizeof(F1AP_GBR_QoSFlowInformation_t));
|
||||
asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateDownlink, 1L);
|
||||
asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateUplink, 1L);
|
||||
asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink, 1L);
|
||||
asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink, 1L);
|
||||
DRB_Information->dRB_QoS.gBR_QoS_Flow_Information = (F1AP_GBR_QoSFlowInformation_t *)calloc(1, sizeof(F1AP_GBR_QoSFlowInformation_t));
|
||||
asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateDownlink, 1L);
|
||||
asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateUplink, 1L);
|
||||
asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink, 1L);
|
||||
asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink, 1L);
|
||||
|
||||
/* OPTIONAL */
|
||||
/* maxPacketLossRateDownlink */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = 1L;
|
||||
DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
|
||||
*DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = 1L;
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
/* maxPacketLossRateUplink */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = 1L;
|
||||
DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
|
||||
*DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = 1L;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -489,8 +503,8 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
/* OPTIONAL */
|
||||
/* reflective_QoS_Attribute */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.reflective_QoS_Attribute = (long *)calloc(1, sizeof(long));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->dRB_QoS.reflective_QoS_Attribute = 1L;
|
||||
DRB_Information->dRB_QoS.reflective_QoS_Attribute = (long *)calloc(1, sizeof(long));
|
||||
*DRB_Information->dRB_QoS.reflective_QoS_Attribute = 1L;
|
||||
}
|
||||
|
||||
} // dRB_QoS
|
||||
@@ -498,21 +512,21 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
/* 12.1.2.2 sNSSAI */
|
||||
{
|
||||
/* sST */
|
||||
OCTET_STRING_fromBuf(&drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->sNSSAI.sST, "asdsa1d32sa1d31asd31as",
|
||||
OCTET_STRING_fromBuf(&DRB_Information->sNSSAI.sST, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
/* OPTIONAL */
|
||||
/* sD */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->sNSSAI.sD = (OCTET_STRING_t *)calloc(1, sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->sNSSAI.sD, "asdsa1d32sa1d31asd31as",
|
||||
DRB_Information->sNSSAI.sD = (OCTET_STRING_t *)calloc(1, sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(DRB_Information->sNSSAI.sD, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
}
|
||||
}
|
||||
/* OPTIONAL */
|
||||
/* 12.1.2.3 notificationControl */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->notificationControl = (F1AP_NotificationControl_t *)calloc(1, sizeof(F1AP_NotificationControl_t));
|
||||
*drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->notificationControl = F1AP_NotificationControl_active; // enum
|
||||
DRB_Information->notificationControl = (F1AP_NotificationControl_t *)calloc(1, sizeof(F1AP_NotificationControl_t));
|
||||
*DRB_Information->notificationControl = F1AP_NotificationControl_active; // enum
|
||||
}
|
||||
|
||||
/* 12.1.2.4 flows_Mapped_To_DRB_List */ // BK: need verifiy
|
||||
@@ -523,7 +537,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
memset((void *)&flows_mapped_to_drb_item, 0, sizeof(F1AP_Flows_Mapped_To_DRB_Item_t));
|
||||
|
||||
/* qoSFlowIndicator */
|
||||
flows_mapped_to_drb_item.qoSFlowIndicator = 1L;
|
||||
flows_mapped_to_drb_item.qoSFlowIdentifier = 1L;
|
||||
|
||||
/* qoSFlowLevelQoSParameters */
|
||||
{
|
||||
@@ -569,9 +583,10 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetDelayBudget = 1L;
|
||||
|
||||
/* packetErrorRate */
|
||||
flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate = 1L;
|
||||
flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Scalar = 1L;
|
||||
flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Exponent = 6L;
|
||||
|
||||
/* OPTIONAL */
|
||||
/* OPTIONAL */
|
||||
/* delayCritical */
|
||||
if (0) {
|
||||
flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->delayCritical = (long *)calloc(1, sizeof(long));
|
||||
@@ -637,7 +652,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
|
||||
} // qoSFlowLevelQoSParameters
|
||||
// BK: need check
|
||||
ASN_SEQUENCE_ADD(&drbs_toBeSetup_item.qoSInformation.choice.dRB_Information->flows_Mapped_To_DRB_List.list, &flows_mapped_to_drb_item);
|
||||
ASN_SEQUENCE_ADD(&DRB_Information->flows_Mapped_To_DRB_List.list, &flows_mapped_to_drb_item);
|
||||
}
|
||||
|
||||
} // if some_decide_qos
|
||||
@@ -672,7 +687,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
drbs_toBeSetup_item.rLCMode = F1AP_RLCMode_rlc_am;
|
||||
break;
|
||||
default:
|
||||
drbs_toBeSetup_item.rLCMode = F1AP_RLCMode_rlc_um;
|
||||
drbs_toBeSetup_item.rLCMode = F1AP_RLCMode_rlc_um_bidirectional;
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
@@ -716,26 +731,26 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RAT_FrequencyPriorityInformation;
|
||||
|
||||
int some_decide_rat = 1; // BK: Need Check
|
||||
if (some_decide_rat) {
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP = 11L;
|
||||
int endc = 1; // RK: Get this from somewhere ...
|
||||
if (endc) {
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 11L;
|
||||
} else {
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 11L;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
/* RRCContainer */
|
||||
if (0) {
|
||||
if(RC.nrrrc) {
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer;
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_ue_context_setup_req->rrc_container,
|
||||
f1ap_ue_context_setup_req->rrc_container_length);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
@@ -752,10 +767,28 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT SETUP REQUEST\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, (void *)pdu);
|
||||
|
||||
// asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
|
||||
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
// buffer = res.buffer;
|
||||
// len = res.result.encoded;
|
||||
|
||||
// if (res.result.encoded <= 0) {
|
||||
// LOG_E(F1AP, "ASN1 message encoding failed (%s, %lu)!\n", res.result.failed_type->name, res.result.encoded);
|
||||
// return -1;
|
||||
// }
|
||||
|
||||
LOG_D(F1AP,"F1AP UEContextSetupRequest Encoded %u bits\n", len);
|
||||
|
||||
if(RC.nrrrc) {
|
||||
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -763,7 +796,42 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
F1AP_UEContextSetupResponse_t *container;
|
||||
F1AP_UEContextSetupResponseIEs_t *ie;
|
||||
|
||||
DevAssert(pdu);
|
||||
|
||||
container = &pdu->choice.successfulOutcome->value.choice.UEContextSetupResponse;
|
||||
|
||||
/* GNB_CU_UE_F1AP_ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
|
||||
|
||||
/* GNB_DU_UE_F1AP_ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
|
||||
|
||||
/* DUtoCURRCInformation */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation, true);
|
||||
|
||||
/* DRBs_Setup_List */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_DRBs_Setup_List, true);
|
||||
|
||||
/* SRBs_FailedToBeSetup_List */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List, true);
|
||||
|
||||
/* DRBs_FailedToBeSetup_List */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List, true);
|
||||
|
||||
/* SCell_FailedtoSetup_List */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List, true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
|
||||
@@ -963,35 +1031,55 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
|
||||
// F1AP_CriticalityDiagnostics_IE_List
|
||||
}
|
||||
|
||||
struct rrc_eNB_ue_context_s *ue_context_p =
|
||||
rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, instance, ENB_FLAG_YES, rnti, 0, 0, instance);
|
||||
|
||||
if (ue_context_p) {
|
||||
/* The following is normally done in the function rrc_rx_tx() */
|
||||
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance,
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id);
|
||||
if (RC.nrrrc[instance]->node_type == ngran_gNB_CU) {
|
||||
struct rrc_gNB_ue_context_s *ue_context_p =
|
||||
rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti);
|
||||
|
||||
rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p);
|
||||
// erase data of GTP tunnels in UE context
|
||||
for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
|
||||
memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab],
|
||||
0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab]));
|
||||
ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0;
|
||||
if (ue_context_p) {
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_CU_F1, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = ue_context_p->ue_context.gNB_ue_ngap_id;
|
||||
itti_send_msg_to_task(TASK_NGAP, instance, msg);
|
||||
|
||||
rrc_gNB_remove_ue_context(&ctxt, RC.nrrrc[instance], ue_context_p);
|
||||
} else {
|
||||
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
|
||||
}
|
||||
#ifdef ITTI_SIM
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids =
|
||||
rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0,
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id);
|
||||
if (rrc_ue_s1ap_ids)
|
||||
rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids);
|
||||
|
||||
/* trigger UE release in RRC */
|
||||
rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p);
|
||||
} else {
|
||||
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
|
||||
struct rrc_eNB_ue_context_s *ue_context_p =
|
||||
rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
|
||||
|
||||
if (ue_context_p) {
|
||||
/* The following is normally done in the function rrc_rx_tx() */
|
||||
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance,
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id);
|
||||
|
||||
rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p);
|
||||
// erase data of GTP tunnels in UE context
|
||||
for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
|
||||
memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab],
|
||||
0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab]));
|
||||
ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0;
|
||||
}
|
||||
|
||||
struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids =
|
||||
rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0,
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id);
|
||||
if (rrc_ue_s1ap_ids)
|
||||
rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids);
|
||||
|
||||
/* trigger UE release in RRC */
|
||||
rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p);
|
||||
} else {
|
||||
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
|
||||
}
|
||||
}
|
||||
|
||||
pdcp_remove_UE(&ctxt);
|
||||
@@ -1019,8 +1107,8 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
|
||||
// for test
|
||||
int mcc = 208;
|
||||
int mnc = 93;
|
||||
int mnc_digit_length = 8;
|
||||
int mnc = 92;
|
||||
int mnc_digit_length = 2;
|
||||
|
||||
/* Create */
|
||||
/* 0. Message Type */
|
||||
@@ -1061,7 +1149,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
|
||||
NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
|
||||
ie->value.choice.NRCGI = nRCGI;
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
@@ -1070,7 +1158,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
/* mandatory */
|
||||
/* c4. ServCellIndex */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ServCellndex;
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ServCellIndex;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ServCellIndex;
|
||||
ie->value.choice.ServCellIndex = 5L;
|
||||
@@ -1114,13 +1202,13 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c6. TransmissionStopIndicator */
|
||||
/* c6. TransmissionActionIndicator */
|
||||
if (1) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransmissionStopIndicator;
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransmissionActionIndicator;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_TransmissionStopIndicator;
|
||||
ie->value.choice.TransmissionStopIndicator = F1AP_TransmissionStopIndicator_true;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_TransmissionActionIndicator;
|
||||
ie->value.choice.TransmissionActionIndicator = F1AP_TransmissionActionIndicator_stop;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
@@ -1140,10 +1228,10 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
/* c7. RRCRconfigurationCompleteIndicator */
|
||||
if (1) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RRCRconfigurationCompleteIndicator;
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RRCReconfigurationCompleteIndicator;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCRconfigurationCompleteIndicator;
|
||||
ie->value.choice.RRCRconfigurationCompleteIndicator = F1AP_RRCRconfigurationCompleteIndicator_true;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCReconfigurationCompleteIndicator;
|
||||
ie->value.choice.RRCReconfigurationCompleteIndicator = F1AP_RRCReconfigurationCompleteIndicator_true;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
@@ -1186,7 +1274,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
|
||||
NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
|
||||
scell_toBeSetupMod_item.sCell_ID = nRCGI;
|
||||
|
||||
/* sCellIndex */
|
||||
@@ -1226,7 +1314,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
|
||||
NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
|
||||
scell_toBeRemoved_item.sCell_ID = nRCGI;
|
||||
|
||||
/* ADD */
|
||||
@@ -1325,7 +1413,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
}
|
||||
|
||||
/* rLCMode */
|
||||
drbs_toBeSetupMod_item.rLCMode = F1AP_RLCMode_rlc_um; // enum
|
||||
drbs_toBeSetupMod_item.rLCMode = F1AP_RLCMode_rlc_um_bidirectional; // enum
|
||||
|
||||
/* OPTIONAL */
|
||||
/* ULConfiguration */
|
||||
@@ -1366,9 +1454,10 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
drbs_toBeModified_item.dRBID = 30L;
|
||||
|
||||
/* qoSInformation */
|
||||
drbs_toBeModified_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
|
||||
drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
|
||||
drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS->qCI = 254L;
|
||||
drbs_toBeModified_item.qoSInformation =calloc(1,sizeof(*drbs_toBeModified_item.qoSInformation));
|
||||
drbs_toBeModified_item.qoSInformation->present = F1AP_QoSInformation_PR_eUTRANQoS;
|
||||
drbs_toBeModified_item.qoSInformation->choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
|
||||
drbs_toBeModified_item.qoSInformation->choice.eUTRANQoS->qCI = 254L;
|
||||
|
||||
/* ULTunnels_ToBeModified_List */
|
||||
int j = 0;
|
||||
@@ -1472,7 +1561,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT_MODIFICATION REQUEST\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_gNBCUConfigurationUpdate:
|
||||
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer:
|
||||
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_InitialULRRCMessageTransfer\n", __func__);
|
||||
@@ -69,6 +74,9 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
|
||||
case F1AP_ProcedureCode_id_UEContextReleaseRequest:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextReleaseRequest\n", __func__);
|
||||
break;
|
||||
case F1AP_ProcedureCode_id_UEContextSetup:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
|
||||
break;
|
||||
// case F1AP_ProcedureCode_id_InitialContextSetup:
|
||||
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
// message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
|
||||
@@ -102,6 +110,10 @@ static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu)
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_gNBCUConfigurationUpdate:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_UEContextRelease:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__);
|
||||
break;
|
||||
@@ -157,7 +169,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
|
||||
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
|
||||
|
||||
if (dec_ret.code != RC_OK) {
|
||||
LOG_E(F1AP, "Failed to decode pdu\n");
|
||||
AssertFatal(1==0,"Failed to decode pdu\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,18 @@
|
||||
#include "assertions.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int nrb_lut[29] = {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};
|
||||
|
||||
int to_NRNRB(int nrb) {
|
||||
if (RC.nrrrc) {
|
||||
for (int i=0;i<29;i++) if (nrb_lut[i] == nrb) return i;
|
||||
AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n",nrb);
|
||||
} else {
|
||||
return nrb;
|
||||
}
|
||||
}
|
||||
|
||||
int DU_handle_RESET(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
@@ -95,7 +106,6 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
/* Create */
|
||||
/* 0. pdu Type */
|
||||
@@ -189,9 +199,19 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
|
||||
|
||||
/* - fiveGS_TAC */
|
||||
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
|
||||
(const char*)&f1ap_du_data->tac[i],
|
||||
3);
|
||||
if (RC.nrrrc) {
|
||||
uint8_t fiveGS_TAC[3];
|
||||
fiveGS_TAC[0] = ((uint8_t*)&f1ap_du_data->tac[i])[2];
|
||||
fiveGS_TAC[1] = ((uint8_t*)&f1ap_du_data->tac[i])[1];
|
||||
fiveGS_TAC[2] = ((uint8_t*)&f1ap_du_data->tac[i])[0];
|
||||
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
|
||||
(const char *)fiveGS_TAC,
|
||||
3);
|
||||
} else {
|
||||
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
|
||||
(const char*)&f1ap_du_data->tac[i],
|
||||
3);
|
||||
}
|
||||
|
||||
/* - Configured_EPS_TAC */
|
||||
if(0){
|
||||
@@ -201,19 +221,11 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
2);
|
||||
}
|
||||
|
||||
/* - broadcast PLMNs */
|
||||
// RK: add the num_available_broadcast_PLMNs to the message
|
||||
int num_available_broadcast_PLMNs = 1; //f1ap_du_data->num_available_broadcast_PLMNs;
|
||||
LOG_D(F1AP, "num_available_broadcast_PLMNs = %d \n", num_available_broadcast_PLMNs);
|
||||
for (j=0;
|
||||
j<num_available_broadcast_PLMNs; // num_available_broadcast_PLMNs
|
||||
j++) {
|
||||
/* > PLMN BroadcastPLMNs Item */
|
||||
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
//MCC_MNC_TO_PLMNID(208, 95, 2, &broadcastPLMNs_Item->pLMN_Identity);
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
|
||||
}
|
||||
/* servedPLMN information */
|
||||
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
|
||||
memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
|
||||
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
@@ -237,7 +249,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
|
||||
/* FDD.1.3 freqBandListNr */
|
||||
int fdd_ul_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_frequency_bands;
|
||||
LOG_D(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
|
||||
LOG_I(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
|
||||
int fdd_ul_j;
|
||||
for (fdd_ul_j=0;
|
||||
fdd_ul_j<fdd_ul_num_available_freq_Bands;
|
||||
@@ -279,7 +291,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
|
||||
/* FDD.2.3 freqBandListNr */
|
||||
int fdd_dl_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_frequency_bands;
|
||||
LOG_D(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
|
||||
LOG_I(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
|
||||
int fdd_dl_j;
|
||||
for (fdd_dl_j=0;
|
||||
fdd_dl_j<fdd_dl_num_available_freq_Bands;
|
||||
@@ -308,10 +320,10 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
|
||||
/* FDD.3 UL Transmission Bandwidth */
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs;
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.ul_nrb;
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.ul_nrb);
|
||||
/* FDD.4 DL Transmission Bandwidth */
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs;
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.dl_nrb;
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.dl_nrb);
|
||||
|
||||
nR_Mode_Info.choice.fDD = fDD_Info;
|
||||
} else { // TDD
|
||||
@@ -333,7 +345,8 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
|
||||
/* TDD.1.3 freqBandListNr */
|
||||
int tdd_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].tdd.num_frequency_bands;
|
||||
LOG_D(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
|
||||
LOG_I(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
|
||||
AssertFatal(tdd_num_available_freq_Bands > 0, "should have at least one TDD band available\n");
|
||||
int j;
|
||||
for (j=0;
|
||||
j<tdd_num_available_freq_Bands;
|
||||
@@ -362,7 +375,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
|
||||
/* TDD.2 transmission_Bandwidth */
|
||||
tDD_Info->transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].tdd.scs;
|
||||
tDD_Info->transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].tdd.nrb;
|
||||
tDD_Info->transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].tdd.nrb);
|
||||
|
||||
nR_Mode_Info.choice.tDD = tDD_Info;
|
||||
} // if nR_Mode_Info
|
||||
@@ -384,6 +397,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
(const char*)f1ap_du_data->mib[i],//f1ap_du_data->mib,
|
||||
f1ap_du_data->mib_length[i]);
|
||||
|
||||
LOG_D(F1AP,"Filling SIB1_message for cell %d, length %d\n",i,f1ap_du_data->sib1_length[i]);
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
|
||||
(const char*)f1ap_du_data->sib1[i],
|
||||
f1ap_du_data->sib1_length[i]);
|
||||
@@ -399,6 +413,20 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c5. RRC VERSION */
|
||||
if(RC.nrrrc) {
|
||||
ie = (F1AP_F1SetupRequestIEs_t *) calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
|
||||
ie->value.choice.RRC_Version.latest_RRC_Version.buf = calloc(1, sizeof(char));
|
||||
ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
|
||||
ie->value.choice.RRC_Version.latest_RRC_Version.size = 1;
|
||||
ie->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
@@ -425,126 +453,175 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
|
||||
F1AP_F1AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
LOG_D(F1AP, "DU_handle_F1_SETUP_RESPONSE\n");
|
||||
LOG_D(F1AP, "DU_handle_F1_SETUP_RESPONSE\n");
|
||||
|
||||
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_successfulOutcome,
|
||||
"pdu->present != F1AP_F1AP_PDU_PR_successfulOutcome\n");
|
||||
AssertFatal(pdu->choice.successfulOutcome->procedureCode == F1AP_ProcedureCode_id_F1Setup,
|
||||
"pdu->choice.successfulOutcome->procedureCode != F1AP_ProcedureCode_id_F1Setup\n");
|
||||
AssertFatal(pdu->choice.successfulOutcome->criticality == F1AP_Criticality_reject,
|
||||
"pdu->choice.successfulOutcome->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(pdu->choice.successfulOutcome->value.present == F1AP_SuccessfulOutcome__value_PR_F1SetupResponse,
|
||||
"pdu->choice.successfulOutcome->value.present != F1AP_SuccessfulOutcome__value_PR_F1SetupResponse\n");
|
||||
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_successfulOutcome,
|
||||
"pdu->present != F1AP_F1AP_PDU_PR_successfulOutcome\n");
|
||||
AssertFatal(pdu->choice.successfulOutcome->procedureCode == F1AP_ProcedureCode_id_F1Setup,
|
||||
"pdu->choice.successfulOutcome->procedureCode != F1AP_ProcedureCode_id_F1Setup\n");
|
||||
AssertFatal(pdu->choice.successfulOutcome->criticality == F1AP_Criticality_reject,
|
||||
"pdu->choice.successfulOutcome->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(pdu->choice.successfulOutcome->value.present == F1AP_SuccessfulOutcome__value_PR_F1SetupResponse,
|
||||
"pdu->choice.successfulOutcome->value.present != F1AP_SuccessfulOutcome__value_PR_F1SetupResponse\n");
|
||||
|
||||
F1AP_F1SetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.F1SetupResponse;
|
||||
F1AP_F1SetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.F1SetupResponse;
|
||||
|
||||
|
||||
F1AP_F1SetupResponseIEs_t *ie;
|
||||
int TransactionId = -1;
|
||||
int num_cells_to_activate = 0;
|
||||
F1AP_Cells_to_be_Activated_List_Item_t *cell;
|
||||
F1AP_F1SetupResponseIEs_t *ie;
|
||||
int TransactionId = -1;
|
||||
int num_cells_to_activate = 0;
|
||||
F1AP_Cells_to_be_Activated_List_Item_t *cell;
|
||||
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_SETUP_RESP);
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_SETUP_RESP);
|
||||
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp: protocolIEs.list.count %d\n",
|
||||
in->protocolIEs.list.count);
|
||||
for (int i=0;i < in->protocolIEs.list.count; i++) {
|
||||
ie = in->protocolIEs.list.array[i];
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_reject,
|
||||
"ie->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_TransactionID,
|
||||
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
|
||||
TransactionId=ie->value.choice.TransactionID;
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp: TransactionId %d\n",
|
||||
TransactionId);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_Name:
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_ignore,
|
||||
"ie->criticality != F1AP_Criticality_ignore\n");
|
||||
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name,
|
||||
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
|
||||
F1AP_SETUP_RESP (msg_p).gNB_CU_name = malloc(ie->value.choice.GNB_CU_Name.size+1);
|
||||
memcpy(F1AP_SETUP_RESP (msg_p).gNB_CU_name,ie->value.choice.GNB_CU_Name.buf,ie->value.choice.GNB_CU_Name.size);
|
||||
F1AP_SETUP_RESP (msg_p).gNB_CU_name[ie->value.choice.GNB_CU_Name.size]='\0';
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp: gNB_CU_name %s\n",
|
||||
F1AP_SETUP_RESP (msg_p).gNB_CU_name);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List:
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_reject,
|
||||
"ie->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List,
|
||||
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List\n");
|
||||
num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count;
|
||||
LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate);
|
||||
for (int i=0;i<num_cells_to_activate;i++) {
|
||||
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i];
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp: protocolIEs.list.count %d\n",
|
||||
in->protocolIEs.list.count);
|
||||
for (int i=0;i < in->protocolIEs.list.count; i++) {
|
||||
ie = in->protocolIEs.list.array[i];
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_reject,
|
||||
"ie->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_TransactionID,
|
||||
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
|
||||
TransactionId=ie->value.choice.TransactionID;
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp: TransactionId %d\n",
|
||||
TransactionId);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_Name:
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_ignore,
|
||||
"ie->criticality != F1AP_Criticality_ignore\n");
|
||||
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name,
|
||||
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
|
||||
F1AP_SETUP_RESP (msg_p).gNB_CU_name = malloc(ie->value.choice.GNB_CU_Name.size+1);
|
||||
memcpy(F1AP_SETUP_RESP (msg_p).gNB_CU_name,ie->value.choice.GNB_CU_Name.buf,ie->value.choice.GNB_CU_Name.size);
|
||||
F1AP_SETUP_RESP (msg_p).gNB_CU_name[ie->value.choice.GNB_CU_Name.size]='\0';
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp: gNB_CU_name %s\n",
|
||||
F1AP_SETUP_RESP (msg_p).gNB_CU_name);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_GNB_CU_RRC_Version:
|
||||
LOG_D(F1AP, "F1AP: Received GNB-CU-RRC-Version, ignoring\n");
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List:
|
||||
{
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_reject,
|
||||
"ie->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List,
|
||||
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List\n");
|
||||
num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count;
|
||||
LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate);
|
||||
for (int i=0;i<num_cells_to_activate;i++) {
|
||||
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item,
|
||||
"cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject,
|
||||
"cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item,
|
||||
"cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i];
|
||||
|
||||
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item,
|
||||
"cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject,
|
||||
"cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item,
|
||||
"cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
|
||||
|
||||
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).mcc[i], F1AP_SETUP_RESP (msg_p).mnc[i], F1AP_SETUP_RESP (msg_p).mnc_digit_length[i]);
|
||||
AssertFatal(cell->nRPCI != NULL, "nRPCI is null\n");
|
||||
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
|
||||
cell->nRCGI.nRCellIdentity.buf[0],
|
||||
cell->nRCGI.nRCellIdentity.buf[1],
|
||||
cell->nRCGI.nRCellIdentity.buf[2],
|
||||
cell->nRCGI.nRCellIdentity.buf[3],
|
||||
cell->nRCGI.nRCellIdentity.buf[4]);
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
|
||||
F1AP_SETUP_RESP (msg_p).nr_cellid[i]);
|
||||
F1AP_SETUP_RESP (msg_p).nrpci[i] = *cell->nRPCI;
|
||||
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
|
||||
|
||||
F1AP_ProtocolExtensionContainer_160P9_t *ext = (F1AP_ProtocolExtensionContainer_160P9_t *)cell->iE_Extensions;
|
||||
AssertFatal(ext!=NULL,"Extension for SI is null\n");
|
||||
F1AP_SETUP_RESP (msg_p).num_SI[i] = ext->list.count;
|
||||
AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n");
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n",
|
||||
i, F1AP_SETUP_RESP (msg_p).mcc[i], F1AP_SETUP_RESP (msg_p).mnc[i],
|
||||
F1AP_SETUP_RESP (msg_p).nr_cellid[i], F1AP_SETUP_RESP (msg_p).num_SI[i]);
|
||||
for (int si =0;si < ext->list.count;si++) {
|
||||
size_t size = ext->list.array[si]->extensionValue.choice.GNB_CUSystemInformation.sImessage.size;
|
||||
F1AP_SETUP_RESP (msg_p).SI_container_length[i][si] = size;
|
||||
LOG_D(F1AP, "F1AP: F1Setup-Resp SI_container_length[%d][%d] %ld bytes\n", i, si, size);
|
||||
F1AP_SETUP_RESP (msg_p).SI_container[i][si] = malloc(F1AP_SETUP_RESP (msg_p).SI_container_length[i][si]);
|
||||
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc_digit_length);
|
||||
|
||||
memcpy((void*)F1AP_SETUP_RESP (msg_p).SI_container[i][si],
|
||||
(void*)ext->list.array[si]->extensionValue.choice.GNB_CUSystemInformation.sImessage.buf,
|
||||
F1AP_SETUP_RESP (msg_p).SI_container_length[i][si]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
|
||||
AssertFatal(num_cells_to_activate>0,"No cells activated\n");
|
||||
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = num_cells_to_activate;
|
||||
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
|
||||
cell->nRCGI.nRCellIdentity.buf[0],
|
||||
cell->nRCGI.nRCellIdentity.buf[1],
|
||||
cell->nRCGI.nRCellIdentity.buf[2],
|
||||
cell->nRCGI.nRCellIdentity.buf[3],
|
||||
cell->nRCGI.nRCellIdentity.buf[4]);
|
||||
|
||||
for (int i=0;i<num_cells_to_activate;i++)
|
||||
AssertFatal(F1AP_SETUP_RESP (msg_p).num_SI[i] > 0, "System Information %d is missing",i);
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid);
|
||||
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_F1AP_DU,
|
||||
MSC_F1AP_CU,
|
||||
0,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
assoc_id);
|
||||
|
||||
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
if (ext==NULL) continue;
|
||||
|
||||
for (int cnt=0;cnt<ext->list.count;cnt++) {
|
||||
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt];
|
||||
switch (cells_to_be_activated_list_itemExtIEs->id) {
|
||||
/*
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_NOTHING:
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailablePLMNList,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_ExtendedAvailablePLMN_List,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_IAB_Info_IAB_donor_CU,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailableSNPN_ID_List
|
||||
*/
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation:
|
||||
{
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nrpci = (cell->nRPCI != NULL) ? *cell->nRPCI : 0;
|
||||
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t*)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;
|
||||
AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n");
|
||||
LOG_D(F1AP, "F1AP: Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n",
|
||||
i, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc,
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI);
|
||||
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
|
||||
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
|
||||
size_t size = sib_item->sIBmessage.size;
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[sib_item->sIBtype] = size;
|
||||
LOG_I(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype] = malloc(size);
|
||||
memcpy((void*)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype],
|
||||
(void*)sib_item->sIBmessage.buf,
|
||||
size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case F1AP_ProtocolIE_ID_id_AvailablePLMNList:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_ExtendedAvailablePLMN_List:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_IAB_Info_IAB_donor_CU:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_AvailableSNPN_ID_List:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n",(int)cells_to_be_activated_list_itemExtIEs->id);
|
||||
break;
|
||||
}
|
||||
} // for (cnt=...
|
||||
} // for (cells_to_activate...
|
||||
break;
|
||||
} // case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n", (int)ie->id);
|
||||
break;
|
||||
} // switch ie
|
||||
} // for IE
|
||||
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
|
||||
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = num_cells_to_activate;
|
||||
|
||||
for (int i=0;i<num_cells_to_activate;i++)
|
||||
AssertFatal(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI > 0, "System Information %d is missing",i);
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_F1AP_DU,
|
||||
MSC_F1AP_CU,
|
||||
0,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
assoc_id);
|
||||
|
||||
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
|
||||
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to GNB_APP with assoc_id (%d->%d)\n",
|
||||
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
|
||||
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
|
||||
} else {
|
||||
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
itti_send_msg_to_task(TASK_ENB_APP, instance, msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SETUP FAILURE
|
||||
@@ -553,6 +630,26 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
LOG_E(F1AP, "DU_handle_F1_SETUP_FAILURE\n");
|
||||
|
||||
F1AP_F1SetupFailure_t *out;
|
||||
F1AP_F1SetupFailureIEs_t *ie;
|
||||
|
||||
out = &pdu->choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
|
||||
|
||||
/* Transaction ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out,
|
||||
F1AP_ProtocolIE_ID_id_TransactionID, true);
|
||||
|
||||
/* Cause */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out,
|
||||
F1AP_ProtocolIE_ID_id_Cause, true);
|
||||
|
||||
if(0) {
|
||||
/* TimeToWait */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out,
|
||||
F1AP_ProtocolIE_ID_id_TimeToWait, true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -635,9 +732,19 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
|
||||
|
||||
/* - fiveGS_TAC */
|
||||
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
|
||||
(const char *) &f1ap_setup_req->tac[i],
|
||||
3);
|
||||
if (RC.nrrrc) {
|
||||
uint8_t fiveGS_TAC[3];
|
||||
fiveGS_TAC[0] = ((uint8_t*)&f1ap_setup_req->tac[i])[2];
|
||||
fiveGS_TAC[1] = ((uint8_t*)&f1ap_setup_req->tac[i])[1];
|
||||
fiveGS_TAC[2] = ((uint8_t*)&f1ap_setup_req->tac[i])[0];
|
||||
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
|
||||
(const char *)fiveGS_TAC,
|
||||
3);
|
||||
} else {
|
||||
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
|
||||
(const char *) &f1ap_setup_req->tac[i],
|
||||
3);
|
||||
}
|
||||
|
||||
/* - Configured_EPS_TAC */
|
||||
if(1){
|
||||
@@ -647,17 +754,10 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
2);
|
||||
}
|
||||
|
||||
/* - broadcast PLMNs */
|
||||
int maxnoofBPLMNS = 1;
|
||||
for (i=0;
|
||||
i<maxnoofBPLMNS;
|
||||
i++) {
|
||||
/* > PLMN BroadcastPLMNs Item */
|
||||
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
|
||||
}
|
||||
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
|
||||
memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
|
||||
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
@@ -803,7 +903,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
|
||||
|
||||
/* - fiveGS_TAC */
|
||||
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
|
||||
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
|
||||
(const char *) &f1ap_setup_req->tac[i],
|
||||
3);
|
||||
|
||||
@@ -815,17 +915,10 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
2);
|
||||
}
|
||||
|
||||
/* - broadcast PLMNs */
|
||||
int maxnoofBPLMNS = 1;
|
||||
for (i=0;
|
||||
i<maxnoofBPLMNS;
|
||||
i++) {
|
||||
/* > PLMN BroadcastPLMNs Item */
|
||||
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
|
||||
}
|
||||
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
|
||||
memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
|
||||
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
@@ -963,45 +1056,9 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c5. Active_Cells_List */
|
||||
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Active_Cells_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Active_Cells_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_Active_Cells_ItemIEs_t *active_cells_item_ies;
|
||||
active_cells_item_ies = (F1AP_Active_Cells_ItemIEs_t *)calloc(1, sizeof(F1AP_Active_Cells_ItemIEs_t));
|
||||
active_cells_item_ies->id = F1AP_ProtocolIE_ID_id_Active_Cells_Item;
|
||||
active_cells_item_ies->criticality = F1AP_Criticality_reject;
|
||||
active_cells_item_ies->value.present = F1AP_Active_Cells_ItemIEs__value_PR_Active_Cells_Item;
|
||||
|
||||
F1AP_Active_Cells_Item_t active_cells_item;
|
||||
memset((void *)&active_cells_item, 0, sizeof(F1AP_Active_Cells_Item_t));
|
||||
|
||||
/* 3.1 oldNRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
|
||||
active_cells_item.nRCGI = nRCGI;
|
||||
|
||||
/* ADD */
|
||||
active_cells_item_ies->value.choice.Active_Cells_Item = active_cells_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Active_Cells_List.list,
|
||||
active_cells_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 gNB-DU CONFIGURATION UPDATE\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1029,17 +1086,229 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
|
||||
if(!RC.nrrrc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOG_D(F1AP, "DU_handle_gNB_CU_CONFIGURATION_UPDATE\n");
|
||||
|
||||
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_initiatingMessage,
|
||||
"pdu->present != F1AP_F1AP_PDU_PR_initiatingMessage\n");
|
||||
AssertFatal(pdu->choice.initiatingMessage->procedureCode == F1AP_ProcedureCode_id_gNBCUConfigurationUpdate,
|
||||
"pdu->choice.initiatingMessage->procedureCode != F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n");
|
||||
AssertFatal(pdu->choice.initiatingMessage->criticality == F1AP_Criticality_reject,
|
||||
"pdu->choice.initiatingMessage->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(pdu->choice.initiatingMessage->value.present == F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate,
|
||||
"pdu->choice.initiatingMessage->value.present != F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate\n");
|
||||
|
||||
F1AP_GNBCUConfigurationUpdate_t *in = &pdu->choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
|
||||
|
||||
|
||||
F1AP_GNBCUConfigurationUpdateIEs_t *ie;
|
||||
int TransactionId = -1;
|
||||
int num_cells_to_activate = 0;
|
||||
F1AP_Cells_to_be_Activated_List_Item_t *cell;
|
||||
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE);
|
||||
|
||||
LOG_D(F1AP, "F1AP: gNB_CU_Configuration_Update: protocolIEs.list.count %d\n",
|
||||
in->protocolIEs.list.count);
|
||||
for (int i=0;i < in->protocolIEs.list.count; i++) {
|
||||
ie = in->protocolIEs.list.array[i];
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_reject,
|
||||
"ie->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID,
|
||||
"ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID\n");
|
||||
TransactionId=ie->value.choice.TransactionID;
|
||||
LOG_D(F1AP, "F1AP: GNB-CU-ConfigurationUpdate: TransactionId %d\n",
|
||||
TransactionId);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List:
|
||||
{
|
||||
AssertFatal(ie->criticality == F1AP_Criticality_reject,
|
||||
"ie->criticality != F1AP_Criticality_reject\n");
|
||||
AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List,
|
||||
"ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List\n");
|
||||
num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count;
|
||||
LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate);
|
||||
for (int i=0;i<num_cells_to_activate;i++) {
|
||||
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i];
|
||||
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item,
|
||||
"cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject,
|
||||
"cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
|
||||
AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item,
|
||||
"cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
|
||||
|
||||
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
|
||||
|
||||
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc_digit_length);
|
||||
|
||||
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
|
||||
cell->nRCGI.nRCellIdentity.buf[0],
|
||||
cell->nRCGI.nRCellIdentity.buf[1],
|
||||
cell->nRCGI.nRCellIdentity.buf[2],
|
||||
cell->nRCGI.nRCellIdentity.buf[3],
|
||||
cell->nRCGI.nRCellIdentity.buf[4]);
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid);
|
||||
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
|
||||
|
||||
if (ext==NULL) continue;
|
||||
|
||||
for (int cnt=0;cnt<ext->list.count;cnt++) {
|
||||
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt];
|
||||
switch (cells_to_be_activated_list_itemExtIEs->id) {
|
||||
/*
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_NOTHING:
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailablePLMNList,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_ExtendedAvailablePLMN_List,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_IAB_Info_IAB_donor_CU,
|
||||
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailableSNPN_ID_List
|
||||
*/
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation:
|
||||
{
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nrpci = (cell->nRPCI != NULL) ? *cell->nRPCI : 0;
|
||||
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t*)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;
|
||||
AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n");
|
||||
LOG_D(F1AP, "F1AP: Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n",
|
||||
i, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc,
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI);
|
||||
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
|
||||
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
|
||||
size_t size = sib_item->sIBmessage.size;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[sib_item->sIBtype] = size;
|
||||
LOG_I(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype] = malloc(size);
|
||||
memcpy((void*)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype],
|
||||
(void*)sib_item->sIBmessage.buf,
|
||||
size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case F1AP_ProtocolIE_ID_id_AvailablePLMNList:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_ExtendedAvailablePLMN_List:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_IAB_Info_IAB_donor_CU:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_AvailableSNPN_ID_List:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n",(int)cells_to_be_activated_list_itemExtIEs->id);
|
||||
break;
|
||||
}
|
||||
} // for (cnt=...
|
||||
} // for (cells_to_activate...
|
||||
break;
|
||||
} // case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n", (int)ie->id);
|
||||
break;
|
||||
} // switch ie
|
||||
} // for IE
|
||||
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
|
||||
LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate;
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_F1AP_DU,
|
||||
MSC_F1AP_CU,
|
||||
0,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
assoc_id);
|
||||
|
||||
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
|
||||
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to GNB_APP with assoc_id (%d->%d)\n",
|
||||
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
|
||||
} else {
|
||||
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
|
||||
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) {
|
||||
AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n",
|
||||
GNBCUConfigurationUpdateFailure->cause);
|
||||
}
|
||||
|
||||
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
|
||||
|
||||
if(!RC.nrrrc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0,
|
||||
"%d cells failed to activate\n",
|
||||
GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated);
|
||||
|
||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup == 0,
|
||||
"%d TNLAssociations to setup, handle this ...\n",
|
||||
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup);
|
||||
|
||||
|
||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed == 0,
|
||||
"%d TNLAssociations failed\n",
|
||||
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed);
|
||||
|
||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs == 0,
|
||||
"%d DedicatedSIDeliveryNeededUEs\n",
|
||||
GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs);
|
||||
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
|
||||
/* Create */
|
||||
/* 0. pdu Type */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
|
||||
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
|
||||
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge;
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledge_t *out = &pdu.choice.successfulOutcome->value.choice.GNBCUConfigurationUpdateAcknowledge;
|
||||
|
||||
/* mandatory */
|
||||
/* c1. Transaction ID (integer value)*/
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *ie = (F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID;
|
||||
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(0, 0);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode GNB-DU-Configuration-Update-Acknowledge\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,17 +98,17 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
|
||||
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure);
|
||||
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
|
||||
|
||||
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge);
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
|
||||
|
||||
|
||||
/*
|
||||
* gNB-DU Resource Coordination
|
||||
*/
|
||||
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
|
||||
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
|
||||
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
|
||||
|
||||
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
|
||||
@@ -42,32 +42,50 @@
|
||||
#include "LTE_DL-DCCH-Message.h"
|
||||
#include "LTE_UL-DCCH-Message.h"
|
||||
|
||||
#include "NR_DL-CCCH-Message.h"
|
||||
#include "NR_UL-CCCH-Message.h"
|
||||
#include "NR_DL-DCCH-Message.h"
|
||||
#include "NR_UL-DCCH-Message.h"
|
||||
// for SRB1_logicalChannelConfig_defaultValue
|
||||
#include "rrc_extern.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
#include "asn1_msg.h"
|
||||
#include "intertask_interface.h"
|
||||
|
||||
// undefine C_RNTI from
|
||||
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
|
||||
// replaces in ie->value.choice.C_RNTI, causing
|
||||
// a compile error
|
||||
|
||||
#undef C_RNTI
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_srb_bearer2add_list,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_drb_bearer2add_list);
|
||||
|
||||
uint8_t du_ccch_flag = 1;
|
||||
|
||||
int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/* DL RRC Message Transfer */
|
||||
int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
|
||||
if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
|
||||
LOG_I(F1AP, "node is gNB DU, call DU_handle_DL_NR_RRC_MESSAGE_TRANSFER \n");
|
||||
return DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance, assoc_id, stream, pdu);
|
||||
}
|
||||
|
||||
LOG_D(F1AP, "DU_handle_DL_RRC_MESSAGE_TRANSFER \n");
|
||||
|
||||
F1AP_DLRRCMessageTransfer_t *container;
|
||||
@@ -161,10 +179,10 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation, true);
|
||||
|
||||
switch(ie->value.choice.RAT_FrequencyPriorityInformation.present) {
|
||||
case F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP:
|
||||
case F1AP_RAT_FrequencyPriorityInformation_PR_eNDC:
|
||||
//subscriberProfileIDforRFP = ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP;
|
||||
break;
|
||||
case F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority:
|
||||
case F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN:
|
||||
//rAT_FrequencySelectionPriority = ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority;
|
||||
break;
|
||||
default:
|
||||
@@ -454,36 +472,36 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
|
||||
}
|
||||
|
||||
rrc_mac_config_req_eNB(
|
||||
ctxt.module_id,
|
||||
0,0,0,0,0,0,
|
||||
0,
|
||||
ue_context_p->ue_context.rnti,
|
||||
(LTE_BCCH_BCH_Message_t *) NULL,
|
||||
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
|
||||
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
|
||||
physicalConfigDedicated,
|
||||
(LTE_SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
(LTE_MeasObjectToAddMod_t **) NULL,
|
||||
mac_MainConfig,
|
||||
DRB2LCHAN[i],
|
||||
DRB_configList->list.array[i]->logicalChannelConfig,
|
||||
measGapConfig,
|
||||
(LTE_TDD_Config_t *) NULL,
|
||||
NULL,
|
||||
(LTE_SchedulingInfoList_t *) NULL,
|
||||
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
|
||||
, 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL,
|
||||
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
|
||||
0,
|
||||
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
|
||||
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
|
||||
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
|
||||
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
|
||||
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
|
||||
(LTE_MBSFNAreaConfiguration_r9_t*) NULL
|
||||
);
|
||||
rrc_mac_config_req_eNB(
|
||||
ctxt.module_id,
|
||||
0,0,0,0,0,0,
|
||||
0,
|
||||
ue_context_p->ue_context.rnti,
|
||||
(LTE_BCCH_BCH_Message_t *) NULL,
|
||||
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
|
||||
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
|
||||
physicalConfigDedicated,
|
||||
(LTE_SCellToAddMod_r10_t *)NULL,
|
||||
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
(LTE_MeasObjectToAddMod_t **) NULL,
|
||||
mac_MainConfig,
|
||||
DRB2LCHAN[i],
|
||||
DRB_configList->list.array[i]->logicalChannelConfig,
|
||||
measGapConfig,
|
||||
(LTE_TDD_Config_t *) NULL,
|
||||
NULL,
|
||||
(LTE_SchedulingInfoList_t *) NULL,
|
||||
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
|
||||
, 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL,
|
||||
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
|
||||
0,
|
||||
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
|
||||
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
|
||||
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
|
||||
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
|
||||
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
|
||||
(LTE_MBSFNAreaConfiguration_r9_t*) NULL
|
||||
);
|
||||
}
|
||||
|
||||
} else { // remove LCHAN from MAC/PHY
|
||||
@@ -720,8 +738,8 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
LOG_E(F1AP, "Did not find the UE context associated with UE RNTOI %x, ue_context_p is NULL\n", rnti);
|
||||
|
||||
} else {
|
||||
LOG_A(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti);
|
||||
ue_context_p->ue_context.Status = RRC_CONNECTED;
|
||||
LOG_I(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti);
|
||||
ue_context_p->ue_context.StatusRrc = RRC_CONNECTED;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -765,7 +783,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
}
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 UL RRC MESSAGE TRANSFER\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -780,7 +798,10 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
|
||||
int UE_id,
|
||||
rnti_t rntiP,
|
||||
const uint8_t *sduP,
|
||||
sdu_size_t sdu_lenP) {
|
||||
sdu_size_t sdu_lenP,
|
||||
const int8_t *sdu2P,
|
||||
sdu_size_t sdu2_lenP) {
|
||||
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_InitialULRRCMessageTransfer_t *out;
|
||||
F1AP_InitialULRRCMessageTransferIEs_t *ie;
|
||||
@@ -836,7 +857,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
|
||||
ie->id = F1AP_ProtocolIE_ID_id_C_RNTI;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_C_RNTI;
|
||||
C_RNTI_TO_BIT_STRING(rntiP, &ie->value.choice.C_RNTI);
|
||||
ie->value.choice.C_RNTI=rntiP;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
@@ -850,29 +871,36 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
|
||||
|
||||
/* optional */
|
||||
/* c5. DUtoCURRCContainer */
|
||||
if (0) {
|
||||
if (sdu2P && RC.nrrrc) {
|
||||
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCContainer;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_DUtoCURRCContainer;
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCContainer, "dummy_val",
|
||||
strlen("dummy_val"));
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCContainer, (char *)sdu2P, sdu2_lenP);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
}
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 INITIAL UL RRC MESSAGE TRANSFER\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_allocate_new_UE_context(RC.rrc[module_idP]);
|
||||
ue_context_p->ue_id_rnti = rntiP;
|
||||
ue_context_p->ue_context.rnti = rntiP;
|
||||
ue_context_p->ue_context.random_ue_identity = rntiP;
|
||||
ue_context_p->ue_context.Srb0.Active = 1;
|
||||
RB_INSERT(rrc_ue_tree_s, &RC.rrc[module_idP]->rrc_ue_head, ue_context_p);
|
||||
if (RC.nrrrc && RC.nrrrc[module_idP]->node_type == ngran_gNB_DU) {
|
||||
struct rrc_gNB_ue_context_s* ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]);
|
||||
ue_context_p->ue_id_rnti = rntiP;
|
||||
ue_context_p->ue_context.rnti = rntiP;
|
||||
ue_context_p->ue_context.random_ue_identity = rntiP;
|
||||
ue_context_p->ue_context.Srb0.Active = 1;
|
||||
RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p);
|
||||
} else {
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_allocate_new_UE_context(RC.rrc[module_idP]);
|
||||
ue_context_p->ue_id_rnti = rntiP;
|
||||
ue_context_p->ue_context.rnti = rntiP;
|
||||
ue_context_p->ue_context.random_ue_identity = rntiP;
|
||||
ue_context_p->ue_context.Srb0.Active = 1;
|
||||
RB_INSERT(rrc_ue_tree_s, &RC.rrc[module_idP]->rrc_ue_head, ue_context_p);
|
||||
}
|
||||
du_f1ap_itti_send_sctp_data_req(module_idP, f1ap_du_data->assoc_id, buffer, len, f1ap_du_data->default_sctp_stream_id);
|
||||
|
||||
return 0;
|
||||
@@ -884,4 +912,473 @@ void init_f1ap_du_ue_inst (void) {
|
||||
memset(f1ap_du_inst, 0, sizeof(f1ap_du_inst));
|
||||
}
|
||||
|
||||
int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
const f1ap_ul_rrc_message_t *msg) {
|
||||
const rnti_t rnti = msg->rnti;
|
||||
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_ULRRCMessageTransfer_t *out;
|
||||
F1AP_ULRRCMessageTransferIEs_t *ie;
|
||||
|
||||
uint8_t *buffer = NULL;
|
||||
uint32_t len;
|
||||
|
||||
|
||||
LOG_I(F1AP, "[DU %ld] %s: size %d UE RNTI %x in SRB %d\n",
|
||||
instance, __func__, msg->rrc_container_length, rnti, msg->srb_id);
|
||||
|
||||
//LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, msg->rrc_container_length);
|
||||
//for (int i = 0;i < msg->rrc_container_length; i++)
|
||||
// printf("%02x ", msg->rrc_container[i]);
|
||||
//printf("\n");
|
||||
|
||||
/* Create */
|
||||
/* 0. Message Type */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
|
||||
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_ULRRCMessageTransfer;
|
||||
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
|
||||
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer;
|
||||
out = &pdu.choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
|
||||
|
||||
/* mandatory */
|
||||
/* c1. GNB_CU_UE_F1AP_ID */
|
||||
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
|
||||
|
||||
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_inst[instance], rnti);
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c2. GNB_DU_UE_F1AP_ID */
|
||||
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
|
||||
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_inst[instance], rnti);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c3. SRBID */
|
||||
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID;
|
||||
ie->value.choice.SRBID = msg->srb_id;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
// issue in here
|
||||
/* mandatory */
|
||||
/* c4. RRCContainer */
|
||||
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer;
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer,
|
||||
(const char *) msg->rrc_container,
|
||||
msg->rrc_container_length);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 UL RRC MESSAGE TRANSFER \n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, f1ap_du_data->default_sctp_stream_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* DL NR RRC Message Transfer */
|
||||
int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
LOG_D(F1AP, "DU_handle_DL_NR_RRC_MESSAGE_TRANSFER \n");
|
||||
|
||||
F1AP_DLRRCMessageTransfer_t *container;
|
||||
F1AP_DLRRCMessageTransferIEs_t *ie;
|
||||
|
||||
uint64_t cu_ue_f1ap_id;
|
||||
uint64_t du_ue_f1ap_id;
|
||||
uint64_t srb_id;
|
||||
int executeDuplication;
|
||||
sdu_size_t rrc_dl_sdu_len;
|
||||
//uint64_t subscriberProfileIDforRFP;
|
||||
//uint64_t rAT_FrequencySelectionPriority;
|
||||
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
if (stream != 0) {
|
||||
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
|
||||
assoc_id, stream);
|
||||
return -1;
|
||||
}
|
||||
|
||||
container = &pdu->choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
|
||||
|
||||
|
||||
/* GNB_CU_UE_F1AP_ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
|
||||
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
LOG_D(F1AP, "cu_ue_f1ap_id %lu \n", cu_ue_f1ap_id);
|
||||
|
||||
|
||||
/* GNB_DU_UE_F1AP_ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
|
||||
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
|
||||
du_ue_f1ap_id,
|
||||
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
|
||||
|
||||
if (f1ap_du_add_cu_ue_id(&f1ap_du_inst[instance],du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
|
||||
LOG_E(F1AP, "Failed to find the F1AP UID \n");
|
||||
//return -1;
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* oldgNB_DU_UE_F1AP_ID */
|
||||
if (0) {
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID, true);
|
||||
}
|
||||
|
||||
/* mandatory */
|
||||
/* SRBID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_SRBID, true);
|
||||
srb_id = ie->value.choice.SRBID;
|
||||
LOG_D(F1AP, "srb_id %lu \n", srb_id);
|
||||
|
||||
/* optional */
|
||||
/* ExecuteDuplication */
|
||||
if (0) {
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_ExecuteDuplication, true);
|
||||
executeDuplication = ie->value.choice.ExecuteDuplication;
|
||||
LOG_D(F1AP, "ExecuteDuplication %d \n", executeDuplication);
|
||||
}
|
||||
|
||||
// issue in here
|
||||
/* mandatory */
|
||||
/* RRC Container */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_RRCContainer, true);
|
||||
// BK: need check
|
||||
// create an ITTI message and copy SDU
|
||||
|
||||
// message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND);
|
||||
// memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
|
||||
rrc_dl_sdu_len = ie->value.choice.RRCContainer.size;
|
||||
// memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
|
||||
// ccch_sdu_len);
|
||||
|
||||
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
|
||||
//for (int i = 0;i < ie->value.choice.RRCContainer.size; i++)
|
||||
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
|
||||
//printf("\n");
|
||||
|
||||
/* optional */
|
||||
/* RAT_FrequencyPriorityInformation */
|
||||
if (0) {
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation, true);
|
||||
|
||||
switch(ie->value.choice.RAT_FrequencyPriorityInformation.present) {
|
||||
case F1AP_RAT_FrequencyPriorityInformation_PR_eNDC:
|
||||
//subscriberProfileIDforRFP = ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP;
|
||||
break;
|
||||
case F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN:
|
||||
//rAT_FrequencySelectionPriority = ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority;
|
||||
break;
|
||||
default:
|
||||
LOG_W(F1AP, "unhandled IE RAT_FrequencyPriorityInformation.present\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// decode RRC Container and act on the message type
|
||||
AssertFatal(srb_id<3,"illegal srb_id\n");
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id);
|
||||
ctxt.module_id = instance;
|
||||
ctxt.instance = instance;
|
||||
ctxt.enb_flag = 1;
|
||||
|
||||
struct rrc_gNB_ue_context_s* ue_context_p = rrc_gNB_get_ue_context(
|
||||
RC.nrrrc[ctxt.module_id],
|
||||
ctxt.rnti);
|
||||
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
|
||||
if (srb_id == 0) {
|
||||
NR_DL_CCCH_Message_t* dl_ccch_msg=NULL;
|
||||
asn_dec_rval_t dec_rval;
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_DL_CCCH_Message,
|
||||
(void**)&dl_ccch_msg,
|
||||
ie->value.choice.RRCContainer.buf,
|
||||
rrc_dl_sdu_len,0,0);
|
||||
AssertFatal(dec_rval.code == RC_OK, "could not decode F1AP message\n");
|
||||
switch (dl_ccch_msg->message.choice.c1->present) {
|
||||
|
||||
case NR_DL_CCCH_MessageType__c1_PR_NOTHING:
|
||||
|
||||
LOG_I(F1AP, "Received PR_NOTHING on DL-CCCH-Message\n");
|
||||
break;
|
||||
|
||||
case NR_DL_CCCH_MessageType__c1_PR_rrcReject:
|
||||
LOG_I(F1AP,
|
||||
"Logical Channel DL-CCCH (SRB0), Received RRCReject\n");
|
||||
break;
|
||||
|
||||
case NR_DL_CCCH_MessageType__c1_PR_rrcSetup:
|
||||
{
|
||||
LOG_I(F1AP,
|
||||
"Logical Channel DL-CCCH (SRB0), Received RRCSetup DU_ID %lx/RNTI %x\n",
|
||||
du_ue_f1ap_id,
|
||||
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id));
|
||||
// Get configuration
|
||||
|
||||
NR_RRCSetup_t* rrcSetup = dl_ccch_msg->message.choice.c1->choice.rrcSetup;
|
||||
AssertFatal(rrcSetup!=NULL, "rrcSetup is null\n");
|
||||
NR_RRCSetup_IEs_t *rrcSetup_ies = rrcSetup->criticalExtensions.choice.rrcSetup;
|
||||
|
||||
ue_context_p->ue_context.SRB_configList = rrcSetup_ies->radioBearerConfig.srb_ToAddModList;
|
||||
AssertFatal(rrcSetup_ies->masterCellGroup.buf!=NULL,"masterCellGroup is null\n");
|
||||
asn_dec_rval_t dec_rval;
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_CellGroupConfig,
|
||||
(void**)&ue_context_p->ue_context.masterCellGroup,
|
||||
rrcSetup_ies->masterCellGroup.buf,
|
||||
rrcSetup_ies->masterCellGroup.size,0,0);
|
||||
AssertFatal(dec_rval.code == RC_OK, "could not decode masterCellGroup\n");
|
||||
|
||||
apply_macrlc_config(rrc,ue_context_p,&ctxt);
|
||||
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
|
||||
AssertFatal(ue_p->Srb0.Active == 1,"SRB0 is not active\n");
|
||||
|
||||
memcpy((void*)ue_p->Srb0.Tx_buffer.Payload,
|
||||
(void*)ie->value.choice.RRCContainer.buf,
|
||||
rrc_dl_sdu_len); // ie->value.choice.RRCContainer.size
|
||||
|
||||
ue_p->Srb0.Tx_buffer.payload_size = rrc_dl_sdu_len;
|
||||
|
||||
break;
|
||||
} // case
|
||||
|
||||
case NR_DL_CCCH_MessageType__c1_PR_spare2:
|
||||
LOG_I(F1AP,
|
||||
"Logical Channel DL-CCCH (SRB0), Received spare2\n");
|
||||
break;
|
||||
|
||||
case NR_DL_CCCH_MessageType__c1_PR_spare1:
|
||||
LOG_I(F1AP,
|
||||
"Logical Channel DL-CCCH (SRB0), Received spare1\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,
|
||||
"Unknown message\n");
|
||||
break;
|
||||
}// switch case
|
||||
return(0);
|
||||
} else if (srb_id == 1) {
|
||||
|
||||
NR_DL_DCCH_Message_t* dl_dcch_msg=NULL;
|
||||
asn_dec_rval_t dec_rval;
|
||||
dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_DL_DCCH_Message,
|
||||
(void**)&dl_dcch_msg,
|
||||
&ie->value.choice.RRCContainer.buf[2], // buf[0] includes the pdcp header
|
||||
rrc_dl_sdu_len-6,0,0);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
|
||||
LOG_E(F1AP," Failed to decode DL-DCCH (%zu bytes)\n",dec_rval.consumed);
|
||||
else
|
||||
LOG_D(F1AP, "Received message: present %d and c1 present %d\n",
|
||||
dl_dcch_msg->message.present, dl_dcch_msg->message.choice.c1->present);
|
||||
|
||||
if (dl_dcch_msg->message.present == NR_DL_DCCH_MessageType_PR_c1) {
|
||||
switch (dl_dcch_msg->message.choice.c1->present) {
|
||||
case NR_DL_DCCH_MessageType__c1_PR_NOTHING:
|
||||
LOG_I(F1AP, "Received PR_NOTHING on DL-DCCH-Message\n");
|
||||
return 0;
|
||||
|
||||
case NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration:
|
||||
// handle RRCReconfiguration
|
||||
LOG_I(F1AP,
|
||||
"Logical Channel DL-DCCH (SRB1), Received RRCReconfiguration DU_ID %lx/RNTI %x\n",
|
||||
du_ue_f1ap_id,
|
||||
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id));
|
||||
|
||||
NR_RRCReconfiguration_t* rrcReconfiguration = dl_dcch_msg->message.choice.c1->choice.rrcReconfiguration;
|
||||
|
||||
if (rrcReconfiguration->criticalExtensions.present == NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration) {
|
||||
NR_RRCReconfiguration_IEs_t* rrcReconfiguration_ies =
|
||||
rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration;
|
||||
|
||||
if (rrcReconfiguration_ies->measConfig != NULL) {
|
||||
LOG_I(F1AP, "Measurement Configuration is present\n");
|
||||
}
|
||||
|
||||
if (rrcReconfiguration_ies->radioBearerConfig) {
|
||||
LOG_I(F1AP, "Radio Resource Configuration is present\n");
|
||||
long drb_id;
|
||||
int i;
|
||||
NR_DRB_ToAddModList_t *DRB_configList = rrcReconfiguration_ies->radioBearerConfig->drb_ToAddModList;
|
||||
NR_SRB_ToAddModList_t *SRB_configList = rrcReconfiguration_ies->radioBearerConfig->srb_ToAddModList;
|
||||
// NR_DRB_ToReleaseList_t *DRB_ReleaseList = rrcReconfiguration_ies->radioBearerConfig->drb_ToReleaseList;
|
||||
|
||||
// rrc_rlc_config_asn1_req
|
||||
|
||||
if (SRB_configList != NULL) {
|
||||
for (i = 0; (i < SRB_configList->list.count) && (i < 3); i++) {
|
||||
if (SRB_configList->list.array[i]->srb_Identity == 1 ){
|
||||
ue_context_p->ue_context.Srb1.Active=1;
|
||||
}
|
||||
else if (SRB_configList->list.array[i]->srb_Identity == 2 ) {
|
||||
ue_context_p->ue_context.Srb2.Active=1;
|
||||
ue_context_p->ue_context.Srb2.Srb_info.Srb_id=2;
|
||||
LOG_I(F1AP, "[DU %d] SRB2 is now active\n",ctxt.module_id);
|
||||
} else {
|
||||
LOG_W(F1AP, "[DU %d] invalide SRB identity %ld\n",ctxt.module_id,
|
||||
SRB_configList->list.array[i]->srb_Identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (DRB_configList != NULL) {
|
||||
for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8)
|
||||
if (DRB_configList->list.array[i]) {
|
||||
drb_id = (int)DRB_configList->list.array[i]->drb_Identity;
|
||||
LOG_I(F1AP,
|
||||
"[DU %d] Logical Channel UL-DCCH, Received RRCConnectionReconfiguration for UE rnti %x, reconfiguring DRB %d\n",
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
(int)DRB_configList->list.array[i]->drb_Identity);
|
||||
// (int)*DRB_configList->list.array[i]->logicalChannelIdentity);
|
||||
|
||||
if (ue_context_p->ue_context.DRB_active[drb_id] == 0) {
|
||||
ue_context_p->ue_context.DRB_active[drb_id] = 1;
|
||||
|
||||
// logicalChannelIdentity
|
||||
// rrc_mac_config_req_eNB
|
||||
}
|
||||
|
||||
} else { // remove LCHAN from MAC/PHY
|
||||
AssertFatal(1==0,"Can't handle this yet in DU\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_rrcResume:
|
||||
LOG_I(F1AP,"Received rrcResume\n");
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_rrcRelease:
|
||||
LOG_I(F1AP,"Received rrcRelease\n");
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment:
|
||||
LOG_I(F1AP,"Received rrcReestablishment\n");
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_securityModeCommand:
|
||||
LOG_I(F1AP,"Received securityModeCommand\n");
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer:
|
||||
LOG_I(F1AP, "Received dlInformationTransfer\n");
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry:
|
||||
LOG_I(F1AP, "Received ueCapabilityEnquiry\n");
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_counterCheck:
|
||||
LOG_I(F1AP, "Received counterCheck\n");
|
||||
break;
|
||||
case NR_DL_DCCH_MessageType__c1_PR_mobilityFromNRCommand:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_dlDedicatedMessageSegment_r16:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_ueInformationRequest_r16:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_dlInformationTransferMRDC_r16:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r16:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare3:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare2:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare1:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (srb_id == 2) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
LOG_I(F1AP, "Received DL RRC Transfer on srb_id %ld\n", srb_id);
|
||||
|
||||
|
||||
// rlc_op_status_t rlc_status;
|
||||
// boolean_t ret = TRUE;
|
||||
mem_block_t *pdcp_pdu_p = NULL;
|
||||
pdcp_pdu_p = get_free_mem_block(rrc_dl_sdu_len, __func__);
|
||||
|
||||
//LOG_I(F1AP, "PRRCContainer size %lu:", ie->value.choice.RRCContainer.size);
|
||||
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
|
||||
|
||||
//printf (", PDCP PDU size %d:", rrc_dl_sdu_len);
|
||||
//for (int i=0;i<rrc_dl_sdu_len;i++) printf("%2x ",pdcp_pdu_p->data[i]);
|
||||
//printf("\n");
|
||||
|
||||
if (pdcp_pdu_p != NULL) {
|
||||
memset(pdcp_pdu_p->data, 0, rrc_dl_sdu_len);
|
||||
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, rrc_dl_sdu_len);
|
||||
|
||||
/* for rfsim */
|
||||
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, rrc_dl_sdu_len, pdcp_pdu_p);
|
||||
// rlc_status = rlc_data_req(&ctxt
|
||||
// , 1
|
||||
// , MBMS_FLAG_NO
|
||||
// , srb_id
|
||||
// , 0
|
||||
// , 0
|
||||
// , rrc_dl_sdu_len
|
||||
// , pdcp_pdu_p
|
||||
// ,NULL
|
||||
// ,NULL
|
||||
// );
|
||||
// switch (rlc_status) {
|
||||
// case RLC_OP_STATUS_OK:
|
||||
// //LOG_I(F1AP, "Data sending request over RLC succeeded!\n");
|
||||
// ret=TRUE;
|
||||
// break;
|
||||
|
||||
// case RLC_OP_STATUS_BAD_PARAMETER:
|
||||
// LOG_W(F1AP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
|
||||
// ret= FALSE;
|
||||
// break;
|
||||
|
||||
// case RLC_OP_STATUS_INTERNAL_ERROR:
|
||||
// LOG_W(F1AP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
|
||||
// ret= FALSE;
|
||||
// break;
|
||||
|
||||
// case RLC_OP_STATUS_OUT_OF_RESSOURCES:
|
||||
// LOG_W(F1AP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
|
||||
// ret= FALSE;
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// LOG_W(F1AP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
|
||||
// ret= FALSE;
|
||||
// break;
|
||||
// } // switch case
|
||||
// return ret;
|
||||
} // if pdcp_pdu_p
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,12 +42,15 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg);
|
||||
int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg);
|
||||
|
||||
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
|
||||
int CC_idP,
|
||||
int UE_id,
|
||||
rnti_t rntiP,
|
||||
const uint8_t *sduP,
|
||||
sdu_size_t sdu_lenP);
|
||||
sdu_size_t sdu_lenP,
|
||||
const int8_t *sdu2P,
|
||||
sdu_size_t sdu2_lenP);
|
||||
|
||||
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
|
||||
|
||||
@@ -86,9 +86,9 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
|
||||
DevAssert(sctp_new_association_resp != NULL);
|
||||
|
||||
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
|
||||
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
|
||||
LOG_E(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
(int)instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
|
||||
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
|
||||
@@ -102,7 +102,12 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
|
||||
f1ap_du_data->default_sctp_stream_id = 0;
|
||||
|
||||
/* setup parameters for F1U and start the server */
|
||||
const cudu_params_t params = {
|
||||
const cudu_params_t params = (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) ? (cudu_params_t){
|
||||
.local_ipv4_address = RC.nrmac[instance]->eth_params_n.my_addr,
|
||||
.local_port = RC.nrmac[instance]->eth_params_n.my_portd,
|
||||
.remote_ipv4_address = RC.nrmac[instance]->eth_params_n.remote_addr,
|
||||
.remote_port = RC.nrmac[instance]->eth_params_n.remote_portd
|
||||
} : (cudu_params_t){
|
||||
.local_ipv4_address = RC.mac[instance]->eth_params_n.my_addr,
|
||||
.local_port = RC.mac[instance]->eth_params_n.my_portd,
|
||||
.remote_ipv4_address = RC.mac[instance]->eth_params_n.remote_addr,
|
||||
@@ -159,6 +164,14 @@ void *F1AP_DU_task(void *arg) {
|
||||
du_task_send_sctp_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_SETUP_REQ(received_msg));
|
||||
break;
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
|
||||
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
|
||||
break;
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE:
|
||||
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg));
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP:
|
||||
// 1. store the respon
|
||||
@@ -175,10 +188,26 @@ void *F1AP_DU_task(void *arg) {
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
break;
|
||||
|
||||
case F1AP_INITIAL_UL_RRC_MESSAGE: // to rrc
|
||||
LOG_I(F1AP, "DU Task Received F1AP_INITIAL_UL_RRC_MESSAGE\n");
|
||||
|
||||
f1ap_initial_ul_rrc_message_t *msg = &F1AP_INITIAL_UL_RRC_MESSAGE(received_msg);
|
||||
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(0,0,0,msg->crnti,
|
||||
msg->rrc_container,
|
||||
msg->rrc_container_length,
|
||||
(const int8_t*)msg->du2cu_rrc_container,
|
||||
msg->du2cu_rrc_container_length);
|
||||
break;
|
||||
|
||||
case F1AP_UL_RRC_MESSAGE: // to rrc
|
||||
LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
|
||||
DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UL_RRC_MESSAGE(received_msg));
|
||||
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
|
||||
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UL_RRC_MESSAGE(received_msg));
|
||||
} else {
|
||||
DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UL_RRC_MESSAGE(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
|
||||
|
||||
@@ -38,13 +38,8 @@
|
||||
|
||||
#include "rrc_extern.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
|
||||
// undefine C_RNTI from
|
||||
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
|
||||
// replaces in ie->value.choice.C_RNTI, causing
|
||||
// a compile error
|
||||
|
||||
#undef C_RNTI
|
||||
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data;
|
||||
extern f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
|
||||
@@ -91,7 +86,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&ie->value.choice.NRCGI.nRCellIdentity, f1ap_ue_context_setup_req->nr_cellid);
|
||||
/* ServCellIndex */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_ServCellndex, true);
|
||||
F1AP_ProtocolIE_ID_id_ServCellIndex, true);
|
||||
f1ap_ue_context_setup_req->servCellIndex = ie->value.choice.ServCellIndex;
|
||||
/* optional */
|
||||
/* CellULConfigured */
|
||||
@@ -108,51 +103,82 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
|
||||
f1ap_ue_context_setup_req->cellULConfigured = NULL;
|
||||
}
|
||||
|
||||
/* CUtoDURRCInformation */
|
||||
/* Candidate_SpCell_List */
|
||||
/* optional */
|
||||
/* DRXCycle */
|
||||
/* optional */
|
||||
/* ResourceCoordinationTransferContainer */
|
||||
/* SCell_ToBeSetup_List */
|
||||
/* SRBs_ToBeSetup_List */
|
||||
/* DRBs_ToBeSetup_List */
|
||||
/* Decode DRBs_ToBeSetup_List */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List, true);
|
||||
f1ap_ue_context_setup_req->drbs_to_be_setup_length = ie->value.choice.DRBs_ToBeSetup_List.list.count;
|
||||
f1ap_ue_context_setup_req->drbs_to_be_setup = calloc(f1ap_ue_context_setup_req->drbs_to_be_setup_length,
|
||||
sizeof(f1ap_drb_to_be_setup_t));
|
||||
AssertFatal(f1ap_ue_context_setup_req->drbs_to_be_setup,
|
||||
"could not allocate memory for f1ap_ue_context_setup_req->drbs_to_be_setup\n");
|
||||
if (RC.nrrrc) {
|
||||
/* RRCContainer */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_RRCContainer, false);
|
||||
if (ie) {
|
||||
/* correct here */
|
||||
f1ap_ue_context_setup_req->rrc_container = malloc(ie->value.choice.RRCContainer.size);
|
||||
memcpy(f1ap_ue_context_setup_req->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
|
||||
} else {
|
||||
LOG_E(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
|
||||
}
|
||||
|
||||
for (i = 0; i < f1ap_ue_context_setup_req->drbs_to_be_setup_length; ++i) {
|
||||
f1ap_drb_to_be_setup_t *drb_p = &f1ap_ue_context_setup_req->drbs_to_be_setup[i];
|
||||
F1AP_DRBs_ToBeSetup_Item_t *drbs_tobesetup_item_p;
|
||||
drbs_tobesetup_item_p = &((F1AP_DRBs_ToBeSetup_ItemIEs_t *)ie->value.choice.DRBs_ToBeSetup_List.list.array[i])->value.choice.DRBs_ToBeSetup_Item;
|
||||
drb_p->drb_id = drbs_tobesetup_item_p->dRBID;
|
||||
/* TODO in the following, assume only one UP UL TNL is present.
|
||||
* this matches/assumes OAI CU implementation, can be up to 2! */
|
||||
drb_p->up_ul_tnl_length = 1;
|
||||
AssertFatal(drbs_tobesetup_item_p->uLUPTNLInformation_ToBeSetup_List.list.count > 0,
|
||||
"no UL UP TNL Information in DRBs to be Setup list\n");
|
||||
F1AP_ULUPTNLInformation_ToBeSetup_Item_t *ul_up_tnl_info_p = (F1AP_ULUPTNLInformation_ToBeSetup_Item_t *)drbs_tobesetup_item_p->uLUPTNLInformation_ToBeSetup_List.list.array[0];
|
||||
F1AP_GTPTunnel_t *ul_up_tnl0 = ul_up_tnl_info_p->uLUPTNLInformation.choice.gTPTunnel;
|
||||
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&ul_up_tnl0->transportLayerAddress, drb_p->up_ul_tnl[0].tl_address);
|
||||
OCTET_STRING_TO_INT32(&ul_up_tnl0->gTP_TEID, drb_p->up_ul_tnl[0].gtp_teid);
|
||||
// AssertFatal(0, "check configuration, send to appropriate handler\n");
|
||||
|
||||
switch (drbs_tobesetup_item_p->rLCMode) {
|
||||
case F1AP_RLCMode_rlc_am:
|
||||
drb_p->rlc_mode = RLC_MODE_AM;
|
||||
break;
|
||||
protocol_ctxt_t ctxt;
|
||||
// ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], ie->value.choice.GNB_DU_UE_F1AP_ID);
|
||||
ctxt.rnti = 0x1234;
|
||||
ctxt.module_id = instance;
|
||||
ctxt.instance = instance;
|
||||
ctxt.enb_flag = 1;
|
||||
|
||||
default:
|
||||
drb_p->rlc_mode = RLC_MODE_TM;
|
||||
break;
|
||||
mem_block_t *pdcp_pdu_p = NULL;
|
||||
pdcp_pdu_p = get_free_mem_block(ie->value.choice.RRCContainer.size, __func__);
|
||||
if (pdcp_pdu_p != NULL) {
|
||||
memset(pdcp_pdu_p->data, 0, ie->value.choice.RRCContainer.size);
|
||||
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
|
||||
|
||||
/* for rfsim */
|
||||
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ie->value.choice.RRCContainer.size, pdcp_pdu_p);
|
||||
}
|
||||
} else {
|
||||
/* CUtoDURRCInformation */
|
||||
/* Candidate_SpCell_List */
|
||||
/* optional */
|
||||
/* DRXCycle */
|
||||
/* optional */
|
||||
/* ResourceCoordinationTransferContainer */
|
||||
/* SCell_ToBeSetup_List */
|
||||
/* SRBs_ToBeSetup_List */
|
||||
/* DRBs_ToBeSetup_List */
|
||||
/* Decode DRBs_ToBeSetup_List */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List, true);
|
||||
f1ap_ue_context_setup_req->drbs_to_be_setup_length = ie->value.choice.DRBs_ToBeSetup_List.list.count;
|
||||
f1ap_ue_context_setup_req->drbs_to_be_setup = calloc(f1ap_ue_context_setup_req->drbs_to_be_setup_length,
|
||||
sizeof(f1ap_drb_to_be_setup_t));
|
||||
AssertFatal(f1ap_ue_context_setup_req->drbs_to_be_setup,
|
||||
"could not allocate memory for f1ap_ue_context_setup_req->drbs_to_be_setup\n");
|
||||
|
||||
for (i = 0; i < f1ap_ue_context_setup_req->drbs_to_be_setup_length; ++i) {
|
||||
f1ap_drb_to_be_setup_t *drb_p = &f1ap_ue_context_setup_req->drbs_to_be_setup[i];
|
||||
F1AP_DRBs_ToBeSetup_Item_t *drbs_tobesetup_item_p;
|
||||
drbs_tobesetup_item_p = &((F1AP_DRBs_ToBeSetup_ItemIEs_t *)ie->value.choice.DRBs_ToBeSetup_List.list.array[i])->value.choice.DRBs_ToBeSetup_Item;
|
||||
drb_p->drb_id = drbs_tobesetup_item_p->dRBID;
|
||||
/* TODO in the following, assume only one UP UL TNL is present.
|
||||
* this matches/assumes OAI CU implementation, can be up to 2! */
|
||||
drb_p->up_ul_tnl_length = 1;
|
||||
AssertFatal(drbs_tobesetup_item_p->uLUPTNLInformation_ToBeSetup_List.list.count > 0,
|
||||
"no UL UP TNL Information in DRBs to be Setup list\n");
|
||||
F1AP_ULUPTNLInformation_ToBeSetup_Item_t *ul_up_tnl_info_p = (F1AP_ULUPTNLInformation_ToBeSetup_Item_t *)drbs_tobesetup_item_p->uLUPTNLInformation_ToBeSetup_List.list.array[0];
|
||||
F1AP_GTPTunnel_t *ul_up_tnl0 = ul_up_tnl_info_p->uLUPTNLInformation.choice.gTPTunnel;
|
||||
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&ul_up_tnl0->transportLayerAddress, drb_p->up_ul_tnl[0].tl_address);
|
||||
OCTET_STRING_TO_INT32(&ul_up_tnl0->gTP_TEID, drb_p->up_ul_tnl[0].gtp_teid);
|
||||
|
||||
switch (drbs_tobesetup_item_p->rLCMode) {
|
||||
case F1AP_RLCMode_rlc_am:
|
||||
drb_p->rlc_mode = RLC_MODE_AM;
|
||||
break;
|
||||
|
||||
default:
|
||||
drb_p->rlc_mode = RLC_MODE_TM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AssertFatal(0, "check configuration, send to appropriate handler\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -227,7 +253,8 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) {
|
||||
ie->id = F1AP_ProtocolIE_ID_id_C_RNTI;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_C_RNTI;
|
||||
C_RNTI_TO_BIT_STRING(rntiP, &ie->value.choice.C_RNTI);
|
||||
//C_RNTI_TO_BIT_STRING(rntiP, &ie->value.choice.C_RNTI);
|
||||
ie->value.choice.C_RNTI=rntiP;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
@@ -510,7 +537,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) {
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT SETUP RESPONSE\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -632,11 +659,21 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
|
||||
rnti, ctxt.rnti);
|
||||
int UE_out_of_sync = 0;
|
||||
|
||||
for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
|
||||
if (RC.mac[instance]->UE_info.active[n] == TRUE
|
||||
&& rnti == UE_RNTI(instance, n)) {
|
||||
UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync;
|
||||
break;
|
||||
if (RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
|
||||
for (int n = 0; n < MAX_MOBILES_PER_GNB; ++n) {
|
||||
if (RC.nrmac[instance]->UE_info.active[n] == TRUE
|
||||
&& rnti == RC.nrmac[instance]->UE_info.rnti[n]) {
|
||||
UE_out_of_sync = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
|
||||
if (RC.mac[instance]->UE_info.active[n] == TRUE
|
||||
&& rnti == UE_RNTI(instance, n)) {
|
||||
UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,6 +723,15 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
|
||||
}
|
||||
}
|
||||
|
||||
if (RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
|
||||
// struct rrc_gNB_ue_context_s *ue_context_p;
|
||||
|
||||
f1ap_ue_context_release_cplt_t cplt;
|
||||
cplt.rnti = ctxt.rnti;
|
||||
DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance, &cplt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct rrc_eNB_ue_context_s *ue_context_p;
|
||||
|
||||
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id], ctxt.rnti);
|
||||
@@ -1016,7 +1062,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
|
||||
srbs_failedToBeSetupMod_item.sRBID = 50L;
|
||||
srbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
|
||||
srbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
|
||||
srbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
|
||||
srbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
|
||||
/* ADD */
|
||||
srbs_failedToBeSetupMod_item_ies->value.choice.SRBs_FailedToBeSetupMod_Item = srbs_failedToBeSetupMod_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_FailedToBeSetupMod_List.list,
|
||||
@@ -1047,7 +1093,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
|
||||
drbs_failedToBeSetupMod_item.dRBID = 30L;
|
||||
drbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
|
||||
drbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
|
||||
drbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
|
||||
drbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
|
||||
/* ADD */
|
||||
drbs_failedToBeSetupMod_item_ies->value.choice.DRBs_FailedToBeSetupMod_Item = drbs_failedToBeSetupMod_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeSetupMod_List.list,
|
||||
@@ -1083,7 +1129,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
|
||||
scell_failedtoSetupMod_item.sCell_ID = nRCGI;
|
||||
scell_failedtoSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
|
||||
scell_failedtoSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
|
||||
scell_failedtoSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
|
||||
scell_failedtoSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
|
||||
/* ADD */
|
||||
scell_failedtoSetupMod_item_ies->value.choice.SCell_FailedtoSetupMod_Item = scell_failedtoSetupMod_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_FailedtoSetupMod_List.list,
|
||||
@@ -1114,7 +1160,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
|
||||
drbs_failedToBeModified_item.dRBID = 30L;
|
||||
drbs_failedToBeModified_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
|
||||
drbs_failedToBeModified_item.cause->present = F1AP_Cause_PR_radioNetwork;
|
||||
drbs_failedToBeModified_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
|
||||
drbs_failedToBeModified_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
|
||||
/* ADD */
|
||||
drbs_failedToBeModified_item_ies->value.choice.DRBs_FailedToBeModified_Item = drbs_failedToBeModified_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeModified_List.list,
|
||||
@@ -1180,7 +1226,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 setup request\n");
|
||||
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT MODIFICATION RESPONSE\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,12 +84,8 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
|
||||
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
|
||||
}
|
||||
|
||||
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
|
||||
|
||||
if (encoded < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1AP message\n");
|
||||
return -1;
|
||||
}
|
||||
AssertFatal((encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer))>0,
|
||||
"Failed to encode F1AP message\n");
|
||||
|
||||
*length = encoded;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
|
||||
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */
|
||||
{ 0, 0, 0 }, /* ErrorIndication */
|
||||
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */
|
||||
{ 0, 0, 0 }, /* gNBCUConfigurationUpdate */
|
||||
{ DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE }, /* gNBCUConfigurationUpdate */
|
||||
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
|
||||
{ DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */
|
||||
{ 0, 0, 0 }, /* UEContextModification */
|
||||
|
||||
@@ -47,7 +47,9 @@
|
||||
#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd"
|
||||
#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference"
|
||||
#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads"
|
||||
|
||||
#define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD "pusch_dtx_threshold"
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* L1 configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -62,7 +64,10 @@
|
||||
{CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0} \
|
||||
{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \
|
||||
}
|
||||
#define L1_CC_IDX 0
|
||||
#define L1_TRANSPORT_N_PREFERENCE_IDX 1
|
||||
@@ -74,6 +79,9 @@
|
||||
#define L1_LOCAL_N_PORTD_IDX 7
|
||||
#define L1_REMOTE_N_PORTD_IDX 8
|
||||
#define L1_PUSCH_PROC_THREADS 9
|
||||
#define L1_PUCCH0_DTX_THRESHOLD 10
|
||||
#define L1_PRACH_DTX_THRESHOLD 11
|
||||
#define L1_PUSCH_DTX_THRESHOLD 12
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#endif
|
||||
|
||||
@@ -55,7 +55,11 @@
|
||||
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc"
|
||||
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd"
|
||||
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd"
|
||||
|
||||
#define CONFIG_STRING_MACRLC_ULSCH_MAX_SLOTS_INACTIVITY "ulsch_max_slots_inactivity"
|
||||
#define CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10 "pusch_TargetSNRx10"
|
||||
#define CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10 "pucch_TargetSNRx10"
|
||||
#define CONFIG_STRING_MACRLC_PUCCHFAILURETHRES "pucch_FailureThres"
|
||||
#define CONFIG_STRING_MACRLC_PUSCHFAILURETHRES "pusch_FailureThres"
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* MacRLC configuration parameters */
|
||||
@@ -79,6 +83,11 @@
|
||||
{CONFIG_STRING_MACRLC_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_ULSCH_MAX_SLOTS_INACTIVITY, "Maximum number of slots before a UE is scheduled ULSCH due to inactivity", 0, uptr:NULL, defintval:200, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:150, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_PUCCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_MACRLC_PUSCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
|
||||
}
|
||||
#define MACRLC_CC_IDX 0
|
||||
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
|
||||
@@ -97,5 +106,10 @@
|
||||
#define MACRLC_REMOTE_S_PORTC_IDX 14
|
||||
#define MACRLC_LOCAL_S_PORTD_IDX 15
|
||||
#define MACRLC_REMOTE_S_PORTD_IDX 16
|
||||
#define MACRLC_ULSCH_MAX_SLOTS_INACTIVITY 17
|
||||
#define MACRLC_PUSCHTARGETSNRX10_IDX 18
|
||||
#define MACRLC_PUCCHTARGETSNRX10_IDX 19
|
||||
#define MACRLC_PUCCHFAILURETHRES_IDX 20
|
||||
#define MACRLC_PUSCHFAILURETHRES_IDX 21
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#endif
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
#define GNB_CONFIG_STRING_PUCCHGROUPHOPPING "pucchGroupHopping"
|
||||
#define GNB_CONFIG_STRING_HOPPINGID "hoppingId"
|
||||
#define GNB_CONFIG_STRING_P0NOMINAL "p0_nominal"
|
||||
#define GNB_CONFIG_STRING_PUCCHRES "pucch_ResourceCommon"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPK2_0 "initialULBWPk2_0"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0 "initialULBWPmappingType_0"
|
||||
#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0 "initialULBWPstartSymbolAndLength_0"
|
||||
@@ -211,6 +212,24 @@
|
||||
|
||||
#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 Dedicated */
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED "servingCellConfigDedicated"
|
||||
#define GNB_CONFIG_STRING_DLPTRSFREQDENSITY0_0 "dl_ptrsFreqDensity0_0"
|
||||
#define GNB_CONFIG_STRING_DLPTRSFREQDENSITY1_0 "dl_ptrsFreqDensity1_0"
|
||||
#define GNB_CONFIG_STRING_DLPTRSTIMEDENSITY0_0 "dl_ptrsTimeDensity0_0"
|
||||
#define GNB_CONFIG_STRING_DLPTRSTIMEDENSITY1_0 "dl_ptrsTimeDensity1_0"
|
||||
#define GNB_CONFIG_STRING_DLPTRSTIMEDENSITY2_0 "dl_ptrsTimeDensity2_0"
|
||||
#define GNB_CONFIG_STRING_DLPTRSEPRERATIO_0 "dl_ptrsEpreRatio_0"
|
||||
#define GNB_CONFIG_STRING_DLPTRSREOFFSET_0 "dl_ptrsReOffset_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSFREQDENSITY0_0 "ul_ptrsFreqDensity0_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSFREQDENSITY1_0 "ul_ptrsFreqDensity1_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSTIMEDENSITY0_0 "ul_ptrsTimeDensity0_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSTIMEDENSITY1_0 "ul_ptrsTimeDensity1_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSTIMEDENSITY2_0 "ul_ptrsTimeDensity2_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSREOFFSET_0 "ul_ptrsReOffset_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSMAXPORTS_0 "ul_ptrsMaxPorts_0"
|
||||
#define GNB_CONFIG_STRING_ULPTRSPOWER_0 "ul_ptrsPower_0"
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------------*/
|
||||
/* pdcch_ConfigSIB1 parameters */
|
||||
/*--------------------------------------------------------------------------------------------------------------------*/
|
||||
@@ -379,6 +398,7 @@
|
||||
{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_PUCCHRES, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon,defint64val:0,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR,NULL,0,uptr:&scc->ssb_PositionsInBurst->present,defuintval:NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap,TYPE_UINT,0/*140*/}, \
|
||||
{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},\
|
||||
@@ -395,6 +415,26 @@
|
||||
{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}}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* Serving Cell Config Dedicated configuration parameters */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#define SCDPARAMS_DESC(scd) { \
|
||||
{GNB_CONFIG_STRING_DLPTRSFREQDENSITY0_0,NULL,0,i64ptr:scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.array[0],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_DLPTRSFREQDENSITY1_0,NULL,0,i64ptr:scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.array[1],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_DLPTRSTIMEDENSITY0_0,NULL,0,i64ptr:scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list.array[0],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_DLPTRSTIMEDENSITY1_0,NULL,0,i64ptr:scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list.array[1],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_DLPTRSTIMEDENSITY2_0,NULL,0,i64ptr:scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list.array[2],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_DLPTRSEPRERATIO_0,NULL,0,i64ptr:scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->epre_Ratio,defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_DLPTRSREOFFSET_0,NULL,0,i64ptr:scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->resourceElementOffset,defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSFREQDENSITY0_0,NULL,0,i64ptr:scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[0],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSFREQDENSITY1_0,NULL,0,i64ptr:scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[1],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSTIMEDENSITY0_0,NULL,0,i64ptr:scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[0],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSTIMEDENSITY1_0,NULL,0,i64ptr:scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[1],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSTIMEDENSITY2_0,NULL,0,i64ptr:scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[2],defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSREOFFSET_0,NULL,0,i64ptr:scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->resourceElementOffset,defint64val:-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSMAXPORTS_0,NULL,0,i64ptr:&scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->maxNrofPorts,defint64val:0,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_ULPTRSPOWER_0,NULL,0,i64ptr:&scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->ptrs_Power,defint64val:0,TYPE_INT64,0}}
|
||||
|
||||
|
||||
|
||||
|
||||
+106
-24
@@ -29,6 +29,10 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <nr_pdcp/nr_pdcp.h>
|
||||
#include <softmodem-common.h>
|
||||
#include <split_headers.h>
|
||||
#include <proto_agent.h>
|
||||
|
||||
#include "gnb_app.h"
|
||||
#include "gnb_config.h"
|
||||
@@ -43,7 +47,11 @@
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "f1ap_cu_task.h"
|
||||
#include "f1ap_du_task.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include <openair2/LAYER2/nr_pdcp/nr_pdcp.h>
|
||||
#include "openair2/LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
extern unsigned char NB_gNB_INST;
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
@@ -61,7 +69,7 @@ static void configure_nr_rrc(uint32_t gnb_id)
|
||||
if (RC.nrrrc[gnb_id]) {
|
||||
RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
|
||||
|
||||
|
||||
LOG_I(GNB_APP, "RRC starting with node type %d\n", RC.nrrrc[gnb_id]->node_type);
|
||||
LOG_I(GNB_APP,"Sending configuration message to NR_RRC task\n");
|
||||
itti_send_msg_to_task (TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
|
||||
@@ -82,26 +90,25 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//,
|
||||
{
|
||||
if(NGAP_CONF_MODE){
|
||||
ngap_register_gnb_req_t *ngap_register_gNB; //Type Temporarily reuse
|
||||
|
||||
// note: there is an implicit relationship between the data structure and the message name
|
||||
|
||||
// note: there is an implicit relationship between the data structure and the message name
|
||||
msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, NGAP_REGISTER_GNB_REQ); //Message Temporarily reuse
|
||||
|
||||
RCconfig_NR_NG(msg_p, gnb_id);
|
||||
|
||||
|
||||
ngap_register_gNB = &NGAP_REGISTER_GNB_REQ(msg_p); //Message Temporarily reuse
|
||||
|
||||
LOG_I(GNB_APP,"default drx %d\n",ngap_register_gNB->default_drx);
|
||||
|
||||
itti_send_msg_to_task (TASK_NGAP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
}
|
||||
LOG_I(GNB_APP,"default drx %d\n",ngap_register_gNB->default_drx);
|
||||
|
||||
itti_send_msg_to_task (TASK_NGAP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
}
|
||||
if (gnb_id == 0) RCconfig_nr_gtpu();
|
||||
|
||||
LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id));
|
||||
|
||||
register_gnb_pending++;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id));
|
||||
|
||||
register_gnb_pending++;
|
||||
}
|
||||
|
||||
return register_gnb_pending;
|
||||
}
|
||||
@@ -126,15 +133,42 @@ static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end)
|
||||
return register_gnb_x2_pending;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
static void init_pdcp(void) {
|
||||
if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
|
||||
pdcp_layer_init();
|
||||
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
if (IS_SOFTMODEM_NOS1) {
|
||||
LOG_I(PDCP, "IS_SOFTMODEM_NOS1 option enabled\n");
|
||||
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
|
||||
}
|
||||
|
||||
nr_pdcp_module_init(pdcp_initmask, 0);
|
||||
|
||||
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
|
||||
} else {
|
||||
LOG_I(PDCP, "node is gNB \n");
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
}
|
||||
} else {
|
||||
LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
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 gnb_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
const char *msg_name = NULL;
|
||||
@@ -143,13 +177,14 @@ void *gNB_app_task(void *args_p)
|
||||
/* for no gcc warnings */
|
||||
(void)instance;
|
||||
|
||||
int cell_to_activate = 0;
|
||||
itti_mark_task_ready (TASK_GNB_APP);
|
||||
|
||||
LOG_I(PHY, "%s() Task ready initialize structures\n", __FUNCTION__);
|
||||
|
||||
RCconfig_NR_L1();
|
||||
|
||||
RCconfig_nr_macrlc();
|
||||
if (RC.nb_nr_macrlc_inst>0) RCconfig_nr_macrlc();
|
||||
|
||||
LOG_I(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
|
||||
|
||||
@@ -171,19 +206,43 @@ void *gNB_app_task(void *args_p)
|
||||
configure_nr_rrc(gnb_id);
|
||||
}
|
||||
|
||||
if (RC.nb_nr_inst > 0) {
|
||||
init_pdcp();
|
||||
}
|
||||
|
||||
if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(RC.rrc[0]->node_type)
|
||||
LOG_I(X2AP, "X2AP enabled \n");
|
||||
__attribute__((unused)) uint32_t x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end);
|
||||
}
|
||||
|
||||
if (AMF_MODE_ENABLED) {
|
||||
/* Try to register each gNB */
|
||||
//registered_gnb = 0;
|
||||
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
|
||||
} else {
|
||||
/* Start L2L1 task */
|
||||
msg_p = itti_alloc_new_message(TASK_GNB_APP, 0, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task(TASK_L2L1, INSTANCE_DEFAULT, msg_p);
|
||||
/* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info
|
||||
* can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/
|
||||
if ((AMF_MODE_ENABLED || is_x2ap_enabled()) && !NODE_IS_DU(RC.nrrrc[0]->node_type) && !NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
/* Try to register each gNB */
|
||||
//registered_gnb = 0;
|
||||
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
|
||||
}
|
||||
|
||||
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
|
||||
if (itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL) < 0) {
|
||||
LOG_E(F1AP, "Create task for F1AP CU failed\n");
|
||||
AssertFatal(1==0,"exiting");
|
||||
}
|
||||
}
|
||||
|
||||
if (NODE_IS_DU(RC.nrrrc[0]->node_type)) {
|
||||
|
||||
if (itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL) < 0) {
|
||||
LOG_E(F1AP, "Create task for F1AP DU failed\n");
|
||||
AssertFatal(1==0,"exiting");
|
||||
}
|
||||
// configure F1AP here for F1C
|
||||
LOG_I(GNB_APP,"ngran_gNB_DU: Allocating ITTI message for F1AP_SETUP_REQ\n");
|
||||
msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_SETUP_REQ);
|
||||
RCconfig_NR_DU_F1(msg_p, 0);
|
||||
|
||||
itti_send_msg_to_task (TASK_DU_F1, GNB_MODULE_ID_TO_INSTANCE(0), msg_p);
|
||||
}
|
||||
|
||||
do {
|
||||
@@ -247,6 +306,29 @@ void *gNB_app_task(void *args_p)
|
||||
*/
|
||||
break;
|
||||
|
||||
case F1AP_SETUP_RESP:
|
||||
AssertFatal(NODE_IS_DU(RC.nrrrc[0]->node_type), "Should not have received F1AP_SETUP_RESP in CU/gNB\n");
|
||||
|
||||
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
|
||||
F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
|
||||
cell_to_activate = F1AP_SETUP_RESP(msg_p).num_cells_to_activate;
|
||||
|
||||
gNB_app_handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
|
||||
|
||||
break;
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE:
|
||||
AssertFatal(NODE_IS_DU(RC.nrrrc[0]->node_type), "Should not have received F1AP_GNB_CU_CONFIGURATION_UPDATE in CU/gNB\n");
|
||||
|
||||
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).gNB_CU_name,F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate);
|
||||
|
||||
cell_to_activate += F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate;
|
||||
gNB_app_handle_f1ap_gnb_cu_configuration_update(&F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p));
|
||||
|
||||
/* Check if at least gNB is registered with one AMF */
|
||||
AssertFatal(cell_to_activate == 1,"No cells to activate or cells > 1 %d\n",cell_to_activate);
|
||||
|
||||
break;
|
||||
case NGAP_DEREGISTERED_GNB_IND:
|
||||
LOG_W(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name,
|
||||
NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf);
|
||||
|
||||
+765
-22
@@ -35,6 +35,7 @@
|
||||
#include "assertions.h"
|
||||
#include "gnb_config.h"
|
||||
#include "gnb_paramdef.h"
|
||||
#include "enb_paramdef.h"
|
||||
#include "UTIL/OTG/otg.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
#include "intertask_interface.h"
|
||||
@@ -42,6 +43,7 @@
|
||||
#include "ngap_gNB.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "sctp_default_values.h"
|
||||
#include "F1AP_CauseRadioNetwork.h"
|
||||
// #include "SystemInformationBlockType2.h"
|
||||
// #include "LAYER2/MAC/extern.h"
|
||||
// #include "LAYER2/MAC/proto.h"
|
||||
@@ -53,11 +55,12 @@
|
||||
|
||||
//#include "L1_paramdef.h"
|
||||
#include "L1_nr_paramdef.h"
|
||||
#include "MACRLC_paramdef.h"
|
||||
#include "MACRLC_nr_paramdef.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
//#include "RRC_config_tools.h"
|
||||
#include "gnb_paramdef.h"
|
||||
#include "NR_MAC_gNB/mac_proto.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
#include "NR_asn_constant.h"
|
||||
#include "executables/thread-common.h"
|
||||
@@ -77,7 +80,12 @@
|
||||
#include "NR_ControlResourceSet.h"
|
||||
#include "NR_EUTRA-MBSFN-SubframeConfig.h"
|
||||
|
||||
#include "RRC/NR/MESSAGES/asn1_msg.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp.h"
|
||||
|
||||
extern uint16_t sf_ahead;
|
||||
int macrlc_has_f1 = 0;
|
||||
extern ngran_node_t node_type;
|
||||
|
||||
extern int config_check_band_frequencies(int ind, int16_t band, uint64_t downlink_frequency,
|
||||
int32_t uplink_frequency_offset, uint32_t frame_type);
|
||||
@@ -123,7 +131,37 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon));
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero = CALLOC(1,sizeof(long));
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero = CALLOC(1,sizeof(long));
|
||||
// scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = CALLOC(1,sizeof(struct NR_ControlResourceSet));
|
||||
|
||||
NR_ControlResourceSet_t *coreset0 = CALLOC(1,sizeof(struct NR_ControlResourceSet));
|
||||
coreset0->controlResourceSetId = 0;
|
||||
// frequencyDomainResources '11111111 00000000 00000000 00000000 00000000 00000'B,
|
||||
if(coreset0->frequencyDomainResources.buf == NULL) coreset0->frequencyDomainResources.buf = calloc(1,6);
|
||||
coreset0->frequencyDomainResources.buf[0] = 0xff;
|
||||
coreset0->frequencyDomainResources.buf[1] = 0;
|
||||
coreset0->frequencyDomainResources.buf[2] = 0;
|
||||
coreset0->frequencyDomainResources.buf[3] = 0;
|
||||
coreset0->frequencyDomainResources.buf[4] = 0;
|
||||
coreset0->frequencyDomainResources.buf[5] = 0;
|
||||
coreset0->frequencyDomainResources.size = 6;
|
||||
coreset0->frequencyDomainResources.bits_unused = 3;
|
||||
coreset0->duration = 1;
|
||||
coreset0->cce_REG_MappingType.present=NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved;
|
||||
coreset0->cce_REG_MappingType.choice.interleaved=calloc(1,sizeof(*coreset0->cce_REG_MappingType.choice.interleaved));
|
||||
coreset0->cce_REG_MappingType.choice.interleaved->reg_BundleSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6;
|
||||
coreset0->cce_REG_MappingType.choice.interleaved->interleaverSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n2;
|
||||
coreset0->cce_REG_MappingType.choice.interleaved->shiftIndex = scc->physCellId;
|
||||
coreset0->precoderGranularity = NR_ControlResourceSet__precoderGranularity_sameAsREG_bundle;
|
||||
if(coreset0->tci_StatesPDCCH_ToAddList == NULL) coreset0->tci_StatesPDCCH_ToAddList = calloc(1,sizeof(*coreset0->tci_StatesPDCCH_ToAddList));
|
||||
NR_TCI_StateId_t *tci[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
tci[i]=calloc(1,sizeof(*tci[i]));
|
||||
*tci[i] = i;
|
||||
ASN_SEQUENCE_ADD(&coreset0->tci_StatesPDCCH_ToAddList->list,tci[i]);
|
||||
}
|
||||
coreset0->tci_StatesPDCCH_ToReleaseList = NULL;
|
||||
coreset0->tci_PresentInDCI = NULL;
|
||||
coreset0->pdcch_DMRS_ScramblingID = NULL;
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = coreset0;
|
||||
|
||||
// scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList));
|
||||
// scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
@@ -291,6 +329,167 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
|
||||
free(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing);
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=NULL;
|
||||
}
|
||||
|
||||
// check pucch_ResourceConfig
|
||||
AssertFatal(*scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon < 2,
|
||||
"pucch_ResourceConfig should be 0 or 1 for now\n");
|
||||
}
|
||||
|
||||
/* Function to allocate dedicated serving cell config strutures */
|
||||
void prepare_scd(NR_ServingCellConfig_t *scd) {
|
||||
// Allocate downlink structures
|
||||
|
||||
scd->downlinkBWP_ToAddModList = CALLOC(1, sizeof(*scd->downlinkBWP_ToAddModList));
|
||||
|
||||
// Downlink bandwidth part
|
||||
NR_BWP_Downlink_t *bwp = calloc(1, sizeof(*bwp));
|
||||
bwp->bwp_Id = 1;
|
||||
|
||||
// Allocate downlink dedicated bandwidth part and PDSCH structures
|
||||
bwp->bwp_Dedicated = calloc(1, sizeof(*bwp->bwp_Dedicated));
|
||||
bwp->bwp_Dedicated->pdsch_Config = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config));
|
||||
bwp->bwp_Dedicated->pdsch_Config->present = NR_SetupRelease_PDSCH_Config_PR_setup;
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup));
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA));
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->present = NR_SetupRelease_DMRS_DownlinkConfig_PR_setup;
|
||||
|
||||
// Allocate DL DMRS and PTRS configuration
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup));
|
||||
NR_DMRS_DownlinkConfig_t *NR_DMRS_DownlinkCfg = bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
|
||||
NR_DMRS_DownlinkCfg->phaseTrackingRS=CALLOC(1, sizeof(*NR_DMRS_DownlinkCfg->phaseTrackingRS));
|
||||
NR_DMRS_DownlinkCfg->phaseTrackingRS->present = NR_SetupRelease_PTRS_DownlinkConfig_PR_setup;
|
||||
NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup = CALLOC(1, sizeof(*NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup));
|
||||
NR_PTRS_DownlinkConfig_t *NR_PTRS_DownlinkCfg = NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup;
|
||||
NR_PTRS_DownlinkCfg->frequencyDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->frequencyDensity));
|
||||
long *dl_rbs = CALLOC(2, sizeof(long));
|
||||
for (int i=0;i<2;i++) {
|
||||
ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->frequencyDensity->list, &dl_rbs[i]);
|
||||
}
|
||||
NR_PTRS_DownlinkCfg->timeDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->timeDensity));
|
||||
long *dl_mcs = CALLOC(3, sizeof(long));
|
||||
for (int i=0;i<3;i++) {
|
||||
ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->timeDensity->list, &dl_mcs[i]);
|
||||
}
|
||||
NR_PTRS_DownlinkCfg->epre_Ratio = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->epre_Ratio));
|
||||
NR_PTRS_DownlinkCfg->resourceElementOffset = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->resourceElementOffset));
|
||||
*NR_PTRS_DownlinkCfg->resourceElementOffset = 0;
|
||||
ASN_SEQUENCE_ADD(&scd->downlinkBWP_ToAddModList->list,bwp);
|
||||
|
||||
// Allocate uplink structures
|
||||
|
||||
scd->uplinkConfig = CALLOC(1, sizeof(*scd->uplinkConfig));
|
||||
scd->uplinkConfig->uplinkBWP_ToAddModList = CALLOC(1, sizeof(*scd->uplinkConfig->uplinkBWP_ToAddModList));
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = CALLOC(1, sizeof(*pusch_Config));
|
||||
|
||||
// Allocate UL DMRS and PTRS structures
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB = CALLOC(1, sizeof(*pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB));
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->present = NR_SetupRelease_DMRS_UplinkConfig_PR_setup;
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup = CALLOC(1, sizeof(*pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup));
|
||||
NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
|
||||
NR_DMRS_UplinkConfig->phaseTrackingRS = CALLOC(1, sizeof(*NR_DMRS_UplinkConfig->phaseTrackingRS));
|
||||
NR_DMRS_UplinkConfig->phaseTrackingRS->present = NR_SetupRelease_PTRS_UplinkConfig_PR_setup;
|
||||
NR_DMRS_UplinkConfig->phaseTrackingRS->choice.setup = CALLOC(1, sizeof(*NR_DMRS_UplinkConfig->phaseTrackingRS->choice.setup));
|
||||
NR_PTRS_UplinkConfig_t *NR_PTRS_UplinkConfig = NR_DMRS_UplinkConfig->phaseTrackingRS->choice.setup;
|
||||
NR_PTRS_UplinkConfig->transformPrecoderDisabled = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled));
|
||||
NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity));
|
||||
long *n_rbs = CALLOC(2, sizeof(long));
|
||||
for (int i=0;i<2;i++) {
|
||||
ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity->list, &n_rbs[i]);
|
||||
}
|
||||
NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity));
|
||||
long *ptrs_mcs = CALLOC(3, sizeof(long));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity->list, &ptrs_mcs[i]);
|
||||
}
|
||||
NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset));
|
||||
*NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset = 0;
|
||||
|
||||
// UL bandwidth part
|
||||
NR_BWP_Uplink_t *ubwp = CALLOC(1, sizeof(*ubwp));
|
||||
ubwp->bwp_Id = 1;
|
||||
ubwp->bwp_Dedicated = CALLOC(1, sizeof(*ubwp->bwp_Dedicated));
|
||||
|
||||
ubwp->bwp_Dedicated->pusch_Config = CALLOC(1, sizeof(*ubwp->bwp_Dedicated->pusch_Config));
|
||||
ubwp->bwp_Dedicated->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
|
||||
ubwp->bwp_Dedicated->pusch_Config->choice.setup = pusch_Config;
|
||||
|
||||
ASN_SEQUENCE_ADD(&scd->uplinkConfig->uplinkBWP_ToAddModList->list,ubwp);
|
||||
}
|
||||
|
||||
/* This function checks dedicated serving cell configuration and performs fixes as needed */
|
||||
void fix_scd(NR_ServingCellConfig_t *scd) {
|
||||
// Check for DL PTRS parameters validity
|
||||
if (scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS) {
|
||||
// If any of the frequencyDensity values are not set or are out of bounds, PTRS is assumed to be not present
|
||||
for (int i = scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.count-1; i >= 0; i--) {
|
||||
if ((*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.array[i] < 1)
|
||||
|| (*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.array[i] > 276)) {
|
||||
LOG_I(RRC, "DL PTRS frequencyDensity %d not set. Assuming PTRS not present! \n", i);
|
||||
free(scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS);
|
||||
scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS) {
|
||||
// If any of the timeDensity values are not set or are out of bounds, PTRS is assumed to be not present
|
||||
for (int i = scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list.count-1; i >= 0; i--) {
|
||||
if ((*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list.array[i] < 0)
|
||||
|| (*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->timeDensity->list.array[i] > 29)) {
|
||||
LOG_I(RRC, "DL PTRS timeDensity %d not set. Assuming PTRS not present! \n", i);
|
||||
free(scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS);
|
||||
scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS) {
|
||||
if (*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->resourceElementOffset > 2) {
|
||||
LOG_I(RRC, "Freeing DL PTRS resourceElementOffset \n");
|
||||
free(scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->resourceElementOffset);
|
||||
scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->resourceElementOffset = NULL;
|
||||
}
|
||||
if (*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->epre_Ratio > 1) {
|
||||
LOG_I(RRC, "Freeing DL PTRS epre_Ratio \n");
|
||||
free(scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->epre_Ratio);
|
||||
scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->epre_Ratio = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS) {
|
||||
// If any of the frequencyDensity values are not set or are out of bounds, PTRS is assumed to be not present
|
||||
for (int i = scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.count-1; i >= 0; i--) {
|
||||
if ((*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[i] < 1)
|
||||
|| (*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[i] > 276)) {
|
||||
LOG_I(RRC, "UL PTRS frequencyDensity %d not set. Assuming PTRS not present! \n", i);
|
||||
free(scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS);
|
||||
scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS) {
|
||||
// If any of the timeDensity values are not set or are out of bounds, PTRS is assumed to be not present
|
||||
for (int i = scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.count-1; i >= 0; i--) {
|
||||
if ((*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[i] < 0)
|
||||
|| (*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[i] > 29)) {
|
||||
LOG_I(RRC, "UL PTRS timeDensity %d not set. Assuming PTRS not present! \n", i);
|
||||
free(scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS);
|
||||
scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS) {
|
||||
// Check for UL PTRS parameters validity
|
||||
if (*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->resourceElementOffset > 2) {
|
||||
LOG_I(RRC, "Freeing UL PTRS resourceElementOffset \n");
|
||||
free(scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->resourceElementOffset);
|
||||
scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->resourceElementOffset = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RCconfig_nr_flexran()
|
||||
@@ -399,11 +598,13 @@ void RCconfig_NR_L1(void) {
|
||||
RC.gNB[j] = (PHY_VARS_gNB *)malloc(sizeof(PHY_VARS_gNB));
|
||||
LOG_I(NR_PHY,"RC.gNB[%d] = %p\n",j,RC.gNB[j]);
|
||||
memset(RC.gNB[j],0,sizeof(PHY_VARS_gNB));
|
||||
RC.gNB[j]->Mod_id = j;
|
||||
RC.gNB[j]->Mod_id = j;
|
||||
}
|
||||
|
||||
RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr);
|
||||
|
||||
RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->pusch_thres = *(L1_ParamList.paramarray[j][L1_PUSCH_DTX_THRESHOLD].uptr);
|
||||
if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
|
||||
//sf_ahead = 2; // Need 4 subframe gap between RX and TX
|
||||
}else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
|
||||
@@ -424,15 +625,17 @@ void RCconfig_NR_L1(void) {
|
||||
RC.nb_nr_CC = (int *)malloc((1+RC.nb_nr_inst)*sizeof(int));
|
||||
RC.nb_nr_CC[0]=1;
|
||||
|
||||
RC.nb_nr_inst =1; // DJP - feptx_prec uses num_gNB but phy_init_RU uses nb_nr_inst
|
||||
|
||||
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_nr_inst=1 this is because phy_init_RU() uses that to index and not RC.num_gNB - why the 2 similar variables?\n", __FUNCTION__);
|
||||
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_nr_CC[0]=%d for init_gNB_afterRU()\n", __FUNCTION__, RC.nb_nr_CC[0]);
|
||||
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_nr_macrlc_inst:%d because used by mac_top_init_gNB()\n", __FUNCTION__, RC.nb_nr_macrlc_inst);
|
||||
|
||||
mac_top_init_gNB();
|
||||
|
||||
configure_nr_nfapi_pnf(RC.gNB[j]->eth_params_n.remote_addr, RC.gNB[j]->eth_params_n.remote_portc, RC.gNB[j]->eth_params_n.my_addr, RC.gNB[j]->eth_params_n.my_portd, RC.gNB[j]->eth_params_n .remote_portd);
|
||||
configure_nr_nfapi_pnf(RC.gNB[j]->eth_params_n.remote_addr,
|
||||
RC.gNB[j]->eth_params_n.remote_portc,
|
||||
RC.gNB[j]->eth_params_n.my_addr,
|
||||
RC.gNB[j]->eth_params_n.my_portd,
|
||||
RC.gNB[j]->eth_params_n.remote_portd);
|
||||
}else { // other midhaul
|
||||
}
|
||||
}// for (j = 0; j < RC.nb_nr_L1_inst; j++)
|
||||
@@ -471,10 +674,25 @@ void RCconfig_nr_macrlc() {
|
||||
|
||||
for (j=0;j<RC.nb_nr_macrlc_inst;j++) {
|
||||
RC.nb_nr_mac_CC[j] = *(MacRLC_ParamList.paramarray[j][MACRLC_CC_IDX].iptr);
|
||||
|
||||
RC.nrmac[j]->pusch_target_snrx10 = *(MacRLC_ParamList.paramarray[j][MACRLC_PUSCHTARGETSNRX10_IDX].iptr);
|
||||
RC.nrmac[j]->pucch_target_snrx10 = *(MacRLC_ParamList.paramarray[j][MACRLC_PUCCHTARGETSNRX10_IDX].iptr);
|
||||
RC.nrmac[j]->pucch_failure_thres = *(MacRLC_ParamList.paramarray[j][MACRLC_PUCCHFAILURETHRES_IDX].iptr);
|
||||
RC.nrmac[j]->pusch_failure_thres = *(MacRLC_ParamList.paramarray[j][MACRLC_PUSCHFAILURETHRES_IDX].iptr);
|
||||
|
||||
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) {
|
||||
// check number of instances is same as RRC/PDCP
|
||||
|
||||
}else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) {
|
||||
printf("Configuring F1 interfaces for MACRLC\n");
|
||||
RC.nrmac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
|
||||
RC.nrmac[j]->eth_params_n.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr));
|
||||
RC.nrmac[j]->eth_params_n.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr));
|
||||
RC.nrmac[j]->eth_params_n.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTC_IDX].iptr);
|
||||
RC.nrmac[j]->eth_params_n.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTC_IDX].iptr);
|
||||
RC.nrmac[j]->eth_params_n.my_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTD_IDX].iptr);
|
||||
RC.nrmac[j]->eth_params_n.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTD_IDX].iptr);;
|
||||
RC.nrmac[j]->eth_params_n.transp_preference = ETH_UDP_MODE;
|
||||
macrlc_has_f1 = 1;
|
||||
}else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "cudu") == 0) {
|
||||
RC.nrmac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
|
||||
RC.nrmac[j]->eth_params_n.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr));
|
||||
@@ -500,17 +718,17 @@ void RCconfig_nr_macrlc() {
|
||||
RC.nrmac[j]->eth_params_s.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr);
|
||||
RC.nrmac[j]->eth_params_s.transp_preference = ETH_UDP_MODE;
|
||||
|
||||
//sf_ahead = 2; // Cannot cope with 4 subframes between RX and TX - set it to 2
|
||||
|
||||
printf("**************** vnf_port:%d\n", RC.nrmac[j]->eth_params_s.my_portc);
|
||||
configure_nr_nfapi_vnf(RC.nrmac[j]->eth_params_s.my_addr, RC.nrmac[j]->eth_params_s.my_portc);
|
||||
printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.nrmac[j]->eth_params_s.my_portc);
|
||||
}else { // other midhaul
|
||||
AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
|
||||
}
|
||||
RC.nrmac[j]->ulsch_max_slots_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_SLOTS_INACTIVITY].uptr);
|
||||
}// for (j=0;j<RC.nb_nr_macrlc_inst;j++)
|
||||
}else {// MacRLC_ParamList.numelt > 0
|
||||
AssertFatal (0,"No " CONFIG_STRING_MACRLC_LIST " configuration found");
|
||||
LOG_E(PHY,"No %s configuration found\n", CONFIG_STRING_MACRLC_LIST);
|
||||
// AssertFatal (0,"No " CONFIG_STRING_MACRLC_LIST " configuration found");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -615,7 +833,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
int num_gnbs = 0;
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
int32_t gnb_id = 0;
|
||||
int k;
|
||||
int k = 0;
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
////////// Identification parameters
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
@@ -627,6 +846,13 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
prepare_scc(scc);
|
||||
paramdef_t SCCsParams[] = SCCPARAMS_DESC(scc);
|
||||
paramlist_def_t SCCsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, NULL, 0};
|
||||
|
||||
// Serving Cell Config Dedicated
|
||||
NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t));
|
||||
memset((void*)scd,0,sizeof(NR_ServingCellConfig_t));
|
||||
prepare_scd(scd);
|
||||
paramdef_t SCDsParams[] = SCDPARAMS_DESC(scd);
|
||||
paramlist_def_t SCDsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, NULL, 0};
|
||||
////////// Physical parameters
|
||||
|
||||
|
||||
@@ -700,7 +926,59 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
(int)scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower);
|
||||
fix_scc(scc,ssb_bitmap);
|
||||
}
|
||||
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
|
||||
config_getlist(&SCDsParamList, NULL, 0, aprefix);
|
||||
if (SCDsParamList.numelt > 0) {
|
||||
sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, 0);
|
||||
config_get( SCDsParams,sizeof(SCDsParams)/sizeof(paramdef_t),aprefix);
|
||||
LOG_I(RRC,"Read in ServingCellConfigDedicated UL (FreqDensity_0 %d, FreqDensity_1 %d, TimeDensity_0 %d, TimeDensity_1 %d, TimeDensity_2 %d, RE offset %d \n",
|
||||
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[0],
|
||||
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[1],
|
||||
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[0],
|
||||
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[1],
|
||||
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->timeDensity->list.array[2],
|
||||
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->resourceElementOffset);
|
||||
}
|
||||
fix_scd(scd);
|
||||
|
||||
printf("NRRRC %d: Southbound Transport %s\n",i,*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr));
|
||||
|
||||
if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "f1") == 0) {
|
||||
paramdef_t SCTPParams[] = GNBSCTPPARAMS_DESC;
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(aprefix,"%s.[%u].%s",GNB_CONFIG_STRING_GNB_LIST,i,GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
config_get(SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
|
||||
rrc->node_id = *(GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr);
|
||||
LOG_I(GNB_APP,"F1AP: gNB_CU_id[%d] %d\n",k,rrc->node_id);
|
||||
rrc->node_name = strdup(*(GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr));
|
||||
LOG_I(GNB_APP,"F1AP: gNB_CU_name[%d] %s\n",k,rrc->node_name);
|
||||
rrc->eth_params_s.local_if_name = strdup(*(GNBParamList.paramarray[i][GNB_LOCAL_S_IF_NAME_IDX].strptr));
|
||||
rrc->eth_params_s.my_addr = strdup(*(GNBParamList.paramarray[i][GNB_LOCAL_S_ADDRESS_IDX].strptr));
|
||||
rrc->eth_params_s.remote_addr = strdup(*(GNBParamList.paramarray[i][GNB_REMOTE_S_ADDRESS_IDX].strptr));
|
||||
rrc->eth_params_s.my_portc = *(GNBParamList.paramarray[i][GNB_LOCAL_S_PORTC_IDX].uptr);
|
||||
rrc->eth_params_s.remote_portc = *(GNBParamList.paramarray[i][GNB_REMOTE_S_PORTC_IDX].uptr);
|
||||
rrc->eth_params_s.my_portd = *(GNBParamList.paramarray[i][GNB_LOCAL_S_PORTD_IDX].uptr);
|
||||
rrc->eth_params_s.remote_portd = *(GNBParamList.paramarray[i][GNB_REMOTE_S_PORTD_IDX].uptr);
|
||||
rrc->eth_params_s.transp_preference = ETH_UDP_MODE;
|
||||
rrc->node_type = ngran_gNB_CU;
|
||||
rrc->sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
|
||||
rrc->sctp_out_streams = (uint16_t)*(SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
|
||||
} else {
|
||||
// set to ngran_gNB for now, it will get set to ngran_gNB_DU if macrlc entity which uses F1 is present
|
||||
// Note: we will have to handle the case of ngran_ng_gNB_DU
|
||||
if (macrlc_has_f1 == 0) {
|
||||
rrc->node_type = ngran_gNB;
|
||||
LOG_I(NR_RRC,"Setting node_type to ngran_gNB\n");
|
||||
} else {
|
||||
rrc->node_type = ngran_gNB_DU;
|
||||
LOG_I(NR_RRC,"Setting node_type to ngran_gNB_DU\n");
|
||||
}
|
||||
}
|
||||
|
||||
rrc->nr_cellid = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr);
|
||||
|
||||
if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) {
|
||||
|
||||
} else if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "cudu") == 0) {
|
||||
@@ -750,7 +1028,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
|
||||
PLMNParamList.numelt);
|
||||
|
||||
RRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt;
|
||||
NRRRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt;
|
||||
|
||||
for (int l = 0; l < PLMNParamList.numelt; ++l) {
|
||||
|
||||
@@ -765,15 +1043,15 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr;
|
||||
printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr;
|
||||
printf("pusch_TargetSNRx10 %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_TARGETPOW_X10_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pusch_TargetSNRx10 = *GNBParamList.paramarray[i][GNB_PUSCH_TARGETPOW_X10_IDX].iptr;
|
||||
printf("pucch_TargetSNRx10 %d\n",*GNBParamList.paramarray[i][GNB_PUCCH_TARGETPOW_X10_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pucch_TargetSNRx10 = *GNBParamList.paramarray[i][GNB_PUCCH_TARGETPOW_X10_IDX].iptr;
|
||||
printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).scc = scc;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).scd = scd;
|
||||
|
||||
|
||||
}//
|
||||
}//End for (k=0; k <num_gnbs ; k++)
|
||||
memcpy(&rrc->configuration, &NRRRC_CONFIGURATION_REQ(msg_p), sizeof(NRRRC_CONFIGURATION_REQ(msg_p)));
|
||||
}//End if (num_gnbs>0)
|
||||
|
||||
config_security(rrc);
|
||||
@@ -828,20 +1106,25 @@ int RCconfig_nr_gtpu(void ) {
|
||||
MessageDef *message;
|
||||
|
||||
if (gnb_mode == 1) { // NSA
|
||||
AssertFatal((message = itti_alloc_new_message(TASK_GNB_APP, 0, GTPV1U_ENB_S1_REQ))!=NULL,"");
|
||||
message = itti_alloc_new_message(TASK_GNB_APP, 0, GTPV1U_ENB_S1_REQ);
|
||||
AssertFatal(message!=NULL,"");
|
||||
// IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
|
||||
// LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up);
|
||||
IPV4_STR_ADDR_TO_INT_NWBO (address, GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
|
||||
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up);
|
||||
GTPV1U_ENB_S1_REQ(message).enb_port_for_S1u_S12_S4_up = gnb_port_for_S1U;
|
||||
strcpy(GTPV1U_ENB_S1_REQ(message).addrStr,address);
|
||||
sprintf(GTPV1U_ENB_S1_REQ(message).portStr,"%d", gnb_port_for_NGU);
|
||||
} else {// TODO SA
|
||||
AssertFatal((message = itti_alloc_new_message(TASK_GNB_APP, 0, GTPV1U_GNB_NG_REQ))!=NULL,"");
|
||||
message = itti_alloc_new_message(TASK_GNB_APP, 0, GTPV1U_GNB_NG_REQ);
|
||||
AssertFatal(message!=NULL,"");
|
||||
IPV4_STR_ADDR_TO_INT_NWBO (address, GTPV1U_GNB_NG_REQ(message).gnb_ip_address_for_NGu_up, "BAD IP ADDRESS FORMAT FOR gNB NG_U !\n" );
|
||||
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_GNB_NG_REQ(message).gnb_ip_address_for_NGu_up);
|
||||
GTPV1U_GNB_NG_REQ(message).gnb_port_for_NGu_up = gnb_port_for_NGU;
|
||||
strcpy(GTPV1U_GNB_NG_REQ(message).addrStr,address);
|
||||
sprintf(GTPV1U_GNB_NG_REQ(message).portStr,"%d", gnb_port_for_NGU);
|
||||
}
|
||||
|
||||
itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
} else
|
||||
LOG_E(GTPU,"invalid address for NGU\n");
|
||||
|
||||
@@ -1019,10 +1302,12 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv6 = 1;
|
||||
}
|
||||
|
||||
/* not in configuration yet ...
|
||||
if (NGParamList.paramarray[l][GNB_AMF_BROADCAST_PLMN_INDEX].iptr)
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = NGParamList.paramarray[l][GNB_AMF_BROADCAST_PLMN_INDEX].numelt;
|
||||
else
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = 0;
|
||||
*/
|
||||
|
||||
AssertFatal(NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] <= NGAP_REGISTER_GNB_REQ(msg_p).num_plmn,
|
||||
"List of broadcast PLMN to be sent to AMF can not be longer than actual "
|
||||
@@ -1129,7 +1414,7 @@ void NRRCConfig(void) {
|
||||
|
||||
// Get num MACRLC instances
|
||||
config_getlist( &MACRLCParamList,NULL,0, NULL);
|
||||
RC.nb_macrlc_inst = MACRLCParamList.numelt;
|
||||
RC.nb_nr_macrlc_inst = MACRLCParamList.numelt;
|
||||
// Get num L1 instances
|
||||
config_getlist( &L1ParamList,NULL,0, NULL);
|
||||
RC.nb_nr_L1_inst = L1ParamList.numelt;
|
||||
@@ -1348,3 +1633,461 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
int k;
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
|
||||
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal (i < num_gnbs,
|
||||
"Failed to parse config file no %uth element in %s \n",i, GNB_CONFIG_STRING_ACTIVE_GNBS);
|
||||
|
||||
if (num_gnbs > 0) {
|
||||
// Output a list of all eNBs.
|
||||
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
|
||||
AssertFatal(GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr != NULL,
|
||||
"gNB id %u is not defined in configuration file\n",i);
|
||||
F1AP_SETUP_REQ (msg_p).num_cells_available = 0;
|
||||
|
||||
for (k=0; k <num_gnbs ; k++) {
|
||||
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[k], *(GNBParamList.paramarray[i][GNB_GNB_NAME_IDX].strptr)) == 0) {
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(aprefix,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
|
||||
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
|
||||
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
|
||||
|
||||
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
|
||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||
|
||||
config_getlist(&PLMNParamList, PLMNParams, sizeof(PLMNParams)/sizeof(paramdef_t), aprefix);
|
||||
paramdef_t SCTPParams[] = SCTPPARAMS_DESC;
|
||||
F1AP_SETUP_REQ (msg_p).num_cells_available++;
|
||||
F1AP_SETUP_REQ (msg_p).gNB_DU_id = *(GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr);
|
||||
LOG_I(GNB_APP,"F1AP: gNB_DU_id[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_id);
|
||||
F1AP_SETUP_REQ (msg_p).gNB_DU_name = strdup(*(GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr));
|
||||
LOG_I(GNB_APP,"F1AP: gNB_DU_name[%d] %s\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_name);
|
||||
F1AP_SETUP_REQ (msg_p).tac[k] = *GNBParamList.paramarray[i][GNB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).tac[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mcc[k] = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mcc[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mnc[k] = *PLMNParamList.paramarray[0][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] = *PLMNParamList.paramarray[0][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
LOG_I(GNB_APP,"F1AP: mnc_digit_length[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
|
||||
AssertFatal((F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 2) ||
|
||||
(F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 3),
|
||||
"BAD MNC DIGIT LENGTH %d",
|
||||
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
|
||||
F1AP_SETUP_REQ (msg_p).nr_cellid[k] = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr);
|
||||
LOG_I(GNB_APP,"F1AP: nr_cellid[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).nr_cellid[k]);
|
||||
LOG_I(GNB_APP,"F1AP: CU_ip4_address in DU %s\n",RC.nrmac[k]->eth_params_n.remote_addr);
|
||||
LOG_I(GNB_APP,"FIAP: CU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv4_address,(int)strlen(RC.nrmac[k]->eth_params_n.remote_addr));
|
||||
F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv6 = 0;
|
||||
F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv4 = 1;
|
||||
//strcpy(F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv6_address, "");
|
||||
strcpy(F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv4_address, RC.nrmac[k]->eth_params_n.remote_addr);
|
||||
LOG_I(GNB_APP,"F1AP: DU_ip4_address in DU %s\n",RC.nrmac[k]->eth_params_n.my_addr);
|
||||
LOG_I(GNB_APP,"FIAP: DU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4_address,(int)strlen(RC.nrmac[k]->eth_params_n.my_addr));
|
||||
F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv6 = 0;
|
||||
F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4 = 1;
|
||||
//strcpy(F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv6_address, "");
|
||||
strcpy(F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4_address, RC.nrmac[k]->eth_params_n.my_addr);
|
||||
//strcpy(F1AP_SETUP_REQ (msg_p).CU_ip_address[l].ipv6_address,*(F1ParamList.paramarray[l][ENB_CU_IPV6_ADDRESS_IDX].strptr));
|
||||
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
config_get(SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
|
||||
F1AP_SETUP_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
|
||||
F1AP_SETUP_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[k];
|
||||
// wait until RRC cell information is configured
|
||||
int cell_info_configured = 0;
|
||||
|
||||
do {
|
||||
LOG_I(GNB_APP,"ngran_gNB_DU: Waiting for basic cell configuration\n");
|
||||
usleep(100000);
|
||||
pthread_mutex_lock(&rrc->cell_info_mutex);
|
||||
cell_info_configured = rrc->cell_info_configured;
|
||||
pthread_mutex_unlock(&rrc->cell_info_mutex);
|
||||
} while (cell_info_configured == 0);
|
||||
|
||||
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).mcc[k];
|
||||
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).mnc[k];
|
||||
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).tac[k];
|
||||
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).nr_cellid[k];
|
||||
F1AP_SETUP_REQ (msg_p).nr_pci[k] = *rrc->configuration.scc->physCellId;
|
||||
F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0;
|
||||
|
||||
if (rrc->configuration.scc->tdd_UL_DL_ConfigurationCommon) {
|
||||
LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
|
||||
F1AP_SETUP_REQ (msg_p).fdd_flag = 0;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_arfcn = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.scs = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nrb = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.num_frequency_bands = 1;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_band[0] = *rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.sul_active = 0;
|
||||
} else {
|
||||
/***************** for test *****************/
|
||||
LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k);
|
||||
F1AP_SETUP_REQ (msg_p).fdd_flag = 1;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_arfcn = 26200UL;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nr_arfcn = 26200UL;
|
||||
// For LTE use scs field to carry prefix type and number of antennas
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_scs = 0;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_scs = 0;
|
||||
// use nrb field to hold LTE N_RB_DL (0...5)
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nrb = 3;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nrb = 3;
|
||||
// RK: we need to check there value for FDD's frequency_bands DL/UL
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_num_frequency_bands = 1;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nr_band[0] = 7;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_num_frequency_bands = 1;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_band[0] = 7;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_num_sul_frequency_bands = 0;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nr_sul_band[0] = 7;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_num_sul_frequency_bands = 0;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_sul_band[0] = 7;
|
||||
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.sul_active = 0;
|
||||
/***************** for test *****************/
|
||||
}
|
||||
|
||||
F1AP_SETUP_REQ (msg_p).measurement_timing_information[k] = "0";
|
||||
F1AP_SETUP_REQ (msg_p).ranac[k] = 0;
|
||||
F1AP_SETUP_REQ (msg_p).mib[k] = rrc->carrier.MIB;
|
||||
F1AP_SETUP_REQ (msg_p).sib1[k] = rrc->carrier.SIB1;
|
||||
F1AP_SETUP_REQ (msg_p).mib_length[k] = rrc->carrier.sizeof_MIB;
|
||||
F1AP_SETUP_REQ (msg_p).sib1_length[k] = rrc->carrier.sizeof_SIB1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int du_check_plmn_identity(rrc_gNB_carrier_data_t *carrier,uint16_t mcc,uint16_t mnc,uint8_t mnc_digit_length) {
|
||||
NR_SIB1_t *sib1 = carrier->siblock1->message.choice.c1->choice.systemInformationBlockType1;
|
||||
AssertFatal(sib1->cellAccessRelatedInfo.plmn_IdentityList.list.array[0]->plmn_IdentityList.list.count > 0,
|
||||
"plmn info isn't there\n");
|
||||
AssertFatal(mnc_digit_length == 2 || mnc_digit_length == 3,
|
||||
"impossible mnc_digit_length %d\n", mnc_digit_length);
|
||||
NR_PLMN_Identity_t *plmn_Identity = sib1->cellAccessRelatedInfo.plmn_IdentityList.list.array[0]
|
||||
->plmn_IdentityList.list.array[0];
|
||||
|
||||
// check if mcc is different and return failure if so
|
||||
if (mcc !=
|
||||
((*plmn_Identity->mcc->list.array[0])*100)+
|
||||
((*plmn_Identity->mcc->list.array[1])*10) +
|
||||
(*plmn_Identity->mcc->list.array[2])) {
|
||||
LOG_E(GNB_APP, "mcc in F1AP_SETUP_RESP message is different from mcc in DU \n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
// check that mnc digit length is different and return failure if so
|
||||
if (mnc_digit_length != plmn_Identity->mnc.list.count) {
|
||||
LOG_E(GNB_APP, "mnc(length: %d) in F1AP_SETUP_RESP message is different from mnc(length: %d) in DU \n",
|
||||
mnc_digit_length, plmn_Identity->mnc.list.count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// check that 2 digit mnc is different and return failure if so
|
||||
if (mnc_digit_length == 2 &&
|
||||
(mnc !=
|
||||
(*plmn_Identity->mnc.list.array[0]*10) +
|
||||
(*plmn_Identity->mnc.list.array[1]))) {
|
||||
LOG_E(GNB_APP, "mnc(%d) in F1AP_SETUP_RESP message is different from mnc(%ld%ld) in DU \n",
|
||||
mnc, *plmn_Identity->mnc.list.array[0], *plmn_Identity->mnc.list.array[1]);
|
||||
return(0);
|
||||
}
|
||||
else if (mnc_digit_length == 3 &&
|
||||
(mnc !=
|
||||
(*plmn_Identity->mnc.list.array[0]*100) +
|
||||
(*plmn_Identity->mnc.list.array[1]*10) +
|
||||
(*plmn_Identity->mnc.list.array[2]))) {
|
||||
LOG_E(GNB_APP, "mnc(%d) in F1AP_SETUP_RESP message is different from mnc(%ld%ld%ld) in DU \n",
|
||||
mnc, *plmn_Identity->mnc.list.array[0], *plmn_Identity->mnc.list.array[1], *plmn_Identity->mnc.list.array[2]);
|
||||
return(0);
|
||||
}
|
||||
|
||||
// if we're here, the mcc/mnc match so return success
|
||||
return(1);
|
||||
}
|
||||
|
||||
void du_extract_and_decode_SI(int inst, int si_ind, uint8_t *si_container, int si_container_length) {
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[inst];
|
||||
rrc_gNB_carrier_data_t *carrier = &rrc->carrier;
|
||||
NR_BCCH_DL_SCH_Message_t *bcch_message ;
|
||||
AssertFatal(si_ind == 0, "Can only handle a single SI block for now\n");
|
||||
LOG_I(GNB_APP, "rrc inst %d: Trying to decode SI block %d @ %p, length %d\n", inst, si_ind, si_container, si_container_length);
|
||||
// point to first SI block
|
||||
bcch_message = &carrier->systemInformation;
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_BCCH_DL_SCH_Message,
|
||||
(void **)&bcch_message,
|
||||
(const void *)si_container,
|
||||
si_container_length);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0, "[GNB_APP][NR_RRC inst %"PRIu8"] Failed to decode BCCH_DLSCH_MESSAGE (%zu bits)\n",
|
||||
inst,
|
||||
dec_rval.consumed );
|
||||
}
|
||||
|
||||
if (bcch_message->message.present == NR_BCCH_DL_SCH_MessageType_PR_c1) {
|
||||
switch (bcch_message->message.choice.c1->present) {
|
||||
case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1:
|
||||
AssertFatal(1 == 0, "Should have received SIB1 from CU\n");
|
||||
break;
|
||||
|
||||
case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformation:
|
||||
{
|
||||
NR_SystemInformation_t *si = bcch_message->message.choice.c1->choice.systemInformation;
|
||||
|
||||
if (si->criticalExtensions.present == NR_SystemInformation__criticalExtensions_PR_systemInformation) {
|
||||
for (int i = 0; i < si->criticalExtensions.choice.systemInformation->sib_TypeAndInfo.list.count; i++) {
|
||||
LOG_I(GNB_APP, "Extracting SI %d/%d\n", i, si->criticalExtensions.choice.systemInformation->sib_TypeAndInfo.list.count);
|
||||
SystemInformation_IEs__sib_TypeAndInfo__Member *typeAndInfo;
|
||||
typeAndInfo = si->criticalExtensions.choice.systemInformation->sib_TypeAndInfo.list.array[i];
|
||||
|
||||
switch(typeAndInfo->present) {
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_NOTHING:
|
||||
AssertFatal(0, "Should have received SIB2 SIB3 from CU\n");
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib2:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB2 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
carrier->sib2 = typeAndInfo->choice.sib2;
|
||||
carrier->SIB23 = (uint8_t *)malloc(64);
|
||||
memcpy((void *)carrier->SIB23, (void *)si_container, si_container_length);
|
||||
carrier->sizeof_SIB23 = si_container_length;
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib3:
|
||||
carrier->sib3 = typeAndInfo->choice.sib3;
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB3 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib4:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB4 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib5:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB5 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib6:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB6 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib7:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB7 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib8:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB8 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib9:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB9 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib10_v1610:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB10 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib11_v1610:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB11 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib12_v1610:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB12 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib13_v1610:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB13 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
case NR_SystemInformation_IEs__sib_TypeAndInfo__Member_PR_sib14_v1610:
|
||||
LOG_I(GNB_APP, "[NR_RRC %"PRIu8"] Found SIB14 in CU F1AP_SETUP_RESP message\n", inst);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Shouldn't have received this SI %d\n", typeAndInfo->present);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case NR_BCCH_DL_SCH_MessageType__c1_PR_NOTHING:
|
||||
AssertFatal(0, "Should have received SIB1 from CU\n");
|
||||
break;
|
||||
}
|
||||
} else AssertFatal(1 == 0, "No SI messages\n");
|
||||
}
|
||||
|
||||
void configure_gnb_du_mac(int inst) {
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[inst];
|
||||
// LOG_I(GNB_APP,"Configuring MAC/L1 %d, carrier->sib2 %p\n", inst, &carrier->sib2->radioResourceConfigCommon);
|
||||
LOG_I(GNB_APP,"Configuring gNB DU MAC/L1 %d \n", inst);
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->configuration.ssb_SubcarrierOffset,
|
||||
rrc->configuration.pdsch_AntennaPorts,
|
||||
rrc->configuration.pusch_AntennaPorts,
|
||||
rrc->configuration.scc,
|
||||
0,
|
||||
0, // rnti
|
||||
(NR_CellGroupConfig_t *)NULL
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
|
||||
int i, j, si_ind;
|
||||
int ret=0;
|
||||
LOG_I(GNB_APP, "cells_to_activate %d, RRC instances %d\n",
|
||||
resp->num_cells_to_activate, RC.nb_nr_inst);
|
||||
|
||||
for (j = 0; j < resp->num_cells_to_activate; j++) {
|
||||
for (i = 0; i < RC.nb_nr_inst; i++) {
|
||||
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[i]->carrier;
|
||||
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID
|
||||
LOG_I(GNB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n",
|
||||
j, i, RC.nrrrc[i]->nr_cellid, resp->cells_to_activate[j].nr_cellid);
|
||||
|
||||
if (RC.nrrrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid &&
|
||||
(du_check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
|
||||
resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
|
||||
// copy system information and decode it
|
||||
for (si_ind=0; si_ind<resp->cells_to_activate[j].num_SI; si_ind++) {
|
||||
|
||||
du_extract_and_decode_SI(i,
|
||||
si_ind,
|
||||
resp->cells_to_activate[j].SI_container[2+si_ind],
|
||||
resp->cells_to_activate[j].SI_container_length[2+si_ind]);
|
||||
}
|
||||
|
||||
// perform MAC/L1 common configuration
|
||||
configure_gnb_du_mac(i);
|
||||
ret++;
|
||||
} else {
|
||||
LOG_E(GNB_APP, "F1 Setup Response not matching\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update) {
|
||||
int i, j, si_ind, ret=0;
|
||||
LOG_I(GNB_APP, "cells_to_activate %d, RRC instances %d\n",
|
||||
gnb_cu_cfg_update->num_cells_to_activate, RC.nb_nr_inst);
|
||||
|
||||
for (j = 0; j < gnb_cu_cfg_update->num_cells_to_activate; j++) {
|
||||
for (i = 0; i < RC.nb_nr_inst; i++) {
|
||||
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[i]->carrier;
|
||||
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID
|
||||
LOG_I(GNB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, gnb_cu_cfg_updatenr_cellid %lx\n",
|
||||
j, i, RC.nrrrc[i]->nr_cellid, gnb_cu_cfg_update->cells_to_activate[j].nr_cellid);
|
||||
|
||||
if (RC.nrrrc[i]->nr_cellid == gnb_cu_cfg_update->cells_to_activate[j].nr_cellid &&
|
||||
(du_check_plmn_identity(carrier, gnb_cu_cfg_update->cells_to_activate[j].mcc, gnb_cu_cfg_update->cells_to_activate[j].mnc, gnb_cu_cfg_update->cells_to_activate[j].mnc_digit_length)>0 &&
|
||||
gnb_cu_cfg_update->cells_to_activate[j].nrpci == carrier->physCellId)) {
|
||||
// copy system information and decode it
|
||||
for (si_ind=0; si_ind<gnb_cu_cfg_update->cells_to_activate[j].num_SI; si_ind++) {
|
||||
|
||||
du_extract_and_decode_SI(i,
|
||||
si_ind,
|
||||
gnb_cu_cfg_update->cells_to_activate[j].SI_container[2+si_ind],
|
||||
gnb_cu_cfg_update->cells_to_activate[j].SI_container_length[2+si_ind]);
|
||||
}
|
||||
|
||||
// perform MAC/L1 common configuration
|
||||
configure_gnb_du_mac(i);
|
||||
ret++;
|
||||
} else {
|
||||
LOG_E(GNB_APP, "GNB_CU_CONFIGURATION_UPDATE not matching\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
MessageDef *msg_ack_p = NULL;
|
||||
if (ret > 0) {
|
||||
// generate gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
|
||||
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE);
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).num_cells_failed_to_be_activated = 0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0;
|
||||
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
|
||||
|
||||
}
|
||||
else {
|
||||
// generate gNB_CU_CONFIGURATION_UPDATE_FAILURE
|
||||
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE);
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(msg_ack_p).cause = F1AP_CauseRadioNetwork_cell_not_available;
|
||||
|
||||
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
|
||||
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
void set_node_type(void) {
|
||||
int j;
|
||||
paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC;
|
||||
paramlist_def_t MacRLC_ParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0};
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
|
||||
config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL);
|
||||
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
|
||||
|
||||
if ( MacRLC_ParamList.numelt > 0) {
|
||||
RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt;
|
||||
for (j=0;j<RC.nb_nr_macrlc_inst;j++) {
|
||||
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) {
|
||||
macrlc_has_f1 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(*(GNBParamList.paramarray[0][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "f1") == 0) {
|
||||
node_type = ngran_gNB_CU;
|
||||
} else {
|
||||
if (macrlc_has_f1 == 0) {
|
||||
node_type = ngran_gNB;
|
||||
LOG_I(NR_RRC,"Setting node_type to ngran_gNB\n");
|
||||
} else {
|
||||
node_type = ngran_gNB_DU;
|
||||
LOG_I(NR_RRC,"Setting node_type to ngran_gNB_DU\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nr_read_config_and_init(void) {
|
||||
MessageDef *msg_p = NULL;
|
||||
uint32_t gnb_id;
|
||||
uint32_t gnb_nb = RC.nb_nr_inst;
|
||||
|
||||
RCconfig_NR_L1();
|
||||
set_node_type();
|
||||
RCconfig_nr_macrlc();
|
||||
|
||||
LOG_I(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
|
||||
|
||||
if (RC.nb_nr_L1_inst>0) AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n");
|
||||
|
||||
AssertFatal (gnb_nb <= RC.nb_nr_inst,
|
||||
"Number of gNB is greater than gNB defined in configuration file (%d/%d)!",
|
||||
gnb_nb, RC.nb_nr_inst);
|
||||
|
||||
LOG_I(GNB_APP,"Allocating gNB_RRC_INST for %d instances\n",RC.nb_nr_inst);
|
||||
|
||||
RC.nrrrc = (gNB_RRC_INST **)malloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *));
|
||||
LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.nrrrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.nrrrc);
|
||||
|
||||
for (gnb_id = 0; gnb_id < RC.nb_nr_inst ; gnb_id++) {
|
||||
RC.nrrrc[gnb_id] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
|
||||
LOG_I(PHY, "%s() Creating RRC instance RC.nrrrc[%d]:%p (%d of %d)\n", __FUNCTION__, gnb_id, RC.nrrrc[gnb_id], gnb_id+1, RC.nb_nr_inst);
|
||||
memset((void *)RC.nrrrc[gnb_id],0,sizeof(gNB_RRC_INST));
|
||||
msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, NRRRC_CONFIGURATION_REQ);
|
||||
RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
|
||||
}
|
||||
|
||||
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
pdcp_layer_init();
|
||||
// nr_DRB_preconfiguration(0x1234);
|
||||
rrc_init_nr_global_param();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "s1ap_messages_types.h"
|
||||
#include "ngap_messages_types.h"
|
||||
#include "f1ap_messages_types.h"
|
||||
|
||||
#ifdef CMAKER
|
||||
#include "rrc_messages_types.h"
|
||||
@@ -92,7 +93,7 @@ typedef struct ru_config_s {
|
||||
uint8_t if_compress;
|
||||
} ru_config_t;
|
||||
*/
|
||||
extern void RCconfig_RU(void);
|
||||
extern void NRRCconfig_RU(void);
|
||||
extern void RCconfig_nr_flexran(void);
|
||||
extern void RCconfig_NR_L1(void);
|
||||
extern void RCconfig_nr_macrlc(void);
|
||||
@@ -105,6 +106,10 @@ extern void NRRCConfig(void);
|
||||
void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
|
||||
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
|
||||
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
|
||||
int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i);
|
||||
int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
|
||||
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update);
|
||||
void nr_read_config_and_init(void);
|
||||
|
||||
#endif /* GNB_CONFIG_H_ */
|
||||
/** @} */
|
||||
|
||||
@@ -115,8 +115,8 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd"
|
||||
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_PUSCHTARGETPOWX10 "pusch_TargetSNRx10"
|
||||
#define GNB_CONFIG_STRING_PUCCHTARGETPOWX10 "pucch_TargetSNRx10"
|
||||
#define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_NRCELLID "nr_cellid"
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* cell configuration parameters */
|
||||
@@ -139,8 +139,8 @@ typedef enum {
|
||||
{GNB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUSCHTARGETPOWX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUCCHTARGETPOWX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \
|
||||
}
|
||||
|
||||
#define GNB_GNB_ID_IDX 0
|
||||
@@ -159,8 +159,8 @@ typedef enum {
|
||||
#define GNB_REMOTE_S_PORTD_IDX 13
|
||||
#define GNB_SSB_SUBCARRIEROFFSET_IDX 14
|
||||
#define GNB_PDSCH_ANTENNAPORTS_IDX 15
|
||||
#define GNB_PUSCH_TARGETPOW_X10_IDX 16
|
||||
#define GNB_PUCCH_TARGETPOW_X10_IDX 17
|
||||
#define GNB_PUSCH_ANTENNAPORTS_IDX 16
|
||||
#define GNB_NRCELLID_IDX 17
|
||||
|
||||
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
|
||||
#define GNBPARAMS_CHECK { \
|
||||
|
||||
@@ -337,7 +337,8 @@ config_sib2(int Mod_idP,
|
||||
LTE_ARFCN_ValueEUTRA_t *ul_CArrierFreqP,
|
||||
long *ul_BandwidthP,
|
||||
LTE_AdditionalSpectrumEmission_t *additionalSpectrumEmissionP,
|
||||
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigListP) {
|
||||
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigListP,
|
||||
int dl_Bandwidth) {
|
||||
nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
|
||||
cfg->subframe_config.pb.value = radioResourceConfigCommonP->pdsch_ConfigCommon.p_b;
|
||||
cfg->subframe_config.pb.tl.tag = NFAPI_SUBFRAME_CONFIG_PB_TAG;
|
||||
@@ -345,7 +346,7 @@ config_sib2(int Mod_idP,
|
||||
cfg->rf_config.reference_signal_power.value = radioResourceConfigCommonP->pdsch_ConfigCommon.referenceSignalPower;
|
||||
cfg->rf_config.reference_signal_power.tl.tag = NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->nfapi_config.max_transmit_power.value = cfg->rf_config.reference_signal_power.value + power_off_dB[cfg->rf_config.dl_channel_bandwidth.value];
|
||||
cfg->nfapi_config.max_transmit_power.value = cfg->rf_config.reference_signal_power.value + power_off_dB[dl_Bandwidth];
|
||||
cfg->nfapi_config.max_transmit_power.tl.tag = NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->prach_config.configuration_index.value = radioResourceConfigCommonP->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
|
||||
@@ -870,7 +871,8 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
config_sib2(Mod_idP, CC_idP, radioResourceConfigCommon,
|
||||
radioResourceConfigCommon_BR,
|
||||
NULL, ul_Bandwidth, additionalSpectrumEmission,
|
||||
mbsfn_SubframeConfigList);
|
||||
mbsfn_SubframeConfigList,
|
||||
mib->message.dl_Bandwidth);
|
||||
} // mib != NULL
|
||||
|
||||
if (mobilityControlInfo !=NULL) {
|
||||
|
||||
@@ -85,10 +85,6 @@ void ue_mac_reset(module_id_t module_idP, uint8_t eNB_index) {
|
||||
ue_init_mac(module_idP); //This will hopefully do the rest of the MAC reset procedure
|
||||
}
|
||||
|
||||
int32_t **rxdata;
|
||||
int32_t **txdata;
|
||||
|
||||
|
||||
int
|
||||
rrc_mac_config_req_ue(module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
|
||||
@@ -537,9 +537,6 @@ typedef struct {
|
||||
|
||||
// global variables
|
||||
|
||||
nprach_parameters_NB_IoT_t nprach_list[3];
|
||||
|
||||
//DLSF Table
|
||||
DLSF_INFO_t DLSF_information;
|
||||
|
||||
#endif /*__LAYER2_MAC_DEFS_NB_IoT_H__ */
|
||||
|
||||
@@ -608,6 +608,23 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
memset(cc[CC_id].vrb_map_UL, 0, 100);
|
||||
cc[CC_id].mcch_active = 0;
|
||||
clear_nfapi_information(RC.mac[module_idP], CC_id, frameP, subframeP);
|
||||
|
||||
/* hack: skip BCH RBs in subframe 0 for DL scheduling,
|
||||
* because with high MCS we may exceed code rate 0.93
|
||||
* when using those RBs (36.213 7.1.7 says the UE may
|
||||
* skip decoding if the code rate is higher than 0.93)
|
||||
* TODO: remove this hack, deal with physical bits properly
|
||||
* i.e. reduce MCS in the scheduler if code rate > 0.93
|
||||
*/
|
||||
if (subframeP == 0) {
|
||||
int i;
|
||||
int bw = cc[CC_id].mib->message.dl_Bandwidth;
|
||||
/* start and count defined for RBs: 6, 15, 25, 50, 75, 100 */
|
||||
int start[6] = { 0, 4, 9, 22, 34, 47 };
|
||||
int count[6] = { 6, 7, 7, 6, 7, 6 };
|
||||
for (i = 0; i < count[bw]; i++)
|
||||
cc[CC_id].vrb_map[start[bw] + i] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Refresh UE list based on UEs dropped by PHY in previous subframe */
|
||||
@@ -617,6 +634,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
CC_id = UE_PCCID(module_idP, UE_id);
|
||||
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
|
||||
|
||||
/* to be merged with MAC_stats.log generation. probably redundant
|
||||
if (((frameP & 127) == 0) && (subframeP == 0)) {
|
||||
double total_bler;
|
||||
if(UE_scheduling_control->pusch_rx_num[CC_id] == 0 && UE_scheduling_control->pusch_rx_error_num[CC_id] == 0) {
|
||||
@@ -654,7 +672,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
UE_scheduling_control->aperiodic_ri_received[CC_id]
|
||||
);
|
||||
}
|
||||
|
||||
*/
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP] = -63;
|
||||
|
||||
if (UE_id == UE_info->list.head) {
|
||||
|
||||
@@ -476,8 +476,8 @@ void generate_Msg2(module_id_t module_idP,
|
||||
first_rb = 0;
|
||||
vrb_map[first_rb] = 1;
|
||||
vrb_map[first_rb + 1] = 1;
|
||||
vrb_map[first_rb + 2] = 1;
|
||||
vrb_map[first_rb + 3] = 1;
|
||||
//vrb_map[first_rb + 2] = 1;
|
||||
//vrb_map[first_rb + 3] = 1;
|
||||
memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_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));
|
||||
@@ -488,12 +488,12 @@ void generate_Msg2(module_id_t module_idP,
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // RA-RNTI : see Table 4-10 from SCF082 - nFAPI specifications
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 0; // no TPC
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 0;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 1;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 2);
|
||||
|
||||
// This checks if the above DCI allocation is feasible in current subframe
|
||||
if (!CCE_allocation_infeasible(module_idP, CC_idP, 0, subframeP,
|
||||
@@ -512,7 +512,7 @@ void generate_Msg2(module_id_t module_idP,
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 2);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
|
||||
@@ -901,7 +901,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
} // rach_resource_type > 0
|
||||
else {
|
||||
// This is normal LTE case
|
||||
LOG_I(MAC, "generate_Msg4 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR eNB_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP);
|
||||
LOG_D(MAC, "generate_Msg4 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR eNB_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP);
|
||||
|
||||
if ((ra->Msg4_frame == frameP) && (ra->Msg4_subframe == subframeP)) {
|
||||
// Get RRCConnectionSetup for Piggyback
|
||||
@@ -1086,7 +1086,7 @@ generate_Msg4(module_id_t module_idP,
|
||||
}
|
||||
} // CCE Allocation feasible
|
||||
} else {
|
||||
LOG_I(MAC,
|
||||
LOG_D(MAC,
|
||||
"eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Delaying Msg4 for RRC Piggyback (RNTI %x)\n",
|
||||
module_idP, CC_idP, frameP, subframeP, ra->rnti);
|
||||
ra->Msg4_subframe ++;
|
||||
@@ -1288,9 +1288,9 @@ initiate_ra_proc(module_id_t module_idP,
|
||||
prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13;
|
||||
}
|
||||
|
||||
LOG_I(MAC,
|
||||
"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",
|
||||
module_idP, CC_id, frameP, subframeP, preamble_index);
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d, timing offset %d\n",
|
||||
module_idP, CC_id, frameP, subframeP, preamble_index, timing_offset);
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",
|
||||
module_idP, CC_id, frameP, subframeP, rach_resource_type);
|
||||
@@ -1332,6 +1332,9 @@ initiate_ra_proc(module_id_t module_idP,
|
||||
abort();
|
||||
|
||||
case 1 :
|
||||
case 3 :
|
||||
case 4 :
|
||||
case 5 :
|
||||
offset = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ schedule_ue_spec(module_id_t module_idP,
|
||||
eNB_UE_stats->rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
|
||||
eNB_UE_stats->harq_pid = harq_pid;
|
||||
eNB_UE_stats->harq_round = round_DL;
|
||||
|
||||
eNB_UE_stats->dlsch_rounds[round_DL&7]++;
|
||||
if (eNB_UE_stats->rrc_status < RRC_RECONFIGURED) {
|
||||
ue_sched_ctrl->uplane_inactivity_timer = 0;
|
||||
}
|
||||
@@ -792,7 +792,6 @@ schedule_ue_spec(module_id_t module_idP,
|
||||
// No TX request for retransmission (check if null request for FAPI)
|
||||
}
|
||||
|
||||
//eNB_UE_stats->dlsch_trials[round]++;
|
||||
eNB_UE_stats->num_retransmission += 1;
|
||||
eNB_UE_stats->rbs_used_retx = nb_rb;
|
||||
eNB_UE_stats->total_rbs_used_retx += nb_rb;
|
||||
@@ -1065,20 +1064,23 @@ schedule_ue_spec(module_id_t module_idP,
|
||||
ue_template->pucch_tpc_tx_frame = frameP;
|
||||
ue_template->pucch_tpc_tx_subframe = subframeP;
|
||||
|
||||
if (snr > target_snr + 4) {
|
||||
if (snr > target_snr + PUCCH_PCHYST) {
|
||||
tpc = 0; //-1
|
||||
} else if (snr < target_snr - 4) {
|
||||
ue_sched_ctrl->pucch_tpc_accumulated[CC_id]--;
|
||||
} else if (snr < target_snr - PUCCH_PCHYST) {
|
||||
tpc = 2; //+1
|
||||
ue_sched_ctrl->pucch_tpc_accumulated[CC_id]--;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
|
||||
LOG_D(MAC, "[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, snr/target snr %d/%d (normal case)\n",
|
||||
LOG_D(MAC, "[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d (accumulated %d), snr/target snr %d/%d (normal case)\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
harq_pid,
|
||||
tpc,
|
||||
ue_sched_ctrl->pucch_tpc_accumulated[CC_id],
|
||||
snr,
|
||||
target_snr);
|
||||
} // Po_PUCCH has been updated
|
||||
@@ -1700,9 +1702,9 @@ schedule_ue_spec_br(module_id_t module_idP,
|
||||
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_frame = frameP;
|
||||
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe = subframeP;
|
||||
|
||||
if (snr > target_snr + 4) {
|
||||
if (snr > target_snr + PUCCH_PCHYST) {
|
||||
tpc = 0; //-1
|
||||
} else if (snr < target_snr - 4) {
|
||||
} else if (snr < target_snr - PUCCH_PCHYST) {
|
||||
tpc = 2; //+1
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "OCG_extern.h"
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#include "rlc.h"
|
||||
|
||||
#include "common/utils/lte/prach_utils.h"
|
||||
#include "T.h"
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
|
||||
|
||||
// Initialization
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
dlsch_ue_max_num[CC_id] = (uint16_t)RC.rrc[module_idP]->configuration.radioresourceconfig[CC_id].ue_multiple_max;
|
||||
dlsch_ue_max_num[CC_id] = eNB->ue_multiple_max;
|
||||
// save origin DL PDU number
|
||||
DL_req = &eNB->DL_req[CC_id].dl_config_request_body;
|
||||
saved_dlsch_dci[CC_id] = DL_req->number_pdu;
|
||||
@@ -1044,48 +1044,6 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TM5
|
||||
|
||||
// This has to be revisited!!!!
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
i1 = 0;
|
||||
i2 = 0;
|
||||
i3 = 0;
|
||||
|
||||
for (j = 0; j < N_RBG[CC_id]; j++) {
|
||||
if (MIMO_mode_indicator[CC_id][j] == 2) {
|
||||
i1 = i1 + 1;
|
||||
} else if (MIMO_mode_indicator[CC_id][j] == 1) {
|
||||
i2 = i2 + 1;
|
||||
} else if (MIMO_mode_indicator[CC_id][j] == 0) {
|
||||
i3 = i3 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((i1 < N_RBG[CC_id]) && (i2 > 0) && (i3 == 0)) {
|
||||
PHY_vars_eNB_g[Mod_id][CC_id]->check_for_SUMIMO_transmissions =
|
||||
PHY_vars_eNB_g[Mod_id][CC_id]->
|
||||
check_for_SUMIMO_transmissions + 1;
|
||||
}
|
||||
|
||||
if (i3 == N_RBG[CC_id] && i1 == 0 && i2 == 0) {
|
||||
PHY_vars_eNB_g[Mod_id][CC_id]->FULL_MUMIMO_transmissions =
|
||||
PHY_vars_eNB_g[Mod_id][CC_id]->FULL_MUMIMO_transmissions +
|
||||
1;
|
||||
}
|
||||
|
||||
if((i1 < N_RBG[CC_id]) && (i3 > 0)) {
|
||||
PHY_vars_eNB_g[Mod_id][CC_id]->
|
||||
check_for_MUMIMO_transmissions + 1;
|
||||
}
|
||||
|
||||
PHY_vars_eNB_g[Mod_id][CC_id]->check_for_total_transmissions =
|
||||
PHY_vars_eNB_g[Mod_id][CC_id]->check_for_total_transmissions +
|
||||
1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
for (i = 0; i < dlsch_ue_select[CC_id].ue_num; i++) {
|
||||
if(dlsch_ue_select[CC_id].list[i].ue_priority == SCH_DL_MSG2) {
|
||||
@@ -1154,7 +1112,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
// int continue_flag = 0;
|
||||
int32_t snr, target_snr;
|
||||
int32_t tpc = 1;
|
||||
static int32_t tpc_accumulated = 0;
|
||||
UE_sched_ctrl_t *ue_sched_ctl;
|
||||
int mcs;
|
||||
int i;
|
||||
@@ -1540,7 +1497,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
subframeP,
|
||||
S_DL_SCHEDULED,
|
||||
rnti);
|
||||
//eNB_UE_stats->dlsch_trials[round]++;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[round]++;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].num_retransmission += 1;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used_retx = nb_rb;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used_retx += nb_rb;
|
||||
@@ -1982,6 +1939,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
// store stats
|
||||
eNB->eNB_stats[CC_id].dlsch_bytes_tx+=sdu_length_total;
|
||||
eNB->eNB_stats[CC_id].dlsch_pdus_tx+=1;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[0]++;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1;
|
||||
@@ -2015,19 +1973,19 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_frame=frameP;
|
||||
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe=subframeP;
|
||||
|
||||
if (snr > target_snr + 4) {
|
||||
if (snr > target_snr + PUCCH_PCHYST) {
|
||||
tpc = 0; //-1
|
||||
tpc_accumulated--;
|
||||
} else if (snr < target_snr - 4) {
|
||||
ue_sched_ctl->pucch_tpc_accumulated[CC_id]--;
|
||||
} else if (snr < target_snr - PUCCH_PCHYST) {
|
||||
tpc = 2; //+1
|
||||
tpc_accumulated++;
|
||||
ue_sched_ctl->pucch_tpc_accumulated[CC_id]++;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, snr/target snr %d/%d\n",
|
||||
module_idP,frameP, subframeP,harq_pid,tpc,
|
||||
tpc_accumulated,snr,target_snr);
|
||||
ue_sched_ctl->pucch_tpc_accumulated[CC_id],snr,target_snr);
|
||||
} // Po_PUCCH has been updated
|
||||
else {
|
||||
tpc = 1; //0
|
||||
@@ -2245,7 +2203,6 @@ void ulsch_scheduler_pre_ue_select_fairRR(
|
||||
uint8_t first_ue_id[MAX_NUM_CCs][20];
|
||||
uint8_t ul_inactivity_num[MAX_NUM_CCs];
|
||||
uint8_t ul_inactivity_id[MAX_NUM_CCs][20]={{0}};
|
||||
// LTE_DL_FRAME_PARMS *frame_parms;
|
||||
uint8_t ulsch_ue_max_num[MAX_NUM_CCs];
|
||||
uint16_t saved_ulsch_dci[MAX_NUM_CCs];
|
||||
rnti_t rnti;
|
||||
@@ -2263,7 +2220,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
|
||||
//save ulsch dci number
|
||||
saved_ulsch_dci[CC_id] = eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body.number_of_dci;
|
||||
// maximum multiplicity number
|
||||
ulsch_ue_max_num[CC_id] =RC.rrc[module_idP]->configuration.radioresourceconfig[CC_id].ue_multiple_max;
|
||||
ulsch_ue_max_num[CC_id] =eNB->ue_multiple_max;
|
||||
cc_id_flag[CC_id] = 0;
|
||||
ue_first_num[CC_id] = 0;
|
||||
ul_inactivity_num[CC_id] = 0;
|
||||
@@ -2290,6 +2247,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
|
||||
// UL DCI
|
||||
HI_DCI0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body;
|
||||
|
||||
|
||||
if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) {
|
||||
cc_id_flag[CC_id] = 1;
|
||||
HI_DCI0_req->number_of_dci = saved_ulsch_dci[CC_id];
|
||||
@@ -2322,6 +2280,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
|
||||
//round
|
||||
round = UE_info->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid];
|
||||
|
||||
|
||||
if ( round > 0 ) {
|
||||
hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi];
|
||||
format_flag = 2;
|
||||
@@ -2352,6 +2311,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
|
||||
UE_info->UE_template[CC_id][UE_id].scheduled_ul_bytes = 0;
|
||||
}
|
||||
|
||||
|
||||
if ( UE_id > last_ulsch_ue_id[CC_id] && ((ulsch_ue_select[CC_id].ue_num+ue_first_num[CC_id]) < ulsch_ue_max_num[CC_id]) ) {
|
||||
if ( bytes_to_schedule > 0 ) {
|
||||
first_ue_id[CC_id][ue_first_num[CC_id]]= UE_id;
|
||||
@@ -2369,9 +2329,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
|
||||
|
||||
UE_sched_ctl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
|
||||
|
||||
if ( ((UE_sched_ctl->ul_inactivity_timer>64)&&(UE_sched_ctl->ul_scheduled==0)) ||
|
||||
((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) ||
|
||||
if ( ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) ||
|
||||
((UE_sched_ctl->cqi_req_timer>64)&&((rrc_status >= RRC_CONNECTED))) ) {
|
||||
first_ue_id[CC_id][ue_first_num[CC_id]]= UE_id;
|
||||
first_ue_total[CC_id] [ue_first_num[CC_id]] = 0;
|
||||
@@ -2482,6 +2440,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
|
||||
}
|
||||
rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
|
||||
|
||||
|
||||
if ( (bytes_to_schedule > 0) || (UE_info->UE_template[CC_id][UE_id].ul_SR > 0) ||
|
||||
((UE_sched_ctl->ul_inactivity_timer>64)&&(UE_sched_ctl->ul_scheduled==0)) ||
|
||||
((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) ||
|
||||
@@ -2595,7 +2554,6 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
UE_info_t *UE_info= &eNB->UE_info;
|
||||
UE_TEMPLATE *UE_template = NULL;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = NULL;
|
||||
uint8_t ue_num_temp;
|
||||
uint8_t total_rbs=0;
|
||||
uint8_t average_rbs;
|
||||
@@ -2617,18 +2575,17 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
// MCS and RB assgin
|
||||
for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) {
|
||||
cc = &RC.mac[module_idP]->common_channels[CC_id];
|
||||
frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms);
|
||||
|
||||
int N_RB_UL = to_prb(cc->ul_Bandwidth);
|
||||
if (cc->tdd_Config) { //TDD
|
||||
if (frame_parms->N_RB_UL == 25) {
|
||||
if (N_RB_UL == 25) {
|
||||
num_pucch_rb = 1;
|
||||
} else if (frame_parms->N_RB_UL == 50) {
|
||||
} else if (N_RB_UL == 50) {
|
||||
num_pucch_rb = 2;
|
||||
} else {
|
||||
num_pucch_rb = 3;
|
||||
}
|
||||
} else {//FDD
|
||||
if (frame_parms->N_RB_UL == 25) {
|
||||
if (N_RB_UL == 25) {
|
||||
num_pucch_rb = 1;
|
||||
} else {
|
||||
num_pucch_rb = 2;
|
||||
@@ -2653,13 +2610,13 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (first_rb[CC_id] >= frame_parms->N_RB_UL-num_pucch_rb ) {
|
||||
if (first_rb[CC_id] >= N_RB_UL-num_pucch_rb ) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
|
||||
module_idP,frameP,subframeP,UE_id,UE_RNTI(CC_id,UE_id),CC_id);
|
||||
break;
|
||||
}
|
||||
|
||||
total_rbs = frame_parms->N_RB_UL-num_pucch_rb-first_rb[CC_id];
|
||||
total_rbs = N_RB_UL-num_pucch_rb-first_rb[CC_id];
|
||||
average_rbs = (int)round((double)total_rbs/(double)ue_num_temp);
|
||||
|
||||
if ( average_rbs < 3 ) {
|
||||
@@ -2727,19 +2684,20 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
UE_info->UE_sched_ctrl[UE_id].pusch_rx_num_old[CC_id] = UE_info->UE_sched_ctrl[UE_id].pusch_rx_num[CC_id];
|
||||
UE_info->UE_sched_ctrl[UE_id].pusch_rx_error_num_old[CC_id] = UE_info->UE_sched_ctrl[UE_id].pusch_rx_error_num[CC_id];
|
||||
|
||||
if(bler < 0.5) {
|
||||
if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] !=0) {
|
||||
UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]--;
|
||||
if (eNB->use_mcs_offset == 1) {
|
||||
if(bler < eNB->bler_lower) {
|
||||
if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] !=0) {
|
||||
UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(bler >= 2) {
|
||||
UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]++;
|
||||
if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] >= 20) {
|
||||
UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]=20;
|
||||
if(bler >= eNB->bler_upper) {
|
||||
UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]++;
|
||||
if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] >= 20) {
|
||||
UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]=20;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
snr = UE_info->UE_sched_ctrl[UE_id].pusch_snr_avg[CC_id];
|
||||
|
||||
mcs = 20 - UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id];
|
||||
@@ -2758,15 +2716,20 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ul_total_buffer > 0 ) {
|
||||
rb_table_index = 2;
|
||||
tbs = get_TBS_UL(mcs,rb_table[rb_table_index]);
|
||||
tx_power = (int8_t)(hundred_times_log10_NPRB[rb_table[rb_table_index] - 1] / 100);
|
||||
tx_power= estimate_ue_tx_power(0,tbs*8,rb_table[rb_table_index],0,cc->Ncp,0);
|
||||
|
||||
while ( (tbs < bytes_to_schedule) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-num_pucch_rb-first_rb[CC_id])) &&
|
||||
((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) {
|
||||
rb_table_index++;
|
||||
while ( (((UE_template->phr_info - tx_power) < 0 ) || (tbs > bytes_to_schedule)) && (mcs > 3) ) {
|
||||
mcs--;
|
||||
tbs = get_TBS_UL(mcs,rb_table[rb_table_index]);
|
||||
tx_power = (int8_t)(hundred_times_log10_NPRB[rb_table[rb_table_index] - 1] / 100);
|
||||
tx_power= estimate_ue_tx_power(0,tbs*8,rb_table[rb_table_index],0,cc->Ncp,0);
|
||||
}
|
||||
|
||||
while ( (tbs < bytes_to_schedule) && (rb_table[rb_table_index]<(N_RB_UL-num_pucch_rb-first_rb[CC_id])) &&
|
||||
((UE_template->phr_info - tx_power) > 0) && (rb_table_index < eNB->max_ul_rb_index )) {
|
||||
rb_table_index++;
|
||||
tbs = get_TBS_UL(mcs,rb_table[rb_table_index]);
|
||||
tx_power= estimate_ue_tx_power(0,tbs*8,rb_table[rb_table_index],0,cc->Ncp,0);
|
||||
}
|
||||
if ( rb_table[rb_table_index]<3 ) {
|
||||
rb_table_index=2;
|
||||
}
|
||||
@@ -2807,11 +2770,12 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
|
||||
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
|
||||
} else {
|
||||
// assigne RBS( 3 RBs)
|
||||
/*
|
||||
first_rb[CC_id] = first_rb[CC_id] + 3;
|
||||
UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 3;
|
||||
UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 2;
|
||||
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
|
||||
}
|
||||
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
|
||||
*/ }
|
||||
}
|
||||
} else if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_INACTIVE ) {
|
||||
// assigne RBS( 3 RBs)
|
||||
@@ -2913,12 +2877,10 @@ schedule_ulsch_fairRR(module_id_t module_idP, frame_t frameP,
|
||||
|
||||
ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs];
|
||||
memset(ulsch_ue_select, 0, sizeof(ulsch_ue_select));
|
||||
LTE_DL_FRAME_PARMS *frame_parms ;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
cc = &mac->common_channels[CC_id];
|
||||
frame_parms= &RC.eNB[module_idP][CC_id]->frame_parms;
|
||||
|
||||
int N_RB_UL=to_prb(cc->ul_Bandwidth);
|
||||
// output of scheduling, the UE numbers in RBs, where it is in the code???
|
||||
// check if RA (Msg3) is active in this subframeP, if so skip the PRBs used for Msg3
|
||||
// Msg3 is using 1 PRB so we need to increase first_rb accordingly
|
||||
@@ -2928,13 +2890,13 @@ schedule_ulsch_fairRR(module_id_t module_idP, frame_t frameP,
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].ue_priority = SCH_UL_MSG3;
|
||||
|
||||
if (cc->tdd_Config == NULL) {
|
||||
if(frame_parms->N_RB_UL == 25) {
|
||||
if(N_RB_UL == 25) {
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1;
|
||||
} else {
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 2;
|
||||
}
|
||||
} else {
|
||||
switch(frame_parms->N_RB_UL) {
|
||||
switch(N_RB_UL) {
|
||||
case 25:
|
||||
default:
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1;
|
||||
@@ -2958,14 +2920,18 @@ schedule_ulsch_fairRR(module_id_t module_idP, frame_t frameP,
|
||||
}
|
||||
|
||||
//PRACH
|
||||
if (is_prach_subframe(frame_parms,sched_frame,sched_subframe)==1) {
|
||||
if (is_prach_subframe0(cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,cc->tdd_Config!=NULL ? 1 : 0,
|
||||
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
|
||||
sched_frame,sched_subframe)==1) {
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].ue_priority = SCH_UL_PRACH;
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = get_prach_prb_offset(
|
||||
frame_parms,
|
||||
frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
|
||||
0,//tdd_mapindex
|
||||
frameP); //Nf --> shouldn't it be sched_frame ???
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb =
|
||||
get_prach_prb_offset(cc->tdd_Config!=NULL ? 1 : 0,
|
||||
cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,
|
||||
to_prb(cc->ul_Bandwidth),
|
||||
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
|
||||
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset,
|
||||
0,
|
||||
sched_frame);
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].nb_rb = 6;
|
||||
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].UE_id = -1;
|
||||
ulsch_ue_select[CC_id].ue_num++;
|
||||
@@ -2993,7 +2959,6 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
|
||||
uint32_t cqi_req,cshift,ndi,tpc;
|
||||
int32_t snr;
|
||||
int32_t target_snr=0;
|
||||
static int32_t tpc_accumulated=0;
|
||||
int CC_id,ulsch_ue_num;
|
||||
int N_RB_UL;
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
@@ -3012,7 +2977,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
|
||||
nfapi_ul_config_request_body_t *ul_req_tmp;
|
||||
nfapi_ul_config_ulsch_harq_information *ulsch_harq_information;
|
||||
LOG_D(MAC,"entering ulsch preprocesor\n");
|
||||
LOG_D(MAC,"entering ulsch preprocesor for %d.%d\n",sched_frame,sched_subframeP);
|
||||
ulsch_scheduler_pre_processor_fairRR(module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
@@ -3185,12 +3150,12 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
|
||||
UE_template->pusch_tpc_tx_frame=frameP;
|
||||
UE_template->pusch_tpc_tx_subframe=subframeP;
|
||||
|
||||
if (snr > target_snr + 4) {
|
||||
if (snr > target_snr + PUSCH_PCHYST) {
|
||||
tpc = 0; //-1
|
||||
tpc_accumulated--;
|
||||
} else if (snr < target_snr - 4) {
|
||||
UE_sched_ctrl->pusch_tpc_accumulated[CC_id]--;
|
||||
} else if (snr < target_snr - PUSCH_PCHYST) {
|
||||
tpc = 2; //+1
|
||||
tpc_accumulated++;
|
||||
UE_sched_ctrl->pusch_tpc_accumulated[CC_id]++;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
@@ -3201,7 +3166,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
|
||||
if (tpc!=1) {
|
||||
LOG_D(MAC,"[eNB %d] ULSCH schedulerRR: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, snr/target snr %d/%d\n",
|
||||
module_idP,frameP,subframeP,harq_pid,tpc,
|
||||
tpc_accumulated,snr,target_snr);
|
||||
UE_sched_ctrl->pusch_tpc_accumulated[CC_id],snr,target_snr);
|
||||
}
|
||||
|
||||
// new transmission
|
||||
@@ -3214,6 +3179,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
|
||||
UE_sched_ctrl->cqi_req_timer);
|
||||
ndi = 1-UE_template->oldNDI_UL[harq_pid];
|
||||
UE_template->oldNDI_UL[harq_pid]=ndi;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0]++;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].snr = snr;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].target_snr = target_snr;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul;
|
||||
@@ -3402,6 +3368,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
|
||||
T_INT(round));
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].snr = snr;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].target_snr = target_snr;
|
||||
|
||||
uint8_t mcs_rv = 0;
|
||||
|
||||
if(rvidx_tab[round&3]==1) {
|
||||
|
||||
@@ -84,7 +84,7 @@ get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id,
|
||||
|
||||
static uint32_t bytes_in_buffer=0;
|
||||
static uint32_t msi_pmch_stop=0;
|
||||
int mbms_rab_id = 2047;
|
||||
rb_id_t mbms_rab_id=2047;//[8] = {2047,2047,2047,2047,2047,2047,2047,2047};
|
||||
static uint32_t msi_sfs=0;
|
||||
|
||||
|
||||
|
||||
@@ -1985,10 +1985,13 @@ find_UE_id(module_id_t mod_idP,
|
||||
{
|
||||
int UE_id;
|
||||
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
|
||||
if(!UE_info)
|
||||
return -1;
|
||||
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (UE_info->active[UE_id] == TRUE) {
|
||||
if (UE_info->UE_template[UE_PCCID(mod_idP, UE_id)][UE_id].rnti == rntiP) {
|
||||
int CC_id = UE_PCCID(mod_idP, UE_id);
|
||||
if (CC_id>=0 && CC_id<NFAPI_CC_MAX && UE_info->UE_template[CC_id][UE_id].rnti == rntiP) {
|
||||
return UE_id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include "flexran_agent_mac.h"
|
||||
#include <dlfcn.h>
|
||||
#include <openair2/LAYER2/MAC/mac.h>
|
||||
|
||||
#include "common/utils/lte/prach_utils.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
@@ -144,16 +144,18 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
if (UE_id != -1) {
|
||||
UE_scheduling_control = &UE_info->UE_sched_ctrl[UE_id];
|
||||
UE_template_ptr = &UE_info->UE_template[CC_idP][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, "[eNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH (%s) sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d, timing_advance %d\n",
|
||||
enb_mod_idP,
|
||||
harq_pid,
|
||||
CC_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
sduP==NULL ? "in error" : "OK",
|
||||
UE_scheduling_control->round_UL[CC_idP][harq_pid],
|
||||
current_rnti,
|
||||
UE_id,
|
||||
ul_cqi);
|
||||
ul_cqi,
|
||||
timing_advance);
|
||||
AssertFatal(UE_scheduling_control->round_UL[CC_idP][harq_pid] < 8, "round >= 8\n");
|
||||
|
||||
if (sduP != NULL) {
|
||||
@@ -219,7 +221,7 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
if (UE_scheduling_control->round_UL[CC_idP][harq_pid] == 3) {
|
||||
UE_scheduling_control->ul_scheduled &= (~(1 << harq_pid));
|
||||
UE_scheduling_control->round_UL[CC_idP][harq_pid] = 0;
|
||||
|
||||
UE_info->eNB_UE_stats[CC_idP][UE_id].ulsch_errors++;
|
||||
if (UE_scheduling_control->ul_consecutive_errors++ == 10) {
|
||||
UE_scheduling_control->ul_failure_timer = 1;
|
||||
}
|
||||
@@ -236,6 +238,7 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
}
|
||||
} else {
|
||||
UE_scheduling_control->round_UL[CC_idP][harq_pid]++;
|
||||
UE_info->eNB_UE_stats[CC_idP][UE_id].ulsch_rounds[UE_scheduling_control->round_UL[CC_idP][harq_pid]]++;
|
||||
}
|
||||
|
||||
/* CDRX UL HARQ timers */
|
||||
@@ -287,17 +290,35 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
AssertFatal(mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx > 1,
|
||||
"maxHARQ %d should be greater than 1\n",
|
||||
(int) mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx);
|
||||
LOG_D(MAC, "[eNB %d][PUSCH %d] CC_id %d [RAPROC Msg3] Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",
|
||||
LOG_D(MAC, "[eNB %d][PUSCH %d] CC_id %d [RAPROC Msg3] Received ULSCH sdu (%s) round %d from PHY (rnti %x, RA_id %d) ul_cqi %d, timing advance %d\n",
|
||||
enb_mod_idP,
|
||||
harq_pid,
|
||||
CC_idP,
|
||||
sduP!=NULL ? "OK" : "in error",
|
||||
ra->msg3_round,
|
||||
current_rnti,
|
||||
RA_id,
|
||||
ul_cqi);
|
||||
ul_cqi,
|
||||
timing_advance);
|
||||
|
||||
first_rb = ra->msg3_first_rb;
|
||||
|
||||
if (sduP == NULL) { // we've got an error on Msg3
|
||||
bool no_sig = true;
|
||||
if (sduP) {
|
||||
for (int k = 0; k < sdu_lenP; k++) {
|
||||
if(sduP[k]!=0) {
|
||||
no_sig = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (no_sig || sduP == NULL) { // we've got an error on Msg3
|
||||
|
||||
if(no_sig) {
|
||||
LOG_D(MAC,"No signal in Msg3\n");
|
||||
}
|
||||
|
||||
LOG_D(MAC, "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n",
|
||||
enb_mod_idP,
|
||||
CC_idP,
|
||||
@@ -306,6 +327,20 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
(int) mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx);
|
||||
|
||||
if (ra->msg3_round >= mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx - 1) {
|
||||
|
||||
// Release RNTI of LTE PHY when RA does not succeed
|
||||
UE_free_list_t *free_list = NULL;
|
||||
pthread_mutex_lock(&lock_ue_freelist);
|
||||
free_list = &mac->UE_free_list;
|
||||
free_list->UE_free_ctrl[free_list->tail_freelist].rnti = current_rnti;
|
||||
free_list->UE_free_ctrl[free_list->tail_freelist].removeContextFlg = 1;
|
||||
free_list->UE_free_ctrl[free_list->tail_freelist].raFlag = 1;
|
||||
free_list->num_UEs++;
|
||||
mac->UE_release_req.ue_release_request_body.ue_release_request_TLVs_list[mac->UE_release_req.ue_release_request_body.number_of_TLVs].rnti = current_rnti;
|
||||
mac->UE_release_req.ue_release_request_body.number_of_TLVs++;
|
||||
free_list->tail_freelist = (free_list->tail_freelist + 1) % (NUMBER_OF_UE_MAX+1);
|
||||
pthread_mutex_unlock(&lock_ue_freelist);
|
||||
|
||||
cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti);
|
||||
nfapi_hi_dci0_request_t *hi_dci0_req = NULL;
|
||||
uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_idP], subframeP);
|
||||
@@ -403,13 +438,8 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
switch (rx_ces[i]) { // implement and process PHR + CRNTI + BSR
|
||||
case POWER_HEADROOM:
|
||||
if (UE_id != -1) {
|
||||
uint16_t nb_rb_ul = UE_template_ptr->nb_rb_ul[harq_pid];
|
||||
if (nb_rb_ul < 1 || nb_rb_ul > sizeof(hundred_times_log10_NPRB) / sizeof(hundred_times_log10_NPRB[0])) {
|
||||
LOG_E(MAC, "invalid nb_rb_ul=%u for harq_pid=%u\n", nb_rb_ul, harq_pid);
|
||||
break;
|
||||
}
|
||||
UE_template_ptr->phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET
|
||||
+ (int8_t)(hundred_times_log10_NPRB[nb_rb_ul - 1] / 100);
|
||||
/*UE_template_ptr->phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET + (int8_t)(hundred_times_log10_NPRB[UE_template_ptr->nb_rb_ul[harq_pid] - 1] / 100);i*/
|
||||
UE_template_ptr->phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET + estimate_ue_tx_power(0,sdu_lenP*8,UE_template_ptr->nb_rb_ul[harq_pid],0,mac->common_channels[CC_idP].Ncp,0);
|
||||
|
||||
if (UE_template_ptr->phr_info > 40) {
|
||||
UE_template_ptr->phr_info = 40;
|
||||
@@ -430,7 +460,7 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
case CRNTI:
|
||||
old_rnti = (((uint16_t) payload_ptr[0]) << 8) + payload_ptr[1];
|
||||
old_UE_id = find_UE_id(enb_mod_idP, old_rnti);
|
||||
LOG_D(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",
|
||||
LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
@@ -444,7 +474,7 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
/* Receiving CRNTI means that the current rnti has to go away */
|
||||
if (old_UE_id != -1) {
|
||||
if (mac_eNB_get_rrc_status(enb_mod_idP,old_rnti) == RRC_HO_EXECUTION) {
|
||||
LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) Handover case\n",
|
||||
LOG_D(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) Handover case\n",
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
@@ -689,6 +719,19 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
break;
|
||||
}
|
||||
|
||||
bool no_sig = true;
|
||||
for (int k = 0; k < sdu_lenP; k++) {
|
||||
if(sduP[k]!=0) {
|
||||
no_sig = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(no_sig) {
|
||||
LOG_D(MAC, "No signal\n");
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_D(MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n",
|
||||
enb_mod_idP,
|
||||
CC_idP,
|
||||
@@ -1299,16 +1342,19 @@ schedule_ulsch(module_id_t module_idP,
|
||||
|
||||
/* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */
|
||||
for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) {
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &RC.eNB[module_idP][CC_id]->frame_parms;
|
||||
if (is_prach_subframe(frame_parms, sched_frame, sched_subframe)) {
|
||||
int start_rb = get_prach_prb_offset(
|
||||
frame_parms,
|
||||
frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
|
||||
0, // tdd_mapindex
|
||||
sched_frame); // Nf
|
||||
|
||||
if (is_prach_subframe0(cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,cc->tdd_Config!=NULL ? 1 : 0,
|
||||
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
|
||||
sched_frame, sched_subframe)) {
|
||||
int start_rb = get_prach_prb_offset(cc->tdd_Config!=NULL ? 1 : 0,
|
||||
cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,
|
||||
to_prb(cc->ul_Bandwidth),
|
||||
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
|
||||
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset,
|
||||
0, // tdd_mapindex
|
||||
sched_frame); // Nf
|
||||
for (int i = 0; i < 6; i++)
|
||||
cc[CC_id].vrb_map_UL[start_rb + i] = 1;
|
||||
cc->vrb_map_UL[start_rb + i] = 1;
|
||||
}
|
||||
|
||||
/* HACK: let's remove the PUCCH from available RBs
|
||||
@@ -1320,24 +1366,24 @@ schedule_ulsch(module_id_t module_idP,
|
||||
*/
|
||||
switch (to_prb(cc[CC_id].ul_Bandwidth)) {
|
||||
case 25:
|
||||
cc[CC_id].vrb_map_UL[0] = 1;
|
||||
cc[CC_id].vrb_map_UL[24] = 1;
|
||||
cc->vrb_map_UL[0] = 1;
|
||||
cc->vrb_map_UL[24] = 1;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
cc[CC_id].vrb_map_UL[0] = 1;
|
||||
cc[CC_id].vrb_map_UL[1] = 1;
|
||||
cc[CC_id].vrb_map_UL[48] = 1;
|
||||
cc[CC_id].vrb_map_UL[49] = 1;
|
||||
cc->vrb_map_UL[0] = 1;
|
||||
cc->vrb_map_UL[1] = 1;
|
||||
cc->vrb_map_UL[48] = 1;
|
||||
cc->vrb_map_UL[49] = 1;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
cc[CC_id].vrb_map_UL[0] = 1;
|
||||
cc[CC_id].vrb_map_UL[1] = 1;
|
||||
cc[CC_id].vrb_map_UL[2] = 1;
|
||||
cc[CC_id].vrb_map_UL[97] = 1;
|
||||
cc[CC_id].vrb_map_UL[98] = 1;
|
||||
cc[CC_id].vrb_map_UL[99] = 1;
|
||||
cc->vrb_map_UL[0] = 1;
|
||||
cc->vrb_map_UL[1] = 1;
|
||||
cc->vrb_map_UL[2] = 1;
|
||||
cc->vrb_map_UL[97] = 1;
|
||||
cc->vrb_map_UL[98] = 1;
|
||||
cc->vrb_map_UL[99] = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1355,6 +1401,8 @@ schedule_ulsch(module_id_t module_idP,
|
||||
/*
|
||||
* Schedule the DCI0 for ULSCH
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
schedule_ulsch_rnti(module_id_t module_idP,
|
||||
int CC_id,
|
||||
@@ -1362,7 +1410,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
sub_frame_t subframeP,
|
||||
unsigned char sched_subframeP) {
|
||||
/* TODO: does this need to be static? */
|
||||
static int32_t tpc_accumulated = 0;
|
||||
/* values from 0 to 7 can be used for mapping the cyclic shift
|
||||
* (36.211 , Table 5.5.2.1.1-1) */
|
||||
const uint32_t cshift = 0;
|
||||
@@ -1487,8 +1534,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
/* Power control */
|
||||
/*
|
||||
* Compute the expected ULSCH RX snr (for the stats)
|
||||
* This is the normalized RX snr and this should be constant (regardless
|
||||
* of mcs) Is not in dBm, unit from nfapi, converting to dBm
|
||||
*
|
||||
*/
|
||||
const int32_t snr = UE_sched_ctrl_ptr->pusch_snr[CC_id];
|
||||
const int32_t target_snr = mac->puSch10xSnr / 10;
|
||||
@@ -1507,12 +1553,12 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
UE_template_ptr->pusch_tpc_tx_frame = frameP;
|
||||
UE_template_ptr->pusch_tpc_tx_subframe = subframeP;
|
||||
|
||||
if (snr > target_snr + 4) {
|
||||
if (snr > target_snr + PUSCH_PCHYST) {
|
||||
tpc = 0; // -1
|
||||
tpc_accumulated--;
|
||||
} else if (snr < target_snr - 4) {
|
||||
UE_sched_ctrl_ptr->pusch_tpc_accumulated[CC_id]--;
|
||||
} else if (snr < target_snr - PUSCH_PCHYST) {
|
||||
tpc = 2; // +1
|
||||
tpc_accumulated++;
|
||||
UE_sched_ctrl_ptr->pusch_tpc_accumulated[CC_id]++;
|
||||
}
|
||||
}
|
||||
if (tpc != 1) {
|
||||
@@ -1524,7 +1570,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
subframeP,
|
||||
harq_pid,
|
||||
tpc,
|
||||
tpc_accumulated,
|
||||
UE_sched_ctrl_ptr->pusch_tpc_accumulated[CC_id],
|
||||
snr,
|
||||
target_snr);
|
||||
}
|
||||
@@ -1578,6 +1624,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
const uint8_t ndi = 1 - UE_template_ptr->oldNDI_UL[harq_pid]; // NDI: new data indicator
|
||||
const uint8_t mcs = UE_template_ptr->pre_assigned_mcs_ul;
|
||||
UE_template_ptr->oldNDI_UL[harq_pid] = ndi;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0]++;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].snr = snr;
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].target_snr = target_snr;
|
||||
UE_template_ptr->mcs_UL[harq_pid] = mcs;
|
||||
@@ -1599,8 +1646,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2 = mcs;
|
||||
|
||||
while (rb_table[rb_table_index] > 45 && rb_table_index > 0)
|
||||
rb_table_index--;
|
||||
|
||||
UE_template_ptr->TBS_UL[harq_pid] = get_TBS_UL(mcs, rb_table[rb_table_index]);
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx += rb_table[rb_table_index];
|
||||
@@ -2086,10 +2131,10 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
|
||||
|
||||
if (snr > target_snr + 4) {
|
||||
tpc = 0; //-1
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id]--;
|
||||
UE_sched_ctrl->pusch_tpc_accumulated[CC_id]--;
|
||||
} else if (snr < target_snr - 4) {
|
||||
tpc = 2; //+1
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id]++;
|
||||
UE_sched_ctrl->pusch_tpc_accumulated[CC_id]++;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
@@ -2104,7 +2149,7 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
|
||||
subframeP,
|
||||
harq_pid,
|
||||
tpc,
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id],
|
||||
UE_sched_ctrl->pusch_tpc_accumulated[CC_id],
|
||||
snr,
|
||||
target_snr);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
#define MAX_MAC_INST 16
|
||||
#define BCCH_PAYLOAD_SIZE_MAX 128
|
||||
#define CCCH_PAYLOAD_SIZE_MAX 128
|
||||
#define CCCH_PAYLOAD_SIZE_MAX 512
|
||||
#define PCCH_PAYLOAD_SIZE_MAX 128
|
||||
#define RAR_PAYLOAD_SIZE_MAX 128
|
||||
|
||||
@@ -143,7 +143,10 @@
|
||||
#define MAX_SUPPORTED_BW 4
|
||||
/*!\brief CQI values range from 1 to 15 (4 bits) */
|
||||
#define CQI_VALUE_RANGE 16
|
||||
|
||||
/*!\brief Hysteresis of PUSCH power control loop */
|
||||
#define PUSCH_PCHYST 1
|
||||
/*!\brief Hysteresis of PUCCH power control loop */
|
||||
#define PUCCH_PCHYST 1
|
||||
/*!\brief value for indicating BSR Timer is not running */
|
||||
#define MAC_UE_BSR_TIMER_NOT_RUNNING (0xFFFF)
|
||||
|
||||
@@ -490,7 +493,7 @@ typedef struct {
|
||||
|
||||
/*! \brief Uplink SCH PDU Structure */
|
||||
typedef struct {
|
||||
int8_t payload[SCH_PAYLOAD_SIZE_MAX]; /*!< \brief SACH payload */
|
||||
uint8_t payload[SCH_PAYLOAD_SIZE_MAX]; /*!< \brief SACH payload */
|
||||
uint16_t Pdu_size;
|
||||
} __attribute__ ((__packed__)) ULSCH_PDU;
|
||||
|
||||
@@ -615,6 +618,8 @@ typedef struct {
|
||||
|
||||
// here for RX
|
||||
//
|
||||
|
||||
uint32_t ulsch_rounds[4];
|
||||
uint32_t ulsch_bitrate;
|
||||
//
|
||||
uint32_t ulsch_bytes_rx;
|
||||
@@ -684,6 +689,17 @@ typedef struct {
|
||||
// Length of SDU Got from LC DL
|
||||
uint32_t sdu_length_tx[NB_RB_MAX];
|
||||
|
||||
int lc_bytes_tx[64];
|
||||
int dlsch_rounds[8];
|
||||
int dlsch_errors;
|
||||
int dlsch_total_bytes;
|
||||
|
||||
int lc_bytes_rx[64];
|
||||
int ulsch_rounds[8];
|
||||
int ulsch_errors;
|
||||
int ulsch_total_bytes_scheduled;
|
||||
int ulsch_total_bytes_rx;
|
||||
|
||||
|
||||
/// overall
|
||||
//
|
||||
@@ -776,7 +792,6 @@ typedef struct {
|
||||
uint32_t num_mac_sdu_rx;
|
||||
// Length of SDU Got from LC UL - Size array can be refined
|
||||
uint32_t sdu_length_rx[NB_RB_MAX];
|
||||
|
||||
} eNB_UE_STATS;
|
||||
/*! \brief eNB template for UE context information */
|
||||
|
||||
@@ -982,7 +997,8 @@ typedef struct {
|
||||
uint16_t feedback_cnt[NFAPI_CC_MAX];
|
||||
uint16_t timing_advance;
|
||||
uint16_t timing_advance_r9;
|
||||
uint8_t tpc_accumulated[NFAPI_CC_MAX];
|
||||
int8_t pusch_tpc_accumulated[NFAPI_CC_MAX];
|
||||
int8_t pucch_tpc_accumulated[NFAPI_CC_MAX];
|
||||
uint8_t periodic_wideband_cqi[NFAPI_CC_MAX];
|
||||
uint8_t periodic_wideband_spatial_diffcqi[NFAPI_CC_MAX];
|
||||
uint8_t periodic_wideband_pmi[NFAPI_CC_MAX];
|
||||
@@ -1176,6 +1192,8 @@ typedef struct {
|
||||
rnti_t rnti;
|
||||
///remove UE context flag
|
||||
boolean_t removeContextFlg;
|
||||
///remove RA flag
|
||||
boolean_t raFlag;
|
||||
} UE_free_ctrl_t;
|
||||
/*! \brief REMOVE UE list used by eNB to order UEs/CC for deleting*/
|
||||
typedef struct {
|
||||
@@ -1342,6 +1360,7 @@ typedef struct {
|
||||
uint8_t FeMBMS_flag;
|
||||
} COMMON_channels_t;
|
||||
/*! \brief top level eNB MAC structure */
|
||||
|
||||
typedef struct eNB_MAC_INST_s {
|
||||
/// Ethernet parameters for northbound midhaul interface
|
||||
eth_params_t eth_params_n;
|
||||
@@ -1435,6 +1454,17 @@ typedef struct eNB_MAC_INST_s {
|
||||
|
||||
int32_t puSch10xSnr;
|
||||
int32_t puCch10xSnr;
|
||||
|
||||
int max_ul_rb_index;
|
||||
|
||||
int ue_multiple_max;
|
||||
|
||||
int use_mcs_offset;
|
||||
|
||||
double bler_lower;
|
||||
|
||||
double bler_upper;
|
||||
pthread_t mac_stats_thread;
|
||||
} eNB_MAC_INST;
|
||||
|
||||
/*
|
||||
|
||||
@@ -65,6 +65,7 @@ extern const int cqi_to_mcs[16];
|
||||
extern uint32_t RRC_CONNECTION_FLAG;
|
||||
|
||||
extern uint8_t rb_table[34];
|
||||
extern rb_id_t mbms_rab_id;
|
||||
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
@@ -77,4 +78,8 @@ extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
|
||||
extern mac_rlc_am_muilist_t rlc_am_mui;
|
||||
extern SCHEDULER_MODES global_scheduler_mode;
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern rb_id_t mbms_rab_id;
|
||||
#endif //DEF_H
|
||||
|
||||
@@ -40,8 +40,84 @@
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "intertask_interface.h"
|
||||
#include <pthread.h>
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern int oai_exit;
|
||||
|
||||
void *mac_stats_thread(void *param) {
|
||||
eNB_MAC_INST *mac = (eNB_MAC_INST *)param;
|
||||
FILE *fd;
|
||||
UE_info_t *UE_info = &(mac->UE_info);
|
||||
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
fd=fopen("MAC_stats.log","w+");
|
||||
AssertFatal(fd!=NULL,"Cannot open MAC_stats.log\n");
|
||||
|
||||
for (int UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (UE_info->active[UE_id]) {
|
||||
int rnti = UE_RNTI(mac->Mod_id, UE_id);
|
||||
int CC_id = UE_PCCID(mac->Mod_id, UE_id);
|
||||
UE_sched_ctrl_t *UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
|
||||
|
||||
double total_bler;
|
||||
if(UE_scheduling_control->pusch_rx_num[CC_id] == 0 && UE_scheduling_control->pusch_rx_error_num[CC_id] == 0) {
|
||||
total_bler = 0;
|
||||
}
|
||||
else {
|
||||
total_bler = (double)UE_scheduling_control->pusch_rx_error_num[CC_id] / (double)(UE_scheduling_control->pusch_rx_error_num[CC_id] + UE_scheduling_control->pusch_rx_num[CC_id]) * 100;
|
||||
}
|
||||
fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d\n",
|
||||
rnti,
|
||||
UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync",
|
||||
UE_info->UE_template[CC_id][UE_id].phr_info,
|
||||
UE_scheduling_control->dl_cqi[CC_id],
|
||||
UE_scheduling_control->pusch_snr/*_avg*/[CC_id],
|
||||
UE_scheduling_control->pucch1_snr[CC_id],
|
||||
UE_scheduling_control->rlc_out_of_resources_cnt,
|
||||
UE_scheduling_control->pusch_rx_num[CC_id],
|
||||
UE_scheduling_control->pusch_rx_error_num[CC_id],
|
||||
UE_scheduling_control->pusch_bler[CC_id],
|
||||
mac->bler_lower,mac->bler_upper,total_bler,
|
||||
UE_scheduling_control->mcs_offset[CC_id],
|
||||
UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul,
|
||||
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul,
|
||||
UE_info->UE_template[CC_id][UE_id].estimated_ul_buffer,
|
||||
UE_info->UE_template[CC_id][UE_id].scheduled_ul_bytes,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes_rx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_num_pdus_rx,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_num_pdus,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used,
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
UE_info->UE_template[CC_id][UE_id].dl_buffer_total,
|
||||
#else
|
||||
0,
|
||||
#endif
|
||||
UE_scheduling_control->first_cnt[CC_id],
|
||||
UE_scheduling_control->ret_cnt[CC_id],
|
||||
UE_scheduling_control->aperiodic_ri_received[CC_id]
|
||||
);
|
||||
fprintf(fd," ULSCH rounds %d/%d/%d/%d, DLSCH rounds %d/%d/%d/%d, ULSCH errors %d, DLSCH errors %d\n",
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[1],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[2],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[3],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[0],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[1],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[2],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[3],
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_errors,
|
||||
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_errors);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void init_UE_info(UE_info_t *UE_info)
|
||||
{
|
||||
@@ -128,6 +204,9 @@ void mac_top_init_eNB(void)
|
||||
pdcp_layer_init();
|
||||
|
||||
rrc_init_global_param();
|
||||
|
||||
for (i=0;i<RC.nb_macrlc_inst; i++) pthread_create(&mac[i]->mac_stats_thread,NULL,mac_stats_thread,(void*)mac[i]);
|
||||
|
||||
}
|
||||
|
||||
void mac_init_cell_params(int Mod_idP, int CC_idP)
|
||||
|
||||
@@ -113,10 +113,29 @@ bool try_allocate_harq_retransmission(module_id_t Mod_id,
|
||||
LOG_D(MAC, "cannot allocate UE %d: no CCE can be allocated\n", UE_id);
|
||||
return false;
|
||||
}
|
||||
/* if nb_rb is not multiple of RBGsize, then last RBG must be free
|
||||
* (it will be allocated just below)
|
||||
*/
|
||||
if (nb_rb % RBGsize && !rbgalloc_mask[N_RBG-1]) {
|
||||
LOG_E(MAC, "retransmission: last RBG already allocated (this should not happen)\n");
|
||||
return false;
|
||||
}
|
||||
ue_ctrl->pre_dci_dl_pdu_idx = idx;
|
||||
// retransmissions: directly allocate
|
||||
*n_rbg_sched -= nb_rbg;
|
||||
ue_ctrl->pre_nb_available_rbs[CC_id] += nb_rb;
|
||||
if (nb_rb % RBGsize) {
|
||||
/* special case: if nb_rb is not multiple of RBGsize, then allocate last RBG.
|
||||
* If we instead allocated another RBG then we will retransmit with more
|
||||
* RBs and the UE will not accept it.
|
||||
* (This has been seen in a test with cots UEs, if not true, then change
|
||||
* code as needed.)
|
||||
* At this point rbgalloc_mask[N_RBG-1] == 1 due to the test above.
|
||||
*/
|
||||
ue_ctrl->rballoc_sub_UE[CC_id][N_RBG-1] = 1;
|
||||
rbgalloc_mask[N_RBG-1] = 0;
|
||||
nb_rbg--;
|
||||
}
|
||||
for (; nb_rbg > 0; start_rbg++) {
|
||||
if (!rbgalloc_mask[start_rbg])
|
||||
continue;
|
||||
@@ -730,13 +749,13 @@ void calculate_max_mcs_min_rb(module_id_t mod_id,
|
||||
int tbs = get_TBS_UL(*mcs, rb_table[*rb_index]);
|
||||
|
||||
// fixme: set use_srs flag
|
||||
*tx_power = estimate_ue_tx_power(tbs * 8, rb_table[*rb_index], 0, Ncp, 0);
|
||||
*tx_power = estimate_ue_tx_power(0,tbs * 8, rb_table[*rb_index], 0, Ncp, 0);
|
||||
|
||||
/* find maximum MCS */
|
||||
while ((phr - *tx_power < 0 || tbs > bytes) && *mcs > 3) {
|
||||
(*mcs)--;
|
||||
tbs = get_TBS_UL(*mcs, rb_table[*rb_index]);
|
||||
*tx_power = estimate_ue_tx_power(tbs * 8, rb_table[*rb_index], 0, Ncp, 0);
|
||||
*tx_power = estimate_ue_tx_power(0,tbs * 8, rb_table[*rb_index], 0, Ncp, 0);
|
||||
}
|
||||
|
||||
/* find minimum necessary RBs */
|
||||
@@ -746,7 +765,7 @@ void calculate_max_mcs_min_rb(module_id_t mod_id,
|
||||
&& phr - *tx_power > 0) {
|
||||
(*rb_index)++;
|
||||
tbs = get_TBS_UL(*mcs, rb_table[*rb_index]);
|
||||
*tx_power = estimate_ue_tx_power(tbs * 8, rb_table[*rb_index], 0, Ncp, 0);
|
||||
*tx_power = estimate_ue_tx_power(0,tbs * 8, rb_table[*rb_index], 0, Ncp, 0);
|
||||
}
|
||||
|
||||
/* Decrease if we went to far in last iteration */
|
||||
@@ -801,7 +820,7 @@ int rr_ul_run(module_id_t Mod_id,
|
||||
AssertFatal(num_contig_rb <= 2, "cannot handle more than two contiguous RB regions\n");
|
||||
UE_info_t *UE_info = &RC.mac[Mod_id]->UE_info;
|
||||
const int max_rb = num_contig_rb > 1 ? MAX(rbs[0].length, rbs[1].length) : rbs[0].length;
|
||||
|
||||
eNB_MAC_INST *mac = RC.mac[Mod_id];
|
||||
/* for every UE: check whether we have to handle a retransmission (and
|
||||
* allocate, if so). If not, compute how much RBs this UE would need */
|
||||
int rb_idx_required[MAX_MOBILES_PER_ENB];
|
||||
@@ -809,7 +828,7 @@ int rr_ul_run(module_id_t Mod_id,
|
||||
int num_ue_req = 0;
|
||||
for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
|
||||
UE_TEMPLATE *UE_template = &UE_info->UE_template[CC_id][UE_id];
|
||||
uint8_t harq_pid = subframe2harqpid(&RC.mac[Mod_id]->common_channels[CC_id],
|
||||
uint8_t harq_pid = subframe2harqpid(&mac->common_channels[CC_id],
|
||||
sched_frame, sched_subframe);
|
||||
if (UE_info->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid] > 0) {
|
||||
/* this UE has a retransmission, allocate it right away */
|
||||
@@ -845,11 +864,11 @@ int rr_ul_run(module_id_t Mod_id,
|
||||
}
|
||||
} else {
|
||||
LOG_W(MAC,
|
||||
"cannot allocate UL retransmission for UE %d (nb_rb %d)\n",
|
||||
UE_id,
|
||||
nb_rb);
|
||||
"%d.%d cannot allocate UL retransmission for UE %d (nb_rb %d, rbs0.length %d, rbs1.length %d,rbs0.start %d,rbs1.start %d)\n",
|
||||
sched_frame,sched_subframe,UE_id,
|
||||
nb_rb, rbs[0].length,rbs[1].length,rbs[0].start,rbs[1].start);
|
||||
UE_template->pre_dci_ul_pdu_idx = -1; // do not need CCE
|
||||
RC.mac[Mod_id]->HI_DCI0_req[CC_id][subframe].hi_dci0_request_body.number_of_dci--;
|
||||
mac->HI_DCI0_req[CC_id][subframe].hi_dci0_request_body.number_of_dci--;
|
||||
continue;
|
||||
}
|
||||
LOG_D(MAC, "%4d.%d UE %d retx %d RBs at start %d\n",
|
||||
@@ -895,10 +914,9 @@ int rr_ul_run(module_id_t Mod_id,
|
||||
&tx_power);
|
||||
|
||||
UE_template->pre_assigned_mcs_ul = mcs;
|
||||
/* rb_idx_given >= 22: apparently the PHY cannot support more than 48
|
||||
* RBs in the uplink. Hence, we limit every UE to 48 RBs, which is at
|
||||
* index 22 */
|
||||
rb_idx_required[UE_id] = min(22, rb_table_index);
|
||||
/* rb_idx_given >= MAX index: limit RBs to value in configuration file
|
||||
* RBs in the uplink. */
|
||||
rb_idx_required[UE_id] = min(mac->max_ul_rb_index, rb_table_index);
|
||||
//UE_template->pre_allocated_nb_rb_ul = rb_table[rb_table_index];
|
||||
/* only print log when PHR changed */
|
||||
static int phr = 0;
|
||||
|
||||
@@ -67,8 +67,10 @@ fill_rar(const module_id_t module_idP,
|
||||
rar[5] = (uint8_t) (ra->rnti & 0xff);
|
||||
//ra->timing_offset = 0;
|
||||
ra->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps
|
||||
rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4
|
||||
rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4
|
||||
//rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4
|
||||
//rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4
|
||||
rar[0] = (uint8_t) (ra->timing_offset >> (4)); // 7 MSBs of timing advance + divide by 4
|
||||
rar[1] = (uint8_t) (ra->timing_offset << (4)) & 0xf0; // 4 LSBs of timing advance + divide by 4
|
||||
COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id];
|
||||
|
||||
if(N_RB_UL == 25) {
|
||||
|
||||
@@ -72,7 +72,7 @@ extern UL_IND_t *UL_INFO;
|
||||
extern int next_ra_frame;
|
||||
extern module_id_t next_Mod_id;
|
||||
|
||||
int mbms_rab_id=2047;//[8] = {2047,2047,2047,2047,2047,2047,2047,2047};
|
||||
rb_id_t mbms_rab_id=2047;//[8] = {2047,2047,2047,2047,2047,2047,2047,2047};
|
||||
static int mbms_mch_i=0;
|
||||
//static int num_msi_per_CSA[28];
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
uint32_t Ninfo, Np_info, C;
|
||||
uint8_t n, scale;
|
||||
|
||||
LOG_D(MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh);
|
||||
|
||||
nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
|
||||
nb_re = min(156, nbp_re) * nb_rb;
|
||||
scale = (R>1024)?11:10;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define TABLE_38213_13_1_NUM_INDEXES 15
|
||||
#define TABLE_38213_13_2_NUM_INDEXES 14
|
||||
@@ -53,7 +54,7 @@
|
||||
// Definitions for MAC control and data
|
||||
#define NR_BCCH_DL_SCH 3 // SI
|
||||
#define NR_BCCH_BCH 5 // MIB
|
||||
#define CCCH_PAYLOAD_SIZE_MAX 128
|
||||
#define CCCH_PAYLOAD_SIZE_MAX 512
|
||||
#define RAR_PAYLOAD_SIZE_MAX 128
|
||||
#define MAX_BWP_SIZE 275
|
||||
|
||||
@@ -148,10 +149,10 @@ typedef struct {
|
||||
// single Entry PHR MAC CE
|
||||
// TS 38.321 ch. 6.1.3.8
|
||||
typedef struct {
|
||||
uint8_t PH: 6;
|
||||
uint8_t R1: 2;
|
||||
uint8_t PCMAX: 6;
|
||||
uint8_t R2: 6;
|
||||
uint8_t PH: 6; // octet 1 [5:0]
|
||||
uint8_t R1: 2; // octet 1 [7:6]
|
||||
uint8_t PCMAX: 6; // octet 2 [5:0]
|
||||
uint8_t R2: 2; // octet 2 [7:6]
|
||||
} __attribute__ ((__packed__)) NR_SINGLE_ENTRY_PHR_MAC_CE;
|
||||
|
||||
|
||||
@@ -334,12 +335,12 @@ typedef struct {
|
||||
#define DL_SCH_LCID_CON_RES_ID 0x3E
|
||||
#define DL_SCH_LCID_PADDING 0x3F
|
||||
|
||||
#define UL_SCH_LCID_CCCH 0x00
|
||||
#define UL_SCH_LCID_CCCH1 0x00
|
||||
#define UL_SCH_LCID_SRB1 0x01
|
||||
#define UL_SCH_LCID_SRB2 0x02
|
||||
#define UL_SCH_LCID_SRB3 0x03
|
||||
#define UL_SCH_LCID_DTCH 0x04
|
||||
#define UL_SCH_LCID_CCCH_MSG3 0x21
|
||||
#define UL_SCH_LCID_CCCH 0x34
|
||||
#define UL_SCH_LCID_RECOMMENDED_BITRATE_QUERY 0x35
|
||||
#define UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT 0x36
|
||||
#define UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION 0x37
|
||||
@@ -418,14 +419,6 @@ typedef enum {
|
||||
NR_RNTI_MCS_C,
|
||||
} nr_rnti_type_t;
|
||||
|
||||
typedef enum subcarrier_spacing_e {
|
||||
scs_15kHz = 0x1,
|
||||
scs_30kHz = 0x2,
|
||||
scs_60kHz = 0x4,
|
||||
scs_120kHz = 0x8,
|
||||
scs_240kHz = 0x16
|
||||
} subcarrier_spacing_t;
|
||||
|
||||
typedef enum channel_bandwidth_e {
|
||||
bw_5MHz = 0x1,
|
||||
bw_10MHz = 0x2,
|
||||
@@ -462,6 +455,7 @@ typedef struct Type0_PDCCH_CSS_config_s {
|
||||
uint32_t ssb_length;
|
||||
uint32_t ssb_index;
|
||||
uint32_t cset_start_rb;
|
||||
bool active;
|
||||
} NR_Type0_PDCCH_CSS_config_t;
|
||||
|
||||
#endif /*__LAYER2_MAC_H__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,26 +39,26 @@
|
||||
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
|
||||
|
||||
void get_frame_type(uint16_t nr_bandP, uint8_t scs_index, lte_frame_type_t *current_type);
|
||||
lte_frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index);
|
||||
|
||||
void get_delta_duplex(int nr_bandP, uint8_t scs_index, int32_t *delta_duplex);
|
||||
int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index);
|
||||
|
||||
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);
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI);
|
||||
|
||||
int is_nr_DL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slot_t slotP);
|
||||
|
||||
int is_nr_UL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slotP, lte_frame_type_t frame_type);
|
||||
|
||||
uint16_t nr_dci_size(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
uint16_t nr_dci_size(const NR_BWP_UplinkCommon_t *initialULBWP,
|
||||
const NR_CellGroupConfig_t *cg,
|
||||
dci_pdu_rel15_t *dci_pdu,
|
||||
nr_dci_format_t format,
|
||||
nr_rnti_type_t rnti_type,
|
||||
uint16_t N_RB,
|
||||
nr_rnti_type_t rnti_type,
|
||||
uint16_t N_RB,
|
||||
int bwp_id);
|
||||
|
||||
void find_aggregation_candidates(uint8_t *aggregation_level,
|
||||
@@ -81,7 +81,7 @@ int get_nr_prach_info_from_index(uint8_t index,
|
||||
uint8_t *N_dur,
|
||||
uint16_t *RA_sfn_index,
|
||||
uint8_t *N_RA_slot,
|
||||
uint8_t *config_period);
|
||||
uint8_t *config_period);
|
||||
|
||||
int get_nr_prach_occasion_info_from_index(uint8_t index,
|
||||
uint32_t pointa,
|
||||
@@ -113,7 +113,7 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig,long transformPreco
|
||||
|
||||
int get_format0(uint8_t index, uint8_t unpaired,frequency_range_t);
|
||||
|
||||
int64_t *get_prach_config_info(uint32_t pointa,
|
||||
int64_t *get_prach_config_info(frequency_range_t freq_range,
|
||||
uint8_t index,
|
||||
uint8_t unpaired);
|
||||
|
||||
@@ -121,17 +121,23 @@ uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config);
|
||||
|
||||
int get_num_dmrs(uint16_t dmrs_mask );
|
||||
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position);
|
||||
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength);
|
||||
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength, uint8_t start_symbolt, uint8_t dmrs_typeA_position);
|
||||
|
||||
uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table);
|
||||
uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB);
|
||||
|
||||
int get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config,
|
||||
NR_MIB_t *mib,
|
||||
uint8_t extra_bits,
|
||||
uint32_t ssb_length,
|
||||
uint32_t ssb_index,
|
||||
uint32_t ssb_offset_point_a);
|
||||
void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config,
|
||||
frame_t frameP,
|
||||
NR_MIB_t *mib,
|
||||
uint8_t num_slot_per_frame,
|
||||
uint8_t ssb_subcarrier_offset,
|
||||
uint16_t ssb_start_symbol,
|
||||
NR_SubcarrierSpacing_t scs_ssb,
|
||||
frequency_range_t frequency_range,
|
||||
uint32_t ssb_index,
|
||||
uint32_t ssb_offset_point_a);
|
||||
|
||||
uint16_t get_ssb_start_symbol(const long band, NR_SubcarrierSpacing_t scs, int i_ssb);
|
||||
|
||||
int16_t get_N_RA_RB (int delta_f_RA_PRACH,int delta_f_PUSCH);
|
||||
|
||||
@@ -140,9 +146,14 @@ bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config,
|
||||
uint8_t *K_ptrs, uint8_t *L_ptrs,uint8_t *portIndex,
|
||||
uint8_t *nERatio,uint8_t *reOffset,
|
||||
uint8_t NrOfSymbols);
|
||||
void get_band(uint64_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
|
||||
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
|
||||
bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
|
||||
uint16_t rbSize,uint8_t mcsIndex, uint8_t mcsTable,
|
||||
uint8_t *K_ptrs, uint8_t *L_ptrs,
|
||||
uint8_t *reOffset, uint8_t *maxNumPorts, uint8_t *ulPower,
|
||||
uint8_t NrOfSymbols);
|
||||
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype);
|
||||
|
||||
/* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16
|
||||
@param *pusch_config, pointer to pusch config
|
||||
@@ -151,11 +162,16 @@ uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Posi
|
||||
@param rnti_type rnti type
|
||||
@param configuredGrant indicates whether a configured grant was received or not
|
||||
@returns transformPrecoding value */
|
||||
uint8_t get_transformPrecoding(const NR_ServingCellConfigCommon_t *scc,
|
||||
uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
|
||||
const NR_PUSCH_Config_t *pusch_config,
|
||||
const NR_BWP_Uplink_t *ubwp,
|
||||
uint8_t *dci_format,
|
||||
int rnti_type,
|
||||
uint8_t configuredGrant);
|
||||
|
||||
void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP) ;
|
||||
#endif
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
extern const uint8_t nr_slots_per_frame[5];
|
||||
|
||||
extern dci_pdu_rel15_t *def_dci_pdu_rel15;
|
||||
|
||||
/* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
|
||||
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
|
||||
extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
@@ -139,4 +141,13 @@ extern const float table_38213_13_12_c3[16];
|
||||
|
||||
extern const int32_t table_38213_10_1_1_c2[5];
|
||||
|
||||
extern const uint8_t table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[16][3];
|
||||
extern const uint8_t table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[16][3];
|
||||
|
||||
#endif //DEF_H
|
||||
|
||||
@@ -31,9 +31,13 @@
|
||||
*/
|
||||
|
||||
//#include "mac_defs.h"
|
||||
#include <NR_MAC_gNB/mac_proto.h>
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "NR_MAC-CellGroupConfig.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
extern uint32_t N_RB_DL;
|
||||
|
||||
int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
|
||||
int mu,
|
||||
@@ -147,6 +151,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_ServingCellConfigCommonSIB_t *scc_SIB = mac->scc_SIB;
|
||||
int i;
|
||||
|
||||
mac->phy_config.Mod_id = module_id;
|
||||
@@ -155,78 +160,80 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
// carrier config
|
||||
LOG_D(MAC, "Entering 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]);
|
||||
AssertFatal(scc==NULL || scc_SIB==NULL,"Both scc and scc_SIB cannot be null\n");
|
||||
|
||||
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;
|
||||
if (scc) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
mac->frequency_range = band<100?FR1:FR2;
|
||||
|
||||
lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
|
||||
|
||||
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]);
|
||||
// cell config
|
||||
|
||||
cfg->cell_config.phy_cell_id = *scc->physCellId;
|
||||
cfg->cell_config.frame_duplex_type = frame_type;
|
||||
|
||||
// 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?
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
frequency_range_t frequency_range = band<100?FR1:FR2;
|
||||
|
||||
lte_frame_type_t frame_type;
|
||||
get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing, &frame_type);
|
||||
|
||||
// cell config
|
||||
|
||||
cfg->cell_config.phy_cell_id = *scc->physCellId;
|
||||
cfg->cell_config.frame_duplex_type = frame_type;
|
||||
|
||||
// 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) {
|
||||
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;
|
||||
@@ -245,48 +252,48 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
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;
|
||||
}
|
||||
if(cfg->cell_config.frame_duplex_type == TDD){
|
||||
LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period);
|
||||
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");
|
||||
}
|
||||
|
||||
// PRACH configuration
|
||||
|
||||
uint8_t nb_preambles = 64;
|
||||
if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL)
|
||||
nb_preambles = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles;
|
||||
|
||||
cfg->prach_config.prach_sequence_length = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present-1;
|
||||
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing)
|
||||
cfg->prach_config.prach_sub_c_spacing = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
cfg->prach_config.prach_sub_c_spacing = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
|
||||
cfg->prach_config.restricted_set_config = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig;
|
||||
|
||||
switch (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM) {
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
if(cfg->cell_config.frame_duplex_type == TDD){
|
||||
LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period);
|
||||
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");
|
||||
}
|
||||
|
||||
// PRACH configuration
|
||||
|
||||
uint8_t nb_preambles = 64;
|
||||
if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL)
|
||||
nb_preambles = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles;
|
||||
|
||||
cfg->prach_config.prach_sequence_length = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present-1;
|
||||
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing)
|
||||
cfg->prach_config.prach_sub_c_spacing = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
cfg->prach_config.prach_sub_c_spacing = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
|
||||
cfg->prach_config.restricted_set_config = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig;
|
||||
|
||||
switch (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM) {
|
||||
case 0 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 1;
|
||||
break;
|
||||
@@ -301,33 +308,187 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
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_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(cfg->prach_config.num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t));
|
||||
for (i=0; i<cfg->prach_config.num_prach_fd_occasions; i++) {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_prach_fd_occasions = i;
|
||||
if (cfg->prach_config.prach_sequence_length)
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = 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 = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1 = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_root_sequences = compute_nr_root_seq(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup,
|
||||
nb_preambles, frame_type,mac->frequency_range);
|
||||
//cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences = ???
|
||||
}
|
||||
|
||||
cfg->prach_config.ssb_per_rach = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present-1;
|
||||
|
||||
} // scc
|
||||
|
||||
else { // scc_SIB
|
||||
|
||||
cfg->carrier_config.dl_bandwidth = config_bandwidth(scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
|
||||
*scc_SIB->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR);
|
||||
|
||||
cfg->carrier_config.dl_frequency = downlink_frequency[0][0] - (10+scc_SIB->downlinkConfigCommon.frequencyInfoDL.offsetToPointA)*(15<<scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing);
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
if (i==scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.dl_grid_size[i] = scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.dl_k0[i] = scc_SIB->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_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
|
||||
scc_SIB->uplinkConfigCommon->frequencyInfoUL.frequencyBandList==NULL ? *scc_SIB->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR : *scc_SIB->uplinkConfigCommon->frequencyInfoUL.frequencyBandList->list.array[0]->freqBandIndicatorNR);
|
||||
|
||||
|
||||
if (scc_SIB->uplinkConfigCommon->frequencyInfoUL.absoluteFrequencyPointA == NULL)
|
||||
cfg->carrier_config.uplink_frequency = cfg->carrier_config.dl_frequency;
|
||||
else
|
||||
cfg->carrier_config.uplink_frequency = from_nrarfcn(*scc_SIB->uplinkConfigCommon->frequencyInfoUL.frequencyBandList->list.array[0]->freqBandIndicatorNR,
|
||||
scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
*scc_SIB->uplinkConfigCommon->frequencyInfoUL.absoluteFrequencyPointA)/1000; // freq in kHz
|
||||
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
if (i==scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.ul_grid_size[i] = scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.ul_k0[i] = scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
}
|
||||
else {
|
||||
cfg->carrier_config.ul_grid_size[i] = 0;
|
||||
cfg->carrier_config.ul_k0[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t band = *scc_SIB->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR;
|
||||
frequency_range_t frequency_range = band<100?FR1:FR2;
|
||||
|
||||
lte_frame_type_t frame_type = get_frame_type(band, get_softmodem_params()->numerology);
|
||||
|
||||
// cell config
|
||||
|
||||
cfg->cell_config.phy_cell_id = mac->physCellId;
|
||||
cfg->cell_config.frame_duplex_type = frame_type;
|
||||
|
||||
// SSB config
|
||||
cfg->ssb_config.ss_pbch_power = scc_SIB->ss_PBCH_BlockPower;
|
||||
cfg->ssb_config.scs_common = get_softmodem_params()->numerology;
|
||||
|
||||
// SSB Table config
|
||||
|
||||
cfg->ssb_table.ssb_offset_point_a = scc_SIB->downlinkConfigCommon.frequencyInfoDL.offsetToPointA;
|
||||
cfg->ssb_table.ssb_period = scc_SIB->ssb_PeriodicityServingCell;
|
||||
cfg->ssb_table.ssb_subcarrier_offset = 0; // TODO currently not in RRC?
|
||||
|
||||
AssertFatal(scc_SIB->ssb_PositionsInBurst.groupPresence==NULL, "Cannot handle more than 8 SSBs for now (%x.%x.%x.%x.%x.%x.%x.%x)\n",
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[0],
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[1],
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[2],
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[3],
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[4],
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[5],
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[6],
|
||||
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[7]);
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask = scc_SIB->ssb_PositionsInBurst.inOneGroup.buf[0]<<24;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask = 0;
|
||||
|
||||
|
||||
// TDD Table Configuration
|
||||
if (scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL)
|
||||
cfg->tdd_table.tdd_period = scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
|
||||
else {
|
||||
AssertFatal(scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL,
|
||||
"scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n");
|
||||
cfg->tdd_table.tdd_period = *scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
}
|
||||
if(cfg->cell_config.frame_duplex_type == TDD){
|
||||
LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period);
|
||||
int return_tdd = set_tdd_config_nr_ue(cfg,
|
||||
scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,
|
||||
scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols,
|
||||
scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots,
|
||||
scc_SIB->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");
|
||||
}
|
||||
|
||||
// PRACH configuration
|
||||
|
||||
uint8_t nb_preambles = 64;
|
||||
if(scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL)
|
||||
nb_preambles = *scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles;
|
||||
|
||||
cfg->prach_config.prach_sequence_length = scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present-1;
|
||||
|
||||
if (scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing)
|
||||
cfg->prach_config.prach_sub_c_spacing = *scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
cfg->prach_config.prach_sub_c_spacing = scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
|
||||
cfg->prach_config.restricted_set_config = scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->restrictedSetConfig;
|
||||
|
||||
switch (scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM) {
|
||||
case 0 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 1;
|
||||
break;
|
||||
case 1 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 2;
|
||||
break;
|
||||
case 2 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 4;
|
||||
break;
|
||||
case 3 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 8;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"msg1 FDM identifier %ld undefined (0,1,2,3) \n", scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM);
|
||||
}
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(cfg->prach_config.num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t));
|
||||
for (i=0; i<cfg->prach_config.num_prach_fd_occasions; i++) {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_prach_fd_occasions = i;
|
||||
if (cfg->prach_config.prach_sequence_length)
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
|
||||
else
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1 = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_root_sequences = compute_nr_root_seq(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup, nb_preambles, frame_type,frequency_range);
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1 = NRRIV2PRBOFFSET(scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing, scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf = scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_root_sequences = compute_nr_root_seq(scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup, nb_preambles, mac->frame_type, frequency_range);
|
||||
//cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences = ???
|
||||
}
|
||||
|
||||
cfg->prach_config.ssb_per_rach = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present-1;
|
||||
cfg->prach_config.ssb_per_rach = scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present-1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** \brief This function performs some configuration routines according to clause 12 "Bandwidth part operation" 3GPP TS 38.213 version 16.3.0 Release 16
|
||||
@param NR_UE_MAC_INST_t mac: pointer to local MAC instance
|
||||
@returns void
|
||||
*/
|
||||
|
||||
void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format){
|
||||
|
||||
NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated;
|
||||
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
|
||||
|
||||
if (bwp_ind && dci_format){
|
||||
|
||||
@@ -362,6 +523,70 @@ void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format
|
||||
|
||||
}
|
||||
|
||||
|
||||
void fill_default_coreset_zero(NR_UE_MAC_INST_t *mac) {
|
||||
|
||||
// Search space zero
|
||||
|
||||
if(mac->search_space_zero == NULL) mac->search_space_zero=calloc(1,sizeof(*mac->search_space_zero));
|
||||
if(mac->search_space_zero->controlResourceSetId == NULL) mac->search_space_zero->controlResourceSetId=calloc(1,sizeof(*mac->search_space_zero->controlResourceSetId));
|
||||
if(mac->search_space_zero->monitoringSymbolsWithinSlot == NULL) mac->search_space_zero->monitoringSymbolsWithinSlot = calloc(1,sizeof(*mac->search_space_zero->monitoringSymbolsWithinSlot));
|
||||
if(mac->search_space_zero->monitoringSymbolsWithinSlot->buf == NULL) mac->search_space_zero->monitoringSymbolsWithinSlot->buf = calloc(1,2);
|
||||
if(mac->search_space_zero->nrofCandidates == NULL) mac->search_space_zero->nrofCandidates = calloc(1,sizeof(*mac->search_space_zero->nrofCandidates));
|
||||
if(mac->search_space_zero->searchSpaceType == NULL) mac->search_space_zero->searchSpaceType = calloc(1,sizeof(*mac->search_space_zero->searchSpaceType));
|
||||
if(mac->search_space_zero->searchSpaceType->choice.common == NULL) mac->search_space_zero->searchSpaceType->choice.common=calloc(1,sizeof(*mac->search_space_zero->searchSpaceType->choice.common));
|
||||
if(mac->search_space_zero->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0 == NULL) mac->search_space_zero->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0 = calloc(1,sizeof(*mac->search_space_zero->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0));
|
||||
mac->search_space_zero->searchSpaceId = 0;
|
||||
*mac->search_space_zero->controlResourceSetId = 0;
|
||||
mac->search_space_zero->monitoringSlotPeriodicityAndOffset = calloc(1,sizeof(*mac->search_space_zero->monitoringSlotPeriodicityAndOffset));
|
||||
mac->search_space_zero->monitoringSlotPeriodicityAndOffset->present = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
|
||||
mac->search_space_zero->duration=NULL;
|
||||
// should be '1100 0000 0000 00'B (LSB first!), first two symbols in slot, adjust if needed
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->buf[1] = 0;
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->buf[0] = (1<<7);
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->size = 2;
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->bits_unused = 2;
|
||||
|
||||
// FIXME: update values from TS38.213 Section 10.1 Table 10.1-1: CCE aggregation levels and maximum number of PDCCH candidates per CCE aggregation level for CSS sets configured by searchSpaceSIB1
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n2;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
mac->search_space_zero->searchSpaceType->present = NR_SearchSpace__searchSpaceType_PR_common;
|
||||
|
||||
// Coreset0
|
||||
if(mac->coreset0 == NULL) mac->coreset0 = calloc(1,sizeof(*mac->coreset0));
|
||||
mac->coreset0->controlResourceSetId = 0;
|
||||
// frequencyDomainResources '11111111 00000000 00000000 00000000 00000000 00000'B,
|
||||
if(mac->coreset0->frequencyDomainResources.buf == NULL) mac->coreset0->frequencyDomainResources.buf = calloc(1,6);
|
||||
mac->coreset0->frequencyDomainResources.buf[0] = 0xff;
|
||||
mac->coreset0->frequencyDomainResources.buf[1] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[2] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[3] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[4] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[5] = 0;
|
||||
mac->coreset0->frequencyDomainResources.size = 6;
|
||||
mac->coreset0->frequencyDomainResources.bits_unused = 3;
|
||||
mac->coreset0->duration = 1;
|
||||
mac->coreset0->cce_REG_MappingType.present=NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved;
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved=calloc(1,sizeof(*mac->coreset0->cce_REG_MappingType.choice.interleaved));
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved->reg_BundleSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6;
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved->interleaverSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n2;
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved->shiftIndex = NULL;
|
||||
mac->coreset0->precoderGranularity = NR_ControlResourceSet__precoderGranularity_sameAsREG_bundle;
|
||||
if(mac->coreset0->tci_StatesPDCCH_ToAddList == NULL) mac->coreset0->tci_StatesPDCCH_ToAddList = calloc(1,sizeof(*mac->coreset0->tci_StatesPDCCH_ToAddList));
|
||||
NR_TCI_StateId_t *tci[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
tci[i]=calloc(1,sizeof(*tci[i]));
|
||||
*tci[i] = i;
|
||||
ASN_SEQUENCE_ADD(&mac->coreset0->tci_StatesPDCCH_ToAddList->list,tci[i]);
|
||||
}
|
||||
mac->coreset0->tci_StatesPDCCH_ToReleaseList = NULL;
|
||||
mac->coreset0->tci_PresentInDCI = NULL;
|
||||
mac->coreset0->pdcch_DMRS_ScramblingID = NULL;
|
||||
}
|
||||
|
||||
/** \brief This function is relavant for the UE procedures for control. It loads the search spaces, the BWPs and the CORESETs into the MAC instance and
|
||||
\brief performs assert checks on the relevant RRC configuration.
|
||||
@param NR_UE_MAC_INST_t mac: pointer to local MAC instance
|
||||
@@ -371,7 +596,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
|
||||
uint8_t coreset_id = 1, ss_id;
|
||||
|
||||
NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated;
|
||||
NR_ServingCellConfig_t *scd = mac->cg->spCellConfig->spCellConfigDedicated;
|
||||
AssertFatal(scd->downlinkBWP_ToAddModList != NULL, "downlinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(scd->downlinkBWP_ToAddModList->list.count == 1, "downlinkBWP_ToAddModList->list->count is %d\n", scd->downlinkBWP_ToAddModList->list.count);
|
||||
|
||||
@@ -443,65 +668,7 @@ void config_control_ue(NR_UE_MAC_INST_t *mac){
|
||||
ss_id++;
|
||||
}
|
||||
|
||||
// TODO: Merge this code in a single function as fill_default_searchSpaceZero() in rrc_gNB_reconfig.c
|
||||
// Search space zero
|
||||
if(mac->search_space_zero == NULL) mac->search_space_zero=calloc(1,sizeof(*mac->search_space_zero));
|
||||
if(mac->search_space_zero->controlResourceSetId == NULL) mac->search_space_zero->controlResourceSetId=calloc(1,sizeof(*mac->search_space_zero->controlResourceSetId));
|
||||
if(mac->search_space_zero->monitoringSymbolsWithinSlot == NULL) mac->search_space_zero->monitoringSymbolsWithinSlot = calloc(1,sizeof(*mac->search_space_zero->monitoringSymbolsWithinSlot));
|
||||
if(mac->search_space_zero->monitoringSymbolsWithinSlot->buf == NULL) mac->search_space_zero->monitoringSymbolsWithinSlot->buf = calloc(1,2);
|
||||
if(mac->search_space_zero->nrofCandidates == NULL) mac->search_space_zero->nrofCandidates = calloc(1,sizeof(*mac->search_space_zero->nrofCandidates));
|
||||
if(mac->search_space_zero->searchSpaceType == NULL) mac->search_space_zero->searchSpaceType = calloc(1,sizeof(*mac->search_space_zero->searchSpaceType));
|
||||
if(mac->search_space_zero->searchSpaceType->choice.common == NULL) mac->search_space_zero->searchSpaceType->choice.common=calloc(1,sizeof(*mac->search_space_zero->searchSpaceType->choice.common));
|
||||
if(mac->search_space_zero->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0 == NULL) mac->search_space_zero->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0 = calloc(1,sizeof(*mac->search_space_zero->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0));
|
||||
mac->search_space_zero->searchSpaceId = 0;
|
||||
*mac->search_space_zero->controlResourceSetId = 0;
|
||||
mac->search_space_zero->monitoringSlotPeriodicityAndOffset = calloc(1,sizeof(*mac->search_space_zero->monitoringSlotPeriodicityAndOffset));
|
||||
mac->search_space_zero->monitoringSlotPeriodicityAndOffset->present = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
|
||||
mac->search_space_zero->duration=NULL;
|
||||
// should be '1100 0000 0000 00'B (LSB first!), first two symbols in slot, adjust if needed
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->buf[1] = 0;
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->buf[0] = (1<<7);
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->size = 2;
|
||||
mac->search_space_zero->monitoringSymbolsWithinSlot->bits_unused = 2;
|
||||
|
||||
// FIXME: update values from TS38.213 Section 10.1 Table 10.1-1: CCE aggregation levels and maximum number of PDCCH candidates per CCE aggregation level for CSS sets configured by searchSpaceSIB1
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n2;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
|
||||
mac->search_space_zero->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
|
||||
mac->search_space_zero->searchSpaceType->present = NR_SearchSpace__searchSpaceType_PR_common;
|
||||
|
||||
// Coreset0
|
||||
if(mac->coreset0 == NULL) mac->coreset0 = calloc(1,sizeof(*mac->coreset0));
|
||||
mac->coreset0->controlResourceSetId = 0;
|
||||
// frequencyDomainResources '11111111 00000000 00000000 00000000 00000000 00000'B,
|
||||
if(mac->coreset0->frequencyDomainResources.buf == NULL) mac->coreset0->frequencyDomainResources.buf = calloc(1,6);
|
||||
mac->coreset0->frequencyDomainResources.buf[0] = 0xff;
|
||||
mac->coreset0->frequencyDomainResources.buf[1] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[2] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[3] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[4] = 0;
|
||||
mac->coreset0->frequencyDomainResources.buf[5] = 0;
|
||||
mac->coreset0->frequencyDomainResources.size = 6;
|
||||
mac->coreset0->frequencyDomainResources.bits_unused = 3;
|
||||
mac->coreset0->duration = 1;
|
||||
mac->coreset0->cce_REG_MappingType.present=NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved;
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved=calloc(1,sizeof(*mac->coreset0->cce_REG_MappingType.choice.interleaved));
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved->reg_BundleSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6;
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved->interleaverSize = NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n2;
|
||||
mac->coreset0->cce_REG_MappingType.choice.interleaved->shiftIndex = NULL;
|
||||
mac->coreset0->precoderGranularity = NR_ControlResourceSet__precoderGranularity_sameAsREG_bundle;
|
||||
if(mac->coreset0->tci_StatesPDCCH_ToAddList == NULL) mac->coreset0->tci_StatesPDCCH_ToAddList = calloc(1,sizeof(*mac->coreset0->tci_StatesPDCCH_ToAddList));
|
||||
NR_TCI_StateId_t *tci[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
tci[i]=calloc(1,sizeof(*tci[i]));
|
||||
*tci[i] = i;
|
||||
ASN_SEQUENCE_ADD(&mac->coreset0->tci_StatesPDCCH_ToAddList->list,tci[i]);
|
||||
}
|
||||
mac->coreset0->tci_StatesPDCCH_ToReleaseList = NULL;
|
||||
mac->coreset0->tci_PresentInDCI = NULL;
|
||||
mac->coreset0->pdcch_DMRS_ScramblingID = NULL;
|
||||
fill_default_coreset_zero(mac);
|
||||
|
||||
}
|
||||
|
||||
@@ -510,10 +677,11 @@ int nr_rrc_mac_config_req_ue(
|
||||
int cc_idP,
|
||||
uint8_t gNB_index,
|
||||
NR_MIB_t *mibP,
|
||||
// NR_ServingCellConfigCommon_t *sccP,
|
||||
NR_ServingCellConfigCommonSIB_t *sccP,
|
||||
// NR_MAC_CellGroupConfig_t *mac_cell_group_configP,
|
||||
// NR_PhysicalCellGroupConfig_t *phy_cell_group_configP,
|
||||
NR_CellGroupConfig_t *cell_group_config ){
|
||||
NR_CellGroupConfig_t *cell_group_config,
|
||||
NR_CellGroupConfig_t *scell_group_config){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
@@ -521,28 +689,71 @@ int nr_rrc_mac_config_req_ue(
|
||||
// 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(cell_group_config != NULL ){
|
||||
mac->scg = cell_group_config;
|
||||
mac->servCellIndex = *cell_group_config->spCellConfig->servCellIndex;
|
||||
// if this is the first MIB intialize coreset0 for SA
|
||||
if (mac->mib == NULL) fill_default_coreset_zero(mac);
|
||||
|
||||
mac->mib = mibP; // update by every reception
|
||||
mac->phy_config.Mod_id = module_id;
|
||||
mac->phy_config.CC_id = cc_idP;
|
||||
mac->phy_config.config_req.ssb_table.ssb_subcarrier_offset = 0; // TODO currently not in RRC?
|
||||
mac->phy_config.config_req.tdd_table.tdd_period_in_slots=5<<get_softmodem_params()->numerology;
|
||||
mac->phy_config.config_req.ssb_table.ssb_offset_point_a = (N_RB_DL-20)>>1;
|
||||
}
|
||||
AssertFatal(scell_group_config == NULL || cell_group_config == NULL,
|
||||
"both scell_group_config and cell_group_config cannot be non-NULL\n");
|
||||
|
||||
if (sccP != NULL) {
|
||||
|
||||
mac->scc_SIB=sccP;
|
||||
LOG_I(MAC,"Keeping ServingCellConfigCommonSIB\n");
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
int num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
|
||||
if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) num_slots_ul++;
|
||||
LOG_I(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
|
||||
mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t));
|
||||
// Setup the SSB to Rach Occasions mapping according to the config
|
||||
build_ssb_to_ro_map(mac);//->scc, mac->phy_config.config_req.cell_config.frame_duplex_type);
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
mac->common_configuration_complete = 1;
|
||||
}
|
||||
if(scell_group_config != NULL ){
|
||||
mac->cg = scell_group_config;
|
||||
mac->servCellIndex = *scell_group_config->spCellConfig->servCellIndex;
|
||||
config_control_ue(mac);
|
||||
if (cell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||
ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
|
||||
mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
int num_slots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
|
||||
if (mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) {
|
||||
num_slots++;
|
||||
if (scell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||
if (scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) {
|
||||
ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
|
||||
}
|
||||
mac->ul_config_request = calloc(num_slots, sizeof(*mac->ul_config_request));
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
mac->physCellId = *mac->scc->physCellId;
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
}
|
||||
|
||||
// Setup the SSB to Rach Occasions mapping according to the config
|
||||
build_ssb_to_ro_map(mac->scc, mac->phy_config.config_req.cell_config.frame_duplex_type);
|
||||
build_ssb_to_ro_map(mac);
|
||||
}
|
||||
else if (cell_group_config != NULL){
|
||||
LOG_I(MAC,"Applying CellGroupConfig from gNodeB\n");
|
||||
mac->cg = cell_group_config;
|
||||
mac->servCellIndex = cell_group_config->spCellConfig->servCellIndex ? *cell_group_config->spCellConfig->servCellIndex : 0;
|
||||
if(get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) {
|
||||
config_control_ue(mac);
|
||||
if (cell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||
if (cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) {
|
||||
ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
|
||||
}
|
||||
mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
}
|
||||
|
||||
// Setup the SSB to Rach Occasions mapping according to the config
|
||||
build_ssb_to_ro_map(mac);
|
||||
}
|
||||
|
||||
/*
|
||||
if(mac_cell_group_configP != NULL){
|
||||
|
||||
@@ -234,9 +234,12 @@ typedef struct {
|
||||
|
||||
typedef enum {
|
||||
RA_UE_IDLE = 0,
|
||||
WAIT_RAR = 1,
|
||||
WAIT_CONTENTION_RESOLUTION = 2,
|
||||
RA_SUCCEEDED = 3
|
||||
GENERATE_IDLE = 0,
|
||||
GENERATE_PREAMBLE = 1,
|
||||
WAIT_RAR = 2,
|
||||
WAIT_CONTENTION_RESOLUTION = 3,
|
||||
RA_SUCCEEDED = 4,
|
||||
RA_FAILED = 5
|
||||
} RA_state_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -257,8 +260,10 @@ typedef struct {
|
||||
uint8_t RA_attempt_number;
|
||||
/// Random-access procedure flag
|
||||
uint8_t RA_active;
|
||||
/// Random-access preamble index
|
||||
int ra_PreambleIndex;
|
||||
/// Flag for the Msg1 generation: enabled at every occurrence of nr prach slot
|
||||
uint8_t generate_nr_prach;
|
||||
RA_state_t generate_nr_prach;
|
||||
|
||||
/// Random-access window counter
|
||||
int16_t RA_window_cnt;
|
||||
@@ -289,6 +294,8 @@ typedef struct {
|
||||
uint8_t RA_contention_resolution_timer_active;
|
||||
/// Random-access Contention Resolution Timer count value
|
||||
uint8_t RA_contention_resolution_cnt;
|
||||
/// Transmitted UE Contention Resolution Identifier
|
||||
uint8_t cont_res_id[6];
|
||||
|
||||
/// BeamfailurerecoveryConfig
|
||||
NR_BeamFailureRecoveryConfig_t RA_BeamFailureRecoveryConfig;
|
||||
@@ -308,23 +315,28 @@ typedef struct {
|
||||
typedef struct {
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc;
|
||||
NR_CellGroupConfig_t *scg;
|
||||
NR_ServingCellConfigCommonSIB_t *scc_SIB;
|
||||
NR_CellGroupConfig_t *cg;
|
||||
int servCellIndex;
|
||||
NR_CSI_ReportConfig_t *csirc;
|
||||
long physCellId;
|
||||
//// MAC config
|
||||
int common_configuration_complete;
|
||||
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_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];
|
||||
|
||||
lte_frame_type_t frame_type;
|
||||
|
||||
/*BWP*/
|
||||
// dedicated active DL BWP
|
||||
NR_BWP_Id_t DL_BWP_Id;
|
||||
@@ -352,7 +364,8 @@ typedef struct {
|
||||
uint8_t mib_ssb;
|
||||
/// Last NDI of UL HARQ processes
|
||||
uint8_t UL_ndi[NR_MAX_HARQ_PROCESSES];
|
||||
|
||||
/// first ULTX of UL HARQ processes
|
||||
int first_ul_tx[NR_MAX_HARQ_PROCESSES];
|
||||
//// FAPI-like interface message
|
||||
fapi_nr_ul_config_request_t *ul_config_request;
|
||||
fapi_nr_dl_config_request_t dl_config_request;
|
||||
@@ -371,6 +384,9 @@ typedef struct {
|
||||
NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config;
|
||||
NR_SearchSpace_t *search_space_zero;
|
||||
NR_ControlResourceSet_t *coreset0;
|
||||
frequency_range_t frequency_range;
|
||||
|
||||
dci_pdu_rel15_t def_dci_pdu_rel15[8];
|
||||
|
||||
// Defined for abstracted mode
|
||||
nr_downlink_indication_t dl_info;
|
||||
@@ -494,5 +510,8 @@ typedef struct ssb_list_info {
|
||||
uint8_t nb_tx_ssb;
|
||||
} ssb_list_info_t;
|
||||
|
||||
void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id);
|
||||
void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15);
|
||||
|
||||
/*@}*/
|
||||
#endif /*__LAYER2_MAC_DEFS_H__ */
|
||||
|
||||
@@ -68,8 +68,6 @@ extern const uint16_t table_7_2_1[16];
|
||||
|
||||
extern dci_pdu_rel15_t *def_dci_pdu_rel15;
|
||||
|
||||
extern dci_pdu_rel15_t *def_dci_pdu_rel15;
|
||||
|
||||
extern void mac_rlc_data_ind(const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
|
||||
@@ -53,17 +53,18 @@ int8_t nr_ue_decode_mib(
|
||||
uint8_t extra_bits,
|
||||
uint32_t ssb_length,
|
||||
uint32_t ssb_index,
|
||||
void *pduP,
|
||||
void *pduP,
|
||||
uint16_t ssb_start_subcarrier,
|
||||
uint16_t cell_id );
|
||||
|
||||
/**\brief decode sib1 pdu in NR_UE, from if_module dl_ind
|
||||
/**\brief decode SIB1 and other SIs pdus in NR_UE, from if_module dl_ind
|
||||
\param module_id module id
|
||||
\param cc_id component carrier id
|
||||
\param gNB_index gNB index
|
||||
\param sibs_mask sibs mask
|
||||
\param pduP pointer to pdu
|
||||
\param pdu_length length of pdu */
|
||||
int8_t nr_ue_decode_sib1(module_id_t module_id,
|
||||
int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
|
||||
int cc_id,
|
||||
unsigned int gNB_index,
|
||||
uint32_t sibs_mask,
|
||||
@@ -82,8 +83,10 @@ int nr_rrc_mac_config_req_ue(
|
||||
int cc_idP,
|
||||
uint8_t gNB_index,
|
||||
NR_MIB_t *mibP,
|
||||
//NR_ServingCellConfigCommon_t *sccP,
|
||||
NR_CellGroupConfig_t *cell_group_config);
|
||||
NR_ServingCellConfigCommonSIB_t *sccP,
|
||||
NR_CellGroupConfig_t *cell_group_config,
|
||||
NR_CellGroupConfig_t *scell_group_config
|
||||
);
|
||||
|
||||
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
|
||||
NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst);
|
||||
@@ -166,6 +169,10 @@ uint16_t nr_generate_ulsch_pdu(uint8_t *sdus_payload,
|
||||
unsigned short post_padding,
|
||||
uint16_t buflen);
|
||||
|
||||
void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15);
|
||||
|
||||
void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id);
|
||||
|
||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, frame_t frame, int slot);
|
||||
|
||||
uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
@@ -178,7 +185,8 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
uint8_t time_domain_ind);
|
||||
uint8_t time_domain_ind,
|
||||
bool use_default);
|
||||
|
||||
uint8_t
|
||||
nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
@@ -300,7 +308,7 @@ void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
|
||||
uint8_t *nb_dmrs_re_per_rb,
|
||||
uint16_t *number_dmrs_symbols);
|
||||
|
||||
void build_ssb_to_ro_map(NR_ServingCellConfigCommon_t *scc, uint8_t unpaired);
|
||||
void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac);
|
||||
|
||||
void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
const char *rnti_types[]={"RNTI_new", "RNTI_C", "RNTI_RA", "NR_RNTI_P", "NR_RNTI_CS", "NR_RNTI_TC"};
|
||||
const char *rnti_types[]={"RNTI_new", "RNTI_C", "RNTI_RA", "NR_RNTI_P", "NR_RNTI_CS", "NR_RNTI_TC", "NR_RNTI_SP_CSI", "NR_RNTI_SI"};
|
||||
const char *dci_formats[]={"1_0", "1_1", "2_0", "2_1", "2_2", "2_3", "0_0", "0_1"};
|
||||
|
||||
// table_7_3_1_1_2_2_3_4_5 contains values for number of layers and precoding information for tables 7.3.1.1.2-2/3/4/5 from TS 38.212 subclause 7.3.1.1.2
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp.h"
|
||||
|
||||
static NR_UE_MAC_INST_t *nr_ue_mac_inst;
|
||||
|
||||
@@ -50,12 +51,26 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst)
|
||||
|
||||
//init mac here
|
||||
nr_ue_mac_inst = (NR_UE_MAC_INST_t *)calloc(sizeof(NR_UE_MAC_INST_t),NB_NR_UE_MAC_INST);
|
||||
if (rrc_inst) {
|
||||
nr_rrc_mac_config_req_ue(0,0,0,NULL,rrc_inst->cell_group_config);
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
for (int j=0;j<NB_NR_UE_MAC_INST;j++)
|
||||
for (int i=0;i<NR_MAX_HARQ_PROCESSES;i++)
|
||||
nr_ue_mac_inst[j].first_ul_tx[i]=1;
|
||||
|
||||
if (rrc_inst && (rrc_inst->scell_group_config || rrc_inst->cell_group_config)) {
|
||||
|
||||
if(rrc_inst->scell_group_config) {
|
||||
nr_rrc_mac_config_req_ue(0,0,0,NULL,NULL,NULL,rrc_inst->scell_group_config);
|
||||
//if (IS_SOFTMODEM_NOS1){
|
||||
// AssertFatal(rlc_module_init(0) == 0, "%s: Could not initialize RLC layer\n", __FUNCTION__);
|
||||
// nr_pdcp_layer_init();
|
||||
// nr_DRB_preconfiguration(nr_ue_mac_inst->crnti);
|
||||
//}
|
||||
} else if (rrc_inst->cell_group_config) {
|
||||
nr_rrc_mac_config_req_ue(0,0,0,NULL,NULL,rrc_inst->cell_group_config,NULL);
|
||||
AssertFatal(rlc_module_init(0) == 0, "%s: Could not initialize RLC layer\n", __FUNCTION__);
|
||||
pdcp_layer_init();
|
||||
nr_DRB_preconfiguration(nr_ue_mac_inst->crnti);
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
pdcp_layer_init();
|
||||
nr_DRB_preconfiguration(nr_ue_mac_inst->crnti);
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate memory for ul_config_request in the mac instance. This is now a pointer and will
|
||||
@@ -68,8 +83,14 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst)
|
||||
LOG_D(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
|
||||
nr_ue_mac_inst->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t));
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG_I(MAC,"Running without CellGroupConfig\n");
|
||||
nr_rrc_mac_config_req_ue(0,0,0,NULL,NULL,NULL,NULL);
|
||||
if(get_softmodem_params()->sa == 1) {
|
||||
AssertFatal(rlc_module_init(0) == 0, "%s: Could not initialize RLC layer\n", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
else LOG_I(MAC,"Running without RRC instance\n");
|
||||
|
||||
return (nr_ue_mac_inst);
|
||||
}
|
||||
|
||||
@@ -41,10 +41,11 @@
|
||||
int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_format){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = (mac->scc!=NULL) ?
|
||||
mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup:
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
|
||||
NR_SubcarrierSpacing_t scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing;
|
||||
int prach_sequence_length = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present - 1;
|
||||
int prach_sequence_length = (mac->scc!=NULL)?(mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present - 1) : (mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present-1);
|
||||
uint8_t prachConfigIndex, mu;
|
||||
|
||||
AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
|
||||
@@ -145,18 +146,11 @@ int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_forma
|
||||
int nr_get_Po_NOMINAL_PUSCH(NR_PRACH_RESOURCES_t *prach_resources, module_id_t mod_id, uint8_t CC_id){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
int8_t receivedTargerPower, delta_preamble;
|
||||
long preambleReceivedTargetPower = 0;
|
||||
|
||||
if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
preambleReceivedTargetPower = nr_rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower;
|
||||
} else if (prach_resources->RA_TYPE == RA_2STEP){
|
||||
// msgA-PreambleReceivedTargetPower
|
||||
LOG_E(MAC, "In %s:%d: missing implementation for 2-step RA...\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
int8_t receivedTargerPower;
|
||||
int8_t delta_preamble;
|
||||
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = (mac->scc != NULL) ? mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup: mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
|
||||
long preambleReceivedTargetPower = nr_rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower;
|
||||
delta_preamble = nr_get_DELTA_PREAMBLE(mod_id, CC_id, prach_resources->prach_format);
|
||||
|
||||
receivedTargerPower = preambleReceivedTargetPower + delta_preamble + (prach_resources->RA_PREAMBLE_POWER_RAMPING_COUNTER - 1) * prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP + prach_resources->POWER_OFFSET_2STEP_RA;
|
||||
@@ -211,7 +205,8 @@ void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
|
||||
long nr_get_Pcmax(module_id_t mod_id){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
uint32_t band = *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
uint32_t band = (mac->scc!=NULL) ? *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] :
|
||||
*mac->scc_SIB->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR;
|
||||
NR_P_Max_t p_max = 0;
|
||||
uint8_t P_powerclass = 23;
|
||||
uint8_t delta_P_powerclass = 0;
|
||||
@@ -230,17 +225,18 @@ long nr_get_Pcmax(module_id_t mod_id){
|
||||
delta_MPR_c = 0.5;
|
||||
}
|
||||
|
||||
if (mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1){
|
||||
if (*mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1->powerBoostPi2BPSK == 1){
|
||||
if (mac->cg && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1){
|
||||
if (*mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1->powerBoostPi2BPSK == 1){
|
||||
// TbD: assuming power class 3 capable UE operating in TDD bands n40, n41, n77, n78, and n79 with Pi/2 BPSK modulation
|
||||
delta_P_powerclass = -3;
|
||||
p_max += 3;
|
||||
}
|
||||
}
|
||||
|
||||
if (mac->scc->uplinkConfigCommon->frequencyInfoUL->p_Max){
|
||||
NR_P_Max_t *p_Max = (mac->scc!=NULL) ? mac->scc->uplinkConfigCommon->frequencyInfoUL->p_Max : mac->scc_SIB->uplinkConfigCommon->frequencyInfoUL.p_Max;
|
||||
if (p_Max){
|
||||
|
||||
p_max += *mac->scc->uplinkConfigCommon->frequencyInfoUL->p_Max;
|
||||
p_max += *p_Max;
|
||||
|
||||
LOG_D(MAC, "In %s maximum UL transmission power p_max is %ld dBm \n", __FUNCTION__, p_max);
|
||||
|
||||
@@ -262,4 +258,4 @@ long nr_get_Pcmax(module_id_t mod_id){
|
||||
|
||||
return P_cmax;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
/* RRC */
|
||||
#include "NR_RACH-ConfigCommon.h"
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
|
||||
/* PHY */
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
|
||||
@@ -47,6 +48,8 @@
|
||||
#include "NR_MAC_COMMON/nr_mac.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
void nr_get_RA_window(NR_UE_MAC_INST_t *mac);
|
||||
|
||||
// Random Access procedure initialization as per 5.1.1 and initialization of variables specific
|
||||
@@ -63,6 +66,8 @@ void init_RA(module_id_t mod_id,
|
||||
|
||||
RA_config_t *ra = &mac->ra;
|
||||
ra->RA_active = 1;
|
||||
ra->ra_PreambleIndex = -1;
|
||||
ra->RA_usedGroupA = 1;
|
||||
ra->RA_RAPID_found = 0;
|
||||
ra->preambleTransMax = 0;
|
||||
ra->first_Msg3 = 1;
|
||||
@@ -78,8 +83,8 @@ void init_RA(module_id_t mod_id,
|
||||
|
||||
if (rach_ConfigDedicated) {
|
||||
if (rach_ConfigDedicated->cfra){
|
||||
LOG_I(MAC, "Initialization of 4-step contention-free random access procedure\n");
|
||||
prach_resources->RA_TYPE = RA_4STEP;
|
||||
LOG_I(MAC, "Initialization of 2-step contention-free random access procedure\n");
|
||||
prach_resources->RA_TYPE = RA_2STEP;
|
||||
ra->cfra = 1;
|
||||
} else if (rach_ConfigDedicated->ext1){
|
||||
if (rach_ConfigDedicated->ext1->cfra_TwoStep_r16){
|
||||
@@ -92,185 +97,176 @@ void init_RA(module_id_t mod_id,
|
||||
} else {
|
||||
LOG_E(MAC, "In %s: config not handled\n", __FUNCTION__);
|
||||
}
|
||||
} else if (nr_rach_ConfigCommon){
|
||||
LOG_I(MAC, "Initialization of 4-step contention-based random access procedure\n");
|
||||
prach_resources->RA_TYPE = RA_4STEP;
|
||||
ra->cfra = 0;
|
||||
} else {
|
||||
LOG_E(MAC, "In %s: config not handled\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
if (prach_resources->RA_TYPE == RA_2STEP){
|
||||
LOG_E(MAC, "Missing implementation of initialization of 2-step RA specific variables...\n");
|
||||
} else if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
LOG_D(MAC, "Initialization of 4-step RA specific variables...\n");
|
||||
switch (rach_ConfigGeneric->powerRampingStep){ // in dB
|
||||
case 0:
|
||||
switch (rach_ConfigGeneric->powerRampingStep){ // in dB
|
||||
case 0:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 1:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 2;
|
||||
break;
|
||||
case 2:
|
||||
case 2:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 4;
|
||||
break;
|
||||
case 3:
|
||||
case 3:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (rach_ConfigGeneric->preambleTransMax) {
|
||||
case 0:
|
||||
ra->preambleTransMax = 3;
|
||||
break;
|
||||
case 1:
|
||||
ra->preambleTransMax = 4;
|
||||
break;
|
||||
case 2:
|
||||
ra->preambleTransMax = 5;
|
||||
break;
|
||||
case 3:
|
||||
ra->preambleTransMax = 6;
|
||||
break;
|
||||
case 4:
|
||||
ra->preambleTransMax = 7;
|
||||
break;
|
||||
case 5:
|
||||
ra->preambleTransMax = 8;
|
||||
break;
|
||||
case 6:
|
||||
ra->preambleTransMax = 10;
|
||||
break;
|
||||
case 7:
|
||||
ra->preambleTransMax = 20;
|
||||
break;
|
||||
case 8:
|
||||
ra->preambleTransMax = 50;
|
||||
break;
|
||||
case 9:
|
||||
ra->preambleTransMax = 100;
|
||||
break;
|
||||
case 10:
|
||||
ra->preambleTransMax = 200;
|
||||
break;
|
||||
}
|
||||
if (nr_rach_ConfigCommon->ext1) {
|
||||
if (nr_rach_ConfigCommon->ext1->ra_PrioritizationForAccessIdentity){
|
||||
LOG_D(MAC, "In %s:%d: Missing implementation for Access Identity initialization procedures\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
switch (rach_ConfigGeneric->preambleTransMax) {
|
||||
case 0:
|
||||
ra->preambleTransMax = 3;
|
||||
break;
|
||||
case 1:
|
||||
ra->preambleTransMax = 4;
|
||||
break;
|
||||
case 2:
|
||||
ra->preambleTransMax = 5;
|
||||
break;
|
||||
case 3:
|
||||
ra->preambleTransMax = 6;
|
||||
break;
|
||||
case 4:
|
||||
ra->preambleTransMax = 7;
|
||||
break;
|
||||
case 5:
|
||||
ra->preambleTransMax = 8;
|
||||
break;
|
||||
case 6:
|
||||
ra->preambleTransMax = 10;
|
||||
break;
|
||||
case 7:
|
||||
ra->preambleTransMax = 20;
|
||||
break;
|
||||
case 8:
|
||||
ra->preambleTransMax = 50;
|
||||
break;
|
||||
case 9:
|
||||
ra->preambleTransMax = 100;
|
||||
break;
|
||||
case 10:
|
||||
ra->preambleTransMax = 200;
|
||||
break;
|
||||
}
|
||||
|
||||
if (nr_rach_ConfigCommon->ext1) {
|
||||
if (nr_rach_ConfigCommon->ext1->ra_PrioritizationForAccessIdentity){
|
||||
LOG_D(MAC, "In %s:%d: Missing implementation for Access Identity initialization procedures\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ssb_rach_config(RA_config_t *ra, NR_PRACH_RESOURCES_t *prach_resources, NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon, fapi_nr_ul_config_prach_pdu *prach_pdu){
|
||||
|
||||
// Determine the SSB to RACH mapping ratio
|
||||
// =======================================
|
||||
if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
|
||||
boolean_t multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB
|
||||
uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB
|
||||
int total_preambles_per_ssb;
|
||||
uint8_t ssb_nb_in_ro;
|
||||
int numberOfRA_Preambles = 64;
|
||||
|
||||
switch (ssb_perRACH_config){
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 1;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 16;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Unsupported ssb_perRACH_config %d\n", ssb_perRACH_config);
|
||||
break;
|
||||
}
|
||||
NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR ssb_perRACH_config = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
|
||||
boolean_t multiple_ssb_per_ro; // true if more than one or exactly one SSB per RACH occasion, false if more than one RO per SSB
|
||||
uint8_t ssb_rach_ratio; // Nb of SSBs per RACH or RACHs per SSB
|
||||
int total_preambles_per_ssb;
|
||||
uint8_t ssb_nb_in_ro;
|
||||
int numberOfRA_Preambles = 64;
|
||||
|
||||
if (nr_rach_ConfigCommon->totalNumberOfRA_Preambles)
|
||||
numberOfRA_Preambles = *(nr_rach_ConfigCommon->totalNumberOfRA_Preambles);
|
||||
switch (ssb_perRACH_config){
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf:
|
||||
multiple_ssb_per_ro = false;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 1;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 2;
|
||||
ra->cb_preambles_per_ssb = 4 * (nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two + 1);
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 4;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 8;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight;
|
||||
break;
|
||||
case NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen:
|
||||
multiple_ssb_per_ro = true;
|
||||
ssb_rach_ratio = 16;
|
||||
ra->cb_preambles_per_ssb = nr_rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Unsupported ssb_perRACH_config %d\n", ssb_perRACH_config);
|
||||
}
|
||||
|
||||
// Compute the proper Preamble selection params according to the selected SSB and the ssb_perRACH_OccasionAndCB_PreamblesPerSSB configuration
|
||||
if ((true == multiple_ssb_per_ro) &&
|
||||
(ssb_rach_ratio > 1)) {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles / ssb_rach_ratio;
|
||||
if (nr_rach_ConfigCommon->totalNumberOfRA_Preambles)
|
||||
numberOfRA_Preambles = *(nr_rach_ConfigCommon->totalNumberOfRA_Preambles);
|
||||
|
||||
ssb_nb_in_ro = prach_pdu->ssb_nb_in_ro;
|
||||
ra->starting_preamble_nb = total_preambles_per_ssb * ssb_nb_in_ro;
|
||||
}
|
||||
else {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles;
|
||||
ra->starting_preamble_nb = 0;
|
||||
}
|
||||
// Compute the proper Preamble selection params according to the selected SSB and the ssb_perRACH_OccasionAndCB_PreamblesPerSSB configuration
|
||||
if ((true == multiple_ssb_per_ro) && (ssb_rach_ratio > 1)) {
|
||||
total_preambles_per_ssb = numberOfRA_Preambles / ssb_rach_ratio;
|
||||
|
||||
ssb_nb_in_ro = prach_pdu->ssb_nb_in_ro;
|
||||
ra->starting_preamble_nb = total_preambles_per_ssb * ssb_nb_in_ro;
|
||||
} else {
|
||||
LOG_E(MAC, "In %s:%d: missing implementation for 2-step RA...\n", __FUNCTION__, __LINE__);
|
||||
total_preambles_per_ssb = numberOfRA_Preambles;
|
||||
ra->starting_preamble_nb = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// This routine implements RA premable configuration according to
|
||||
// This routine implements RA preamble configuration according to
|
||||
// section 5.1 (Random Access procedure) of 3GPP TS 38.321 version 16.2.1 Release 16
|
||||
void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t *mac, int16_t dl_pathloss){
|
||||
|
||||
int messageSizeGroupA = 0;
|
||||
int sizeOfRA_PreamblesGroupA = 0;
|
||||
int messagePowerOffsetGroupB = 0;
|
||||
int PLThreshold;
|
||||
int PLThreshold = 0;
|
||||
long deltaPreamble_Msg3 = 0;
|
||||
uint8_t noGroupB = 0;
|
||||
RA_config_t *ra = &mac->ra;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &nr_rach_ConfigCommon->rach_ConfigGeneric;
|
||||
NR_RACH_ConfigCommon_t *setup;
|
||||
if (mac->scc) setup = mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
else setup = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
|
||||
|
||||
if (prach_resources->RA_TYPE == RA_4STEP){
|
||||
NR_BWP_UplinkCommon_t *initialUplinkBWP = (mac->scc) ? mac->scc->uplinkConfigCommon->initialUplinkBWP : &mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP;
|
||||
if (initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble){
|
||||
deltaPreamble_Msg3 = (*initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) * 2; // dB
|
||||
LOG_D(MAC, "In %s: deltaPreamble_Msg3 set to %ld\n", __FUNCTION__, deltaPreamble_Msg3);
|
||||
}
|
||||
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble){
|
||||
deltaPreamble_Msg3 = (*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) * 2; // dB
|
||||
LOG_D(MAC, "In %s: deltaPreamble_Msg3 set to %ld\n", __FUNCTION__, deltaPreamble_Msg3);
|
||||
}
|
||||
|
||||
if (!nr_rach_ConfigCommon->groupBconfigured) {
|
||||
noGroupB = 1;
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is not configured...\n", __FUNCTION__, __LINE__);
|
||||
} else {
|
||||
// RA preambles group B is configured
|
||||
// - Random Access Preambles group B is configured for 4-step RA type
|
||||
// - Defining the number of RA preambles in RA Preamble Group A for each SSB
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is configured...\n", __FUNCTION__, __LINE__);
|
||||
sizeOfRA_PreamblesGroupA = nr_rach_ConfigCommon->groupBconfigured->numberOfRA_PreamblesGroupA;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA){
|
||||
if (!setup->groupBconfigured) {
|
||||
noGroupB = 1;
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is not configured...\n", __FUNCTION__, __LINE__);
|
||||
} else {
|
||||
// RA preambles group B is configured
|
||||
// - Random Access Preambles group B is configured for 4-step RA type
|
||||
// - Defining the number of RA preambles in RA Preamble Group A for each SSB
|
||||
LOG_D(MAC, "In %s:%d: preambles group B is configured...\n", __FUNCTION__, __LINE__);
|
||||
sizeOfRA_PreamblesGroupA = setup->groupBconfigured->numberOfRA_PreamblesGroupA;
|
||||
switch (setup->groupBconfigured->ra_Msg3SizeGroupA){
|
||||
/* - Threshold to determine the groups of RA preambles */
|
||||
case 0:
|
||||
messageSizeGroupA = 56;
|
||||
@@ -303,13 +299,13 @@ void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t
|
||||
messageSizeGroupA = 72;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Unknown ra_Msg3SizeGroupA %lu\n", nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA);
|
||||
AssertFatal(1 == 0, "Unknown ra_Msg3SizeGroupA %lu\n", setup->groupBconfigured->ra_Msg3SizeGroupA);
|
||||
/* todo cases 10 -15*/
|
||||
}
|
||||
|
||||
/* Power offset for preamble selection in dB */
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB){
|
||||
switch (setup->groupBconfigured->messagePowerOffsetGroupB){
|
||||
case 0:
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
break;
|
||||
@@ -335,45 +331,43 @@ void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t
|
||||
messagePowerOffsetGroupB = 18;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown messagePowerOffsetGroupB %lu\n", nr_rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB);
|
||||
}
|
||||
|
||||
PLThreshold = prach_resources->RA_PCMAX - rach_ConfigGeneric->preambleReceivedTargetPower - deltaPreamble_Msg3 - messagePowerOffsetGroupB;
|
||||
|
||||
AssertFatal(1 == 0,"Unknown messagePowerOffsetGroupB %lu\n", setup->groupBconfigured->messagePowerOffsetGroupB);
|
||||
}
|
||||
} else {
|
||||
// todo:
|
||||
// - groupB-ConfiguredTwoStepRA
|
||||
// - msgA-DeltaPreamble
|
||||
LOG_E(MAC, "In %s:%d: missing implementation for 2-step RA...\n", __FUNCTION__, __LINE__);
|
||||
|
||||
PLThreshold = prach_resources->RA_PCMAX - rach_ConfigGeneric->preambleReceivedTargetPower - deltaPreamble_Msg3 - messagePowerOffsetGroupB;
|
||||
|
||||
}
|
||||
|
||||
/* Msg3 has not been transmitted yet */
|
||||
if (ra->first_Msg3) {
|
||||
if (noGroupB) {
|
||||
// use Group A preamble
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else if ((ra->Msg3_size < messageSizeGroupA) && (dl_pathloss > PLThreshold)) {
|
||||
// Group B is configured and RA preamble Group A is used
|
||||
// - todo add condition on CCCH_sdu_size for initiation by CCCH
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else {
|
||||
// Group B preamble is configured and used
|
||||
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
|
||||
// the remaining belong to RA Preambles Group B
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
ra->RA_usedGroupA = 0;
|
||||
if(ra->ra_PreambleIndex < 0 || ra->ra_PreambleIndex > 63) {
|
||||
if (noGroupB) {
|
||||
// use Group A preamble
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else if ((ra->Msg3_size < messageSizeGroupA) && (dl_pathloss > PLThreshold)) {
|
||||
// Group B is configured and RA preamble Group A is used
|
||||
// - todo add condition on CCCH_sdu_size for initiation by CCCH
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
ra->RA_usedGroupA = 1;
|
||||
} else {
|
||||
// Group B preamble is configured and used
|
||||
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
|
||||
// the remaining belong to RA Preambles Group B
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
ra->RA_usedGroupA = 0;
|
||||
}
|
||||
}
|
||||
} else { // Msg3 is being retransmitted
|
||||
if (ra->RA_usedGroupA && noGroupB) {
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % ra->cb_preambles_per_ssb);
|
||||
} else if (ra->RA_usedGroupA && !noGroupB){
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + ((taus()) % sizeOfRA_PreamblesGroupA);
|
||||
} else {
|
||||
prach_resources->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
ra->ra_PreambleIndex = ra->starting_preamble_nb + sizeOfRA_PreamblesGroupA + ((taus()) % (ra->cb_preambles_per_ssb - sizeOfRA_PreamblesGroupA));
|
||||
}
|
||||
}
|
||||
prach_resources->ra_PreambleIndex = ra->ra_PreambleIndex;
|
||||
}
|
||||
|
||||
// RA-RNTI computation (associated to PRACH occasion in which the RA Preamble is transmitted)
|
||||
@@ -429,7 +423,10 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = (mac->scc)?
|
||||
mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup :
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
|
||||
|
||||
LOG_D(PHY, "In %s: getting PRACH resources frame (first_Msg3 %d)\n", __FUNCTION__, ra->first_Msg3);
|
||||
|
||||
@@ -464,7 +461,9 @@ void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
|
||||
void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = (mac->scc) ?
|
||||
mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup:
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
|
||||
RA_config_t *ra = &mac->ra;
|
||||
|
||||
LOG_I(MAC,"In %s: [UE %d] Frame %d, CB-RA: starting contention resolution timer\n", __FUNCTION__, mod_id, frameP);
|
||||
@@ -472,6 +471,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
|
||||
// start contention resolution timer
|
||||
ra->RA_contention_resolution_cnt = (nr_rach_ConfigCommon->ra_ContentionResolutionTimer + 1) * 8;
|
||||
ra->RA_contention_resolution_timer_active = 1;
|
||||
ra->ra_state = WAIT_CONTENTION_RESOLUTION;
|
||||
|
||||
}
|
||||
|
||||
@@ -503,72 +503,71 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES];
|
||||
uint8_t lcid = UL_SCH_LCID_CCCH_MSG3, *payload;
|
||||
uint8_t lcid = UL_SCH_LCID_CCCH;
|
||||
uint8_t *payload;
|
||||
uint16_t size_sdu = 0;
|
||||
unsigned short post_padding;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
if (scc == NULL) {
|
||||
return 0;
|
||||
}
|
||||
AssertFatal(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup != NULL, "In %s: FATAL! nr_rach_ConfigCommon is NULL...\n", __FUNCTION__);
|
||||
NR_RACH_ConfigCommon_t *setup = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigCommon_t *setup;
|
||||
if (mac->scc) setup = mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
else setup = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
|
||||
AssertFatal(&setup->rach_ConfigGeneric != NULL, "In %s: FATAL! rach_ConfigGeneric is NULL...\n", __FUNCTION__);
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
|
||||
NR_RACH_ConfigDedicated_t *rach_ConfigDedicated = ra->rach_ConfigDedicated;
|
||||
|
||||
uint8_t sdu_lcids[NB_RB_MAX] = {0};
|
||||
uint16_t sdu_lengths[NB_RB_MAX] = {0};
|
||||
int TBS_bytes = 848, header_length_total=0, num_sdus, offset, mac_ce_len;
|
||||
int num_sdus = 0;
|
||||
int offset = 0;
|
||||
|
||||
// Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side
|
||||
if (!prach_resources->init_msg1) {
|
||||
if (((MAX_FRAME_NUMBER + frame - prach_resources->sync_frame) % MAX_FRAME_NUMBER) > 150){
|
||||
if ( (mac->common_configuration_complete>0 || get_softmodem_params()->do_ra==1) && ((MAX_FRAME_NUMBER+frame-prach_resources->sync_frame)%MAX_FRAME_NUMBER)>150 ){
|
||||
prach_resources->init_msg1 = 1;
|
||||
} else {
|
||||
LOG_D(NR_MAC,"PRACH Condition not met: frame %d, prach_resources->sync_frame %d\n",frame,prach_resources->sync_frame);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (prach_resources->init_msg1) {
|
||||
LOG_D(NR_MAC,"frame %d prach_resources->init_msg1 %d, ra->ra_state %d, ra->RA_active %d\n",
|
||||
frame,prach_resources->init_msg1,ra->ra_state,ra->RA_active);
|
||||
|
||||
if (prach_resources->init_msg1 && ra->ra_state != RA_SUCCEEDED) {
|
||||
|
||||
if (ra->RA_active == 0) {
|
||||
/* RA not active - checking if RRC is ready to initiate the RA procedure */
|
||||
|
||||
LOG_D(MAC, "RA not active. Checking for data to transmit from upper layers...\n");
|
||||
LOG_D(NR_MAC, "RA not active. Checking for data to transmit from upper layers...\n");
|
||||
|
||||
uint8_t TBS_max = 8 + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
|
||||
payload = (uint8_t*) mac->CCCH_pdu.payload;
|
||||
|
||||
payload = (uint8_t*) &mac->CCCH_pdu.payload;
|
||||
mac_ce_len = 0;
|
||||
num_sdus = 1;
|
||||
post_padding = 1;
|
||||
sdu_lcids[0] = lcid;
|
||||
|
||||
if (0){
|
||||
// initialisation by RRC
|
||||
// CCCH PDU
|
||||
// size_sdu = (uint16_t) mac_rrc_data_req_ue(mod_id,
|
||||
// CC_id,
|
||||
// frame,
|
||||
// CCCH,
|
||||
// 1,
|
||||
// mac_sdus,
|
||||
// gNB_id,
|
||||
// 0);
|
||||
LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n", mod_id, frame, size_sdu);
|
||||
} else {
|
||||
// fill ulsch_buffer with random data
|
||||
for (int i = 0; i < TBS_bytes; i++){
|
||||
mac_sdus[i] = (unsigned char) (lrand48()&0xff);
|
||||
}
|
||||
//Sending SDUs with size 1
|
||||
//Initialize elements of sdu_lcids and sdu_lengths
|
||||
sdu_lcids[0] = lcid;
|
||||
sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len;
|
||||
header_length_total += 2 + (sdu_lengths[0] >= 128);
|
||||
size_sdu += sdu_lengths[0];
|
||||
// initialisation by RRC
|
||||
|
||||
// TODO: To be removed after RA procedures fully implemented
|
||||
if(get_softmodem_params()->do_ra) {
|
||||
nr_rrc_ue_generate_RRCSetupRequest(mod_id,gNB_id);
|
||||
}
|
||||
|
||||
// CCCH PDU
|
||||
size_sdu = (uint16_t) nr_mac_rrc_data_req_ue(mod_id, CC_id, gNB_id, frame, CCCH, mac_sdus);
|
||||
|
||||
sdu_lengths[0] = size_sdu;
|
||||
|
||||
LOG_D(NR_MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n", mod_id, frame, size_sdu);
|
||||
|
||||
if (size_sdu > 0) {
|
||||
|
||||
LOG_D(MAC, "[UE %d][%d.%d]: starting initialisation Random Access Procedure...\n", mod_id, frame, nr_slot_tx);
|
||||
// UE Contention Resolution Identity
|
||||
// Store the first 48 bits belonging to the uplink CCCH SDU within Msg3 to determine whether or not the
|
||||
// Random Access Procedure has been successful after reception of Msg4
|
||||
memcpy(ra->cont_res_id, mac_sdus, sizeof(uint8_t) * 6);
|
||||
|
||||
LOG_D(NR_MAC, "[UE %d][%d.%d]: starting initialisation Random Access Procedure...\n", mod_id, frame, nr_slot_tx);
|
||||
|
||||
ra->Msg3_size = size_sdu + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
|
||||
|
||||
@@ -577,9 +576,9 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
nr_get_RA_window(mac);
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
if (ra->generate_nr_prach == 1)
|
||||
if (ra->generate_nr_prach == GENERATE_PREAMBLE) {
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
}
|
||||
offset = nr_generate_ulsch_pdu((uint8_t *) mac_sdus, // sdus buffer
|
||||
(uint8_t *) payload, // UL MAC pdu pointer
|
||||
num_sdus, // num sdus
|
||||
@@ -593,12 +592,27 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
post_padding,
|
||||
0);
|
||||
|
||||
AssertFatal(TBS_max > offset, "Frequency resources are not enough for Msg3!\n");
|
||||
|
||||
// Padding: fill remainder with 0
|
||||
if (post_padding > 0){
|
||||
for (int j = 0; j < (TBS_bytes - offset); j++)
|
||||
payload[offset + j] = 0; // mac_pdu[offset + j] = 0;
|
||||
for (int j = 0; j < (TBS_max - offset); j++)
|
||||
payload[offset + j] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC,"size_sdu = %i\n", size_sdu);
|
||||
LOG_D(MAC,"offset = %i\n", offset);
|
||||
for(int k = 0; k < TBS_max; k++) {
|
||||
LOG_D(MAC,"(%i): %i\n", k, prach_resources->Msg3[k]);
|
||||
}
|
||||
|
||||
// Msg3 was initialized with TBS_max bytes because the RA_Msg3_size will only be known after
|
||||
// receiving Msg2 (which contains the Msg3 resource reserve).
|
||||
// Msg3 will be transmitted with RA_Msg3_size bytes, removing unnecessary 0s.
|
||||
mac->ulsch_pdu.Pdu_size = TBS_max;
|
||||
memcpy(mac->ulsch_pdu.payload, prach_resources->Msg3, TBS_max);
|
||||
|
||||
} else if (ra->RA_window_cnt != -1) { // RACH is active
|
||||
|
||||
LOG_D(MAC, "In %s [%d.%d] RA is active: RA window count %d, RA backoff count %d\n", __FUNCTION__, frame, nr_slot_tx, ra->RA_window_cnt, ra->RA_backoff_cnt);
|
||||
@@ -610,9 +624,13 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
}
|
||||
|
||||
if (ra->RA_window_cnt >= 0 && ra->RA_RAPID_found == 1) {
|
||||
// Reset RA_active flag: it disables Msg3 retransmission (8.3 of TS 38.213)
|
||||
|
||||
nr_ra_succeeded(mod_id, frame, nr_slot_tx);
|
||||
if(ra->cfra) {
|
||||
// Reset RA_active flag: it disables Msg3 retransmission (8.3 of TS 38.213)
|
||||
nr_ra_succeeded(mod_id, frame, nr_slot_tx);
|
||||
} else {
|
||||
ra->generate_nr_prach = GENERATE_IDLE;
|
||||
}
|
||||
|
||||
} else if (ra->RA_window_cnt == 0 && !ra->RA_RAPID_found) {
|
||||
|
||||
@@ -626,15 +644,16 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
ra->RA_window_cnt--;
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
|
||||
if (ra->generate_nr_prach == GENERATE_PREAMBLE) {
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
}
|
||||
} else if (ra->RA_backoff_cnt > 0) {
|
||||
|
||||
LOG_D(MAC, "[UE %d][%d.%d]: RAR not received yet (RA backoff count %d) \n", mod_id, frame, nr_slot_tx, ra->RA_backoff_cnt);
|
||||
|
||||
ra->RA_backoff_cnt--;
|
||||
|
||||
if ((ra->RA_backoff_cnt > 0 && ra->generate_nr_prach == 1) || ra->RA_backoff_cnt == 0){
|
||||
if ((ra->RA_backoff_cnt > 0 && ra->generate_nr_prach == GENERATE_PREAMBLE) || ra->RA_backoff_cnt == 0) {
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
|
||||
}
|
||||
|
||||
@@ -646,7 +665,12 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
nr_ue_contention_resolution(mod_id, CC_id, frame, nr_slot_tx, prach_resources);
|
||||
}
|
||||
|
||||
return ra->generate_nr_prach;
|
||||
LOG_D(MAC,"ra->generate_nr_prach %d ra->ra_state %d (GENERATE_IDLE %d)\n",ra->generate_nr_prach,ra->ra_state,GENERATE_IDLE);
|
||||
if(ra->generate_nr_prach != GENERATE_IDLE) {
|
||||
return ra->generate_nr_prach;
|
||||
} else {
|
||||
return ra->ra_state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -654,17 +678,21 @@ void nr_get_RA_window(NR_UE_MAC_INST_t *mac){
|
||||
|
||||
uint8_t mu, ra_ResponseWindow;
|
||||
RA_config_t *ra = &mac->ra;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *setup = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigCommon_t *setup;
|
||||
if (mac->scc) setup = mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
else setup = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.rach_ConfigCommon->choice.setup;
|
||||
AssertFatal(&setup->rach_ConfigGeneric != NULL, "In %s: FATAL! rach_ConfigGeneric is NULL...\n", __FUNCTION__);
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
|
||||
NR_FrequencyInfoDL_t *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
||||
|
||||
long scs = (mac->scc) ?
|
||||
mac->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing :
|
||||
mac->scc_SIB->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
|
||||
ra_ResponseWindow = rach_ConfigGeneric->ra_ResponseWindow;
|
||||
|
||||
if (setup->msg1_SubcarrierSpacing)
|
||||
mu = *setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
mu = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
mu = scs;
|
||||
|
||||
ra->RA_window_cnt = ra->RA_offset*nr_slots_per_frame[mu]; // taking into account the 2 frames gap introduced by OAI gNB
|
||||
|
||||
@@ -740,6 +768,7 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
|
||||
LOG_I(MAC, "[UE %d][%d.%d][RAPROC] RA procedure succeeded. CF-RA: RAR successfully received.\n", mod_id, frame, slot);
|
||||
|
||||
ra->RA_window_cnt = -1;
|
||||
mac->crnti = ra->t_crnti;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -747,6 +776,7 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
|
||||
|
||||
ra->RA_contention_resolution_cnt = -1;
|
||||
ra->RA_contention_resolution_timer_active = 0;
|
||||
mac->crnti = ra->t_crnti;
|
||||
ra->t_crnti = 0;
|
||||
|
||||
LOG_D(MAC, "In %s: [UE %d][%d.%d] CB-RA: cleared contention resolution timer...\n", __FUNCTION__, mod_id, frame, slot);
|
||||
@@ -755,50 +785,40 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
|
||||
|
||||
LOG_D(MAC, "In %s: [UE %d] clearing RA_active flag...\n", __FUNCTION__, mod_id);
|
||||
ra->RA_active = 0;
|
||||
ra->generate_nr_prach = 2;
|
||||
ra->generate_nr_prach = GENERATE_IDLE;
|
||||
ra->ra_state = RA_SUCCEEDED;
|
||||
|
||||
}
|
||||
|
||||
// Handlig failure of RA procedure @ MAC layer
|
||||
// Handling failure of RA procedure @ MAC layer
|
||||
// according to section 5 of 3GPP TS 38.321 version 16.2.1 Release 16
|
||||
// todo:
|
||||
// - complete handling of received contention-based RA preamble
|
||||
// - 2-step RA implementation
|
||||
void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_resources, frame_t frame, int slot) {
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
|
||||
ra->first_Msg3 = 0;
|
||||
ra->generate_nr_prach = 3;
|
||||
ra->first_Msg3 = 1;
|
||||
ra->ra_PreambleIndex = -1;
|
||||
ra->generate_nr_prach = RA_FAILED;
|
||||
ra->ra_state = RA_UE_IDLE;
|
||||
|
||||
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER++;
|
||||
|
||||
if(prach_resources->RA_TYPE == RA_4STEP){
|
||||
if (prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER == ra->preambleTransMax + 1){
|
||||
|
||||
if (prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER == ra->preambleTransMax + 1){
|
||||
LOG_D(MAC, "In %s: [UE %d][%d.%d] Maximum number of RACH attempts (%d) reached, selecting backoff time...\n",
|
||||
__FUNCTION__, mod_id, frame, slot, ra->preambleTransMax);
|
||||
|
||||
LOG_D(MAC, "In %s: [UE %d][%d.%d] Maximum number of RACH attempts (%d) reached, selecting backoff time...\n", __FUNCTION__, mod_id, frame, slot, ra->preambleTransMax);
|
||||
|
||||
ra->RA_backoff_cnt = rand() % (prach_resources->RA_PREAMBLE_BACKOFF + 1);
|
||||
|
||||
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER = 1;
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP += 2; // 2 dB increment
|
||||
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER = nr_get_Po_NOMINAL_PUSCH(prach_resources, mod_id, CC_id);
|
||||
|
||||
} else {
|
||||
|
||||
// Resetting RA window
|
||||
nr_get_RA_window(mac);
|
||||
|
||||
}
|
||||
|
||||
} else if (prach_resources->RA_TYPE == RA_2STEP){
|
||||
|
||||
LOG_E(MAC, "Missing implementation of RA failure handling for 2-step RA...\n");
|
||||
ra->RA_backoff_cnt = rand() % (prach_resources->RA_PREAMBLE_BACKOFF + 1);
|
||||
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER = 1;
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP += 2; // 2 dB increment
|
||||
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER = nr_get_Po_NOMINAL_PUSCH(prach_resources, mod_id, CC_id);
|
||||
|
||||
} else {
|
||||
// Resetting RA window
|
||||
nr_get_RA_window(mac);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,9 +47,7 @@
|
||||
#endif
|
||||
#define LOG_DCI_PARM(a...) LOG_D(PHY,"\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_generate_ue_ul_dlsch_params_from_dci)" a)
|
||||
|
||||
// #define DEBUG_DCI
|
||||
|
||||
dci_pdu_rel15_t *def_dci_pdu_rel15;
|
||||
//#define DEBUG_DCI
|
||||
|
||||
void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) {
|
||||
|
||||
@@ -72,12 +70,22 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
uint16_t monitoringSymbolsWithinSlot = 0;
|
||||
uint8_t coreset_id = 1;
|
||||
int sps = 0;
|
||||
def_dci_pdu_rel15 = calloc(1,2*sizeof(dci_pdu_rel15_t));
|
||||
AssertFatal(mac->scc != NULL, "scc is null\n");
|
||||
|
||||
AssertFatal(mac->scc == NULL || mac->scc_SIB == NULL, "both scc and scc_SIB cannot be non-null\n");
|
||||
|
||||
NR_BWP_Id_t bwp_id = mac->DL_BWP_Id;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = mac->DLbwp[bwp_id - 1]->bwp_Common;
|
||||
NR_BWP_DownlinkCommon_t *initialDownlinkBWP = scc->downlinkConfigCommon->initialDownlinkBWP;
|
||||
NR_ServingCellConfigCommonSIB_t *scc_SIB = mac->scc_SIB;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common=NULL;
|
||||
NR_BWP_DownlinkCommon_t *initialDownlinkBWP=NULL;
|
||||
NR_BWP_UplinkCommon_t *initialUplinkBWP=NULL;
|
||||
|
||||
if (scc!=NULL || scc_SIB != NULL) {
|
||||
initialDownlinkBWP = scc!=NULL ? scc->downlinkConfigCommon->initialDownlinkBWP : &scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
|
||||
initialUplinkBWP = scc!=NULL ? scc->uplinkConfigCommon->initialUplinkBWP : &scc_SIB->uplinkConfigCommon->initialUplinkBWP;
|
||||
|
||||
bwp_Common = bwp_id>0 ? mac->DLbwp[bwp_id-1]->bwp_Common : NULL;
|
||||
}
|
||||
|
||||
NR_SearchSpace_t *ss;
|
||||
NR_ControlResourceSet_t *coreset;
|
||||
@@ -88,7 +96,11 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
} else {
|
||||
ss = mac->search_space_zero;
|
||||
coreset = mac->coreset0;
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
||||
if(rnti_type == NR_RNTI_SI) {
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
||||
} else {
|
||||
rel15->coreset.CoreSetType = NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG_CSET_0;
|
||||
}
|
||||
}
|
||||
|
||||
rel15->coreset.duration = coreset->duration;
|
||||
@@ -100,8 +112,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
struct NR_ControlResourceSet__cce_REG_MappingType__interleaved *interleaved = coreset->cce_REG_MappingType.choice.interleaved;
|
||||
rel15->coreset.RegBundleSize = (interleaved->reg_BundleSize == NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2 + interleaved->reg_BundleSize);
|
||||
rel15->coreset.InterleaverSize = (interleaved->interleaverSize == NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2 + interleaved->interleaverSize);
|
||||
AssertFatal(scc->physCellId != NULL, "mac->scc->physCellId is null\n");
|
||||
rel15->coreset.ShiftIndex = interleaved->shiftIndex != NULL ? *interleaved->shiftIndex : *scc->physCellId;
|
||||
rel15->coreset.ShiftIndex = interleaved->shiftIndex != NULL ? *interleaved->shiftIndex : mac->physCellId;
|
||||
} else {
|
||||
rel15->coreset.RegBundleSize = 0;
|
||||
rel15->coreset.InterleaverSize = 0;
|
||||
@@ -115,7 +126,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
rel15->coreset.pdcch_dmrs_scrambling_id = *coreset->pdcch_DMRS_ScramblingID;
|
||||
rel15->coreset.scrambling_rnti = mac->crnti;
|
||||
} else {
|
||||
rel15->coreset.pdcch_dmrs_scrambling_id = *scc->physCellId;
|
||||
rel15->coreset.pdcch_dmrs_scrambling_id = mac->physCellId;
|
||||
rel15->coreset.scrambling_rnti = 0;
|
||||
}
|
||||
|
||||
@@ -127,15 +138,23 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
switch(rnti_type) {
|
||||
case NR_RNTI_C:
|
||||
// we use DL BWP dedicated
|
||||
sps = bwp_Common->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
sps = bwp_Common ?
|
||||
(bwp_Common->genericParameters.cyclicPrefix ? 12 : 14) :
|
||||
initialDownlinkBWP->genericParameters.cyclicPrefix ? 12 : 14;
|
||||
// for SPS=14 8 MSBs in positions 13 down to 6
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
rel15->rnti = mac->crnti;
|
||||
rel15->BWPSize = NRRIV2BW(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->SubcarrierSpacing = bwp_Common->genericParameters.subcarrierSpacing;
|
||||
if (!bwp_Common) {
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
}
|
||||
else {
|
||||
rel15->BWPSize = NRRIV2BW(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->SubcarrierSpacing = bwp_Common->genericParameters.subcarrierSpacing;
|
||||
}
|
||||
for (int i = 0; i < rel15->num_dci_options; i++) {
|
||||
rel15->dci_length_options[i] = nr_dci_size(scc, mac->scg, def_dci_pdu_rel15+i, rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, bwp_id);
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, bwp_id);
|
||||
}
|
||||
break;
|
||||
case NR_RNTI_RA:
|
||||
@@ -144,21 +163,34 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
rel15->rnti = ra->ra_rnti;
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); //NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, 275);
|
||||
if (get_softmodem_params()->sa) {
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
} else { // NSA mode is not using the Initial BWP
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
}
|
||||
rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing;
|
||||
rel15->dci_length_options[0] = nr_dci_size(scc, mac->scg, def_dci_pdu_rel15, rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, bwp_id);
|
||||
rel15->dci_length_options[0] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, bwp_id);
|
||||
break;
|
||||
case NR_RNTI_P:
|
||||
break;
|
||||
case NR_RNTI_CS:
|
||||
break;
|
||||
case NR_RNTI_TC:
|
||||
// we use the initial DL BWP
|
||||
sps = initialDownlinkBWP->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
rel15->rnti = ra->t_crnti;
|
||||
rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing;
|
||||
rel15->dci_length_options[0] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_TC, rel15->BWPSize, bwp_id);
|
||||
break;
|
||||
case NR_RNTI_SP_CSI:
|
||||
break;
|
||||
case NR_RNTI_SI:
|
||||
// we use DL BWP dedicated
|
||||
sps = bwp_Common->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
if (bwp_Common) sps = bwp_Common->genericParameters.cyclicPrefix == NULL ? 14 : 12;
|
||||
else sps=14; // note: normally this would be found with SSS detection
|
||||
|
||||
// for SPS=14 8 MSBs in positions 13 down to 6
|
||||
monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps));
|
||||
@@ -169,7 +201,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
|
||||
rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon;
|
||||
|
||||
for (int i = 0; i < rel15->num_dci_options; i++) {
|
||||
rel15->dci_length_options[i] = nr_dci_size(scc, mac->scg, def_dci_pdu_rel15, rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, 0);
|
||||
rel15->dci_length_options[i] = nr_dci_size(initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, 0);
|
||||
}
|
||||
break;
|
||||
case NR_RNTI_SFI:
|
||||
@@ -211,159 +243,176 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
|
||||
RA_config_t *ra = &mac->ra;
|
||||
int ss_id;
|
||||
uint8_t bwp_id = 1, coreset_id = 1;
|
||||
|
||||
uint8_t bwp_id = (mac->cg) ? 1 : 0, coreset_id = (mac->cg) ? 1 : 0;
|
||||
//NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated;
|
||||
NR_BWP_Downlink_t *bwp = mac->DLbwp[bwp_id - 1];
|
||||
NR_BWP_Downlink_t *bwp = (mac->cg) ? mac->DLbwp[bwp_id - 1] : NULL;
|
||||
|
||||
#ifdef DEBUG_DCI
|
||||
LOG_D(MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti);
|
||||
#endif
|
||||
LOG_D(MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti);
|
||||
|
||||
// loop over all available SS for BWP ID 1, CORESET ID 1
|
||||
for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id - 1][coreset_id - 1][ss_id] != NULL; ss_id++){
|
||||
NR_SearchSpace_t *ss = mac->SSpace[bwp_id - 1][coreset_id - 1][ss_id];
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = bwp->bwp_Common;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
||||
struct NR_PhysicalCellGroupConfig *phy_cgc = mac->scg->physicalCellGroupConfig;
|
||||
switch (ss->searchSpaceType->present){
|
||||
case NR_SearchSpace__searchSpaceType_PR_common:
|
||||
// this is for CSSs, we use BWP common and pdcch_ConfigCommon
|
||||
if (mac->cg) { // do this only after we have a Master or Secondary Cell group
|
||||
// loop over all available SS for BWP ID 1, CORESET ID 1
|
||||
if (bwp) {
|
||||
for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id - 1][coreset_id - 1][ss_id] != NULL; ss_id++){
|
||||
LOG_D(MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
|
||||
NR_SearchSpace_t *ss = mac->SSpace[bwp_id - 1][coreset_id - 1][ss_id];
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = bwp->bwp_Common;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
||||
struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig;
|
||||
switch (ss->searchSpaceType->present){
|
||||
case NR_SearchSpace__searchSpaceType_PR_common:
|
||||
// this is for CSSs, we use BWP common and pdcch_ConfigCommon
|
||||
|
||||
// Fetch configuration for searchSpaceZero
|
||||
// note: The search space with the SearchSpaceId = 0 identifies the search space configured via PBCH (MIB) and in ServingCellConfigCommon (searchSpaceZero).
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceZero && !get_softmodem_params()->nsa){
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 == NULL){
|
||||
pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=calloc(1,sizeof(*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1));
|
||||
}
|
||||
*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = 0;
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure SearchSpace#0 of the initial BWP\n");
|
||||
}
|
||||
if (ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0){
|
||||
// check available SS IDs
|
||||
if (pdcch_ConfigCommon->choice.setup->ra_SearchSpace){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->ra_SearchSpace){
|
||||
switch(ra->ra_state){
|
||||
case WAIT_RAR:
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space\n");
|
||||
rel15->num_dci_options = 1;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, ss_id);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
break;
|
||||
case WAIT_CONTENTION_RESOLUTION:
|
||||
LOG_E(MAC, "In %s: CB-RA not implemented yet. Should not have fallen in this case.\n", __FUNCTION__);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
|
||||
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
|
||||
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->pagingSearchSpace){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->pagingSearchSpace){
|
||||
// Configure monitoring of PDCCH candidates in Type2-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (phy_cgc){
|
||||
if (phy_cgc->cs_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by CS-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->ext1){
|
||||
if (phy_cgc->ext1->mcs_C_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by MCS-C-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end DCI 00 and 01
|
||||
// DCI 2_0
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_0){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_0 with CRC scrambled by SFI-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
// DCI 2_1
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_1){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_1 with CRC scrambled by INT-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
// DCI 2_2
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_2){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_2 with CRC scrambled by TPC-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
// DCI 2_3
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_3){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_3 with CRC scrambled by TPC-SRS-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
// Fetch configuration for searchSpaceZero
|
||||
// note: The search space with the SearchSpaceId = 0 identifies the search space configured via PBCH (MIB) and in ServingCellConfigCommon (searchSpaceZero).
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceZero){
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 == NULL){
|
||||
pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=calloc(1,sizeof(*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1));
|
||||
}
|
||||
*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = 0;
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure SearchSpace#0 of the initial BWP\n");
|
||||
}
|
||||
if (ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0){
|
||||
// check available SS IDs
|
||||
if (pdcch_ConfigCommon->choice.setup->ra_SearchSpace){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->ra_SearchSpace){
|
||||
switch(ra->ra_state){
|
||||
case WAIT_RAR:
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg2)\n");
|
||||
rel15->num_dci_options = 1;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
if (get_softmodem_params()->sa) {
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, -1);
|
||||
} else {
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_RA, ss_id);
|
||||
}
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
break;
|
||||
case WAIT_CONTENTION_RESOLUTION:
|
||||
LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg4)\n");
|
||||
rel15->num_dci_options = 1;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_TC, -1);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
|
||||
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
|
||||
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (pdcch_ConfigCommon->choice.setup->pagingSearchSpace){
|
||||
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->pagingSearchSpace){
|
||||
// Configure monitoring of PDCCH candidates in Type2-PDCCH common search space on the MCG
|
||||
LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
|
||||
}
|
||||
}
|
||||
if (phy_cgc){
|
||||
if (phy_cgc->cs_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by CS-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->ext1){
|
||||
if (phy_cgc->ext1->mcs_C_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by MCS-C-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end DCI 00 and 01
|
||||
// DCI 2_0
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_0){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_0 with CRC scrambled by SFI-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
// DCI 2_1
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_1){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_1 with CRC scrambled by INT-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
// DCI 2_2
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_2){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_2 with CRC scrambled by TPC-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
// DCI 2_3
|
||||
if (ss->searchSpaceType->choice.common->dci_Format2_3){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type3-PDCCH common search space for DCI format 2_3 with CRC scrambled by TPC-SRS-RNTI \n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This format should not be configured yet...");
|
||||
}
|
||||
|
||||
break;
|
||||
case NR_SearchSpace__searchSpaceType_PR_ue_Specific:
|
||||
// this is an USS
|
||||
if (ss->searchSpaceType->choice.ue_Specific){
|
||||
if(ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_1_And_1_1){
|
||||
// Monitors DCI 01 and 11 scrambled with C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI
|
||||
if ((ra->ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test) && mac->crnti > 0) {
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n");
|
||||
rel15->num_dci_options = 2;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_1;
|
||||
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_1;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_C, ss_id);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
break;
|
||||
case NR_SearchSpace__searchSpaceType_PR_ue_Specific:
|
||||
// this is an USS
|
||||
if (ss->searchSpaceType->choice.ue_Specific){
|
||||
if(ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_1_And_1_1){
|
||||
// Monitors DCI 01 and 11 scrambled with C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI
|
||||
if ((ra->ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test) && mac->crnti > 0) {
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n");
|
||||
rel15->num_dci_options = 2;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_1;
|
||||
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_1;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_C, ss_id);
|
||||
fill_dci_search_candidates(ss, rel15);
|
||||
|
||||
#ifdef DEBUG_DCI
|
||||
LOG_D(MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n",
|
||||
ss_id,
|
||||
ss->searchSpaceType->choice.ue_Specific,
|
||||
ss->searchSpaceType->present,
|
||||
ss->searchSpaceType->choice.ue_Specific->dci_Formats);
|
||||
#endif
|
||||
}
|
||||
if (phy_cgc){
|
||||
if (phy_cgc->cs_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by CS-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->sp_CSI_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by SP-CSI-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->ext1){
|
||||
if (phy_cgc->ext1->mcs_C_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by MCS-C-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_DCI
|
||||
LOG_D(MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n",
|
||||
ss_id,
|
||||
ss->searchSpaceType->choice.ue_Specific,
|
||||
ss->searchSpaceType->present,
|
||||
ss->searchSpaceType->choice.ue_Specific->dci_Formats);
|
||||
#endif
|
||||
}
|
||||
if (phy_cgc){
|
||||
if (phy_cgc->cs_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by CS-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->sp_CSI_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by SP-CSI-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
if (phy_cgc->ext1){
|
||||
if (phy_cgc->ext1->mcs_C_RNTI){
|
||||
LOG_D(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in user specific search space for dci_Format0_0_AndFormat1_0 with CRC scrambled by MCS-C-RNTI...\n");
|
||||
LOG_W(MAC, "[DCI_CONFIG] This RNTI should not be configured yet...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "[DCI_CONFIG] Unrecognized search space type...");
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "[DCI_CONFIG] Unrecognized search space type...");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
AssertFatal(1==0,"Handle DCI searching when CellGroup without dedicated BWP\n");
|
||||
}
|
||||
// Search space 0, CORESET ID 0
|
||||
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = bwp->bwp_Common;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
|
||||
NR_BWP_DownlinkCommon_t *bwp_Common = bwp ? bwp->bwp_Common : NULL;
|
||||
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp?bwp_Common->pdcch_ConfigCommon:NULL;
|
||||
|
||||
if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 && !get_softmodem_params()->nsa){
|
||||
if (pdcch_ConfigCommon &&
|
||||
pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 &&
|
||||
!get_softmodem_params()->nsa) {
|
||||
|
||||
NR_SearchSpace_t *ss0 = mac->search_space_zero;
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
@@ -377,5 +426,13 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else { // use coreset0/ss0
|
||||
NR_SearchSpace_t *ss0 = mac->search_space_zero;
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[0].dci_config_pdu.dci_config_rel15;
|
||||
rel15->num_dci_options = 1;
|
||||
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
|
||||
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_C , -1);
|
||||
fill_dci_search_candidates(ss0, rel15);
|
||||
dl_config->number_pdus = 1;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,88 @@ extern RAN_CONTEXT_t RC;
|
||||
extern void mac_top_init_gNB(void);
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
|
||||
void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list,
|
||||
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
if (rlc_bearer2add_list)
|
||||
// keep lcids
|
||||
for (int i=0;i<rlc_bearer2add_list->list.count;i++) {
|
||||
sched_ctrl->lcid_mask |= (1<<rlc_bearer2add_list->list.array[i]->logicalChannelIdentity);
|
||||
LOG_I(NR_MAC,"Adding LCID %d (%s %d)\n",
|
||||
(int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity,
|
||||
rlc_bearer2add_list->list.array[i]->logicalChannelIdentity<4 ? "SRB" : "DRB",
|
||||
(int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity);
|
||||
}
|
||||
if (rlc_bearer2release_list)
|
||||
for (int i=0;i<rlc_bearer2release_list->list.count;i++)
|
||||
sched_ctrl->lcid_mask |= (1<<*rlc_bearer2release_list->list.array[i]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void process_drx_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_SetupRelease_DRX_Config_t *drx_Config) {
|
||||
if (!drx_Config) return;
|
||||
AssertFatal(drx_Config->present != NR_SetupRelease_DRX_Config_PR_NOTHING, "Cannot have NR_SetupRelease_DRX_Config_PR_NOTHING\n");
|
||||
|
||||
if (drx_Config->present == NR_SetupRelease_DRX_Config_PR_setup) {
|
||||
LOG_I(NR_MAC,"Adding DRX config\n");
|
||||
}
|
||||
else {
|
||||
LOG_I(NR_MAC,"Removing DRX config\n");
|
||||
}
|
||||
}
|
||||
|
||||
void process_schedulingRequestConfig(NR_UE_sched_ctrl_t *sched_ctrl,NR_SchedulingRequestConfig_t *schedulingRequestConfig) {
|
||||
if (!schedulingRequestConfig) return;
|
||||
|
||||
LOG_I(NR_MAC,"Adding SchedulingRequestconfig\n");
|
||||
}
|
||||
|
||||
void process_bsrConfig(NR_UE_sched_ctrl_t *sched_ctrl,NR_BSR_Config_t *bsr_Config) {
|
||||
if (!bsr_Config) return;
|
||||
LOG_I(NR_MAC,"Adding BSR config\n");
|
||||
}
|
||||
|
||||
void process_tag_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_TAG_Config_t *tag_Config) {
|
||||
if (!tag_Config) return;
|
||||
LOG_I(NR_MAC,"Adding TAG config\n");
|
||||
}
|
||||
|
||||
void process_phr_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_SetupRelease_PHR_Config_t *phr_Config) {
|
||||
if (!phr_Config) return;
|
||||
AssertFatal(phr_Config->present != NR_SetupRelease_PHR_Config_PR_NOTHING, "Cannot have NR_SetupRelease_PHR_Config_PR_NOTHING\n");
|
||||
|
||||
if (phr_Config->present == NR_SetupRelease_PHR_Config_PR_setup) {
|
||||
LOG_I(NR_MAC,"Adding PHR config\n");
|
||||
}
|
||||
else {
|
||||
LOG_I(NR_MAC,"Removing PHR config\n");
|
||||
}
|
||||
}
|
||||
|
||||
void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
AssertFatal(CellGroup, "CellGroup is null\n");
|
||||
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = CellGroup->mac_CellGroupConfig;
|
||||
|
||||
|
||||
if (mac_CellGroupConfig) {
|
||||
process_drx_Config(sched_ctrl,mac_CellGroupConfig->drx_Config);
|
||||
process_schedulingRequestConfig(sched_ctrl,mac_CellGroupConfig->schedulingRequestConfig);
|
||||
process_bsrConfig(sched_ctrl,mac_CellGroupConfig->bsr_Config);
|
||||
process_tag_Config(sched_ctrl,mac_CellGroupConfig->tag_Config);
|
||||
process_phr_Config(sched_ctrl,mac_CellGroupConfig->phr_Config);
|
||||
}
|
||||
else {
|
||||
// apply defaults
|
||||
|
||||
}
|
||||
|
||||
process_rlcBearerConfig(CellGroup->rlc_BearerToAddModList,CellGroup->rlc_BearerToReleaseList,sched_ctrl);
|
||||
|
||||
}
|
||||
void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0];
|
||||
RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon = scc;
|
||||
@@ -67,7 +148,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
cfg->carrier_config.dl_bandwidth.tl.tag = NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG; //temporary
|
||||
cfg->num_tlv++;
|
||||
LOG_I(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, cfg->carrier_config.dl_bandwidth.value);
|
||||
LOG_I(NR_MAC,"%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,
|
||||
@@ -95,7 +176,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
*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);
|
||||
LOG_I(NR_MAC,"%s() dl_BandwidthP:%d\n", __FUNCTION__, cfg->carrier_config.uplink_bandwidth.value);
|
||||
|
||||
int UL_pointA;
|
||||
if (scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA == NULL)
|
||||
@@ -127,8 +208,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
uint32_t band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
frequency_range_t frequency_range = band<100?FR1:FR2;
|
||||
|
||||
lte_frame_type_t frame_type;
|
||||
get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing, &frame_type);
|
||||
lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
|
||||
RC.nrmac[Mod_idP]->common_channels[0].frame_type = frame_type;
|
||||
|
||||
// Cell configuration
|
||||
@@ -209,8 +289,12 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
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 + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
//k1= msg1_FrequencyStart + 12 (no. of FDM)(RB for PRACH occasion);
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
if (get_softmodem_params()->sa) {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
} else {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
|
||||
}
|
||||
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;
|
||||
@@ -241,6 +325,9 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
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++;
|
||||
cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset;
|
||||
cfg->ssb_table.ssb_subcarrier_offset.tl.tag = NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1 :
|
||||
@@ -265,20 +352,34 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->num_tlv+=2;
|
||||
|
||||
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->ssb_table.ssb_beam_id_list[i].beam_id.tl.tag = NFAPI_NR_CONFIG_BEAM_ID_TAG;
|
||||
if ((cfg->ssb_table.ssb_mask_list[0].ssb_mask.value>>(31-i))&1) {
|
||||
cfg->ssb_table.ssb_beam_id_list[i].beam_id.value = num_ssb;
|
||||
num_ssb++;
|
||||
}
|
||||
cfg->num_tlv++;
|
||||
}
|
||||
for (int i=0;i<32;i++) {
|
||||
cfg->ssb_table.ssb_beam_id_list[32+i].beam_id.tl.tag = NFAPI_NR_CONFIG_BEAM_ID_TAG;
|
||||
if ((cfg->ssb_table.ssb_mask_list[1].ssb_mask.value>>(31-i))&1) {
|
||||
cfg->ssb_table.ssb_beam_id_list[32+i].beam_id.value = num_ssb;
|
||||
num_ssb++;
|
||||
}
|
||||
cfg->num_tlv++;
|
||||
}
|
||||
|
||||
cfg->carrier_config.num_rx_ant.value = cfg->carrier_config.num_tx_ant.value;
|
||||
cfg->carrier_config.num_rx_ant.value = pusch_AntennaPorts;
|
||||
AssertFatal(pusch_AntennaPorts > 0 && pusch_AntennaPorts < 13, "pusch_AntennaPorts in 1...12\n");
|
||||
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);
|
||||
LOG_I(NR_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++;
|
||||
@@ -295,34 +396,33 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
|
||||
}
|
||||
if(cfg->cell_config.frame_duplex_type.value == TDD){
|
||||
LOG_I(MAC,"Setting TDD configuration period to %d\n",cfg->tdd_table.tdd_period.value);
|
||||
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);
|
||||
LOG_I(NR_MAC,"Setting TDD configuration period to %d\n",cfg->tdd_table.tdd_period.value);
|
||||
int periods_per_frame = 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(MAC,"TDD configuration can not be done\n");
|
||||
else
|
||||
LOG_I(MAC,"TDD has been properly configurated\n");
|
||||
if (periods_per_frame < 0)
|
||||
LOG_E(NR_MAC,"TDD configuration can not be done\n");
|
||||
else {
|
||||
LOG_I(NR_MAC,"TDD has been properly configurated\n");
|
||||
RC.nrmac[Mod_idP]->tdd_beam_association = (int16_t *)malloc16(periods_per_frame*sizeof(int16_t));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern uint16_t sl_ahead;
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
int pusch_tgt_snrx10,
|
||||
int pucch_tgt_snrx10,
|
||||
int pusch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int add_ue,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup){
|
||||
int add_ue,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *CellGroup) {
|
||||
|
||||
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);
|
||||
@@ -351,20 +451,14 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL,
|
||||
"could not allocate memory for RC.nrmac[]->common_channels[0].vrb_map_UL\n");
|
||||
|
||||
for (int i = 0; i < MAX_NUM_BWP; ++i) {
|
||||
RC.nrmac[Mod_idP]->pucch_index_used[i] =
|
||||
calloc(n, sizeof(*RC.nrmac[Mod_idP]->pucch_index_used));
|
||||
AssertFatal(RC.nrmac[Mod_idP]->pucch_index_used[i],
|
||||
"could not allocate memory for RC.nrmac[]->pucch_index_used[%d]\n",
|
||||
i);
|
||||
}
|
||||
|
||||
LOG_I(MAC,"Configuring common parameters from NR ServingCellConfig\n");
|
||||
LOG_I(NR_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);
|
||||
ssb_SubcarrierOffset,
|
||||
pdsch_AntennaPorts,
|
||||
pusch_AntennaPorts,
|
||||
scc);
|
||||
LOG_D(NR_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 == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MODE_VNF) && (RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req == NULL) ){
|
||||
@@ -374,32 +468,83 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
printf("Waiting for PHY_config_req\n");
|
||||
}
|
||||
}
|
||||
|
||||
RC.nrmac[Mod_idP]->pusch_target_snrx10 = pusch_tgt_snrx10;
|
||||
RC.nrmac[Mod_idP]->pucch_target_snrx10 = pucch_tgt_snrx10;
|
||||
RC.nrmac[Mod_idP]->ssb_SubcarrierOffset = ssb_SubcarrierOffset;
|
||||
|
||||
NR_PHY_Config_t phycfg;
|
||||
phycfg.Mod_id = Mod_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);
|
||||
|
||||
find_SSB_and_RO_available(Mod_idP);
|
||||
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
|
||||
const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
|
||||
const int nr_dlmix_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0);
|
||||
const int nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0);
|
||||
|
||||
for (int slot = 0; slot < n; ++slot) {
|
||||
/* FIXME: it seems there is a problem with slot 0/10/slots right after UL:
|
||||
* we just get retransmissions. Thus, do not schedule such slots in DL */
|
||||
if (slot % nr_slots_period != 0)
|
||||
RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dlmix_slots) << (slot % 64);
|
||||
RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64);
|
||||
LOG_D(NR_MAC, "slot %d DL %d UL %d\n",
|
||||
slot,
|
||||
(RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0,
|
||||
(RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0);
|
||||
}
|
||||
|
||||
if (get_softmodem_params()->phy_test) {
|
||||
RC.nrmac[Mod_idP]->pre_processor_dl = nr_preprocessor_phytest;
|
||||
RC.nrmac[Mod_idP]->pre_processor_ul = nr_ul_preprocessor_phytest;
|
||||
} else {
|
||||
RC.nrmac[Mod_idP]->pre_processor_dl = nr_init_fr1_dlsch_preprocessor(Mod_idP, 0);
|
||||
RC.nrmac[Mod_idP]->pre_processor_ul = nr_init_fr1_ulsch_preprocessor(Mod_idP, 0);
|
||||
}
|
||||
|
||||
if (get_softmodem_params()->sa > 0) {
|
||||
NR_COMMON_channels_t *cc = &RC.nrmac[Mod_idP]->common_channels[0];
|
||||
for (int n=0;n<NR_NB_RA_PROC_MAX;n++ ) {
|
||||
cc->ra[n].cfra = false;
|
||||
cc->ra[n].rnti = 0;
|
||||
cc->ra[n].preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES;
|
||||
cc->ra[n].preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t));
|
||||
for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++)
|
||||
cc->ra[n].preambles.preamble_list[i] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (secondaryCellGroup) {
|
||||
if (CellGroup) {
|
||||
|
||||
RC.nrmac[Mod_idP]->secondaryCellGroupCommon = secondaryCellGroup;
|
||||
const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated;
|
||||
|
||||
const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList;
|
||||
if(bwpList) {
|
||||
AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n");
|
||||
for (int i = 0; i < bwpList->list.count; ++i) {
|
||||
const NR_BWP_Downlink_t *bwp = bwpList->list.array[i];
|
||||
calculate_preferred_dl_tda(Mod_idP, bwp);
|
||||
}
|
||||
}
|
||||
|
||||
const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList;
|
||||
if(ubwpList) {
|
||||
AssertFatal(ubwpList->list.count > 0, "downlinkBWP_ToAddModList no BWPs!\n");
|
||||
for (int i = 0; i < ubwpList->list.count; ++i) {
|
||||
const NR_BWP_Uplink_t *ubwp = ubwpList->list.array[i];
|
||||
calculate_preferred_ul_tda(Mod_idP, ubwp);
|
||||
}
|
||||
}
|
||||
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||
if (add_ue == 1 && get_softmodem_params()->phy_test) {
|
||||
const int UE_id = add_new_nr_ue(Mod_idP, rnti, secondaryCellGroup);
|
||||
LOG_I(PHY,"Added new UE_id %d/%x with initial secondaryCellGroup\n",UE_id,rnti);
|
||||
const int UE_id = add_new_nr_ue(Mod_idP, rnti, CellGroup);
|
||||
LOG_I(NR_MAC,"Added new UE_id %d/%x with initial CellGroup\n",UE_id,rnti);
|
||||
process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]);
|
||||
} else if (add_ue == 1 && !get_softmodem_params()->phy_test) {
|
||||
const int CC_id = 0;
|
||||
NR_COMMON_channels_t *cc = &RC.nrmac[Mod_idP]->common_channels[CC_id];
|
||||
@@ -409,16 +554,17 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
if((cc->ra[ra_index].state == RA_IDLE) && (!cc->ra[ra_index].cfra)) break;
|
||||
}
|
||||
if (ra_index == NR_NB_RA_PROC_MAX) {
|
||||
LOG_E(MAC, "%s() %s:%d RA processes are not available for CFRA RNTI :%x\n", __FUNCTION__, __FILE__, __LINE__, rnti);
|
||||
LOG_E(NR_MAC, "%s() %s:%d RA processes are not available for CFRA RNTI :%x\n", __FUNCTION__, __FILE__, __LINE__, rnti);
|
||||
return -1;
|
||||
}
|
||||
NR_RA_t *ra = &cc->ra[ra_index];
|
||||
ra->secondaryCellGroup = secondaryCellGroup;
|
||||
if (secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated!=NULL) {
|
||||
if (secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra != NULL) {
|
||||
ra->CellGroup = CellGroup;
|
||||
if (CellGroup->spCellConfig && CellGroup->spCellConfig->reconfigurationWithSync &&
|
||||
CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated!=NULL) {
|
||||
if (CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra != NULL) {
|
||||
ra->cfra = true;
|
||||
ra->rnti = rnti;
|
||||
struct NR_CFRA *cfra = secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra;
|
||||
struct NR_CFRA *cfra = CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra;
|
||||
uint8_t num_preamble = cfra->resources.choice.ssb->ssb_ResourceList.list.count;
|
||||
ra->preambles.num_preambles = num_preamble;
|
||||
ra->preambles.preamble_list = (uint8_t *) malloc(num_preamble*sizeof(uint8_t));
|
||||
@@ -433,12 +579,20 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ra->cfra = false;
|
||||
ra->rnti = 0;
|
||||
ra->preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES;
|
||||
ra->preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t));
|
||||
for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++)
|
||||
ra->preambles.preamble_list[i] = i;
|
||||
}
|
||||
LOG_I(PHY,"Added new RA process for UE RNTI %04x with initial secondaryCellGroup\n", rnti);
|
||||
} else { // secondaryCellGroup has been updated
|
||||
LOG_I(NR_MAC,"Added new RA process for UE RNTI %04x with initial CellGroup\n", rnti);
|
||||
} else { // CellGroup has been updated
|
||||
const int UE_id = find_nr_UE_id(Mod_idP,rnti);
|
||||
UE_info->secondaryCellGroup[UE_id] = secondaryCellGroup;
|
||||
LOG_I(PHY,"Modified UE_id %d/%x with secondaryCellGroup\n",UE_id,rnti);
|
||||
UE_info->CellGroup[UE_id] = CellGroup;
|
||||
LOG_I(NR_MAC,"Modified UE_id %d/%x with CellGroup\n",UE_id,rnti);
|
||||
process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]);
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -53,40 +53,83 @@
|
||||
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "executables/nr-softmodem.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
|
||||
|
||||
void clear_mac_stats(gNB_MAC_INST *gNB) {
|
||||
memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t));
|
||||
}
|
||||
|
||||
#define MACSTATSSTRLEN 16384
|
||||
void dump_mac_stats(gNB_MAC_INST *gNB)
|
||||
{
|
||||
NR_UE_info_t *UE_info = &gNB->UE_info;
|
||||
int num = 1;
|
||||
FILE *fd=fopen("nrMAC_stats.log","w");
|
||||
AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno));
|
||||
char output[MACSTATSSTRLEN];
|
||||
memset(output,0,MACSTATSSTRLEN);
|
||||
int stroff=0;
|
||||
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) {
|
||||
LOG_I(MAC, "UE ID %d RNTI %04x (%d/%d)\n", UE_id, UE_info->rnti[UE_id], num++, UE_info->num_UEs);
|
||||
const NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
LOG_I(MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d\n",
|
||||
stroff = sprintf(output,"UE ID %d RNTI %04x (%d/%d)\n", UE_id, UE_info->rnti[UE_id], num++, UE_info->num_UEs);
|
||||
LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n",
|
||||
UE_id,
|
||||
UE_info->rnti[UE_id],
|
||||
num++,
|
||||
UE_info->num_UEs,
|
||||
UE_info->UE_sched_ctrl[UE_id].ph,
|
||||
UE_info->UE_sched_ctrl[UE_id].pcmax);
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0;
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n",
|
||||
UE_id,
|
||||
stats->dlsch_rounds[0], stats->dlsch_rounds[1],
|
||||
stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors);
|
||||
LOG_I(MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
|
||||
LOG_I(MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d\n",
|
||||
stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors,
|
||||
avg_rsrp, stats->num_rsrp_meas);
|
||||
LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n",
|
||||
UE_id,
|
||||
stats->dlsch_rounds[0], stats->dlsch_rounds[1],
|
||||
stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors,
|
||||
avg_rsrp, stats->num_rsrp_meas);
|
||||
stats->num_rsrp_meas = 0;
|
||||
stats->cumul_rsrp = 0 ;
|
||||
stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
|
||||
stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n",
|
||||
UE_id,
|
||||
stats->ulsch_rounds[0], stats->ulsch_rounds[1],
|
||||
stats->ulsch_rounds[2], stats->ulsch_rounds[3],
|
||||
stats->ulsch_DTX,
|
||||
stats->ulsch_errors);
|
||||
stroff+=sprintf(output+stroff,
|
||||
"UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n",
|
||||
UE_id,
|
||||
stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx);
|
||||
LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
|
||||
LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n",
|
||||
UE_id,
|
||||
stats->ulsch_rounds[0], stats->ulsch_rounds[1],
|
||||
stats->ulsch_rounds[2], stats->ulsch_rounds[3], stats->ulsch_errors);
|
||||
LOG_I(MAC,
|
||||
stats->ulsch_rounds[2], stats->ulsch_rounds[3],
|
||||
stats->ulsch_DTX,
|
||||
stats->ulsch_errors);
|
||||
LOG_I(NR_MAC,
|
||||
"UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n",
|
||||
UE_id,
|
||||
stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx);
|
||||
for (int lc_id = 0; lc_id < 63; lc_id++) {
|
||||
if (stats->lc_bytes_tx[lc_id] > 0)
|
||||
LOG_I(MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]);
|
||||
stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]);
|
||||
LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]);
|
||||
if (stats->lc_bytes_rx[lc_id] > 0)
|
||||
LOG_I(MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]);
|
||||
stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]);
|
||||
LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]);
|
||||
}
|
||||
}
|
||||
print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL);
|
||||
if (stroff>0) fprintf(fd,"%s",output);
|
||||
fclose(fd);
|
||||
}
|
||||
|
||||
void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
@@ -300,15 +343,16 @@ void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subfram
|
||||
|
||||
|
||||
bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) {
|
||||
if (slot>=64) return false; //quickfix for FR2 where there are more than 64 slots (bitmap to be removed)
|
||||
return (bitmap >> slot) & 0x01;
|
||||
}
|
||||
|
||||
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
frame_t frame,
|
||||
sub_frame_t slot){
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
protocol_ctxt_t ctxt={0};
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP);
|
||||
int nb_periods_per_frame;
|
||||
|
||||
const int bwp_id = 1;
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
@@ -320,48 +364,18 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
NR_COMMON_channels_t *cc = gNB->common_channels;
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
NR_TDD_UL_DL_Pattern_t *tdd_pattern = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
|
||||
switch(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity) {
|
||||
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 %ld\n", scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
|
||||
if (slot==0 && (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]>=257)) {
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
||||
const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
|
||||
const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
|
||||
const int nb_periods_per_frame = n / nr_slots_period;
|
||||
// re-initialization of tdd_beam_association at beginning of frame (only for FR2)
|
||||
for (int i=0; i<nb_periods_per_frame; i++)
|
||||
gNB->tdd_beam_association[i] = -1;
|
||||
}
|
||||
|
||||
int num_slots_per_tdd = (nr_slots_per_frame[*scc->ssbSubcarrierSpacing])/nb_periods_per_frame;
|
||||
|
||||
const int nr_ulmix_slots = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0);
|
||||
start_meas(&RC.nrmac[module_idP]->eNB_scheduler);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
|
||||
|
||||
@@ -369,22 +383,13 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
/* send tick to RLC and RRC every ms */
|
||||
if ((slot & ((1 << *scc->ssbSubcarrierSpacing) - 1)) == 0) {
|
||||
void nr_rlc_tick(int frame, int subframe);
|
||||
void nr_pdcp_tick(int frame, int subframe);
|
||||
nr_rlc_tick(frame, slot >> *scc->ssbSubcarrierSpacing);
|
||||
nr_pdcp_tick(frame, slot >> *scc->ssbSubcarrierSpacing);
|
||||
nr_rrc_trigger(&ctxt, 0 /*CC_id*/, frame, slot >> *scc->ssbSubcarrierSpacing);
|
||||
}
|
||||
|
||||
#define BIT(x) (1 << (x))
|
||||
const uint64_t dlsch_in_slot_bitmap = BIT( 1) | BIT( 2) | BIT( 3) | BIT( 4) | BIT( 5) | BIT( 6)
|
||||
| BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(15) | BIT(16);
|
||||
|
||||
uint8_t prach_config_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex;
|
||||
uint64_t ulsch_in_slot_bitmap;
|
||||
if (prach_config_index==4) //this is the PRACH config used in the Benetel RRU. TODO: make this generic for any PRACH config.
|
||||
ulsch_in_slot_bitmap = BIT( 8) | BIT( 9);
|
||||
else
|
||||
ulsch_in_slot_bitmap = BIT( 8) | BIT(18);
|
||||
|
||||
memset(RC.nrmac[module_idP]->cce_list[bwp_id][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0
|
||||
memset(RC.nrmac[module_idP]->cce_list[0][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0
|
||||
memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info;
|
||||
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id])
|
||||
@@ -408,7 +413,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
|
||||
// This schedules MIB
|
||||
schedule_nr_mib(module_idP, frame, slot, nr_slots_per_frame[*scc->ssbSubcarrierSpacing]);
|
||||
schedule_nr_mib(module_idP, frame, slot);
|
||||
|
||||
// This schedules SIB1
|
||||
if ( get_softmodem_params()->sa == 1 )
|
||||
@@ -430,7 +435,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
}
|
||||
|
||||
// This schedule SR
|
||||
// TODO
|
||||
nr_sr_reporting(module_idP, frame, slot);
|
||||
|
||||
// Schedule CSI-RS transmission
|
||||
nr_csirs_scheduling(module_idP, frame, slot, nr_slots_per_frame[*scc->ssbSubcarrierSpacing]);
|
||||
|
||||
// Schedule CSI measurement reporting: check in slot 0 for the whole frame
|
||||
if (slot == 0)
|
||||
@@ -443,18 +451,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
}
|
||||
|
||||
// This schedules the DCI for Uplink and subsequently PUSCH
|
||||
{
|
||||
if (NFAPI_MODE == NFAPI_MODE_VNF) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
gNB->UL_tti_req_ahead[0][i].SFN = frame;
|
||||
}
|
||||
gNB->UL_tti_req[0] = &gNB->UL_tti_req_ahead[0][slot];
|
||||
}
|
||||
nr_schedule_ulsch(module_idP, frame, slot, num_slots_per_tdd, nr_ulmix_slots, ulsch_in_slot_bitmap);
|
||||
}
|
||||
nr_schedule_ulsch(module_idP, frame, slot);
|
||||
|
||||
// This schedules the DCI for Downlink and PDSCH
|
||||
if (is_xlsch_in_slot(dlsch_in_slot_bitmap, slot))
|
||||
nr_schedule_ue_spec(module_idP, frame, slot);
|
||||
nr_schedule_ue_spec(module_idP, frame, slot);
|
||||
|
||||
nr_schedule_pucch(module_idP, frame, slot);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -53,26 +53,12 @@
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern uint8_t SSB_Table[38];
|
||||
|
||||
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, uint8_t slots_per_frame){
|
||||
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
NR_COMMON_channels_t *cc;
|
||||
|
||||
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;
|
||||
uint16_t get_ssboffset_pointa(NR_ServingCellConfigCommon_t *scc,const long band) {
|
||||
|
||||
int mib_sdu_length;
|
||||
int CC_id;
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
cc = &gNB->common_channels[CC_id];
|
||||
const long band = *cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
const uint32_t ssb_offset0 = *cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - cc->ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
|
||||
int ratio;
|
||||
switch (*cc->ServingCellConfigCommon->ssbSubcarrierSpacing) {
|
||||
int ratio;
|
||||
switch (*scc->ssbSubcarrierSpacing) {
|
||||
case NR_SubcarrierSpacing_kHz15:
|
||||
AssertFatal(band <= 79,
|
||||
"Band %ld is not possible for SSB with 15 kHz SCS\n",
|
||||
@@ -105,116 +91,206 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "SCS %ld not allowed for SSB \n",
|
||||
*cc->ServingCellConfigCommon->ssbSubcarrierSpacing);
|
||||
*scc->ssbSubcarrierSpacing);
|
||||
}
|
||||
|
||||
const uint32_t ssb_offset0 = *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
|
||||
|
||||
return (ssb_offset0/(ratio*12) - 10); // absoluteFrequencySSB is the center of SSB
|
||||
|
||||
}
|
||||
|
||||
|
||||
void schedule_ssb(frame_t frame, sub_frame_t slot,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req,
|
||||
int i_ssb, uint8_t scoffset, uint16_t offset_pointa, uint32_t payload) {
|
||||
|
||||
uint8_t beam_index = 0;
|
||||
nfapi_nr_dl_tti_request_pdu_t *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);
|
||||
|
||||
AssertFatal(scc->physCellId!=NULL,"ServingCellConfigCommon->physCellId is null\n");
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.PhysCellId = *scc->physCellId;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.BetaPss = 0;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = i_ssb;
|
||||
AssertFatal(scc->downlinkConfigCommon!=NULL,"scc->downlinkConfigCommonL is null\n");
|
||||
AssertFatal(scc->downlinkConfigCommon->frequencyInfoDL!=NULL,"scc->downlinkConfigCommon->frequencyInfoDL is null\n");
|
||||
AssertFatal(scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB!=NULL,"scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB is null\n");
|
||||
AssertFatal(scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.count==1,"Frequency Band list does not have 1 element (%d)\n",
|
||||
scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.count);
|
||||
AssertFatal(scc->ssbSubcarrierSpacing,"ssbSubcarrierSpacing is null\n");
|
||||
AssertFatal(scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],"band is null\n");
|
||||
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = scoffset; //kSSB
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA = offset_pointa;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag = 1;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload = payload;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.precoding_and_beamforming.num_prgs=1;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.precoding_and_beamforming.prg_size=275; //1 PRG of max size for analogue beamforming
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.precoding_and_beamforming.dig_bf_interfaces=1;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.precoding_and_beamforming.prgs_list[0].pm_idx = 0;
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.precoding_and_beamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx = beam_index;
|
||||
dl_req->nPDUs++;
|
||||
|
||||
LOG_D(MAC,"Scheduling ssb %d at frame %d and slot %d\n",i_ssb,frame,slot);
|
||||
|
||||
}
|
||||
|
||||
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_tti_request_t *dl_tti_request;
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req;
|
||||
NR_MIB_t *mib = RC.nrrrc[module_idP]->carrier.mib.message.choice.mib;
|
||||
uint8_t num_tdd_period,num_ssb;
|
||||
int mib_sdu_length;
|
||||
int CC_id;
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
cc = &gNB->common_channels[CC_id];
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
const int slots_per_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
||||
dl_tti_request = &gNB->DL_req[CC_id];
|
||||
dl_req = &dl_tti_request->dl_tti_request_body;
|
||||
|
||||
// get MIB every 8 frames
|
||||
if(((slotP == 0) && (frameP & 7) == 0) ||
|
||||
gNB->first_MIB) {
|
||||
|
||||
mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 0, 1, &cc->MIB_pdu.payload[0]);
|
||||
|
||||
// flag to avoid sending an empty MIB in the first frames of execution since gNB doesn't get at the beginning in frame 0 slot 0
|
||||
gNB->first_MIB = false;
|
||||
|
||||
LOG_D(MAC,
|
||||
"[gNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
CC_id,
|
||||
mib_sdu_length);
|
||||
}
|
||||
|
||||
// scheduling MIB every 8 frames, PHY repeats it in between
|
||||
if((slotP == 0) && (frameP & 7) == 0) {
|
||||
dl_tti_request = &gNB->DL_req[CC_id];
|
||||
dl_req = &dl_tti_request->dl_tti_request_body;
|
||||
int8_t ssb_period = *scc->ssb_periodicityServingCell;
|
||||
uint8_t ssb_frame_periodicity = 1; // every how many frames SSB are generated
|
||||
|
||||
mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 1, &cc->MIB_pdu.payload[0]);
|
||||
if (ssb_period > 1) // 0 is every half frame
|
||||
ssb_frame_periodicity = 1 << (ssb_period -1);
|
||||
|
||||
LOG_D(MAC, "Frame %d, slot %d: BCH PDU length %d\n", frameP, slotP, mib_sdu_length);
|
||||
if (!(frameP%ssb_frame_periodicity) &&
|
||||
((slotP<(slots_per_frame>>1)) || (ssb_period == 0))) {
|
||||
// schedule SSB only for given frames according to SSB periodicity
|
||||
// and in first half frame unless periodicity of 5ms
|
||||
int rel_slot;
|
||||
if (ssb_period == 0) // scheduling every half frame
|
||||
rel_slot = slotP%(slots_per_frame>>1);
|
||||
else
|
||||
rel_slot = 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->nPDUs,
|
||||
mib_sdu_length);
|
||||
NR_SubcarrierSpacing_t scs = *scc->ssbSubcarrierSpacing;
|
||||
const long band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
uint16_t offset_pointa = get_ssboffset_pointa(scc,band);
|
||||
uint8_t ssbSubcarrierOffset = gNB->ssb_SubcarrierOffset;
|
||||
|
||||
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);
|
||||
}
|
||||
const BIT_STRING_t *shortBitmap = &scc->ssb_PositionsInBurst->choice.shortBitmap;
|
||||
const BIT_STRING_t *mediumBitmap = &scc->ssb_PositionsInBurst->choice.mediumBitmap;
|
||||
const BIT_STRING_t *longBitmap = &scc->ssb_PositionsInBurst->choice.longBitmap;
|
||||
|
||||
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);
|
||||
uint16_t ssb_start_symbol;
|
||||
|
||||
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");
|
||||
|
||||
const nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[module_idP]->config[0];
|
||||
dl_config_pdu->ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = cfg->ssb_table.ssb_subcarrier_offset.value; //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++;
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1:
|
||||
// short bitmap (<3GHz) max 4 SSBs
|
||||
for (int i_ssb=0; i_ssb<4; i_ssb++) {
|
||||
if ((shortBitmap->buf[0]>>(7-i_ssb))&0x01) {
|
||||
ssb_start_symbol = get_ssb_start_symbol(band,scs,i_ssb);
|
||||
// if start symbol is in current slot, schedule current SSB, fill VRB map and call get_type0_PDCCH_CSS_config_parameters
|
||||
if ((ssb_start_symbol/14) == rel_slot){
|
||||
schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, ssbSubcarrierOffset, offset_pointa, (*(uint32_t*)cc->MIB_pdu.payload) & ((1<<24)-1));
|
||||
fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id);
|
||||
if (get_softmodem_params()->sa == 1) {
|
||||
get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb],
|
||||
frameP,
|
||||
mib,
|
||||
slots_per_frame,
|
||||
ssbSubcarrierOffset,
|
||||
ssb_start_symbol,
|
||||
scs,
|
||||
FR1,
|
||||
i_ssb,
|
||||
offset_pointa);
|
||||
gNB->type0_PDCCH_CSS_config[i_ssb].active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// medium bitmap (<6GHz) max 8 SSBs
|
||||
for (int i_ssb=0; i_ssb<8; i_ssb++) {
|
||||
if ((mediumBitmap->buf[0]>>(7-i_ssb))&0x01) {
|
||||
ssb_start_symbol = get_ssb_start_symbol(band,scs,i_ssb);
|
||||
// if start symbol is in current slot, schedule current SSB, fill VRB map and call get_type0_PDCCH_CSS_config_parameters
|
||||
if ((ssb_start_symbol/14) == rel_slot){
|
||||
schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, ssbSubcarrierOffset, offset_pointa, (*(uint32_t*)cc->MIB_pdu.payload) & ((1<<24)-1));
|
||||
fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id);
|
||||
if (get_softmodem_params()->sa == 1) {
|
||||
get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb],
|
||||
frameP,
|
||||
mib,
|
||||
slots_per_frame,
|
||||
ssbSubcarrierOffset,
|
||||
ssb_start_symbol,
|
||||
scs,
|
||||
FR1,
|
||||
i_ssb,
|
||||
offset_pointa);
|
||||
gNB->type0_PDCCH_CSS_config[i_ssb].active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// long bitmap FR2 max 64 SSBs
|
||||
num_ssb = 0;
|
||||
for (int i_ssb=0; i_ssb<64; i_ssb++) {
|
||||
if ((longBitmap->buf[i_ssb/8]>>(7-(i_ssb%8)))&0x01) {
|
||||
ssb_start_symbol = get_ssb_start_symbol(band,scs,i_ssb);
|
||||
// if start symbol is in current slot, schedule current SSB, fill VRB map and call get_type0_PDCCH_CSS_config_parameters
|
||||
if ((ssb_start_symbol/14) == rel_slot){
|
||||
schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, ssbSubcarrierOffset, offset_pointa, (*(uint32_t*)cc->MIB_pdu.payload) & ((1<<24)-1));
|
||||
fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id);
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
|
||||
const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
|
||||
num_tdd_period = rel_slot/nr_slots_period;
|
||||
gNB->tdd_beam_association[num_tdd_period]=i_ssb;
|
||||
num_ssb++;
|
||||
AssertFatal(num_ssb<2,"beamforming currently not supported for more than one SSB per slot\n");
|
||||
if (get_softmodem_params()->sa == 1) {
|
||||
get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb],
|
||||
frameP,
|
||||
mib,
|
||||
slots_per_frame,
|
||||
ssbSubcarrierOffset,
|
||||
ssb_start_symbol,
|
||||
scs,
|
||||
FR2,
|
||||
i_ssb,
|
||||
offset_pointa);
|
||||
gNB->type0_PDCCH_CSS_config[i_ssb].active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0,"SSB bitmap size value %d undefined (allowed values 1,2,3)\n",
|
||||
scc->ssb_PositionsInBurst->present);
|
||||
}
|
||||
|
||||
// Get type0_PDCCH_CSS_config parameters
|
||||
NR_DL_FRAME_PARMS *frame_parms = &RC.gNB[module_idP]->frame_parms;
|
||||
NR_MIB_t *mib = RC.nrrrc[module_idP]->carrier.mib.message.choice.mib;
|
||||
uint8_t gNB_xtra_byte = 0;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
gNB_xtra_byte |= ((RC.gNB[module_idP]->pbch.pbch_a >> (31 - i)) & 1) << (7 - i);
|
||||
}
|
||||
get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config, mib, gNB_xtra_byte, frame_parms->Lmax,
|
||||
frame_parms->ssb_index, frame_parms->ssb_start_subcarrier/NR_NB_SC_PER_RB);
|
||||
|
||||
}
|
||||
|
||||
// checking if there is any SSB in slot
|
||||
const int abs_slot = (slots_per_frame * frameP) + slotP;
|
||||
const int slot_per_period = (slots_per_frame>>1)<<(*cc->ServingCellConfigCommon->ssb_periodicityServingCell);
|
||||
int eff_120_slot;
|
||||
const BIT_STRING_t *shortBitmap = &cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.shortBitmap;
|
||||
const BIT_STRING_t *mediumBitmap = &cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.mediumBitmap;
|
||||
const BIT_STRING_t *longBitmap = &cc->ServingCellConfigCommon->ssb_PositionsInBurst->choice.longBitmap;
|
||||
uint8_t buf = 0;
|
||||
switch (cc->ServingCellConfigCommon->ssb_PositionsInBurst->present) {
|
||||
case 1:
|
||||
// presence of ssbs possible in the first 2 slots of ssb period
|
||||
if ((abs_slot % slot_per_period) < 2 &&
|
||||
(((shortBitmap->buf[0]) >> (6 - (slotP << 1))) & 3) != 0)
|
||||
fill_ssb_vrb_map(cc, (ssb_offset0 / (ratio * 12) - 10), CC_id);
|
||||
break;
|
||||
case 2:
|
||||
// presence of ssbs possible in the first 4 slots of ssb period
|
||||
if ((abs_slot % slot_per_period) < 4 &&
|
||||
(((mediumBitmap->buf[0]) >> (6 - (slotP << 1))) & 3) != 0)
|
||||
fill_ssb_vrb_map(cc, (ssb_offset0 / (ratio * 12) - 10), CC_id);
|
||||
break;
|
||||
case 3:
|
||||
AssertFatal(*cc->ServingCellConfigCommon->ssbSubcarrierSpacing ==
|
||||
NR_SubcarrierSpacing_kHz120,
|
||||
"240kHZ subcarrier spacing currently not supported for SSBs\n");
|
||||
if ((abs_slot % slot_per_period) < 8) {
|
||||
eff_120_slot = slotP;
|
||||
buf = longBitmap->buf[0];
|
||||
} else if ((abs_slot % slot_per_period) < 17) {
|
||||
eff_120_slot = slotP - 9;
|
||||
buf = longBitmap->buf[1];
|
||||
} else if ((abs_slot % slot_per_period) < 26) {
|
||||
eff_120_slot = slotP - 18;
|
||||
buf = longBitmap->buf[2];
|
||||
} else if ((abs_slot % slot_per_period) < 35) {
|
||||
eff_120_slot = slotP - 27;
|
||||
buf = longBitmap->buf[3];
|
||||
}
|
||||
if (((buf >> (6 - (eff_120_slot << 1))) & 3) != 0)
|
||||
fill_ssb_vrb_map(cc, ssb_offset0 / (ratio * 12) - 10, CC_id);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0,
|
||||
"SSB bitmap size value %d undefined (allowed values 1,2,3)\n",
|
||||
cc->ServingCellConfigCommon->ssb_PositionsInBurst->present);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,17 +300,26 @@ void schedule_nr_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframe
|
||||
//----------------------------------------
|
||||
}
|
||||
|
||||
void fill_ssb_vrb_map (NR_COMMON_channels_t *cc, int rbStart, int CC_id) {
|
||||
void fill_ssb_vrb_map (NR_COMMON_channels_t *cc, int rbStart, uint16_t symStart, int CC_id) {
|
||||
|
||||
AssertFatal(*cc->ServingCellConfigCommon->ssbSubcarrierSpacing !=
|
||||
NR_SubcarrierSpacing_kHz240,
|
||||
"240kHZ subcarrier won't work with current VRB map because a single SSB might be across 2 slots\n");
|
||||
|
||||
uint16_t *vrb_map = cc[CC_id].vrb_map;
|
||||
|
||||
for (int rb = 0; rb < 20; rb++)
|
||||
vrb_map[rbStart + rb] = 1;
|
||||
vrb_map[rbStart + rb] = 15<<symStart;
|
||||
|
||||
}
|
||||
|
||||
void schedule_control_sib1(module_id_t module_id,
|
||||
int CC_id,
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config,
|
||||
int time_domain_allocation,
|
||||
uint8_t mcsTableIdx,
|
||||
uint8_t mcs,
|
||||
uint8_t candidate_idx,
|
||||
int num_total_bytes) {
|
||||
|
||||
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
|
||||
@@ -242,20 +327,19 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map;
|
||||
|
||||
if (gNB_mac->sched_ctrlCommon == NULL){
|
||||
LOG_D(NR_MAC,"schedule_control_common: Filling nr_mac->sched_ctrlCommon\n");
|
||||
gNB_mac->sched_ctrlCommon = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon));
|
||||
gNB_mac->sched_ctrlCommon->search_space = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->search_space));
|
||||
gNB_mac->sched_ctrlCommon->active_bwp = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->active_bwp));
|
||||
gNB_mac->sched_ctrlCommon->coreset = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->coreset));
|
||||
gNB_mac->sched_ctrlCommon->active_bwp = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->active_bwp));
|
||||
fill_default_searchSpaceZero(gNB_mac->sched_ctrlCommon->search_space);
|
||||
fill_default_coresetZero(gNB_mac->sched_ctrlCommon->coreset,servingcellconfigcommon);
|
||||
fill_default_initialDownlinkBWP(gNB_mac->sched_ctrlCommon->active_bwp,servingcellconfigcommon);
|
||||
}
|
||||
gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL;
|
||||
|
||||
gNB_mac->sched_ctrlCommon->time_domain_allocation = time_domain_allocation;
|
||||
gNB_mac->sched_ctrlCommon->mcsTableIdx = mcsTableIdx;
|
||||
gNB_mac->sched_ctrlCommon->mcs = mcs;
|
||||
gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation = time_domain_allocation;
|
||||
gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx = mcsTableIdx;
|
||||
gNB_mac->sched_ctrlCommon->sched_pdsch.mcs = mcs;
|
||||
gNB_mac->sched_ctrlCommon->num_total_bytes = num_total_bytes;
|
||||
|
||||
uint8_t nr_of_candidates;
|
||||
@@ -266,70 +350,77 @@ void schedule_control_sib1(module_id_t module_id,
|
||||
gNB_mac->sched_ctrlCommon->coreset,
|
||||
gNB_mac->sched_ctrlCommon->aggregation_level,
|
||||
0,
|
||||
0,
|
||||
candidate_idx,
|
||||
nr_of_candidates);
|
||||
|
||||
if (gNB_mac->sched_ctrlCommon->cce_index < 0) {
|
||||
LOG_E(MAC, "%s(): could not find CCE for coreset0\n", __func__);
|
||||
return;
|
||||
AssertFatal(gNB_mac->sched_ctrlCommon->cce_index >= 0, "Could not find CCE for coreset0\n");
|
||||
|
||||
const uint16_t bwpSize = type0_PDCCH_CSS_config->num_rbs;
|
||||
int rbStart = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
|
||||
int startSymbolIndex = 0;
|
||||
int nrOfSymbols = 0;
|
||||
|
||||
if(gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position == 0) {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][2];
|
||||
} else {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][2];
|
||||
}
|
||||
|
||||
const uint16_t bwpSize = gNB_mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
int rbStart = gNB_mac->type0_PDCCH_CSS_config.cset_start_rb;
|
||||
|
||||
// Calculate number of symbols
|
||||
struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = gNB_mac->sched_ctrlCommon->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
const int startSymbolAndLength = tdaList->list.array[gNB_mac->sched_ctrlCommon->time_domain_allocation]->startSymbolAndLength;
|
||||
int startSymbolIndex, nrOfSymbols;
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C)
|
||||
int mappingtype = (startSymbolIndex <= 3)? typeA: typeB;
|
||||
|
||||
if (nrOfSymbols == 2) {
|
||||
gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData = 1;
|
||||
gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData = 1;
|
||||
} else {
|
||||
gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData = 2;
|
||||
gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData = 2;
|
||||
}
|
||||
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, startSymbolIndex+nrOfSymbols);
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
LOG_D(MAC,"dlDmrsSymbPos %x\n",dlDmrsSymbPos);
|
||||
int rbSize = 0;
|
||||
uint32_t TBS = 0;
|
||||
do {
|
||||
rbSize++;
|
||||
TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->mcs, gNB_mac->sched_ctrlCommon->mcsTableIdx),
|
||||
nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->mcs, gNB_mac->sched_ctrlCommon->mcsTableIdx),
|
||||
TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx),
|
||||
nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx),
|
||||
rbSize, nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3;
|
||||
} while (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize] && TBS < gNB_mac->sched_ctrlCommon->num_total_bytes);
|
||||
|
||||
// FIXME: Something is not working in nr_modulation() for TBS = 84, so we need to skip it
|
||||
} while ( (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize] && TBS < gNB_mac->sched_ctrlCommon->num_total_bytes) || (TBS==84) );
|
||||
gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize = rbSize;
|
||||
gNB_mac->sched_ctrlCommon->sched_pdsch.rbStart = 0;
|
||||
|
||||
gNB_mac->sched_ctrlCommon->rbSize = rbSize;
|
||||
gNB_mac->sched_ctrlCommon->rbStart = 0;
|
||||
|
||||
LOG_D(MAC,"SLIV = %i\n", startSymbolAndLength);
|
||||
LOG_D(MAC,"startSymbolIndex = %i\n", startSymbolIndex);
|
||||
LOG_D(MAC,"nrOfSymbols = %i\n", nrOfSymbols);
|
||||
LOG_D(MAC,"rbSize = %i\n", gNB_mac->sched_ctrlCommon->rbSize);
|
||||
LOG_D(MAC, "rbSize = %i\n", gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize);
|
||||
LOG_D(MAC,"TBS = %i\n", TBS);
|
||||
LOG_D(MAC,"dmrs_length %d\n",dmrs_length);
|
||||
LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS);
|
||||
LOG_D(MAC,"mappingtype = %d\n", mappingtype);
|
||||
|
||||
// Mark the corresponding RBs as used
|
||||
for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->rbSize; rb++) {
|
||||
for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) {
|
||||
vrb_map[rb + rbStart] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req,
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config,
|
||||
uint32_t TBS,
|
||||
int StartSymbolIndex,
|
||||
int NrOfSymbols) {
|
||||
int NrOfSymbols,
|
||||
uint16_t dlDmrsSymbPos) {
|
||||
|
||||
gNB_MAC_INST *gNB_mac = RC.nrmac[Mod_idP];
|
||||
NR_COMMON_channels_t *cc = gNB_mac->common_channels;
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = gNB_mac->secondaryCellGroupCommon;
|
||||
NR_BWP_Downlink_t *bwp = gNB_mac->sched_ctrlCommon->active_bwp;
|
||||
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||
@@ -344,6 +435,10 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
scc,
|
||||
bwp);
|
||||
|
||||
// TODO: This assignment should be done in function nr_configure_pdcch()
|
||||
pdcch_pdu_rel15->BWPSize = type0_PDCCH_CSS_config->num_rbs;
|
||||
pdcch_pdu_rel15->BWPStart = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||
memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||
dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE;
|
||||
@@ -357,8 +452,8 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
pdsch_pdu_rel15->rnti = SI_RNTI;
|
||||
pdsch_pdu_rel15->pduIndex = gNB_mac->pdu_index[0]++;
|
||||
|
||||
pdsch_pdu_rel15->BWPSize = gNB_mac->type0_PDCCH_CSS_config.num_rbs;
|
||||
pdsch_pdu_rel15->BWPStart = gNB_mac->type0_PDCCH_CSS_config.cset_start_rb;
|
||||
pdsch_pdu_rel15->BWPSize = type0_PDCCH_CSS_config->num_rbs;
|
||||
pdsch_pdu_rel15->BWPStart = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
|
||||
pdsch_pdu_rel15->SubcarrierSpacing = bwp->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
if (bwp->bwp_Common->genericParameters.cyclicPrefix) {
|
||||
@@ -368,32 +463,31 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
}
|
||||
|
||||
pdsch_pdu_rel15->NrOfCodewords = 1;
|
||||
pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->mcs,0);
|
||||
pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, 0);
|
||||
pdsch_pdu_rel15->qamModOrder[0] = 2;
|
||||
pdsch_pdu_rel15->mcsIndex[0] = gNB_mac->sched_ctrlCommon->mcs;
|
||||
pdsch_pdu_rel15->mcsIndex[0] = gNB_mac->sched_ctrlCommon->sched_pdsch.mcs;
|
||||
pdsch_pdu_rel15->mcsTable[0] = 0;
|
||||
pdsch_pdu_rel15->rvIndex[0] = nr_rv_round_map[0];
|
||||
pdsch_pdu_rel15->dataScramblingId = *scc->physCellId;
|
||||
pdsch_pdu_rel15->nrOfLayers = 1;
|
||||
pdsch_pdu_rel15->transmissionScheme = 0;
|
||||
pdsch_pdu_rel15->refPoint = 1;
|
||||
pdsch_pdu_rel15->dmrsConfigType = gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
|
||||
pdsch_pdu_rel15->dmrsConfigType = 0;
|
||||
pdsch_pdu_rel15->dlDmrsScramblingId = *scc->physCellId;
|
||||
pdsch_pdu_rel15->SCID = 0;
|
||||
pdsch_pdu_rel15->numDmrsCdmGrpsNoData = gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData;
|
||||
pdsch_pdu_rel15->numDmrsCdmGrpsNoData = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData;
|
||||
pdsch_pdu_rel15->dmrsPorts = 1;
|
||||
pdsch_pdu_rel15->resourceAlloc = 1;
|
||||
pdsch_pdu_rel15->rbStart = gNB_mac->sched_ctrlCommon->rbStart;
|
||||
pdsch_pdu_rel15->rbSize = gNB_mac->sched_ctrlCommon->rbSize;
|
||||
pdsch_pdu_rel15->rbStart = gNB_mac->sched_ctrlCommon->sched_pdsch.rbStart;
|
||||
pdsch_pdu_rel15->rbSize = gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize;
|
||||
pdsch_pdu_rel15->VRBtoPRBMapping = 0;
|
||||
pdsch_pdu_rel15->qamModOrder[0] = nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->mcs, gNB_mac->sched_ctrlCommon->mcsTableIdx);
|
||||
pdsch_pdu_rel15->qamModOrder[0] = nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs,
|
||||
gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx);
|
||||
pdsch_pdu_rel15->TBSize[0] = TBS;
|
||||
pdsch_pdu_rel15->mcsTable[0] = gNB_mac->sched_ctrlCommon->mcsTableIdx;
|
||||
pdsch_pdu_rel15->mcsTable[0] = gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx;
|
||||
pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex;
|
||||
pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols;
|
||||
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(bwp->bwp_Dedicated->pdsch_Config->choice.setup, scc->dmrs_TypeA_Position, pdsch_pdu_rel15->StartSymbolIndex+pdsch_pdu_rel15->NrOfSymbols);
|
||||
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = dlDmrsSymbPos;
|
||||
LOG_D(MAC,"dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos);
|
||||
|
||||
/* Fill PDCCH DL DCI PDU */
|
||||
@@ -415,10 +509,10 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
|
||||
// frequency domain assignment
|
||||
dci_payload.frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(
|
||||
pdsch_pdu_rel15->rbSize, pdsch_pdu_rel15->rbStart, gNB_mac->type0_PDCCH_CSS_config.num_rbs);
|
||||
pdsch_pdu_rel15->rbSize, pdsch_pdu_rel15->rbStart, type0_PDCCH_CSS_config->num_rbs);
|
||||
|
||||
dci_payload.time_domain_assignment.val = gNB_mac->sched_ctrlCommon->time_domain_allocation;
|
||||
dci_payload.mcs = gNB_mac->sched_ctrlCommon->mcs;
|
||||
dci_payload.time_domain_assignment.val = gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation;
|
||||
dci_payload.mcs = gNB_mac->sched_ctrlCommon->sched_pdsch.mcs;
|
||||
dci_payload.rv = pdsch_pdu_rel15->rvIndex[0];
|
||||
dci_payload.harq_pid = 0;
|
||||
dci_payload.ndi = 0;
|
||||
@@ -433,7 +527,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
int rnti_type = NR_RNTI_SI;
|
||||
|
||||
fill_dci_pdu_rel15(scc,
|
||||
secondaryCellGroup,
|
||||
NULL,
|
||||
&pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci - 1],
|
||||
&dci_payload,
|
||||
dci_format,
|
||||
@@ -460,61 +554,95 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
|
||||
|
||||
void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) {
|
||||
|
||||
LOG_D(MAC,"Schedule_nr_sib1: frameP = %i, slotP = %i\n", frameP, slotP);
|
||||
|
||||
// TODO: Get these values from RRC
|
||||
const int CC_id = 0;
|
||||
int time_domain_allocation = 0;
|
||||
uint8_t mcsTableIdx = 0;
|
||||
uint8_t mcs = 6;
|
||||
uint8_t candidate_idx = 0;
|
||||
|
||||
gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP];
|
||||
NR_ServingCellConfigCommon_t *scc = gNB_mac->common_channels[CC_id].ServingCellConfigCommon;
|
||||
|
||||
if( (frameP%2 == gNB_mac->type0_PDCCH_CSS_config.sfn_c) && (slotP == gNB_mac->type0_PDCCH_CSS_config.n_0) && (gNB_mac->type0_PDCCH_CSS_config.num_rbs > 0) ) {
|
||||
int L_max;
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1:
|
||||
L_max = 4;
|
||||
break;
|
||||
case 2:
|
||||
L_max = 8;
|
||||
break;
|
||||
case 3:
|
||||
L_max = 64;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0,"SSB bitmap size value %d undefined (allowed values 1,2,3)\n",
|
||||
scc->ssb_PositionsInBurst->present);
|
||||
}
|
||||
|
||||
LOG_D(MAC,"> SIB1 transmission\n");
|
||||
for (int i=0; i<L_max; i++) {
|
||||
|
||||
// Get SIB1
|
||||
uint8_t sib1_payload[NR_MAX_SIB_LENGTH/8];
|
||||
uint8_t sib1_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, BCCH, 1, sib1_payload);
|
||||
LOG_D(MAC,"sib1_sdu_length = %i\n", sib1_sdu_length);
|
||||
LOG_D(MAC,"SIB1: \n");
|
||||
for (int i=0;i<sib1_sdu_length;i++) LOG_D(MAC,"byte %d : %x\n",i,((uint8_t*)sib1_payload)[i]);
|
||||
NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config = &gNB_mac->type0_PDCCH_CSS_config[i];
|
||||
|
||||
// Configure sched_ctrlCommon for SIB1
|
||||
schedule_control_sib1(module_idP, CC_id, time_domain_allocation, mcsTableIdx, mcs, sib1_sdu_length);
|
||||
if((frameP%2 == type0_PDCCH_CSS_config->sfn_c) &&
|
||||
(slotP == type0_PDCCH_CSS_config->n_0) &&
|
||||
(type0_PDCCH_CSS_config->num_rbs > 0) &&
|
||||
(type0_PDCCH_CSS_config->active == true)) {
|
||||
|
||||
// Calculate number of symbols
|
||||
int startSymbolIndex, nrOfSymbols;
|
||||
struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = gNB_mac->sched_ctrlCommon->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
const int startSymbolAndLength = tdaList->list.array[gNB_mac->sched_ctrlCommon->time_domain_allocation]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
|
||||
LOG_D(NR_MAC,"(%d.%d) SIB1 transmission: ssb_index %d\n", frameP, slotP, type0_PDCCH_CSS_config->ssb_index);
|
||||
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(gNB_mac->sched_ctrlCommon->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, startSymbolIndex+nrOfSymbols);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
// Get SIB1
|
||||
uint8_t sib1_payload[NR_MAX_SIB_LENGTH/8];
|
||||
uint8_t sib1_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, BCCH, SI_RNTI, 1, sib1_payload);
|
||||
LOG_D(NR_MAC,"sib1_sdu_length = %i\n", sib1_sdu_length);
|
||||
LOG_D(NR_MAC,"SIB1: \n");
|
||||
for (int k=0;k<sib1_sdu_length;k++)
|
||||
LOG_D(NR_MAC,"byte %d : %x\n",k,((uint8_t*)sib1_payload)[k]);
|
||||
|
||||
const uint32_t TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->mcs, gNB_mac->sched_ctrlCommon->mcsTableIdx),
|
||||
nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->mcs, gNB_mac->sched_ctrlCommon->mcsTableIdx),
|
||||
gNB_mac->sched_ctrlCommon->rbSize, nrOfSymbols, N_PRB_DMRS * dmrs_length,0 ,0 ,1 ) >> 3;
|
||||
// Configure sched_ctrlCommon for SIB1
|
||||
schedule_control_sib1(module_idP, CC_id, type0_PDCCH_CSS_config, time_domain_allocation, mcsTableIdx, mcs, candidate_idx, sib1_sdu_length);
|
||||
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
||||
nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, TBS, startSymbolIndex, nrOfSymbols);
|
||||
int startSymbolIndex = 0;
|
||||
int nrOfSymbols = 0;
|
||||
if(gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position == 0) {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][2];
|
||||
} else {
|
||||
startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][1];
|
||||
nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation][2];
|
||||
}
|
||||
|
||||
const int ntx_req = gNB_mac->TX_req[CC_id].Number_of_PDUs;
|
||||
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[ntx_req];
|
||||
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C)
|
||||
int mappingtype = (startSymbolIndex <= 3) ? typeA : typeB;
|
||||
|
||||
// Data to be transmitted
|
||||
bzero(tx_req->TLVs[0].value.direct,MAX_NR_DLSCH_PAYLOAD_BYTES);
|
||||
memcpy(tx_req->TLVs[0].value.direct, sib1_payload, sib1_sdu_length);
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype);
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
tx_req->PDU_length = TBS;
|
||||
tx_req->PDU_index = gNB_mac->pdu_index[0]++;
|
||||
tx_req->num_TLV = 1;
|
||||
tx_req->TLVs[0].length = TBS + 2;
|
||||
gNB_mac->TX_req[CC_id].Number_of_PDUs++;
|
||||
gNB_mac->TX_req[CC_id].SFN = frameP;
|
||||
gNB_mac->TX_req[CC_id].Slot = slotP;
|
||||
const uint32_t TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx),
|
||||
nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx),
|
||||
gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize, nrOfSymbols, N_PRB_DMRS * dmrs_length,0 ,0 ,1 ) >> 3;
|
||||
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
||||
nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, type0_PDCCH_CSS_config, TBS, startSymbolIndex, nrOfSymbols, dlDmrsSymbPos);
|
||||
|
||||
const int ntx_req = gNB_mac->TX_req[CC_id].Number_of_PDUs;
|
||||
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[ntx_req];
|
||||
|
||||
// Data to be transmitted
|
||||
bzero(tx_req->TLVs[0].value.direct,MAX_NR_DLSCH_PAYLOAD_BYTES);
|
||||
memcpy(tx_req->TLVs[0].value.direct, sib1_payload, sib1_sdu_length);
|
||||
|
||||
tx_req->PDU_length = TBS;
|
||||
tx_req->PDU_index = gNB_mac->pdu_index[0]++;
|
||||
tx_req->num_TLV = 1;
|
||||
tx_req->TLVs[0].length = TBS + 2;
|
||||
gNB_mac->TX_req[CC_id].Number_of_PDUs++;
|
||||
gNB_mac->TX_req[CC_id].SFN = frameP;
|
||||
gNB_mac->TX_req[CC_id].Slot = slotP;
|
||||
|
||||
type0_PDCCH_CSS_config->active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -146,15 +146,18 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
int startSymbolAndLength=0;
|
||||
int StartSymbolIndex=-1,NrOfSymbols=14;
|
||||
int StartSymbolIndex_tmp,NrOfSymbols_tmp;
|
||||
int mappingtype_tmp, mappingtype=0;
|
||||
|
||||
for (int i=0;
|
||||
i<scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;
|
||||
i++) {
|
||||
startSymbolAndLength = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength,&StartSymbolIndex_tmp,&NrOfSymbols_tmp);
|
||||
mappingtype_tmp = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType;
|
||||
if (NrOfSymbols_tmp < NrOfSymbols) {
|
||||
NrOfSymbols = NrOfSymbols_tmp;
|
||||
StartSymbolIndex = StartSymbolIndex_tmp;
|
||||
mappingtype = mappingtype_tmp;
|
||||
// k0 = *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0;
|
||||
// time_domain_assignment = i;
|
||||
}
|
||||
@@ -164,7 +167,9 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols;
|
||||
pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL,
|
||||
scc->dmrs_TypeA_Position,
|
||||
NrOfSymbols);
|
||||
NrOfSymbols,
|
||||
StartSymbolIndex,
|
||||
mappingtype);
|
||||
|
||||
/*
|
||||
AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n");
|
||||
@@ -254,14 +259,21 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
}
|
||||
}
|
||||
|
||||
extern int getNrOfSymbols(NR_BWP_Downlink_t *bwp, int tda);
|
||||
extern uint8_t getN_PRB_DMRS(NR_BWP_Downlink_t *bwp, int numDmrsCdmGrpsNoData);
|
||||
uint32_t target_dl_mcs = 9;
|
||||
uint32_t target_dl_Nl = 1;
|
||||
uint32_t target_dl_bw = 50;
|
||||
uint64_t dlsch_slot_bitmap = (1<<1);
|
||||
/* schedules whole bandwidth for first user, all the time */
|
||||
void nr_preprocessor_phytest(module_id_t module_id,
|
||||
frame_t frame,
|
||||
sub_frame_t slot)
|
||||
{
|
||||
if (slot != 1)
|
||||
if (!is_xlsch_in_slot(dlsch_slot_bitmap, slot))
|
||||
return;
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
|
||||
NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon;
|
||||
const int UE_id = 0;
|
||||
const int CC_id = 0;
|
||||
AssertFatal(UE_info->active[UE_id],
|
||||
@@ -272,24 +284,27 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
/* find largest unallocated chunk */
|
||||
const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
int rbStart = 0;
|
||||
int tStart = 0;
|
||||
int rbSize = 0;
|
||||
if (target_dl_bw>bwpSize)
|
||||
target_dl_bw = bwpSize;
|
||||
uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map;
|
||||
/* find largest unallocated RB region */
|
||||
do {
|
||||
/* loop ensures that we allocate exactly target_dl_bw, or return */
|
||||
while (true) {
|
||||
/* advance to first free RB */
|
||||
while (tStart < bwpSize && vrb_map[tStart])
|
||||
tStart++;
|
||||
/* find maximum rbSize at current rbStart */
|
||||
int tSize = 1;
|
||||
while (tStart + tSize < bwpSize && !vrb_map[tStart + tSize])
|
||||
tSize++;
|
||||
if (tSize > rbSize) {
|
||||
rbStart = tStart;
|
||||
rbSize = tSize;
|
||||
}
|
||||
tStart += tSize;
|
||||
} while (tStart < bwpSize);
|
||||
while (rbStart < bwpSize && vrb_map[rbStart])
|
||||
rbStart++;
|
||||
rbSize = 1;
|
||||
/* iterate until we are at target_dl_bw or no available RBs */
|
||||
while (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize] && rbSize < target_dl_bw)
|
||||
rbSize++;
|
||||
/* found target_dl_bw? */
|
||||
if (rbSize == target_dl_bw)
|
||||
break;
|
||||
/* at end and below target_dl_bw? */
|
||||
if (rbStart + rbSize >= bwpSize)
|
||||
return;
|
||||
rbStart += rbSize;
|
||||
}
|
||||
|
||||
sched_ctrl->num_total_bytes = 0;
|
||||
const int lcid = DL_SCH_LCID_DTCH;
|
||||
@@ -308,14 +323,10 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
0);
|
||||
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
|
||||
|
||||
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
|
||||
sched_ctrl->search_space = get_searchspace(sched_ctrl->active_bwp, target_ss);
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&sched_ctrl->aggregation_level,
|
||||
&nr_of_candidates,
|
||||
sched_ctrl->search_space);
|
||||
sched_ctrl->coreset = get_coreset(
|
||||
sched_ctrl->active_bwp, sched_ctrl->search_space, 1 /* dedicated */);
|
||||
const int cid = sched_ctrl->coreset->controlResourceSetId;
|
||||
const uint16_t Y = UE_info->Y[UE_id][cid][slot];
|
||||
const int m = UE_info->num_pdcch_cand[UE_id][cid];
|
||||
@@ -331,8 +342,8 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
__func__,
|
||||
UE_id);
|
||||
|
||||
const bool alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot);
|
||||
if (!alloc) {
|
||||
const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1);
|
||||
if (alloc < 0) {
|
||||
LOG_D(MAC,
|
||||
"%s(): could not find PUCCH for UE %d/%04x@%d.%d\n",
|
||||
__func__,
|
||||
@@ -347,36 +358,50 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
return;
|
||||
}
|
||||
|
||||
AssertFatal(alloc,
|
||||
"could not find uplink slot for PUCCH (RNTI %04x@%d.%d)!\n",
|
||||
rnti, frame, slot);
|
||||
//AssertFatal(alloc,
|
||||
// "could not find uplink slot for PUCCH (RNTI %04x@%d.%d)!\n",
|
||||
// rnti, frame, slot);
|
||||
|
||||
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
sched_pdsch->pucch_allocation = alloc;
|
||||
sched_pdsch->rbStart = rbStart;
|
||||
sched_pdsch->rbSize = rbSize;
|
||||
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = 1;
|
||||
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pdsch_semi_static(
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
|
||||
sched_pdsch->nrOfLayers = target_dl_Nl;
|
||||
sched_pdsch->mcs = target_dl_mcs;
|
||||
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm,
|
||||
sched_pdsch->R,
|
||||
sched_pdsch->rbSize,
|
||||
ps->nrOfSymbols,
|
||||
ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
|
||||
0 /* N_PRB_oh, 0 for initialBWP */,
|
||||
0 /* tb_scaling */,
|
||||
sched_pdsch->nrOfLayers)
|
||||
>> 3;
|
||||
|
||||
sched_ctrl->rbStart = rbStart;
|
||||
sched_ctrl->rbSize = rbSize;
|
||||
sched_ctrl->time_domain_allocation = 2;
|
||||
if (!UE_info->secondaryCellGroup[UE_id]->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table)
|
||||
sched_ctrl->mcsTableIdx = 0;
|
||||
else {
|
||||
if (*UE_info->secondaryCellGroup[UE_id]->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table == 0)
|
||||
sched_ctrl->mcsTableIdx = 1;
|
||||
else
|
||||
sched_ctrl->mcsTableIdx = 2;
|
||||
}
|
||||
sched_ctrl->mcs = 9;
|
||||
sched_ctrl->numDmrsCdmGrpsNoData = 1;
|
||||
/* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */
|
||||
sched_ctrl->dl_harq_pid = sched_ctrl->retrans_dl_harq.head;
|
||||
sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head;
|
||||
|
||||
/* mark the corresponding RBs as used */
|
||||
for (int rb = 0; rb < sched_ctrl->rbSize; rb++)
|
||||
vrb_map[rb + sched_ctrl->rbStart] = 1;
|
||||
for (int rb = 0; rb < sched_pdsch->rbSize; rb++)
|
||||
vrb_map[rb + sched_pdsch->rbStart] = 1;
|
||||
|
||||
if ((frame&127) == 0) LOG_D(MAC,"phytest: %d.%d DL mcs %d, DL rbStart %d, DL rbSize %d\n", frame, slot, sched_pdsch->mcs, rbStart,rbSize);
|
||||
}
|
||||
|
||||
bool nr_ul_preprocessor_phytest(module_id_t module_id,
|
||||
frame_t frame,
|
||||
sub_frame_t slot,
|
||||
int num_slots_per_tdd,
|
||||
uint64_t ulsch_in_slot_bitmap) {
|
||||
uint32_t target_ul_mcs = 9;
|
||||
uint32_t target_ul_bw = 50;
|
||||
uint64_t ulsch_slot_bitmap = (1 << 8);
|
||||
bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
{
|
||||
gNB_MAC_INST *nr_mac = RC.nrmac[module_id];
|
||||
NR_COMMON_channels_t *cc = nr_mac->common_channels;
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
@@ -395,32 +420,53 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id,
|
||||
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
|
||||
const int tda = 1;
|
||||
const int tda = sched_ctrl->active_ubwp ? RC.nrmac[module_id]->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 1;
|
||||
if (tda < 0)
|
||||
return false;
|
||||
const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList =
|
||||
sched_ctrl->active_ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
AssertFatal(tda < tdaList->list.count,
|
||||
"time domain assignment %d >= %d\n",
|
||||
tda,
|
||||
tdaList->list.count);
|
||||
int K2 = get_K2(sched_ctrl->active_ubwp, tda, mu);
|
||||
int K2 = get_K2(scc,sched_ctrl->active_ubwp, tda, mu);
|
||||
const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]);
|
||||
const int sched_slot = (slot + K2) % nr_slots_per_frame[mu];
|
||||
/* check if slot is UL, and that slot is 8 (assuming K2=6 because of UE
|
||||
* limitations). Note that if K2 or the TDD configuration is changed, below
|
||||
* conditions might exclude each other and never be true */
|
||||
if (!(is_xlsch_in_slot(ulsch_in_slot_bitmap, sched_slot) && sched_slot == 8))
|
||||
if (!is_xlsch_in_slot(ulsch_slot_bitmap, sched_slot))
|
||||
return false;
|
||||
|
||||
const int bw = NRRIV2BW(sched_ctrl->active_ubwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const int dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = 1;
|
||||
/* we want to avoid a lengthy deduction of DMRS and other parameters in
|
||||
* every TTI if we can save it, so check whether dci_format, TDA, or
|
||||
* num_dmrs_cdm_grps_no_data has changed and only then recompute */
|
||||
NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static;
|
||||
if (ps->time_domain_allocation != tda
|
||||
|| ps->dci_format != dci_format
|
||||
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
|
||||
uint16_t rbStart = 0;
|
||||
uint16_t rbSize = 50; /* due to OAI UE limitations */
|
||||
if (rbSize>bw)
|
||||
uint16_t rbSize;
|
||||
|
||||
const int bw = NRRIV2BW(sched_ctrl->active_ubwp ?
|
||||
sched_ctrl->active_ubwp->bwp_Common->genericParameters.locationAndBandwidth :
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
if (target_ul_bw>bw)
|
||||
rbSize = bw;
|
||||
else
|
||||
rbSize = target_ul_bw;
|
||||
|
||||
uint16_t *vrb_map_UL =
|
||||
&RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE];
|
||||
const uint16_t symb = ((1 << ps->nrOfSymbols) - 1) << ps->startSymbolIndex;
|
||||
for (int i = rbStart; i < rbStart + rbSize; ++i) {
|
||||
if (vrb_map_UL[i]) {
|
||||
if ((vrb_map_UL[i] & symb) != 0) {
|
||||
LOG_E(MAC,
|
||||
"%s(): %4d.%2d RB %d is already reserved, cannot schedule UE\n",
|
||||
__func__,
|
||||
@@ -434,14 +480,10 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id,
|
||||
sched_ctrl->sched_pusch.slot = sched_slot;
|
||||
sched_ctrl->sched_pusch.frame = sched_frame;
|
||||
|
||||
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
|
||||
sched_ctrl->search_space = get_searchspace(sched_ctrl->active_bwp, target_ss);
|
||||
uint8_t nr_of_candidates;
|
||||
find_aggregation_candidates(&sched_ctrl->aggregation_level,
|
||||
&nr_of_candidates,
|
||||
sched_ctrl->search_space);
|
||||
sched_ctrl->coreset = get_coreset(
|
||||
sched_ctrl->active_bwp, sched_ctrl->search_space, 1 /* dedicated */);
|
||||
const int cid = sched_ctrl->coreset->controlResourceSetId;
|
||||
const uint16_t Y = UE_info->Y[UE_id][cid][slot];
|
||||
const int m = UE_info->num_pdcch_cand[UE_id][cid];
|
||||
@@ -458,25 +500,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id,
|
||||
}
|
||||
UE_info->num_pdcch_cand[UE_id][cid]++;
|
||||
|
||||
sched_ctrl->sched_pusch.time_domain_allocation = tda;
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const int dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = 1;
|
||||
/* we want to avoid a lengthy deduction of DMRS and other parameters in
|
||||
* every TTI if we can save it, so check whether dci_format, TDA, or
|
||||
* num_dmrs_cdm_grps_no_data has changed and only then recompute */
|
||||
NR_sched_pusch_save_t *ps = &sched_ctrl->pusch_save;
|
||||
if (ps->time_domain_allocation != tda
|
||||
|| ps->dci_format != dci_format
|
||||
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|
||||
nr_save_pusch_fields(scc,
|
||||
sched_ctrl->active_ubwp,
|
||||
dci_format,
|
||||
tda,
|
||||
num_dmrs_cdm_grps_no_data,
|
||||
ps);
|
||||
|
||||
const int mcs = 9;
|
||||
const int mcs = target_ul_mcs;
|
||||
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
|
||||
sched_pusch->mcs = mcs;
|
||||
sched_pusch->rbStart = rbStart;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user