Commit 807e160b authored by Michele Paffetti's avatar Michele Paffetti

adding PHY_Config structure for FAPI-like PHY configuration, still to finish...

adding PHY_Config structure for FAPI-like PHY configuration, still to finish the function call. The code compile
parent bd903cfe
This diff is collapsed.
This diff is collapsed.
......@@ -565,6 +565,9 @@ typedef struct PHY_VARS_eNB_s {
// Pointers for active physicalConfigDedicated to be applied in current subframe
struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
//Pointers for actve physicalConfigDedicated for NB-IoT to be applied in current subframe
struct PhysicalConfigDedicated_NB_r13 *phy_config_dedicated_NB[NUMBER_OF_UE_MAX];
uint32_t rb_mask_ul[4];
......
......@@ -48,27 +48,31 @@
/// NPRACH-ParametersList-NB-r13 from 36.331 RRC spec
typedef struct {
typedef struct NPRACH_Parameters_NB{
/// the period time for nprach
uint8_t nprach_Periodicity;
uint16_t nprach_Periodicity;
/// for the start time for the NPRACH resource from 40ms-2560ms
uint8_t nprach_StartTime;
uint16_t nprach_StartTime;
/// for the subcarrier of set to the NPRACH preamble from n0 - n34
uint8_t nprach_SubcarrierOffset;
uint16_t nprach_SubcarrierOffset;
///number of subcarriers in a NPRACH resource allowed values (n12,n24,n36,n48)
uint16_t nprach_NumSubcarriers;
/// where is the region that in NPRACH resource to indicate if this UE support MSG3 for multi-tone or not. from 0 - 1
uint8_t nprach_SubcarrierMSG3_RangeStart;
uint16_t nprach_SubcarrierMSG3_RangeStart;
/// The max preamble transmission attempt for the CE level from 1 - 128
uint8_t maxNumPreambleAttemptCE;
uint16_t maxNumPreambleAttemptCE;
/// Number of NPRACH repetitions per attempt for each NPRACH resource
uint16_t numRepetitionsPerPreambleAttempt;
/// The number of the repetition for DCI use in RAR/MSG3/MSG4 from 1 - 2048
uint8_t npdcch_NumRepetitions_RA;
uint16_t npdcch_NumRepetitions_RA;
/// Starting subframe for NPDCCH Common searching space for (RAR/MSG3/MSG4)
uint8_t npdcch_StartSF_CSS_RA;
uint16_t npdcch_StartSF_CSS_RA;
/// Fractional period offset of starting subframe for NPDCCH common search space
uint8_t npdcch_Offset_RA;
uint16_t npdcch_Offset_RA;
} nprach_parameters_NB_t;
typedef struct{
A_SEQUENCE_OF(struct NPRACH_Parameters_NB) list;
A_SEQUENCE_OF(nprach_parameters_NB_t) list;
}NPRACH_List_NB_t;
typedef long RSRP_Range_t;
......@@ -81,7 +85,7 @@ typedef struct {
/// NPRACH_ConfigSIB-NB from 36.331 RRC spec
typedef struct {
/// nprach_CP_Length_r13, for the CP length(unit us) only 66.7 and 266.7 is implemented
uint8_t nprach_CP_Length;
uint16_t nprach_CP_Length;
/// The criterion for UEs to select a NPRACH resource. Up to 2 RSRP threshold values can be signalled. \vr{[1..2]}
struct rsrp_ThresholdsNPrachInfoList *rsrp_ThresholdsPrachInfoList;
/// NPRACH Parameters List
......@@ -91,20 +95,20 @@ typedef struct {
/// NPDSCH-ConfigCommon from 36.331 RRC spec
typedef struct {
///see TS 36.213 (16.2). \vr{[-60..50]}\n Provides the downlink reference-signal EPRE. The actual value in dBm.
int8_t nrs_Power;
uint16_t nrs_Power;
} NPDSCH_CONFIG_COMMON;
typedef struct{
/// The base sequence of DMRS sequence in a cell for 3 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 12. Value 12 is not used.
uint8_t threeTone_BaseSequence;
uint16_t threeTone_BaseSequence;
/// Define 3 cyclic shifts for the 3-tone case, see TS 36.211 [21, 10.1.4.1.2].
uint8_t threeTone_CyclicShift;
uint16_t threeTone_CyclicShift;
/// The base sequence of DMRS sequence in a cell for 6 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 14. Value 14 is not used.
uint8_t sixTone_BaseSequence;
uint16_t sixTone_BaseSequence;
/// Define 4 cyclic shifts for the 6-tone case, see TS 36.211 [21, 10.1.4.1.2].
uint8_t sixTone_CyclicShift;
uint16_t sixTone_CyclicShift;
/// The base sequence of DMRS sequence in a cell for 12 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 30. Value 30 is not used.
uint8_t twelveTone_BaseSequence;
uint16_t twelveTone_BaseSequence;
}DMRS_CONFIG_t;
......@@ -142,9 +146,9 @@ typedef struct{
/* DL-GapConfig-NB-r13 */
typedef struct {
uint8_t dl_GapThreshold;
uint8_t dl_GapPeriodicity;
uint8_t dl_GapDurationCoeff;
uint16_t dl_GapThreshold;
uint16_t dl_GapPeriodicity;
uint16_t dl_GapDurationCoeff;
} DL_GapConfig_NB;
typedef struct {
......@@ -217,7 +221,8 @@ typedef struct {
int eutra_band;
uint32_t dl_CarrierFreq;
uint32_t ul_CarrierFreq;
uint8_t CE;// CE level to determine the NPRACH Configuration
// CE level to determine the NPRACH Configuration (one CE for each NPRACH config.)
uint8_t CE;
} NB_DL_FRAME_PARMS;
......
......@@ -150,4 +150,7 @@ int16_t unscrambling_lut[65536*16] __attribute__((aligned(32)));
uint8_t scrambling_lut[65536*16] __attribute__((aligned(32)));
#endif /*__PHY_VARS_H__ */
......@@ -49,10 +49,45 @@ void Schedule_Response(Sched_Rsp_t Sched_INFO){
//todo
}
void PHY_config_req(PHY_Config_t config_INFO){
if(config_INFO.get_MIB != 0){
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.rf_config.tx_antenna_ports,
config_INFO.dl_CarrierFreq,
config_INFO.ul_CarrierFreq);
}
//Common Configuration included in SIB2-NB
NB_phy_config_sib2_eNB(config_INFO.mod_id,
config_INFO.CC_id,
&config_INFO.nb_iot_config, // FIXME to be evaluated is should be passed a pointer
&config_INFO.rf_config); // FIXME to be evaluated is should be passed a pointer
//Dedicated Configuration
if(config_INFO.phy_config_dedicated != NULL){
NB_phy_config_dedicated_eNB(config_INFO.mod_id,
config_INFO.CC_id,
config_INFO.rnti,
config_INFO.phy_config_dedicated //not defined by fapi specs
);
}
}
int IF_Module_init(IF_Module_t *if_inst){
if_inst->UL_indication = UL_indication;
if_inst->Schedule_Response = Schedule_Response;
if_inst->PHY_config_req = PHY_config_req;
return 0;
}
/*This is the interface module between PHY
*Provided the FAPI style interface structures for P7.
*
*
*Provide the semi-FAPI style interface for P5 (configuration)
*
*/
#ifndef __IF_MODULE_NB_IoT__H__
#define __IF_MODULE_NB_IoT__H__
#include "openair1/PHY/LTE_TRANSPORT/defs_nb_iot.h"
#include "PhysicalConfigDedicated-NB-r13.h"
#define SCH_PAYLOAD_SIZE_MAX 4096
#define BCCH_PAYLOAD_SIZE_MAX 128
#define NUMBER_OF_UE_MAX 20
// 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*/
module_id_t mod_id;
int CC_id;
int rnti;
int get_MIB; //should be different from 0 only when the mib!= null (NB_rrc_mac_config_req_eNB)
//In FAPI specs --> is inside the nb_iot_rssi_request (P4 Network Monitor Mode procedure)
//In OAI is called eutra_band
uint8_t frequency_band_indicator; //parameter carried by the SIB1-NB, is and index of the Table 5.5-1 TS 36.101
//In 3GPP specs (TS 36.101 Table 5.7.3-1 and ch 5.7.3F) see also SIB2-NB freqInfo.ul-carrierFreq
//this parameters should be evaluated based of the EUTRA Absolute Radio Frequency Channel Number (EARFCN)
//in FAPI this value is given inside th BROADCAST DETECT request (P4 Network Monito Mode procedure)
//in OAI we set the dl_CarrierFrequenci at configuration time (see COMMON/rrc_messages_types.h)
//then adding an offset for the ul_CarrierFreq ( see RU-RAU split approach - init_SI)
uint32_t dl_CarrierFreq;
uint32_t ul_CarrierFreq;
/*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;
/*Dedicated configuration --> not supported by FAPI?*/
PhysicalConfigDedicated_NB_r13_t *phy_config_dedicated;
}PHY_Config_t;
// uplink subframe P7
typedef struct{
......@@ -192,6 +321,7 @@ typedef struct{
typedef struct IF_Module_s{
void (*UL_indication)(UL_IND_t UL_INFO);
void (*Schedule_Response)(Sched_Rsp_t Sched_INFO);
void (*PHY_config_req)(PHY_Config_t config_INFO);
}IF_Module_t;
/*Initial */
......@@ -206,5 +336,10 @@ void UL_indication(UL_IND_t UL_INFO);
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void Schedule_Response(Sched_Rsp_t Sched_INFO);
/*Interface for Configuration*/
//void Config_Request();
/*Interface for PHY Configuration
* Trigger the phy_config_xxx functions using parameters from the shared PHY_Config structure
* */
void PHY_config_req(PHY_Config_t config_INFO);
#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