- Maintain The Configuration Module

- Create task for GAB_APP and GAN_RRC
- Create the NR FAPI for P5 interface
- *It could be build, but still have a lot of warning need to maintain
This commit is contained in:
WEI-TAI CHEN
2018-06-14 06:02:26 -07:00
parent 5b94aeac77
commit 73cfa6bbb6
40 changed files with 7387 additions and 9990 deletions
+1
View File
@@ -55,6 +55,7 @@ MESSAGE_DEF(RRC_STATE_IND, MESSAGE_PRIORITY_MED, RrcStateInd,
// eNB: ENB_APP -> RRC messages
MESSAGE_DEF(RRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, RrcConfigurationReq, rrc_configuration_req)
MESSAGE_DEF(NBIOTRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, NbIoTRrcConfigurationReq, nbiotrrc_configuration_req)
MESSAGE_DEF(NRRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, gNB_RrcConfigurationReq, nrrrc_configuration_req)
// UE: NAS -> RRC messages
MESSAGE_DEF(NAS_KENB_REFRESH_REQ, MESSAGE_PRIORITY_MED, NasKenbRefreshReq, nas_kenb_refresh_req)
+2 -2
View File
@@ -293,9 +293,9 @@ typedef struct NRRrcConfigurationReq_s {
//NR FrequencyInfoUL
long UL_FreqBandIndicatorNR[MAX_NUM_CCs];
long UL_absoluteFrequencyPointA[MAX_NUM_CCs];
lte_prefix_type_t UL_additionalSpectrumEmission[MAX_NUM_CCs];
long UL_additionalSpectrumEmission[MAX_NUM_CCs];
long UL_p_Max[MAX_NUM_CCs];
long ULfrequencyShift7p5khz[MAX_NUM_CCs];
long UL_frequencyShift7p5khz[MAX_NUM_CCs];
//NR UL SCS-SpecificCarrier
uint32_t UL_offsetToCarrier[MAX_NUM_CCs];
+4
View File
@@ -44,6 +44,8 @@ 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)
@@ -59,6 +61,8 @@ TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200)
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)
@@ -29,23 +29,21 @@
* \note
* \warning
*/
#ifndef __NRRRC_PARAMSVALUES__H__
#define __NRRRC_PARAMSVALUES__H__
#ifndef __NR_RRC_PARAMSVALUES__H__
#define __NR_RRC_PARAMSVALUES__H__
/* cell configuration section name */
#define GNB_CONFIG_STRING_GNB_LIST "gNBs"
/* component carriers configuration section name */
#define GNB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
#define GNB_CONFIG_STRING_FRAME_TYPE "frame_type"
#define GNB_CONFIG_STRING_DL_PREFIX_TYPE "DL_prefix_type"
#define GNB_CONFIG_STRING_UL_PREFIX_TYPE "UL_prefix_type"
#define GNB_CONFIG_STRING_EUTRA_BAND "eutra_band"
#define GNB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
#define GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
#define GNB_CONFIG_STRING_NID_CELL "Nid_cell"
#define GNB_CONFIG_STRING_N_RB_DL "N_RB_DL"
#define GNB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn"
#define GNB_CONFIG_STRING_GNB_LIST "gNBs"
/* component carriers configuration section name */
#define GNB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
#define GNB_CONFIG_STRING_FRAME_TYPE "frame_type"
#define GNB_CONFIG_STRING_DL_PREFIX_TYPE "DL_prefix_type"
#define GNB_CONFIG_STRING_UL_PREFIX_TYPE "UL_prefix_type"
#define GNB_CONFIG_STRING_EUTRA_BAND "eutra_band"
#define GNB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
#define GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
#define GNB_CONFIG_STRING_NID_CELL "Nid_cell"
#define GNB_CONFIG_STRING_N_RB_DL "N_RB_DL"
#define FRAMETYPE_OKVALUES {"FDD","TDD"}
#define FRAMETYPE_MODVALUES { FDD, TDD}
@@ -66,7 +64,7 @@
#define UETIMER_T300_OKVALUES {100,200,300,400,600,1000,1500,2000}
#define UETT300(A) UE_TimersAndConstants__t300_ ## A
#define UETIMER_T300_MODVALUES { UETT300(ms100), UETT300(ms200),UETT300(ms300),UETT300(ms400),UETT300(ms600),UETT300(ms1000),UETT300(ms1500),UETT300(ms2000)}
#define UETIMER_T300_MODVALUES { UETT300(ms100), UETT300(ms200),UETT300(ms300),UETT300(ms400),UETT300(ms600),UETT300(ms1000),UETT300(ms1500),UETT300(ms2000)}
#define UETIMER_T301_OKVALUES {100,200,300,400,600,1000,1500,2000}
#define UETT301(A) UE_TimersAndConstants__t301_ ## A
@@ -84,14 +84,14 @@ static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_
*/
/*------------------------------------------------------------------------------*/
static void configure_nrrrc(uint32_t gnb_id)
static void configure_nr_rrc(uint32_t gnb_id)
{
MessageDef *msg_p = NULL;
// int CC_id;
msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ);
if (RC.nr_rrc[gnb_id]) {
if (RC.nrrrc[gnb_id]) {
RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
@@ -112,16 +112,16 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//,
for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) {
{
s1ap_register_gnb_req_t *s1ap_register_gNB;
s1ap_register_enb_req_t *s1ap_register_gNB; //Type Temporarily reuse
/* note: there is an implicit relationship between the data structure and the message name */
msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_GNB_REQ);
msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_ENB_REQ); //Message Temporarily reuse
RCconfig_S1(msg_p, gnb_id);
if (gnb_id == 0) RCconfig_gtpu();
s1ap_register_gNB = &S1AP_REGISTER_GNB_REQ(msg_p);
s1ap_register_gNB = &S1AP_REGISTER_ENB_REQ(msg_p); //Message Temporarily reuse
LOG_I(GNB_APP,"default drx %d\n",s1ap_register_gNB->default_drx);
LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id));
@@ -150,8 +150,8 @@ void *gNB_app_task(void *args_p)
long gnb_register_retry_timer_id;
# endif
uint32_t gnb_id;
MessageDef *msg_p = NULL;
const char *msg_name = NULL;
MessageDef *msg_p = NULL;
const char *msg_name = NULL;
instance_t instance;
int result;
/* for no gcc warnings */
@@ -161,9 +161,9 @@ void *gNB_app_task(void *args_p)
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
//RCconfig_L1();
RCconfig_NR_L1();
//RCconfig_macrlc();
RCconfig_nr_macrlc();
LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
@@ -175,14 +175,14 @@ void *gNB_app_task(void *args_p)
LOG_I(GNB_APP,"Allocating gNB_RRC_INST for %d instances\n",RC.nb_nr_inst);
RC.rrc = (gNB_RRC_INST **)malloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *));
LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.rrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.rrc);
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 = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) {
RC.rrc[gnb_id] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
LOG_I(PHY, "%s() Creating RRC instance RC.rrc[%d]:%p (%d of %d)\n", __FUNCTION__, gnb_id, RC.rrc[gnb_id], gnb_id+1, gnb_id_end);
memset((void *)RC.rrc[gnb_id],0,sizeof(gNB_RRC_INST));
configure_nrrrc(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, gnb_id_end);
memset((void *)RC.nrrrc[gnb_id],0,sizeof(gNB_RRC_INST));
configure_nr_rrc(gnb_id);
}
# if defined(ENABLE_USE_MME)
File diff suppressed because it is too large Load Diff
@@ -37,17 +37,15 @@
#include "commonDef.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "PHY/impl_defs_lte.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
//#ifdef CMAKER
//#include "SystemInformationBlockType2.h"
//#include "rrc_messages_types.h"
//#else
//#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
//#endif
#ifdef CMAKER
#include "rrc_messages_types.h"
#endif
#include "intertask_interface_types.h"
#include "RRC/NR/defs_NR.h"
#include "RRC/NR/nr_rrc_defs.h"
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
struct in_addr inp;\
@@ -64,7 +62,7 @@
*/
// Hard to find a defined value for max enb...
#define MAX_ENB 16
#define MAX_GNB 16
/*
typedef struct mme_ip_address_s {
@@ -93,18 +91,18 @@ 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(void);
//extern int RCconfig_gtpu(void );
extern void RCconfig_RU(void);
extern void RCconfig_flexran(void);
extern void RCconfig_NR_L1(void);
extern void RCconfig_nr_macrlc(void);
extern int RCconfig_gtpu(void );
extern void NRRCConfig(void);
//void enb_config_display(void);
//void ru_config_display(void);
int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc);
//int RCconfig_S1(MessageDef *msg_p, uint32_t i);
int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
int RCconfig_S1(MessageDef *msg_p, uint32_t i);
#endif /* GNB_CONFIG_H_ */
/** @} */
@@ -31,7 +31,7 @@
*/
#include "common/config/config_paramdesc.h"
#include "NRRRC_paramsvalues.h"
#include "NR_RRC_paramsvalues.h"
#define GNB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
@@ -401,14 +401,170 @@ typedef enum {
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET "RateMatchPatternLTE_CRS_radioframeAllocationOffset"
#define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE "RateMatchPatternLTE_CRS_subframeAllocation_choice"
/* init for checkedparam_t structure */
#define NRCCPARAMS_CHECK { \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
}
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* component carriers configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt checked_param */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define NRCCPARAMS_DESC { \
{GNB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&frame_type, defstrval:"FDD", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_DL_prefix_type, NULL, 0, strptr:&DL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_UL_prefix_type, NULL, 0, strptr:&UL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_DL_PREFIX_TYPE, NULL, 0, strptr:&DL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_UL_PREFIX_TYPE, NULL, 0, strptr:&UL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_EUTRA_BAND, NULL, 0, iptr:&eutra_band, defintval:7, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \
{GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \
@@ -553,153 +709,355 @@ typedef enum {
/* component carries configuration parameters name */
#define ENB_CONFIG_FRAME_TYPE_IDX 0
#define ENB_CONFIG_DL_PREFIX_TYPE_IDX 1
#define ENB_CONFIG_UL_PREFIX_TYPE_IDX 1
#define ENB_CONFIG_EUTRA_BAND_IDX 2
#define ENB_CONFIG_DOWNLINK_FREQUENCY_IDX 3
#define ENB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 4
#define ENB_CONFIG_NID_CELL_IDX 5
#define ENB_CONFIG_N_RB_DL_IDX 6
#define GNB_CONFIG_NB_ANT_PORTS_IDX
#define GNB_CONFIG_NB_ANT_TX_IDX
#define GNB_CONFIG_NB_ANT_RX_IDX
#define GNB_CONFIG_TX_GAIN_IDX
#define GNB_CONFIG_RX_GAIN_IDX
#define GNB_CONFIG_MIB_SUBCARRIERSPACINGCOMMON_IDX
#define GNB_CONFIG_MIB_SSB_SUBCARRIEROFFSET_IDX
#define GNB_CONFIG_MIB_DMRS_TYPEA_POSITION_IDX
#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX
#define GNB_CONFIG_SIB1_FREQUENCYOFFSETSSB_IDX
#define GNB_CONFIG_SIB1_SSB_PERIODICITYSERVINGCELL_IDX
#define GNB_CONFIG_SIB1_SS_PBCH_BLOCKPOWER_IDX
#define GNB_CONFIG_ABSOLUTEFREQUENCYSSB_IDX
#define GNB_CONFIG_SSB_SUBCARRIEROFFSET_IDX
#define GNB_CONFIG_DL_FREQBANDINDICATORNR_IDX
#define GNB_CONFIG_DL_ABSOLUTEFREQUENCYPOINTA_IDX
#define GNB_CONFIG_DL_OFFSETTOCARRIER_IDX
#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_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_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_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_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
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER_IDX
#define GNB_CONFIG_REFERENCESUBCARRIERSPACING_IDX
#define GNB_CONFIG_DL_UL_TRANSMISSIONPERIODICITY_IDX
#define GNB_CONFIG_NROFDOWNLINKSLOTS_IDX
#define GNB_CONFIG_NROFDOWNLINKSYMBOLS_IDX
#define GNB_CONFIG_NROFUPLINKSLOTS_IDX
#define GNB_CONFIG_NROFUPLINKSYMBOLS_IDX
#define GNB_CONFIG_RACH_TOTALNUMBEROFRA_PREAMBLES_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT_IDX
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN_IDX
#define GNB_CONFIG_RACH_GROUPBCONFIGURED_IDX
#define GNB_CONFIG_RACH_RA_MSG3SIZEGROUPA_IDX
#define GNB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX
#define GNB_CONFIG_RACH_NUMBEROFRA_PREAMBLESGROUPA_IDX
#define GNB_CONFIG_RACH_RA_CONTENTIONRESOLUTIONTIMER_IDX
#define GNB_CONFIG_RSRP_THRESHOLDSSB_IDX
#define GNB_CONFIG_RSRP_THRESHOLDSSB_SUL_IDX
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_CHOICE_IDX
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L839_IDX
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L139_IDX
#define GNB_CONFIG_PRACH_MSG1_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_RESTRICTEDSETCONFIG_IDX
#define GNB_CONFIG_MSG3_TRANSFORMPRECODING_IDX
#define GNB_CONFIG_PRACH_CONFIGURATIONINDEX_IDX
#define GNB_CONFIG_PRACH_MSG1_FDM_IDX
#define GNB_CONFIG_PRACH_MSG1_FREQUENCYSTART_IDX
#define GNB_CONFIG_ZEROCORRELATIONZONECONFIG_IDX
#define GNB_CONFIG_PREAMBLERECEIVEDTARGETPOWER_IDX
#define GNB_CONFIG_PREAMBLETRANSMAX_IDX
#define GNB_CONFIG_POWERRAMPINGSTEP_IDX
#define GNB_CONFIG_RA_RESPONSEWINDOW_IDX
#define GNB_CONFIG_GROUPHOPPINGENABLEDTRANSFORMPRECODING_IDX
#define GNB_CONFIG_MSG3_DELTAPREAMBLE_IDX
#define GNB_CONFIG_P0_NOMINALWITHGRANT_IDX
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2_IDX
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX
#define GNB_CONFIG_PUCCH_GROUPHOPPING_IDX
#define GNB_CONFIG_P0_NOMINAL_IDX
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0_IDX
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX
#define GNB_CONFIG_RATEMATCHPATTERNID_IDX
#define GNB_CONFIG_RATEMATCHPATTERN_PATTERNTYPE_IDX
#define GNB_CONFIG_SYMBOLSINRESOURCEBLOCK_IDX
#define GNB_CONFIG_PERIODICITYANDPATTERN_IDX
#define GNB_CONFIG_RATEMATCHPATTERN_CONTROLRESOURCESET_IDX
#define GNB_CONFIG_RATEMATCHPATTERN_SUBCARRIERSPACING_IDX
#define GNB_CONFIG_RATEMATCHPATTERN_MODE_IDX
#define GNB_CONFIG_SEARCHSPACESIB1_IDX
#define GNB_CONFIG_SEARCHSPACEOTHERSYSTEMINFORMATION_IDX
#define GNB_CONFIG_PAGINGSEARCHSPACE_IDX
#define GNB_CONFIG_RA_SEARCHSPACE_IDX
#define GNB_CONFIG_RACH_RA_CONTROLRESOURCESET_IDX
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESETID_IDX
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESET_DURATION_IDX
#define GNB_CONFIG_PDCCH_CCE_REG_MAPPINGTYPE_IDX
#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_TCI_STATEID_IDX
#define GNB_CONFIG_TCI_PRESENTINDCI_IDX
#define GNB_CONFIG_SEARCHSPACEID_IDX
#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL1_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL2_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL4_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL5_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL8_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL10_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL16_IDX
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL20_IDX
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1_IDX
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2_IDX
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4_IDX
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8_IDX
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16_IDX
#define GNB_CONFIG_SEARCHSPACE_SEARCHSPACETYPE_IDX
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1_IDX
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2_IDX
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4_IDX
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8_IDX
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16_IDX
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY_IDX
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES_IDX
#define GNB_CONFIG_UE_SPECIFIC__DCI_FORMATS_IDX
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL_IDX
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL_IDX
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS_IDX
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_V_SHIFT_IDX
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD_IDX
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET_IDX
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE_IDX
#define GNB_CONFIG_FRAME_TYPE_IDX 0
#define GNB_CONFIG_DL_PREFIX_TYPE_IDX 1
#define GNB_CONFIG_UL_PREFIX_TYPE_IDX 2
#define GNB_CONFIG_EUTRA_BAND_IDX 3
#define GNB_CONFIG_DOWNLINK_FREQUENCY_IDX 4
#define GNB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 5
#define GNB_CONFIG_NID_CELL_IDX 6
#define GNB_CONFIG_N_RB_DL_IDX 7
#define GNB_CONFIG_NB_ANT_PORTS_IDX 8
#define GNB_CONFIG_NB_ANT_TX_IDX 9
#define GNB_CONFIG_NB_ANT_RX_IDX 10
#define GNB_CONFIG_TX_GAIN_IDX 11
#define GNB_CONFIG_RX_GAIN_IDX 12
#define GNB_CONFIG_MIB_SUBCARRIERSPACINGCOMMON_IDX 13
#define GNB_CONFIG_MIB_SSB_SUBCARRIEROFFSET_IDX 14
#define GNB_CONFIG_MIB_DMRS_TYPEA_POSITION_IDX 15
#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX 16
#define GNB_CONFIG_SIB1_FREQUENCYOFFSETSSB_IDX 17
#define GNB_CONFIG_SIB1_SSB_PERIODICITYSERVINGCELL_IDX 18
#define GNB_CONFIG_SIB1_SS_PBCH_BLOCKPOWER_IDX 19
#define GNB_CONFIG_ABSOLUTEFREQUENCYSSB_IDX 20
#define GNB_CONFIG_SSB_SUBCARRIEROFFSET_IDX 21
#define GNB_CONFIG_DL_FREQBANDINDICATORNR_IDX 22
#define GNB_CONFIG_DL_ABSOLUTEFREQUENCYPOINTA_IDX 23
#define GNB_CONFIG_DL_OFFSETTOCARRIER_IDX 24
#define GNB_CONFIG_DL_SUBCARRIERSPACING_IDX 25
#define GNB_CONFIG_DL_SCS_SPECIFICCARRIER_K0_IDX 26
#define GNB_CONFIG_DL_CARRIERBANDWIDTH_IDX 27
#define GNB_CONFIG_DL_LOCATIONANDBANDWIDTH_IDX 28
#define GNB_CONFIG_DL_BWP_SUBCARRIERSPACING_IDX 29
#define GNB_CONFIG_DL_BWP_PREFIX_TYPE_IDX 30
#define GNB_CONFIG_UL_FREQBANDINDICATORNR_IDX 31
#define GNB_CONFIG_UL_ABSOLUTEFREQUENCYPOINTA_IDX 32
#define GNB_CONFIG_UL_ADDITIONALSPECTRUMEMISSION_IDX; 33
#define GNB_CONFIG_UL_P_MAX_IDX 34
#define GNB_CONFIG_UL_FREQUENCYSHIFT7P5KHZ_IDX 35
#define GNB_CONFIG_UL_OFFSETTOCARRIER_IDX 36
#define GNB_CONFIG_UL_SCS_SUBCARRIERSPACING_IDX 37
#define GNB_CONFIG_UL_SCS_SPECIFICCARRIER_K0_IDX 38
#define GNB_CONFIG_UL_CARRIERBANDWIDTH_IDX 39
#define GNB_CONFIG_UL_LOCATIONANDBANDWIDTH_IDX 41
#define GNB_CONFIG_UL_BWP_SUBCARRIERSPACING_IDX 42
#define GNB_CONFIG_UL_BWP_PREFIX_TYPE_IDX 43
#define GNB_CONFIG_SUBCARRIERSPACINGCOMMON_IDX 44
#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX 45
#define GNB_CONFIG_FREQUENCYOFFSETSSB_IDX 46
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR_IDX 47
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL_IDX 48
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION_IDX 49
#define GNB_CONFIG_NIA_SUBCARRIERSPACING_IDX 50
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER_IDX 51
#define GNB_CONFIG_REFERENCESUBCARRIERSPACING_IDX 52
#define GNB_CONFIG_DL_UL_TRANSMISSIONPERIODICITY_IDX 53
#define GNB_CONFIG_NROFDOWNLINKSLOTS_IDX 54
#define GNB_CONFIG_NROFDOWNLINKSYMBOLS_IDX 55
#define GNB_CONFIG_NROFUPLINKSLOTS_IDX 56
#define GNB_CONFIG_NROFUPLINKSYMBOLS_IDX 57
#define GNB_CONFIG_RACH_TOTALNUMBEROFRA_PREAMBLES_IDX 58
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE_IDX 59
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH_IDX 60
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH_IDX 61
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF_IDX 62
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE_IDX 63
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO_IDX 64
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR_IDX 65
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT_IDX 66
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN_IDX 67
#define GNB_CONFIG_RACH_GROUPBCONFIGURED_IDX 68
#define GNB_CONFIG_RACH_RA_MSG3SIZEGROUPA_IDX 69
#define GNB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX 70
#define GNB_CONFIG_RACH_NUMBEROFRA_PREAMBLESGROUPA_IDX 71
#define GNB_CONFIG_RACH_RA_CONTENTIONRESOLUTIONTIMER_IDX 72
#define GNB_CONFIG_RSRP_THRESHOLDSSB_IDX 73
#define GNB_CONFIG_RSRP_THRESHOLDSSB_SUL_IDX 74
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_CHOICE_IDX 75
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L839_IDX 76
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L139_IDX 77
#define GNB_CONFIG_PRACH_MSG1_SUBCARRIERSPACING_IDX 78
#define GNB_CONFIG_RESTRICTEDSETCONFIG_IDX 79
#define GNB_CONFIG_MSG3_TRANSFORMPRECODING_IDX 80
#define GNB_CONFIG_PRACH_CONFIGURATIONINDEX_IDX 81
#define GNB_CONFIG_PRACH_MSG1_FDM_IDX 82
#define GNB_CONFIG_PRACH_MSG1_FREQUENCYSTART_IDX 83
#define GNB_CONFIG_ZEROCORRELATIONZONECONFIG_IDX 84
#define GNB_CONFIG_PREAMBLERECEIVEDTARGETPOWER_IDX 85
#define GNB_CONFIG_PREAMBLETRANSMAX_IDX 86
#define GNB_CONFIG_POWERRAMPINGSTEP_IDX 87
#define GNB_CONFIG_RA_RESPONSEWINDOW_IDX 88
#define GNB_CONFIG_GROUPHOPPINGENABLEDTRANSFORMPRECODING_IDX 89
#define GNB_CONFIG_MSG3_DELTAPREAMBLE_IDX 90
#define GNB_CONFIG_P0_NOMINALWITHGRANT_IDX 91
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2_IDX 92
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 93
#define GNB_CONFIG_PUCCH_GROUPHOPPING_IDX 94
#define GNB_CONFIG_P0_NOMINAL_IDX 95
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0_IDX 96
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 97
#define GNB_CONFIG_RATEMATCHPATTERNID_IDX 98
#define GNB_CONFIG_RATEMATCHPATTERN_PATTERNTYPE_IDX 99
#define GNB_CONFIG_SYMBOLSINRESOURCEBLOCK_IDX 100
#define GNB_CONFIG_PERIODICITYANDPATTERN_IDX 101
#define GNB_CONFIG_RATEMATCHPATTERN_CONTROLRESOURCESET_IDX 102
#define GNB_CONFIG_RATEMATCHPATTERN_SUBCARRIERSPACING_IDX 103
#define GNB_CONFIG_RATEMATCHPATTERN_MODE_IDX 104
#define GNB_CONFIG_SEARCHSPACESIB1_IDX 105
#define GNB_CONFIG_SEARCHSPACEOTHERSYSTEMINFORMATION_IDX 106
#define GNB_CONFIG_PAGINGSEARCHSPACE_IDX 107
#define GNB_CONFIG_RA_SEARCHSPACE_IDX 108
#define GNB_CONFIG_RACH_RA_CONTROLRESOURCESET_IDX 109
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESETID_IDX 110
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESET_DURATION_IDX 111
#define GNB_CONFIG_PDCCH_CCE_REG_MAPPINGTYPE_IDX 112
#define GNB_CONFIG_PDCCH_REG_BUNDLESIZE_IDX 113
#define GNB_CONFIG_PDCCH_INTERLEAVERSIZE_IDX 114
#define GNB_CONFIG_PDCCH_SHIFTINDEX_IDX 115
#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX 116
#define GNB_CONFIG_PDCCH_TCI_STATEID_IDX 117
#define GNB_CONFIG_TCI_PRESENTINDCI_IDX 118
#define GNB_CONFIG_SEARCHSPACEID_IDX 119
#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX 120
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE_IDX 121
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL1_IDX 122
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL2_IDX 123
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL4_IDX 124
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL5_IDX 125
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL8_IDX 126
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL10_IDX 127
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL16_IDX 128
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL20_IDX 129
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1_IDX 130
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2_IDX 131
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4_IDX 132
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8_IDX 133
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16_IDX 134
#define GNB_CONFIG_SEARCHSPACE_SEARCHSPACETYPE_IDX 135
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1_IDX 136
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2_IDX 137
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4_IDX 138
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8_IDX 139
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16_IDX 140
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY_IDX 141
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES_IDX 142
#define GNB_CONFIG_UE_SPECIFIC__DCI_FORMATS_IDX 143
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL_IDX 144
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL_IDX 145
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS_IDX 146
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_V_SHIFT_IDX 147
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD_IDX 148
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET_IDX 149
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE_IDX 150
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* SRB1 configuration parameters section name */
#define GNB_CONFIG_STRING_SRB1 "srb1_parameters"
/* SRB1 configuration parameters names */
#define GNB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit"
#define GNB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering"
#define GNB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT "timer_status_prohibit"
#define GNB_CONFIG_STRING_SRB1_POLL_PDU "poll_pdu"
#define GNB_CONFIG_STRING_SRB1_POLL_BYTE "poll_byte"
#define GNB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD "max_retx_threshold"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* SRB1 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define SRB1PARAMS_DESC { \
{GNB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, NULL, 0, iptr:&srb1_timer_poll_retransmit, defintval:80, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SRB1_TIMER_REORDERING, NULL, 0, iptr:&srb1_timer_reordering, defintval:35, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, NULL, 0, iptr:&srb1_timer_status_prohibit, defintval:0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SRB1_POLL_PDU, NULL, 0, iptr:&srb1_poll_pdu, defintval:4, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SRB1_POLL_BYTE, NULL, 0, iptr:&srb1_poll_byte, defintval:99999, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, NULL, 0, iptr:&srb1_max_retx_threshold, defintval:4, TYPE_UINT, 0} \
}
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* MME configuration parameters section name */
#define GNB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address"
/* SRB1 configuration parameters names */
#define GNB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4"
#define GNB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6"
#define GNB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active"
#define GNB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference"
/*-------------------------------------------------------------------------------------------------------------------------------------*/
/* MME configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------*/
#define S1PARAMS_DESC { \
{GNB_CONFIG_STRING_MME_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
}
#define GNB_MME_IPV4_ADDRESS_IDX 0
#define GNB_MME_IPV6_ADDRESS_IDX 1
#define GNB_MME_IP_ADDRESS_ACTIVE_IDX 2
#define GNB_MME_IP_ADDRESS_PREFERENCE_IDX 3
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* SCTP configuration parameters section name */
#define GNB_CONFIG_STRING_SCTP_CONFIG "SCTP"
/* SCTP configuration parameters names */
#define GNB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS"
#define GNB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* SRB1 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define SCTPPARAMS_DESC { \
{GNB_CONFIG_STRING_SCTP_INSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SCTP_OUTSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0} \
}
#define GNB_SCTP_INSTREAMS_IDX 0
#define GNB_SCTP_OUTSTREAMS_IDX 1
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* S1 interface configuration parameters section name */
#define GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES"
#define GNB_INTERFACE_NAME_FOR_S1_MME_IDX 0
#define GNB_IPV4_ADDRESS_FOR_S1_MME_IDX 1
#define GNB_INTERFACE_NAME_FOR_S1U_IDX 2
#define GNB_IPV4_ADDR_FOR_S1U_IDX 3
#define GNB_PORT_FOR_S1U_IDX 4
/* S1 interface configuration parameters names */
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME "GNB_INTERFACE_NAME_FOR_S1_MME"
#define GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME "GNB_IPV4_ADDRESS_FOR_S1_MME"
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U "GNB_INTERFACE_NAME_FOR_S1U"
#define GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U "GNB_IPV4_ADDRESS_FOR_S1U"
#define GNB_CONFIG_STRING_GNB_PORT_FOR_S1U "GNB_PORT_FOR_S1U"
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
/* S1 interface configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
#define NETPARAMS_DESC { \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* GTPU configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GTPUPARAMS_DESC { \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:&enb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* L1 configuration section names */
#define CONFIG_STRING_L1_LIST "L1s"
#define CONFIG_STRING_L1_CONFIG "l1_config"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER"
#define CONFIG_STRING_FLEXRAN_ENABLED "FLEXRAN_ENABLED"
#define CONFIG_STRING_FLEXRAN_INTERFACE_NAME "FLEXRAN_INTERFACE_NAME"
#define CONFIG_STRING_FLEXRAN_IPV4_ADDRESS "FLEXRAN_IPV4_ADDRESS"
#define CONFIG_STRING_FLEXRAN_PORT "FLEXRAN_PORT"
#define CONFIG_STRING_FLEXRAN_CACHE "FLEXRAN_CACHE"
#define CONFIG_STRING_FLEXRAN_AWAIT_RECONF "FLEXRAN_AWAIT_RECONF"
#define FLEXRAN_ENABLED 0
#define FLEXRAN_INTERFACE_NAME_IDX 1
#define FLEXRAN_IPV4_ADDRESS_IDX 2
#define FLEXRAN_PORT_IDX 3
#define FLEXRAN_CACHE_IDX 4
#define FLEXRAN_AWAIT_RECONF_IDX 5
#define FLEXRANPARAMS_DESC { \
{CONFIG_STRING_FLEXRAN_ENABLED, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_INTERFACE_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_IPV4_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_PORT, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
{CONFIG_STRING_FLEXRAN_CACHE, NULL, 0, strptr:NULL, defstrval:"/mnt/oai_agent_cache", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_AWAIT_RECONF, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0} \
}
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* MACRLC configuration section names */
#define CONFIG_STRING_MACRLC_LIST "MACRLCs"
#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config"
/* MACRLC configuration parameters names */
#define CONFIG_STRING_MACRLC_CC "num_cc"
#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference"
#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address"
#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc"
#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_PHY_TEST_MODE "phy_test_mode"
#define MACRLC_CC_IDX 0
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
#define MACRLC_LOCAL_N_IF_NAME_IDX 2
#define MACRLC_LOCAL_N_ADDRESS_IDX 3
#define MACRLC_REMOTE_N_ADDRESS_IDX 4
#define MACRLC_LOCAL_N_PORTC_IDX 5
#define MACRLC_REMOTE_N_PORTC_IDX 6
#define MACRLC_LOCAL_N_PORTD_IDX 7
#define MACRLC_REMOTE_N_PORTD_IDX 8
#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9
#define MACRLC_LOCAL_S_IF_NAME_IDX 10
#define MACRLC_LOCAL_S_ADDRESS_IDX 11
#define MACRLC_REMOTE_S_ADDRESS_IDX 12
#define MACRLC_LOCAL_S_PORTC_IDX 13
#define MACRLC_REMOTE_S_PORTC_IDX 14
#define MACRLC_LOCAL_S_PORTD_IDX 15
#define MACRLC_REMOTE_S_PORTD_IDX 16
#define MACRLC_PHY_TEST_IDX 17
+68 -70
View File
@@ -48,87 +48,85 @@ extern RAN_CONTEXT_t RC;
void mac_top_init_eNB(void)
{
module_id_t i, j;
int list_el;
UE_list_t *UE_list;
eNB_MAC_INST *mac;
module_id_t i, j;
int list_el;
UE_list_t *UE_list;
eNB_MAC_INST *mac;
LOG_I(MAC, "[MAIN] Init function start:nb_macrlc_inst=%d\n",
RC.nb_macrlc_inst);
LOG_I(MAC, "[MAIN] Init function start:nb_macrlc_inst=%d\n",
RC.nb_macrlc_inst);
if (RC.nb_macrlc_inst > 0) {
RC.mac =
(eNB_MAC_INST **) malloc16(RC.nb_macrlc_inst *
sizeof(eNB_MAC_INST *));
AssertFatal(RC.mac != NULL,
"can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",
RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *),
RC.nb_macrlc_inst, sizeof(eNB_MAC_INST));
for (i = 0; i < RC.nb_macrlc_inst; i++) {
RC.mac[i] = (eNB_MAC_INST *) malloc16(sizeof(eNB_MAC_INST));
AssertFatal(RC.mac != NULL,
"can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",
RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *),
RC.nb_macrlc_inst, sizeof(eNB_MAC_INST));
LOG_D(MAC,
"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",
sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, RC.mac);
bzero(RC.mac[i], sizeof(eNB_MAC_INST));
RC.mac[i]->Mod_id = i;
for (j = 0; j < MAX_NUM_CCs; j++) {
RC.mac[i]->DL_req[j].dl_config_request_body.
dl_config_pdu_list = RC.mac[i]->dl_config_pdu_list[j];
RC.mac[i]->UL_req[j].ul_config_request_body.
ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list[j];
for (int k = 0; k < 10; k++)
RC.mac[i]->UL_req_tmp[j][k].
ul_config_request_body.ul_config_pdu_list =
RC.mac[i]->ul_config_pdu_list_tmp[j][k];
RC.mac[i]->HI_DCI0_req[j].
hi_dci0_request_body.hi_dci0_pdu_list =
RC.mac[i]->hi_dci0_pdu_list[j];
RC.mac[i]->TX_req[j].tx_request_body.tx_pdu_list =
RC.mac[i]->tx_request_pdu[j];
RC.mac[i]->ul_handle = 0;
}
}
AssertFatal(rlc_module_init() == 0,
"Could not initialize RLC layer\n");
// These should be out of here later
pdcp_layer_init();
rrc_init_global_param();
} else {
RC.mac = NULL;
}
// Initialize Linked-List for Active UEs
if (RC.nb_macrlc_inst > 0) {
RC.mac = (eNB_MAC_INST **) malloc16(RC.nb_macrlc_inst *sizeof(eNB_MAC_INST *));
AssertFatal(RC.mac != NULL,"can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",
RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *),
RC.nb_macrlc_inst, sizeof(eNB_MAC_INST));
for (i = 0; i < RC.nb_macrlc_inst; i++) {
mac = RC.mac[i];
RC.mac[i] = (eNB_MAC_INST *) malloc16(sizeof(eNB_MAC_INST));
AssertFatal(RC.mac != NULL,"can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n",
RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *),
RC.nb_macrlc_inst, sizeof(eNB_MAC_INST));
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, RC.mac);
bzero(RC.mac[i], sizeof(eNB_MAC_INST));
RC.mac[i]->Mod_id = i;
for (j = 0; j < MAX_NUM_CCs; j++) {
RC.mac[i]->DL_req[j].dl_config_request_body.
dl_config_pdu_list = RC.mac[i]->dl_config_pdu_list[j];
RC.mac[i]->UL_req[j].ul_config_request_body.
ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list[j];
for (int k = 0; k < 10; k++)
RC.mac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list =RC.mac[i]->ul_config_pdu_list_tmp[j][k];
RC.mac[i]->HI_DCI0_req[j].hi_dci0_request_body.hi_dci0_pdu_list =RC.mac[i]->hi_dci0_pdu_list[j];
RC.mac[i]->TX_req[j].tx_request_body.tx_pdu_list =
RC.mac[i]->tx_request_pdu[j];
RC.mac[i]->ul_handle = 0;
}
}//END for (i = 0; i < RC.nb_macrlc_inst; i++)
AssertFatal(rlc_module_init() == 0,
"Could not initialize RLC layer\n");
mac->if_inst = IF_Module_init(i);
// These should be out of here later
pdcp_layer_init();
UE_list = &mac->UE_list;
rrc_init_global_param();
UE_list->num_UEs = 0;
UE_list->head = -1;
UE_list->head_ul = -1;
UE_list->avail = 0;
}else {
RC.mac = NULL;
}
for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) {
UE_list->next[list_el] = list_el + 1;
UE_list->next_ul[list_el] = list_el + 1;
}
// Initialize Linked-List for Active UEs
for (i = 0; i < RC.nb_macrlc_inst; i++) {
mac = RC.mac[i];
mac->if_inst = IF_Module_init(i);
UE_list->next[list_el] = -1;
UE_list->next_ul[list_el] = -1;
UE_list = &mac->UE_list;
UE_list->num_UEs = 0;
UE_list->head = -1;
UE_list->head_ul = -1;
UE_list->avail = 0;
for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) {
UE_list->next[list_el] = list_el + 1;
UE_list->next_ul[list_el] = list_el + 1;
}
UE_list->next[list_el] = -1;
UE_list->next_ul[list_el] = -1;
}
}
void mac_init_cell_params(int Mod_idP, int CC_idP)
+243
View File
@@ -0,0 +1,243 @@
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/ran_context.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_ServingCellConfigCommon.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
extern RAN_CONTEXT_t RC;
//extern int l2_init_gNB(void);
extern void mac_top_init_gNB(void);
extern uint8_t nfapi_mode;
int32_t **rxdata;
int32_t **txdata;
typedef struct eutra_bandentry_s {
int16_t band;
uint32_t ul_min;
uint32_t ul_max;
uint32_t dl_min;
uint32_t dl_max;
uint32_t N_OFFs_DL;
} eutra_bandentry_t;
typedef struct band_info_s {
int nbands;
eutra_bandentry_t band_info[100];
} band_info_t;
static const eutra_bandentry_t eutra_bandtable[] = {
{1, 19200, 19800, 21100, 21700, 0},
{2, 18500, 19100, 19300, 19900, 6000},
{3, 17100, 17850, 18050, 18800, 12000},
{4, 17100, 17550, 21100, 21550, 19500},
{5, 8240, 8490, 8690, 8940, 24000},
{6, 8300, 8400, 8750, 8850, 26500},
{7, 25000, 25700, 26200, 26900, 27500},
{8, 8800, 9150, 9250, 9600, 34500},
{9, 17499, 17849, 18449, 18799, 38000},
{10, 17100, 17700, 21100, 21700, 41500},
{11, 14279, 14529, 14759, 15009, 47500},
{12, 6980, 7160, 7280, 7460, 50100},
{13, 7770, 7870, 7460, 7560, 51800},
{14, 7880, 7980, 7580, 7680, 52800},
{17, 7040, 7160, 7340, 7460, 57300},
{18, 8150, 9650, 8600, 10100, 58500},
{19, 8300, 8450, 8750, 8900, 60000},
{20, 8320, 8620, 7910, 8210, 61500},
{21, 14479, 14629, 14959, 15109, 64500},
{22, 34100, 34900, 35100, 35900, 66000},
{23, 20000, 20200, 21800, 22000, 75000},
{24, 16126, 16605, 15250, 15590, 77000},
{25, 18500, 19150, 19300, 19950, 80400},
{26, 8140, 8490, 8590, 8940, 86900},
{27, 8070, 8240, 8520, 8690, 90400},
{28, 7030, 7580, 7580, 8130, 92100},
{29, 0, 0, 7170, 7280, 96600},
{30, 23050, 23250, 23500, 23600, 97700},
{31, 45250, 34900, 46250, 35900, 98700},
{32, 0, 0, 14520, 14960, 99200},
{33, 19000, 19200, 19000, 19200, 36000},
{34, 20100, 20250, 20100, 20250, 36200},
{35, 18500, 19100, 18500, 19100, 36350},
{36, 19300, 19900, 19300, 19900, 36950},
{37, 19100, 19300, 19100, 19300, 37550},
{38, 25700, 26200, 25700, 26300, 37750},
{39, 18800, 19200, 18800, 19200, 38250},
{40, 23000, 24000, 23000, 24000, 38650},
{41, 24960, 26900, 24960, 26900, 39650},
{42, 34000, 36000, 34000, 36000, 41590},
{43, 36000, 38000, 36000, 38000, 43590},
{44, 7030, 8030, 7030, 8030, 45590},
{45, 14470, 14670, 14470, 14670, 46590},
{46, 51500, 59250, 51500, 59250, 46790},
{65, 19200, 20100, 21100, 22000, 65536},
{66, 17100, 18000, 21100, 22000, 66436},
{67, 0, 0, 7380, 7580, 67336},
{68, 6980, 7280, 7530, 7830, 67536}
};
uint32_t nr_to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw)
{
uint32_t dl_CarrierFreq_by_100k = dl_CarrierFreq / 100000;
int bw_by_100 = bw / 100;
int i;
AssertFatal(eutra_bandP < 69, "eutra_band %d > 68\n", eutra_bandP);
for (i = 0; i < 69 && eutra_bandtable[i].band != eutra_bandP; i++);
AssertFatal(dl_CarrierFreq_by_100k >= eutra_bandtable[i].dl_min,
"Band %d, bw %u : DL carrier frequency %u Hz < %u\n",
eutra_bandP, bw, dl_CarrierFreq,
eutra_bandtable[i].dl_min);
AssertFatal(dl_CarrierFreq_by_100k <=
(eutra_bandtable[i].dl_max - bw_by_100),
"Band %d, bw %u: DL carrier frequency %u Hz > %d\n",
eutra_bandP, bw, dl_CarrierFreq,
eutra_bandtable[i].dl_max - bw_by_100);
return (dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min +
(eutra_bandtable[i].N_OFFs_DL / 10));
}
void config_nr_mib(int Mod_idP,
int CC_idP,
int p_gNBP,
int subCarrierSpacingCommon,
uint32_t ssb_SubcarrierOffset,
int dmrs_TypeA_Position,
uint32_t pdcch_ConfigSIB1,
int cellBarred,
int intraFreqReselection
){
nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
cfg->num_tlv=0;
cfg->rf_config.tx_antenna_ports.value = p_gNBP;
cfg->rf_config.tx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG;
cfg->num_tlv++;
cfg->sch_config.ssb_subcarrier_offset.value = ssb_SubcarrierOffset;
}
void config_common(int Mod_idP,
int CC_idP,
int eutra_bandP,
int dl_CarrierFreqP,
int dl_BandwidthP
){
nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
// FDD
cfg->subframe_config.duplex_mode.value = 1;
cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG;
cfg->num_tlv++;
/// In NR DL and UL will be different band
cfg->nfapi_config.rf_bands.number_rf_bands = 1;
cfg->nfapi_config.rf_bands.rf_band[0] = eutra_bandP;
cfg->nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG;
cfg->num_tlv++;
cfg->nfapi_config.earfcn.value = nr_to_earfcn(eutra_bandP,dl_CarrierFreqP,dl_BandwidthP*180/100);
cfg->nfapi_config.earfcn.tl.tag = NFAPI_NFAPI_EARFCN_TAG;
cfg->num_tlv++;
cfg->subframe_config.numerology_index_mu.value = 1;
//cfg->subframe_config.tl.tag =
//cfg->num_tlv++;
cfg->dl_frequencyinfo.DL_carrierBandwidth.value = dl_BandwidthP;
cfg->dl_frequencyinfo.DL_carrierBandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; //temporary
cfg->num_tlv++;
LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
cfg->ul_frequencyinfo.UL_carrierBandwidth.value = dl_BandwidthP;
cfg->ul_frequencyinfo.UL_carrierBandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG; //temporary
cfg->num_tlv++;
//cfg->sch_config.half_frame_index.value = 0; Fix in PHY
//cfg->sch_config.n_ssb_crb.value = 86; Fix in PHY
}
/*void config_servingcellconfigcommon(){
}*/
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int CC_idP,
int p_gNB,
int eutra_bandP,
int dl_CarrierFreqP,
int dl_BandwidthP,
NR_BCCH_BCH_Message_t *mib,
NR_ServingCellConfigCommon_t *servingcellconfigcommon
){
if( mib != NULL ){
config_nr_mib(Mod_idP,
CC_idP,
p_gNB,
mib->message.choice.mib->subCarrierSpacingCommon,
mib->message.choice.mib->ssb_SubcarrierOffset,
mib->message.choice.mib->dmrs_TypeA_Position,
mib->message.choice.mib->pdcch_ConfigSIB1,
mib->message.choice.mib->cellBarred,
mib->message.choice.mib->intraFreqReselection
);
}// END if( mib != NULL )
if( servingcellconfigcommon != NULL ){
config_common(Mod_idP,
CC_idP,
eutra_bandP,
dl_CarrierFreqP,
dl_BandwidthP
);
}//END if( servingcellconfigcommon != NULL )
LOG_E(MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.mac[Mod_idP]->if_inst->PHY_config_req);
// if in nFAPI mode
if ( (nfapi_mode == 1 || nfapi_mode == 2) && (RC.nrmac[Mod_idP]->if_inst->PHY_config_req == NULL) ){
while(RC.nrmac[Mod_idP]->if_inst->PHY_config_req == NULL) {
// DJP AssertFatal(RC.nrmac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n");
usleep(100 * 1000);
printf("Waiting for PHY_config_req\n");
}
}
if (servingcellconfigcommon != NULL){
NR_PHY_Config_t phycfg;
phycfg.Mod_id = Mod_idP;
phycfg.CC_id = CC_idP;
phycfg.cfg = &RC.nrmac[Mod_idP]->config[CC_idP];
if (RC.nrmac[Mod_idP]->if_inst->PHY_config_req) RC.nrmac[Mod_idP]->if_inst->PHY_config_req(&phycfg);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
}
return(0);
}// END rrc_mac_config_req_gNB
+96
View File
@@ -0,0 +1,96 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file LAYER2/MAC/defs.h
* \brief MAC data structures, constant, and function prototype
* \author Navid Nikaein and Raymond Knopp
* \date 2011
* \version 0.5
* \email navid.nikaein@eurecom.fr
*/
/** @defgroup _oai2 openair2 Reference Implementation
* @ingroup _ref_implementation_
* @{
*/
/*@}*/
#ifndef __LAYER2_NR_MAC_DEFS_H__
#define __LAYER2_NR_MAC_DEFS_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "COMMON/platform_constants.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_ServingCellConfigCommon.h"
#include "nfapi_nr_interface.h"
#include "NR_PHY_INTERFACE/IF_Module.h"
#include "PHY/TOOLS/time_meas.h"
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t
#include "targets/ARCH/COMMON/common_lib.h"
#include "LAYER2/MAC/mac.h" // temporary
/*! \brief top level eNB MAC structure */
typedef struct gNB_MAC_INST_s {
/// Ethernet parameters for northbound midhaul interface
eth_params_t eth_params_n;
/// Ethernet parameters for fronthaul interface
eth_params_t eth_params_s;
/// Module
module_id_t Mod_id;
/// frame counter
frame_t frame;
/// subframe counter
sub_frame_t subframe;
/// Pointer to IF module instance for PHY
NR_IF_Module_t *if_inst;
/// NFAPI Config Request Structure
nfapi_nr_config_request_t config[NFAPI_CC_MAX];
/// NFAPI DL Config Request Structure
nfapi_dl_config_request_t DL_req[NFAPI_CC_MAX];
/// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place
nfapi_ul_config_request_t UL_req[NFAPI_CC_MAX];
/// Preallocated DL pdu list
nfapi_dl_config_request_pdu_t dl_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_DL_PDU];
/// Preallocated UL pdu list
nfapi_ul_config_request_pdu_t ul_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_UL_PDU];
/// NFAPI HI/DCI0 Config Request Structure
nfapi_hi_dci0_request_t HI_DCI0_req[NFAPI_CC_MAX];
/// NFAPI DL PDU structure
nfapi_tx_request_t TX_req[NFAPI_CC_MAX];
/// Common cell resources
COMMON_channels_t common_channels[NFAPI_CC_MAX];
UE_list_t UE_list;
} gNB_MAC_INST;
#endif /*__LAYER2_NR_MAC_DEFS_H__ */
+22
View File
@@ -0,0 +1,22 @@
#ifndef __LAYER2_NR_MAC_PROTO_H__
#define __LAYER2_NR_MAC_PROTO_H__
#include "mac.h"
#include "PHY/defs_nr_common.h"
void mac_top_init_gNB(void);
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int CC_id,
int p_gNB,
int eutra_bandP,
int dl_CarrierFreqP,
int dl_BandwidthP,
NR_BCCH_BCH_Message_t *mib,
NR_ServingCellConfigCommon_t *servingcellconfigcommon
);
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
+124
View File
@@ -0,0 +1,124 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file main.c
* \brief top init of Layer 2
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \email: navid.nikaein@eurecom.fr
* @ingroup _mac
*/
#include "mac_proto.h"
#include "LAYER2/MAC/mac_extern.h" //temporary
#include "assertions.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
#include "RRC/NR/nr_rrc_defs.h"
#include "UTIL/LOG/log.h"
//#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
void mac_top_init_gNB(void)
{
module_id_t i, j;
int list_el;
UE_list_t *UE_list;
gNB_MAC_INST *nrmac;
LOG_I(MAC, "[MAIN] Init function start:nb_nr_macrlc_inst=%d\n",RC.nb_nr_macrlc_inst);
if (RC.nb_nr_macrlc_inst > 0) {
RC.nrmac = (gNB_MAC_INST **) malloc16(RC.nb_nr_macrlc_inst *sizeof(gNB_MAC_INST *));
AssertFatal(RC.nrmac != NULL,"can't ALLOCATE %zu Bytes for %d gNB_MAC_INST with size %zu \n",
RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *),
RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST));
for (i = 0; i < RC.nb_nr_macrlc_inst; i++) {
RC.nrmac[i] = (gNB_MAC_INST *) malloc16(sizeof(gNB_MAC_INST));
AssertFatal(RC.nrmac != NULL,"can't ALLOCATE %zu Bytes for %d gNB_MAC_INST with size %zu \n",
RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *),
RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST));
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d gNB_MAC_INST @ %p\n",sizeof(gNB_MAC_INST), RC.nb_nr_macrlc_inst, RC.mac);
bzero(RC.nrmac[i], sizeof(gNB_MAC_INST));
RC.nrmac[i]->Mod_id = i;
/*
for (j = 0; j < MAX_NUM_CCs; j++) {
RC.nrmac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = RC.nrmac[i]->dl_config_pdu_list[j];
RC.nrmac[i]->UL_req[j].ul_config_request_body.ul_config_pdu_list = RC.nrmac[i]->ul_config_pdu_list[j];
for (int k = 0; k < 10; k++)
RC.nrmac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list =RC.nrmac[i]->ul_config_pdu_list_tmp[j][k];
RC.nrmac[i]->HI_DCI0_req[j].hi_dci0_request_body.hi_dci0_pdu_list = RC.nrmac[i]->hi_dci0_pdu_list[j];
RC.nrmac[i]->TX_req[j].tx_request_body.tx_pdu_list = RC.nrmac[i]->tx_request_pdu[j];
RC.nrmac[i]->ul_handle = 0;
}
*/
}//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
AssertFatal(rlc_module_init() == 0,"Could not initialize RLC layer\n");
// These should be out of here later
pdcp_layer_init();
rrc_init_global_param();
}else {
RC.nrmac = NULL;
}
// Initialize Linked-List for Active UEs
for (i = 0; i < RC.nb_nr_macrlc_inst; i++) {
nrmac = RC.nrmac[i];
nrmac->if_inst = NR_IF_Module_init(i);
UE_list = &nrmac->UE_list;
UE_list->num_UEs = 0;
UE_list->head = -1;
UE_list->head_ul = -1;
UE_list->avail = 0;
for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) {
UE_list->next[list_el] = list_el + 1;
UE_list->next_ul[list_el] = list_el + 1;
}
UE_list->next[list_el] = -1;
UE_list->next_ul[list_el] = -1;
}
}
+131
View File
@@ -0,0 +1,131 @@
#include "openair1/PHY/defs_eNB.h"
#include "openair2/NR_PHY_INTERFACE/IF_Module.h"
#include "openair1/PHY/phy_extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "common/ran_context.h"
#define MAX_IF_MODULES 100
NR_IF_Module_t *if_inst[MAX_IF_MODULES];
NR_Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs];
extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind);
extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern uint8_t nfapi_mode;
extern uint16_t sf_ahead;
void NR_UL_indication(NR_UL_IND_t *UL_info)
{
AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
#ifdef DUMP_FAPI
dump_ul(UL_info);
#endif
module_id_t module_id = UL_info->module_id;
int CC_id = UL_info->CC_id;
NR_Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id];
NR_IF_Module_t *ifi = if_inst[module_id];
gNB_MAC_INST *mac = RC.nrmac[module_id];
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
UL_info->frame,UL_info->subframe,
module_id,CC_id,
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
if (nfapi_mode != 1)
{
if (ifi->CC_mask==0) {
ifi->current_frame = UL_info->frame;
ifi->current_subframe = UL_info->subframe;
}
else {
AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask);
}
ifi->CC_mask |= (1<<CC_id);
}
// clear DL/UL info for new scheduling round
clear_nfapi_information(RC.mac[module_id],CC_id,
UL_info->frame,UL_info->subframe);
handle_rach(UL_info);
handle_sr(UL_info);
handle_cqi(UL_info);
handle_harq(UL_info);
// clear HI prior to handling ULSCH
mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0;
handle_ulsch(UL_info);
if (nfapi_mode != 1)
{
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
eNB_dlsch_ulsch_scheduler(module_id,
(UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024,
(UL_info->subframe+sf_ahead)%10);
ifi->CC_mask = 0;
sched_info->module_id = module_id;
sched_info->CC_id = CC_id;
sched_info->frame = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024;
sched_info->subframe = (UL_info->subframe+sf_ahead)%10;
sched_info->DL_req = &mac->DL_req[CC_id];
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
(is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+sf_ahead)%10)>0))
sched_info->UL_req = &mac->UL_req[CC_id];
else
sched_info->UL_req = NULL;
sched_info->TX_req = &mac->TX_req[CC_id];
#ifdef DUMP_FAPI
dump_dl(sched_info);
#endif
if (ifi->schedule_response)
{
AssertFatal(ifi->schedule_response!=NULL,
"schedule_response is null (mod %d, cc %d)\n",
module_id,
CC_id);
ifi->schedule_response(sched_info);
}
LOG_D(PHY,"Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu);
}
}
}
NR_IF_Module_t *NR_IF_Module_init(int Mod_id){
AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
if (if_inst[Mod_id]==NULL) {
if_inst[Mod_id] = (NR_IF_Module_t*)malloc(sizeof(NR_IF_Module_t));
memset((void*)if_inst[Mod_id],0,sizeof(NR_IF_Module_t));
if_inst[Mod_id]->CC_mask=0;
if_inst[Mod_id]->UL_indication = NR_UL_indication;
AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
}
return if_inst[Mod_id];
}
+139
View File
@@ -0,0 +1,139 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/PHY_INTERFACE/IF_Module.h
* \brief data structures for PHY/MAC interface modules
* \author EURECOM/NTUST
* \date 2017
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __NR_IF_MODULE__H__
#define __NR_IF_MODULE__H__
#include <stdint.h>
#include "nfapi_nr_interface.h"
#include "platform_constants.h"
#include "platform_types.h"
#define MAX_NUM_DL_PDU 100
#define MAX_NUM_UL_PDU 100
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100
#define MAX_NUM_HARQ_IND 100
#define MAX_NUM_CRC_IND 100
#define MAX_NUM_SR_IND 100
#define MAX_NUM_CQI_IND 100
#define MAX_NUM_RACH_IND 100
#define MAX_NUM_SRS_IND 100
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
int CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// harq indication list
nfapi_harq_indication_t harq_ind;
/// crc indication list
nfapi_crc_indication_t crc_ind;
/// SR indication list
nfapi_sr_indication_t sr_ind;
/// CQI indication list
nfapi_cqi_indication_body_t cqi_ind;
/// RACH indication list
nfapi_rach_indication_t rach_ind;
#ifdef Rel14
/// RACH indication list for BR UEs
nfapi_rach_indication_t rach_ind_br;
#endif
/// SRS indication list
nfapi_srs_indication_body_t srs_ind;
/// RX indication
nfapi_rx_indication_t rx_ind;
} NR_UL_IND_t;
// Downlink subframe P7
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
uint8_t CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// nFAPI DL Config Request
nfapi_dl_config_request_t *DL_req;
/// nFAPI UL Config Request
nfapi_ul_config_request_t *UL_req;
/// nFAPI HI_DCI Request
nfapi_hi_dci0_request_t *HI_DCI0_req;
/// Pointers to DL SDUs
nfapi_tx_request_t *TX_req;
} NR_Sched_Rsp_t;
typedef struct {
uint8_t Mod_id;
int CC_id;
nfapi_nr_config_request_t *cfg;
} NR_PHY_Config_t;
typedef struct NR_IF_Module_s{
//define the function pointer
void (*UL_indication)(NR_UL_IND_t *UL_INFO);
void (*schedule_response)(NR_Sched_Rsp_t *Sched_INFO);
void (*PHY_config_req)(NR_PHY_Config_t* config_INFO);
uint32_t CC_mask;
uint16_t current_frame;
uint8_t current_subframe;
pthread_mutex_t if_mutex;
} NR_IF_Module_t;
/*Initial */
NR_IF_Module_t *NR_IF_Module_init(int Mod_id);
void NR_IF_Module_kill(int Mod_id);
void NR_UL_indication(NR_UL_IND_t *UL_INFO);
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void NR_Schedule_Response(NR_Sched_Rsp_t *Sched_INFO);
#endif /*_NFAPI_INTERFACE_NR_H_*/
File diff suppressed because it is too large Load Diff
+8 -188
View File
@@ -28,7 +28,6 @@
* \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr
*/
#ifdef USER_MODE
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h> /* for atoi(3) */
@@ -36,14 +35,11 @@
#include <string.h> /* for strerror(3) */
#include <sysexits.h> /* for EX_* exit codes */
#include <errno.h> /* for errno */
#else
#include <linux/module.h> /* Needed by all modules */
#endif
#include <asn_application.h>
#include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */
#include "RRC/NR/defs_NR.h"
#include "RRC/NR/nr_rrc_defs.h"
/*
* The variant of the above function which dumps the BASIC-XER (XER_F_BASIC)
@@ -81,194 +77,18 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier,
@param configuration Pointer Configuration Request structure
@return size of encoded bit stream in bytes*/
uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,int Mod_id,int CC_id, gNB_RrcConfigurationReq *configuration
);
uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,int Mod_id,int CC_id, gNB_RrcConfigurationReq *configuration);
/**
\brief Generate a default configuration for SIB2/SIB3 in one System Information PDU (eNB).
@param Mod_id Index of eNB (used to derive some parameters)
@param buffer Pointer to PER-encoded ASN.1 description of SI PDU
@param systemInformation Pointer to asn1c C representation of SI PDU
@param sib2 Pointer (returned) to sib2 component withing SI PDU
@param sib3 Pointer (returned) to sib3 component withing SI PDU
@param sib13 Pointer (returned) to sib13 component withing SI PDU
@param MBMS_flag Indicates presence of MBMS system information (when 1)
@return size of encoded bit stream in bytes*/
void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
int CC_id
#if defined(ENABLE_ITTI)
,gNB_RrcConfigurationReq *configuration
#endif
);
/*uint8_t do_SIB23(uint8_t Mod_id,
int CC_id
#if defined(ENABLE_ITTI)
, RrcConfigurationReq *configuration
#endif
);
/**
\brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This
routine only generates an mo-data establishment cause.
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
@param rv 5 byte random string or S-TMSI
@returns Size of encoded bit stream in bytes*/
/*uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv);
/** \brief Generate an RRCConnectionSetupComplete UL-DCCH-Message (UE)
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
@returns Size of encoded bit stream in bytes*/
/*uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t* buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength,
const char* dedicatedInfoNAS);
/** \brief Generate an RRCConnectionReconfigurationComplete UL-DCCH-Message (UE)
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
@returns Size of encoded bit stream in bytes*/
/*uint8_t
do_RRCConnectionReconfigurationComplete(
const protocol_ctxt_t* const ctxt_pP,
uint8_t* buffer,
const uint8_t Transaction_id
);
/**
\brief Generate an RRCConnectionSetup DL-CCCH-Message (eNB). This routine configures SRB_ToAddMod (SRB1/SRB2) and
PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting (PUCCH format 2/2a/2b) or SRS.
@param ctxt_pP Running context
@param ue_context_pP UE context
@param CC_id Component Carrier ID
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
@param transmission_mode Transmission mode for UE (1-9)
@param UE_id UE index for this message
@param Transaction_id Transaction_ID for this message
@param SRB_configList Pointer (returned) to SRB1_config/SRB2_config(later) IEs for this UE
@param physicalConfigDedicated Pointer (returned) to PhysicalConfigDedicated IE for this UE
@returns Size of encoded bit stream in bytes*/
/*uint8_t
do_RRCConnectionSetup(
const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* const ue_context_pP,
int CC_id,
uint8_t* const buffer,
const uint8_t transmission_mode,
const uint8_t Transaction_id,
SRB_ToAddModList_t** SRB_configList,
struct PhysicalConfigDedicated** physicalConfigDedicated
);
/**
\brief Generate an RRCConnectionReconfiguration DL-DCCH-Message (eNB). This routine configures SRBToAddMod (SRB2) and one DRBToAddMod
(DRB3). PhysicalConfigDedicated is not updated.
@param ctxt_pP Running context
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
@param Transaction_id Transaction_ID for this message
@param SRB_list Pointer to SRB List to be added/modified (NULL if no additions/modifications)
@param DRB_list Pointer to DRB List to be added/modified (NULL if no additions/modifications)
@param DRB_list2 Pointer to DRB List to be released (NULL if none to be released)
@param sps_Config Pointer to sps_Config to be modified (NULL if no modifications, or default if initial configuration)
@param physicalConfigDedicated Pointer to PhysicalConfigDedicated to be modified (NULL if no modifications)
@param MeasObj_list Pointer to MeasObj List to be added/modified (NULL if no additions/modifications)
@param ReportConfig_list Pointer to ReportConfig List (NULL if no additions/modifications)
@param QuantityConfig Pointer to QuantityConfig to be modified (NULL if no modifications)
@param MeasId_list Pointer to MeasID List (NULL if no additions/modifications)
@param mobilityInfo mobility control information for handover
@param speedStatePars speed state parameteres for handover
@param mac_MainConfig Pointer to Mac_MainConfig(NULL if no modifications)
@param measGapConfig Pointer to MeasGapConfig (NULL if no modifications)
@param cba_rnti RNTI for the cba transmission
@returns Size of encoded bit stream in bytes*/
/*uint16_t
do_RRCConnectionReconfiguration(
const protocol_ctxt_t* const ctxt_pP,
uint8_t *buffer,
uint8_t Transaction_id,
SRB_ToAddModList_t *SRB_list,
DRB_ToAddModList_t *DRB_list,
DRB_ToReleaseList_t *DRB_list2,
struct SPS_Config *sps_Config,
struct PhysicalConfigDedicated *physicalConfigDedicated,
MeasObjectToAddModList_t *MeasObj_list,
ReportConfigToAddModList_t *ReportConfig_list,
QuantityConfig_t *quantityConfig,
MeasIdToAddModList_t *MeasId_list,
MAC_MainConfig_t *mac_MainConfig,
MeasGapConfig_t *measGapConfig,
MobilityControlInfo_t *mobilityInfo,
struct MeasConfig__speedStatePars *speedStatePars,
RSRP_Range_t *rsrp,
C_RNTI_t *cba_rnti,
struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList* dedicatedInfoNASList
#if defined(Rel10) || defined(Rel14)
, SCellToAddMod_r10_t *SCell_config
#endif
);
/**
\brief Generate an RRCConnectionReestablishmentReject DL-CCCH-Message (eNB).
@param Mod_id Module ID of eNB
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
@returns Size of encoded bit stream in bytes*/
/*uint8_t
do_RRCConnectionReestablishmentReject(
uint8_t Mod_id,
uint8_t* const buffer);
/**
\brief Generate an RRCConnectionReject DL-CCCH-Message (eNB).
@param Mod_id Module ID of eNB
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
@returns Size of encoded bit stream in bytes*/
/*uint8_t
do_RRCConnectionReject(
uint8_t Mod_id,
uint8_t* const buffer);
/**
\brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This
routine only generates an mo-data establishment cause.
@param Mod_id Module ID of eNB
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
@param transaction_id Transaction index
@returns Size of encoded bit stream in bytes*/
/*uint8_t do_RRCConnectionRelease(uint8_t Mod_id, uint8_t *buffer,int Transaction_id);
/***
* \brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data)
* @param buffer Pointer to PER-encoded ASN.1 description of MCCH-Message PDU
* @returns Size of encoded bit stream in bytes
*/
/*uint8_t do_MCCHMessage(uint8_t *buffer);
#if defined(Rel10) || defined(Rel14)
/***
* \brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data)
* @param buffer Pointer to PER-encoded ASN.1 description of MCCH-Message PDU
* @returns Size of encoded bit stream in bytes
*/
/*uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
uint8_t sync_area,
uint8_t *buffer,
MCCH_Message_t *mcch_message,
MBSFNAreaConfiguration_r9_t **mbsfnAreaConfiguration);
#endif
uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_id,long rsrp_s,long rsrq_s,long rsrp_t,long rsrq_t);
uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t transaction_id, uint32_t pdu_length, uint8_t *pdu_buffer);
uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer);
OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer);
uint8_t
do_UECapabilityEnquiry(
const protocol_ctxt_t* const ctxt_pP,
uint8_t* const buffer,
const uint8_t Transaction_id
);
uint8_t do_SecurityModeCommand(
const protocol_ctxt_t* const ctxt_pP,
uint8_t* const buffer,
const uint8_t Transaction_id,
const uint8_t cipheringAlgorithm,
const uint8_t integrityProtAlgorithm);
-573
View File
@@ -1,573 +0,0 @@
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file RRC/LITE/defs_NR.h
* \brief NR RRC struct definitions and function prototypes
* \author Navid Nikaein, Raymond Knopp
* \date 2010 - 2014, 2018
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
*/
#ifndef __OPENAIR_RRC_DEFS_NR_H__
#define __OPENAIR_RRC_DEFS_NR_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "collection/tree.h"
#include "rrc_types_NR.h"
#include "COMMON/platform_constants.h"
#include "COMMON/platform_types.h"
//#include "COMMON/mac_rrc_primitives.h"
#if defined(NR_Rel15)
#include "NR_SIB1.h"
//#include "SystemInformation.h"
//#include "RRCConnectionReconfiguration.h"
#include "NR_RRCReconfigurationComplete.h"
#include "NR_RRCReconfiguration.h"
//#include "RRCConnectionReconfigurationComplete.h"
//#include "RRCConnectionSetup.h"
//#include "RRCConnectionSetupComplete.h"
//#include "RRCConnectionRequest.h"
//#include "RRCConnectionReestablishmentRequest.h"
//#include "BCCH-DL-SCH-Message.h"
#include "NR_BCCH-BCH-Message.h"
//#include "MCCH-Message.h"
//#include "MBSFNAreaConfiguration-r9.h"
//#include "SCellToAddMod-r10.h"
//#include "AS-Config.h"
//#include "AS-Context.h"
#include "NR_UE-NR-Capability.h"
#include "NR_MeasResults.h"
#include "NR_ServingCellConfigCommon.h"
#endif
//-------------------
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
/* TODO: be sure this include is correct.
* It solves a problem of compilation of the RRH GW,
* issue #186.
*/
#if !defined(ENABLE_ITTI)
# include "as_message.h"
#endif
#if defined(ENABLE_USE_MME)
# include "commonDef.h"
#endif
#if ENABLE_RAL
# include "collection/hashtable/obj_hashtable.h"
#endif
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
typedef unsigned int uid_NR_t;
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NR (((NUMBER_OF_NR_UE_MAX/8)/sizeof(unsigned int)) + 1)
typedef struct uid_linear_allocator_NR_s {
unsigned int bitmap[UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NR];
} uid_allocator_NR_t;
#define PROTOCOL_NRRRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NRRRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_NRRRC_CTXT_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NRRRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!!
#define UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1
typedef enum {
NR_RRC_OK=0,
NR_RRC_ConnSetup_failed,
NR_RRC_PHY_RESYNCH,
NR_RRC_Handover_failed,
NR_RRC_HO_STARTED
} NR_RRC_status_t;
typedef enum UE_STATE_NR_e {
NR_RRC_INACTIVE=0,
NR_RRC_IDLE,
NR_RRC_SI_RECEIVED,
NR_RRC_CONNECTED,
NR_RRC_RECONFIGURED,
NR_RRC_HO_EXECUTION
} NR_UE_STATE_t;
typedef enum HO_STATE_NR_e {
NR_HO_IDLE=0,
NR_HO_MEASURMENT,
NR_HO_PREPARE,
NR_HO_CMD, // initiated by the src eNB
NR_HO_COMPLETE // initiated by the target eNB
} NR_HO_STATE_t;
//#define NUMBER_OF_UE_MAX MAX_MOBILES_PER_RG
#define RRM_FREE(p) if ( (p) != NULL) { free(p) ; p=NULL ; }
#define RRM_MALLOC(t,n) (t *) malloc16( sizeof(t) * n )
#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n)
#define RRM_CALLOC2(t,s) (t *) malloc16( s )
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3
typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
uint8_t Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/
uint8_t Target_bler; /*!< \brief Target Average Transport Block Error rate*/
uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
} __attribute__ ((__packed__)) LCHAN_DESC_NR;
typedef struct UE_RRC_INFO_NR_s {
NR_UE_STATE_t State;
uint8_t SIB1systemInfoValueTag;
uint32_t SIStatus;
uint32_t SIcnt;
#if defined(Rel10) || defined(Rel14)
uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA
#endif
uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
uint8_t handoverTarget;
//HO_STATE_t ho_state;
uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120
unsigned short UE_index;
uint32_t T300_active;
uint32_t T300_cnt;
uint32_t T304_active;
uint32_t T304_cnt;
uint32_t T310_active;
uint32_t T310_cnt;
uint32_t N310_cnt;
uint32_t N311_cnt;
rnti_t rnti;
} __attribute__ ((__packed__)) UE_RRC_INFO_NR;
typedef struct UE_S_TMSI_NR_s {
boolean_t presence;
mme_code_t mme_code;
m_tmsi_t m_tmsi;
} __attribute__ ((__packed__)) UE_S_TMSI_NR;
typedef enum e_rab_satus_NR_e {
E_RAB_STATUS_NEW_NR,
E_RAB_STATUS_DONE_NR, // from the eNB perspective
E_RAB_STATUS_ESTABLISHED_NR, // get the reconfigurationcomplete form UE
E_RAB_STATUS_FAILED_NR,
} e_rab_status_NR_t;
typedef struct e_rab_param_NR_s {
e_rab_t param;
uint8_t status;
uint8_t xid; // transaction_id
} __attribute__ ((__packed__)) e_rab_param_NR_t;
typedef struct HANDOVER_INFO_NR_s {
uint8_t ho_prepare;
uint8_t ho_complete;
uint8_t modid_s; //module_idP of serving cell
uint8_t modid_t; //module_idP of target cell
uint8_t ueid_s; //UE index in serving cell
uint8_t ueid_t; //UE index in target cell
// NR not define at this moment
//AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */
//AS_Context_t as_context; /* They are mandatory for HO */
uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */
int size; /* size of above message in bytes */
} HANDOVER_INFO_NR;
#define RRC_HEADER_SIZE_MAX 64
#define RRC_BUFFER_SIZE_MAX 1024
typedef struct {
char Payload[RRC_BUFFER_SIZE_MAX];
char Header[RRC_HEADER_SIZE_MAX];
char payload_size;
} RRC_BUFFER_NR;
#define RRC_BUFFER_SIZE_NR sizeof(RRC_BUFFER_NR)
typedef struct RB_INFO_NR_s {
uint16_t Rb_id; //=Lchan_id
LCHAN_DESC Lchan_desc[2];
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
} RB_INFO_NR;
typedef struct SRB_INFO_NR_s {
uint16_t Srb_id; //=Lchan_id
RRC_BUFFER Rx_buffer;
RRC_BUFFER Tx_buffer;
LCHAN_DESC Lchan_desc[2];
unsigned int Trans_id;
uint8_t Active;
} SRB_INFO_NR;
typedef struct RB_INFO_TABLE_ENTRY_NR_s {
RB_INFO_NR Rb_info;
uint8_t Active;
uint32_t Next_check_frame;
uint8_t Status;
} RB_INFO_TABLE_ENTRY_NR;
typedef struct SRB_INFO_TABLE_ENTRY_NR_s {
SRB_INFO_NR Srb_info;
uint8_t Active;
uint8_t Status;
uint32_t Next_check_frame;
} SRB_INFO_TABLE_ENTRY_NR;
typedef struct MEAS_REPORT_LIST_NR_s {
MeasId_t measId;
//CellsTriggeredList cellsTriggeredList;//OPTIONAL
uint32_t numberOfReportsSent;
} MEAS_REPORT_LIST_NR;
typedef struct HANDOVER_INFO_UE_NR_s {
PhysCellId_t targetCellId;
uint8_t measFlag;
} HANDOVER_INFO_UE_NR;
//NB-IoT eNB_RRC_UE_NB_IoT_s--(used as a context in eNB --> ue_context in rrc_eNB_ue_context)------
typedef struct gNB_RRC_UE_s {
uint8_t primaryCC_id;
//SCellToAddMod_t sCell_config[2];
SRB_ToAddModList_t* SRB_configList;//for SRB1 and SRB1bis
SRB_ToAddModList_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
DRB_ToAddModList_t* DRB_configList; //for all the DRBs
DRB_ToAddModList_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
uint8_t DRB_active[8];//in LTE was 8
// NR not define at this moment
//struct PhysicalConfigDedicated* physicalConfigDedicated_NR;
struct SPS_Config* sps_Config;
MeasObjectToAddMod_t* MeasObj[MAX_MEAS_OBJ];
struct ReportConfigToAddMod* ReportConfig[MAX_MEAS_CONFIG];
struct QuantityConfig* QuantityConfig;
struct MeasIdToAddMod* MeasId[MAX_MEAS_ID];
// NR not define at this moment
//MAC_MainConfig_t* mac_MainConfig_NR;
MeasGapConfig_t* measGapConfig;
SRB_INFO_NR SI;
SRB_INFO_NR Srb0;
SRB_INFO_TABLE_ENTRY_NR Srb1;
SRB_INFO_TABLE_ENTRY_NR Srb2;
MeasConfig_t* measConfig;
HANDOVER_INFO_NR* handover_info;
#if defined(ENABLE_SECURITY)
/* KeNB as derived from KASME received from EPC */
uint8_t kenb[32];
#endif
/* Used integrity/ciphering algorithms */
//Specs. TS 38.331 V15.1.0 pag 432 Change position of chipering enumerative w.r.t previous version
e_NR_CipheringAlgorithm ciphering_algorithm;
e_NR_IntegrityProtAlgorithm integrity_algorithm;
uint8_t Status;
rnti_t rnti;
uint64_t random_ue_identity;
/* Information from UE RRC ConnectionRequest */
UE_S_TMSI_NR Initialue_identity_s_TMSI;
/* NR not define at this moment
EstablishmentCause_t establishment_cause_NR; //different set for NB-IoT
*/
/* NR not define at this moment*/
/* Information from UE RRC ConnectionReestablishmentRequest */
//ReestablishmentCause_t reestablishment_cause_NR; //different set for NB_IoT
/* UE id for initial connection to S1AP */
uint16_t ue_initial_id;
/* Information from S1AP initial_context_setup_req */
uint32_t eNB_ue_s1ap_id :24;
security_capabilities_t security_capabilities;
/* Total number of e_rab already setup in the list */ //NAS list?
uint8_t setup_e_rabs;
/* Number of e_rab to be setup in the list */ //NAS list?
uint8_t nb_of_e_rabs;
/* list of e_rab to be setup by RRC layers */
e_rab_param_NR_t e_rab[NB_RB_MAX_NB_IOT];//[S1AP_MAX_E_RAB];
// LG: For GTPV1 TUNNELS
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
//Which timers are referring to?
uint32_t ul_failure_timer;
uint32_t ue_release_timer;
//threshold of the release timer--> set in RRCConnectionRelease
uint32_t ue_release_timer_thres;
} gNB_RRC_UE_t;
//--------------------------------------------------------------------------------
typedef uid_NR_t ue_uid_t;
//generally variable called: ue_context_pP
typedef struct rrc_gNB_ue_context_s {
/* Tree related data */
RB_ENTRY(rrc_gNB_ue_context_s) entries;
/* Uniquely identifies the UE between MME and eNB within the eNB.
* This id is encoded on 24bits.
*/
rnti_t ue_id_rnti;
// another key for protocol layers but should not be used as a key for RB tree
ue_uid_t local_uid;
/* UE id for initial connection to S1AP */
struct gNB_RRC_UE_s ue_context; //context of ue in the e-nB
} rrc_gNB_ue_context_t;
//called "carrier"--> data from PHY layer
typedef struct {
// buffer that contains the encoded messages
uint8_t *MIB;
uint8_t sizeof_MIB;
uint8_t *SIB1;
uint8_t sizeof_SIB1;
//implicit parameters needed
int Ncp; //cyclic prefix for DL
int Ncp_UL; //cyclic prefix for UL
int p_gNB; //number of tx antenna port
int p_rx_gNB; //number of receiving antenna ports
uint32_t dl_CarrierFreq; //detected by the UE
uint32_t ul_CarrierFreq; //detected by the UE
uint16_t physCellId;
//are the only static one (memory has been already allocated)
BCCH_BCH_Message_t mib;
NR_SIB1_t *sib1;
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
SRB_INFO_NR SI;
SRB_INFO_NR Srb0;
} rrc_gNB_carrier_data_t;
//---------------------------------------------------
//---NR---(completely change)---------------------
typedef struct gNB_RRC_INST_s {
eth_params_t eth_params_s;
rrc_gNB_carrier_data_t carrier[MAX_NUM_CCs];
uid_allocator_NR_t uid_allocator; // for rrc_ue_head
RB_HEAD(rrc_ue_tree_NR_s, rrc_gNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti
uint8_t HO_flag;
uint8_t Nb_ue;
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t
//RRC configuration
#if defined(ENABLE_ITTI)
gNB_RrcConfigurationReq configuration;//rrc_messages_types.h
#endif
// other PLMN parameters
/// Mobile country code
int mcc;
/// Mobile network code
int mnc;
/// number of mnc digits
int mnc_digit_length;
// other RAN parameters
int srb1_timer_poll_retransmit;
int srb1_poll_pdu;
int srb1_poll_byte;
int srb1_max_retx_threshold;
int srb1_timer_reordering;
int srb1_timer_status_prohibit;
int srs_enable[MAX_NUM_CCs];
} gNB_RRC_INST;
//#define RRC_HEADER_SIZE_MAX_NR 64
#define MAX_UE_CAPABILITY_SIZE_NR 255
//not needed for the moment
typedef struct OAI_UECapability_NR_s {
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NR];
uint8_t sdu_size;
////NR------
NR_UE_NR_Capability_t UE_Capability_NR; //replace the UE_EUTRA_Capability of LTE
} OAI_UECapability_NR_t;
typedef struct UE_RRC_INST_NR_s {
Rrc_State_NR_t RrcState;
Rrc_Sub_State_NR_t RrcSubState;
# if defined(ENABLE_USE_MME)
plmn_t plmnID;
Byte_t rat;
as_nas_info_t initialNasMsg;
# endif
OAI_UECapability_NR_t *UECap;
uint8_t *UECapability;
uint8_t UECapability_size;
UE_RRC_INFO_NR Info[NB_SIG_CNX_UE];
SRB_INFO_NR Srb0[NB_SIG_CNX_UE];
SRB_INFO_TABLE_ENTRY_NR Srb1[NB_CNX_UE];
SRB_INFO_TABLE_ENTRY_NR Srb2[NB_CNX_UE];
HANDOVER_INFO_UE_NR HandoverInfoUe;
/*
uint8_t *SIB1[NB_CNX_UE];
uint8_t sizeof_SIB1[NB_CNX_UE];
uint8_t *SI[NB_CNX_UE];
uint8_t sizeof_SI[NB_CNX_UE];
uint8_t SIB1Status[NB_CNX_UE];
uint8_t SIStatus[NB_CNX_UE];
SIB1_t *sib1[NB_CNX_UE];
SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI().
SystemInformationBlockType2_t *sib2[NB_CNX_UE];
SystemInformationBlockType3_t *sib3[NB_CNX_UE];
SystemInformationBlockType4_t *sib4[NB_CNX_UE];
SystemInformationBlockType5_t *sib5[NB_CNX_UE];
SystemInformationBlockType6_t *sib6[NB_CNX_UE];
SystemInformationBlockType7_t *sib7[NB_CNX_UE];
SystemInformationBlockType8_t *sib8[NB_CNX_UE];
SystemInformationBlockType9_t *sib9[NB_CNX_UE];
SystemInformationBlockType10_t *sib10[NB_CNX_UE];
SystemInformationBlockType11_t *sib11[NB_CNX_UE];
#if defined(Rel10) || defined(Rel14)
uint8_t MBMS_flag;
uint8_t *MCCH_MESSAGE[NB_CNX_UE];
uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE];
uint8_t MCCH_MESSAGEStatus[NB_CNX_UE];
MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE];
SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
#endif
#ifdef CBA
uint8_t num_active_cba_groups;
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
#endif
uint8_t num_srb;
struct SRB_ToAddMod *SRB1_config[NB_CNX_UE];
struct SRB_ToAddMod *SRB2_config[NB_CNX_UE];
struct DRB_ToAddMod *DRB_config[NB_CNX_UE][8];
rb_id_t *defaultDRB; // remember the ID of the default DRB
MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
struct ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG];
*/
struct QuantityConfig *QuantityConfig[NB_CNX_UE];
/*
struct MeasIdToAddMod *MeasId[NB_CNX_UE][MAX_MEAS_ID];
MEAS_REPORT_LIST *measReportList[NB_CNX_UE][MAX_MEAS_ID];
uint32_t measTimer[NB_CNX_UE][MAX_MEAS_ID][6]; // 6 neighboring cells
RSRP_Range_t s_measure;
struct MeasConfig__speedStatePars *speedStatePars;
struct PhysicalConfigDedicated *physicalConfigDedicated[NB_CNX_UE];
struct SPS_Config *sps_Config[NB_CNX_UE];
MAC_MainConfig_t *mac_MainConfig[NB_CNX_UE];
MeasGapConfig_t *measGapConfig[NB_CNX_UE];
double filter_coeff_rsrp; // [7] ???
double filter_coeff_rsrq; // [7] ???
float rsrp_db[7];
float rsrq_db[7];
float rsrp_db_filtered[7];
float rsrq_db_filtered[7];
#if ENABLE_RAL
obj_hash_table_t *ral_meas_thresholds;
ral_transaction_id_t scan_transaction_id;
#endif
#if defined(ENABLE_SECURITY)
// KeNB as computed from parameters within USIM card //
uint8_t kenb[32];
#endif
// Used integrity/ciphering algorithms //
CipheringAlgorithm_r12_t ciphering_algorithm;
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
*/
}UE_RRC_INST_NR;
#include "proto_NR.h" //should be put here otherwise compilation error
#endif
/** @} */
+87
View File
@@ -0,0 +1,87 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file rrc_common.c
* \brief rrc common procedures for eNB and UE
* \author Navid Nikaein and Raymond Knopp
* \date 2011 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr
*/
#include "nr_rrc_defs.h"
#include "nr_rrc_extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "COMMON/openair_defs.h"
#include "COMMON/platform_types.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "LAYER2/RLC/rlc.h"
#include "COMMON/mac_rrc_primitives.h"
#include "UTIL/LOG/log.h"
#include "asn1_msg.h"
#include "pdcp.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "rrc_eNB_UE_context.h"
#include "common/ran_context.h"
#define DEBUG_NR_RRC 1
extern RAN_CONTEXT_t RC;
extern UE_MAC_INST *UE_mac_inst;
extern mui_t rrc_gNB_mui;
//-----------------------------------------------------------------------------
int
nr_rrc_init_global_param(
void
)
//-----------------------------------------------------------------------------
{
rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc
DCCH_LCHAN_DESC.transport_block_size = 4;
DCCH_LCHAN_DESC.max_transport_blocks = 16;
DCCH_LCHAN_DESC.Delay_class = 1;
DTCH_DL_LCHAN_DESC.transport_block_size = 52;
DTCH_DL_LCHAN_DESC.max_transport_blocks = 20;
DTCH_DL_LCHAN_DESC.Delay_class = 1;
DTCH_UL_LCHAN_DESC.transport_block_size = 52;
DTCH_UL_LCHAN_DESC.max_transport_blocks = 20;
DTCH_UL_LCHAN_DESC.Delay_class = 1;
Rlc_info_um.rlc_mode = RLC_MODE_UM;
Rlc_info_um.rlc.rlc_um_info.timer_reordering = 5;
Rlc_info_um.rlc.rlc_um_info.sn_field_length = 10;
Rlc_info_um.rlc.rlc_um_info.is_mXch = 0;
//Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16;
Rlc_info_am_config.rlc_mode = RLC_MODE_AM;
Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 50;
Rlc_info_am_config.rlc.rlc_am_info.poll_pdu = 8;
Rlc_info_am_config.rlc.rlc_am_info.poll_byte = 1000;
Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit = 15;
Rlc_info_am_config.rlc.rlc_am_info.t_reordering = 50;
Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit = 10;
return 0;
}
+333
View File
@@ -0,0 +1,333 @@
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file RRC/LITE/defs_NR.h
* \brief NR RRC struct definitions and function prototypes
* \author Navid Nikaein, Raymond Knopp
* \date 2010 - 2014, 2018
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
*/
#ifndef __OPENAIR_RRC_DEFS_NR_H__
#define __OPENAIR_RRC_DEFS_NR_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "collection/tree.h"
#include "nr_rrc_types.h"
#include "COMMON/platform_constants.h"
#include "COMMON/platform_types.h"
#include "RRC/LTE/rrc_defs.h"
//#include "LAYER2/RLC/rlc.h"
//#include "COMMON/mac_rrc_primitives.h"
#if defined(NR_Rel15)
#include "NR_SIB1.h"
//#include "SystemInformation.h"
//#include "RRCConnectionReconfiguration.h"
#include "NR_RRCReconfigurationComplete.h"
#include "NR_RRCReconfiguration.h"
//#include "RRCConnectionReconfigurationComplete.h"
//#include "RRCConnectionSetup.h"
//#include "RRCConnectionSetupComplete.h"
//#include "RRCConnectionRequest.h"
//#include "RRCConnectionReestablishmentRequest.h"
//#include "BCCH-DL-SCH-Message.h"
#include "NR_BCCH-BCH-Message.h"
//#include "MCCH-Message.h"
//#include "MBSFNAreaConfiguration-r9.h"
//#include "SCellToAddMod-r10.h"
//#include "AS-Config.h"
//#include "AS-Context.h"
#include "NR_UE-NR-Capability.h"
#include "NR_MeasResults.h"
#include "NR_ServingCellConfigCommon.h"
#endif
//-------------------
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
/* TODO: be sure this include is correct.
* It solves a problem of compilation of the RRH GW,
* issue #186.
*/
#if !defined(ENABLE_ITTI)
# include "as_message.h"
#endif
#if defined(ENABLE_USE_MME)
# include "commonDef.h"
#endif
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
typedef unsigned int uid_nr_t;
#define NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((NUMBER_OF_NR_UE_MAX/8)/sizeof(unsigned int)) + 1)
typedef struct nr_uid_linear_allocator_s {
unsigned int bitmap[NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE];
} nr_uid_allocator_t;
#define PROTOCOL_NR_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_NR_RRC_CTXT_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define NR_UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!!
#define NR_UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1
typedef enum {
NR_RRC_OK=0,
NR_RRC_ConnSetup_failed,
NR_RRC_PHY_RESYNCH,
NR_RRC_Handover_failed,
NR_RRC_HO_STARTED
} NR_RRC_status_t;
typedef enum UE_STATE_NR_e {
NR_RRC_INACTIVE=0,
NR_RRC_IDLE,
NR_RRC_SI_RECEIVED,
NR_RRC_CONNECTED,
NR_RRC_RECONFIGURED,
NR_RRC_HO_EXECUTION
} NR_UE_STATE_t;
//#define NUMBER_OF_NR_UE_MAX MAX_MOBILES_PER_RG
#define RRM_FREE(p) if ( (p) != NULL) { free(p) ; p=NULL ; }
#define RRM_MALLOC(t,n) (t *) malloc16( sizeof(t) * n )
#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n)
#define RRM_CALLOC2(t,s) (t *) malloc16( s )
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#define NR_RRC_TRANSACTION_IDENTIFIER_NUMBER 3
typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
uint8_t Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/
uint8_t Target_bler; /*!< \brief Target Average Transport Block Error rate*/
uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
} __attribute__ ((__packed__)) NR_LCHAN_DESC;
typedef struct UE_RRC_INFO_NR_s {
NR_UE_STATE_t State;
uint8_t SIB1systemInfoValueTag;
uint32_t SIStatus;
uint32_t SIcnt;
#if defined(Rel10) || defined(Rel14)
uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA
#endif
uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
uint8_t handoverTarget;
//HO_STATE_t ho_state;
uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120
unsigned short UE_index;
uint32_t T300_active;
uint32_t T300_cnt;
uint32_t T304_active;
uint32_t T304_cnt;
uint32_t T310_active;
uint32_t T310_cnt;
uint32_t N310_cnt;
uint32_t N311_cnt;
rnti_t rnti;
} __attribute__ ((__packed__)) NR_UE_RRC_INFO;
typedef struct UE_S_TMSI_NR_s {
boolean_t presence;
mme_code_t mme_code;
m_tmsi_t m_tmsi;
} __attribute__ ((__packed__)) NR_UE_S_TMSI;
typedef enum nr_e_rab_satus_e {
NR_E_RAB_STATUS_NEW,
NR_E_RAB_STATUS_DONE, // from the gNB perspective
NR_E_RAB_STATUS_ESTABLISHED, // get the reconfigurationcomplete form UE
NR_E_RAB_STATUS_FAILED,
} nr_e_rab_status_t;
typedef struct nr_e_rab_param_s {
e_rab_t param;
uint8_t status;
uint8_t xid; // transaction_id
} __attribute__ ((__packed__)) nr_e_rab_param_t;
typedef struct HANDOVER_INFO_NR_s {
uint8_t ho_prepare;
uint8_t ho_complete;
uint8_t modid_s; //module_idP of serving cell
uint8_t modid_t; //module_idP of target cell
uint8_t ueid_s; //UE index in serving cell
uint8_t ueid_t; //UE index in target cell
// NR not define at this moment
//AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */
//AS_Context_t as_context; /* They are mandatory for HO */
uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */
int size; /* size of above message in bytes */
} NR_HANDOVER_INFO;
#define NR_RRC_HEADER_SIZE_MAX 64
#define NR_RRC_BUFFER_SIZE_MAX 1024
typedef struct {
char Payload[NR_RRC_BUFFER_SIZE_MAX];
char Header[NR_RRC_HEADER_SIZE_MAX];
char payload_size;
} NR_RRC_BUFFER;
#define NR_RRC_BUFFER_SIZE sizeof(RRC_BUFFER_NR)
typedef struct RB_INFO_NR_s {
uint16_t Rb_id; //=Lchan_id
NR_LCHAN_DESC Lchan_desc[2];
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
} NR_RB_INFO;
typedef struct NR_SRB_INFO_s {
uint16_t Srb_id; //=Lchan_id
NR_RRC_BUFFER Rx_buffer;
NR_RRC_BUFFER Tx_buffer;
NR_LCHAN_DESC Lchan_desc[2];
unsigned int Trans_id;
uint8_t Active;
} NR_SRB_INFO;
typedef struct RB_INFO_TABLE_ENTRY_NR_s {
NR_RB_INFO Rb_info;
uint8_t Active;
uint32_t Next_check_frame;
uint8_t Status;
} NR_RB_INFO_TABLE_ENTRY;
typedef struct SRB_INFO_TABLE_ENTRY_NR_s {
NR_SRB_INFO Srb_info;
uint8_t Active;
uint8_t Status;
uint32_t Next_check_frame;
} NR_SRB_INFO_TABLE_ENTRY;
//called "carrier"--> data from PHY layer
typedef struct {
// buffer that contains the encoded messages
uint8_t *MIB;
uint8_t sizeof_MIB;
uint8_t *SIB1;
uint8_t sizeof_SIB1;
//implicit parameters needed
int physCellId;
int Ncp; //cyclic prefix for DL
int Ncp_UL; //cyclic prefix for UL
int p_gNB; //number of tx antenna port
int p_rx_gNB; //number of receiving antenna ports
uint32_t dl_CarrierFreq; //detected by the UE
uint32_t ul_CarrierFreq; //detected by the UE
//are the only static one (memory has been already allocated)
NR_BCCH_BCH_Message_t mib;
NR_SIB1_t *sib1;
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
NR_SRB_INFO SI;
NR_SRB_INFO Srb0;
} rrc_gNB_carrier_data_t;
//---------------------------------------------------
//---NR---(completely change)---------------------
typedef struct gNB_RRC_INST_s {
eth_params_t eth_params_s;
rrc_gNB_carrier_data_t carrier[MAX_NUM_CCs];
nr_uid_allocator_t uid_allocator; // for rrc_ue_head
RB_HEAD(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti
uint8_t Nb_ue;
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t
//RRC configuration
#if defined(ENABLE_ITTI)
gNB_RrcConfigurationReq configuration;//rrc_messages_types.h
#endif
// other PLMN parameters
/// Mobile country code
int mcc;
/// Mobile network code
int mnc;
/// number of mnc digits
int mnc_digit_length;
// other RAN parameters
int srb1_timer_poll_retransmit;
int srb1_poll_pdu;
int srb1_poll_byte;
int srb1_max_retx_threshold;
int srb1_timer_reordering;
int srb1_timer_status_prohibit;
int srs_enable[MAX_NUM_CCs];
} gNB_RRC_INST;
#include "nr_rrc_proto.h" //should be put here otherwise compilation error
#endif
/** @} */
@@ -30,16 +30,13 @@
#ifndef __OPENAIR_RRC_EXTERN_H__
#define __OPENAIR_RRC_EXTERN_H__
#include "defs.h"
#include "nr_rrc_defs.h"
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/RLC/rlc.h"
extern UE_RRC_INST *UE_rrc_inst;
#include "LAYER2/MAC/extern.h"
extern uint8_t DRB2LCHAN[8];
extern LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue;
+45
View File
@@ -0,0 +1,45 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file proto.h
* \brief RRC functions prototypes for eNB and UE
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \email navid.nikaein@eurecom.fr
* \version 1.0
*/
/** \addtogroup _rrc
* @{
*/
#include "RRC/NR/nr_rrc_defs.h"
#include "flexran_agent_extern.h"
int nr_rrc_init_global_param(void);
#if defined(ENABLE_ITTI)
/**\brief RRC eNB task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_gnb_task(void *args_p);
#endif
View File
+46 -100
View File
@@ -27,44 +27,40 @@
* \company Eurecom
* \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr
*/
#define RRC_GNB
#define RRC_GNB_C
#define RRC_GNB_C
#include "defs_NR.h"
#include "extern.h"
#include "nr_rrc_defs.h"
#include "nr_rrc_extern.h"
#include "assertions.h"
#include "common/ran_context.h"
#include "asn1_conversions.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "LAYER2/RLC/rlc.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/mac_proto.h"
#include "UTIL/LOG/log.h"
#include "COMMON/mac_rrc_primitives.h"
#include "RRC/NR/asn1_msg.h"
#include "RRC/NR/MESSAGES/asn1_msg.h"
///ASN.1 header files
//#include "RRCConnectionRequest.h"
//#include "RRCConnectionReestablishmentRequest.h"
//#include "ReestablishmentCause.h"
#include "BCCH-BCH-Message.h"
//#include "UL-CCCH-Message.h"
//#include "DL-CCCH-Message.h"
#include "UL-DCCH-Message.h"
#include "DL-DCCH-Message.h"
//#include "TDD-Config.h"
//#include "HandoverCommand.h"
#include "MeasResults.h"
#include "pdcp.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_UL-DCCH-Message.h"
#include "NR_DL-DCCH-Message.h"
#include "NR_MeasResults.h"
#include "rlc.h"
#include "SIMULATION/ETH_TRANSPORT/extern.h"
#include "rrc_eNB_UE_context.h"
#include "platform_types.h"
#include "msc.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "T.h"
//#if defined(Rel10) || defined(Rel14)
#include "MeasResults.h"
//#endif
#include "RRC/NAS/nas_config.h"
#include "RRC/NAS/rb_config.h"
@@ -84,20 +80,22 @@
# endif
#endif
#include "pdcp.h"
#include "gtpv1u_eNB_task.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
#if ENABLE_RAL
# include "rrc_eNB_ral.h"
#endif
#include "SIMULATION/TOOLS/defs.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
//#define XER_PRINT
extern RAN_CONTEXT_t RC;
#ifdef PHY_EMUL
@@ -124,7 +122,7 @@ openair_nrrrc_on(
{
int CC_id;
LOG_I(NR_RRC, PROTOCOL_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",
LOG_I(NR_RRC, PROTOCOL_NR_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.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
@@ -154,8 +152,9 @@ init_NR_SI(
// copy basic parameters
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_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].p_gNB = configuration->nb_antenna_ports[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->DL_prefix_type[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp_UL = configuration->UL_prefix_type[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
@@ -174,18 +173,17 @@ init_NR_SI(
);
///SIB1
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.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_NR_RRC_CTXT_FMT" init_SI: FATAL, no memory for NR SIB1 allocated\n",PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = do_SIB1_NR(&RC.nrrrc[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)
,configuration
#endif
);
);*/
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");
@@ -198,16 +196,15 @@ init_NR_SI(
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.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
(ServingCellConfigCommon_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id]servingcellconfigcommon
);
rrc_mac_config_req_gNB(ctxt_pP->module_id,
CC_id,
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB,
configuration->eutra_band[CC_id],
RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq,
configuration->N_RB_DL[CC_id],
(NR_BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib,
(NR_ServingCellConfigCommon_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].servingcellconfigcommon
);
}
@@ -216,7 +213,9 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
int CC_id;
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));
LOG_I(NR_RRC,
PROTOCOL_NR_RRC_CTXT_FMT" Init...\n",
PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
#if OCP_FRAMEWORK
while ( RC.nrrrc[gnb_mod_idP] == NULL ) {
@@ -236,7 +235,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
RC.nrrrc[ctxt.module_id]->carrier[CC_id].Srb0.Active = 0;
}
uid_linear_allocator_init(&nrrrc.nrrrc[ctxt.module_id]->uid_allocator);
uid_linear_allocator_init(&RC.nrrrc[ctxt.module_id]->uid_allocator);
RB_INIT(&RC.nrrrc[ctxt.module_id]->rrc_ue_head);
RC.nrrrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
@@ -246,7 +245,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
/// System Information INIT
LOG_I(NR_RRC, PROTOCOL_NRRRC_CTXT_FMT" Checking release \n",PROTOCOL_NRRRC_CTXT_ARGS(&ctxt));
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" Checking release \n",PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
#ifdef CBA
@@ -260,8 +259,8 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
}
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),
PROTOCOL_NR_RRC_CTXT_FMT" Initialization of 4 cba_RNTI values (%x %x %x %x) num active groups %d\n",
PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt),
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],
@@ -278,18 +277,10 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
,configuration
#endif
);
for (int ue_id = 0; ue_id < NUMBER_OF_UE_MAX; ue_id++){
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++)
//rrc_init_NR_global_param();
nr_rrc_init_global_param();
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
openair_rrc_top_init_gNB(RC.nrrrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0);
}
openair_nrrrc_on(&ctxt);
@@ -342,7 +333,7 @@ void* rrc_gnb_task(void* args_p){
/* Messages from S1AP */
case S1AP_DOWNLINK_NAS:
rrc_eNB_process_S1AP_DOWNLINK_NAS(msg_p, msg_name_p, instance, &rrc_eNB_mui);
rrc_eNB_process_S1AP_DOWNLINK_NAS(msg_p, msg_name_p, instance, &rrc_gNB_mui);
break;
case S1AP_INITIAL_CONTEXT_SETUP_REQ:
@@ -410,48 +401,3 @@ void* rrc_gnb_task(void* args_p){
}
#endif //END #if defined(ENABLE_ITTI)
/*------------------------------------------------------------------------------*/
void
openair_rrc_top_init_gNB(int eMBMS_active,uint8_t HO_active)
//-----------------------------------------------------------------------------
{
module_id_t module_id;
int CC_id;
/* for no gcc warnings */
(void)CC_id;
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_gNB_INST=%d\n", RC.nb_nr_inst);
if (RC.nb_nr_inst > 0) {
LOG_I(RRC,"[gNB] handover active state is %d \n", HO_active);
for (module_id=0; module_id<NB_gNB_INST; module_id++) {
RC.nrrrc[module_id]->HO_flag = (uint8_t)HO_active;
}
#if defined(Rel10) || defined(Rel14)
LOG_I(RRC,"[gNB] eMBMS active state is %d \n", eMBMS_active);
for (module_id=0; module_id<NB_gNB_INST; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.nrrrc[module_id]->carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active;
}
}
#endif
#ifdef CBA
for (module_id=0; module_id<RC.nb_nr_inst; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.nrrrc[module_id]->carrier[CC_id].num_active_cba_groups = cba_group_active;
}
}
#endif
}//END if (RC.nb_nr_inst > 0)
}
+4
View File
@@ -186,6 +186,10 @@ typedef enum {
RRH,
X2AP,
MAX_LOG_COMPONENTS,
GNB_APP,
NR_RRC,
NR_MAC,
NR_PHY,
}
comp_name_t;