Commit e6c47f94 authored by Michele Paffetti's avatar Michele Paffetti

Setup of required variables for managing the SI messages transmission,...

Setup of required variables for managing the SI messages transmission, according to our Assumptions. Still to include the function for encoding, scrambling ecc.. of npdsch and npdcch for the DL path. Code compile. 141 Warnings
parent 2a68d847
......@@ -807,6 +807,16 @@ typedef struct {
// NB-IoT
//----------------------------------------------------------------------------------------------------
//enum for distinguish the different type of ndlsch (may in the future will be not needed)
typedef enum
{
SIB1,
SI_Message,
RAR,
UE_Data
}ndlsch_flag_t;
typedef struct {
......@@ -841,10 +851,9 @@ typedef struct {
/// NB-IoT
/// The scheduling the NPDCCH and the NPDSCH transmission TS 36.213 Table 16.4.1-1
uint8_t scheduling_delay;
/// The number of the subframe to transmit the NPDSCH TB TS 36.213 Table 16.4.1.3-1 (Nsf
/// FAPI spec P.181 for the NPDSCH containing BCCH value 1-8, while 36.331 P.190 value only 2 & 8
/// 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;
/// Determined the repeat number of NPDSCH TB TS 36.213 Table 16.4.1.3-2 (Nrep)
/// 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;
......@@ -891,8 +900,6 @@ typedef struct {
uint8_t nCCE[10];
/*in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required*/
/// The only HARQ process for the DLSCH
NB_IoT_DL_eNB_HARQ_t *harq_process;
/// Number of soft channel bits
......@@ -912,15 +919,22 @@ typedef struct {
/// number of cell specific TX antenna ports assumed by the UE
uint8_t nrs_antenna_ports;
/*
* This indicate the current subframe within the subframe interval between the NPDSCH transmission (Nsf*Nrep)
*/
//This indicate the current subframe within the subframe interval between the NPDSCH transmission (Nsf*Nrep)
uint16_t sf_index;
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDSCH transmission
/// see FAPI/NFAPI specs Table 4-47
uint8_t npdsch_start_symbol;
/*SIB1-NB related parameters*/
///flag for indicate if the current frame is the start of a new SIB1-NB repetition within the SIB1-NB period (0 = FALSE, 1 = TRUE)
uint8_t sib1_rep_start;
///the number of the frame within the 16 continuous frame in which sib1-NB is transmitted (1-8 = 1st, 2nd ecc..) (0 = not foresees a transmission)
uint8_t relative_sib1_frame;
//Flag used to discern among different NDLSCH structures (SIB1,SI,RA,UE-spec)
//(in this case is used because we may have that more that one calls of npdch_procedure is needed for transmitting a data (NB-IoT implement repetitions)
ndlsch_flag_t ndlsch_type;
} NB_IoT_eNB_NDLSCH_t;
......@@ -1036,6 +1050,9 @@ typedef struct {
#define NPBCH_A 34
typedef struct {
//the 2 LSB of the hsfn (the MSB are indicated by the SIB1-NB)
uint16_t h_sfn_lsb;
uint8_t npbch_d[96+(3*(16+NPBCH_A))];
uint8_t npbch_w[3*3*(16+NPBCH_A)];
uint8_t npbch_e[1600];
......
......@@ -68,7 +68,7 @@ void ccode_encode_npdsch_NB_IoT (int32_t numbits,
int dlsch_encoding_NB_IoT(unsigned char *a,
NB_IoT_eNB_DLSCH_t *dlsch,
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)
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *i_stats)
......
......@@ -22,38 +22,47 @@ void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
//Check for SI PDU since in NB-IoT there is no DCI for that
//SIB1 (type 0), other DLSCH data (type 1) (include the SI messages) based on our ASSUMPTIONs
//is SIB1-NB
if(rel13->rnti_type == 0 && rel13->rnti == 65535)
{
/*
* the configuration of the NDLSCH PDU for the SIB1-NB shoudl be the following:
* RNTI type = 0;
* RNTI = OxFFFF (65535)
* Repetition number = 0-15 and should be mapped to 4,8,16 as reported in Table 16.4.1.3-3 TS 36.213
* Number of subframe for resource assignment = may is not neded to know since the scheduling is fixed
* -RNTI type = 0; (BCCH)
* -RNTI = OxFFFF (65535)
* -Repetition number = 0-15 and should be mapped to 4,8,16 as reported in Table 16.4.1.3-3 TS 36.213 (is the schedulingInoSIB1 of the MIB)
* -Number of subframe for resource assignment = may is not neded to know since the scheduling is fixed
* (Spec TS 36.331 "SIB1-NB transmission occur in subframe #4 of every other frame in 16 continuous frame"
* meaning that from the starting point we should transmit the SIB1-NB in 8 subframes among the 16 available (every other))
*
* From spec. TS 36.321 v14.2.o pag 31 --> there is an HARQ process for all the broadcast
* From spec. TS 36.321 v14.2.o pag 31 --> there is an HARQ process for all the broadcast (so we consider it also for SIB1-NB)
*
*/
ndlsch= eNB->ndlsch_SIB1;
ndlsch->ndlsch_type = SIB1;
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start symbol for the ndlsch transmission
ndlsch_harq = ndlsch->harq_process;
ndlsch_harq->pdu = sdu;
//should be from 1 to 8
ndlsch_harq->resource_assignment = rel13->number_of_subframes_for_resource_assignment;
ndlsch_harq->repetition_number = rel13->repetition_number; //is the schedulingInfoSIB1 of MMIB that is mapped into value 4-8-16 (see NDLSCH fapi specs Table 4-47)
ndlsch_harq->resource_assignment = rel13->number_of_subframes_for_resource_assignment;//maybe we don't care about it since a fixed schedule
ndlsch_harq->repetition_number = rel13->repetition_number; //is the schedulingInfoSIB1 (value 1-15) of MIB that is mapped into value 4-8-16 (see NDLSCH fapi specs Table 4-47)
ndlsch_harq->modulation = rel13->modulation;
ndlsch_harq->status = ACTIVE;
//SI information in reality have no feedback (so there is no retransmission from the HARQ view point since no sck and nack)
//SI information in reality have no feedback (so there is no retransmission from the HARQ view point since no ack and nack)
// ndlsch_harq->frame = frame;
// ndlsch_harq->subframe = subframe;
ndlsch->nrs_antenna_ports = rel13->nrs_antenna_ports_assumed_by_the_ue;
ndlsch->scrambling_sequence_intialization = rel13->scrambling_sequence_initialization_cinit;
}
//This are System Information (SI message)
//is SI message (this is an NDLSCH that will be transmitted very frequently)
else if(rel13->rnti_type == 1 && rel13->rnti == 65535)
{
/*
......@@ -62,38 +71,45 @@ void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
* RNTI type = 1;
* RNTI = OxFFFF (65535)
* Repetition number = 0 and should be mapped to 1 through Table 16.4.1.3-2 TS 36.213
* Number of subframe for resource assignment = will be evaluated by the MAC based on the value of the "si-TB" field inside the SIB1-NB
* Number of subframe for resource assignment = will be evaluated by the MAC based on the value of the "si-TB" field inside the SIB1-NB (value 2 or 8)
*
* From spec. TS 36.321 v14.2.o pag 31 --> there is an HARQ process for all the broadcast
*
*
*/
ndlsch= eNB->ndlsch_SI;
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start symbol for the ndlsch transmission
ndlsch->ndlsch_type = SI_Message;
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission
ndlsch_harq = ndlsch->harq_process;
if(sdu != NULL) //new SI starting transmission
ndlsch_harq->pdu = sdu;
else //this indicate me to continue the transmission of the previous one
//new SI starting transmission
if(sdu != NULL)
{
//the major fact is that i should be aware when the SI should be transmitted since the PHY layer have no logic for this
ndlsch_harq->pdu = sdu;
ndlsch_harq->resource_assignment = rel13->number_of_subframes_for_resource_assignment;//value 2 or 8
ndlsch_harq->repetition_number = rel13->repetition_number;//should be always fix to 0 to be mapped in 1
ndlsch_harq->modulation = rel13->modulation;
ndlsch_harq->status = ACTIVE;
//SI information in reality have no feedback (so there is no retransmission from the HARQ view point since no sck and nack)
// ndlsch_harq->frame = frame;
// ndlsch_harq->subframe = subframe;
ndlsch->nrs_antenna_ports = rel13->nrs_antenna_ports_assumed_by_the_ue;
ndlsch->scrambling_sequence_intialization = rel13->scrambling_sequence_initialization_cinit;
}
//continue the remaining transmission of the previous SI at PHY if any (otherwise nothing)
else
{
ndlsch_harq->pdu = NULL;
//there is no need of repeating the configuration on the ndlsch
//should be from 1 to 8
ndlsch_harq->resource_assignment = rel13->number_of_subframes_for_resource_assignment;
ndlsch_harq->repetition_number = rel13->repetition_number;
ndlsch_harq->modulation = rel13->modulation;
ndlsch_harq->status = ACTIVE;
//SI information in reality have no feedback (so there is no retransmission from the HARQ view point since no sck and nack)
// ndlsch_harq->frame = frame;
// ndlsch_harq->subframe = subframe;
ndlsch->nrs_antenna_ports = rel13->nrs_antenna_ports_assumed_by_the_ue;
ndlsch->scrambling_sequence_intialization = rel13->scrambling_sequence_initialization_cinit;
}
}
//ue specific data or RAR
//ue specific data or RAR (we already have received the DCI for this)
else if(rel13->rnti != 65535 && rel13->rnti_type == 1)
{
......@@ -203,14 +219,18 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
// for the moment we don't care about the n-bch pdu content since we need only the sdu if tx.request
npbch = eNB->npbch; //in the main of the lte-softmodem they should allocate this memory of phy vars
npbch = eNB->npbch; //in the main of the lte-softmodem they should allocate this memory of PHY_vars
npbch->h_sfn_lsb = dl_config_pdu->nbch_pdu.nbch_pdu_rel13.hyper_sfn_2_lsbs;
if(Sched_INFO->sdu[i] != NULL)
npbch->pdu = Sched_INFO->sdu[i];
else
LOG_E(PHY, "REceived a schedule_response with N-BCH but no PDU!!\n");
LOG_E(PHY, "Received a schedule_response with N-BCH but no SDU!!\n");
break;
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE://we can have three types of NDLSCH based on our assumptions: SIB1, SI, Data
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
//we can have three types of NDLSCH based on our assumptions: SIB1, SI, Data
//remember that SI messages have no DCI in NB-IoT therefore this is the only way to configure the ndlsch_SI structure
handle_nfapi_dlsch_pdu_NB(eNB, proc,dl_config_pdu,Sched_INFO->sdu[i]);
......
/*
* 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_procedures_lte_eNB.c
* \brief Implementation of eNB procedures from 36.213 LTE specifications
* \author R. Knopp, F. Kaltenberger, N. Nikaein, X. Foukas, Michele Paffetti, Nick Ho
* \date 2011
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr, x.foukas@sms.ed.ac.uk, michele.paffetti@studio.unibo.it, nick133371@gmail.com
* \note
* \warning
*/
#include "PHY/defs.h"
#include "PHY/defs_nb_iot.h"
......@@ -474,6 +504,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi
DCI_format = DCIFormatN1_RAR;
ndlsch= eNB->ndlsch_ra;//we store the RNTI for the RAR
ndlsch->ndlsch_type = RAR;
//DCI format N1 to RAR
DCI_Content->DCIN1_RAR.type = 1;
......@@ -511,6 +542,7 @@ void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi
AssertFatal(UE_id == -1, "no ndlsch context available or no ndlsch context corresponding to that rnti\n");
ndlsch = eNB->ndlsch[(uint8_t)UE_id]; //in the old implementation they also consider UE_id = 1;
ndlsch->ndlsch_type = UE_Data;
//DCI format N1 to DLSCH
DCI_Content->DCIN1.type = 1;
......@@ -649,7 +681,7 @@ void npdsch_procedures(PHY_VARS_eNB *eNB,
/*
* we don't need to manage the RAR here since should be managed in the MAC layer for two reasons:
* 1)we should receive directly the pdu containing the RAR from the MAC in the schedule_response
* 2)all the parameters for getting the MSG3 should be given by the UL_CONFIG.request (all inside the next Sched_RSP function)
* 2)all the parameters for getting the MSG3 should be given by the UL_CONFIG.request (all inside the next schedule_response function)
*
*/
......@@ -658,8 +690,6 @@ void npdsch_procedures(PHY_VARS_eNB *eNB,
//scheduling request not implemented in NB-IoT
//nulsch_param configuration for MSG3 should be considered in handling UL_Config.request
//(in particular the nulsch structure for RAR is distinguished based on the harq_process->rar_alloc and the particular subframe in which we should have Msg3)
}
else { //XXX we should change taus function???
......@@ -681,6 +711,20 @@ void npdsch_procedures(PHY_VARS_eNB *eNB,
if (eNB->abstraction_flag==0) { // used for simulation of the PHY??
//we can distinguish among the different kind of NDLSCH structure (example)
switch(ndlsch->ndlsch_type)
{
case SIB1:
break;
case SI_Message:
break;
case RAR: //maybe not needed
break;
case UE_Data: //maybe not needed
break;
}
/*
* in any case inside the encoding procedure is re-checked if this is round 0 or no
* in the case of harq_process round = 0 --> generate the sequence and put it into the parameter *c[r]
......@@ -701,20 +745,27 @@ void npdsch_procedures(PHY_VARS_eNB *eNB,
//encoding---------------------------
/*
* we should have as an iput parameter also G for the encoding based on the switch/case
* G is evaluated based on the switch/case done over eutracontrolRegionSize (if exist) and operationModeInfo
*
* REASONING:
* Encoding procedure will generate a Table with encoded data ( in ndlsch structure)
* The table will go in input to the scrambling
* --we should take care if there are repetitions of data or not because scrambling should be called at the first frame and subframe in which each repetition
* begin (see params Nf, Ns)
*
* we should have as an iput parameter also G for the encoding based on the switch/case over eutracontrolRegionSize (if exist) and operationModeInfo if defined
* NB: switch case of G is the same for npdsch and npdcch
*
* the npdsch_start symbol index refers to TS 36.213 ch 16.4.1.4
* npdsch_start symbol index
* -refers to TS 36.213 ch 16.4.1.4:
* -if subframe k is a subframe for receiving the SIB1-NB
* -- if operationModeInfo set to 00 or 01 (in band) --> npdsch_start_sysmbol = 3
* -- otherwise --> npdsch_start_symbol = 0
* -if the k subframe is not for SIB1-NB
* --npdsch_start_symbol = eutracontrolregionsize (defined for in-band operating mode (mode 0,1 for FAPI specs) and take values 1,2,3 [units in number of OFDM symbol])
* - otherwise --> npdsch_start_symbol = 0
* (is the starting OFDM for the NPDSCH transmission in the first slot in a subframe k)
* FAPI style: is stored in the ndlsch structure from the reception of the NPDLSCH PDU in the DL_CONFIG.request (so should be set by the MAC and put inside the schedule response)
*-if subframe k is a subframe for receiving the SIB1-NB
*-- if operationModeInfo set to 00 or 01 (in band) --> npdsch_start_sysmbol = 3
*-- otherwise --> npdsch_start_symbol = 0
*-if the k subframe is not for SIB1-NB
*--npdsch_start_symbol = eutracontrolregionsize (defined for in-band operating mode (mode 0,1 for FAPI specs) and take values 1,2,3 [units in number of OFDM symbol])
*- otherwise --> npdsch_start_symbol = 0
*
* FAPI style:
* npdsch_start symbol is stored in the ndlsch structure from the reception of the NPDLSCH PDU in the DL_CONFIG.request (so should be set by the MAC and put inside the schedule response)
* Nsf needed as an input (number of subframe)-->inside harq_process of ndlsch
*/
......@@ -848,6 +899,13 @@ extern int oai_exit;
* (see schedule_response implementation)
*
*/
/*
* This function is triggered by the schedule_response
* (the frequency at which is transmitted to the PHY depends on the MAC scheduler implementation)
* (in OAI in principle is every subframe)
*/
void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
int do_meas)
......@@ -860,7 +918,6 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
int8_t UE_id = 0;
uint8_t ul_subframe;
uint32_t ul_frame;
int **txdataF = eNB->common_vars.txdataF[0];
......@@ -880,31 +937,22 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//generate NPSS/NSSS
NB_common_signal_procedures(eNB,proc);
/*Generate MIB
*
*
* *the MIB pdu has been stored in the npbch structure of the PHY_vars_eNB during the schedule_response procedure
*
* TX.request --> nfapi_tx_request_pdu_t --> MAC PDU (MIB) //not used in our case since we put inside the *sdu in Sched_INFO
* Content of tx_request_pdu
* -pdu length 14 (bytes)???
* -pdu index = 1
* -num segments = 1,
* -segment length 5 bytes,
* -segment data 34 bits for MIB (5 bytes)
*
*
*Problem: NB_IoT_RB_ID should be the ID of the RB dedicated to NB-IoT
*but if we are in stand alone mode?? i should pass the DC carrier???
*in general this RB-ID should be w.r.t LTE bandwidht???
**allowed indexes for Nb-IoT PRBs are reported in R&Shwartz whitepaper pag 9
*
*/
//Generate MIB
if(subframe==0 && (eNB->npbch != NULL))
{
if(eNB->npbch->pdu != NULL)
{
//BCOM function
/*
* -the function get the MIB pdu and schedule the transmission over the 64 radio frame
* -need to check the subframe #0 (since encoding functions only check the frame)
* this functions should be called every frame (the function will transmit the remaining part of MIB)
* ( XXX Should check when the schedule_responce is transmitted by MAC scheduler)
* RB-ID only for the case of in-band operation but should be always considered
* (in stand alone i can put whatever the number)in other case consider the PRB index in the Table R&Shwartz pag 9
*
*/
generate_npbch(&eNB->npbch,
txdataF,
AMP,
......@@ -923,20 +971,37 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//Check for SIB1-NB transmission
//we should still consider that if at the start of the new SIB1-NB period the MAC will not send an NPDSCH for the SIB1-NB transmission then SIB1-NB will be not transmitted
/*
*
* the function should be called for each frame
* Parameters needed:
* -sib1-NB pdu if new one (should be given by the MAC at the start of each SIB1-NB period)
* -when start a new SIB1-NB repetition (sib1_rep_start)
* -the frame number relative to the 16 continuous frame within a repetition (relative_sib1_frame) 1st, 2nd ...
*
* we check that the transmission should occurr in subframe #4
*
* consider that if at the start of the new SIB1-NB period the MAC will not send an NPDSCH for the SIB1-NB transmission then SIB1-NB will be not transmitted (pdu = NULL)
*
*/
if(subframe == 4 && eNB->ndlsch_SIB1 != NULL)
{
uint32_t sib1_startFrame = is_SIB1_NB(frame, eNB->ndlsch_SIB1->harq_process->repetition_number,fp->Nid_cell);
//check if current frame is for SIB1-NB transmission (if yes get the starting frame of SIB1-NB) and set the flag for the encoding
uint32_t sib1_startFrame = is_SIB1_NB(frame,
eNB->ndlsch_SIB1->harq_process->repetition_number,
fp->Nid_cell,
eNB->ndlsch_SIB1 // we need it to set the flag
);
if(sib1_startFrame != -1 && eNB->ndlsch_SIB1->harq_process->pdu != NULL)
{
npdsch_procedures(eNB,
proc,
eNB->ndlsch_SIB1, //since we have no DCI for system information, this is filled directly when we receive the DL_CONFIG.request message (add a file in Sched_INFO)
eNB->ndlsch_SIB1, //since we have no DCI for system information, this is filled directly when we receive the NDLSCH pdu from DL_CONFIG.request message
eNB->ndlsch_SIB1->harq_process->pdu);
}
//at the end of the period we put the PDU to NULL since we have to wait for the new one from the MAC for starting the nextis_SIB1_NB
//at the end of the period we put the PDU to NULL since we have to wait for the new one from the MAC for starting the next SIB1-NB transmission
if((frame-sib1_startFrame)%256 == 255)
eNB->ndlsch_SIB1->harq_process->pdu = NULL;
......@@ -944,14 +1009,34 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//Check for SI transmission
if(eNB->ndlsch_SI != NULL && (eNB->ndlsch_SI->harq_process->pdu != NULL))
/*
*Parameters needed:
* -total number of subframes for the transmission (2-8) (inside the NDLSCH structure --> HARQ process -->resource_assignment)
* XXX: in reality this flag is not needed because is enough to check if the PDU is NULL (continue the transmission) or not (new SI transmission)
* -SI_start (inside ndlsch structure): flag for indicate the starting of the SI transmission within the SI window (new PDU is received by the MAC) otherwise the PHY continue to transmit
* what have in its buffer (so check the remaining encoded data continuously)
*
* SI transmission should not occurr in reserved subframes
* subframe = 0 (MIB-NB)
* subframe = 4 (SIB1-NB) but depends on the frame
* subframe = 5 (NPSS)
* subframe = 9 (NSSS) but depends on the frame (if is even)
*
* XXX Important: in the case the SI-window finish the PHY layer should have also being able to conclude all the SI transmission in time
* (because this is managed by the MAC layer that stops transmitting the SDU to PHY in advance because is counting the remaining subframe for the transmission)
*
*
*/
if(eNB->ndlsch_SI != NULL)
{
//check if the PDU != NULL will be done inside just for understanding if a new SI message need to be transmitted or not
npdsch_procedures(eNB,
proc,
eNB->ndlsch_SI, //since we have no DCI for system information, this is filled directly when we receive the DL_CONFIG.request message
eNB->ndlsch_SI->harq_process->pdu);
}
///check for RAR transmission
if(eNB->ndlsch_ra != NULL && eNB->ndlsch_ra->active == 1)
{
......@@ -985,8 +1070,6 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
}
//num_pdcch_symbols?? (maybe later when we have the DCI)
//no SMBV
//no dedicated phy config
......
......@@ -560,11 +560,12 @@ int npdsch_rep_to_array[3] ={4,8,16}; //TS 36.213 Table 16.4.1.3-3
int sib1_startFrame_to_array[4] = {0,16,32,48};//TS 36.213 Table 16.4.1.3-4
//New----------------------------------------------------
//return -1 whenever no SIB1-NB transmission occur.
//return sib1_startFrame when transmission occur
//return sib1_startFrame when transmission occur in the current frame
uint32_t is_SIB1_NB(
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId //by configuration
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId, //by configuration
NB_IoT_eNB_NDLSCH_t *ndlsch_SIB1
)
{
uint8_t nb_rep=0; // number of sib1-nb repetitions within the 256 radio frames
......@@ -584,20 +585,29 @@ uint32_t is_SIB1_NB(
* schedule with a periodicity of 2560 ms (256 Radio Frames) and repetitions (4, 8 or 16) are made, equally spaced
* within the 2560 ms period
*
*
* 0)find the SIB1-NB period over the 1024 frames in which the actual frame fall
* 0.0) check the input parameters
* 0)find the SIB1-NB period number over the 1024 frames in which the actual frame fall
* 1)from the schedulingInfoSIB1 of MIB-NB and the physCell_id we deduce the starting radio frame
* 2)check if the actual frame is after the staring radio frame
* 3)check if the actual frame is within a SIB1-transmission interval
* 4)based on the starting radio frame we can state when SIB1-NB is transmitted in odd or even frame
* 4)based on the starting radio frame we can state when SIB1-NB is transmitted in odd or even frame (commented)
* (if the starting frame is even (0,16,32,48) then SIB1-NB is transmitted in even frames, if starting frame is odd (1)
* we can state that SIB1-NB will be transmitted in every odd frame since repetitions are 16 in 256 radio frame period)
* 4bis) we do a for loop over the 16 continuous frame (hopping by 2) for check if the frame is considered in that interval
*
* *0) is necessary because at least i need to know in which of the even frames the repetition are -> is based on the offset
* *in 1023 frames there are exactly 4 period of SIB1-NB
**/
if(schedulingInfoSIB1 > 11 || schedulingInfoSIB1 < 0){
LOG_E(RRC, "is_SIB1_NB: schedulingInfoSIB1 value not allowed");
return 0;
}
//SIB1-NB period number
period_nb = (int) frameP/sib1_NB_period;
......@@ -646,35 +656,126 @@ uint32_t is_SIB1_NB(
//loop over the SIB1-NB period
for( int i = 0; i < nb_rep; i++)
{
//find the correct sib1-nb repetition interval in which the actual frame is
//this is the start frame of a repetition
index = sib1_startFrame+ i*(16+offset) + period_nb*256;
if(frameP>= index && frameP <= (index+15)) //SIB1_NB transmission interval
//the actual frame is in a gap between two consecutive repetitions
if(frameP < index)
{
ndlsch_SIB1->sib1_rep_start = 0;
ndlsch_SIB1->relative_sib1_frame = 0;
return -1;
}
//this is needed for ndlsch_procedure
else if(frameP == index)
{
//the actual frame is the start of a new repetition (SIB1-NB should be retransmitted)
ndlsch_SIB1->sib1_rep_start = 1;
ndlsch_SIB1->relative_sib1_frame = 1;
return sib1_startFrame;
}
else
ndlsch_SIB1->sib1_rep_start = 0;
//check in the current SIB1_NB repetition
if(frameP>= index && frameP <= (index+15))
{
//find if the actual frame is one of the "every other frame in 16 continuous frame" in which SIB1-NB is transmitted
if(sib1_startFrame%2 != 0){ // means that the starting frame was 1 --> sib1-NB is transmitted in every odd frame
if(frameP%2 == 1){
for(int y = 0; y < 16; y += 2) //every other frame (increment by 2)
{
if(frameP == index + y)
{
//this flag tell which is the number of the current frame w.r.t the 8th (over the continuous 16) in a repetition
ndlsch_SIB1->relative_sib1_frame = y/2 + 1; //1st, 2nd, 3rd,...
return sib1_startFrame;
}
}
}
//in all other starting frame cases SIB1-NB is transmitted in the even frames inside the corresponding repetition interval
if(frameP%2 == 0){ // SIB1-NB is transmitted
return sib1_startFrame;
}
//if we are here means that the frame was inside the repetition interval but not considered for SIB1-NB transmission
ndlsch_SIB1->relative_sib1_frame = 0;
return -1;
//XXX this part has been commented because in case that the "relative_sib1_frame" flag is not needed is necessary just a simple check if even or odd frame depending on sib1_startFrame
// if(sib1_startFrame%2 != 0){ // means that the starting frame was 1 --> sib1-NB is transmitted in every odd frame
// if(frameP%2 == 1){ //the actual frame is odd
// return sib1_startFrame;
// }
// }
//
// //in all other starting frame cases SIB1-NB is transmitted in the even frames inside the corresponding repetition interval
// if(frameP%2 == 0){ // SIB1-NB is transmitted
// return sib1_startFrame;
// }
//---------------------------------------------------------------------------------------------------------------------------------------------------------
}
if(index> frameP) // was not inside an interval of 16 radio frames for sib1-nb transmission
return -1;
}
return -1;
}
//New----------------------------------------------------
//Function for check if the current frame is the start of a new SIB1-NB period
uint8_t is_SIB1_NB_start(
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId //by configuration
)
{
uint8_t nb_rep=0; // number of sib1-nb repetitions within the 256 radio frames
uint32_t sib1_startFrame;
uint32_t sib1_NB_period = 256;//from specs TS 36.331 (rf)
uint8_t index;
int offset;
int period_nb; // the number of the actual period over the 1024 frames
if(schedulingInfoSIB1 > 11 || schedulingInfoSIB1 < 0){
LOG_E(RRC, "is_SIB1_NB: schedulingInfoSIB1 value not allowed");
return 0;
}
//number of repetitions
nb_rep = npdsch_rep_to_array[schedulingInfoSIB1%3];
//based on number of rep. and the physical cell id we derive the starting radio frame (TS 36.213 Table 16.4.1.3-3/4)
switch(nb_rep)
{
case 4:
//physCellId%4 possible value are 0,1,2,3
sib1_startFrame = sib1_startFrame_to_array[physCellId%4];
break;
case 8:
//physCellId%2possible value are 0,1
sib1_startFrame = sib1_startFrame_to_array[physCellId%2];
break;
case 16:
//physCellId%2 possible value are 0,1
if(physCellId%2 == 0)
sib1_startFrame = 0;
else
sib1_startFrame = 1; // the only case in which the starting frame is odd
break;
default:
LOG_E(RRC, "Number of repetitions %d not allowed", nb_rep);
return -1;
}
if((frameP-sib1_startFrame)%256 == 0)
return 0;
else
return -1;
}
//-------------------------------------------------------
//---------------------------------------------------------------------------
//New
int si_windowLength_to_rf[7]={16,32,48,64,96,128,160}; //TS 36.331 v14.2.1 pag 587
......@@ -901,8 +1002,10 @@ int8_t NB_mac_rrc_data_req_eNB(
}
//sib1-NB scheduled in subframe #4
if(subframeP == 4 && is_SIB1_NB(frameP,schedulingInfoSIB1, physCellId)!= -1){
///XXX Following FAPI implementation in principle we should only take care of get the PDU from the MAC only when the SIB1-NB period Start
//sib1-NB scheduled in subframe #4
if(subframeP == 4 && is_SIB1_NB_start(frameP,schedulingInfoSIB1, physCellId)!= -1){
memcpy(&buffer_pP[0],
eNB_rrc_inst_NB[Mod_idP].carrier[CC_id].SIB1_NB,
......
......@@ -98,15 +98,30 @@ int NB_rrc_mac_config_req_eNB(
//New
/**\brief function for evaluate if the SIB1-NB transmission occur
* called by the NB_mac_rrc_data_req
* return the SIB1 starting frame
* called by phy_procedure_eNB_Tx before calling the npdsch_procedure
*/
uint32_t is_SIB1_NB(
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId, //by configuration
NB_IoT_eNB_NDLSCH_t *ndlsch_SIB1
);
//--------------------------------------
//New
/**\brief function for evaluate if the SIB1-NB period start
* return 0 = TRUE
* return -1 = FALSE
* called by the NB_mac_rrc_data_req
*/
uint8_t is_SIB1_NB_start(
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId //by configuration
);
//New
/**\brief function for evaluate if the SIB23-NB transmission occurr
* called by the NB_mac_rrc_data_req
......
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