//XXX MP: one important problem to solve is how we decide when we deal with anchor or non anchor carrier?? configuration time?
//anchor carrier refers to the allowed PRBs index in the in-band operation mode at the beginning the UE is always camp on an anchor carrier from which
//receive NSSS, NPSSS ecc... but the RRCConnectionReconfiguration may could indicate non-anchor carrier to be used for data transmission
//ASSUMPTION: we always use an anchor carrier
floatm_dl=0;//this is the category offset for NB1/NB2 UE category used for EARFCN evaluation (TS 36.101 ch. 5.7.3F) (for the moment we keep this value fixed)
//PROBLEM: we need to know the LTE bandwidht for In-band and Guard band operating mode in order to choose the proper PRB idex or is given at configuration time??
//The prb index allowed are the one specified in R&shwarz pag 9 NB-IoT white papaer
config_INFO->cfg->config_NB_IoT.prb_index.value=-1;// is not defined for this case (put a negative random value--> will be not considered for encoding, scrambling procedures)
config_INFO->cfg->config_NB_IoT.control_region_size.value=-1;//is not defined so we put a negative value
config_INFO->cfg->config_NB_IoT.assumed_crs_aps.value=-1;//is not defined so we put a negative value
break;
default:
LOG_E(RRC,"rrc_mac_config_req_eNB_NB_IoT: NB-IoT operating Mode (MIB-NB) not set\n");
break;
}
/// Allocate how many SIB mapping-----------------------------------------------------------------------------------------------------///
LogicalChannelConfig_NB_r13_t*logicalChannelConfig,//FIXME: decide how to use it
rrc_config_NB_IoT_t*mac_config,
uint8_tded_flag,
uint8_tue_list_ded_num)
{
if(mib_flag!=0){
intUE_id=-1;
//find ue_id here
config_INFO->get_MIB=0;
config_INFO->get_COMMON=0;
config_INFO->get_DEDICATED=0;
config_INFO->mod_id=Mod_idP;
config_INFO->CC_id=CC_idP;
config_INFO->cfg->subframe_config.duplex_mode.value=2;//HD-FDD for NB-IoT
if(&carrier->mib_NB_IoT!=NULL){
/*printf(MAC,
"Configuring MIB for instance %d, CCid %d : (band %ld,Nid_cell %d,TX antenna port (p) %d,DL freq %u\n",
Mod_idP,
CC_idP,
sib1_NB_IoT->freqBandIndicator_r13,
carrier->physCellId,
carrier->p_eNB,
carrier->dl_CarrierFreq
);*/
/*
* Following the FAPI like approach:
* 1)fill the PHY_Config_t structure (PHY_INTERFACE/IF_Module_NB_IoT.h)
* 2)Call the PHY_config_req for trigger the NB_phy_config_mib_eNB() at the end
*/
//XXX where allocate memory for cfg??
if(config_INFO->cfg!=NULL)LOG_E(MAC,"rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
//if(config_INFO->cfg == NULL) LOG_E(MAC, "rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
if(config_INFO->cfg==NULL)LOG_E(MAC,"rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
if(config_INFO->cfg==NULL)LOG_E(MAC,"rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
//XXX MP: one important problem to solve is how we decide when we deal with anchor or non anchor carrier?? configuration time?
//anchor carrier refers to the allowed PRBs index in the in-band operation mode at the beginning the UE is always camp on an anchor carrier from which
//receive NSSS, NPSSS ecc... but the RRCConnectionReconfiguration may could indicate non-anchor carrier to be used for data transmission
//ASSUMPTION: we always use an anchor carrier
floatm_dl=0;//this is the category offset for NB1/NB2 UE category used for EARFCN evaluation (TS 36.101 ch. 5.7.3F) (for the moment we keep this value fixed)
//PROBLEM: we need to know the LTE bandwidht for In-band and Guard band operating mode in order to choose the proper PRB idex or is given at configuration time??
//The prb index allowed are the one specified in R&shwarz pag 9 NB-IoT white papaer
config_INFO->cfg->config_NB_IoT.prb_index.value=-1;// is not defined for this case (put a negative random value--> will be not considered for encoding, scrambling procedures)
config_INFO->cfg->config_NB_IoT.control_region_size.value=-1;//is not defined so we put a negative value
config_INFO->cfg->config_NB_IoT.assumed_crs_aps.value=-1;//is not defined so we put a negative value
break;
default:
LOG_E(RRC,"rrc_mac_config_req_eNB_NB_IoT: NB-IoT operating Mode (MIB-NB) not set\n");
break;
}
//we shoud use dl_CarrierConfig for generating the earfcn for LTE-CAT N2 based on TS 36.101 5.7.3F
/*
* 1) takes a random number from the offset of category NB1 and NB2 based on the operating mode (we assume always the usage of anchor carrier)
* 2)evaluate the EARFCN value based on the corresponding formula
"Configuring MIB for instance %d, CCid %d : (band %ld,Nid_cell %d,TX antenna port (p) %d,DL freq %u\n",
Mod_idP,
CC_idP,
eutra_band,
physCellId,
p_eNB,
dl_CarrierFreq
);
/*
* Following the FAPI like approach:
* 1)fill the PHY_Config_t structure (PHY_INTERFACE/IF_Module_NB_IoT.h)
* 2)Call the PHY_config_req for trigger the NB_phy_config_mib_eNB() at the end
*/
//XXX where allocate memory for cfg??
if(config_INFO->cfg==NULL)LOG_E(MAC,"rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
//Mapping OAI params into FAPI params
config_mib_fapi_NB_IoT(rntiP,
physCellId,
eutra_band,
Ncp,
Ncp_UL,
p_eNB,
p_rx_eNB,
dl_CarrierFreq,
ul_CarrierFreq,
eutraControlRegionSize,
mib_NB_IoT
);
}//mib_NB_IoT!=NULL
if(radioResourceConfigCommon!=NULL){
if(config_INFO->cfg==NULL)LOG_E(MAC,"rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
if(config_INFO->cfg==NULL)LOG_E(MAC,"rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
//logical channel group not defined for nb-iot --> no UL specific Parameter
// or at least LCGID should be set to 0 for NB-IoT (See TS 36.321 ch 6.1.3.1) so no make sense to store this
}
}
if(physicalConfigDedicated!=NULL){
if(config_INFO->cfg==NULL)LOG_E(MAC,"rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");