Commit b010d77f authored by Michele Paffetti's avatar Michele Paffetti

Adding comment for ASSUMPTIONs in SI transmission for FAPI style apprach. Code compile

parent c2ef993c
......@@ -706,7 +706,7 @@ typedef struct PHY_VARS_eNB_s {
//NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT]; //check the max size of this array
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX_NB_IoT];
NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX_NB_IoT+1]; //nulsch[0] contains the RAR
NB_IoT_eNB_NDLSCH_t *ndlsch_SI,*ndlsch_ra;
NB_IoT_eNB_NDLSCH_t *ndlsch_SI,*ndlsch_ra, *ndlsch_SIB1;
NB_DL_FRAME_PARMS frame_parms_nb_iot;
// DCI for at most 2 DCI pdus
......
......@@ -8,7 +8,6 @@
#include "PHY/INIT/defs_nb_iot.h"
void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
nfapi_dl_config_request_pdu_t *dl_config_pdu,
......@@ -21,33 +20,85 @@ void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
int UE_id= -1;
//Check for SI PDU since in NB-IoT there is no DCI for that
//SIB (type 0), other DLSCH data (type 1)
if(rel13->rnti_type == 0)
//SIB1 (type 0), other DLSCH data (type 1) (include the SI messages) based on our ASSUMPTIONs
if(rel13->rnti_type == 0 && rel13->rnti == 65535)
{
ndlsch = eNB->ndlsch_SI;
/*
* 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
*
* From spec. TS 36.321 v14.2.o pag 31 --> there is an HARQ process for all the broadcast
*
*/
ndlsch= eNB->ndlsch_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;
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->modulation = rel13->modulation;
ndlsch_harq->status = ACTIVE;
//SI information in reality have no feedback
//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;
//managment of TBS size for SI??? (is written inside the SIB1-NB)
}
else
{ //ue specific data or RAR
//This are System Information (SI message)
else if(rel13->rnti_type == 1 && rel13->rnti == 65535)
{
/*
*
* the configuration of the NDLSCH PDU for the SIB1-NB should be the following:
* 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
*
* 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_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
{
//the major fact is that i should be aware when the SI should be transmitted since the PHY layer have no logic for this
}
//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
else if(rel13->rnti != 65535 && rel13->rnti_type == 1)
{
//check if the PDU is for RAR
if(eNB->ndlsch_ra != NULL && rel13->rnti == eNB->ndlsch_ra->rnti)
if(eNB->ndlsch_ra != NULL && rel13->rnti == eNB->ndlsch_ra->rnti) //rnti for the RAR should have been set priviously by the DCI
{
eNB->ndlsch_ra->harq_process->pdu = sdu;
eNB->ndlsch_ra->npdsch_start_symbol = rel13->start_symbol;
......@@ -62,17 +113,19 @@ void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
UE_id = find_ue_NB(rel13->rnti,eNB);
AssertFatal(UE_id==-1,"no existing ue specific dlsch_context\n");
ndlsch = eNB->ndlsch[(uint8_t)UE_id];
ndlsch_harq = eNB->ndlsch[(uint8_t)UE_id]->harq_process;
AssertFatal(ndlsch_harq!=NULL,"dlsch_harq for ue specific is null\n");
ndlsch = eNB->ndlsch[(uint8_t)UE_id];
ndlsch->npdsch_start_symbol = rel13->start_symbol;
ndlsch_harq->pdu = sdu;
}
}
//I don't know which kind of data is
else
{
LOG_E(PHY, "handle_nfapi_dlsch_pdu_NB: Unknown type of data (rnti type %d, rnti %d)\n", rel13->rnti_type, rel13->rnti);
}
}
......@@ -113,24 +166,51 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
nfapi_ul_config_request_pdu_t *ul_config_pdu;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
for (i=0;i<number_dl_pdu;i++)
//clear previous possible allocation (maybe someone else should be added)
for(int i = 0; i < NUMBER_OF_UE_MAX_NB_IoT; i++)
{
if(eNB->ndlsch[i])
{
eNB->ndlsch[i]->harq_process->round=0; // may not needed
/*clear previous allocation information for all UEs*/
eNB->ndlsch[i]->subframe_tx[subframe] = 0;
}
/*clear the DCI allocation maps for new subframe*/
if(eNB->nulsch[i])
{
eNB->nulsch[i]->harq_process->dci_alloc = 0; //flag for indicating that a DCI has been allocated for UL
eNB->nulsch[i]->harq_process->rar_alloc = 0; //Flag indicating that this ULSCH has been allocated by a RAR (for Msg3)
//no phich for NB-IoT so no DMRS should be utilized
}
}
for (i=0;i<number_dl_pdu;i++) //in principle this should be always = 1
{
dl_config_pdu = &DL_req->dl_config_pdu_list[i];
switch (dl_config_pdu->pdu_type)
{
case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
//Remember: there is no DCI for SI information
NB_generate_eNB_dlsch_params(eNB,proc,dl_config_pdu);
break;
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
//XXX 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;
npbch->pdu = Sched_INFO->sdu[i];
// 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
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");
break;
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE://we can have three types of NDLSCH based on our assumptions: SIB1, SI, Data
handle_nfapi_dlsch_pdu_NB(eNB, proc,dl_config_pdu,Sched_INFO->sdu[i]);
......
......@@ -267,8 +267,8 @@ void NB_initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint1
if (loop == 100) { printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
//RA_template[i].RA_rnti = 1+subframeP+(10*f_id);
/*for NB-IoT, RA_rnti is counted in 36.321 5.1.4*/
RA_template[i].RA_rnti = 1+floor(frameP/4)+256*carrier_id;
RA_template[i].preamble_index = preamble_index;
RA_template[i].RA_rnti = 1+floor(frameP/4)+256*carrier_id;
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation for process %d, rnti %x, RA_active %d\n",
module_idP,CC_id,frameP,i,RA_template[i].rnti,
RA_template[i].RA_active);
......
......@@ -559,7 +559,9 @@ int NB_rrc_mac_config_req_eNB(
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----------------------------------------------------
boolean_t is_SIB1_NB(
//return -1 whenever no SIB1-NB transmission occur.
//return sib1_startFrame when transmission occur
uint32_t is_SIB1_NB(
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId //by configuration
......@@ -623,13 +625,13 @@ boolean_t is_SIB1_NB(
break;
default:
LOG_E(RRC, "Number of repetitions %d not allowed", nb_rep);
return FALSE;
return -1;
}
//check the actual frame w.r.t SIB1-NB starting frame
if(frameP < sib1_startFrame + period_nb*256){
LOG_T(RRC, "the actual frame %d is before the SIB1-NB starting frame %d of the period--> bcch_sdu_legnth = 0", frameP, sib1_startFrame + period_nb*256);
return FALSE;
return -1;
}
......@@ -656,22 +658,23 @@ boolean_t is_SIB1_NB(
if(sib1_startFrame%2 != 0){ // means that the starting frame was 1 --> sib1-NB is transmitted in every odd frame
if(frameP%2 == 1){
return TRUE;
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 TRUE;
return sib1_startFrame;
}
}
if(index> frameP) // was not inside an interval of 16 radio frames for sib1-nb transmission
return 0;
return -1;
}
return FALSE;
return -1;
}
//---------------------------------------------------------------------------
//New
int si_windowLength_to_rf[7]={16,32,48,64,96,128,160}; //TS 36.331 v14.2.1 pag 587
......@@ -681,8 +684,8 @@ int si_period_to_nb[7]={64,128,256,512,1024,2048,4096};
boolean_t is_SIB23_NB(
const frame_t frameP,
const frame_t h_frameP, // the HSFN (increased by 1 every SFN wrap around) (10 bits)
long si_period, //SI-periodicity (rf)
long si_windowLength_ms, //Si-windowlength (ms) XXX received as an enumerative (see the IE of SIB1-NB)
long si_period, //SI-periodicity (value given by the Enumerative of the SIB1-NB)
long si_windowLength_ms, //Si-windowlength (ms) received as an enumerative (see the IE of SIB1-NB)
long* si_RadioFrameOffset, //Optional
long si_RepetitionPattern // is given as an Enumerated
)
......@@ -741,6 +744,7 @@ boolean_t is_SIB23_NB(
return FALSE;
}
//translate the enumerative into numer of Radio Frames
si_periodicity = si_period_to_nb[si_period];
//check if the actual frame is within an HSFN interval that will include si-window (relation with the si-periodicity)
......@@ -761,7 +765,7 @@ boolean_t is_SIB23_NB(
return FALSE;
}
//get the si_window in Radio Frame
//get the si_window from enumerative into Radio FRames
si_windowLength = si_windowLength_to_rf[si_windowLength_ms];
if(si_windowLength > si_periodicity){
......@@ -769,10 +773,10 @@ boolean_t is_SIB23_NB(
return FALSE;
}
//get the si_pattern
//get the si_pattern from the enumerative
si_pattern = si_repPattern_to_nb[si_RepetitionPattern];
if(si_RadioFrameOffset == NULL)//is not defined
if(si_RadioFrameOffset == NULL)//may is not defined since is optional
{
LOG_I(RRC, "si_RadioFrame offset was NULL --> set = 0\n");
si_offset = 0;
......@@ -873,7 +877,7 @@ int8_t NB_mac_rrc_data_req_eNB(
//Requesting for SI Message
//XXX to be check when it is initialized
if(eNB_rrc_inst_NB[Mod_idP].carrier[CC_id].SI.Active==0) {
if(eNB_rrc_inst_NB[Mod_idP].carrier[CC_id].SI.Active==0) { //is set when we call openair_rrc_on function
LOG_E(RRC, "SI value on the carrier = 0");
return 0;
}
......@@ -898,7 +902,7 @@ int8_t NB_mac_rrc_data_req_eNB(
//sib1-NB scheduled in subframe #4
if(subframeP == 4 && is_SIB1_NB(frameP,schedulingInfoSIB1, physCellId)){
if(subframeP == 4 && is_SIB1_NB(frameP,schedulingInfoSIB1, physCellId)!= -1){
memcpy(&buffer_pP[0],
eNB_rrc_inst_NB[Mod_idP].carrier[CC_id].SIB1_NB,
......
......@@ -100,7 +100,7 @@ int NB_rrc_mac_config_req_eNB(
/**\brief function for evaluate if the SIB1-NB transmission occur
* called by the NB_mac_rrc_data_req
*/
boolean_t is_SIB1_NB(
uint32_t is_SIB1_NB(
const frame_t frameP,
long schedulingInfoSIB1,//from the mib
int physCellId
......
......@@ -1626,10 +1626,6 @@ init_SI_NB(
config_INFO = malloc(sizeof(PHY_Config_t));
// uint8_t SIwindowsize = 1; //frame
// uint16_t SIperiod = 8; // in frames
//copy basic parameters
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
eNB_rrc_inst_NB[ctxt_pP->module_id].carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id];
......
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