Commit a6003505 authored by Matthieu Kanj's avatar Matthieu Kanj

bug fix for lte-softmodem and SIB1

parent 2d46e712
/***********************************************************************
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
**********************************************************************/
/*! \file PHY/LTE_TRANSPORT/dlsch_modulation_NB_IoT.c
* \brief Top-level routines for generating the NPDSCH physical channel for NB_IoT,
* \author M. KANJ
......@@ -121,8 +139,8 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
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_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe
unsigned short npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned short subframe,
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe,
unsigned short NB_IoT_RB_ID)
{
//uint8_t harq_pid = dlsch0->current_harq_pid;
......
/*******************************************************************************
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
*******************************************************************************/
/*! \file PHY/LTE_TRANSPORT/dlsch_scrambling_NB_IoT.c
* \brief Routines for the scrambling procedure of the NPDSCH physical channel for NB_IoT, TS 36-211, V13.4.0 2017-02
* \author M. KANJ
......@@ -29,17 +47,17 @@
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
NB_IoT_DL_eNB_SIB_t *dlsch,
int tot_bits, // total number of bits to transmit
uint8_t Nf, // Nf is the frame number (0..9)
uint8_t Ns) // slot number (0..19)
uint16_t Nf, // Nf is the frame number (0..9)
uint8_t Ns)
{
int i,j,k=0;
uint32_t x1,x2, s=0;
uint8_t *e = dlsch->e; //uint8_t *e=dlsch->harq_processes[dlsch->current_harq_pid]->e;
x2 = (dlsch->si_rnti<<15) + (frame_parms->Nid_cell + 1) * ( (Nf % 61) + 1 ) ;
//x2 = (dlsch->si_rnti<<15) + (frame_parms->Nid_cell + 1) * ( (Nf % 61) + 1 ) ;
x2 = (dlsch->si_rnti<<14) + ((Nf%2)<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell;
// for NPDSCH not carriying SIBs
//x2 = (dlsch->harq_process_sib1.rnti<<14) + ((Nf%2)<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 10.2.3.1
......
......@@ -115,7 +115,7 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
void dlsch_sib_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_DL_eNB_SIB_t *dlsch, //NB_IoT_eNB_NDLSCH_t
int tot_bits,
uint8_t Nf,
uint16_t Nf,
uint8_t Ns);
/*
......@@ -250,8 +250,8 @@ int dlsch_modulation_NB_IoT(int32_t **txdataF,
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_DL_eNB_SIB_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
int G, // number of bits per subframe
unsigned short npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned short subframe,
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
unsigned int subframe,
unsigned short NB_IoT_RB_ID);
int32_t dlsch_encoding_NB_IoT(unsigned char *a,
......
......@@ -246,10 +246,10 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
printf("\n");*/
}
/* if(frame%64==1 && subframe ==0)
if(frame%64==1 && subframe ==0)
{
do_SIB1_NB_IoT_x(0,0,carrier,208,92,1,3584,7,2,hyper_frame);
}*/
do_SIB1_NB_IoT_x(0,0,carrier,208,92,1,3584,8,2,hyper_frame);
}
/////////////////////////////////////////////////////////////////////////////////
//uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize();
......@@ -307,7 +307,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
}
///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////////////////////////
///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////
if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{
if( frame%32 == 0 )
......@@ -319,9 +319,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
1); //////////// G*2
dlsch_sib_scrambling_NB_IoT(fp, // is called only in subframe 4
dlsch_sib_scrambling_NB_IoT(fp,
sib1,
1888, ////// total_bits
1888,
frame,
subframe*2);
}
......@@ -332,7 +332,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
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
((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),
4,
RB_IoT_ID);
......@@ -376,7 +376,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
AMP,
fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
sib1,
sib23,
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,
......
......@@ -580,7 +580,7 @@ void rrc_mac_config_req_NB_IoT(
//return 0;
init_mac_NB_IoT(mac_inst);
//init_mac_NB_IoT(mac_inst);
LOG_I(MAC,"[NB-IoT] Init_MAC done\n");
......
......@@ -139,7 +139,7 @@ uint8_t do_MIB_NB_IoT(
//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.systemInfoValueTag_r13= frame%16;
mib_NB_IoT->message.systemInfoValueTag_r13= 0;
mib_NB_IoT->message.ab_Enabled_r13 = 0;
//to be decided
......@@ -192,6 +192,9 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
eutraControlRegionSize = CALLOC(1,sizeof(long));
long systemInfoValueTagSI = 0;
long *offset=NULL; //this parameter should be set only if we are considering in-band operating mode (samePCI or differentPCI)
offset = CALLOC(1,sizeof(long));
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;
......@@ -359,9 +362,11 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
exit(-1);
}
//FIXME which value chose for the following parameter
*offset =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= 0;
(*sib1_NB_IoT)->si_RadioFrameOffset_r13=offset;
/////optional parameters, decide to use at future
/*
......@@ -401,14 +406,13 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
/*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
)
uint16_t mcc,
uint16_t mnc,
uint16_t tac,
uint32_t cell_identity,
uint16_t band,
uint16_t mnc_digit_length,
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);
......@@ -430,6 +434,9 @@ uint8_t do_SIB1_NB_IoT_x(uint8_t Mod_id, int CC_id,
eutraControlRegionSize = CALLOC(1,sizeof(long));
long systemInfoValueTagSI = 0;
long *offset=NULL; //this parameter should be set only if we are considering in-band operating mode (samePCI or differentPCI)
offset = CALLOC(1,sizeof(long));
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;
......@@ -597,9 +604,11 @@ uint8_t do_SIB1_NB_IoT_x(uint8_t Mod_id, int CC_id,
exit(-1);
}
*/
//FIXME which value chose for the following parameter
*offset =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= 0;
(*sib1_NB_IoT)->si_RadioFrameOffset_r13=offset;
/////optional parameters, decide to use at future
/*
......
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