Commit 4f359646 authored by Michele Paffetti's avatar Michele Paffetti

nb iot files and modifications and not tested

parent a60ea61b
......@@ -84,6 +84,7 @@ typedef struct RrcStateInd_s {
} RrcStateInd;
// eNB: ENB_APP -> RRC messages
//these parameters are set by the configuration files?
typedef struct RrcConfigurationReq_s {
uint32_t cell_identity;
......@@ -103,8 +104,8 @@ typedef struct RrcConfigurationReq_s {
*/
int16_t nb_cc;
lte_frame_type_t frame_type[MAX_NUM_CCs];
uint8_t tdd_config[MAX_NUM_CCs];
uint8_t tdd_config_s[MAX_NUM_CCs];
uint8_t tdd_config[MAX_NUM_CCs]; //not present in NB-IoT
uint8_t tdd_config_s[MAX_NUM_CCs]; //not present in NB-IoT
lte_prefix_type_t prefix_type[MAX_NUM_CCs];
int16_t eutra_band[MAX_NUM_CCs];
uint32_t downlink_frequency[MAX_NUM_CCs];
......@@ -114,19 +115,26 @@ typedef struct RrcConfigurationReq_s {
int16_t N_RB_DL[MAX_NUM_CCs];// for testing, change later
int nb_antennas_tx[MAX_NUM_CCs];
int nb_antennas_rx[MAX_NUM_CCs];
//PRACH
long prach_root[MAX_NUM_CCs];
long prach_config_index[MAX_NUM_CCs];
BOOLEAN_t prach_high_speed[MAX_NUM_CCs];
long prach_zero_correlation[MAX_NUM_CCs];
long prach_freq_offset[MAX_NUM_CCs];
//NPRACH for NB-IoT---
//...completely different parameter and structure for NPRACH
//-----------
//PUCCH
long pucch_delta_shift[MAX_NUM_CCs];
long pucch_nRB_CQI[MAX_NUM_CCs];
long pucch_nCS_AN[MAX_NUM_CCs];
#if !defined(Rel10) && !defined(Rel14)
long pucch_n1_AN[MAX_NUM_CCs];
#endif
//PDSCH
long pdsch_referenceSignalPower[MAX_NUM_CCs];
long pdsch_p_b[MAX_NUM_CCs];
//PUSCH
long pusch_n_SB[MAX_NUM_CCs];
long pusch_hoppingMode[MAX_NUM_CCs];
long pusch_hoppingOffset[MAX_NUM_CCs];
......@@ -137,35 +145,44 @@ typedef struct RrcConfigurationReq_s {
long pusch_nDMRS1[MAX_NUM_CCs];
long phich_duration[MAX_NUM_CCs];
long phich_resource[MAX_NUM_CCs];
//SRS
BOOLEAN_t srs_enable[MAX_NUM_CCs];
long srs_BandwidthConfig[MAX_NUM_CCs];
long srs_SubframeConfig[MAX_NUM_CCs];
BOOLEAN_t srs_ackNackST[MAX_NUM_CCs];
BOOLEAN_t srs_MaxUpPts[MAX_NUM_CCs];
//uplink power control
long pusch_p0_Nominal[MAX_NUM_CCs];
long pusch_alpha[MAX_NUM_CCs];
long pucch_p0_Nominal[MAX_NUM_CCs];
long msg3_delta_Preamble[MAX_NUM_CCs];
long ul_CyclicPrefixLength[MAX_NUM_CCs];
//related to UplinkPowerControl IE
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b[MAX_NUM_CCs];
long rach_numberOfRA_Preambles[MAX_NUM_CCs];
BOOLEAN_t rach_preamblesGroupAConfig[MAX_NUM_CCs];
long rach_sizeOfRA_PreamblesGroupA[MAX_NUM_CCs];
long rach_messageSizeGroupA[MAX_NUM_CCs];
e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
long rach_numberOfRA_Preambles[MAX_NUM_CCs];// not present in NB-IoT SIB2
BOOLEAN_t rach_preamblesGroupAConfig[MAX_NUM_CCs]; // not present in NB-IoT SIB2
long rach_sizeOfRA_PreamblesGroupA[MAX_NUM_CCs];// not presen in NB-IoT SIB2
long rach_messageSizeGroupA[MAX_NUM_CCs]; // not presen in NB-IoT SIB2
e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];// not presen in NB-IoT SIB2
long rach_powerRampingStep[MAX_NUM_CCs];
long rach_preambleInitialReceivedTargetPower[MAX_NUM_CCs];
long rach_preambleTransMax[MAX_NUM_CCs];
long rach_raResponseWindowSize[MAX_NUM_CCs];
long rach_macContentionResolutionTimer[MAX_NUM_CCs];
long rach_maxHARQ_Msg3Tx[MAX_NUM_CCs];
long rach_preambleTransMax[MAX_NUM_CCs]; // not present in NB-IoT SIB2
long rach_raResponseWindowSize[MAX_NUM_CCs]; // not present in NB-IoT SIB2
long rach_macContentionResolutionTimer[MAX_NUM_CCs]; // not present in NB-IoT SIB2
long rach_maxHARQ_Msg3Tx[MAX_NUM_CCs];// not present in NB-IoT SIB2
//BCCH
long bcch_modificationPeriodCoeff[MAX_NUM_CCs];
//PCCH
long pcch_defaultPagingCycle[MAX_NUM_CCs];
long pcch_nB[MAX_NUM_CCs];
long ue_TimersAndConstants_t300[MAX_NUM_CCs];
long ue_TimersAndConstants_t301[MAX_NUM_CCs];
long ue_TimersAndConstants_t310[MAX_NUM_CCs];
......@@ -173,6 +190,66 @@ typedef struct RrcConfigurationReq_s {
long ue_TimersAndConstants_n310[MAX_NUM_CCs];
long ue_TimersAndConstants_n311[MAX_NUM_CCs];
long ue_TransmissionMode[MAX_NUM_CCs];
//NB-IoT------------------------------------------------------------
//RACH
long rach_raResponseWindowSize_NB[MAX_NUM_CCs];
long rach_macContentionResolutionTimer_NB[MAX_NUM_CCs];
long rach_powerRampingStep_NB[MAX_NUM_CCs];
long rach_preambleInitialReceivedTargetPower_NB[MAX_NUM_CCs];
long preambleTransMax_CE_NB[MAX_NUM_CCs]; //da ricontrollare se va bene il tipo
//BCCH
long bcch_modificationPeriodCoeff_NB[MAX_NUM_CCs];
//PCCH
long pcch_defaultPagingCycle_NB[MAX_NUM_CCs];
long pcch_nB_NB[MAX_NUM_CCs];
long pcch_npdcch_NumRepetitionPaging_NB[MAX_NUM_CCs];
//NPRACH
long nprach_CP_Length[MAX_NUM_CCs];
long nprach_rsrp_range_NB[MAX_NUM_CCs];
long nprach_Periodicity[MAX_NUM_CCs];
long nprach_StartTime[MAX_NUM_CCs];
long nprach_SubcarrierOffset[MAX_NUM_CCs];
long nprach_NumSubcarriers[MAX_NUM_CCs];
long nprach_SubcarrierMSG3_RangeStart[MAX_NUM_CCs];
long maxNumPreambleAttemptCE_NB[MAX_NUM_CCs];
long numRepetitionsPerPreambleAttempt_NB[MAX_NUM_CCs];
long npdcch_NumRepetitions_RA[MAX_NUM_CCs];
long npdcch_StartSF_CSS_RA[MAX_NUM_CCs];
long npdcch_Offset_RA[MAX_NUM_CCs];
//NPDSCH
long npdsch_nrs_Power[MAX_NUM_CCs];
//NPUSCH
long npusch_ack_nack_numRepetitions_NB[MAX_NUM_CCs];
long npusch_srs_SubframeConfig_NB[MAX_NUM_CCs];
long npusch_threeTone_CyclicShift_r13[MAX_NUM_CCs];
long npusch_sixTone_CyclicShift_r13[MAX_NUM_CCs];
BOOLEAN_t npusch_groupHoppingEnabled[MAX_NUM_CCs];
long npusch_groupAssignmentNPUSCH_r13[MAX_NUM_CCs];
/*NPUCCH
* all data are sent over the NPUSCH. This includes also the UL control information (UCI), which is transmitted using a different format.
* Consequently there is no equivalent to the PUCCH of LTE in NB-IoT.
*/
//DL_GapConfig
long dl_GapThreshold_NB[MAX_NUM_CCs];
long dl_GapPeriodicity_NB[MAX_NUM_CCs];
long dl_GapDurationCoeff_NB[MAX_NUM_CCs];
//Uplink power control Common
long npusch_p0_NominalNPUSCH_r13[MAX_NUM_CCs];
long npusch_alpha_r13[MAX_NUM_CCs];
long deltaPreambleMsg3_r13[MAX_NUM_CCs];
//UE timers and constants
long ue_TimersAndConstants_t300_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_t301_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_t310_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_t311_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_n310_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_n311_NB[MAX_NUM_CCs];
//---------------------------------------------------------------------------
} RrcConfigurationReq;
// UE: NAS -> RRC messages
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -979,8 +979,6 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio
physicalConfigDedicated2->pusch_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->pusch_ConfigDedicated));
physicalConfigDedicated2->pucch_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->pucch_ConfigDedicated));
physicalConfigDedicated2->cqi_ReportConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic
= CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic));
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated));
physicalConfigDedicated2->schedulingRequestConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->schedulingRequestConfig));
physicalConfigDedicated2->antennaInfo = CALLOC(1,sizeof(*physicalConfigDedicated2->antennaInfo));
......
......@@ -175,7 +175,7 @@ init_SI(
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB1 = 0;
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB23 = 0;
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1 = (uint8_t*) malloc16(32);
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1 = (uint8_t*) malloc16(32);//allocation of buffer memory
/*
printf ("before SIB1 init : Nid_cell %d\n", mac_xface->lte_frame_parms->Nid_cell);
......@@ -189,9 +189,9 @@ init_SI(
ctxt_pP->module_id,
CC_id,
mac_xface->frame_parms,
(uint8_t*)eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].siblock1,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib1
(uint8_t*)eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1, //buffer
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].siblock1, //BCCH_DL_SCH message (parametro in un array)
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib1 //SystemInformationBlockType1 (puntatore dentro un array)
#if defined(ENABLE_ITTI)
, configuration
#endif
......@@ -856,7 +856,7 @@ rrc_eNB_process_RRCConnectionSetupComplete(
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing RRCConnectionSetupComplete from UE (SRB1 Active)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
ue_context_pP->ue_context.Srb1.Active=1;
ue_context_pP->ue_context.Srb1.Active=1; //attivo SRB1
T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
......@@ -1446,8 +1446,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
struct SRB_ToAddMod *SRB2_config = NULL;
struct SRB_ToAddMod__rlc_Config *SRB2_rlc_config = NULL;
struct SRB_ToAddMod__logicalChannelConfig *SRB2_lchan_config = NULL;
struct LogicalChannelConfig__ul_SpecificParameters
*SRB2_ul_SpecificParameters = NULL;
struct LogicalChannelConfig__ul_SpecificParameters *SRB2_ul_SpecificParameters = NULL;
SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList;
SRB_ToAddModList_t **SRB_configList2 = NULL;
......@@ -1523,7 +1522,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
// Configure SRB2
/// SRB2
SRB_configList2=&ue_context_pP->ue_context.SRB_configList2[xid];
SRB_configList2=&ue_context_pP->ue_context.SRB_configList2[xid]; //why no asterix?
if (*SRB_configList2) {
free(*SRB_configList2);
}
......@@ -1575,6 +1574,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
if (*DRB_configList) {
free(*DRB_configList);
}
//DRB_ConfigList era gi stato linkato a ue_context al momento della dichiarazione
*DRB_configList = CALLOC(1, sizeof(**DRB_configList));
memset(*DRB_configList, 0, sizeof(**DRB_configList));
......@@ -2082,7 +2082,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
size = do_RRCConnectionReconfiguration(ctxt_pP,
buffer,
xid, //Transaction_id,
(SRB_ToAddModList_t*)*SRB_configList2, // SRB_configList
(SRB_ToAddModList_t*)*SRB_configList2,
(DRB_ToAddModList_t*)*DRB_configList,
(DRB_ToReleaseList_t*)NULL, // DRB2_list,
(struct SPS_Config*)NULL, // *sps_Config,
......@@ -2542,6 +2542,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
struct MeasConfig__speedStatePars *Sparams;
CellsToAddMod_t *CellToAdd;
CellsToAddModList_t *CellsToAddModList;
// srb 1: for HO
struct SRB_ToAddMod *SRB1_config;
struct SRB_ToAddMod__rlc_Config *SRB1_rlc_config;
......@@ -3447,6 +3448,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
uint8_t *kRRCint = NULL;
uint8_t *kUPenc = NULL;
DRB_ToAddModList_t* DRB_configList = ue_context_pP->ue_context.DRB_configList2[xid];
SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList2[xid];
......@@ -3562,7 +3564,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
// Loop through DRBs and establish if necessary
if (DRB_configList != NULL) {
for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8)
for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8) (for NB_IoT is 2 DRB)
if (DRB_configList->list.array[i]) {
drb_id = (int)DRB_configList->list.array[i]->drb_Identity;
LOG_I(RRC,
......@@ -3674,7 +3676,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
} else { // remove LCHAN from MAC/PHY
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) {
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) { //???
// DRB has just been removed so remove RLC + PDCP for DRB
/* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
......@@ -3751,7 +3753,7 @@ rrc_eNB_generate_RRCConnectionSetup(
(fp->nb_antenna_ports_eNB==2)?2:1, //at this point we do not have the UE capability information, so it can only be TM1 or TM2
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
fp,
SRB_configList,
SRB_configList, //qui le mando come argomento puntatore di puntatore cos vengono configurate
&ue_context_pP->ue_context.physicalConfigDedicated);
#ifdef RRC_MSG_PRINT
......@@ -3769,6 +3771,7 @@ rrc_eNB_generate_RRCConnectionSetup(
if (*SRB_configList != NULL) {
for (cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) {
//sta lavorando solo con SRB1--> perch RRCConnectionSetup setta solo SRB1 (per NB_IoT??)
if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) {
SRB1_config = (*SRB_configList)->list.array[cnt];
......@@ -3776,7 +3779,8 @@ rrc_eNB_generate_RRCConnectionSetup(
if (SRB1_config->logicalChannelConfig->present ==
SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) {
SRB1_logicalChannelConfig = &SRB1_config->logicalChannelConfig->choice.explicitValue;
} else {
}
else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
} else {
......@@ -4128,6 +4132,10 @@ rrc_eNB_decode_ccch(
((rrcConnectionReestablishmentRequest->reestablishmentCause == ReestablishmentCause_otherFailure) ? "Other Failure" :
(rrcConnectionReestablishmentRequest->reestablishmentCause == ReestablishmentCause_handoverFailure) ? "Handover Failure" :
"reconfigurationFailure"));
//qui in realt andr gestita diversamente senza reject sempre
/*{
uint64_t c_rnti = 0;
......@@ -4147,6 +4155,7 @@ rrc_eNB_decode_ccch(
rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP,
rrc_eNB_get_ue_context(&eNB_rrc_inst[ctxt_pP->module_id], ctxt_pP->rnti),
CC_id);
break;
case UL_CCCH_MessageType__c1_PR_rrcConnectionRequest:
......@@ -4313,7 +4322,7 @@ rrc_eNB_decode_ccch(
Idx = DCCH;
// SRB1
ue_context_p->ue_context.Srb1.Active = 1;
ue_context_p->ue_context.Srb1.Srb_info.Srb_id = Idx;
ue_context_p->ue_context.Srb1.Srb_info.Srb_id = Idx; //module_id
memcpy(&ue_context_p->ue_context.Srb1.Srb_info.Lchan_desc[0],
&DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE);
......@@ -4321,7 +4330,7 @@ rrc_eNB_decode_ccch(
&DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE);
// SRB2: set it to go through SRB1 with id 1 (DCCH)
// SRB2: set it to go through SRB1 with id 1 (DCCH) ????
ue_context_p->ue_context.Srb2.Active = 1;
ue_context_p->ue_context.Srb2.Srb_info.Srb_id = Idx;
memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[0],
......
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