Commit 23c08a47 authored by Matthieu Kanj's avatar Matthieu Kanj

SIB23

parent 2512f82d
...@@ -144,25 +144,9 @@ typedef enum { ...@@ -144,25 +144,9 @@ typedef enum {
} SCH_status_NB_IoT_t; } SCH_status_NB_IoT_t;
/*
typedef struct {
/// NB-IoT
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t si_rnti; ///(=0xfff4)
SCH_status_NB_IoT_t status; typedef struct {
/// The scheduling the NPDCCH and the NPDSCH transmission TS 36.213 Table 16.4.1-1 uint16_t si_rnti;
uint8_t scheduling_delay;
/// The number of the subframe to transmit the NPDSCH Table TS 36.213 Table 16.4.1.3-1 (Nsf) (NB. in this case is not the index Isf)
uint8_t resource_assignment;
/// is the index that determined the repeat number of NPDSCH through table TS 36.213 Table 16.4.1.3-2 / for SIB1-NB Table 16.4.1.3-3
uint8_t repetition_number;
/// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2
uint8_t HARQ_ACK_resource;
/// Determined the repetition number value 0-3 (2 biut carried by the FAPI NPDCCH)
uint8_t dci_subframe_repetitions;
/// modulation always QPSK Qm = 2
uint8_t modulation;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[1888]; uint8_t e[1888];
/// data after scrambling /// data after scrambling
...@@ -170,9 +154,9 @@ typedef struct { ...@@ -170,9 +154,9 @@ typedef struct {
//length of the table e //length of the table e
uint16_t length_e; // new parameter uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs /// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+152))]; // new parameter uint8_t d[96+(3*(24+680))]; // new parameter
/// Sub-block interleaver outputs /// Sub-block interleaver outputs
uint8_t w[3*3*(152+24)]; // new parameter uint8_t w[3*3*(680+24)]; // new parameter
/// Status Flag indicating for this DLSCH (idle,active,disabled) /// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status; //SCH_status_t status;
...@@ -188,17 +172,9 @@ typedef struct { ...@@ -188,17 +172,9 @@ typedef struct {
uint32_t frame; uint32_t frame;
/// Subframe where current HARQ round was sent /// Subframe where current HARQ round was sent
uint32_t subframe; uint32_t subframe;
/// Index of current HARQ round for this DLSCH
uint8_t round;
/// MCS format for this NDLSCH , TS 36.213 Table 16.4.1.5
uint8_t mcs;
// we don't have code block segmentation / crc attachment / concatenation in NB-IoT R13 36.212 6.4.2
// we don't have beamforming in NB-IoT
//this index will be used mainly for SI message buffer
uint8_t pdu_buffer_index; uint8_t pdu_buffer_index;
} NB_IoT_DL_eNB_SIB1_t; } NB_IoT_DL_eNB_SIB_t;
*/
typedef struct { typedef struct {
/// NB-IoT /// NB-IoT
...@@ -590,8 +566,6 @@ typedef struct { ...@@ -590,8 +566,6 @@ typedef struct {
} DCI_PDU_NB_IoT; } DCI_PDU_NB_IoT;
typedef struct { typedef struct {
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding) /// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
int32_t *txdataF[8]; int32_t *txdataF[8];
...@@ -611,33 +585,12 @@ typedef struct { ...@@ -611,33 +585,12 @@ typedef struct {
// NB_IoT_DL_eNB_SIB1_t harq_process_sib1; // NB_IoT_DL_eNB_SIB1_t harq_process_sib1;
//////////////////////////////////////////////////////////////////////
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t si_rnti; ///(=0xfff4)
SCH_status_NB_IoT_t status; SCH_status_NB_IoT_t status;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[1888]; //////////////////////////////////////////////////////////////////////
/// data after scrambling NB_IoT_DL_eNB_SIB_t content_sib1;
uint8_t s_e[1888]; NB_IoT_DL_eNB_SIB_t content_sib23;
//length of the table e
uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+680))]; // new parameter
/// Sub-block interleaver outputs
uint8_t w[3*3*(680+24)]; // new parameter
/// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status;
/// Transport block size
uint32_t TBS;
/// The payload + CRC size in bits, "B" from 36-212
uint32_t B;
/// Pointer to the payload
uint8_t *b;
///pdu of the ndlsch message
uint8_t *pdu;
//this index will be used mainly for SI message buffer
uint8_t pdu_buffer_index;
////////////////////////////////////////////////////////////////////////////
/// Number of soft channel bits /// Number of soft channel bits
uint32_t G; uint32_t G;
......
...@@ -84,13 +84,13 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits, ...@@ -84,13 +84,13 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits,
} }
int dlsch_encoding_NB_IoT(unsigned char *a, int dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_NDLSCH_t *dlsch, NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table) uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G) // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation) unsigned int G) // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
{ {
uint32_t crc = 1; uint32_t crc = 1;
//unsigned char harq_pid = dlsch->current_harq_pid; // to check during implementation if harq_pid is required in the NB_IoT_eNB_DLSCH_t structure in defs_NB_IoT.h //unsigned char harq_pid = dlsch->current_harq_pid; // to check during implementation if harq_pid is required in the NB_IoT_eNB_DLSCH_t structure in defs_NB_IoT.h
uint8_t option1,option2,option3,option4; //uint8_t option1,option2,option3,option4;
unsigned int A; unsigned int A;
uint8_t RCC; uint8_t RCC;
......
...@@ -119,9 +119,10 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF, ...@@ -119,9 +119,10 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band) uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
NB_IoT_eNB_NDLSCH_t *dlsch0, NB_IoT_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe int G, // number of bits per subframe
unsigned npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf unsigned npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned subframe,
unsigned short NB_IoT_RB_ID) unsigned short NB_IoT_RB_ID)
{ {
//uint8_t harq_pid = dlsch0->current_harq_pid; //uint8_t harq_pid = dlsch0->current_harq_pid;
...@@ -158,14 +159,14 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF, ...@@ -158,14 +159,14 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
} else { } else {
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2))); NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
} }
symbol_offset = (14*4*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start symbol_offset = (14*subframe*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
allocate_REs_in_RB_NB_IoT(frame_parms, allocate_REs_in_RB_NB_IoT(frame_parms,
txdataF, txdataF,
&jj, &jj,
symbol_offset, symbol_offset,
&dlsch0->e[G*npdsch_data_subframe], &dlsch0->s_e[G*npdsch_data_subframe],
pilots, pilots,
amp, amp,
id_offset, id_offset,
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "PHY/impl_defs_lte.h" #include "PHY/impl_defs_lte.h"
#include "PHY/LTE_REFSIG/defs_NB_IoT.h" #include "PHY/LTE_REFSIG/defs_NB_IoT.h"
void dlsch_sib1_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch, NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
int tot_bits, // total number of bits to transmit int tot_bits, // total number of bits to transmit
uint8_t Nf, // Nf is the frame number (0..9) uint8_t Nf, // Nf is the frame number (0..9)
uint8_t Ns) // slot number (0..19) uint8_t Ns) // slot number (0..19)
......
...@@ -112,11 +112,12 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -112,11 +112,12 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *npbch_e, uint8_t *npbch_e,
uint32_t length); uint32_t length);
void dlsch_sib1_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch, NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
int tot_bits, int tot_bits,
uint8_t Nf, uint8_t Nf,
uint8_t Ns); uint8_t Ns);
/* /*
int scrambling_npbch_REs_rel_14(LTE_DL_FRAME_PARMS *frame_parms, int scrambling_npbch_REs_rel_14(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **txdataF, int32_t **txdataF,
...@@ -247,13 +248,14 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF, ...@@ -247,13 +248,14 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band) uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
NB_IoT_eNB_NDLSCH_t *dlsch0, NB_IoT_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe int G, // number of bits per subframe
unsigned npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf unsigned npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned subframe,
unsigned short NB_IoT_RB_ID); unsigned short NB_IoT_RB_ID);
int32_t dlsch_encoding_NB_IoT(unsigned char *a, int32_t dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_NDLSCH_t *dlsch, NB_IoT_DL_eNB_SIB_t *dlsch, // NB_IoT_eNB_NDLSCH_t
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table) uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
unsigned int G); // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation) unsigned int G); // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
......
...@@ -511,7 +511,7 @@ typedef struct PHY_VARS_eNB_s { ...@@ -511,7 +511,7 @@ typedef struct PHY_VARS_eNB_s {
NB_IoT_eNB_NPBCH_t npbch; NB_IoT_eNB_NPBCH_t npbch;
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX]; NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX];
NB_IoT_eNB_NDLSCH_t ndlsch_SIB1; NB_IoT_eNB_NDLSCH_t ndlsch_SIB;
//////////////////// END ///////////////////////////////// //////////////////// END /////////////////////////////////
......
...@@ -222,7 +222,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -222,7 +222,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
//LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms_NB_IoT; //LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms_NB_IoT;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch; NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch;
NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB1; //NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB;
NB_IoT_DL_eNB_SIB_t *sib1 = &eNB->ndlsch_SIB.content_sib1;
NB_IoT_DL_eNB_SIB_t *sib23 = &eNB->ndlsch_SIB.content_sib23;
int **txdataF = eNB->common_vars.txdataF[0]; int **txdataF = eNB->common_vars.txdataF[0];
int subframe = proc->subframe_tx; int subframe = proc->subframe_tx;
uint32_t frame = proc->frame_tx; uint32_t frame = proc->frame_tx;
...@@ -243,9 +245,20 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -243,9 +245,20 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
printf("%02X ",eNB_rrc_inst_NB_IoT->carrier[0].MIB_NB_IoT[i]); printf("%02X ",eNB_rrc_inst_NB_IoT->carrier[0].MIB_NB_IoT[i]);
printf("\n");*/ printf("\n");*/
} }
if(frame%64==1 && subframe ==0)
{//printf("dooooo MIB");
do_SIB1_NB_IoT_x(0,0,carrier,208,92,1,3584,7,2,hyper_frame);
/* for(int i = 0; i<5;i++)
printf("%02X ",eNB_rrc_inst_NB_IoT->carrier[0].MIB_NB_IoT[i]);
printf("\n");*/
}
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
//uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize(); //uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize();
int G=0; //int G=0;
//NSSS only happened in the even frame //NSSS only happened in the even frame
...@@ -283,7 +296,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -283,7 +296,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
uint8_t *npbch_pdu = get_NB_IoT_MIB(); uint8_t *npbch_pdu = get_NB_IoT_MIB();
uint8_t *sib1_pdu = get_NB_IoT_SIB1(); uint8_t *sib1_pdu = get_NB_IoT_SIB1();
uint8_t *sib23_pdu = get_NB_IoT_SIB23();
if(subframe == 0) if(subframe == 0)
...@@ -299,7 +312,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -299,7 +312,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} }
///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////////////////////////
if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) ) if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{ {
if( frame%32 == 0 ) if( frame%32 == 0 )
...@@ -310,11 +323,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -310,11 +323,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
236); //////////// G*2 236); //////////// G*2
/* dlsch_sib1_scrambling_NB_IoT(fp, // is called only in subframe 4 dlsch_sib_scrambling_NB_IoT(fp, // is called only in subframe 4
sib1, sib1,
1888, ////// total_bits 1888, ////// total_bits
frame, frame,
subframe*2);*/ subframe*2);
} }
dlsch_modulation_NB_IoT(txdataF, dlsch_modulation_NB_IoT(txdataF,
...@@ -324,9 +337,58 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -324,9 +337,58 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
sib1, sib1,
236, // number of bits per subframe 236, // number of bits per subframe
((frame%32)/2),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf ((frame%32)/2),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
4,
RB_IoT_ID);
}
///////////////////////////////////////////////////////// END ////////////////////////////////////////////////////////
//////////////////////////////////////////////////// SIB23 ////////////////////////////////////////////////////////////////////////
if( (subframe >0) && (subframe <5) && (subframe >5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
if( subframe == 1 )
{
dlsch_encoding_NB_IoT(sib23_pdu,
sib23,
8, ///// number_of_subframes_required
236); //////////// G*2
dlsch_sib_scrambling_NB_IoT(fp, // is called only in subframe 4
sib23,
1888, ////// total_bits
frame,
subframe*2);
}
if( subframe < 5 )
{
dlsch_modulation_NB_IoT(txdataF,
AMP,
fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
sib23,
236, // number of bits per subframe
(subframe-1),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
subframe,
RB_IoT_ID); RB_IoT_ID);
} else {
dlsch_modulation_NB_IoT(txdataF,
AMP,
fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
sib1,
236, // number of bits per subframe
(subframe-2),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
subframe,
RB_IoT_ID);
}
} }
//////////////////////////////////////////////////// END ////////////////////////////////////////////////////////////////////////
generate_pilots_NB_IoT(eNB, generate_pilots_NB_IoT(eNB,
txdataF, txdataF,
......
...@@ -139,7 +139,7 @@ uint8_t do_MIB_NB_IoT( ...@@ -139,7 +139,7 @@ uint8_t do_MIB_NB_IoT(
//decide how to set it //decide how to set it
mib_NB_IoT->message.schedulingInfoSIB1_r13 =10; //see TS 36.213-->tables 16.4.1.3-3 ecc... // to make 8 repetitions mib_NB_IoT->message.schedulingInfoSIB1_r13 =10; //see TS 36.213-->tables 16.4.1.3-3 ecc... // to make 8 repetitions
mib_NB_IoT->message.systemInfoValueTag_r13= 0; mib_NB_IoT->message.systemInfoValueTag_r13= frame%16;
mib_NB_IoT->message.ab_Enabled_r13 = 0; mib_NB_IoT->message.ab_Enabled_r13 = 0;
//to be decided //to be decided
...@@ -332,8 +332,8 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, ...@@ -332,8 +332,8 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
// Now, follow the scheduler SIB configuration // Now, follow the scheduler SIB configuration
// There is only one sib2+sib3 common setting // There is only one sib2+sib3 common setting
schedulingInfo_NB_IoT.si_Periodicity_r13=SchedulingInfo_NB_r13__si_Periodicity_r13_rf4096; // (to be set to 64) schedulingInfo_NB_IoT.si_Periodicity_r13= SchedulingInfo_NB_r13__si_Periodicity_r13_rf64; //SchedulingInfo_NB_r13__si_Periodicity_r13_rf4096; // (to be set to 64)
schedulingInfo_NB_IoT.si_RepetitionPattern_r13=SchedulingInfo_NB_r13__si_RepetitionPattern_r13_every2ndRF; //This Indicates the starting radio frames within the SI window used for SI message transmission. schedulingInfo_NB_IoT.si_RepetitionPattern_r13= SchedulingInfo_NB_r13__si_RepetitionPattern_r13_every2ndRF; //This Indicates the starting radio frames within the SI window used for SI message transmission.
schedulingInfo_NB_IoT.si_TB_r13= SchedulingInfo_NB_r13__si_TB_r13_b680;//208 bits schedulingInfo_NB_IoT.si_TB_r13= SchedulingInfo_NB_r13__si_TB_r13_b680;//208 bits
...@@ -361,7 +361,7 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, ...@@ -361,7 +361,7 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
//FIXME which value chose for the following parameter //FIXME which value chose for the following parameter
(*sib1_NB_IoT)->si_WindowLength_r13=SystemInformationBlockType1_NB__si_WindowLength_r13_ms160; (*sib1_NB_IoT)->si_WindowLength_r13=SystemInformationBlockType1_NB__si_WindowLength_r13_ms160;
(*sib1_NB_IoT)->si_RadioFrameOffset_r13= 0; (*sib1_NB_IoT)->si_RadioFrameOffset_r13= 1;
/////optional parameters, decide to use at future /////optional parameters, decide to use at future
/* /*
...@@ -398,6 +398,245 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, ...@@ -398,6 +398,245 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
return((enc_rval.encoded+7)/8); return((enc_rval.encoded+7)/8);
} }
/*do_SIB1_NB*/
uint8_t do_SIB1_NB_IoT_x(uint8_t Mod_id, int CC_id,
rrc_eNB_carrier_data_NB_IoT_t *carrier,
uint16_t mcc, //208
uint16_t mnc, //92
uint16_t tac, //1
uint32_t cell_identity, //3584
uint16_t band, // 7
uint16_t mnc_digit_length, //2
uint32_t frame
)
{
BCCH_DL_SCH_Message_NB_t *bcch_message= &(carrier->siblock1_NB_IoT);
SystemInformationBlockType1_NB_t **sib1_NB_IoT= &(carrier->sib1_NB_IoT);
asn_enc_rval_t enc_rval;
PLMN_IdentityInfo_NB_r13_t PLMN_identity_info_NB_IoT;
MCC_MNC_Digit_t dummy_mcc[3],dummy_mnc[3];
SchedulingInfo_NB_r13_t schedulingInfo_NB_IoT;
SIB_Type_NB_r13_t sib_type_NB_IoT;
long* attachWithoutPDN_Connectivity = NULL;
attachWithoutPDN_Connectivity = CALLOC(1,sizeof(long));
long *nrs_CRS_PowerOffset=NULL;
nrs_CRS_PowerOffset = CALLOC(1, sizeof(long));
long *eutraControlRegionSize=NULL; //this parameter should be set only if we are considering in-band operating mode (samePCI or differentPCI)
eutraControlRegionSize = CALLOC(1,sizeof(long));
long systemInfoValueTagSI = 0;
memset(bcch_message,0,sizeof(BCCH_DL_SCH_Message_NB_t));
bcch_message->message.present = BCCH_DL_SCH_MessageType_NB_PR_c1;
bcch_message->message.choice.c1.present = BCCH_DL_SCH_MessageType_NB__c1_PR_systemInformationBlockType1_r13;
memset(&schedulingInfo_NB_IoT,0,sizeof(SchedulingInfo_NB_r13_t));
memset(&sib_type_NB_IoT,0,sizeof(SIB_Type_NB_r13_t));
//allocation
*sib1_NB_IoT = &bcch_message->message.choice.c1.choice.systemInformationBlockType1_r13;
/*TS 36.331 v14.2.0 pag 589
* hyperSFN-MSB
* Indicates the 8 most significant bits of the hyper-SFN. Together with the hyper-LSB in MIB-NB the complete HSFN is build up
*/
//FIXME see if correct
uint8_t hyperSFN_MSB = (uint8_t) ((frame>>2)& 0xff);
//XXX to be checked
(*sib1_NB_IoT)->hyperSFN_MSB_r13.buf = &hyperSFN_MSB;
(*sib1_NB_IoT)->hyperSFN_MSB_r13.size = 1;
(*sib1_NB_IoT)->hyperSFN_MSB_r13.bits_unused = 0;
memset(&PLMN_identity_info_NB_IoT,0,sizeof(PLMN_IdentityInfo_NB_r13_t));
PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc = CALLOC(1,sizeof(*PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc));
memset(PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc,0,sizeof(*PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc));
asn_set_empty(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list);//.size=0;
//left as it is???
#if defined(ENABLE_ITTI)
dummy_mcc[0] = (mcc / 100) % 10;
dummy_mcc[1] = (mcc / 10) % 10;
dummy_mcc[2] = (mcc / 1) % 10;
#else
dummy_mcc[0] = 0;
dummy_mcc[1] = 0;
dummy_mcc[2] = 1;
#endif
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[0]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[1]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[2]);
PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list.size=0;
PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list.count=0;
#if defined(ENABLE_ITTI)
if (mnc >= 100) {
dummy_mnc[0] = (mnc / 100) % 10;
dummy_mnc[1] = (mnc / 10) % 10;
dummy_mnc[2] = (mnc / 1) % 10;
} else {
if (mnc_digit_length == 2) {
dummy_mnc[0] = (mnc / 10) % 10;
dummy_mnc[1] = (mnc / 1) % 10;
dummy_mnc[2] = 0xf;
} else {
dummy_mnc[0] = (mnc / 100) % 100;
dummy_mnc[1] = (mnc / 10) % 10;
dummy_mnc[2] = (mnc / 1) % 10;
}
}
#else
dummy_mnc[0] = 0;
dummy_mnc[1] = 1;
dummy_mnc[2] = 0xf;
#endif
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[0]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[1]);
if (dummy_mnc[2] != 0xf) {
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[2]);
}
//still set to "notReserved" as in the previous case
PLMN_identity_info_NB_IoT.cellReservedForOperatorUse_r13=PLMN_IdentityInfo_NB_r13__cellReservedForOperatorUse_r13_notReserved;
*attachWithoutPDN_Connectivity = 0;
PLMN_identity_info_NB_IoT.attachWithoutPDN_Connectivity_r13 = attachWithoutPDN_Connectivity;
ASN_SEQUENCE_ADD(&(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.plmn_IdentityList_r13.list,&PLMN_identity_info_NB_IoT);
// 16 bits = 2 byte
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.buf = MALLOC(2); //MALLOC works in byte
//lefts as it is?
#if defined(ENABLE_ITTI)
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.buf[0] = (tac >> 8) & 0xff;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.buf[1] = (tac >> 0) & 0xff;
#else
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.buf[0] = 0x00;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.buf[1] = 0x01;
#endif
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.size=2;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.trackingAreaCode_r13.bits_unused=0;
// 28 bits --> i have to use 32 bits = 4 byte
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf = MALLOC(8); // why allocate 8 byte?
#if defined(ENABLE_ITTI)
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[0] = (cell_identity >> 20) & 0xff;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[1] = (cell_identity >> 12) & 0xff;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[2] = (cell_identity >> 4) & 0xff;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[3] = (cell_identity << 4) & 0xf0;
#else
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[0] = 0x00;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[1] = 0x00;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[2] = 0x00;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.buf[3] = 0x10;
#endif
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.size=4;
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellIdentity_r13.bits_unused=4;
//Still set to "notBarred" as in the previous case
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.cellBarred_r13=SystemInformationBlockType1_NB__cellAccessRelatedInfo_r13__cellBarred_r13_notBarred;
//Still Set to "notAllowed" like in the previous case
(*sib1_NB_IoT)->cellAccessRelatedInfo_r13.intraFreqReselection_r13=SystemInformationBlockType1_NB__cellAccessRelatedInfo_r13__intraFreqReselection_r13_notAllowed;
(*sib1_NB_IoT)->cellSelectionInfo_r13.q_RxLevMin_r13=-65; //which value?? TS 36.331 V14.2.1 pag. 589
(*sib1_NB_IoT)->cellSelectionInfo_r13.q_QualMin_r13 =-22; //FIXME new parameter for SIB1-NB, not present in SIB1 (for cell reselection but if not used the UE should apply the default value)
(*sib1_NB_IoT)->p_Max_r13 = CALLOC(1, sizeof(P_Max_t));
*((*sib1_NB_IoT)->p_Max_r13) = 23;
//FIXME
(*sib1_NB_IoT)->freqBandIndicator_r13 =
#if defined(ENABLE_ITTI)
band;
#else
5; //if not configured we use band 5 (UL: 824 MHz - 849MHz / DL: 869 MHz - 894 MHz FDD mode)
#endif
// Now, follow the scheduler SIB configuration
// There is only one sib2+sib3 common setting
schedulingInfo_NB_IoT.si_Periodicity_r13= SchedulingInfo_NB_r13__si_Periodicity_r13_rf64; //SchedulingInfo_NB_r13__si_Periodicity_r13_rf4096; // (to be set to 64)
schedulingInfo_NB_IoT.si_RepetitionPattern_r13= SchedulingInfo_NB_r13__si_RepetitionPattern_r13_every2ndRF; //This Indicates the starting radio frames within the SI window used for SI message transmission.
schedulingInfo_NB_IoT.si_TB_r13= SchedulingInfo_NB_r13__si_TB_r13_b680;//208 bits
// This is for SIB2/3
/*SIB3 --> There is no mapping information of SIB2 since it is always present
* in the first SystemInformation message
* listed in the schedulingInfoList list.
* */
sib_type_NB_IoT=SIB_Type_NB_r13_sibType3_NB_r13;
ASN_SEQUENCE_ADD(&schedulingInfo_NB_IoT.sib_MappingInfo_r13.list,&sib_type_NB_IoT);
ASN_SEQUENCE_ADD(&(*sib1_NB_IoT)->schedulingInfoList_r13.list,&schedulingInfo_NB_IoT);
//printf("[ASN Debug] SI P: %ld\n",(*sib1_NB_IoT)->schedulingInfoList_r13.list.array[0]->si_Periodicity_r13);
/*
#if defined(ENABLE_ITTI)
if (configuration->frame_type[CC_id] == TDD)
#endif
{
//FIXME in NB-IoT mandatory to be FDD --> so must give an error
LOG_E(RRC,"[NB-IoT %d] Frame Type is TDD --> not supported by NB-IoT, exiting\n", Mod_id); //correct?
exit(-1);
}
*/
//FIXME which value chose for the following parameter
(*sib1_NB_IoT)->si_WindowLength_r13=SystemInformationBlockType1_NB__si_WindowLength_r13_ms160;
(*sib1_NB_IoT)->si_RadioFrameOffset_r13= 1;
/////optional parameters, decide to use at future
/*
//system value tag
(*sib1_NB_IoT)->systemInfoValueTagList_r13 = CALLOC(1, sizeof(struct SystemInfoValueTagList_NB_r13));
asn_set_empty(&(*sib1_NB_IoT)->systemInfoValueTagList_r13->list);
ASN_SEQUENCE_ADD(&(*sib1_NB_IoT)->systemInfoValueTagList_r13->list,&systemInfoValueTagSI);
// downlink bitmap
(*sib1_NB_IoT)->downlinkBitmap_r13 = CALLOC(1, sizeof(struct DL_Bitmap_NB_r13));
((*sib1_NB_IoT)->downlinkBitmap_r13)->present= DL_Bitmap_NB_r13_PR_NOTHING;
// CRS power offset
*nrs_CRS_PowerOffset= 0;
(*sib1_NB_IoT)->nrs_CRS_PowerOffset_r13 = nrs_CRS_PowerOffset;
*/
*eutraControlRegionSize = 2;
(*sib1_NB_IoT)->eutraControlRegionSize_r13 = eutraControlRegionSize;
#ifdef XER_PRINT //generate xml files
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message_NB, (void*)bcch_message);
#endif
//bcch_message->message.choice.c1.choice.systemInformationBlockType1_r13 = **sib1_NB_IoT;
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message_NB,
(void*)bcch_message,
carrier->SIB1_NB_IoT,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
if (enc_rval.encoded==-1) {
return(-1);
}
return((enc_rval.encoded+7)/8);
}
/*SIB23_NB_IoT*/ /*SIB23_NB_IoT*/
//to be clarified is it is possible to carry SIB2 and SIB3 in the same SI message for NB-IoT? //to be clarified is it is possible to carry SIB2 and SIB3 in the same SI message for NB-IoT?
uint8_t do_SIB23_NB_IoT(uint8_t Mod_id, uint8_t do_SIB23_NB_IoT(uint8_t Mod_id,
......
...@@ -84,6 +84,15 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, ...@@ -84,6 +84,15 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id,
uint32_t frame uint32_t frame
); );
uint8_t do_SIB1_NB_IoT_x(uint8_t Mod_id, int CC_id,
rrc_eNB_carrier_data_NB_IoT_t *carrier,
uint16_t mcc, //208
uint16_t mnc, //92
uint16_t tac, //1
uint32_t cell_identity, //3584
uint16_t band, // 7
uint16_t mnc_digit_length,
uint32_t frame);
/** /**
\brief Generate a default configuration for SIB2/SIB3-NB in one System Information PDU (eNB). \brief Generate a default configuration for SIB2/SIB3-NB in one System Information PDU (eNB).
@param Mod_id Index of eNB (used to derive some parameters) @param Mod_id Index of eNB (used to derive some parameters)
......
...@@ -37,9 +37,11 @@ ...@@ -37,9 +37,11 @@
#include "LAYER2/MAC/defs_NB_IoT.h" #include "LAYER2/MAC/defs_NB_IoT.h"
/*NOTE: no static function should be declared in this header file (e.g. init_SI_NB)*/ /*NOTE: no static function should be declared in this header file (e.g. init_SI_NB)*/
uint8_t *get_NB_IoT_MIB(void);
uint8_t *get_NB_IoT_SIB1(void); uint8_t *get_NB_IoT_SIB1(void);
uint8_t *get_NB_IoT_MIB(void); uint8_t *get_NB_IoT_SIB23(void);
long *get_NB_IoT_SIB1_eutracontrolregionsize(void); long *get_NB_IoT_SIB1_eutracontrolregionsize(void);
......
...@@ -130,6 +130,11 @@ uint8_t *get_NB_IoT_SIB1(void) ...@@ -130,6 +130,11 @@ uint8_t *get_NB_IoT_SIB1(void)
return eNB_rrc_inst_NB_IoT->carrier[0].SIB1_NB_IoT; return eNB_rrc_inst_NB_IoT->carrier[0].SIB1_NB_IoT;
} }
uint8_t *get_NB_IoT_SIB23(void)
{
return eNB_rrc_inst_NB_IoT->carrier[0].SIB23_NB_IoT;
}
long *get_NB_IoT_SIB1_eutracontrolregionsize(void) long *get_NB_IoT_SIB1_eutracontrolregionsize(void)
{ {
return eNB_rrc_inst_NB_IoT->carrier[0].sib1_NB_IoT->eutraControlRegionSize_r13; return eNB_rrc_inst_NB_IoT->carrier[0].sib1_NB_IoT->eutraControlRegionSize_r13;
......
...@@ -54,7 +54,8 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -54,7 +54,8 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
PHY_vars_eNB->frame_parms.Nid_cell = Nid_cell; ///////((Nid_cell/3)*3)+((eNB_id+Nid_cell)%3); PHY_vars_eNB->frame_parms.Nid_cell = Nid_cell; ///////((Nid_cell/3)*3)+((eNB_id+Nid_cell)%3);
PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6; PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6;
// for NB-IoT testing // for NB-IoT testing
PHY_vars_eNB->ndlsch_SIB1.si_rnti = 0xffff; PHY_vars_eNB->ndlsch_SIB.content_sib1.si_rnti = 0xffff;
PHY_vars_eNB->ndlsch_SIB.content_sib23.si_rnti = 0xffff;
//////////////////////////// ////////////////////////////
phy_init_lte_eNB(PHY_vars_eNB,0,abstraction_flag); phy_init_lte_eNB(PHY_vars_eNB,0,abstraction_flag);
......
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