Commit e15c1f11 authored by Michele Paffetti's avatar Michele Paffetti

Implementation of configuration data structures following FAPI-like approach....

Implementation of configuration data structures following FAPI-like approach. Some parameters seem to be non implemented in FAPI (for the moment addedd manually). Cleaning of some part of RRC code. Code compile.
parent 87aff44c
......@@ -60,8 +60,8 @@ void NB_phy_config_mib_eNB(int Mod_id,
void NB_phy_config_sib2_eNB(uint8_t Mod_id,
int CC_id,
nb_iot_config_t *config,
rf_config_t *rf_config
nfapi_nb_iot_config_t *config,
nfapi_rf_config_t *rf_config
);
void NB_phy_config_dedicated_eNB(module_id_t Mod_id,
......
......@@ -201,8 +201,8 @@ void NB_phy_config_mib_eNB(
void NB_phy_config_sib2_eNB(uint8_t Mod_id,
int CC_id,
nb_iot_config_t *config,
rf_config_t *rf_config
nfapi_nb_iot_config_t *config,
nfapi_rf_config_t *rf_config
)
{
NB_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
......@@ -213,21 +213,21 @@ void NB_phy_config_sib2_eNB(uint8_t Mod_id,
//MP: FAPI style approach: instead of a list they consider the 3 possible configuration separately
if(config->nprach_config_0_enabled == 1){
if(config->nprach_config_0_enabled.value == 1){
LOG_D(PHY, "NPRACH Config #0 enabled\n");
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
LOG_D(PHY," config#0: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
//FIXME: MP: memory for the list should be allocated? initialization??
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_Periodicity = config->nprach_config_0_sf_periodicity;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_Periodicity = config->nprach_config_0_sf_periodicity.value;
LOG_D(PHY,"config#0: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_Periodicity);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_StartTime = config->nprach_config_0_start_time;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_StartTime = config->nprach_config_0_start_time.value;
LOG_D(PHY,"config#0: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_StartTime);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset.value;
LOG_D(PHY,"config#0: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierOffset);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers.value;
LOG_D(PHY,"config#0: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_NumSubcarriers);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempts;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempt.value;
LOG_D(PHY,"config#0: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[0]->numRepetitionsPerPreambleAttempt);
///FIXME: missed configuration in FAPI config_request (TS 36.331 pag 610)
......@@ -240,21 +240,21 @@ void NB_phy_config_sib2_eNB(uint8_t Mod_id,
}
if(config->nprach_config_1_enabled == 1){
if(config->nprach_config_1_enabled.value == 1){
LOG_D(PHY, "NPRACH Config #1 enabled\n");
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
LOG_D(PHY," config#1: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
//FIXME: MP: memory for the list should be allocated? initialization??
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_Periodicity = config->nprach_config_1_sf_periodicity;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_Periodicity = config->nprach_config_1_sf_periodicity.value;
LOG_D(PHY,"config#1: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_Periodicity);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_StartTime = config->nprach_config_1_start_time;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_StartTime = config->nprach_config_1_start_time.value;
LOG_D(PHY,"config#1: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_StartTime);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset.value;
LOG_D(PHY,"config#1: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierOffset);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers.value;
LOG_D(PHY,"config#1: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_NumSubcarriers);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempts;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempt.value;
LOG_D(PHY,"config#1: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[1]->numRepetitionsPerPreambleAttempt);
///FIXME: missed configuration in FAPI config_request (TS 36.331 pag 610)
......@@ -266,21 +266,21 @@ void NB_phy_config_sib2_eNB(uint8_t Mod_id,
}
if(config->nprach_config_2_enabled == 1){
if(config->nprach_config_2_enabled.value == 1){
LOG_D(PHY, "NPRACH Config #2 enabled\n");
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
LOG_D(PHY," config#2: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
//FIXME: MP: memory for the list should be allocated? initialization??
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_Periodicity = config->nprach_config_2_sf_periodicity;
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_Periodicity = config->nprach_config_2_sf_periodicity.value;
LOG_D(PHY,"config#2: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_Periodicity);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_StartTime = config->nprach_config_2_start_time;
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_StartTime = config->nprach_config_2_start_time.value;
LOG_D(PHY,"config#2: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_StartTime);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset;
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset.value;
LOG_D(PHY,"config#2: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierOffset);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers;
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers.value;
LOG_D(PHY,"config#2: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_NumSubcarriers);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempts;
fp->nprach_config_common.nprach_ParametersList.list.array[2]->numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempt.value;
LOG_D(PHY,"config#2: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->numRepetitionsPerPreambleAttempt);
///FIXME: missed configuration in FAPI config_request (TS 36.331 pag 610)
......@@ -300,20 +300,20 @@ void NB_phy_config_sib2_eNB(uint8_t Mod_id,
//NPDSCH_ConfigCommon_NB_r13_t b;
//FIXME: the FAPI specs pag 140 fix a range of value (0->255) but i don't find any similar correspondence in the 3GPP specs (TS 36.331 pag 608 and TS 36.213 ch 16.2.2)
fp->npdsch_config_common.nrs_Power = rf_config->reference_signal_power;
fp->npdsch_config_common.nrs_Power = rf_config->reference_signal_power.value;
/*NPUSCH ConfigCommon-------------------------------------------------------------------*/
//NPUSCH_ConfigCommon_NB_r13_t c;
fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence = config->three_tone_base_sequence;
fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence = config->three_tone_base_sequence.value;
LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence);
fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence = config->six_tone_base_sequence;
fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence = config->six_tone_base_sequence.value;
LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence);
fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift = config->three_tone_cyclic_shift;
fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift = config->three_tone_cyclic_shift.value;
LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_CyclicShift = %d\n",fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift);
fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift = config->six_tone_cyclic_shift;
fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift = config->six_tone_cyclic_shift.value;
LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_CyclicShift = %d\n",fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift);
fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence= config->twelve_tone_base_sequence;
fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence= config->twelve_tone_base_sequence.value;
LOG_D(PHY,"npusch_config_common.dmrs_Config.twelveTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence);
//MP: FAPI missed parameters
......@@ -337,10 +337,10 @@ void NB_phy_config_sib2_eNB(uint8_t Mod_id,
/*DL gap Config - OPTIONAL----------------------------------------------------------------*/
//DL_GapConfig_NB_r13_t a;
if(config->dl_gap_config_enable == 1){
fp->DL_gap_config.dl_GapDurationCoeff= config->dl_gap_duration_coefficent;
fp->DL_gap_config.dl_GapPeriodicity = config->dl_gap_periodicity;
fp->DL_gap_config.dl_GapThreshold = config->dl_gap_threshold;
if(config->dl_gap_config_enable.value == 1){
fp->DL_gap_config.dl_GapDurationCoeff= config->dl_gap_periodicity.value;
fp->DL_gap_config.dl_GapPeriodicity = config->dl_gap_periodicity.value;
fp->DL_gap_config.dl_GapThreshold = config->dl_gap_threshold.value;
}
//TODO
......
......@@ -204,6 +204,8 @@ typedef struct {
uint8_t nb_antennas_rx;
/// Number of common transmit antenna ports in eNodeB (1 or 2)
uint8_t nb_antenna_ports_eNB;
/// Number of common receiving antenna ports in eNodeB (1 or 2)
uint8_t nb_antenna_ports_rx_eNB;
/// NPRACH Config Common (from 36-331 RRC spec)
NPRACH_CONFIG_COMMON nprach_config_common;
/// NPDSCH Config Common (from 36-331 RRC spec)
......
......@@ -16,10 +16,10 @@ void PHY_config_req(PHY_Config_t* config_INFO){
NB_phy_config_mib_eNB(config_INFO->mod_id,
config_INFO->CC_id,
config_INFO->frequency_band_indicator,
config_INFO->sch_config.physical_cell_id,
config_INFO->subframe_config.dl_cyclic_prefix_type,
config_INFO->subframe_config.ul_cyclic_prefix_type,
config_INFO->rf_config.tx_antenna_ports,
config_INFO->sch_config.physical_cell_id.value,
config_INFO->subframe_config.dl_cyclic_prefix_type.value,
config_INFO->subframe_config.ul_cyclic_prefix_type.value,
config_INFO->rf_config.tx_antenna_ports.value,
config_INFO->dl_CarrierFreq,
config_INFO->ul_CarrierFreq);
}
......
......@@ -116,10 +116,11 @@ typedef struct RrcConfigurationReq_s {
int16_t Nid_cell[MAX_NUM_CCs];// for testing, change later
int16_t N_RB_DL[MAX_NUM_CCs];// for testing, change later
int nb_antennas_tx[MAX_NUM_CCs]; //MP: may no more used
int nb_antennas_rx[MAX_NUM_CCs]; //MP: may no more used
int nb_antennas_tx[MAX_NUM_CCs];
int nb_antennas_rx[MAX_NUM_CCs];
int nb_antenna_ports[MAX_NUM_CCs];
int nb_antenna_ports_rx[MAX_NUM_CCs];
//PRACH
long prach_root[MAX_NUM_CCs];
......
......@@ -468,7 +468,8 @@ typedef struct {
/*! \brief eNB common channels */
typedef struct {
int physCellId;
int p_eNB;
int p_eNB; //number of tx antenna port
int p_rx_eNB; //number of Rx antenna port
int Ncp;
int Ncp_UL;
int eutra_band;
......
......@@ -11,6 +11,7 @@
#include "openair1/PHY/LTE_TRANSPORT/defs_nb_iot.h"
#include "PhysicalConfigDedicated-NB-r13.h"
#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h"
#include "temp_nfapi_interface.h"
#define SCH_PAYLOAD_SIZE_MAX 4096
#define BCCH_PAYLOAD_SIZE_MAX 128
......@@ -19,93 +20,6 @@
// P5 FAPI-like configuration structures
typedef struct{
uint16_t duplex_mode;
uint16_t pcfich_power_offset;
uint16_t p_b; //refers to DL power allocation (see TS 36.213 ch 5.2
uint16_t dl_cyclic_prefix_type;
uint16_t ul_cyclic_prefix_type;
}subframe_config_t;
typedef struct{
uint16_t dl_channel_bandwidth;
uint16_t ul_channel_bandwidth;
uint16_t reference_signal_power;
uint16_t tx_antenna_ports;
uint16_t rx_antenna_ports;
}rf_config_t;
typedef struct{
uint16_t primary_sinchronization_signal_epre_eprers;
uint16_t secondary_sinchronization_signal_epre_eprers;
uint16_t physical_cell_id; //aka Ncell_id
}sch_config_t;
typedef struct{
uint16_t operating_mode;
uint16_t anchor;
uint16_t prb_index;
uint16_t control_region_size;
uint16_t assumed_crs_aps;
//enable or disable configuration #0 (value: 0 = Disable, 1 = Enable)
uint16_t nprach_config_0_enabled;
//periodicity of NPRACH resource (value 0,1,2,3,4,5,6,7 correspond to 40,80,160,240,320,640,1280,2560ms)
uint16_t nprach_config_0_sf_periodicity;
//NPRACH resource starting time after period (value 0,1,2,3,4,5,6,7 correspond to 8,16,32,64,128,256,512,1024ms)
uint16_t nprach_config_0_start_time;
//Frequency location of an NPRACH resource within a PRB (value 0,1,2,3,4,5,6 correspond to 0,12,24,36,2,18,34
uint16_t nprach_config_0_subcarrier_offset;
//Number of Subcarriers in NPRACH resource (value 0,1,2,3 correspond to 12,24,36,48)
uint16_t nprach_config_0_number_of_subcarriers;
//Cyclic prefix length for NPRACH transmission (value: 0 = 66.7usec, 1 = 266.7usec)
uint16_t nprach_config_0_cp_length;
//Number of repetitions for NPRACH transmission (value: 0,1,2,3,4,5,6,7 correspond to 1,2,4,8,16,32,64,128)
uint16_t nprach_config_0_number_of_repetitions_per_attempts;
uint16_t nprach_config_1_enabled;
uint16_t nprach_config_1_sf_periodicity;
uint16_t nprach_config_1_start_time;
uint16_t nprach_config_1_subcarrier_offset;
uint16_t nprach_config_1_number_of_subcarriers;
uint16_t nprach_config_1_cp_length;
uint16_t nprach_config_1_number_of_repetitions_per_attempts;
uint16_t nprach_config_2_enabled;
uint16_t nprach_config_2_sf_periodicity;
uint16_t nprach_config_2_start_time;
uint16_t nprach_config_2_subcarrier_offset;
uint16_t nprach_config_2_number_of_subcarriers;
uint16_t nprach_config_2_cp_length;
uint16_t nprach_config_2_number_of_repetitions_per_attempts;
//4 bits
uint16_t three_tone_base_sequence;/*OPTIONAL*/
//2bits
uint16_t six_tone_base_sequence; /*OPTIONAL*/
//5 bits
uint16_t twelve_tone_base_sequence; /*OPTIONAL*/
uint16_t three_tone_cyclic_shift;
uint16_t six_tone_cyclic_shift;
//Enable/disable the DL gap
uint16_t dl_gap_config_enable;
//Threshold on the maximum number of repetitions configured for NPDCCH before application of DL transmission gap config.
//value 0,1,2,3 correspond to 32,64,128,256
uint16_t dl_gap_threshold;
//Periodicity of a DL tranmission gap (value 0,1,2,3 correspond to 64,128,256,512sf)
uint16_t dl_gap_periodicity;
//Coefficent to calculate the gap duration of a DL transmission (value 0,1,2,3 correspond to oneEight, oneFourth, threeEight, oneHalf)
uint16_t dl_gap_duration_coefficent;
}nb_iot_config_t;
typedef struct{
uint16_t data_report_mode;
uint16_t sfn_sf;
}l23_config_t;
typedef struct{
/*OAI config. parameters*/
......@@ -130,11 +44,12 @@ typedef struct{
/*FAPI style config. parameters*/
subframe_config_t subframe_config;
rf_config_t rf_config;
sch_config_t sch_config;
nb_iot_config_t nb_iot_config;
l23_config_t l23_config;
nfapi_uplink_reference_signal_config_t uplink_reference_signal_config;
nfapi_subframe_config_t subframe_config;
nfapi_rf_config_t rf_config;
nfapi_sch_config_t sch_config;
nfapi_nb_iot_config_t nb_iot_config;
nfapi_l23_config_t l23_config;
/*Dedicated configuration --> not supported by FAPI?*/
PhysicalConfigDedicated_NB_r13_t *phy_config_dedicated;
......
......@@ -117,8 +117,9 @@ int NB_rrc_mac_config_req_eNB(
module_id_t Mod_idP,
int CC_idP,
int rntiP,
int physCellId,
int p_eNB, //number of eNB TX antenna ports
int physCellId, // is the NcellID for NB-IoT
int p_eNB, //number of eNB TX antenna ports (1 or 2 for NB-IoT)
int p_rx_eNB,// number of eNB Rx antenna ports (1 or 2 for NB-IoT)
int Ncp,
int Ncp_UL,
long eutra_band,//FIXME: frequencyBandIndicator in sib1 (is a long not an int!!)
......@@ -169,6 +170,7 @@ int NB_rrc_mac_config_req_eNB(
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].mib_NB = mib_NB;
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].physCellId = physCellId;
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].p_eNB = p_eNB;
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].p_rx_eNB = p_rx_eNB;
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].Ncp = Ncp;
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].Ncp_UL = Ncp_UL;
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].eutra_band = eutra_band;
......@@ -193,10 +195,11 @@ int NB_rrc_mac_config_req_eNB(
config_INFO->get_MIB = 1;
config_INFO->rnti = rntiP;
config_INFO->frequency_band_indicator = (uint8_t)eutra_band;
config_INFO->sch_config.physical_cell_id = physCellId;
config_INFO->subframe_config.dl_cyclic_prefix_type = Ncp;
config_INFO->subframe_config.ul_cyclic_prefix_type = Ncp_UL;
config_INFO->rf_config.tx_antenna_ports = p_eNB;
config_INFO->sch_config.physical_cell_id.value = physCellId;
config_INFO->subframe_config.dl_cyclic_prefix_type.value = Ncp;
config_INFO->subframe_config.ul_cyclic_prefix_type.value = Ncp_UL;
config_INFO->rf_config.tx_antenna_ports.value = p_eNB;
config_INFO->rf_config.rx_antenna_ports.value = p_rx_eNB;
config_INFO->dl_CarrierFreq = dl_CarrierFreq;
config_INFO->ul_CarrierFreq = ul_CarrierFreq;
......@@ -204,35 +207,35 @@ int NB_rrc_mac_config_req_eNB(
{
//FAPI specs pag 135
case MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_SamePCI_r13:
config_INFO->nb_iot_config.operating_mode = 0;
config_INFO->nb_iot_config.prb_index = mib_NB->message.operationModeInfo_r13.choice.inband_SamePCI_r13.eutra_CRS_SequenceInfo_r13;
config_INFO->nb_iot_config.assumed_crs_aps = -1; //is not defined so we put a negative value
config_INFO->nb_iot_config.operating_mode.value = 0;
config_INFO->nb_iot_config.prb_index.value = mib_NB->message.operationModeInfo_r13.choice.inband_SamePCI_r13.eutra_CRS_SequenceInfo_r13;
config_INFO->nb_iot_config.assumed_crs_aps.value = -1; //is not defined so we put a negative value
if(eutraControlRegionSize == NULL)
LOG_E(RRC, "NB_rrc_mac_config_req_eNB: oepration mode is in-band but eutraControlRegionSize is not defined");
LOG_E(RRC, "NB_rrc_mac_config_req_eNB: operation mode is in-band but eutraControlRegionSize is not defined");
else
config_INFO->nb_iot_config.control_region_size = *eutraControlRegionSize;
config_INFO->nb_iot_config.control_region_size.value = *eutraControlRegionSize;
break;
case MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_DifferentPCI_r13:
config_INFO->nb_iot_config.operating_mode = 1;
//config_INFO->nb_iot_config.prb_index = mib_NB->message.operationModeInfo_r13.choice.inband_DifferentPCI_r13
config_INFO->nb_iot_config.assumed_crs_aps = mib_NB->message.operationModeInfo_r13.choice.inband_DifferentPCI_r13.eutra_NumCRS_Ports_r13;
config_INFO->nb_iot_config.operating_mode.value = 1;
//config_INFO->nb_iot_config.prb_index.value = mib_NB->message.operationModeInfo_r13.choice.inband_DifferentPCI_r13 XXX (see FAPI specs pag 135)
config_INFO->nb_iot_config.assumed_crs_aps.value = mib_NB->message.operationModeInfo_r13.choice.inband_DifferentPCI_r13.eutra_NumCRS_Ports_r13;
if(eutraControlRegionSize == NULL)
LOG_E(RRC, "NB_rrc_mac_config_req_eNB: oepration mode is in-band but eutraControlRegionSize is not defined");
LOG_E(RRC, "NB_rrc_mac_config_req_eNB: operation mode is in-band but eutraControlRegionSize is not defined");
else
config_INFO->nb_iot_config.control_region_size = *eutraControlRegionSize;
config_INFO->nb_iot_config.control_region_size.value = *eutraControlRegionSize;
break;
case MasterInformationBlock_NB__operationModeInfo_r13_PR_guardband_r13:
config_INFO->nb_iot_config.operating_mode = 2;
//config_INFO->nb_iot_config.prb_index = mib_NB->message.operationModeInfo_r13.choice.guardband_r13
config_INFO->nb_iot_config.control_region_size = -1; //should not being defined so we put a negative value
config_INFO->nb_iot_config.assumed_crs_aps = -1; //is not defined so we put a negative value
config_INFO->nb_iot_config.operating_mode.value = 2;
//config_INFO->nb_iot_config.prb_index = mib_NB->message.operationModeInfo_r13.choice.guardband_r13 XXX (see FAPI specs pag 135)
config_INFO->nb_iot_config.control_region_size.value = -1; //should not being defined so we put a negative value
config_INFO->nb_iot_config.assumed_crs_aps.value = -1; //is not defined so we put a negative value
break;
case MasterInformationBlock_NB__operationModeInfo_r13_PR_standalone_r13:
config_INFO->nb_iot_config.operating_mode = 3;
config_INFO->nb_iot_config.prb_index = -1; // is not defined for this case (put a negative value)
config_INFO->nb_iot_config.control_region_size = -1;//is not defined so we put a negative value
config_INFO->nb_iot_config.assumed_crs_aps = -1; //is not defined so we put a negative value
config_INFO->nb_iot_config.operating_mode.value = 3;
config_INFO->nb_iot_config.prb_index.value = -1; // is not defined for this case (put a negative value)
config_INFO->nb_iot_config.control_region_size.value = -1;//is not defined so we put a negative value
config_INFO->nb_iot_config.assumed_crs_aps.value = -1; //is not defined so we put a negative value
break;
default:
LOG_E(RRC, "NB_rrc_mac_config_req_eNB: NB-IoT operating Mode (MIB-NB) not valid\n");
......@@ -275,9 +278,9 @@ int NB_rrc_mac_config_req_eNB(
NPRACH_Parameters_NB_r13_t* nprach_parameter;
config_INFO->nb_iot_config.nprach_config_0_enabled = 0;
config_INFO->nb_iot_config.nprach_config_1_enabled = 0;
config_INFO->nb_iot_config.nprach_config_2_enabled = 0;
config_INFO->nb_iot_config.nprach_config_0_enabled.value = 0;
config_INFO->nb_iot_config.nprach_config_1_enabled.value = 0;
config_INFO->nb_iot_config.nprach_config_2_enabled.value = 0;
switch(radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.size)
{
......@@ -285,15 +288,20 @@ int NB_rrc_mac_config_req_eNB(
break;
case 1:
nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[0];
config_INFO->nb_iot_config.nprach_config_0_enabled = 1;
config_INFO->nb_iot_config.nprach_config_0_cp_length = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_0_sf_periodicity = nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_0_start_time = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_offset = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_subcarriers = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_repetitions_per_attempts = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
//MP: missed configuration for FAPI-style structure
config_INFO->nb_iot_config.nprach_config_0_enabled.value = 1;
config_INFO->nb_iot_config.nprach_config_0_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_0_sf_periodicity.value = nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_0_start_time.value = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
config_INFO->nb_iot_config.nprach_config_0_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
//MP: missed configuration for FAPI-style structure (i have added on my own)
//nprach_SubcarrierMSG3_RangeStart_r13
//maxNumPreambleAttemptCE_r13
//npdcch_NumRepetitions_RA_r13
......@@ -304,51 +312,77 @@ int NB_rrc_mac_config_req_eNB(
break;
case 2:
nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[0];
config_INFO->nb_iot_config.nprach_config_0_enabled = 1;
config_INFO->nb_iot_config.nprach_config_0_cp_length = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_0_sf_periodicity = nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_0_start_time = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_offset = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_subcarriers = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_repetitions_per_attempts = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_0_enabled.value= 1;
config_INFO->nb_iot_config.nprach_config_0_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_0_sf_periodicity.value= nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_0_start_time.value = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
config_INFO->nb_iot_config.nprach_config_0_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[1];
config_INFO->nb_iot_config.nprach_config_1_enabled = 1;
config_INFO->nb_iot_config.nprach_config_1_cp_length = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_1_sf_periodicity = nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_1_start_time = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_1_subcarrier_offset = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_subcarriers = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_repetitions_per_attempts = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_1_enabled.value= 1;
config_INFO->nb_iot_config.nprach_config_1_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_1_sf_periodicity.value= nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_1_start_time.value = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_1_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_1_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
config_INFO->nb_iot_config.nprach_config_1_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
config_INFO->nb_iot_config.nprach_config_1_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
config_INFO->nb_iot_config.nprach_config_1_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
config_INFO->nb_iot_config.nprach_config_1_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
break;
case 3:
nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[0];
config_INFO->nb_iot_config.nprach_config_0_enabled = 1;
config_INFO->nb_iot_config.nprach_config_0_cp_length = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_0_sf_periodicity = nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_0_start_time = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_offset = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_subcarriers = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_repetitions_per_attempts = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_0_enabled.value= 1;
config_INFO->nb_iot_config.nprach_config_0_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_0_sf_periodicity.value= nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_0_start_time.value = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_0_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_0_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
config_INFO->nb_iot_config.nprach_config_0_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
config_INFO->nb_iot_config.nprach_config_0_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[1];
config_INFO->nb_iot_config.nprach_config_1_enabled = 1;
config_INFO->nb_iot_config.nprach_config_1_cp_length = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_1_sf_periodicity = nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_1_start_time = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_1_subcarrier_offset = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_subcarriers = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_repetitions_per_attempts = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_1_enabled.value= 1;
config_INFO->nb_iot_config.nprach_config_1_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_1_sf_periodicity.value= nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_1_start_time.value = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_1_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_1_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_1_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
config_INFO->nb_iot_config.nprach_config_1_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
config_INFO->nb_iot_config.nprach_config_1_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
config_INFO->nb_iot_config.nprach_config_1_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
config_INFO->nb_iot_config.nprach_config_1_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[2];
config_INFO->nb_iot_config.nprach_config_2_enabled = 1;
config_INFO->nb_iot_config.nprach_config_2_cp_length = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_2_sf_periodicity = nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_2_start_time = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_2_subcarrier_offset = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_2_number_of_subcarriers = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_2_number_of_repetitions_per_attempts = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_2_enabled.value= 1;
config_INFO->nb_iot_config.nprach_config_2_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
config_INFO->nb_iot_config.nprach_config_2_sf_periodicity.value= nprach_parameter->nprach_Periodicity_r13;
config_INFO->nb_iot_config.nprach_config_2_start_time.value = nprach_parameter->nprach_StartTime_r13;
config_INFO->nb_iot_config.nprach_config_2_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
config_INFO->nb_iot_config.nprach_config_2_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
config_INFO->nb_iot_config.nprach_config_2_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
config_INFO->nb_iot_config.nprach_config_2_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
config_INFO->nb_iot_config.nprach_config_2_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
config_INFO->nb_iot_config.nprach_config_2_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
config_INFO->nb_iot_config.nprach_config_2_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
config_INFO->nb_iot_config.nprach_config_2_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
break;
default:
......@@ -359,47 +393,60 @@ int NB_rrc_mac_config_req_eNB(
/*NPDSCH ConfigCommon*/
//FIXME: MP: FAPI specs define a range of value [0-255]==[0db - 63.75db] with 0.25db step -- corrispondence in 3GPP specs???
config_INFO->rf_config.reference_signal_power = radioResourceConfigCommon->npdsch_ConfigCommon_r13.nrs_Power_r13;
config_INFO->rf_config.reference_signal_power.value = radioResourceConfigCommon->npdsch_ConfigCommon_r13.nrs_Power_r13;
/*NPUSCH ConfigCommon*/
/* OPTIONAL */
if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13 != NULL)
//a pointer to the first element of the list
config_INFO->nb_iot_config.ack_nack_numRepetitions_MSG4 = &radioResourceConfigCommon->npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list.array[0];
if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13 != NULL)/* OPTIONAL */
{
/* OPTIONAL */
if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_BaseSequence_r13!= NULL)
config_INFO->nb_iot_config.three_tone_base_sequence = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_BaseSequence_r13);
config_INFO->nb_iot_config.three_tone_base_sequence.value = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_BaseSequence_r13);
/* OPTIONAL */
if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_BaseSequence_r13!= NULL)
config_INFO->nb_iot_config.six_tone_base_sequence = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_BaseSequence_r13);
config_INFO->nb_iot_config.six_tone_base_sequence.value = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_BaseSequence_r13);
/* OPTIONAL */
if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->twelveTone_BaseSequence_r13!= NULL)
config_INFO->nb_iot_config.twelve_tone_base_sequence = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->twelveTone_BaseSequence_r13);
config_INFO->nb_iot_config.twelve_tone_base_sequence.value = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->twelveTone_BaseSequence_r13);
config_INFO->nb_iot_config.three_tone_cyclic_shift = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13;
config_INFO->nb_iot_config.six_tone_cyclic_shift = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13;
config_INFO->nb_iot_config.three_tone_cyclic_shift.value = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13;
config_INFO->nb_iot_config.six_tone_cyclic_shift.value = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13;
}
//NOTE: MP: FAPI specs for UL RS Configurations seems to be targeted for LTE and not for NB-IoT
if(radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13 == TRUE)
config_INFO->uplink_reference_signal_config.uplink_rs_hopping.value = 1; //RS_GROUP_HOPPING (FAPI specs pag 127)
else
config_INFO->uplink_reference_signal_config.uplink_rs_hopping.value = 0;//RS_NO_HOPPING
config_INFO->uplink_reference_signal_config.group_assignment.value = radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13;
//Some missed parameters are in UL_CONFIG.request message (P7) in FAPI specs. and not configured through P5 procedure
//ack_NACK_NumRepetitions_Msg4_r13
//srs_SubframeConfig_r13 /* OPTIONAL */
//ul_ReferenceSignalsNPUSCH_r13 - groupHoppingEnabled_r13, groupAssignmentNPUSCH_r13
/*DL GAP config*/ /* OPTIONAL */
if(radioResourceConfigCommon->dl_Gap_r13 !=NULL)
/*DL GAP config */
if(radioResourceConfigCommon->dl_Gap_r13 !=NULL)/* OPTIONAL */
{
config_INFO->nb_iot_config.dl_gap_config_enable = 1;
config_INFO->nb_iot_config.dl_gap_threshold = radioResourceConfigCommon->dl_Gap_r13->dl_GapThreshold_r13;
config_INFO->nb_iot_config.dl_gap_duration_coefficent = radioResourceConfigCommon->dl_Gap_r13->dl_GapDurationCoeff_r13;
config_INFO->nb_iot_config.dl_gap_periodicity = radioResourceConfigCommon->dl_Gap_r13->dl_GapPeriodicity_r13;
config_INFO->nb_iot_config.dl_gap_config_enable.value = 1;
config_INFO->nb_iot_config.dl_gap_threshold.value = radioResourceConfigCommon->dl_Gap_r13->dl_GapThreshold_r13;
config_INFO->nb_iot_config.dl_gap_duration_coefficient.value = radioResourceConfigCommon->dl_Gap_r13->dl_GapDurationCoeff_r13;
config_INFO->nb_iot_config.dl_gap_periodicity.value = radioResourceConfigCommon->dl_Gap_r13->dl_GapPeriodicity_r13;
}
else
config_INFO->nb_iot_config.dl_gap_config_enable = 0;
config_INFO->nb_iot_config.dl_gap_config_enable.value = 0;
/*UL Power Control ConfigCommon*/
//nothing defined in FAPI specs
config_INFO->nb_iot_config.p0_nominal_npusch = radioResourceConfigCommon->uplinkPowerControlCommon_r13.p0_NominalNPUSCH_r13;
config_INFO->nb_iot_config.alpha = radioResourceConfigCommon->uplinkPowerControlCommon_r13.alpha_r13;
config_INFO->nb_iot_config.delta_preamle_MSG3 = radioResourceConfigCommon->uplinkPowerControlCommon_r13.deltaPreambleMsg3_r13;
/*RACH Config Common*/
//nothing defined in FAPI specs
......@@ -1126,7 +1173,7 @@ NB_pdcp_apply_security(
const protocol_ctxt_t* const ctxt_pP,
pdcp_t *const pdcp_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_id, //rb_idP % maxDRB_NB_r13
const rb_id_t rb_id, //rb_idP % maxDRB_NB_r13 = rb_id % 2 --> 0,1
const uint8_t pdcp_header_len,
const uint16_t current_sn,
uint8_t * const pdcp_pdu_buffer,
......@@ -2260,10 +2307,10 @@ rlc_op_status_t NB_rrc_rlc_config_asn1_req (
if (srb2add_listP != NULL) {
if(srb1bis_flag == SRB1BIS_FLAG_YES){
rb_id = DCCH0;
rb_id = DCCH0; //3
}//srb1bis
else{
rb_id = DCCH1;
rb_id = DCCH1; //1
}//srb1
lc_id = rb_id;
......@@ -2309,7 +2356,7 @@ rlc_op_status_t NB_rrc_rlc_config_asn1_req (
break; //RLC explicit value
case SRB_ToAddMod_NB_r13__rlc_Config_r13_PR_defaultValue:
//#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue
LOG_I(RRC, "RLC SRB1/SRB1bis is default value !!\n");
struct RLC_Config_NB_r13__am * config_am_pP = &srb_toaddmod_p->rlc_Config_r13->choice.explicitValue.choice.am;
config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13 = T_PollRetransmit_NB_r13_ms25000;
......@@ -2321,7 +2368,8 @@ rlc_op_status_t NB_rrc_rlc_config_asn1_req (
ctxt_pP,
SRB_FLAG_YES,
&srb_toaddmod_p->rlc_Config_r13->choice.explicitValue.choice.am,
rb_id,lc_id);
rb_id,
lc_id);
} else {
LOG_E(RLC, PROTOCOL_CTXT_FMT" ERROR IN ALLOCATING SRB %d \n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
......@@ -2423,8 +2471,8 @@ void NB_config_req_rlc_am_asn1 (
//MP: TODO: check if this conditions are correct
if ((config_am_pP->ul_AM_RLC_r13.maxRetxThreshold_r13 <= UL_AM_RLC_NB_r13__maxRetxThreshold_r13_t32) &&
(config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13 < T_PollRetransmit_NB_r13_spare1))
//&&(config_am_pP->dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 == NULL) //MP: may this check is not needed
(config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13 < T_PollRetransmit_NB_r13_spare1)
&&(config_am_pP->dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 == NULL))
{
MSC_LOG_RX_MESSAGE(
......@@ -2449,7 +2497,7 @@ void NB_config_req_rlc_am_asn1 (
l_rlc_p,
maxRetxThreshold_NB_tab[config_am_pP->ul_AM_RLC_r13.maxRetxThreshold_r13],
pollRetransmit_NB_tab[config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13],
(uint32_t* const) config_am_pP->dl_AM_RLC_r13.enableStatusReportSN_Gap_r13); //MP:XXX very bad cast
(uint32_t*) config_am_pP->dl_AM_RLC_r13.enableStatusReportSN_Gap_r13); //MP:XXX this cast generate problem??
} else {
MSC_LOG_RX_DISCARDED_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
......@@ -2480,7 +2528,7 @@ NB_rlc_am_configure(
rlc_am_entity_t *const rlc_pP,
const uint16_t max_retx_thresholdP,
const uint16_t t_poll_retransmitP,
const uint32_t* const enableStatusReportSN_Gap
const uint32_t* enableStatusReportSN_Gap
)
{
if (rlc_pP->configured == TRUE) {
......@@ -2495,7 +2543,7 @@ NB_rlc_am_configure(
rlc_pP->max_retx_threshold = max_retx_thresholdP;
rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_pP->t_poll_retransmit.ms_duration = t_poll_retransmitP;
rlc_pP->enableStatusReportSN_Gap = *enableStatusReportSN_Gap; //XXX: warning
rlc_pP->enableStatusReportSN_Gap = *enableStatusReportSN_Gap;
} else {
......@@ -2690,8 +2738,7 @@ rlc_op_status_t NB_rrc_rlc_remove_rlc (
}
//defined in rlc_rrc.c
//used for process_RRCConnectionReconfigurationComplete --> CONFIG_ACTION_REMOVE
//used also for rrc_t310_expiration --> I don't know if it is used (probably not)
//used only for rrc_t310_expiration --> I don't know if it is used (probably not)
rlc_op_status_t NB_rrc_rlc_config_req (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
......@@ -2715,7 +2762,7 @@ rlc_op_status_t NB_rrc_rlc_config_req (
switch (actionP) {
//XXX MP:is not used for adding rlc instance??
//XXX MP:this functuion is not used for adding rlc instance
case CONFIG_ACTION_ADD:
if (NB_rrc_rlc_add_rlc(ctxt_pP, srb_flagP, rb_idP, rb_idP, rlc_infoP.rlc_mode) != NULL) {
return RLC_OP_STATUS_INTERNAL_ERROR;
......
......@@ -117,16 +117,16 @@ uint8_t do_MIB_NB(
//XXX check if correct the bit assignment
uint8_t sfn_MSB = (uint8_t)((frame>>6) & 0x0f); // all the 4 bits are set to 1
uint8_t hsfn_LSB = (uint8_t)((frame>>8)& 0x03); //2 bits set to 1
uint8_t hsfn_LSB = (uint8_t)(frame & 0x3); //2 bits set to 1 (0x3 = 0011)
uint16_t spare=0; //11 bits --> use uint16
mib_NB->message.systemFrameNumber_MSB_r13.buf = &sfn_MSB;
mib_NB->message.systemFrameNumber_MSB_r13.size = 1; //if expressed in byte
mib_NB->message.systemFrameNumber_MSB_r13.bits_unused = 6;
mib_NB->message.systemFrameNumber_MSB_r13.bits_unused = 4; //is byte based (so how many bits you don't use of the 8 bits of a bite
mib_NB->message.hyperSFN_LSB_r13.buf= &hsfn_LSB;
mib_NB->message.hyperSFN_LSB_r13.size= 1;
mib_NB->message.hyperSFN_LSB_r13.bits_unused = 8;
mib_NB->message.hyperSFN_LSB_r13.bits_unused = 6;
//XXX to be set??
mib_NB->message.spare.buf = (uint16_t *)&spare;
......@@ -206,7 +206,7 @@ uint8_t do_SIB1_NB(uint8_t Mod_id, int CC_id,
//XXX to be checked
sib1_NB->hyperSFN_MSB_r13.buf = &hyperSFN_MSB;
sib1_NB->hyperSFN_MSB_r13.size = 1;
sib1_NB->hyperSFN_MSB_r13.bits_unused = 2;
sib1_NB->hyperSFN_MSB_r13.bits_unused = 0;
memset(&PLMN_identity_info_NB,0,sizeof(PLMN_IdentityInfo_NB_r13_t));
memset(&schedulingInfo_NB,0,sizeof(SchedulingInfo_NB_r13_t));
......@@ -481,8 +481,9 @@ uint8_t do_SIB23_NB(uint8_t Mod_id,
/// SIB2-NB-----------------------------------------
//Barring is manage by ab-Enabled in MIB-NB (but is not a struct as ac-BarringInfo)
//Barring is manage by ab-Enabled in MIB-NB (but is not a struct as ac-BarringInfo in LTE legacy)
//RACH Config. Common--------------------------------------------------------------
sib2_NB->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.preambleTransMax_CE_r13 =
configuration->rach_preambleTransMax_CE_NB[CC_id];
sib2_NB->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.powerRampingParameters_r13.powerRampingStep =
......@@ -492,7 +493,7 @@ uint8_t do_SIB23_NB(uint8_t Mod_id,
rach_Info_NB.ra_ResponseWindowSize_r13 = configuration->rach_raResponseWindowSize_NB[CC_id];
rach_Info_NB.mac_ContentionResolutionTimer_r13 = configuration-> rach_macContentionResolutionTimer_NB[CC_id];
//initialize this list? how to use it? correct?
//rach_infoList max size = maxNPRACH-Resources-NB-r13 = 3
ASN_SEQUENCE_ADD(&sib2_NB->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.rach_InfoList_r13.list,&rach_Info_NB);
//TS 36.331 pag 614 --> if not present the value to infinity sould be used
......@@ -500,17 +501,17 @@ uint8_t do_SIB23_NB(uint8_t Mod_id,
sib2_NB->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.connEstFailOffset_r13 = connEstFailOffset; /*OPTIONAL*/
// BCCH-Config-NB-IoT
// BCCH-Config-NB-IoT----------------------------------------------------------------
sib2_NB->radioResourceConfigCommon_r13.bcch_Config_r13.modificationPeriodCoeff_r13
= configuration->bcch_modificationPeriodCoeff_NB[CC_id];
// PCCH-Config-NB-IoT
// PCCH-Config-NB-IoT-----------------------------------------------------------------
sib2_NB->radioResourceConfigCommon_r13.pcch_Config_r13.defaultPagingCycle_r13
= configuration->pcch_defaultPagingCycle_NB[CC_id];
sib2_NB->radioResourceConfigCommon_r13.pcch_Config_r13.nB_r13 = configuration->pcch_nB_NB[CC_id];
sib2_NB->radioResourceConfigCommon_r13.pcch_Config_r13.npdcch_NumRepetitionPaging_r13 = configuration-> pcch_npdcch_NumRepetitionPaging_NB[CC_id];
//NPRACH-Config-NB-IoT
//NPRACH-Config-NB-IoT-----------------------------------------------------------------
sib2_NB->radioResourceConfigCommon_r13.nprach_Config_r13.nprach_CP_Length_r13 = configuration->nprach_CP_Length[CC_id];
sib2_NB->radioResourceConfigCommon_r13.nprach_Config_r13.rsrp_ThresholdsPrachInfoList_r13 = NULL; /*OPTIONAL*/
// =CALLOC(1, sizeof(struct RSRP_ThresholdsNPRACH_InfoList_NB_r13)); //fatto uguale dopo
......@@ -536,7 +537,7 @@ uint8_t do_SIB23_NB(uint8_t Mod_id,
sib2_NB->radioResourceConfigCommon_r13.npdsch_ConfigCommon_r13.nrs_Power_r13= configuration->npdsch_nrs_Power[CC_id];
//NPUSCH-Config NB-IoT
//NPUSCH-Config NB-IoT----------------------------------------------------------------
//list of size 3 (see maxNPRACH_Resources_NB_r13)
ack_nack_repetition = configuration-> npusch_ack_nack_numRepetitions_NB[CC_id]; //is an enumerative
ASN_SEQUENCE_ADD(&sib2_NB->radioResourceConfigCommon_r13.npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list,ack_nack_repetition);
......@@ -556,17 +557,17 @@ uint8_t do_SIB23_NB(uint8_t Mod_id,
sib2_NB->radioResourceConfigCommon_r13.npusch_ConfigCommon_r13.dmrs_Config_r13 = dmrs_config;
//ulReferenceSignalsNPUSCH
/*Reference Signal (RS) for UL in NB-IoT is called DRS (Demodulation Reference Signal)
* sequence-group hopping can be enabled or disabled by means of the cell-specific parameter groupHoppingEnabled_r13
* sequence-group hopping can be disabled for certain specific UE through the parameter groupHoppingDisabled (physicalConfigDedicated)
* groupAssignmentNPUSCH--> is used for generate the sequence-shift pattern
*/
sib2_NB->radioResourceConfigCommon_r13.npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13= configuration->npusch_groupHoppingEnabled[CC_id];
sib2_NB->radioResourceConfigCommon_r13.npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13 =configuration->npusch_groupAssignmentNPUSCH_r13[CC_id];
/* NPUCCH NOT EXIST in NB-IoT
*
* all data are sent over the NPUSCH. This includes also the UL control information (UCI),
* which is transmitted using a different format. Consequently there is no equivalent to the PUCCH of LTE in NB-IoT.
*/
/*OPTIONAL*/
//dl_GAP---------------------------------------------------------------------------------/*OPTIONAL*/
dl_Gap = CALLOC(1,sizeof(struct DL_GapConfig_NB_r13));
dl_Gap->dl_GapDurationCoeff_r13= configuration-> dl_GapDurationCoeff_NB[CC_id];
dl_Gap->dl_GapPeriodicity_r13= configuration->dl_GapPeriodicity_NB[CC_id];
......@@ -574,13 +575,13 @@ uint8_t do_SIB23_NB(uint8_t Mod_id,
sib2_NB->radioResourceConfigCommon_r13.dl_Gap_r13 = dl_Gap;
// uplinkPowerControlCommon - NB-IoT
// uplinkPowerControlCommon - NB-IoT------------------------------------------------------
sib2_NB->radioResourceConfigCommon_r13.uplinkPowerControlCommon_r13.p0_NominalNPUSCH_r13 = configuration->npusch_p0_NominalNPUSCH;
sib2_NB->radioResourceConfigCommon_r13.uplinkPowerControlCommon_r13.deltaPreambleMsg3_r13 = configuration->deltaPreambleMsg3;
sib2_NB->radioResourceConfigCommon_r13.uplinkPowerControlCommon_r13.alpha_r13 = configuration->npusch_alpha;
//no deltaFlist_PUCCH and no UL cyclic prefix
// UE Timers and Constants -NB-IoT
// UE Timers and Constants -NB-IoT--------------------------------------------------------
sib2_NB->ue_TimersAndConstants_r13.t300_r13 = configuration-> ue_TimersAndConstants_t300_NB[CC_id];
sib2_NB->ue_TimersAndConstants_r13.t301_r13 = configuration-> ue_TimersAndConstants_t301_NB[CC_id];
sib2_NB->ue_TimersAndConstants_r13.t310_r13 = configuration-> ue_TimersAndConstants_t310_NB[CC_id];
......@@ -588,9 +589,10 @@ uint8_t do_SIB23_NB(uint8_t Mod_id,
sib2_NB->ue_TimersAndConstants_r13.n310_r13 = configuration-> ue_TimersAndConstants_n310_NB[CC_id];
sib2_NB->ue_TimersAndConstants_r13.n311_r13 = configuration-> ue_TimersAndConstants_n311_NB[CC_id];
//other SIB2-NB Parameters--------------------------------------------------------------------------------
sib2_NB->freqInfo_r13.additionalSpectrumEmission_r13 = 1;
sib2_NB->freqInfo_r13.ul_CarrierFreq_r13 = NULL; /*OPTIONAL*/
sib2_NB->timeAlignmentTimerCommon_r13=TimeAlignmentTimer_infinity;//TimeAlignmentTimer_sf5120;
/*OPTIONAL*/
......@@ -703,7 +705,7 @@ uint8_t do_RRCConnectionSetup_NB(
*SRB_configList_NB = CALLOC(1,sizeof(SRB_ToAddModList_NB_r13_t));
/// SRB1--------------------
{
// SRB1_config_NB = CALLOC(1,sizeof(*SRB1_config_NB));
//
// //no srb_Identity in SRB_ToAddMod_NB
......@@ -714,7 +716,6 @@ uint8_t do_RRCConnectionSetup_NB(
// SRB1_rlc_config_NB->present = SRB_ToAddMod_NB_r13__rlc_Config_r13_PR_explicitValue;
// SRB1_rlc_config_NB->choice.explicitValue.present=RLC_Config_NB_r13_PR_am;//the only possible in NB_IoT
//
//
//// SRB1_rlc_config_NB->choice.explicitValue.choice.am.ul_AM_RLC_r13.t_PollRetransmit_r13 = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_poll_retransmit_r13;
//// SRB1_rlc_config_NB->choice.explicitValue.choice.am.ul_AM_RLC_r13.maxRetxThreshold_r13 = enb_properties.properties[ctxt_pP->module_id]->srb1_max_retx_threshold_r13;
//// //(musT be disabled--> SRB1 config pag 640 specs )
......@@ -743,10 +744,9 @@ uint8_t do_RRCConnectionSetup_NB(
//
// //ADD SRB1
// ASN_SEQUENCE_ADD(&(*SRB_configList_NB)->list,SRB1_config_NB);
}
///SRB1bis (The configuration for SRB1 and SRB1bis is the same)
// the only difference is the logical channel identity = 3 but not set here
///SRB1bis (The configuration for SRB1 and SRB1bis is the same) the only difference is the logical channel identity = 3 but not set here
SRB1bis_config_NB = CALLOC(1,sizeof(*SRB1bis_config_NB));
......@@ -776,7 +776,7 @@ uint8_t do_RRCConnectionSetup_NB(
SRB1bis_lchan_config_NB->choice.explicitValue.logicalChannelSR_Prohibit_r13 = logicalChannelSR_Prohibit;
//ADD SRB1bis
//MP: Actually there is no way to distinguish SRB1 and SRB1bis once in the list
//MP: Actually there is no way to distinguish SRB1 and SRB1bis once put in the list
//MP: SRB_ToAddModList_NB_r13_t size = 1
ASN_SEQUENCE_ADD(&(*SRB_configList_NB)->list,SRB1bis_config_NB);
......@@ -799,30 +799,38 @@ uint8_t do_RRCConnectionSetup_NB(
* Once selected, the same transmission scheme applies to NPBCH, NPDCCH, and NPDSCH.
* */
//FIXME: CarrierConfigDedicated check the set values
//FIXME: MP: CarrierConfigDedicated check the set values ----------------------------------------------
//DL
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_CarrierFreq_r13.carrierFreq_r13=0;//random value set
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.downlinkBitmapNonAnchor_r13= CALLOC(1,sizeof(struct DL_CarrierConfigDedicated_NB_r13__downlinkBitmapNonAnchor_r13));
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.downlinkBitmapNonAnchor_r13->present=
DL_CarrierConfigDedicated_NB_r13__downlinkBitmapNonAnchor_r13_PR_useNoBitmap_r13;
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_GapNonAnchor_r13 = CALLOC(1,sizeof(struct DL_CarrierConfigDedicated_NB_r13__dl_GapNonAnchor_r13));
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_GapNonAnchor_r13->present =
DL_CarrierConfigDedicated_NB_r13__dl_GapNonAnchor_r13_PR_useNoGap_r13;
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.inbandCarrierInfo_r13= NULL;
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->ul_CarrierConfig_r13.ul_CarrierFreq_r13->carrierFreq_r13=0;
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->ul_CarrierConfig_r13.ul_CarrierFreq_r13->carrierFreqOffset_r13= NULL;
//UL
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->ul_CarrierConfig_r13.ul_CarrierFreq_r13= NULL;
// NPDCCH
physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13 =0;
physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13 =0;
physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13=0;
// NPUSCH
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13->ack_NACK_NumRepetitions_r13= NULL; //(specs pag 643) /* OPTIONAL */
// NPUSCH //(specs TS 36.331 v14.2.1 pag 643) /* OPTIONAL */
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13->ack_NACK_NumRepetitions_r13= NULL;
npusch_AllSymbols= CALLOC(1, sizeof(BOOLEAN_t));
*npusch_AllSymbols= 1; //TRUE
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13->npusch_AllSymbols_r13= npusch_AllSymbols; /* OPTIONAL */
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13->groupHoppingDisabled_r13=NULL; /* OPTIONAL */
// UplinkPowerControlDedicated
physicalConfigDedicated2_NB->uplinkPowerControlDedicated_r13->p0_UE_NPUSCH_r13 = 0; // 0 dB (specs pag 643)
physicalConfigDedicated2_NB->uplinkPowerControlDedicated_r13->p0_UE_NPUSCH_r13 = 0; // 0 dB (specs TS36.331 v14.2.1 pag 643)
//Fill the rrcConnectionSetup-NB message
......
......@@ -493,7 +493,8 @@ typedef struct {
//implicit parameters needed
int Ncp; //cyclic prefix for DL
int Ncp_UL; //cyclic prefix for UL
int p_eNB; //number of antenna port (getting from the CRS of the MIB-NB)
int p_eNB; //number of tx antenna port
int p_rx_eNB; //number of receiving antenna ports
uint32_t dl_CarrierFreq; //detected by the UE
uint32_t ul_CarrierFreq; //detected by the UE
uint16_t physCellId; //not stored in the MIB-NB but is getting through NPSS/NSSS
......
......@@ -70,9 +70,10 @@ RRC_status_t rrc_rx_tx_NB(protocol_ctxt_t* const ctxt_pP, const uint8_t enb_ind
int NB_rrc_mac_config_req_eNB(
module_id_t Mod_idP,
int CC_idP,
int rntiP, //FIXME: Raymond bug?
int rntiP,
int physCellId,
int p_eNB,
int p_rx_eNB,// number of rx antenna ports
int Ncp,
int Ncp_UL,
long eutra_band,//FIXME: frequencyBandIndicator in sib1 (is a long not an int!!)
......
......@@ -312,7 +312,7 @@ rrc_rx_tx_NB(
"[UE %d][RAPROC] Frame %d T300 Count %d ms\n", ctxt_pP->module_id, ctxt_pP->frame, UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt);
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_cnt
== T300[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.t300]) {
== T300_NB[UE_rrc_inst[ctxt_pP->module_id].sib2[enb_indexP]->ue_TimersAndConstants.t300]) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T300_active = 0;
// ALLOW CCCH to be used
UE_rrc_inst[ctxt_pP->module_id].Srb0[enb_indexP].Tx_buffer.payload_size = 0;
......
......@@ -3628,7 +3628,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
} else { // remove LCHAN from MAC/PHY
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) { //???
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) {
// DRB has just been removed so remove RLC + PDCP for DRB
/* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
......
......@@ -571,6 +571,7 @@ rrc_eNB_generate_RRCConnectionSetup_NB(
ue_context_pP->ue_context.rnti,
0, //physCellID
0, //p_eNB
0, //p_rx_eNB
0, //Ncp
0, //Ncp_UL
0, //eutraband
......@@ -800,6 +801,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
ue_context_pP->ue_context.rnti,
0,//physCellId --> this parameters could be set to 0 since no MIB is present
0,// p_eNB
0,//p_rx_eNB
0, //Ncp
0, //Ncp_UL
0, //eutra_band
......@@ -843,6 +845,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
ue_context_pP->ue_context.rnti,
0,//physCellId --> this parameters could be set to 0 since no MIB is present
0,// p_eNB
0,//p_rx_eNB
0, //Ncp
0, //Ncp_UL
0, //eutra_band
......@@ -1456,7 +1459,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB(const protocol_ctxt_t* c
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
///Mac_MainConfig
///Mac_MainConfig (default as defined in TS 36.331 ch 9.2.2)
mac_MainConfig_NB = CALLOC(1, sizeof(*mac_MainConfig_NB));
ue_context_pP->ue_context.mac_MainConfig_NB = mac_MainConfig_NB;
......@@ -1484,6 +1487,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB(const protocol_ctxt_t* c
if (*physicalConfigDedicated_NB) {
//DL_CarrierConfigDedicated_NB_r13_t cio;
//UL_CarrierConfigDedicated_NB_r13_t c;
//TODO: which value should be configured of phisical config dedicated?
//antennaInfo not present in PhysicalConfigDedicated for NB_IoT
//cqi reporting is not present in PhysicalConfigDedicated for NB_IoT
......@@ -1621,6 +1627,7 @@ init_SI_NB(
//copy basic parameters
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id];
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].p_rx_eNB = configuration->nb_antenna_ports_rx[CC_id];
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].Ncp = configuration->prefix_type[CC_id]; //DL Cyclic prefix
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].Ncp_UL = configuration->prefix_type_UL[CC_id];//UL cyclic prefix
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
......@@ -1719,6 +1726,7 @@ init_SI_NB(
0,//rnti
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].physCellId,
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].p_eNB,
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].p_rx_eNB,
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].Ncp,
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].Ncp_UL,
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].sib1_NB->freqBandIndicator_r13, //eutra_band
......@@ -1807,7 +1815,6 @@ while ( eNB_rrc_inst_NB == NULL ) {
//XXX following the old implementation: openair_rrc_top_init is called in MAC/main.c
//In Rymond version actually is called here
//openair_rrc_top_init_eNB_NB();
//init ch SRB0, SRB1 & BDTCH
......
......@@ -101,9 +101,7 @@ LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {ul_SpecificPara
};
//CONSTANTS
rlc_info_t Rlc_info_um,Rlc_info_am_config,
//NB-IoT
Rlc_info_am;
rlc_info_t Rlc_info_um,Rlc_info_am_config;
uint16_t RACH_FREQ_ALLOC;
//uint8_t NB_RACH;
......
......@@ -29,8 +29,6 @@
*/
//#ifndef __OPENAIR_RRC_VARS_NB_H__
//#define __OPENAIR_RRC_VARS_NB_H__
#include "defs_nb_iot.h"
#include "LAYER2/RLC/rlc.h"
#include "COMMON/mac_rrc_primitives.h"
......@@ -66,10 +64,7 @@ unsigned short Data_to_read;
#include "LAYER2/MAC/extern.h"
#define MAX_U32 0xFFFFFFFF
//LogicalChannelConfig__ext1 logicalChannelSR_Mask_r9_ext1--> not defined for NB-IoT
eNB_RRC_INST_NB *eNB_rrc_inst_NB;
uint8_t DRB2LCHAN_NB[2];//max can be 2 DRBs for NB_IoT --> it used for saving the LCID of DRBs
BOOLEAN_t logicalChannelSR_Prohibit = 1;
......@@ -89,16 +84,12 @@ struct LogicalChannelConfig_NB_r13 SRB1_NB_logicalChannelConfig_defaultValue = {
//CONSTANTS
rlc_info_t Rlc_info_um,Rlc_info_am_config, Rlc_info_am;
uint16_t RACH_FREQ_ALLOC;
//TODO: MP: to e changed --> mac_rrc_primitives
LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
//MP: LCHAN_DESC (mac_rrc_primitives) is not needed, was only an old implementation for storing LCH information
//XXX //MP:May not needed
//MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER;
//MAC_AVG_T BCCH_MEAS_AVG, CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG;
// timers (TS 36.331 "UE-TimersAndConstants-NB" pag 622) (milliseconds) XXX MP:--> not sure they will be used
// timers (TS 36.331 v14.2.1 "UE-TimersAndConstants-NB" pag 622) (milliseconds)
//seems to be not used or only at UE side
uint16_t T300_NB[8] = {2500,4000,6000,10000, 15000,25000,40000,60000};
uint16_t T301_NB[8] = {2500,4000,6000,10000, 15000,25000,40000,60000}; //MP: this start at RRCconnectionReestablishmentReq (not implemented in OAI)
uint16_t T310_NB[8] = {0,200,500,1000,2000,4000,8000};
......@@ -111,4 +102,3 @@ uint16_t N311_NB[8] = {1,2,3,4,5,6,8,10};
/* MP: 36.133 Section 9.1.4 RSRP Measurement Report Mapping and RSRQ Mapping, Table: 9.1.4-1 --> not for NB-IoT*/
//#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment