Commit e6c9d9c6 authored by Nick Ho's avatar Nick Ho

Fix error occurs at PHY and MAC (done), RRC & ASN.1 still ongoing

parent eca9fdc5
...@@ -35,17 +35,18 @@ ...@@ -35,17 +35,18 @@
//#endif //#endif
/*brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB-NB decoding + primary/secondary synch).*/ /*brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB-NB decoding + primary/secondary synch).*/
void phy_config_mib_eNB_NB_IoT(int Mod_id, void phy_config_mib_eNB_NB_IoT(int Mod_id,
int eutra_band, int CC_id,
int Nid_cell, int eutra_band,
int Ncp, int Nid_cell,
int Ncp_UL, int Ncp,
int p_eNB, int Ncp_UL,
uint16_t EARFCN, int p_eNB,
uint16_t prb_index, // NB_IoT_RB_ID, uint16_t EARFCN,
uint16_t operating_mode, uint16_t prb_index, // NB_IoT_RB_ID,
uint16_t control_region_size, uint16_t operating_mode,
uint16_t eutra_NumCRS_ports); uint16_t control_region_size,
uint16_t eutra_NumCRS_ports);
/*NB_phy_config_sib1_eNB is not needed since NB-IoT use only FDD mode*/ /*NB_phy_config_sib1_eNB is not needed since NB-IoT use only FDD mode*/
...@@ -56,15 +57,17 @@ void phy_config_mib_eNB_NB_IoT(int Mod_id, ...@@ -56,15 +57,17 @@ void phy_config_mib_eNB_NB_IoT(int Mod_id,
// RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon // RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon
// ); // );
void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id, void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
nfapi_nb_iot_config_t *config, int CC_id,
nfapi_rf_config_t *rf_config, nfapi_nb_iot_config_t *config,
nfapi_uplink_reference_signal_config_t* ul_nrs_config, nfapi_rf_config_t *rf_config,
extra_phyConfig_t* extra_phy_parms); nfapi_uplink_reference_signal_config_t *ul_nrs_config,
extra_phyConfig_t *extra_phy_parms);
void phy_config_dedicated_eNB_NB_IoT(module_id_t Mod_id,
rnti_t rnti, void phy_config_dedicated_eNB_NB_IoT(uint8_t Mod_id,
extra_phyConfig_t* extra_phy_parms); int CC_id,
uint16_t rnti,
extra_phyConfig_t *extra_parms);
// void phy_init_lte_top_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms); // void phy_init_lte_top_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms);
void phy_init_nb_iot_eNB(PHY_VARS_eNB_NB_IoT *phyvar); void phy_init_nb_iot_eNB(PHY_VARS_eNB_NB_IoT *phyvar);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
//#include "defs.h" //#include "defs.h"
#include "SCHED_NBIOT/defs_NB_IoT.h" #include "SCHED_NBIOT/defs_NB_IoT.h"
#include "PHY/extern.h" #include "PHY/phy_extern.h"
#include "PHY/extern_NB_IoT.h" // PHY/defs_NB_IoT.h is called here , log.h & LTE_TRANSPORT/defs_NB_IoT.h are included through PHY/defs_NB_IoT.h #include "PHY/extern_NB_IoT.h" // PHY/defs_NB_IoT.h is called here , log.h & LTE_TRANSPORT/defs_NB_IoT.h are included through PHY/defs_NB_IoT.h
#include "openair2/LAYER2/MAC/proto_NB_IoT.h" // for functions: from_earfcn_NB_IoT, get_uldl_offset_NB_IoT #include "openair2/LAYER2/MAC/proto_NB_IoT.h" // for functions: from_earfcn_NB_IoT, get_uldl_offset_NB_IoT
//#include "SIMULATION/TOOLS/defs.h" //#include "SIMULATION/TOOLS/defs.h"
......
...@@ -80,8 +80,9 @@ void lte_sync_timefreq_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int band,unsigned int DL_fr ...@@ -80,8 +80,9 @@ void lte_sync_timefreq_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int band,unsigned int DL_fr
while (1) { while (1) {
//compute frequency-domain representation of 6144-sample chunk //compute frequency-domain representation of 6144-sample chunk
// Nick : Not sure about scale
dft6144((int16_t *)rxp, dft6144((int16_t *)rxp,
sp); sp,1);
/* /*
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "PHY/NBIoT_TRANSPORT/extern_NB_IoT.h" #include "PHY/NBIoT_TRANSPORT/extern_NB_IoT.h"
//#define DEBUG_CH //#define DEBUG_CH
#include "PHY/LTE_TRANSPORT/sc_rotation_NB_IoT.h" #include "PHY/NBIoT_TRANSPORT/sc_rotation_NB_IoT.h"
#include "T.h" #include "T.h"
......
...@@ -38,7 +38,7 @@ extern int G_tab[18]; ...@@ -38,7 +38,7 @@ extern int G_tab[18];
extern short conjugate[8],conjugate2[8]; extern short conjugate[8],conjugate2[8];
extern short *ul_ref_sigs_rx_NB_IoT[30][4]; // NB-IoT: format 1 pilots extern short *ul_ref_sigs_rx_NB_IoT[30][4]; // NB-IoT: format 1 pilots
extern short *ul_ref_sigs_f2_rx_NB_IoT[16]; // NB-IoT: format 2 pilots extern short *ul_ref_sigs_f2_rx_NB_IoT[16]; // NB-IoT: format 2 pilots
extern unsigned short dftsizes[33]; //extern unsigned short dftsizes[33];
extern int16_t e_phi_re_m6[120]; extern int16_t e_phi_re_m6[120];
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
#include "UTIL/OCG/OCG_extern.h" #include "UTIL/OCG/OCG_extern.h"
#endif #endif
*/ */
#include "UTIL/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
//#define DEBUG_ULSCH_DECODING //#define DEBUG_ULSCH_DECODING
...@@ -921,7 +921,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -921,7 +921,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
// NB_IoT: functions in ulsch_decoding_data_NB_IoT must be defined // NB_IoT: functions in ulsch_decoding_data_NB_IoT must be defined
int ulsch_decoding_data_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) { int ulsch_decoding_data_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,int UE_id,int harq_pid,int llr8_flag) {
unsigned int r,r_offset=0,Kr,Kr_bytes,iind; unsigned int r,r_offset=0,Kr,Kr_bytes,iind;
uint8_t crc_type; uint8_t crc_type;
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> //#include <linux/init.h>
#include <linux/module.h> //#include <linux/module.h>
#include <linux/version.h> #include <linux/version.h>
#include <linux/types.h> #include <linux/types.h>
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include "LAYER2/MAC/defs_NB_IoT.h" #include "LAYER2/MAC/defs_NB_IoT.h"
#include "LAYER2/MAC/proto_NB_IoT.h" #include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h" #include "LAYER2/MAC/extern_NB_IoT.h"
#include "BCCH-DL-SCH-Message-NB.h" #include "LTE_BCCH-DL-SCH-Message-NB.h"
#include "RRCConnectionSetup-NB.h" #include "LTE_RRCConnectionSetup-NB.h"
#include "BCCH-BCH-Message-NB.h" #include "LTE_BCCH-BCH-Message-NB.h"
//#include "SIB-Type-NB-r13.h" //#include "SIB-Type-NB-r13.h"
typedef struct eutra_bandentry_NB_s { typedef struct eutra_bandentry_NB_s {
...@@ -96,7 +96,7 @@ void config_mib_fapi_NB_IoT(int physCellId, ...@@ -96,7 +96,7 @@ void config_mib_fapi_NB_IoT(int physCellId,
int dl_CarrierFreq, int dl_CarrierFreq,
int ul_CarrierFreq, int ul_CarrierFreq,
long *eutraControlRegionSize, long *eutraControlRegionSize,
BCCH_BCH_Message_NB_t *mib_NB_IoT LTE_BCCH_BCH_Message_NB_t *mib_NB_IoT
) )
{ {
...@@ -114,7 +114,7 @@ void config_mib_fapi_NB_IoT(int physCellId, ...@@ -114,7 +114,7 @@ void config_mib_fapi_NB_IoT(int physCellId,
switch (mib_NB_IoT->message.operationModeInfo_r13.present) switch (mib_NB_IoT->message.operationModeInfo_r13.present)
{ {
//FAPI specs pag 135 //FAPI specs pag 135
case MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_SamePCI_r13: case LTE_MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_SamePCI_r13:
cfg->nb_iot_config.operating_mode.value = 0; cfg->nb_iot_config.operating_mode.value = 0;
cfg->nb_iot_config.prb_index.value = mib_NB_IoT->message.operationModeInfo_r13.choice.inband_SamePCI_r13.eutra_CRS_SequenceInfo_r13; //see TS 36.213 ch 16.0 cfg->nb_iot_config.prb_index.value = mib_NB_IoT->message.operationModeInfo_r13.choice.inband_SamePCI_r13.eutra_CRS_SequenceInfo_r13; //see TS 36.213 ch 16.0
...@@ -127,7 +127,7 @@ void config_mib_fapi_NB_IoT(int physCellId, ...@@ -127,7 +127,7 @@ void config_mib_fapi_NB_IoT(int physCellId,
break; break;
case MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_DifferentPCI_r13: case LTE_MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_DifferentPCI_r13:
cfg->nb_iot_config.operating_mode.value = 1; cfg->nb_iot_config.operating_mode.value = 1;
//fapi think to define also eutra_CRS_sequenceInfo also for in band with different PCI but the problem is that we don-t have i //fapi think to define also eutra_CRS_sequenceInfo also for in band with different PCI but the problem is that we don-t have i
...@@ -140,7 +140,7 @@ void config_mib_fapi_NB_IoT(int physCellId, ...@@ -140,7 +140,7 @@ void config_mib_fapi_NB_IoT(int physCellId,
break; break;
case MasterInformationBlock_NB__operationModeInfo_r13_PR_guardband_r13: case LTE_MasterInformationBlock_NB__operationModeInfo_r13_PR_guardband_r13:
cfg->nb_iot_config.operating_mode.value = 2; cfg->nb_iot_config.operating_mode.value = 2;
cfg->nb_iot_config.control_region_size.value = -1; //should not being defined so we put a negative value cfg->nb_iot_config.control_region_size.value = -1; //should not being defined so we put a negative value
...@@ -148,7 +148,7 @@ void config_mib_fapi_NB_IoT(int physCellId, ...@@ -148,7 +148,7 @@ void config_mib_fapi_NB_IoT(int physCellId,
break; break;
case MasterInformationBlock_NB__operationModeInfo_r13_PR_standalone_r13: case LTE_MasterInformationBlock_NB__operationModeInfo_r13_PR_standalone_r13:
cfg->nb_iot_config.operating_mode.value = 3; cfg->nb_iot_config.operating_mode.value = 3;
cfg->nb_iot_config.prb_index.value = -1; // is not defined for this case (put a negative random value--> will be not considered for encoding, scrambling procedures) cfg->nb_iot_config.prb_index.value = -1; // is not defined for this case (put a negative random value--> will be not considered for encoding, scrambling procedures)
...@@ -165,7 +165,7 @@ void config_mib_fapi_NB_IoT(int physCellId, ...@@ -165,7 +165,7 @@ void config_mib_fapi_NB_IoT(int physCellId,
void config_sib2_fapi_NB_IoT( void config_sib2_fapi_NB_IoT(
int physCellId, int physCellId,
RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon LTE_RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon
) )
{ {
...@@ -180,7 +180,7 @@ void config_sib2_fapi_NB_IoT( ...@@ -180,7 +180,7 @@ void config_sib2_fapi_NB_IoT(
/*NPRACH section*/ /*NPRACH section*/
NPRACH_Parameters_NB_r13_t* nprach_parameter; LTE_NPRACH_Parameters_NB_r13_t* nprach_parameter;
cfg->nb_iot_config.nprach_config_0_enabled.value = 0; cfg->nb_iot_config.nprach_config_0_enabled.value = 0;
cfg->nb_iot_config.nprach_config_1_enabled.value = 0; cfg->nb_iot_config.nprach_config_1_enabled.value = 0;
...@@ -292,10 +292,10 @@ void rrc_mac_config_req_NB_IoT( ...@@ -292,10 +292,10 @@ void rrc_mac_config_req_NB_IoT(
int CC_idP, int CC_idP,
int rntiP, int rntiP,
rrc_eNB_carrier_data_NB_IoT_t *carrier, rrc_eNB_carrier_data_NB_IoT_t *carrier,
SystemInformationBlockType1_NB_t *sib1_NB_IoT, LTE_LTE_SystemInformationBlockType1_NB_t *sib1_NB_IoT,
RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon, LTE_RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon,
PhysicalConfigDedicated_NB_r13_t *physicalConfigDedicated, LTE_PhysicalConfigDedicated_NB_r13_t *physicalConfigDedicated,
LogicalChannelConfig_NB_r13_t *logicalChannelConfig, LTE_LogicalChannelConfig_NB_r13_t *logicalChannelConfig,
uint8_t ded_flag, uint8_t ded_flag,
uint8_t ue_list_ded_num) uint8_t ue_list_ded_num)
{ {
......
...@@ -51,14 +51,14 @@ typedef enum sib_MappingInfo{ ...@@ -51,14 +51,14 @@ typedef enum sib_MappingInfo{
} sib_MappingInfo_NB_IoT; } sib_MappingInfo_NB_IoT;
typedef enum si_TB{ typedef enum si_TB{
si_TB_56=2, si_TB_56=0,
si_TB_120=2, si_TB_120,
si_TB_208=8, si_TB_208,
si_TB_256=8, si_TB_256,
si_TB_328=8, si_TB_328,
si_TB_440=8, si_TB_440,
si_TB_552=8, si_TB_552,
si_TB_680=8 si_TB_680
} si_TB_NB_IoT; } si_TB_NB_IoT;
///RACH_ConfigCommon configuration ///RACH_ConfigCommon configuration
......
...@@ -103,7 +103,7 @@ typedef enum{ ...@@ -103,7 +103,7 @@ typedef enum{
#define MAX_MAX_MOBILES_PER_ENB_NB_IoT 20 #define MAX_MAX_MOBILES_PER_ENB_NB_IoT 20
#define SCH_PAYLOAD_SIZE_MAX_NB_IoT 320 #define SCH_PAYLOAD_SIZE_MAX_NB_IoT 320
#define MAX_NUMBER_OF_SIBs_NB_IoT 16 #define MAX_NUMBER_OF_SIBs_NB_IoT 16
#define MAX_NUMBER_OF_UE_MAX_NB_IoT 20
/*!\brief Values of BCCH0 logical channel for MIB*/ /*!\brief Values of BCCH0 logical channel for MIB*/
#define BCCH0_NB_IoT 11 // MIB-NB_IoT #define BCCH0_NB_IoT 11 // MIB-NB_IoT
/*!\brief Values of BCCH1 logical channel for SIBs */ /*!\brief Values of BCCH1 logical channel for SIBs */
...@@ -130,33 +130,6 @@ typedef enum{ ...@@ -130,33 +130,6 @@ typedef enum{
/*Index of PADDING logical channel*/ /*Index of PADDING logical channel*/
#define PADDING 31 #define PADDING 31
/// NPRACH-ParametersList-NB_IoT-r13 from 36.331 RRC spec defined in PHY
/*typedef struct NPRACH_Parameters_NB_IoT{
/// the period time for nprach
int nprach_Periodicity;
/// for the start time for the NPRACH resource from 40ms-2560ms
int nprach_StartTime;
/// for the subcarrier of set to the NPRACH preamble from n0 - n34
int nprach_SubcarrierOffset;
///number of subcarriers in a NPRACH resource allowed values (n12,n24,n36,n48)
int 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
int nprach_SubcarrierMSG3_RangeStart;
/// The max preamble transmission attempt for the CE level from 1 - 128
int maxNumPreambleAttemptCE;
/// Number of NPRACH repetitions per attempt for each NPRACH resource
int numRepetitionsPerPreambleAttempt;
/// The number of the repetition for DCI use in RAR/MSG3/MSG4 from 1 - 2048 (Rmax)
int npdcch_NumRepetitions_RA;
/// Starting subframe for NPDCCH Common searching space for (RAR/MSG3/MSG4)
int npdcch_StartSF_CSS_RA;
/// Fractional period offset of starting subframe for NPDCCH common search space
int npdcch_Offset_RA;
} nprach_parameters_NB_IoT_t;*/
/*! \brief Downlink SCH PDU Structure */ /*! \brief Downlink SCH PDU Structure */
typedef struct { typedef struct {
uint8_t payload[SCH_PAYLOAD_SIZE_MAX_NB_IoT]; uint8_t payload[SCH_PAYLOAD_SIZE_MAX_NB_IoT];
...@@ -213,10 +186,9 @@ typedef struct { ...@@ -213,10 +186,9 @@ typedef struct {
int RRC_connected; int RRC_connected;
uint8_t flag_schedule_success; uint8_t flag_schedule_success;
// UE active flag // UE active flag
int active; boolean_t active;
//boolean_t active;
uint8_t allocated_data_size_ul; uint8_t allocated_data_size_ul;
} UE_TEMPLATE_NB_IoT; } UE_TEMPLATE_NB_IoT;
// link list of uplink resource node // link list of uplink resource node
...@@ -228,7 +200,7 @@ typedef struct available_resource_UL_s{ ...@@ -228,7 +200,7 @@ typedef struct available_resource_UL_s{
//pointer to next and previous node //pointer to next and previous node
struct available_resource_UL_s *next, *prev; struct available_resource_UL_s *next, *prev;
}available_resource_UL_t; }available_resource_UL_t;
// link list of downlink resource node // link list of downlink resource node
typedef struct available_resource_DL_s{ typedef struct available_resource_DL_s{
///Resource start subframe ///Resource start subframe
...@@ -238,7 +210,7 @@ typedef struct available_resource_DL_s{ ...@@ -238,7 +210,7 @@ typedef struct available_resource_DL_s{
//pointer to next and previous node //pointer to next and previous node
struct available_resource_DL_s *next, *prev; struct available_resource_DL_s *next, *prev;
}available_resource_DL_t; }available_resource_DL_t;
/*Structure used for scheduling*/ /*Structure used for scheduling*/
typedef struct{ typedef struct{
//resource position info. //resource position info.
...@@ -250,12 +222,12 @@ typedef struct{ ...@@ -250,12 +222,12 @@ typedef struct{
//whcih available resource node is used //whcih available resource node is used
available_resource_DL_t *node; available_resource_DL_t *node;
}sched_temp_DL_NB_IoT_t; }sched_temp_DL_NB_IoT_t;
/*Structure used for UL scheduling*/ /*Structure used for UL scheduling*/
typedef struct{ typedef struct{
//resource position info, used subframe as unit //resource position info, used subframe as unit
uint32_t sf_end, sf_start; uint32_t sf_end, sf_start;
// information for allocating the resource (to fill DCIN) // information for allocating the resource (to fill DCIN)
int tone; int tone;
int scheduling_delay; int scheduling_delay;
...@@ -263,7 +235,7 @@ typedef struct{ ...@@ -263,7 +235,7 @@ typedef struct{
int ACK_NACK_resource_field; int ACK_NACK_resource_field;
available_resource_UL_t *node; available_resource_UL_t *node;
}sched_temp_UL_NB_IoT_t; }sched_temp_UL_NB_IoT_t;
/*** the value of variable in this structure is able to be changed in Preprocessor**/ /*** the value of variable in this structure is able to be changed in Preprocessor**/
typedef struct{ typedef struct{
...@@ -330,24 +302,24 @@ typedef struct{ ...@@ -330,24 +302,24 @@ typedef struct{
typedef struct { typedef struct {
/// DCI template and MAC connection parameters for UEs /// DCI template and MAC connection parameters for UEs
UE_TEMPLATE_NB_IoT UE_template_NB_IoT[MAX_MAX_MOBILES_PER_ENB_NB_IoT]; UE_TEMPLATE_NB_IoT UE_template_NB_IoT[MAX_NUMBER_OF_UE_MAX_NB_IoT];
UE_SCHED_CTRL_NB_IoT_t UE_sched_ctrl_NB_IoT[MAX_NUMBER_OF_UE_MAX_NB_IoT];
UE_SCHED_CTRL_NB_IoT_t UE_sched_ctrl_NB_IoT[MAX_MAX_MOBILES_PER_ENB_NB_IoT];
/// NPDCCH Period and searching space info /// NPDCCH Period and searching space info
NPDCCH_config_dedicated_NB_IoT_t NPDCCH_config_dedicated; NPDCCH_config_dedicated_NB_IoT_t NPDCCH_config_dedicated;
//int next[MAX_MAX_MOBILES_PER_ENB_NB_IoT]; //int next[MAX_NUMBER_OF_UE_MAX_NB_IoT];
// -1:No UE in list // -1:No UE in list
int head; int head;
// -1:No UE in list // -1:No UE in list
int tail; int tail;
int num_UEs; int num_UEs;
//boolean_t active[MAX_MAX_MOBILES_PER_ENB_NB_IoT]; //boolean_t active[MAX_NUMBER_OF_UE_MAX_NB_IoT];
} UE_list_NB_IoT_t; } UE_list_NB_IoT_t;
// scheduling flag calculated by computing flag function
typedef struct{ typedef struct{
// flag to indicate scheduing MIB-NB_IoT // flag to indicate scheduing MIB-NB_IoT
uint8_t flag_MIB; uint8_t flag_MIB;
// flag to indicate scheduling SIB1-NB_IoT // flag to indicate scheduling SIB1-NB_IoT
...@@ -359,7 +331,7 @@ typedef struct{ ...@@ -359,7 +331,7 @@ typedef struct{
// flag to indicate scheduling type1 NPDCCH CSS with different CE level // flag to indicate scheduling type1 NPDCCH CSS with different CE level
uint8_t flag_type1_css[3]; uint8_t flag_type1_css[3];
// flag to indicate scheduling NPDCCH USS with UE list // flag to indicate scheduling NPDCCH USS with UE list
uint8_t flag_uss[MAX_MAX_MOBILES_PER_ENB_NB_IoT]; uint8_t flag_uss[MAX_NUMBER_OF_UE_MAX_NB_IoT];
// flag to indicate scheduling sib1/MIB // flag to indicate scheduling sib1/MIB
uint8_t flag_fix_scheduling; uint8_t flag_fix_scheduling;
// number of the type2 css to schedule in this period // number of the type2 css to schedule in this period
...@@ -368,10 +340,8 @@ typedef struct{ ...@@ -368,10 +340,8 @@ typedef struct{
uint8_t num_type1_css_run; uint8_t num_type1_css_run;
// number of the uss to schedule in this period // number of the uss to schedule in this period
uint8_t num_uss_run; uint8_t num_uss_run;
}scheduling_flag_t; }scheduling_flag_t;
/*!\brief MAC subheader short with 7bit Length field */ /*!\brief MAC subheader short with 7bit Length field */
typedef struct { typedef struct {
uint8_t LCID:5; // octet 1 LSB uint8_t LCID:5; // octet 1 LSB
...@@ -381,6 +351,7 @@ typedef struct { ...@@ -381,6 +351,7 @@ typedef struct {
uint8_t L:7; // octet 2 LSB uint8_t L:7; // octet 2 LSB
uint8_t F:1; // octet 2 MSB uint8_t F:1; // octet 2 MSB
} __attribute__((__packed__))SCH_SUBHEADER_SHORT_NB_IoT; } __attribute__((__packed__))SCH_SUBHEADER_SHORT_NB_IoT;
typedef struct { typedef struct {
uint8_t LCID:5; // octet 1 LSB uint8_t LCID:5; // octet 1 LSB
uint8_t E:1; uint8_t E:1;
...@@ -390,6 +361,7 @@ typedef struct { ...@@ -390,6 +361,7 @@ typedef struct {
uint8_t F:1; // octet 2 MSB uint8_t F:1; // octet 2 MSB
uint8_t L_LSB:8; uint8_t L_LSB:8;
} __attribute__((__packed__))SCH_SUBHEADER_LONG_NB_IoT; } __attribute__((__packed__))SCH_SUBHEADER_LONG_NB_IoT;
typedef struct { typedef struct {
uint8_t LCID:5; // octet 1 LSB uint8_t LCID:5; // octet 1 LSB
uint8_t E:1; uint8_t E:1;
...@@ -398,12 +370,12 @@ typedef struct { ...@@ -398,12 +370,12 @@ typedef struct {
uint8_t L_MSB:8; // octet 2 MSB uint8_t L_MSB:8; // octet 2 MSB
uint8_t L_LSB:8; uint8_t L_LSB:8;
} __attribute__((__packed__))SCH_SUBHEADER_LONG_EXTEND_NB_IoT; } __attribute__((__packed__))SCH_SUBHEADER_LONG_EXTEND_NB_IoT;
/*!\brief MAC subheader short without length field */ /*!\brief MAC subheader short without length field */
typedef struct { typedef struct {
uint8_t LCID:5; uint8_t LCID:5;
uint8_t F2:1;
uint8_t E:1; uint8_t E:1;
uint8_t R:1; uint8_t R:2;
} __attribute__((__packed__))SCH_SUBHEADER_FIXED_NB_IoT; } __attribute__((__packed__))SCH_SUBHEADER_FIXED_NB_IoT;
...@@ -425,22 +397,22 @@ typedef struct { ...@@ -425,22 +397,22 @@ typedef struct {
} __attribute__((__packed__))RA_HEADER_RAPID_NB_IoT; } __attribute__((__packed__))RA_HEADER_RAPID_NB_IoT;
typedef struct Available_available_resource_DL{ typedef struct Available_resource_tones_UL_s{
///Available Resoruce for sixtone ///Available Resoruce for sixtone
available_resource_UL_t *sixtone_Head;//, *sixtone_npusch_frame; available_resource_UL_t *sixtone_Head;//, *sixtone_npusch_frame;
uint32_t sixtone_end_subframe; uint32_t sixtone_end_subframe;
///Available Resoruce for threetone ///Available Resoruce for threetone
available_resource_UL_t *threetone_Head;//, *threetone_npusch_frame; available_resource_UL_t *threetone_Head;//, *threetone_npusch_frame;
uint32_t threetone_end_subframe; uint32_t threetone_end_subframe;
///Available Resoruce for singletone1 ///Available Resoruce for singletone1
available_resource_UL_t *singletone1_Head;//, *singletone1_npusch_frame; available_resource_UL_t *singletone1_Head;//, *singletone1_npusch_frame;
uint32_t singletone1_end_subframe; uint32_t singletone1_end_subframe;
///Available Resoruce for singletone2 ///Available Resoruce for singletone2
available_resource_UL_t *singletone2_Head;//, *singletone2_npusch_frame; available_resource_UL_t *singletone2_Head;//, *singletone2_npusch_frame;
uint32_t singletone2_end_subframe; uint32_t singletone2_end_subframe;
///Available Resoruce for singletone3 ///Available Resoruce for singletone3
available_resource_UL_t *singletone3_Head;//, *singletone3_npusch_frame; available_resource_UL_t *singletone3_Head;//, *singletone3_npusch_frame;
uint32_t singletone3_end_subframe; uint32_t singletone3_end_subframe;
}available_resource_tones_UL_t; }available_resource_tones_UL_t;
...@@ -475,6 +447,14 @@ typedef struct schedule_result{ ...@@ -475,6 +447,14 @@ typedef struct schedule_result{
uint8_t *rar_buffer; uint8_t *rar_buffer;
int16_t dl_sdly;
int16_t ul_sdly;
int16_t num_sf;
int16_t harq_round;
// determine this uplink data is msg3 or not (different TBS table here)
uint8_t msg3_flag;
}schedule_result_t; }schedule_result_t;
/*Flag structure used for trigger each scheduler*/ /*Flag structure used for trigger each scheduler*/
...@@ -518,7 +498,9 @@ typedef struct RA_TEMPLATE_NB_IoT_s{ ...@@ -518,7 +498,9 @@ typedef struct RA_TEMPLATE_NB_IoT_s{
boolean_t wait_msg4_ack; boolean_t wait_msg4_ack;
boolean_t wait_msg3_ack; boolean_t wait_msg3_ack;
uint8_t rar_buffer[7]; uint8_t rar_buffer[7];
uint8_t *ccch_buffer;
uint8_t msg4_buffer[16];
uint8_t *msg4_rrc_buffer;
} RA_TEMPLATE_NB_IoT; } RA_TEMPLATE_NB_IoT;
typedef struct RA_template_list_s{ typedef struct RA_template_list_s{
...@@ -527,28 +509,39 @@ typedef struct RA_template_list_s{ ...@@ -527,28 +509,39 @@ typedef struct RA_template_list_s{
}RA_template_list_t; }RA_template_list_t;
/*36331 NPDCCH-ConfigDedicated-NB_IoT*/
typedef struct{
//npdcch-NumRepetitions-r13
uint32_t R_max;
//npdcch-StartSF-CSS-r13
double G;
//npdcch-Offset-USS-r13
double a_offset;
//NPDCCH period
uint32_t T;
//Starting subfrane of Search Space which is mod T
uint32_t ss_start_css;
}NPDCCH_config_common_NB_IoT_t;
/*! \brief top level eNB MAC structure */ /*! \brief top level eNB MAC structure */
typedef struct eNB_MAC_INST_NB_IoT_s { typedef struct mac_NB_IoT_s{
/// Ethernet parameters for northbound midhaul interface
eth_params_t eth_params_n; uint8_t Mod_id;
/// Ethernet parameters for fronthaul interface
eth_params_t eth_params_s;
uint8_t Mod_id;
// System // System
uint32_t hyper_system_frame; uint32_t hyper_system_frame;
uint32_t system_frame; uint32_t system_frame;
uint32_t sub_frame; uint32_t sub_frame;
uint32_t current_subframe; uint32_t current_subframe;
/// Pointer to IF module instance for PHY
IF_Module_t *if_inst;
// RA // RA
RA_template_list_t RA_msg2_list; RA_template_list_t RA_msg2_list;
RA_template_list_t RA_msg3_list; RA_template_list_t RA_msg3_list;
RA_template_list_t RA_msg4_list; RA_template_list_t RA_msg4_list;
RA_TEMPLATE_NB_IoT RA_template[MAX_MAX_MOBILES_PER_ENB_NB_IoT]; RA_TEMPLATE_NB_IoT RA_template[MAX_NUMBER_OF_UE_MAX_NB_IoT];
//int32_t last_tx_subframe; //int32_t last_tx_subframe;
...@@ -569,15 +562,18 @@ typedef struct eNB_MAC_INST_NB_IoT_s { ...@@ -569,15 +562,18 @@ typedef struct eNB_MAC_INST_NB_IoT_s {
scheduling_flag_t scheduling_flag; scheduling_flag_t scheduling_flag;
uint32_t schedule_subframe_DL; uint32_t schedule_subframe_DL;
uint32_t schedule_subframe_UL; //uint32_t schedule_subframe_UL;
NPDCCH_config_common_NB_IoT_t npdcch_config_common[3];
rrc_config_NB_IoT_t rrc_config; rrc_config_NB_IoT_t rrc_config;
nfapi_config_request_t config; nfapi_config_request_t config;
IF_Module_NB_IoT_t *if_inst_NB_IoT;
IF_Module_NB_IoT_t *if_inst_NB_IoT;
Sched_Rsp_NB_IoT_t Sched_INFO; Sched_Rsp_NB_IoT_t Sched_INFO;
} eNB_MAC_INST_NB_IoT; } eNB_MAC_INST_NB_IoT;
// actually not here, but for now put it here // actually not here, but for now put it here
...@@ -593,8 +589,6 @@ typedef struct { ...@@ -593,8 +589,6 @@ typedef struct {
nprach_parameters_NB_IoT_t nprach_list[3]; nprach_parameters_NB_IoT_t nprach_list[3];
//DLSF Table //DLSF Table
DLSF_INFO_t DLSF_information; DLSF_INFO_t DLSF_information;
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "defs_NB_IoT.h" #include "defs_NB_IoT.h"
#include "proto_NB_IoT.h" #include "proto_NB_IoT.h"
#include "extern_NB_IoT.h" #include "extern_NB_IoT.h"
#include "RRC/NBIOT/proto.h" #include "RRC/NBIOT/proto_NB_IoT.h"
#include "RRC/NBIOT/extern.h" #include "RRC/NBIOT/extern_NB_IoT.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
unsigned char str20[] = "DCI_uss"; unsigned char str20[] = "DCI_uss";
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <sysexits.h> /* for EX_* exit codes */ #include <sysexits.h> /* for EX_* exit codes */
#include <errno.h> /* for errno */ #include <errno.h> /* for errno */
#else #else
#include <linux/module.h> /* Needed by all modules */ //#include <linux/module.h> /* Needed by all modules */
#endif #endif
#include <asn_application.h> #include <asn_application.h>
...@@ -163,8 +163,8 @@ uint8_t do_RRCConnectionSetup_NB_IoT( ...@@ -163,8 +163,8 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
int CC_id, int CC_id,
uint8_t* const buffer, //carrier[CC_id].Srb0.Tx_buffer.Payload uint8_t* const buffer, //carrier[CC_id].Srb0.Tx_buffer.Payload
const uint8_t Transaction_id, const uint8_t Transaction_id,
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT, //in order to be configured--> stanno puntando alla SRB_configlist dell ue_context LTE_SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT, //in order to be configured--> stanno puntando alla SRB_configlist dell ue_context
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT //in order to be configured--> stanno puntando alla physicalConfigDedicated dell ue_context struct LTE_PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT //in order to be configured--> stanno puntando alla physicalConfigDedicated dell ue_context
); );
...@@ -190,12 +190,12 @@ do_RRCConnectionReconfiguration_NB_IoT( ...@@ -190,12 +190,12 @@ do_RRCConnectionReconfiguration_NB_IoT(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
uint8_t *buffer, uint8_t *buffer,
uint8_t Transaction_id, uint8_t Transaction_id,
SRB_ToAddModList_NB_r13_t *SRB_list_NB_IoT, LTE_SRB_ToAddModList_NB_r13_t *SRB_list_NB_IoT,
DRB_ToAddModList_NB_r13_t *DRB_list_NB_IoT, LTE_DRB_ToAddModList_NB_r13_t *DRB_list_NB_IoT,
DRB_ToReleaseList_NB_r13_t *DRB_list2_NB_IoT, LTE_DRB_ToReleaseList_NB_r13_t *DRB_list2_NB_IoT,
struct PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated, struct LTE_PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated,
MAC_MainConfig_t *mac_MainConfig, LTE_MAC_MainConfig_t *mac_MainConfig,
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13* dedicatedInfoNASList_NB_IoT); struct LTE_RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13* dedicatedInfoNASList_NB_IoT);
/** /**
* E-UTRAN applies the procedure as follows: when only for NB-IoT SRB1 and SRB1bis is established * E-UTRAN applies the procedure as follows: when only for NB-IoT SRB1 and SRB1bis is established
...@@ -287,7 +287,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT( ...@@ -287,7 +287,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT(
uint8_t* const buffer, uint8_t* const buffer,
const uint8_t Transaction_id, const uint8_t Transaction_id,
const NB_IoT_DL_FRAME_PARMS* const frame_parms, //to be changed const NB_IoT_DL_FRAME_PARMS* const frame_parms, //to be changed
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT LTE_SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT
); );
/** /**
......
...@@ -267,7 +267,7 @@ typedef struct eNB_RRC_UE_NB_IoT_s { ...@@ -267,7 +267,7 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
LTE_DRB_ToAddModList_NB_r13_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid LTE_DRB_ToAddModList_NB_r13_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
struct PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB_IoT; struct LTE_PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB_IoT;
LTE_MAC_MainConfig_NB_r13_t* mac_MainConfig_NB_IoT; LTE_MAC_MainConfig_NB_r13_t* mac_MainConfig_NB_IoT;
//No SPS(semi-persistent scheduling) in NB-IoT //No SPS(semi-persistent scheduling) in NB-IoT
......
...@@ -42,22 +42,20 @@ ...@@ -42,22 +42,20 @@
/**************/ /**************/
#include "openair1/SCHED_NBIOT/defs_NB_IoT.h" #include "openair1/SCHED_NBIOT/defs_NB_IoT.h"
#include "RRC/NBIOT/MESSAGES/asn1_msg_NB_IoT.h" #include "RRC/NBIOT/MESSAGES/asn1_msg_NB_IoT.h"
#include "RRCConnectionRequest-NB.h" #include "LTE_RRCConnectionRequest-NB.h"
#include "RRCConnectionReestablishmentRequest-NB.h" #include "LTE_RRCConnectionReestablishmentRequest-NB.h"
#include "ReestablishmentCause-NB-r13.h" #include "LTE_ReestablishmentCause-NB-r13.h"
#include "UL-CCCH-Message-NB.h" #include "LTE_UL-CCCH-Message-NB.h"
#include "DL-CCCH-Message-NB.h" #include "LTE_DL-CCCH-Message-NB.h"
#include "UL-DCCH-Message-NB.h" #include "LTE_UL-DCCH-Message-NB.h"
#include "DL-DCCH-Message-NB.h" #include "LTE_DL-DCCH-Message-NB.h"
#include "SRB-ToAddMod-NB-r13.h" #include "LTE_SRB-ToAddMod-NB-r13.h"
#include "common/utils/collection/tree.h" #include "common/utils/collection/tree.h"
#include "assertions.h" #include "assertions.h"
#include "asn1_conversions.h" #include "asn1_conversions.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "LAYER2/RLC/rlc.h" #include "LAYER2/RLC/rlc.h"
#include "LAYER2/MAC/proto.h" // For NB-IoT branch
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "COMMON/mac_rrc_primitives.h" #include "COMMON/mac_rrc_primitives.h"
#include "rlc.h" #include "rlc.h"
......
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