Commit f18e4009 authored by Navid Nikaein's avatar Navid Nikaein

* merge/add handover procedure for the access stratum (enabled with the -H), status: experimental.

* fix a bug in BSR computation
* add a python script to launch meld if the diff3 in subvsersion/config file is set to the targets/SCRIPTS/svn-merge-meld.py
* pre-ci passed (100%) 


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4309 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 84fb51d8
......@@ -9,6 +9,7 @@
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"
#include "MobilityControlInfo.h"
#else
/**
......@@ -121,6 +122,17 @@ void phy_config_sib2_ue(u8 Mod_id,u8 CH_index,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
/*!
\fn phy_config_afterHO_ue
\brief Configure Common PHY parameters from mobilityControlInfo
@param Mod_id
@param eNB_index
@param mobilityControlInfo pointer to the mobility control information for handover
@param ho_failed flag to indicated whether the ho was successful or not
*/
void phy_config_afterHO_ue(u8 Mod_id,u8 eNB_index,
MobilityControlInfo_t *mobilityControlInfo,u8 ho_failed);
/*!
\fn void phy_config_sib2_eNB(u8 Mod_id,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
......
......@@ -428,6 +428,118 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *phy_vars_eNB) {
}
}
/*
* Configures UE MAC and PHY with radioResourceCommon received in mobilityControlInfo IE during Handover
*/
void phy_config_afterHO_ue(u8 Mod_id,u8 eNB_id, MobilityControlInfo_t *mobilityControlInfo, u8 ho_failed) {
if(mobilityControlInfo!=NULL) {
RadioResourceConfigCommon_t *radioResourceConfigCommon = &mobilityControlInfo->radioResourceConfigCommon;
LOG_I(PHY,"radioResourceConfigCommon %p\n", radioResourceConfigCommon);
memcpy((void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms_before_ho,
(void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms,
sizeof(LTE_DL_FRAME_PARMS));
PHY_vars_UE_g[Mod_id]->ho_triggered = 1;
//PHY_vars_UE_g[UE_id]->UE_mode[0] = PRACH;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id]->lte_frame_parms;
int N_ZC;
u8 prach_fmt;
int u;
LOG_I(PHY,"[UE%d] Frame %d: Handover triggered: Applying radioResourceConfigCommon from eNB %d\n",
Mod_id,PHY_vars_UE_g[Mod_id]->frame,eNB_id);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
lte_frame_parms->prach_config_common.prach_Config_enabled=1;
lte_frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex;
lte_frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->highSpeedFlag;
lte_frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->zeroCorrelationZoneConfig;
lte_frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_FreqOffset;
prach_fmt = get_prach_fmt(radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex,lte_frame_parms->frame_type);
N_ZC = (prach_fmt <4)?839:139;
u = (prach_fmt < 4) ? prach_root_sequence_map0_3[lte_frame_parms->prach_config_common.rootSequenceIndex] :
prach_root_sequence_map4[lte_frame_parms->prach_config_common.rootSequenceIndex];
//compute_prach_seq(u,N_ZC, PHY_vars_UE_g[Mod_id]->X_u);
compute_prach_seq(&PHY_vars_UE_g[Mod_id]->lte_frame_parms.prach_config_common,
lte_frame_parms->frame_type,
PHY_vars_UE_g[Mod_id]->X_u);
lte_frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
lte_frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon->nRB_CQI;
lte_frame_parms->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon->nCS_AN;
lte_frame_parms->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon->n1PUCCH_AN;
lte_frame_parms->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon->referenceSignalPower;
lte_frame_parms->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon->p_b;
lte_frame_parms->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
lte_frame_parms->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
lte_frame_parms->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
lte_frame_parms->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
lte_frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
lte_frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
lte_frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
lte_frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift;
init_ul_hopping(lte_frame_parms);
lte_frame_parms->soundingrs_ul_config_common.enabled_flag = 0;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon->present==SoundingRS_UL_ConfigCommon_PR_setup) {
lte_frame_parms->soundingrs_ul_config_common.enabled_flag = 1;
lte_frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_BandwidthConfig;
lte_frame_parms->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
lte_frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.ackNackSRS_SimultaneousTransmission;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_MaxUpPts)
lte_frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 1;
else
lte_frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 0;
}
lte_frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUSCH;
lte_frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon->alpha;
lte_frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUCCH;
lte_frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaPreambleMsg3;
lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1;
lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1b;
lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2;
lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2a;
lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2b;
lte_frame_parms->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon->maxHARQ_Msg3Tx;
// Now configure some of the Physical Channels
if (radioResourceConfigCommon->antennaInfoCommon)
lte_frame_parms->nb_antennas_tx = (1<<radioResourceConfigCommon->antennaInfoCommon->antennaPortsCount);
else
lte_frame_parms->nb_antennas_tx = 1;
//PHICH
if (radioResourceConfigCommon->antennaInfoCommon) {
lte_frame_parms->phich_config_common.phich_resource = radioResourceConfigCommon->phich_Config->phich_Resource;
lte_frame_parms->phich_config_common.phich_duration = radioResourceConfigCommon->phich_Config->phich_Duration;
}
//Target CellId
lte_frame_parms->Nid_cell = mobilityControlInfo->targetPhysCellId;
lte_frame_parms->nushift = lte_frame_parms->Nid_cell%6;
// PUCCH
init_ncs_cell(lte_frame_parms,PHY_vars_UE_g[Mod_id]->ncs_cell);
init_ul_hopping(lte_frame_parms);
// RNTI
PHY_vars_UE_g[Mod_id]->lte_ue_pdcch_vars[eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8);
}
if(ho_failed) {
LOG_D(PHY,"[UE%d] Handover failed, triggering RACH procedure\n",Mod_id);
memcpy((void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms,(void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms_before_ho, sizeof(LTE_DL_FRAME_PARMS));
PHY_vars_UE_g[Mod_id]->UE_mode[eNB_id] = PRACH;
}
}
void phy_config_meas_ue(u8 Mod_id,u8 eNB_index,u8 n_adj_cells,unsigned int *adj_cell_id) {
......
......@@ -151,6 +151,13 @@ void lte_ue_measurements_emul(PHY_VARS_UE *phy_vars_ue,u8 last_slot,u8 eNB_id);
@returns Path loss in dB
*/
s16 get_PL(u8 Mod_id,u8 eNB_index);
u8 get_RSRP(u8 Mod_id,u8 eNB_index);
u8 get_RSRQ(u8 Mod_id,u8 eNB_index);
u8 get_n_adj_cells(u8 Mod_id);
s8 get_rx_total_gain_dB(u8 Mod_id);
s8 get_RSSI(u8 Mod_id);
s8 set_RSRP_filtered(u8 Mod_id,u8 eNB_index,float rsrp);
s8 set_RSRQ_filtered(u8 Mod_id,u8 eNB_index,float rstq);
//! Automatic gain control
void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
......
......@@ -68,6 +68,70 @@ s16 get_PL(u8 Mod_id,u8 eNB_index) {
phy_vars_ue->lte_frame_parms.pdsch_config_common.referenceSignalPower));
}
u8 get_n_adj_cells (u8 Mod_id){
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
if (phy_vars_ue)
return phy_vars_ue->PHY_measurements.n_adj_cells;
else
return 0;
}
s8 get_rx_total_gain_dB (u8 Mod_id){
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
if (phy_vars_ue)
return phy_vars_ue->rx_total_gain_dB;
else
return -1;
}
s8 get_RSSI (u8 Mod_id){
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
if (phy_vars_ue)
return phy_vars_ue->PHY_measurements.rssi;
else
return -1;
}
u8 get_RSRP(u8 Mod_id,u8 eNB_index) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
if (phy_vars_ue)
return phy_vars_ue->PHY_measurements.rsrp[eNB_index];
return 0;
}
u8 get_RSRQ(u8 Mod_id,u8 eNB_index) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
if (phy_vars_ue)
return phy_vars_ue->PHY_measurements.rsrq[eNB_index];
return 0;
}
s8 set_RSRP_filtered(u8 Mod_id,u8 eNB_index,float rsrp) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
if (phy_vars_ue){
phy_vars_ue->PHY_measurements.rsrp_filtered[eNB_index]=rsrp;
return 0;
}
LOG_W(PHY,"[UE%d] could not set the rsrp\n",Mod_id);
return -1;
}
s8 set_RSRQ_filtered(u8 Mod_id,u8 eNB_index,float rsrq) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
if (phy_vars_ue){
phy_vars_ue->PHY_measurements.rsrq_filtered[eNB_index]=rsrq;
return 0;
}
LOG_W(PHY,"[UE%d] could not set the rsrq\n",Mod_id);
return -1;
}
void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
u8 slot,
......@@ -202,21 +266,24 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
}
else { // Do abstraction of RSRP and RSRQ
phy_vars_ue->PHY_measurements.rssi = phy_vars_ue->PHY_measurements.rx_power_avg[0];
// dummay value for the moment
phy_vars_ue->PHY_measurements.rsrp[eNB_offset] = -93 ;
phy_vars_ue->PHY_measurements.rsrq[eNB_offset] = 3;
}
if (((phy_vars_ue->frame %10) == 0) && (slot == 1)) {
#ifdef DEBUG_MEAS
if (eNB_offset == 0)
if (eNB_offset == 0)
LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)\n",phy_vars_ue->Mod_id,
phy_vars_ue->frame,slot,10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rssi));
LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements (idx %d, Cell id %d) => rsrp: %3.1f (%3.1f) dBm, rsrq: %3.1f dB\n",
phy_vars_ue->Mod_id,
phy_vars_ue->frame,slot,eNB_offset,
(eNB_offset>0) ? phy_vars_ue->PHY_measurements.adj_cell_id[eNB_offset-1] : phy_vars_ue->lte_frame_parms.Nid_cell,
(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12),
(10*log10(phy_vars_ue->PHY_measurements.rx_power_avg[0])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12),
(10*log10(phy_vars_ue->PHY_measurements.rsrq[eNB_offset]))-20);
LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements (idx %d, Cell id %d) => rsrp: %3.1f (%3.1f) dBm, rsrq: %3.1f dB\n",
phy_vars_ue->Mod_id,
phy_vars_ue->frame,slot,eNB_offset,
(eNB_offset>0) ? phy_vars_ue->PHY_measurements.adj_cell_id[eNB_offset-1] : phy_vars_ue->lte_frame_parms.Nid_cell,
(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12),
(10*log10(phy_vars_ue->PHY_measurements.rx_power_avg[0])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12),
(10*log10(phy_vars_ue->PHY_measurements.rsrq[eNB_offset]))-20);
#endif
......
......@@ -331,8 +331,11 @@ typedef struct
s8 tx_power_max_dBm;
u32 frame;
u8 n_connected_eNB;
u8 ho_initiated;
u8 ho_triggered;
PHY_MEASUREMENTS PHY_measurements; /// Measurement variables
LTE_DL_FRAME_PARMS lte_frame_parms;
LTE_DL_FRAME_PARMS lte_frame_parms_before_ho; // frame parame before ho used to recover if ho fails
LTE_UE_COMMON lte_ue_common_vars;
LTE_UE_PDSCH *lte_ue_pdsch_vars[NUMBER_OF_CONNECTED_eNB_MAX+1];
......
......@@ -350,6 +350,8 @@ typedef struct
unsigned int adj_cell_id[6];
int rsrq[7];
int rsrp[7];
float rsrp_filtered[7]; // after layer 3 filtering
float rsrq_filtered[7];
// common measurements
//! estimated noise power (linear)
unsigned int n0_power[NB_ANTENNAS_RX];
......
......@@ -401,6 +401,9 @@ s32 remove_ue(u16 rnti, PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag);
void process_timing_advance(u8 Mod_id,s16 timing_advance);
void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,u16 timing_advance);
unsigned int get_tx_amp(int gain_dBm, int gain_max_dBm);
void phy_reset_ue(u8 Mod_id,u8 eNB_index);
/** \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in
subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For
......
......@@ -2829,9 +2829,11 @@ void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8
LOG_I(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:\n",phy_vars_eNB->frame,last_slot>>1,
harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++)
LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]);
LOG_T(PHY,"\n");
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0]!=NULL){
for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++)
LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]);
LOG_T(PHY,"\n");
}
//dump_ulsch(phy_vars_eNB, last_slot>>1, i);
......
......@@ -248,6 +248,39 @@ void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 subframe) {
}
#endif
void phy_reset_ue(u8 Mod_id,u8 eNB_index) {
// This flushes ALL DLSCH and ULSCH harq buffers of ALL connected eNBs...add the eNB_index later
// for more flexibility
u8 i,j,k;
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
//[NUMBER_OF_CONNECTED_eNB_MAX][2];
for(i=0;i<NUMBER_OF_CONNECTED_eNB_MAX;i++) {
for(j=0;j<2;j++) {
//DL HARQ
if(phy_vars_ue->dlsch_ue[i][j]) {
for(k=0;k<NUMBER_OF_HARQ_PID_MAX && phy_vars_ue->dlsch_ue[i][j]->harq_processes[k];k++) {
phy_vars_ue->dlsch_ue[i][j]->harq_processes[k]->status = SCH_IDLE;
}
}
}
//UL HARQ
if(phy_vars_ue->ulsch_ue[i]) {
for(k=0;k<NUMBER_OF_HARQ_PID_MAX && phy_vars_ue->ulsch_ue[i]->harq_processes[k];k++) {
phy_vars_ue->ulsch_ue[i]->harq_processes[k]->status = SCH_IDLE;
//Set NDIs for all UL HARQs to 0
phy_vars_ue->ulsch_ue[i]->harq_processes[k]->Ndi = 0;
}
}
// flush Msg3 buffer
phy_vars_ue->ulsch_ue_Msg3_active[i] = 0;
}
}
void ra_failed(u8 Mod_id,u8 eNB_index) {
// if contention resolution fails, go back to PRACH
......@@ -3194,6 +3227,10 @@ int phy_procedures_RN_UE_RX(u8 last_slot, u8 next_slot, relaying_type_t r_type)
phy_vars_ue->UE_mode[eNB_id] = RESYNCH;
mac_xface->macphy_exit("Connection lost");
//exit(-1);
} else if (ret == PHY_HO_PRACH) {
LOG_I(PHY,"[UE %d] Frame %d, subframe %d, return to PRACH and perform a contention-free access\n",
phy_vars_ue->Mod_id,phy_vars_ue->frame,next_slot>>1);
phy_vars_ue->UE_mode[eNB_id] = PRACH;
}
}
#endif
......
......@@ -81,7 +81,9 @@ result could be based on an event-driven measurement report.
typedef enum {
RRC_OK=0,
RRC_ConnSetup_failed,
RRC_PHY_RESYNCH
RRC_PHY_RESYNCH,
RRC_Handover_failed,
RRC_HO_STARTED
} RRC_status_t;
......
This diff is collapsed.
......@@ -59,6 +59,7 @@
#include "TDD-Config.h"
#include "RACH-ConfigCommon.h"
#include "MeasObjectToAddModList.h"
#include "MobilityControlInfo.h"
#ifdef Rel10
#include "MBSFN-AreaInfoList-r9.h"
#include "MBSFN-SubframeConfigList.h"
......@@ -139,7 +140,8 @@
typedef enum {
CONNECTION_OK=0,
CONNECTION_LOST,
PHY_RESYNCH
PHY_RESYNCH,
PHY_HO_PRACH
} UE_L2_STATE_t;
typedef struct {
......@@ -713,6 +715,8 @@ typedef struct{
uint8_t ul_active;
/// pointer to RRC PHY configuration
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon;
/// pointer to RACH_ConfigDedicated (NULL when not active, i.e. upon HO completion or T304 expiry)
struct RACH_ConfigDedicated *rach_ConfigDedicated;
/// pointer to RRC PHY configuration
struct PhysicalConfigDedicated *physicalConfigDedicated;
/// pointer to TDD Configuration (NULL for FDD)
......@@ -839,6 +843,7 @@ unsigned char generate_dlsch_header(unsigned char *mac_header,
@param logicalChannelConfig Pointer to logical channel configuration
@param measGapConfig Measurement Gap configuration for MAC (if NULL keep existing configuration)
@param tdd_Config TDD Configuration from SIB1 (if NULL keep existing configuration)
@param mobilityControlInfo mobility control info received for Handover
@param SIwindowsize SI Windowsize from SIB1 (if NULL keep existing configuration)
@param SIperiod SI Period from SIB1 (if NULL keep existing configuration)
@param MBMS_Flag indicates MBMS transmission
......@@ -855,6 +860,7 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
MobilityControlInfo_t *mobilityControlInfo,
u8 *SIwindowsize,
u16 *SIperiod,
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
......@@ -985,11 +991,11 @@ s8 get_deltaP_rampup(u8 Mod_id);
//main.c
void chbch_phy_sync_success(u8 Mod_id,u32 frame,u8 CH_index);
void chbch_phy_sync_success(u8 Mod_id,u32 frame,u8 eNB_index);
void mrbch_phy_sync_failure(u8 Mod_id, u32 frame,u8 free_eNB_index);
int mac_top_init(int eMBMS_active, u8 cba_group_active);
int mac_top_init(int eMBMS_active, u8 cba_group_active, u8 HO_active);
char layer2_init_UE(u8 Mod_id);
......@@ -1001,7 +1007,7 @@ int mac_init_global_param(void);
void mac_top_cleanup(void);
void mac_UE_out_of_sync_ind(u8 Mod_id,u32 frame, u16 CH_index);
void mac_UE_out_of_sync_ind(u8 Mod_id,u32 frame, u16 eNB_index);
// eNB functions
......@@ -1106,8 +1112,8 @@ void UpdateSBnumber(unsigned char Mod_id);
//end ALU's algo
void ue_mac_reset(u8 Mod_id,u8 eNB_index);
void ue_init_mac(u8 Mod_id);
void init_ue_sched_info(void);
void add_ue_ulsch_info(u8 Mod_id, u8 UE_id, u8 subframe,UE_ULSCH_STATUS status);
void add_ue_dlsch_info(u8 Mod_id, u8 UE_id, u8 subframe,UE_DLSCH_STATUS status);
......@@ -1270,9 +1276,8 @@ u8 *parse_ulsch_header(u8 *mac_header,
u16 tx_lenght);
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_active);
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_active, u8 HO_active);
int mac_init(void);
void ue_init_mac(void);
s8 add_new_ue(u8 Mod_id, u16 rnti);
s8 mac_remove_ue(u8 Mod_id, u8 UE_id);
......
......@@ -4296,6 +4296,12 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf
#endif
#ifdef CELLULAR
rrc_rx_tx(Mod_id, frame, 0, 0);
#else
// check HO
rrc_rx_tx(Mod_id,
frame,
1,
Mod_id);
#endif
#ifdef Rel10
......
......@@ -97,6 +97,9 @@ void mrbch_phy_sync_failure(u8 Mod_id, u32 frame, u8 free_eNB_index){//init as C
layer2_init_eNB(Mod_id, free_eNB_index);
openair_rrc_eNB_init(Mod_id);
}
char layer2_init_eNB(unsigned char Mod_id, unsigned char eNB_index){
......@@ -120,7 +123,7 @@ void mac_UE_out_of_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index){
/***********************************************************************/
int mac_top_init(int eMBMS_active, u8 cba_group_active){
int mac_top_init(int eMBMS_active, u8 cba_group_active, u8 HO_active){
/***********************************************************************/
unsigned char Mod_id,i,j;
RA_TEMPLATE *RA_template;
......@@ -135,8 +138,11 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for UEs \n");
}
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d UE_MAC_INST @ %p\n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,UE_mac_inst);
bzero(UE_mac_inst,NB_UE_INST*sizeof(UE_MAC_INST));
ue_init_mac();
for(i=0;i<NB_UE_INST; i++)
ue_init_mac(i);
}
else
UE_mac_inst = NULL;
......@@ -172,7 +178,7 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){
if (Is_rrc_registered == 1){
LOG_I(MAC,"[MAIN] calling RRC\n");
#ifndef CELLULAR //nothing to be done yet for cellular
openair_rrc_top_init(eMBMS_active, cba_group_active);
openair_rrc_top_init(eMBMS_active, cba_group_active,HO_active);
#endif
}
else {
......@@ -287,6 +293,7 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){
//ICIC init param
#ifdef ICIC
u8 SB_size;
SB_size=mac_xface->get_SB_size(mac_xface->lte_frame_parms->N_RB_DL);
srand (time(NULL));
......@@ -388,7 +395,7 @@ void mac_top_cleanup(void){
free( Mac_rlc_xface);
}
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_active) {
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_active, u8 HO_active) {
......@@ -447,6 +454,11 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_activ
mac_xface->get_ue_active_harq_pid = get_ue_active_harq_pid;
mac_xface->get_PL = get_PL;
mac_xface->get_RSRP = get_RSRP;
mac_xface->get_RSRQ = get_RSRQ;
mac_xface->get_RSSI = get_RSSI;
mac_xface->get_n_adj_cells = get_n_adj_cells;
mac_xface->get_rx_total_gain_dB = get_rx_total_gain_dB;
mac_xface->get_Po_NOMINAL_PUSCH = get_Po_NOMINAL_PUSCH;
mac_xface->get_num_prach_tdd = get_num_prach_tdd;
mac_xface->get_fid_prach_tdd = get_fid_prach_tdd;
......@@ -461,7 +473,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_activ
mac_xface->phy_config_sib2_eNB = phy_config_sib2_eNB;
mac_xface->phy_config_sib2_ue = phy_config_sib2_ue;
mac_xface->phy_config_afterHO_ue = phy_config_afterHO_ue;
#ifdef Rel10
mac_xface->phy_config_sib13_eNB = phy_config_sib13_eNB;
mac_xface->phy_config_sib13_ue = phy_config_sib13_ue;
......@@ -470,6 +482,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_activ
mac_xface->phy_config_cba_rnti = phy_config_cba_rnti ;
#endif
mac_xface->phy_config_meas_ue = phy_config_meas_ue;
mac_xface->phy_reset_ue = phy_reset_ue;
mac_xface->phy_config_dedicated_eNB = phy_config_dedicated_eNB;
mac_xface->phy_config_dedicated_ue = phy_config_dedicated_ue;
......@@ -481,7 +494,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_activ
mac_xface->get_PHR = get_PHR;
LOG_D(MAC,"[MAIN] ALL INIT OK\n");
mac_xface->macphy_init(eMBMS_active,cba_group_active);
mac_xface->macphy_init(eMBMS_active,cba_group_active,HO_active);
//Mac_rlc_xface->Is_cluster_head[0] = 1;
//Mac_rlc_xface->Is_cluster_head[1] = 0;
......
......@@ -89,43 +89,42 @@ mapping BSR_names[] = {
extern inline unsigned int taus(void);
void ue_init_mac(){
int i,j;
for (i=0 ; i < NB_UE_INST; i++){
// default values as deined in 36.331 sec 9.2.2
LOG_I(MAC,"[UE%d] Applying default macMainConfig\n",i);
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_UE][MOD %02d][]\n", i+NB_eNB_INST);
//UE_mac_inst[Mod_id].scheduling_info.macConfig=NULL;
UE_mac_inst[i].scheduling_info.retxBSR_Timer= MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
UE_mac_inst[i].scheduling_info.periodicBSR_Timer=MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
UE_mac_inst[i].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
UE_mac_inst[i].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
UE_mac_inst[i].scheduling_info.PathlossChange_db = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
UE_mac_inst[i].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
UE_mac_inst[i].scheduling_info.SR_COUNTER=0;
UE_mac_inst[i].scheduling_info.sr_ProhibitTimer=0;
UE_mac_inst[i].scheduling_info.sr_ProhibitTimer_Running=0;
UE_mac_inst[i].scheduling_info.maxHARQ_Tx=MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
UE_mac_inst[i].scheduling_info.ttiBundling=0;
UE_mac_inst[i].scheduling_info.drx_config=NULL;
UE_mac_inst[i].scheduling_info.phr_config=NULL;
UE_mac_inst[i].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[i].scheduling_info.periodicBSR_Timer);
UE_mac_inst[i].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[i].scheduling_info.retxBSR_Timer);
UE_mac_inst[i].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[i].scheduling_info.periodicPHR_Timer);
UE_mac_inst[i].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[i].scheduling_info.prohibitPHR_Timer);
UE_mac_inst[i].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[i].scheduling_info.PathlossChange);
for (j=0; j < MAX_NUM_LCID; j++){
LOG_D(MAC,"[UE%d] Applying default logical channel config for LCGID %d\n",i,j);
UE_mac_inst[i].scheduling_info.Bj[j]=-1;
UE_mac_inst[i].scheduling_info.bucket_size[j]=-1;
if (j < DTCH) // initilize all control channels lcgid to 0
UE_mac_inst[i].scheduling_info.LCGID[j]=0;
else // initialize all the data channels lcgid to 1
UE_mac_inst[i].scheduling_info.LCGID[j]=1;
UE_mac_inst[i].scheduling_info.LCID_status[j]=0;
}
void ue_init_mac(u8 Mod_id){
int i;
// default values as deined in 36.331 sec 9.2.2
LOG_I(MAC,"[UE%d] Applying default macMainConfig\n",Mod_id);
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_UE][MOD %02d][]\n", Mod_id+NB_eNB_INST);
//UE_mac_inst[Mod_id].scheduling_info.macConfig=NULL;
UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer= MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer=MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
UE_mac_inst[Mod_id].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
UE_mac_inst[Mod_id].scheduling_info.SR_COUNTER=0;
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer=0;
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer_Running=0;
UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx=MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
UE_mac_inst[Mod_id].scheduling_info.ttiBundling=0;
UE_mac_inst[Mod_id].scheduling_info.drx_config=NULL;
UE_mac_inst[Mod_id].scheduling_info.phr_config=NULL;
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer);
UE_mac_inst[Mod_id].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer);
UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer);
UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer);
UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_id].scheduling_info.PathlossChange);
for (i=0; i < MAX_NUM_LCID; i++){
LOG_D(MAC,"[UE%d] Applying default logical channel config for LCGID %d\n",Mod_id,i);
UE_mac_inst[Mod_id].scheduling_info.Bj[i]=-1;
UE_mac_inst[Mod_id].scheduling_info.bucket_size[i]=-1;
if (i < DTCH) // initilize all control channels lcgid to 0
UE_mac_inst[Mod_id].scheduling_info.LCGID[i]=0;
else // initialize all the data channels lcgid to 1
UE_mac_inst[Mod_id].scheduling_info.LCGID[i]=1;
UE_mac_inst[Mod_id].scheduling_info.LCID_status[i]=0;
}
}
......@@ -1366,6 +1365,15 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire
case RRC_PHY_RESYNCH:
LOG_E(MAC,"RRC Loss of synch, returning PHY_RESYNCH\n");
return(PHY_RESYNCH);
case RRC_Handover_failed:
LOG_D(MAC,"Handover failure for UE %d eNB_index %d\n",Mod_id,eNB_index);
//Invalid...need to add another MAC UE state for re-connection procedure
mac_xface->phy_config_afterHO_ue(Mod_id,eNB_index,(MobilityControlInfo_t *)NULL,1);
//return(3);
break;
case RRC_HO_STARTED:
LOG_I(MAC,"RRC handover, Instruct PHY to start the contention-free PRACH and synchronization\n");
return(PHY_HO_PRACH);
default:
break;
}
......@@ -1402,7 +1410,7 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire
// Put this in another function
// Get RLC status info and update Bj for all lcids that are active
for (lcid=CCCH; lcid <= DTCH; lcid++ ) {
for (lcid=DCCH; lcid <= DTCH; lcid++ ) {
if ((lcid == 0) ||(UE_mac_inst[Mod_id].logicalChannelConfig[lcid])) {
// meausre the Bj
if ((direction == SF_UL)&& (UE_mac_inst[Mod_id].scheduling_info.Bj[lcid] >= 0)){
......@@ -1573,9 +1581,11 @@ int update_bsr(u8 Mod_id, u32 frame, u8 lcid, u8 lcg_id){
u8 sr_pending = 0;
if ((lcg_id < 0) || (lcg_id > MAX_NUM_LCGID) )
return sr_pending;
UE_mac_inst[Mod_id].scheduling_info.BSR[lcg_id]=0;
UE_mac_inst[Mod_id].scheduling_info.BSR_bytes[lcg_id]=0;
// fixme: need a better way to reset
if ((lcid == DCCH) || (lcid == DTCH)){
UE_mac_inst[Mod_id].scheduling_info.BSR[lcg_id]=0;
UE_mac_inst[Mod_id].scheduling_info.BSR_bytes[lcg_id]=0;
}
// for (lcid =0 ; lcid < MAX_NUM_LCID; lcid++) {
if (UE_mac_inst[Mod_id].scheduling_info.LCGID[lcid] == lcg_id) {
rlc_status = mac_rlc_status_ind(Mod_id+NB_eNB_INST,frame,0,RLC_MBMS_NO,
......@@ -1587,13 +1597,13 @@ int update_bsr(u8 Mod_id, u32 frame, u8 lcid, u8 lcg_id){
UE_mac_inst[Mod_id].scheduling_info.BSR[lcg_id] += locate (BSR_TABLE,BSR_TABLE_SIZE, rlc_status.bytes_in_buffer);
UE_mac_inst[Mod_id].scheduling_info.BSR_bytes[lcg_id] += rlc_status.bytes_in_buffer;
// UE_mac_inst[Mod_id].scheduling_info.BSR_short_lcid = lcid; // only applicable to short bsr
LOG_D(MAC,"[UE %d] BSR level %d (LCGID %d, rlc buffer %d byte)\n",
Mod_id, UE_mac_inst[Mod_id].scheduling_info.BSR[lcg_id],lcg_id, UE_mac_inst[Mod_id].scheduling_info.BSR_bytes[lcg_id]);
}
else
UE_mac_inst[Mod_id].scheduling_info.LCID_status[lcid]=LCID_EMPTY;
}
//}
//LOG_D(MAC,"[UE %d] BSR level %d (LCGID %d, rlc buffer %d byte)\n",
// Mod_id, UE_mac_inst[Mod_id].scheduling_info.BSR[lcg_id],lcg_id, UE_mac_inst[Mod_id].scheduling_info.BSR_bytes[lcg_id]);
return sr_pending;
}
......
......@@ -31,6 +31,7 @@
* \author Raymond Knopp, Navid Nikaein
* \date 2012
* \version 1.0
* \email navid.nikaein@eurecom.fr
* @ingroup _mac
*/
......@@ -91,6 +92,7 @@ DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
#ifdef Rel10
DCI1C_5MHz_t MCCH_alloc_pdu;
#endif
......
......@@ -733,7 +733,7 @@ BOOL rrc_pdcp_config_asn1_req (module_id_t module_id, u32_t frame, u8_t eNB_flag
}
if (drb2release_list != NULL) {
for (cnt=0;cnt<drb2add_list->list.count;cnt++) {
for (cnt=0;cnt<drb2release_list->list.count;cnt++) {
pdrb_id = drb2release_list->list.array[cnt];
rb_id = (index * NB_RB_MAX) + *pdrb_id;
action = ACTION_REMOVE;
......
......@@ -256,10 +256,10 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t module_idP, u32_t frameP, u
}
}
if (drb2release_listP != NULL) {
for (cnt=0;cnt<drb2add_listP->list.count;cnt++) {
pdrb_id = drb2release_listP->list.array[cnt];
rrc_rlc_remove_rlc(module_idP, (UE_index * NB_RB_MAX) + *pdrb_id, frameP);
}
for (cnt=0;cnt<drb2release_listP->list.count;cnt++) {
pdrb_id = drb2release_listP->list.array[cnt];
rrc_rlc_remove_rlc(module_idP, (UE_index * NB_RB_MAX) + *pdrb_id, frameP);
}
}
......
......@@ -31,6 +31,7 @@
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 0.5
* \mail navid.nikaein@eurecom.fr or openair_tech@eurecom.fr
* @ingroup _mac
*/
......@@ -57,7 +58,7 @@
typedef struct
{
/// Pointer function that initializes L2
int (*macphy_init)(int eMBMS_active, u8 CBA_enabled);
int (*macphy_init)(int eMBMS_active, u8 CBA_active,u8 HO_active);
/// Pointer function that stops the low-level scheduler due an exit condition
void (*macphy_exit)(const char *);
......@@ -112,7 +113,7 @@ typedef struct
void (*phy_config_sib13_eNB)(u8 Mod_id,int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
#endif
/// PHY-Config-Dedicated eNB
void (*phy_config_dedicated_eNB)(u8 Mod_id,u16 rnti,
struct PhysicalConfigDedicated *physicalConfigDedicated);
......@@ -124,8 +125,11 @@ typedef struct
// configure the cba rnti at the physical layer
void (*phy_config_cba_rnti)(u8 Mod_id,u8 eNB_flag, u8 index, u16 cba_rnti, u8 cba_group_id, u8 num_active_cba_groups);
// UE functions
/// UE functions
/// reset the ue phy
void (*phy_reset_ue)(u8 Mod_id,u8 eNB_index);
/// Indicate loss of synchronization of PBCH for this eNB to MAC layer
void (*out_of_sync_ind)(u8 Mod_id,u32 frame,u16 eNB_index);
......@@ -185,6 +189,10 @@ typedef struct
void (*phy_config_sib13_ue)(u8 Mod_id,u8 CH_index,int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
#endif
/// Configure Common PHY parameters from mobilityControlInfo
void (*phy_config_afterHO_ue)(u8 Mod_id,u8 CH_index,
MobilityControlInfo_t *mobilityControlInfo,
u8 ho_failed);
/// Function to indicate failure of contention resolution or RA procedure
void (*ra_failed)(u8 Mod_id,u8 eNB_index);
......@@ -233,11 +241,26 @@ typedef struct
/// Function for UE MAC to retrieve measured Path Loss
s16 (*get_PL)(u8 Mod_id,u8 eNB_index);
/// Function for UE MAC to retrieve the rssi
u8 (*get_RSSI)(u8 Mod_id);
/// Function for UE MAC to retrieve the total gain
u8 (*get_rx_total_gain_dB)(u8 Mod_id);
/// Function for UE MAC to retrieve the number of adjustent cells
u8 (*get_n_adj_cells)(u8 Mod_id);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
u8* (*get_RSRP)(u8 Mod_id,u8 eNB_index);
u8 (*get_RSRP)(u8 Mod_id,u8 eNB_index);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
u8* (*get_RSRQ)(u8 Mod_id,u8 eNB_index);
u8 (*get_RSRQ)(u8 Mod_id,u8 eNB_index);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
u8 (*set_RSRP_filtered)(u8 Mod_id,u8 eNB_index,float rsrp);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
u8 (*set_RSRQ_filtered)(u8 Mod_id,u8 eNB_index,float rsrq);
/// Function for UE/eNB MAC to retrieve number of PRACH in TDD
u8 (*get_num_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms);
......
......@@ -514,9 +514,9 @@ void rrc_lite_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u32 sdu_si
u8 DCCH_index = Srb_id % NB_RB_MAX;
LOG_N(RRC,"[%s %d] Frame %d: received a DCCH %d message on SRB %d with Size %d\n",
(eNB_flag == 1)? "eNB": "UE",
(eNB_flag == 1)? Mod_id : UE_index,
frame, DCCH_index,Srb_id-1,sdu_size);
(eNB_flag == 1)? "eNB": "UE",
(eNB_flag == 1)? Mod_id : UE_index,
frame, DCCH_index,Srb_id-1,sdu_size);
#if defined(ENABLE_ITTI)
{
......
This diff is collapsed.
/*******************************************************************************
Eurecom OpenAirInterface 2
Copyright(c) 1999 - 2010 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/*! \file asn1_msg.h
* \brief primitives to build the asn1 messages
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 1.0
* \company Eurecom
* \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr
*/
#ifdef USER_MODE
#include <stdio.h>
#include <sys/types.h>
......@@ -105,6 +143,8 @@ uint8_t do_RRCConnectionSetup(uint8_t *buffer,
@param ReportConfig_list Pointer to ReportConfig List (NULL if no additions/modifications)
@param QuantityConfig Pointer to QuantityConfig to be modified (NULL if no modifications)
@param MeasId_list Pointer to MeasID List (NULL if no additions/modifications)
@param mobilityInfo mobility control information for handover
@param speedStatePars speed state parameteres for handover
@param mac_MainConfig Pointer to Mac_MainConfig(NULL if no modifications)
@param measGapConfig Pointer to MeasGapConfig (NULL if no modifications)
@param cba_rnti RNTI for the cba transmission
......@@ -121,11 +161,14 @@ uint8_t do_RRCConnectionReconfiguration(uint8_t Mod_id
struct PhysicalConfigDedicated *physicalConfigDedicated,
MeasObjectToAddModList_t *MeasObj_list,
ReportConfigToAddModList_t *ReportConfig_list,
QuantityConfig_t *QuantityConfig,
QuantityConfig_t *quantityConfig,
MeasIdToAddModList_t *MeasId_list,
MAC_MainConfig_t *mac_MainConfig,
MeasGapConfig_t *measGapConfig,
C_RNTI_t *cba_rnti,
MobilityControlInfo_t *mobilityInfo,
struct MeasConfig__speedStatePars *speedStatePars,
RSRP_Range_t *rsrp,
C_RNTI_t *cba_rnti,
uint8_t *nas_pdu,
uint32_t nas_length);
......
This diff is collapsed.
/*________________________openair_rrc_extern.h________________________
/*******************************************************************************
Authors : Hicham Anouar
Company : EURECOM
Emails : anouar@eurecom.fr
________________________________________________________________*/
Eurecom OpenAirInterface 2
Copyright(c) 1999 - 2010 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/*! \file vars.hles
* \brief rrc variab
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
#ifndef __OPENAIR_RRC_EXTERN_H__
#define __OPENAIR_RRC_EXTERN_H__
......@@ -63,6 +94,16 @@ extern u16 RACH_FREQ_ALLOC;
extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER;
extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG;
extern u16 T300[8];
extern u16 T310[8];
extern u16 N310[8];
extern u16 N311[8];
extern u32 T304[8];
extern u32 timeToTrigger_ms[16];
extern float RSRP_meas_mapping[100];
extern float RSRQ_meas_mapping[33];
#endif
This diff is collapsed.
......@@ -51,6 +51,8 @@
extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
extern mui_t rrc_eNB_mui;
//configure BCCH & CCCH Logical Channels and associated rrc_buffers, configure associated SRBs
void openair_rrc_on(u8 Mod_id, u8 eNB_flag) {
unsigned short i;
......@@ -203,7 +205,7 @@ void rrc_config_buffer(SRB_INFO *Srb_info, u8 Lchan_type, u8 Role) {
}
/*------------------------------------------------------------------------------*/
void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active) {
void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active,u8 HO_active){
/*-----------------------------------------------------------------------------*/
int i;
......@@ -241,6 +243,10 @@ void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active) {
if (NB_eNB_INST > 0) {
eNB_rrc_inst = (eNB_RRC_INST*) malloc16(NB_eNB_INST*sizeof(eNB_RRC_INST));
memset (eNB_rrc_inst, 0, NB_eNB_INST * sizeof(eNB_RRC_INST));
LOG_I(RRC,"[eNB] handover active state is %d \n", HO_active);
for (i=0;i<NB_eNB_INST;i++) {
eNB_rrc_inst[i].HO_flag = (uint8_t)HO_active;
}
#ifdef Rel10
LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
for (i=0;i<NB_eNB_INST;i++) {
......@@ -280,14 +286,6 @@ void rrc_top_cleanup(void) {
}
u16 T300[8] =
{100, 200, 300, 400, 600, 1000, 1500, 2000};
u16 T310[8] =
{0, 50, 100, 200, 500, 1000, 2000};
u16 N310[8] =
{1, 2, 3, 4, 6, 8, 10, 20};
u16 N311[8] =
{1, 2, 3, 4, 6, 8, 10, 20};
void rrc_t310_expiration(u32 frame, u8 Mod_id, u8 eNB_index) {
......@@ -319,9 +317,9 @@ void rrc_t310_expiration(u32 frame, u8 Mod_id, u8 eNB_index) {
}
}
RRC_status_t rrc_rx_tx(u8 Mod_id, u32 frame, u8 eNB_flag, u8 index) {
if (eNB_flag == 0) {
RRC_status_t rrc_rx_tx(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index){
if(eNB_flag == 0) {
// check timers
if (UE_rrc_inst[Mod_id].Info[index].T300_active == 1) {
......@@ -350,7 +348,6 @@ RRC_status_t rrc_rx_tx(u8 Mod_id, u32 frame, u8 eNB_flag, u8 index) {
return RRC_PHY_RESYNCH;
}
}
if (UE_rrc_inst[Mod_id].Info[index].T310_active == 1) {
if (UE_rrc_inst[Mod_id].Info[index].N311_cnt
== N311[UE_rrc_inst[Mod_id].sib2[index]->ue_TimersAndConstants.n311]) {
......@@ -367,7 +364,93 @@ RRC_status_t rrc_rx_tx(u8 Mod_id, u32 frame, u8 eNB_flag, u8 index) {
}
UE_rrc_inst[Mod_id].Info[index].T310_cnt++;
}
}
if (UE_rrc_inst[Mod_id].Info[index].T304_active==1) {
if ((UE_rrc_inst[Mod_id].Info[index].T304_cnt % 10) == 0)
LOG_D(RRC,"[UE %d][RAPROC] Frame %d T304 Count %d ms\n",Mod_id,frame,
UE_rrc_inst[Mod_id].Info[index].T304_cnt);
if (UE_rrc_inst[Mod_id].Info[index].T304_cnt == 0) {
UE_rrc_inst[Mod_id].Info[index].T304_active = 0;
UE_rrc_inst[Mod_id].HandoverInfoUe.measFlag = 1;
LOG_E(RRC,"[UE %d] Handover failure..initiating connection re-establishment procedure... \n");
//Implement 36.331, section 5.3.5.6 here
return(RRC_Handover_failed);
}
UE_rrc_inst[Mod_id].Info[index].T304_cnt--;
}
// Layer 3 filtering of RRC measurements
if (UE_rrc_inst[Mod_id].QuantityConfig[0] != NULL) {
ue_meas_filtering(Mod_id,frame,index);
}
ue_measurement_report_triggering(Mod_id,frame,index);
if (UE_rrc_inst[Mod_id].Info[0].handoverTarget > 0)
LOG_I(RRC,"[UE %d] Frame %d : RRC handover initiated\n", Mod_id, frame);
if((UE_rrc_inst[Mod_id].Info[index].State == RRC_HO_EXECUTION) &&
(UE_rrc_inst[Mod_id].HandoverInfoUe.targetCellId != 0xFF)) {
UE_rrc_inst[Mod_id].Info[index].State= RRC_IDLE;
return(RRC_HO_STARTED);
}
}
else {
check_handovers(Mod_id,frame);
}
return (RRC_OK);
}
long binary_search_int(int elements[], long numElem, int value) {
long first, last, middle, search;
first = 0;
last = numElem-1;
middle = (first+last)/2;
if(value < elements[0])
return first;
if(value > elements[last])
return last;
while (first <= last) {
if (elements[middle] < value)
first = middle+1;
else if (elements[middle] == value) {
search = middle+1;
break;
}
else
last = middle -1;
middle = (first+last)/2;
}
if (first > last)
LOG_E(RRC,"Error in binary search!");
return search;
}
/* This is a binary search routine which operates on an array of floating
point numbers and returns the index of the range the value lies in
Used for RSRP and RSRQ measurement mapping. Can potentially be used for other things
*/
long binary_search_float(float elements[], long numElem, float value) {
long first, last, middle, search;
first = 0;
last = numElem-1;
middle = (first+last)/2;
if(value <= elements[0])
return first;
if(value >= elements[last])
return last;
while (last - first > 1) {
if (elements[middle] > value)
last = middle;
else
first = middle;
middle = (first+last)/2;
}
if (first < 0 || first >= numElem)
LOG_E(RRC,"\n Error in binary search float!");
return first;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/*________________________openair_rrc_vars.h________________________
/*******************************************************************************
Authors : Hicham Anouar
Company : EURECOM
Emails : anouar@eurecom.fr
________________________________________________________________*/
Eurecom OpenAirInterface 2
Copyright(c) 1999 - 2010 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/*! \file vars.hles
* \brief rrc variables
* \author Raymond Knopp and Navid Nikaein
* \date 2013
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
#ifndef __OPENAIR_RRC_VARS_H__
......@@ -38,6 +69,8 @@ unsigned short Header_read_idx,Data_read_idx,Header_size;
unsigned short Data_to_read;
#endif //NO_RRM
#define MAX_U32 0xFFFFFFFF
u8 DRB2LCHAN[8];
long logicalChannelGroup0 = 0;
......@@ -66,7 +99,7 @@ LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {&LCSRB2
,
&logicalChannelSR_Mask_r9
#endif
};
};
//CONSTANTS
rlc_info_t Rlc_info_um,Rlc_info_am_config;
......@@ -75,4 +108,152 @@ u16 RACH_FREQ_ALLOC;
LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER;
MAC_AVG_T BCCH_MEAS_AVG, CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG;
// timers
u16 T300[8] = {100,200,300,400,600,1000,1500,2000};
u16 T310[8] = {0,50,100,200,500,1000,2000};
u16 N310[8] = {1,2,3,4,6,8,10,20};
u16 N311[8] = {1,2,3,4,6,8,10,20};
u32 T304[8] = {50,100,150,200,500,1000,2000,MAX_U32};
// TimeToTrigger enum mapping table (36.331 TimeToTrigger IE)
u32 timeToTrigger_ms[16] = {0,40,64,80,100,128,160,256,320,480,512,640,1024,1280,2560,5120};
/* 36.133 Section 9.1.4 RSRP Measurement Report Mapping, Table: 9.1.4-1 */
float RSRP_meas_mapping[100] = {
-140,
-139,
-138,
-137,
-136,
-135,
-134,
-133,
-132,
-131,
-130,
-129,
-128,
-127,
-126,
-125,
-124,
-123,
-122,
-121,
-120,
-119,
-118,
-117,
-116,
-115,
-114,
-113,
-112,
-111,
-110,
-109,
-108,
-107,
-106,
-105,
-104,
-103,
-102,
-101,
-100,
-99,
-98,
-97,
-96,
-95,
-94,
-93,
-92,
-91,
-90,
-89,
-88,
-87,
-86,
-85,
-84,
-83,
-82,
-81,
-80,
-79,
-78,
-77,
-76,
-75,
-74,
-73,
-72,
-71,
-70,
-69,
-68,
-67,
-66,
-65,
-64,
-63,
-62,
-61,
-60,
-59,
-58,
-57,
-56,
-55,
-54,
-53,
-52,
-51,
-50,
-49,
-48,
-47,
-46,
-45,
-44
};
float RSRQ_meas_mapping[33] = {
-19,
-18.5,
-18,
-17.5,
-17,
-16.5,
-16,
-15.5,
-15,
-14.5,
-14,
-13.5,
-13,
-12.5,
-12,
-11.5,
-11,
-10.5,
-10,
-9.5,
-9,
-8.5,
-8,
-7.5,
-7,
-6.5,
-6,
-5.5,
-5,
-4.5,
-4,
-3.5,
-3
};
#endif
......@@ -661,6 +661,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
unsigned char vcd_enabled;
unsigned char eMBMS_active_state;
unsigned char cba_group_active;
unsigned char handover_active;
char * otg_traffic;
unsigned char otg_bg_traffic_enabled;
unsigned char omg_model_rn;
......
......@@ -1109,7 +1109,8 @@ int main(int argc, char **argv)
//print [MAC][I]... messages
//l2_init(frame_parms,eMBMS_active);
l2_init(frame_parms,eMBMS_active,
0); // cba_group_active
0,// cba_group_active
0); // HO flag
if (UE_flag == 1)
mac_xface->dl_phy_sync_success (0, 0, 0, 1);
else
......
......@@ -63,6 +63,7 @@
#include "PHY/vars.h"
#include "MAC_INTERFACE/vars.h"
//#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
......@@ -1253,8 +1254,8 @@ int main(int argc, char **argv) {
}
PHY_vars_UE_g[0]->tx_power_max_dBm = tx_max_power;
printf("tx_max_power = %d -> amp %d\n",tx_max_power,get_tx_amp(tx_max_power,tx_max_power));
// printf("tx_max_power = %d -> amp %d\n",tx_max_power,get_tx_amp(tx_max_power,tx_max_power));
}
else { //this is eNB
g_log->log_component[HW].level = LOG_DEBUG;
......@@ -1394,7 +1395,8 @@ int main(int argc, char **argv) {
#ifdef OPENAIR2
int eMBMS_active=0;
l2_init(frame_parms,eMBMS_active,
0); // cba_group_active
0,// cba_group_active
0); // HO flag
if (UE_flag == 1)
mac_xface->dl_phy_sync_success (0, 0, 0, 1);
else
......
#!/usr/bin/env python
# svn merge-tool python wrapper for meld
# to use: edit ~/.subversion/config and uncomment the line merge-tool-cmd =
# and set the path to your command
# Note that when a conflict occurs, you will be prompted what to do with it. You need to type a single 'l' and for svn to run this script. When you've finished your merge, you need to type an 'r' to resolve the conflict and copy the merged version to the working copy.
import os, sys
import subprocess
import shutil
try:
# path to meld
meld = "/usr/bin/meld"
print "Set the file paths for mine, theirs, and merged\n"
print "When you've finished your merge, you need to type an 'r' to resolve the conflict and copy the merged version to the working copy\n"
# the base or "left" revision version of the file you're merging with
base = sys.argv[1]
# this is "later" or "right"revision version of the file you're merging with
theirs = sys.argv[2]
# this is my version, recommandations: sync your copy to the latest version
mine = sys.argv[3]
#this starts out as a copy of 'mine' (your working copy), and this is where you want the final results of the merge to end up.
merged = sys.argv[4]
print "Calling meld: the order of the files is (merged, theirs, and mine)"
# all 4 versions: worke right-to-left, reslut being stored in the left file
# cmd = [meld, mine, base, theirs, merged]
# only 3 versions
cmd = [meld, merged, theirs, mine]
# Call meld, making sure it exits correctly
subprocess.check_call(cmd)
except:
print "Oh, an error!\n"
sys.exit(-1)
......@@ -150,27 +150,28 @@ int otg_enabled;
#endif
// this should reflect the channel models in openair1/SIMULATION/TOOLS/defs.h
mapping small_scale_names[] =
{
{"custom", custom},
{"SCM_A", SCM_A},
{"SCM_B", SCM_B},
{"SCM_C", SCM_C},
{"SCM_D", SCM_D},
{"EPA", EPA},
{"EVA", EVA},
{"ETU", ETU},
{"Rayleigh8", Rayleigh8},
{"Rayleigh1", Rayleigh1},
{"Rayleigh1_800", Rayleigh1_800},
{"Rayleigh1_corr", Rayleigh1_corr},
{"Rayleigh1_anticorr", Rayleigh1_anticorr},
{"Rice8", Rice8},
{"Rice1", Rice1},
{"Rice1_corr", Rice1_corr},
{"Rice1_anticorr", Rice1_anticorr},
{"AWGN", AWGN},
{NULL, -1}};
mapping small_scale_names[] = {
{"custom", custom},
{"SCM_A", SCM_A},
{"SCM_B", SCM_B},
{"SCM_C", SCM_C},
{"SCM_D", SCM_D},
{"EPA", EPA},
{"EVA", EVA},
{"ETU", ETU},
{"MBSFN", MBSFN},
{"Rayleigh8", Rayleigh8},
{"Rayleigh1", Rayleigh1},
{"Rayleigh1_800", Rayleigh1_800},
{"Rayleigh1_corr", Rayleigh1_corr},
{"Rayleigh1_anticorr", Rayleigh1_anticorr},
{"Rice8", Rice8},
{"Rice1", Rice1},
{"Rice1_corr", Rice1_corr},
{"Rice1_anticorr", Rice1_anticorr},
{"AWGN", AWGN},
{NULL, -1}
};
//static void *sigh(void *arg);
void terminate(void);
......@@ -194,6 +195,7 @@ void help(void) {
printf ("-F Activates FDD transmission (TDD is default)\n");
printf ("-g Set multicast group ID (0,1,2,3) - valid if M is set\n");
printf ("-G Enable background traffic \n");
printf ("-H Enable handover operation (default disabled) \n");
printf ("-I Enable CLI interface (to connect use telnet localhost 1352)\n");
printf ("-k Set the Ricean factor (linear)\n");
printf ("-l Set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error) \n");
......
......@@ -325,12 +325,15 @@ void init_oai_emulation() {
oai_emulation.info.vcd_enabled=0;
oai_emulation.info.cba_group_active=0;
oai_emulation.info.eMBMS_active_state=0;
oai_emulation.info.handover_active=0;
oai_emulation.info.omg_model_enb=STATIC; //default to static mobility model
oai_emulation.info.omg_model_rn=STATIC; //default to static mobility model
oai_emulation.info.omg_model_ue=STATIC; //default to static mobility model
oai_emulation.info.omg_model_ue_current=STATIC; //default to static mobility model
oai_emulation.info.otg_traffic="no_predefined_traffic";
oai_emulation.info.otg_bg_traffic_enabled = 0; // G flag
oai_emulation.info.max_predefined_traffic_config_index = 0;
oai_emulation.info.max_customized_traffic_config_index = 0;
oai_emulation.info.frame = 0; // frame counter of emulation
oai_emulation.info.time_s = 0; // time of emulation
oai_emulation.info.time_ms = 0; // time of emulation
......@@ -664,6 +667,7 @@ int ocg_config_app(){
init_seeds(g_otg->seed); // initialize all the nodes, then configure the nodes the user specifically did in the XML in the following
LOG_I(OTG,"oai_emulation.info.max_predefined_traffic_config_index = %d\n", oai_emulation.info.max_predefined_traffic_config_index);
LOG_I(OTG,"oai_emulation.info.max_customized_traffic_config_index = %d\n", oai_emulation.info.max_customized_traffic_config_index);
if (oai_emulation.info.ocg_ok) {
......@@ -964,7 +968,9 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1;
}
}
}
if ( oai_emulation.info.otg_enabled==1){ // OCG not used, but -T option is used, so config here
if ((oai_emulation.info.max_predefined_traffic_config_index == 0) &&
(oai_emulation.info.max_customized_traffic_config_index == 0) &&
(oai_emulation.info.otg_enabled==1)){ // OCG not used to configure OTG, but -T option is used, so config here
LOG_I(OTG,"configure OTG through options %s\n", oai_emulation.info.otg_traffic);
for (i=0; i<g_otg->num_nodes; i++){
for (j=0; j<g_otg->num_nodes; j++){
......
......@@ -114,7 +114,7 @@ void get_simulation_options(int argc, char *argv[]) {
{NULL, 0, NULL, 0}
};
while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hi:IJ:j:k:K:L:l:m:M:n:N:oO:p:P:Q:rR:s:S:t:T:u:U:vVw:W:x:X:y:Y:z:Z:", long_options, &option_index)) != -1) {
while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:l:L:m:M:n:N:oO:p:P:Q:rR:s:S:t:T:u:U:vVw:W:x:X:y:Y:z:Z:", long_options, &option_index)) != -1) {
switch (c) {
case 0:
if (! strcmp(long_options[option_index].name, "pdcp_period")) {
......@@ -139,7 +139,7 @@ void get_simulation_options(int argc, char *argv[]) {
case 'C':
oai_emulation.info.tdd_config = atoi (optarg);
if (oai_emulation.info.tdd_config > 6) {
LOG_E(EMU,"Illegal tdd_config %d (should be 0-6)\n", oai_emulation.info.tdd_config);
printf("Illegal tdd_config %d (should be 0-6)\n", oai_emulation.info.tdd_config);
exit (-1);
}
break;
......@@ -152,23 +152,28 @@ void get_simulation_options(int argc, char *argv[]) {
oai_emulation.info.N_RB_DL = atoi (optarg);
if ((oai_emulation.info.N_RB_DL != 6) && (oai_emulation.info.N_RB_DL != 15) && (oai_emulation.info.N_RB_DL != 25)
&& (oai_emulation.info.N_RB_DL != 50) && (oai_emulation.info.N_RB_DL != 75) && (oai_emulation.info.N_RB_DL != 100)) {
LOG_E(EMU,"Illegal N_RB_DL %d (should be one of 6,15,25,50,75,100)\n", oai_emulation.info.N_RB_DL);
printf("Illegal N_RB_DL %d (should be one of 6,15,25,50,75,100)\n", oai_emulation.info.N_RB_DL);
exit (-1);
}
case 'N':
Nid_cell = atoi (optarg);
if (Nid_cell > 503) {
LOG_E(EMU,"Illegal Nid_cell %d (should be 0 ... 503)\n", Nid_cell);
printf("Illegal Nid_cell %d (should be 0 ... 503)\n", Nid_cell);
exit(-1);
}
break;
case 'h':
help ();
exit (1);
break;
case 'H':
oai_emulation.info.handover_active=1;
printf("Activate the handover procedure at RRC\n");
break;
case 'x':
oai_emulation.info.transmission_mode = atoi (optarg);
if ((oai_emulation.info.transmission_mode != 1) && (oai_emulation.info.transmission_mode != 2) && (oai_emulation.info.transmission_mode != 5) && (oai_emulation.info.transmission_mode != 6)) {
LOG_E(EMU, "Unsupported transmission mode %d\n",oai_emulation.info.transmission_mode);
printf("Unsupported transmission mode %d\n",oai_emulation.info.transmission_mode);
exit(-1);
}
break;
......@@ -211,7 +216,7 @@ void get_simulation_options(int argc, char *argv[]) {
break;
case 'k':
//ricean_factor = atof (optarg);
LOG_E(EMU,"[SIM] Option k is no longer supported on the command line. Please specify your channel model in the xml template\n");
printf("[SIM] Option k is no longer supported on the command line. Please specify your channel model in the xml template\n");
exit(-1);
break;
case 'K':
......@@ -219,7 +224,7 @@ void get_simulation_options(int argc, char *argv[]) {
break;
case 't':
//Td = atof (optarg);
LOG_E(EMU,"[SIM] Option t is no longer supported on the command line. Please specify your channel model in the xml template\n");
printf("[SIM] Option t is no longer supported on the command line. Please specify your channel model in the xml template\n");
exit(-1);
break;
case 'f':
......@@ -575,7 +580,7 @@ void init_openair2() {
#ifdef OPENAIR2
s32 i;
s32 UE_id;
#if defined(ENABLE_ITTI)
if (NB_eNB_INST > 0) {
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
......@@ -594,13 +599,12 @@ void init_openair2() {
}
#endif
l2_init (&PHY_vars_eNB_g[0]->lte_frame_parms,oai_emulation.info.eMBMS_active_state, oai_emulation.info.cba_group_active);
printf ("after L2 init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell);
printf ("after L2 init: frame_type %d,tdd_config %d\n",
PHY_vars_eNB_g[0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[0]->lte_frame_parms.tdd_config);
l2_init (&PHY_vars_eNB_g[0]->lte_frame_parms,
oai_emulation.info.eMBMS_active_state,
oai_emulation.info.cba_group_active,
oai_emulation.info.handover_active);
for (i = 0; i < NB_eNB_INST; i++)
for (i = 0; i < NB_eNB_INST; i++)
mac_xface->mrbch_phy_sync_failure (i, 0, i);
if (abstraction_flag == 1) {
......
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