Commit a9f91a9c authored by Michele Paffetti's avatar Michele Paffetti

modified conditions for triggering the npdsch_procedure, still modulation,...

modified conditions for triggering the npdsch_procedure, still modulation, encoding...functions to be integrated. Warnings 144.Code compile
parent e6c47f94
......@@ -54,7 +54,7 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
int i,L, G;
int npdcch_start_index;
int npdcch_start_index = dci_alloc->npdcch_start_symbol;
/* PARAMETERS may not needed
**e_ptr : store the encoding result, and as a input to modulation
......
......@@ -933,10 +933,11 @@ typedef struct {
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)
//(used inside the ndlsch procedure for distinguish the different type of data to manage also in term of repetitions and transmission over more subframes
ndlsch_flag_t ndlsch_type;
} NB_IoT_eNB_NDLSCH_t;
typedef struct {
......
......@@ -75,23 +75,25 @@ void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
*
* From spec. TS 36.321 v14.2.o pag 31 --> there is an HARQ process for all the broadcast
*
* XXX for the moment we are not able to prevent the problem of Error: first transmission but sdu = NULL.
* anyway, the PHY layer if have finished the transmission it will not transmit anything and will generate the error
*
*/
ndlsch= eNB->ndlsch_SI;
ndlsch->ndlsch_type = SI_Message;
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission
ndlsch_harq = ndlsch->harq_process;
//new SI starting transmission
//new SI starting transmission (should enter here only the first time for a new transmission)
if(sdu != NULL)
{
ndlsch->ndlsch_type = SI_Message;
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission
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;
......@@ -100,14 +102,17 @@ void handle_nfapi_dlsch_pdu_NB(PHY_VARS_eNB *eNB,
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;
//continue the remaining transmission of the previous SI at PHY if any (otherwise nothing)
//there is no need of repeating the configuration on the ndlsch
ndlsch_harq->pdu = NULL;
}
//Independently if we have the PDU or not (first transmission or repetition) the process is activated for triggering the ndlsch_procedure
ndlsch_harq->status = ACTIVE;
}
//ue specific data or RAR (we already have received the DCI for this)
else if(rel13->rnti != 65535 && rel13->rnti_type == 1)
......@@ -229,8 +234,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
break;
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
//we can have three types of NDLSCH based on our assumptions: SIB1, SI, Data, RAR
//remember that SI messages have no DCI in NB-IoT therefore this is the only way to configure the ndlsch_SI/ndlsch_SIB1 structure
handle_nfapi_dlsch_pdu_NB(eNB, proc,dl_config_pdu,Sched_INFO->sdu[i]);
......@@ -282,6 +287,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
}
//XXX problem: although we may have nothing to transmit this function should be always triggered in order to allow the PHY layer to complete the repetitions
//of previous Transport Blocks
NB_phy_procedures_eNB_TX(eNB,proc,NULL);
}
......
......@@ -870,6 +870,9 @@ extern int oai_exit;
/*
* ASSUMPTION
*
* The MAC schedule the schedule_response in a SUBFRAME BASE (at least because otherwise we have problem with our assumptions on SI transmission)
*
*Since in FAPI specs seems to not manage the information for the sceduling of system information:
* Assume that the MAC layer manage the scheduling for the System information (SI messages) transmission while MIB and SIB1 are done directly at PHY layer
* This means that the MAC scheduler will send to the PHY the NDLSCH PDU and MIB PDU (DL_CONFIG.request)each time they should be transmitted. In particular:
......@@ -882,20 +885,20 @@ extern int oai_exit;
*if no new NDLSCH pdu (configured for SIB1-NB) at SFN mod 256 = 0 is transmitted. stop SIB1-NB transmission
****SI Messages
* -schedule_response is transmitted by the MAC in every subframe needed for the SI transmission (NDLSCH should have a proper configuration)
* -if the schedule_response carry any SDU (SDU!= NULL)--> put the SDU in the PHY buffer to be encoded ecc... and start the transmission
* -if the schedule_response carry any SDU for SI-Message (SDU!= NULL)--> put the SDU in the PHY buffer to be encoded ecc... and start the transmission
* -if the schedule_response not carry any SDU (SDU == NULL) but NDLSCH is properly set for SI, then PHY continue transmit the remaining part of the previous SDU
* (this because the PHY layer have no logic of repetition_pattern, si_window ecc.. so should be continuously instructed the PHY when to transmit.
*
* Furthermore, SI messages are transmitted in more that 1 subframe (2 or 8) and therefore MAC layer need to count how many subframes are available in the current frame for transmit it
* and take in consideration that other frames are needed before starting the transmission of a new one)
*
*
* FAPI distingsh the BCCH info in the NDLSCH may for some reasons:
* -scrambling is different
*We assume that whenever the NDLSCH pdu is a BCCH type, we consider as if it's a SIB1 while in other case can be data or SI-message depending on the RNTI
*
* **relevant aspects for the System information Transmission (Table 4-47 NDLSCH FAPi specs)
* 1)RNTI type = 0 (contains a BCCH)
* 2)Repetition number == scheduling info SIB1
* 3)RNTI
* 2)Repetition number == scheduling info SIB1 mapped into 4-8-16
* 3)RNTI (0xFFFF = SI-RNTI)
* (see schedule_response implementation)
*
*/
......@@ -919,6 +922,9 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
uint8_t ul_subframe;
uint32_t ul_frame;
int **txdataF = eNB->common_vars.txdataF[0];
uint32_t sib1_startFrame = -1;
if(do_meas == 1)
......@@ -966,8 +972,10 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//In the last frame in which the MIB-NB should be transmitted after we point to NULL since maybe we stop MIB trasnmission
//this should be in line with FAPI specs pag 94 (BCH procedure in Downlink 3.2.4.2 for NB-IoT)
if(frame%64 == 63)
{
eNB->npbch->pdu = NULL;
}
}
//Check for SIB1-NB transmission
......@@ -984,13 +992,13 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
* 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)
if(subframe == 4 && eNB->ndlsch_SIB1 != NULL && eNB->ndlsch_SIB1->harq_process->status == ACTIVE)
{
//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,
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
eNB->ndlsch_SIB1 //set the flags
);
if(sib1_startFrame != -1 && eNB->ndlsch_SIB1->harq_process->pdu != NULL)
......@@ -1003,7 +1011,11 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//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)
{
//whenever we will not receive a new sdu from MAC at the start of the next SIB1-NB period we prevent future SIB1-NB transmission (may just only of the two condition is necessary)
eNB->ndlsch_SIB1->harq_process->status = DISABLED;
eNB->ndlsch_SIB1->harq_process->pdu = NULL;
}
}
......@@ -1022,18 +1034,47 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
* subframe = 5 (NPSS)
* subframe = 9 (NSSS) but depends on the frame (if is even)
*
* [This condition should be known by the MAC layer so it should trigger an DLSCH pdu only at proper instants]
*
* 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)
*
*
*XXX important: set the flag HARQ process->status to DISABLE when PHY finished the SI-transmission over the 2 or 8 subframes
*XXX important: whenever we enter for some error in the ndlsch_procedure with a pdu that is NULL but all the data of the SI have been transmitted --> generate error
*XXX : the npdlsch_procedure in this case should be only called when is triggered by the MAC schedule_response (use the status flag set by the schedule_response)
*
*/
if(eNB->ndlsch_SI != NULL)
if(eNB->ndlsch_SI->harq_process->status == ACTIVE && (eNB->ndlsch_SI->harq_process->status != ACTIVE || subframe != 4)) //condition on SIB1-NB
{
if(frame%2 == 0)//condition on NSSS (subframe 9 not available)
{
if(eNB->ndlsch_SI != NULL && subframe!= 0 && subframe != 5 && subframe != 9)
{
//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);
eNB->ndlsch_SI->harq_process->status = DISABLED;
}
}
else //this frame not foresee the transmission of NSSS (subframe 9 is available)
{
if(eNB->ndlsch_SI != NULL && subframe!= 0 && subframe != 5)
{
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);
eNB->ndlsch_SI->harq_process->status = DISABLED;
}
}
}
......@@ -1053,8 +1094,6 @@ void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//transmission of UE specific ndlsch data
for (int UE_id = 0; i < NUMBER_OF_UE_MAX_NB_IoT; UE_id++)
{
......
......@@ -768,6 +768,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties_index = 0;
num_enbs = config_setting_length(setting);
//Start the loop for parsing all the element over the .config file
for (i = 0; i < num_enbs; i++) {
setting_enb = config_setting_get_elem(setting, i);
......@@ -783,6 +786,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
# endif
}
//Identification Parameters
if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type)
&& config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name)
&& config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac)
......@@ -2519,7 +2524,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
// OTG _CONFIG
// OTG _CONFIG //MP: refers to USB On the GO Features ?? (use USB devices as a fleshdrives)
setting_otg = config_setting_get_member (setting_enb, ENB_CONF_STRING_OTG_CONFIG);
if (setting_otg != NULL) {
......
......@@ -141,7 +141,8 @@ int NB_rrc_mac_config_req_eNB(
int p_rx_eNB,// number of eNB Rx antenna ports (1 or 2 for NB-IoT)
int Ncp,
int Ncp_UL,
long eutra_band,//FIXME: frequencyBandIndicator in sib1 (is a long not an int!!)
//FIXME: frequencyBandIndicator (eutra_band) in sib1 (as Rymond Implementation) (is a long not an int!!)//XXX this param is set in the do_sib1_nb and is directly taken from the .config file
long eutra_band,
struct NS_PmaxList_NB_r13 *frequencyBandInfo, //optional SIB1
struct MultiBandInfoList_NB_r13 *multiBandInfoList, //optional SIB1
struct DL_Bitmap_NB_r13 *dl_bitmap, //optional SIB1
......
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