Commit 6c1c711e authored by ChenWeiTai's avatar ChenWeiTai
Browse files

1. NR gNB Application use ITTI transmit config. to RRC

2.NR RRC do_SERVINGCELLCONFIGCOMMON for all of common config. will be transmit to lower layer by rrc_mac_config_req_gNB"
parent 5e1c6029
......@@ -364,9 +364,9 @@ file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c)
file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h)
set(nr_rrc_h ${nr_rrc_h} ${NR_RRC_FULL_DIR}/asn1_constants.h)
set_source_files_properties(${nr_rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code
add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c)
include_directories ("${NR_RRC_FULL_DIR}")
#add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
# ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c)
#include_directories ("${NR_RRC_FULL_DIR}")
# add the command to generate the source code
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
......
......@@ -91,7 +91,7 @@ typedef struct {
/// NB_IoT RRC context variables
//struct eNB_RRC_INST_NB_IoT_s **nb_iot_rrc;
/// NR RRC context variables
struct gNB_RRC_INST_s **nr_rrc;
struct gNB_RRC_INST_s **nrrrc;
/// MAC context variables
struct eNB_MAC_INST_s **mac;
/// NB_IoT MAC context variables
......
......@@ -84,6 +84,10 @@ typedef boolean_t eNB_flag_t;
#define ENB_FLAG_NO FALSE
#define ENB_FLAG_YES TRUE
typedef boolean_t gNB_flag_t;
#define GNB_FLAG_NO FALSE
#define GNB_FLAG_YES TRUE
typedef boolean_t srb_flag_t;
#define SRB_FLAG_NO FALSE
#define SRB_FLAG_YES TRUE
......@@ -236,6 +240,9 @@ typedef struct protocol_ctxt_s {
#define UE_INSTANCE_TO_MODULE_ID( iNSTANCE ) iNSTANCE - NB_eNB_INST
#define ENB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE
//NR
#define GNB_MODULE_ID_TO_INSTANCE( mODULE_iD ) mODULE_iD
#define GNB_INSTANCE_TO_MODULE_ID( iNSTANCE )iNSTANCE
#define MODULE_ID_TO_INSTANCE(mODULE_iD, iNSTANCE, eNB_fLAG) \
if(eNB_fLAG == ENB_FLAG_YES) \
......
......@@ -280,28 +280,34 @@ typedef struct NRRrcConfigurationReq_s {
//NR DL SCS-SpecificCarrier
uint32_t DL_offsetToCarrier[MAX_NUM_CCs];
long DL_SubcarrierSpacing[MAX_NUM_CCs];
long DL_SCS_SubcarrierSpacing[MAX_NUM_CCs];
long DL_SCS_SpecificCarrier_k0[MAX_NUM_CCs];
uint32_t DL_carrierBandwidth[MAX_NUM_CCs];
//NR BWP-DownlinkCommon
uint32_t DL_locationAndBandwidth[MAX_NUM_CCs];
uint32_t DL_locationAndBandwidth[MAX_NUM_CCs];
long DL_BWP_SubcarrierSpacing[MAX_NUM_CCs];
lte_prefix_type_t DL_BWP_prefix_type[MAX_NUM_CCs];
//NR FrequencyInfoUL
long UL_FreqBandIndicatorNR[MAX_NUM_CCs];
long UL_absoluteFrequencyPointA[MAX_NUM_CCs];
long FrequencyInfoUL_p_Max[MAX_NUM_CCs];
long frequencyShift7p5khz[MAX_NUM_CCs];
lte_prefix_type_t UL_additionalSpectrumEmission[MAX_NUM_CCs]
long UL_p_Max[MAX_NUM_CCs];
long ULfrequencyShift7p5khz[MAX_NUM_CCs];
//NR UL SCS-SpecificCarrier
uint32_t UL_offsetToCarrier[MAX_NUM_CCs];
long UL_SubcarrierSpacing[MAX_NUM_CCs];
long UL_SCS_SubcarrierSpacing[MAX_NUM_CCs];
long UL_SCS_SpecificCarrier_k0[MAX_NUM_CCs];
uint32_t UL_carrierBandwidth[MAX_NUM_CCs];
// NR BWP-UplinkCommon
uint32_t UL_locationAndBandwidth[MAX_NUM_CCs];
long UL_BWP_SubcarrierSpacing[MAX_NUM_CCs];
lte_prefix_type_t UL_BWP_prefix_type[MAX_NUM_CCs];
long ServingCellConfigCommon_ssb_PositionsInBurst_PR[MAX_NUM_CCs];
long ServingCellConfigCommon_ssb_periodicityServingCell[MAX_NUM_CCs]; //ServingCellConfigCommon
long ServingCellConfigCommon_dmrs_TypeA_Position[MAX_NUM_CCs]; //ServingCellConfigCommon
long NIA_SubcarrierSpacing[MAX_NUM_CCs]; //ServingCellConfigCommon Used only for non-initial access
......@@ -394,6 +400,7 @@ typedef struct NRRrcConfigurationReq_s {
long PDCCH_interleaverSize[MAX_NUM_CCs];
long PDCCH_shiftIndex[MAX_NUM_CCs];
long PDCCH_precoderGranularity[MAX_NUM_CCs]; //Corresponds to L1 parameter 'CORESET-precoder-granuality'
long PDCCH_TCI_StateId[MAX_NUM_CCs];
BOOLEAN_t tci_PresentInDCI[MAX_NUM_CCs];
//NR PDCCH-ConfigCommon commonSearchSpaces
......
......@@ -92,7 +92,7 @@ static void configure_nrrrc(uint32_t gnb_id)
msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ);
if (RC.nr_rrc[gnb_id]) {
RCconfig_NRRRC(msg_p,gnb_id, RC.nr_rrc[gnb_id]);
RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
LOG_I(GNB_APP,"Sending configuration message to NR_RRC task\n");
......
This diff is collapsed.
......@@ -244,28 +244,34 @@ typedef enum {
//NR DL SCS-SPECIFICCARRIER
#define GNB_CONFIG_STRING_DL_OFFSETTOCARRIER "DL_offsetToCarrier"
#define GNB_CONFIG_STRING_DL_SUBCARRIERSPACING "DL_SubcarrierSpacing"
#define GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING "DL_SCS_SubcarrierSpacing"
#define GNB_CONFIG_STRING_DL_SCS_SPECIFICCARRIER_K0 "DL_SCS_SpecificCarrier_k0"
#define GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH "DL_carrierBandwidth"
// NR BWP-DOWNLINKCOMMON
#define GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH "DL_locationAndBandwidth"
#define GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING "DL_BWP_SubcarrierSpacing"
#define GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE "DL_BWP_prefix_type"
//NR FREQUENCYINFOUL
#define GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR "UL_FreqBandIndicatorNR"
#define GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA "UL_absoluteFrequencyPointA"
#define GNB_CONFIG_STRING_FREQUENCYINFOUL_P_MAX "FrequencyInfoUL_p_Max"
#define GNB_CONFIG_STRING_FREQUENCYSHIFT7P5KHZ "frequencyShift7p5khz"
#define GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION "UL_additionalSpectrumEmission"
#define GNB_CONFIG_STRING_UL_P_MAX "UL_p_Max"
#define GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ "UL_frequencyShift7p5khz"
//NR UL SCS-SPECIFICCARRIER
#define GNB_CONFIG_STRING_UL_OFFSETTOCARRIER "UL_offsetToCarrier"
#define GNB_CONFIG_STRING_UL_SUBCARRIERSPACING "UL_SubcarrierSpacing"
#define GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING "UL_SCS_SubcarrierSpacing"
#define GNB_CONFIG_STRING_UL_SCS_SPECIFICCARRIER_K0 "UL_SCS_SpecificCarrier_k0"
#define GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH "UL_carrierBandwidth"
// NR BWP-UPLINKCOMMON
#define GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH "UL_locationAndBandwidth"
#define GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING "UL_BWP_SubcarrierSpacing"
#define GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE "UL_BWP_prefix_type"
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR "ServingCellConfigCommon_ssb_PositionsInBurst_PR"
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL "ServingCellConfigCommon_ssb_periodicityServingCell"
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION "ServingCellConfigCommon_dmrs_TypeA_Position"
#define GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING "NIA_SubcarrierSpacing"
......@@ -357,6 +363,7 @@ typedef enum {
#define GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE "PDCCH_interleaverSize"
#define GNB_CONFIG_STRING_PDCCH_SHIFTINDEX "PDCCH_shiftIndex"
#define GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY "PDCCH_precoderGranularity"
#define GNB_CONFIG_STRING_PDCCH_TCI_STATEID "PDCCH_TCI_StateId"
#define GNB_CONFIG_STRING_TCI_PRESENTINDCI "tci_PresentInDCI"
//NR PDCCH-ConfigCommon commonSearchSpaces
......@@ -412,19 +419,25 @@ typedef enum {
{GNB_CONFIG_STRING_DL_FREQBANDINDICATORNR, NULL, 0, iptr:&DL_FreqBandIndicatorNR, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&DL_absoluteFrequencyPointA, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_OFFSETTOCARRIER, NULL, 0, iptr:&DL_offsetToCarrier, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_SUBCARRIERSPACING, NULL, 0, iptr:&DL_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING, NULL, 0, iptr:&DL_SCS_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&DL_SCS_SpecificCarrier_k0, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH, NULL, 0, iptr:&DL_carrierBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&DL_locationAndBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING, NULL, 0, iptr:&DL_BWP_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE, NULL, 0, iptr:&DL_BWP_prefix_type, defintval:0, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR, NULL, 0, iptr:&UL_FreqBandIndicatorNR, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&UL_absoluteFrequencyPointA, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_FREQUENCYINFOUL_P_MAX, NULL, 0, iptr:&FrequencyInfoUL_p_Max, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_FREQUENCYSHIFT7P5KHZ, NULL, 0, iptr:&frequencyShift7p5khz, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION, NULL, 0, iptr:&UL_additionalSpectrumEmission, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_P_MAX, NULL, 0, iptr:&UL_p_Max, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ, NULL, 0, iptr:&UL_frequencyShift7p5khz, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_OFFSETTOCARRIER, NULL, 0, iptr:&UL_offsetToCarrier, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_SUBCARRIERSPACING, NULL, 0, iptr:&UL_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING, NULL, 0, iptr:&UL_SCS_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&UL_SCS_SpecificCarrier_k0, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH, NULL, 0, iptr:&UL_carrierBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&UL_locationAndBandwidth, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING, NULL, 0, iptr:&UL_BWP_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, iptr:&UL_BWP_prefix_type, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, iptr:&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, iptr:&NIA_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \
......@@ -494,6 +507,7 @@ typedef enum {
{GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE, NULL, 0, iptr:&PDCCH_interleaverSize, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_PDCCH_SHIFTINDEX, NULL, 0, iptr:&PDCCH_shiftIndex, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY, NULL, 0, iptr:&PDCCH_precoderGranularity, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_PDCCH_TCI_STATEID, NULL, 0, iptr:&PDCCH_TCI_StateId, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_TCI_PRESENTINDCI, NULL, 0, iptr:&tci_PresentInDCI, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SEARCHSPACEID, NULL, 0, iptr:&SearchSpaceId, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_COMMONSEARCHSPACES_CONTROLRESOURCESETID, NULL, 0, iptr:&commonSearchSpaces_controlResourceSetId, defintval:0, TYPE_UINT, 0}, \
......@@ -551,19 +565,25 @@ typedef enum {
#define GNB_CONFIG_DL_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_DL_SCS_SPECIFICCARRIER_K0_IDX
#define GNB_CONFIG_DL_CARRIERBANDWIDTH_IDX
#define GNB_CONFIG_DL_LOCATIONANDBANDWIDTH_IDX
#define GNB_CONFIG_DL_LOCATIONANDBANDWIDTH_IDX
#define GNB_CONFIG_DL_BWP_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_DL_BWP_PREFIX_TYPE_IDX
#define GNB_CONFIG_UL_FREQBANDINDICATORNR_IDX
#define GNB_CONFIG_UL_ABSOLUTEFREQUENCYPOINTA_IDX
#define GNB_CONFIG_FREQUENCYINFOUL_P_MAX_IDX
#define GNB_CONFIG_FREQUENCYSHIFT7P5KHZ_IDX
#define GNB_CONFIG_UL_ABSOLUTEFREQUENCYPOINTA_IDX
#define GNB_CONFIG_UL_ADDITIONALSPECTRUMEMISSION_IDX;
#define GNB_CONFIG_UL_P_MAX_IDX
#define GNB_CONFIG_UL_FREQUENCYSHIFT7P5KHZ_IDX
#define GNB_CONFIG_UL_OFFSETTOCARRIER_IDX
#define GNB_CONFIG_UL_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_UL_SCS_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_UL_SCS_SPECIFICCARRIER_K0_IDX
#define GNB_CONFIG_UL_CARRIERBANDWIDTH_IDX
#define GNB_CONFIG_UL_LOCATIONANDBANDWIDTH_IDX
#define GNB_CONFIG_UL_BWP_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_UL_BWP_PREFIX_TYPE_IDX
#define GNB_CONFIG_SUBCARRIERSPACINGCOMMON_IDX
#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX
#define GNB_CONFIG_FREQUENCYOFFSETSSB_IDX
#define GNB_CONFIG_FREQUENCYOFFSETSSB_IDX
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR_IDX
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL_IDX
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION_IDX
#define GNB_CONFIG_NIA_SUBCARRIERSPACING_IDX
......@@ -632,7 +652,8 @@ typedef enum {
#define GNB_CONFIG_PDCCH_REG_BUNDLESIZE_IDX
#define GNB_CONFIG_PDCCH_INTERLEAVERSIZE_IDX
#define GNB_CONFIG_PDCCH_SHIFTINDEX_IDX
#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX
#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX
#define GNB_CONFIG_PDCCH_TCI_STATEID_IDX
#define GNB_CONFIG_TCI_PRESENTINDCI_IDX
#define GNB_CONFIG_SEARCHSPACEID_IDX
#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX
......
This diff is collapsed.
......@@ -20,11 +20,11 @@
/*! \file RRC/LITE/defs_NR.h
* \brief NR RRC struct definitions and function prototypes
* \author Navid Nikaein, Raymond Knopp and WEI-TAI CHEN
* \author Navid Nikaein, Raymond Knopp
* \date 2010 - 2014, 2018
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, kroempa@gmail.com.tw
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
*/
#ifndef __OPENAIR_RRC_DEFS_NR_H__
......@@ -45,6 +45,8 @@
#include "SIB1.h"
//#include "SystemInformation.h"
//#include "RRCConnectionReconfiguration.h"
#include "RRCReconfigurationComplete.h"
#include "RRCReconfiguration"
//#include "RRCConnectionReconfigurationComplete.h"
//#include "RRCConnectionSetup.h"
//#include "RRCConnectionSetupComplete.h"
......@@ -59,6 +61,7 @@
//#include "AS-Context.h"
#include "UE-NR-Capability.h"
#include "MeasResults.h"
#include "ServingCellConfigCommon.h"
#endif
//-------------------
......@@ -389,78 +392,35 @@ typedef struct rrc_gNB_ue_context_s {
typedef struct {
// buffer that contains the encoded messages
uint8_t *MIB_NR;
uint8_t sizeof_MIB_NR;
uint8_t *SIB1_NR;
uint8_t sizeof_SIB1_NR;
/*
uint8_t *SIB23_NB_IoT;
uint8_t sizeof_SIB23_NB_IoT;
*/
uint8_t *MIB;
uint8_t sizeof_MIB;
uint8_t *SIB1;
uint8_t sizeof_SIB1;
uint8_t *SERVINGCELLCONFIGCOMMON;
uint8_t sizeof_SERVINGCELLCONFIGCOMMON;
/*
//not actually implemented in OAI
uint8_t *SIB4_NB_IoT;
uint8_t sizeof_SIB4_NB_IoT;
uint8_t *SIB5_NB_IoT;
uint8_t sizeof_SIB5_NB_IoT;
uint8_t *SIB14_NB_IoT;
uint8_t sizeof_SIB14_NB_IoT;
uint8_t *SIB16_NB_IoT;
uint8_t sizeof_SIB16_NB_IoT;
*/
//TS 36.331 V14.2.1
// uint8_t *SIB15_NB;
// uint8_t sizeof_SIB15_NB;
// uint8_t *SIB20_NB;
// uint8_t sizeof_SIB20_NB;
// uint8_t *SIB22_NB;
// uint8_t sizeof_SIB22_NB;
//implicit parameters needed
int Ncp; //cyclic prefix for DL
int Ncp_UL; //cyclic prefix for UL
int p_eNB; //number of tx antenna port
int p_rx_eNB; //number of receiving antenna ports
int p_gNB; //number of tx antenna port
int p_rx_gNB; //number of receiving antenna ports
uint32_t dl_CarrierFreq; //detected by the UE
uint32_t ul_CarrierFreq; //detected by the UE
uint16_t physCellId; //not stored in the MIB-NB but is getting through NPSS/NSSS
uint16_t physCellId;
//are the only static one (memory has been already allocated)
BCCH_BCH_Message_t mib_NR;
BCCH_BCH_Message_t mib;
/*
BCCH_DL_SCH_Message_NR_t siblock1_NB_IoT; //SIB1-NB
BCCH_DL_SCH_Message_NR_t systemInformation_NB_IoT; //SI
*/
SIB1_t *sib1_NR;
/*
SIB2_t *sib2_NR;
SIB3_t *sib3_NR;
//not implemented yet
SIB4_t *sib4_NR;
SIB5_t *sib5_NR;
*/
SIB1_t *sib1;
ServingCellConfigCommon_t *servingcellconfigcommon;
SRB_INFO_NR SI;
SRB_INFO_NR Srb0;
uint8_t **MCCH_MESSAGE; // probably not needed , but added to remove errors
uint8_t sizeof_MCCH_MESSAGE[8];// but added to remove errors
SRB_INFO_NR MCCH_MESS[8];// MAX_MBSFN_AREA
/*future implementation TS 36.331 V14.2.1
SystemInformationBlockType15_NB_r14_t *sib15;
SystemInformationBlockType20_NB_r14_t *sib20;
SystemInformationBlockType22_NB_r14_t *sib22;
uint8_t SCPTM_flag;
uint8_t sizeof_SC_MCHH_MESS[];
SC_MCCH_Message_NR_t scptm;*/
} rrc_gNB_carrier_data_t;
//---------------------------------------------------
......@@ -484,6 +444,7 @@ typedef struct gNB_RRC_INST_s {
#if defined(ENABLE_ITTI)
gNB_RrcConfigurationReq configuration;//rrc_messages_types.h
#endif
// other PLMN parameters
/// Mobile country code
int mcc;
......
......@@ -41,7 +41,7 @@
#include "LAYER2/MAC/proto.h"
#include "UTIL/LOG/log.h"
#include "COMMON/mac_rrc_primitives.h"
#include "RRC/LITE/NR/asn1_msg.h"
#include "RRC/NR/asn1_msg.h"
///ASN.1 header files
//#include "RRCConnectionRequest.h"
......@@ -127,10 +127,10 @@ openair_nrrrc_on(
LOG_I(NR_RRC, PROTOCOL_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_config_buffer (&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
rrc_config_buffer (&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
rrc_config_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
rrc_config_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
}
}
......@@ -153,16 +153,16 @@ init_NR_SI(
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
// copy basic parameters
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->prefix_type[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->prefix_type[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
///MIB
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB_NR = 0;
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].MIB_NR = (uint8_t*) malloc16(4);
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB_NR = do_MIB_NR(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id],0,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB = 0;
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].MIB = (uint8_t*) malloc16(4);
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_MIB = do_MIB_NR(&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id],0,
#ifdef ENABLE_ITTI
configuration->ssb_SubcarrierOffset[CC_id],
configuration->pdcch_ConfigSIB1[CC_id],
......@@ -174,12 +174,12 @@ init_NR_SI(
);
///SIB1
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_NR = 0;
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_NR = (uint8_t*) malloc16(32);
AssertFatal(RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_NR!
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = 0;
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SIB1 = (uint8_t*) malloc16(32);
AssertFatal(RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SIB1!
= NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for NR SIB1 allocated\n",PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_NR = do_SIB1_NR(&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id],
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = do_SIB1_NR(&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id],
ctxt_pP->module_id,
CC_id
#if defined(ENABLE_ITTI)
......@@ -187,17 +187,26 @@ init_NR_SI(
#endif
);
AssertFatal(RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 != 255,"FATAL, RC.nr_rrc[enb_mod_idP].carrier[CC_id].sizeof_SIB1_NR == 255");
rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].Ncp,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].sib1->freqBandIndicator,
RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
AssertFatal(RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 != 255,"FATAL, RC.nrrrc[enb_mod_idP].carrier[CC_id].sizeof_SIB1 == 255");
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SERVINGCELLCONFIGCOMMON = do_SERVINGCELLCONFIGCOMMON(ctxt_pP->module_id,
CC_id
#if defined(ENABLE_ITTI)
,configuration
#endif
);
rrc_mac_config_req_gNB(ctxt_pP->module_id, CC_id,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sib1->freqBandIndicator,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
0, // rnti
(BCCH_BCH_Message_t *)
&RC.nr_rrc[ctxt_pP->module_id]->carrier[CC_id].mib
(BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
(ServingCellConfigCommon_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id]servingcellconfigcommon
);
}
......@@ -206,34 +215,34 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
protocol_ctxt_t ctxt;
int CC_id;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, ENB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, GNB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP);
LOG_I(NR_RRC,PROTOCOL_NRRRC_CTXT_FMT" Init...\n",PROTOCOL_NRRRC_CTXT_ARGS(&ctxt));
#if OCP_FRAMEWORK
while ( RC.nr_rrc[gnb_mod_idP] == NULL ) {
LOG_E(NR_RRC, "RC.nr_rrc not yet initialized, waiting 1 second\n");
while ( RC.nrrrc[gnb_mod_idP] == NULL ) {
LOG_E(NR_RRC, "RC.nrrrc not yet initialized, waiting 1 second\n");
sleep(1);
}
#endif
AssertFatal(RC.nr_rrc[gnb_mod_idP] != NULL, "RC.nr_rrc not initialized!");
AssertFatal(RC.nrrrc[gnb_mod_idP] != NULL, "RC.nrrrc not initialized!");
AssertFatal(NUMBER_OF_UE_MAX < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
#ifdef ENABLE_ITTI
AssertFatal(configuration!=NULL,"configuration input is null\n");
#endif
RC.nr_rrc[ctxt.module_id]->Nb_ue = 0;
RC.nrrrc[ctxt.module_id]->Nb_ue = 0;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].Srb0.Active = 0;
RC.nrrrc[ctxt.module_id]->carrier[CC_id].Srb0.Active = 0;
}
uid_linear_allocator_init(&nr_rrc.nr_rrc[ctxt.module_id]->uid_allocator);
RB_INIT(&RC.nr_rrc[ctxt.module_id]->rrc_ue_head);
uid_linear_allocator_init(&nrrrc.nrrrc[ctxt.module_id]->uid_allocator);
RB_INIT(&RC.nrrrc[ctxt.module_id]->rrc_ue_head);
RC.nr_rrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
RC.nr_rrc[ctxt.module_id]->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
RC.nrrrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
RC.nrrrc[ctxt.module_id]->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
memcpy(&RC.nr_rrc[ctxt.module_id]->configuration,configuration,sizeof(gNB_RrcConfigurationReq));
memcpy(&RC.nrrrc[ctxt.module_id]->configuration,configuration,sizeof(gNB_RrcConfigurationReq));
/// System Information INIT
......@@ -243,21 +252,21 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (j = 0; j < NUM_MAX_CBA_GROUP; j++) {
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[j] = CBA_OFFSET + j;
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[j] = CBA_OFFSET + j;
}
if (RC.nr_rrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups > NUM_MAX_CBA_GROUP) {
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups = NUM_MAX_CBA_GROUP;
if (RC.nrrrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups > NUM_MAX_CBA_GROUP) {
RC.nrrrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups = NUM_MAX_CBA_GROUP;
}
LOG_D(NR_RRC,
PROTOCOL_NRRRC_CTXT_FMT" Initialization of 4 cba_RNTI values (%x %x %x %x) num active groups %d\n",
PROTOCOL_NRRRC_CTXT_ARGS(&ctxt),
gnb_mod_idP, RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[0],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[1],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[2],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].cba_rnti[3],
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups);
gnb_mod_idP, RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[0],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[1],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[2],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[3],
RC.nrrrc[ctxt.module_id]->carrier[CC_id].num_active_cba_groups);
}
#endif
......@@ -270,8 +279,8 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
#endif
);
for (int ue_id = 0; ue_id < NUMBER_OF_UE_MAX; ue_id++){
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0;
RC.nr_rrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t*) malloc16(256);
RC.nrrrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0;
RC.nrrrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t*) malloc16(256);
}
}//END for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
......@@ -279,14 +288,14 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
//rrc_init_NR_global_param();
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
openair_rrc_top_init_gNB(RC.nr_rrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0);
openair_rrc_top_init_gNB(RC.nrrrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0);
}
openair_nrrrc_on(&ctxt);
return 0;
}//END openair_rrc_eNB_configuration
}//END openair_rrc_gNB_configuration
///---------------------------------------------------------------------------------------------------------------///
......@@ -320,7 +329,7 @@ void* rrc_gnb_task(void* args_p){
break;
case MESSAGE_TEST:
LOG_I(RRC, "[eNB %d] Received %s\n", instance, msg_name_p);
LOG_I(RRC, "[gNB %d] Received %s\n", instance, msg_name_p);
break;
/* Messages from MAC */
......@@ -374,16 +383,16 @@ void* rrc_gnb_task(void* args_p){
/* Nothing to do. Apparently everything is done in S1AP processing */
//LOG_I(RRC, "[eNB %d] Received message %s, not processed because procedure not synched\n",
//instance, msg_name_p);
if (rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)
&& rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc > 0) {
rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc =
rrc_eNB_get_ue_context(RC.nr_rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_thres_rrc;
if (rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)
&& rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc > 0) {
rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc =
rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_thres_rrc;
}
break;
#endif
/* Messages from eNB app */
/* Messages from gNB app */
case NRRRC_CONFIGURATION_REQ:
LOG_I(NR_RRC, "[gNB %d] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p));
openair_rrc_gNB_configuration(GNB_INSTANCE_TO_MODULE_ID(instance), &NRRRC_CONFIGURATION_REQ(msg_p));
......@@ -414,35 +423,35 @@ openair_rrc_top_init_gNB(int eMBMS_active,uint8_t HO_active)
/* for no gcc warnings */