Commit 58610853 authored by Navid Nikaein's avatar Navid Nikaein

* Add relay node types and its eNB/UE procedures

* update the L2 interface
* update eMBMS MAC/PHY to support more than one MBSFN sync area
* update OTG to support different multicast traffic for eMBMS
* pre-ci test passed (100%)
 


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4170 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 51bdba77
...@@ -315,6 +315,7 @@ void phy_config_sib13_ue(u8 Mod_id,u8 CH_index,int mbsfn_Area_idx, ...@@ -315,6 +315,7 @@ void phy_config_sib13_ue(u8 Mod_id,u8 CH_index,int mbsfn_Area_idx,
if (mbsfn_Area_idx == 0) { if (mbsfn_Area_idx == 0) {
lte_frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9; lte_frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
} }
lte_gold_mbsfn(lte_frame_parms,PHY_vars_UE_g[Mod_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn); lte_gold_mbsfn(lte_frame_parms,PHY_vars_UE_g[Mod_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn);
...@@ -332,6 +333,7 @@ void phy_config_sib13_eNB(u8 Mod_id,int mbsfn_Area_idx, ...@@ -332,6 +333,7 @@ void phy_config_sib13_eNB(u8 Mod_id,int mbsfn_Area_idx,
if (mbsfn_Area_idx == 0) { if (mbsfn_Area_idx == 0) {
lte_frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9; lte_frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
} }
lte_gold_mbsfn(lte_frame_parms,PHY_vars_eNB_g[Mod_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn); lte_gold_mbsfn(lte_frame_parms,PHY_vars_eNB_g[Mod_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn);
......
...@@ -74,37 +74,37 @@ void dump_mch(PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u16 coded_bits_per_codeword,int ...@@ -74,37 +74,37 @@ void dump_mch(PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u16 coded_bits_per_codeword,int
int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms) { int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms) {
uint32_t period; uint32_t period;
uint8_t i;
if (frame_parms->num_MBSFN_config > 0) { // we have at least one MBSFN configuration for (i=0; i<frame_parms->num_MBSFN_config; i++) { // we have at least one MBSFN configuration
period = 1<<frame_parms->MBSFN_config[i].radioframeAllocationPeriod;
period = 1<<frame_parms->MBSFN_config[0].radioframeAllocationPeriod; if ((frame % period) == frame_parms->MBSFN_config[i].radioframeAllocationOffset) {
if ((frame % period) == frame_parms->MBSFN_config[0].radioframeAllocationOffset) { if (frame_parms->MBSFN_config[i].fourFrames_flag == 0) {
if (frame_parms->MBSFN_config[0].fourFrames_flag == 0) {
if (frame_parms->frame_type == FDD) { if (frame_parms->frame_type == FDD) {
switch (subframe) { switch (subframe) {
case 1: case 1:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_FDD_SF1) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_FDD_SF1) > 0)
return(1); return(1);
break; break;
case 2: case 2:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_FDD_SF2) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_FDD_SF2) > 0)
return(1); return(1);
break; break;
case 3: case 3:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_FDD_SF3) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_FDD_SF3) > 0)
return(1); return(1);
break; break;
case 6: case 6:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_FDD_SF6) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_FDD_SF6) > 0)
return(1); return(1);
break; break;
case 7: case 7:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_FDD_SF7) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_FDD_SF7) > 0)
return(1); return(1);
break; break;
case 8: case 8:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_FDD_SF8) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_FDD_SF8) > 0)
return(1); return(1);
break; break;
} }
...@@ -112,23 +112,23 @@ int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_par ...@@ -112,23 +112,23 @@ int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_par
else { else {
switch (subframe) { switch (subframe) {
case 3: case 3:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_TDD_SF3) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_TDD_SF3) > 0)
return(1); return(1);
break; break;
case 4: case 4:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_TDD_SF4) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_TDD_SF4) > 0)
return(1); return(1);
break; break;
case 7: case 7:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_TDD_SF7) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_TDD_SF7) > 0)
return(1); return(1);
break; break;
case 8: case 8:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_TDD_SF8) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_TDD_SF8) > 0)
return(1); return(1);
break; break;
case 9: case 9:
if ((frame_parms->MBSFN_config[0].mbsfn_SubframeConfig & MBSFN_TDD_SF9) > 0) if ((frame_parms->MBSFN_config[i].mbsfn_SubframeConfig & MBSFN_TDD_SF9) > 0)
return(1); return(1);
break; break;
} }
......
...@@ -210,6 +210,16 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t ...@@ -210,6 +210,16 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",phy_vars_ue->dlsch_received[0],phy_vars_ue->dlsch_errors[0],phy_vars_ue->dlsch_fer[0]); len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",phy_vars_ue->dlsch_received[0],phy_vars_ue->dlsch_errors[0],phy_vars_ue->dlsch_fer[0]);
len += sprintf(&buffer[len], "[UE PROC] DLSCH (SI) Total %d, Error %d\n",phy_vars_ue->dlsch_SI_received[0],phy_vars_ue->dlsch_SI_errors[0]); len += sprintf(&buffer[len], "[UE PROC] DLSCH (SI) Total %d, Error %d\n",phy_vars_ue->dlsch_SI_received[0],phy_vars_ue->dlsch_SI_errors[0]);
len += sprintf(&buffer[len], "[UE PROC] DLSCH (RA) Total %d, Error %d\n",phy_vars_ue->dlsch_ra_received[0],phy_vars_ue->dlsch_ra_errors[0]); len += sprintf(&buffer[len], "[UE PROC] DLSCH (RA) Total %d, Error %d\n",phy_vars_ue->dlsch_ra_received[0],phy_vars_ue->dlsch_ra_errors[0]);
#ifdef Rel10
int i=0;
//len += sprintf(&buffer[len], "[UE PROC] MCH Total %d\n", phy_vars_ue->dlsch_mch_received[0]);
for(i=0; i <phy_vars_ue->lte_frame_parms.num_MBSFN_config; i++ ){
len += sprintf(&buffer[len], "[UE PROC] MCH (MCCH MBSFN %d) Total %d, Error %d, Trials %d\n",
i, phy_vars_ue->dlsch_mcch_received[i][0],phy_vars_ue->dlsch_mcch_errors[i][0],phy_vars_ue->dlsch_mcch_trials[i][0]);
len += sprintf(&buffer[len], "[UE PROC] MCH (MTCH MBSFN %d) Total %d, Error %d, Trials %d\n",
i, phy_vars_ue->dlsch_mtch_received[i][0],phy_vars_ue->dlsch_mtch_errors[i][0],phy_vars_ue->dlsch_mtch_trials[i][0]);
}
#endif
len += sprintf(&buffer[len], "[UE PROC] DLSCH Bitrate %dkbps\n",(phy_vars_ue->bitrate[0]/1000)); len += sprintf(&buffer[len], "[UE PROC] DLSCH Bitrate %dkbps\n",(phy_vars_ue->bitrate[0]/1000));
len += sprintf(&buffer[len], "[UE PROC] Total Received Bits %dkbits\n",(phy_vars_ue->total_received_bits[0]/1000)); len += sprintf(&buffer[len], "[UE PROC] Total Received Bits %dkbits\n",(phy_vars_ue->total_received_bits[0]/1000));
......
...@@ -135,7 +135,6 @@ ...@@ -135,7 +135,6 @@
#include "PHY/CODING/defs.h" #include "PHY/CODING/defs.h"
#include "PHY/TOOLS/defs.h" #include "PHY/TOOLS/defs.h"
#ifdef OPENAIR_LTE #ifdef OPENAIR_LTE
//#include "PHY/LTE_ESTIMATION/defs.h" //#include "PHY/LTE_ESTIMATION/defs.h"
...@@ -159,8 +158,7 @@ enum transmission_access_mode{ ...@@ -159,8 +158,7 @@ enum transmission_access_mode{
}; };
/// Top-level PHY Data Structure for eNB /// Top-level PHY Data Structure for eNB
typedef struct typedef struct {
{
/// Module ID indicator for this instance /// Module ID indicator for this instance
u8 Mod_id; u8 Mod_id;
u8 local_flag; u8 local_flag;
...@@ -388,7 +386,14 @@ typedef struct ...@@ -388,7 +386,14 @@ typedef struct
int dlsch_SI_errors[NUMBER_OF_CONNECTED_eNB_MAX]; int dlsch_SI_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_ra_received[NUMBER_OF_CONNECTED_eNB_MAX]; int dlsch_ra_received[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_ra_errors[NUMBER_OF_CONNECTED_eNB_MAX]; int dlsch_ra_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mch_errors[NUMBER_OF_CONNECTED_eNB_MAX]; int dlsch_mch_received_sf[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mch_received[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mcch_received[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mtch_received[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mcch_errors[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mtch_errors[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mcch_trials[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mtch_trials[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int current_dlsch_cqi[NUMBER_OF_CONNECTED_eNB_MAX]; int current_dlsch_cqi[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned char first_run_timing_advance[NUMBER_OF_CONNECTED_eNB_MAX]; unsigned char first_run_timing_advance[NUMBER_OF_CONNECTED_eNB_MAX];
u8 generate_prach; u8 generate_prach;
...@@ -480,7 +485,19 @@ typedef struct ...@@ -480,7 +485,19 @@ typedef struct
time_stats_t dlsch_tc_intl2_stats; time_stats_t dlsch_tc_intl2_stats;
} PHY_VARS_UE; } PHY_VARS_UE;
/// Top-level PHY Data Structure for RN
typedef struct {
/// Module ID indicator for this instance
u8 Mod_id;
u32 frame;
// phy_vars_eNB
// phy_vars ue
// cuurently only used to store and forward the PMCH
u8 mch_avtive[10];
u8 sync_area[10]; // num SF
LTE_UE_DLSCH_t *dlsch_rn_MCH[10];
} PHY_VARS_RN;
#include "PHY/INIT/defs.h" #include "PHY/INIT/defs.h"
#include "PHY/LTE_REFSIG/defs.h" #include "PHY/LTE_REFSIG/defs.h"
......
...@@ -27,6 +27,7 @@ extern unsigned int DAQ_MBOX; ...@@ -27,6 +27,7 @@ extern unsigned int DAQ_MBOX;
extern PHY_VARS_UE **PHY_vars_UE_g; extern PHY_VARS_UE **PHY_vars_UE_g;
extern PHY_VARS_eNB **PHY_vars_eNB_g; extern PHY_VARS_eNB **PHY_vars_eNB_g;
extern PHY_VARS_RN **PHY_vars_RN_g;
extern LTE_DL_FRAME_PARMS *lte_frame_parms_g; extern LTE_DL_FRAME_PARMS *lte_frame_parms_g;
......
...@@ -36,6 +36,7 @@ s16 *primary_synch2_time; ...@@ -36,6 +36,7 @@ s16 *primary_synch2_time;
//PHY_VARS *PHY_vars; //PHY_VARS *PHY_vars;
PHY_VARS_UE **PHY_vars_UE_g; PHY_VARS_UE **PHY_vars_UE_g;
PHY_VARS_eNB **PHY_vars_eNB_g; PHY_VARS_eNB **PHY_vars_eNB_g;
PHY_VARS_RN **PHY_vars_RN_g;
LTE_DL_FRAME_PARMS *lte_frame_parms_g; LTE_DL_FRAME_PARMS *lte_frame_parms_g;
short *twiddle_ifft,*twiddle_fft,*twiddle_fft_times4,*twiddle_ifft_times4,*twiddle_fft_half,*twiddle_ifft_half; short *twiddle_ifft,*twiddle_fft,*twiddle_fft_times4,*twiddle_ifft_times4,*twiddle_fft_half,*twiddle_ifft_half;
......
...@@ -126,8 +126,9 @@ void cleanup_dlsch_threads(void); ...@@ -126,8 +126,9 @@ void cleanup_dlsch_threads(void);
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param *phy_vars_rn pointer to RN variables
*/ */
void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_type_t r_type); void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn);
/*! /*!
\brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe. \brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe.
@param last_slot Index of last slot (0-19) @param last_slot Index of last slot (0-19)
...@@ -137,8 +138,9 @@ void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eN ...@@ -137,8 +138,9 @@ void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eN
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param mode calibration/debug mode @param mode calibration/debug mode
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param *phy_vars_rn pointer to RN variables
*/ */
void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_type_t r_type); void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
#ifdef Rel10 #ifdef Rel10
/*! /*!
...@@ -175,8 +177,9 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs ...@@ -175,8 +177,9 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param mode calibration/debug mode @param mode calibration/debug mode
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param phy_vars_rn pointer to RN variables
*/ */
int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_type_t r_type); int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
/*! /*!
\brief Scheduling for UE TX procedures in TDD S-subframes. \brief Scheduling for UE TX procedures in TDD S-subframes.
...@@ -204,8 +207,9 @@ void phy_procedures_UE_S_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 a ...@@ -204,8 +207,9 @@ void phy_procedures_UE_S_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 a
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param phy_vars_rn pointer to the RN variables
*/ */
void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type); void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
/*! /*!
\brief Scheduling for eNB RX procedures in normal subframes. \brief Scheduling for eNB RX procedures in normal subframes.
......
...@@ -888,7 +888,8 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, u8 subframe, PHY_VARS_eNB *phy_vars_eNB) { ...@@ -888,7 +888,8 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, u8 subframe, PHY_VARS_eNB *phy_vars_eNB) {
int QPSK[4]={AMP_OVER_SQRT2|(AMP_OVER_SQRT2<<16),AMP_OVER_SQRT2|((65536-AMP_OVER_SQRT2)<<16),((65536-AMP_OVER_SQRT2)<<16)|AMP_OVER_SQRT2,((65536-AMP_OVER_SQRT2)<<16)|(65536-AMP_OVER_SQRT2)}; int QPSK[4]={AMP_OVER_SQRT2|(AMP_OVER_SQRT2<<16),AMP_OVER_SQRT2|((65536-AMP_OVER_SQRT2)<<16),((65536-AMP_OVER_SQRT2)<<16)|AMP_OVER_SQRT2,((65536-AMP_OVER_SQRT2)<<16)|(65536-AMP_OVER_SQRT2)};
int QPSK2[4]={AMP_OVER_2|(AMP_OVER_2<<16),AMP_OVER_2|((65536-AMP_OVER_2)<<16),((65536-AMP_OVER_2)<<16)|AMP_OVER_2,((65536-AMP_OVER_2)<<16)|(65536-AMP_OVER_2)}; int QPSK2[4]={AMP_OVER_2|(AMP_OVER_2<<16),AMP_OVER_2|((65536-AMP_OVER_2)<<16),((65536-AMP_OVER_2)<<16)|AMP_OVER_2,((65536-AMP_OVER_2)<<16)|(65536-AMP_OVER_2)};
void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_type_t r_type) { void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,
relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) {
u8 *pbch_pdu=&phy_vars_eNB->pbch_pdu[0]; u8 *pbch_pdu=&phy_vars_eNB->pbch_pdu[0];
// unsigned int nb_dci_ue_spec = 0, nb_dci_common = 0; // unsigned int nb_dci_ue_spec = 0, nb_dci_common = 0;
u16 input_buffer_length, re_allocated=0; u16 input_buffer_length, re_allocated=0;
...@@ -911,7 +912,9 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 ...@@ -911,7 +912,9 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8
int re_offset; int re_offset;
uint32_t *txptr; uint32_t *txptr;
#ifdef Rel10 #ifdef Rel10
MCH_PDU *mch_pdu; MCH_PDU *mch_pduP;
MCH_PDU mch_pdu;
u8 sync_area=255;
#endif #endif
#if defined(SMBV) && !defined(EXMIMO) #if defined(SMBV) && !defined(EXMIMO)
// counts number of allocations in subframe // counts number of allocations in subframe
...@@ -970,17 +973,66 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 ...@@ -970,17 +973,66 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8
next_slot,1); next_slot,1);
#ifdef Rel10 #ifdef Rel10
// get MCH from MAC // if mcch is active, send regardless of the node type: eNB or RN
mch_pdu = mac_xface->get_mch_sdu(phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot>>1); // when mcch is active, MAC sched does not allow MCCH and MTCH multiplexing
mch_pduP = mac_xface->get_mch_sdu(phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot>>1);
fill_eNB_dlsch_MCH(phy_vars_eNB,mch_pdu->mcs,1,0); switch (r_type){
case no_relay:
LOG_D(PHY,"[eNB%d][MCH] Frame %d: Got MCH pdu for MBSFN Subframe %d : MCS %d, TBS %d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot>>1,mch_pdu->mcs,phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3); if ((mch_pduP->Pdu_size > 0) && (mch_pduP->sync_area == 0)) // TEST: only transmit mcch for sync area 0
// Generate PMCH //if ((mch_pduP->sync_area == 0)) // TEST: only transmit mcch for sync area 0
generate_mch(phy_vars_eNB,next_slot>>1,(uint8_t*)mch_pdu->payload); LOG_I(PHY,"[eNB%d] Frame %d subframe %d : Got MCH pdu for MBSFN (MCS %d, TBS %d) \n",
/*for (i=0;i<phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3;i++) phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot>>1,mch_pduP->mcs,
printf("%2x.",(uint8_t)mch_pdu->payload[i]); phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3);
printf("\n");*/ else {
LOG_D(PHY,"[DeNB %d] Frame %d subframe %d : Do not transmit MCH pdu for MBSFN sync area %d (%s)\n",
phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot>>1,mch_pduP->sync_area,
(mch_pduP->Pdu_size == 0)? "Empty MCH PDU":"Let RN transmit for the moment");
mch_pduP = NULL;
}
break;
case multicast_relay:
if ((mch_pduP->Pdu_size > 0) && ((mch_pduP->mcch_active == 1) || mch_pduP->msi_active==1)){
//if (((mch_pduP->mcch_active == 1) || mch_pduP->msi_active==1)){
LOG_I(PHY,"[RN %d] Frame %d subframe %d: Got the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n",
phy_vars_rn->Mod_id,phy_vars_rn->frame, next_slot>>1,
mch_pduP->sync_area,mch_pduP->mcs,mch_pduP->Pdu_size);
} else if (phy_vars_rn->mch_avtive[(next_slot>>1)%5] == 1){ // SF2 -> SF7, SF3 -> SF8
mch_pduP= &mch_pdu;
memcpy(&mch_pduP->payload, // could be a simple copy
phy_vars_rn->dlsch_rn_MCH[(next_slot>>1)%5]->harq_processes[0]->b,
phy_vars_rn->dlsch_rn_MCH[(next_slot>>1)%5]->harq_processes[0]->TBS>>3);
mch_pduP->Pdu_size = (uint16_t) (phy_vars_rn->dlsch_rn_MCH[(next_slot>>1)%5]->harq_processes[0]->TBS>>3);
mch_pduP->mcs = phy_vars_rn->dlsch_rn_MCH[(next_slot>>1)%5]->harq_processes[0]->mcs;
LOG_I(PHY,"[RN %d] Frame %d subframe %d: Forward the MCH PDU for MBSFN received on SF %d sync area %d (MCS %d, TBS %d)\n",
phy_vars_rn->Mod_id,phy_vars_rn->frame, next_slot>>1,(next_slot>>1)%5,
phy_vars_rn->sync_area[(next_slot>>1)%5],mch_pduP->mcs,mch_pduP->Pdu_size);
} else {
/* LOG_I(PHY,"[RN %d] Frame %d subframe %d: do not forward MCH pdu for MBSFN sync area %d (MCS %d, TBS %d)\n",
phy_vars_rn->Mod_id,phy_vars_rn->frame, next_slot>>1,
mch_pduP->sync_area,mch_pduP->mcs,mch_pduP->Pdu_size);*/
mch_pduP=NULL;
}
phy_vars_rn->mch_avtive[next_slot>>1]=0;
break;
default:
LOG_W(PHY,"[eNB %d] Frame %d subframe %d: unknown relaying type %d \n",
phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot>>1,r_type);
mch_pduP=NULL;
break;
}// switch
if (mch_pduP){
fill_eNB_dlsch_MCH(phy_vars_eNB,mch_pduP->mcs,1,0);
// Generate PMCH
generate_mch(phy_vars_eNB,next_slot>>1,(uint8_t*)mch_pduP->payload);
#ifdef DEBUG_PHY
for (i=0;i<mch_pduP->Pdu_size;i++)
msg("%2x.",(uint8_t)mch_pduP->payload[i]);
msg("\n");
#endif
} else {
LOG_D(PHY,"[eNB/RN] Frame %d subframe %d: MCH not generated \n",phy_vars_eNB->frame,next_slot>>1);
}
#endif #endif
} }
} }
...@@ -3377,7 +3429,7 @@ int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, r ...@@ -3377,7 +3429,7 @@ int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, r
do_proc= no_relay; // perform the normal eNB operation do_proc= no_relay; // perform the normal eNB operation
break; break;
case multicast_relay: case multicast_relay:
if ( ((next_slot >>1) < 6) || ((next_slot >>1) > 8)) if (((next_slot >>1) < 6) || ((next_slot >>1) > 8))
do_proc = 0; // do nothing do_proc = 0; // do nothing
else // SF#6, SF#7 and SF#8 else // SF#6, SF#7 and SF#8
do_proc = multicast_relay; // do PHY procedures eNB TX do_proc = multicast_relay; // do PHY procedures eNB TX
...@@ -3390,7 +3442,8 @@ int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, r ...@@ -3390,7 +3442,8 @@ int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, r
return do_proc; return do_proc;
} }
#endif #endif
void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_type_t r_type) { void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,
relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn) {
/* /*
if (phy_vars_eNB->frame >= 1000) if (phy_vars_eNB->frame >= 1000)
mac_xface->macphy_exit("Exiting after 1000 Frames\n"); mac_xface->macphy_exit("Exiting after 1000 Frames\n");
...@@ -3404,7 +3457,7 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY ...@@ -3404,7 +3457,7 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY
#ifdef Rel10 #ifdef Rel10
if (phy_procedures_RN_eNB_TX(last_slot, next_slot, r_type) != 0 ) if (phy_procedures_RN_eNB_TX(last_slot, next_slot, r_type) != 0 )
#endif #endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_type); phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_type,phy_vars_rn);
} }
if (((phy_vars_eNB->lte_frame_parms.frame_type == 1 )&&(subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_UL))|| if (((phy_vars_eNB->lte_frame_parms.frame_type == 1 )&&(subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_UL))||
(phy_vars_eNB->lte_frame_parms.frame_type == 0)){ (phy_vars_eNB->lte_frame_parms.frame_type == 0)){
...@@ -3415,7 +3468,7 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY ...@@ -3415,7 +3468,7 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY
#ifdef Rel10 #ifdef Rel10
if (phy_procedures_RN_eNB_TX(last_slot, next_slot, r_type) != 0 ) if (phy_procedures_RN_eNB_TX(last_slot, next_slot, r_type) != 0 )
#endif #endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_type); phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_type,phy_vars_rn);
} }
if ((subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_S) && if ((subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_S) &&
((last_slot&1)==0)){ ((last_slot&1)==0)){
......
This diff is collapsed.
...@@ -201,9 +201,11 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -201,9 +201,11 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
if (mbsfn_SubframeConfigList != NULL) { if (mbsfn_SubframeConfigList != NULL) {
if (eNB_flag == 1) { if (eNB_flag == 1) {
LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count);
eNB_mac_inst[Mod_id].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) { for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
eNB_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; eNB_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
LOG_I(MAC, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i, LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_id, i,
eNB_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); eNB_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
} }
#ifdef Rel10 #ifdef Rel10
...@@ -211,8 +213,10 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -211,8 +213,10 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
#endif #endif
} }
else { // UE else { // UE
LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count);
UE_mac_inst[Mod_id].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) { for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig from received SIB2 \n", Mod_id); LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_id, i);
UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
// LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_id, // LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_id,
// UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); // UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
...@@ -223,19 +227,22 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index, ...@@ -223,19 +227,22 @@ int rrc_mac_config_req(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
#ifdef Rel10 #ifdef Rel10
if (mbsfn_AreaInfoList != NULL) { if (mbsfn_AreaInfoList != NULL) {
if (eNB_flag == 1) { if (eNB_flag == 1) {
LOG_I(MAC, "[CONFIG] Number of MBSFN Area Info in the list %d\n", mbsfn_AreaInfoList->list.count); // One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count);
eNB_mac_inst[Mod_id].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
for (i =0; i< mbsfn_AreaInfoList->list.count; i++) { for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
eNB_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; eNB_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
LOG_I(MAC, "[CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", i, LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_id,i,
eNB_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); eNB_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
mac_xface->phy_config_sib13_eNB(Mod_id,i,eNB_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); mac_xface->phy_config_sib13_eNB(Mod_id,i,eNB_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
} }
} }
else { // UE else { // UE
LOG_I(MAC, "[UE %d] Configuring mbsfn_AreaInfo from received SIB13 \n", Mod_id); LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count);
UE_mac_inst[Mod_id].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
for (i =0; i< mbsfn_AreaInfoList->list.count; i++) { for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
UE_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; UE_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
LOG_I(MAC, "[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_id, i, LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_id, i,
UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
mac_xface->phy_config_sib13_ue(Mod_id,eNB_index,i,UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); mac_xface->phy_config_sib13_ue(Mod_id,eNB_index,i,UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
} }
......
...@@ -297,6 +297,10 @@ typedef struct { ...@@ -297,6 +297,10 @@ typedef struct {
s8 payload[SCH_PAYLOAD_SIZE_MAX]; s8 payload[SCH_PAYLOAD_SIZE_MAX];
u16 Pdu_size; u16 Pdu_size;
uint8_t mcs; uint8_t mcs;
uint8_t sync_area;
uint8_t msi_active;
uint8_t mcch_active;
uint8_t mtch_active;
} __attribute__ ((__packed__)) MCH_PDU; } __attribute__ ((__packed__)) MCH_PDU;
/*! \brief Uplink SCH PDU Structure /*! \brief Uplink SCH PDU Structure
...@@ -607,21 +611,27 @@ typedef struct{ ...@@ -607,21 +611,27 @@ typedef struct{
u8 bcch_active; u8 bcch_active;
/// MBSFN SubframeConfig /// MBSFN SubframeConfig
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8];
/// number of subframe allocation pattern available for MBSFN sync area
u8 num_sf_allocation_pattern;
#ifdef Rel10 #ifdef Rel10
/// MBMS Flag /// MBMS Flag
u8 MBMS_flag; u8 MBMS_flag;
/// Outgoing MCCH pdu for PHY /// Outgoing MCCH pdu for PHY
MCCH_PDU MCCH_pdu; MCCH_PDU MCCH_pdu;
/// MCCH active flag /// MCCH active flag
u8 msi_active;
/// MCCH active flag
u8 mcch_active; u8 mcch_active;
/// MTCH active flag
u8 mtch_active;
/// number of active MBSFN area
u8 num_active_mbsfn_area;
/// MBSFN Area Info /// MBSFN Area Info
struct MBSFN_AreaInfo_r9 *mbsfn_AreaInfo[MAX_MBSFN_AREA]; struct MBSFN_AreaInfo_r9 *mbsfn_AreaInfo[MAX_MBSFN_AREA];
/// PMCH Config /// PMCH Config
struct PMCH_Config_r9 *pmch_Config[MAX_PMCH_perMBSFN]; struct PMCH_Config_r9 *pmch_Config[MAX_PMCH_perMBSFN];
/// MBMS session info list /// MBMS session info list
struct MBMS_SessionInfoList_r9 *mbms_SessionList[MAX_PMCH_perMBSFN]; struct MBMS_SessionInfoList_r9 *mbms_SessionList[MAX_PMCH_perMBSFN];
/// Outgoing MCH pdu for PHY /// Outgoing MCH pdu for PHY
MCH_PDU MCH_pdu; MCH_PDU MCH_pdu;
#endif #endif
...@@ -766,8 +776,11 @@ typedef struct{ ...@@ -766,8 +776,11 @@ typedef struct{
u8 power_backoff_db[NUMBER_OF_eNB_MAX]; u8 power_backoff_db[NUMBER_OF_eNB_MAX];
/// MBSFN_Subframe Configuration /// MBSFN_Subframe Configuration
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8];
/// number of subframe allocation pattern available for MBSFN sync area
u8 num_sf_allocation_pattern;
#ifdef Rel10 #ifdef Rel10
/// number of active MBSFN area
u8 num_active_mbsfn_area;
/// MBSFN Area Info /// MBSFN Area Info
struct MBSFN_AreaInfo_r9 *mbsfn_AreaInfo[MAX_MBSFN_AREA]; struct MBSFN_AreaInfo_r9 *mbsfn_AreaInfo[MAX_MBSFN_AREA];
/// PMCH Config /// PMCH Config
...@@ -890,6 +903,20 @@ void schedule_SI(u8 Mod_id,u32 frame,u8 *nprb,unsigned int *nCCE); ...@@ -890,6 +903,20 @@ void schedule_SI(u8 Mod_id,u32 frame,u8 *nprb,unsigned int *nCCE);
*/ */
int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe); int schedule_MBMS(unsigned char Mod_id,u32 frame, u8 subframe);
/** \brief check the mapping between sf allocation and sync area, Currently only supports 1:1 mapping
@param Mod_id Instance ID of eNB
@param mbsfn_sync_area index of mbsfn sync area
@param[out] index of sf pattern
*/
s8 get_mbsfn_sf_alloction (unsigned char Mod_id, u8 mbsfn_sync_area);
/** \brief check the mapping between sf allocation and sync area, Currently only supports 1:1 mapping
@param Mod_id Instance ID of eNB
@param mbsfn_sync_area index of mbsfn sync area
@param eNB_index index of eNB
@param[out] index of sf pattern
*/
s8 ue_get_mbsfn_sf_alloction (unsigned char Mod_id, u8 mbsfn_sync_area, unsigned char eNB_index);
/** \brief top ULSCH Scheduling for TDD (config 1-6). /** \brief top ULSCH Scheduling for TDD (config 1-6).
@param Mod_id Instance ID of eNB @param Mod_id Instance ID of eNB
...@@ -1152,15 +1179,19 @@ void ue_send_sdu(u8 Mod_id, u32 frame, u8 *sdu,u16 sdu_len,u8 CH_index); ...@@ -1152,15 +1179,19 @@ void ue_send_sdu(u8 Mod_id, u32 frame, u8 *sdu,u16 sdu_len,u8 CH_index);
@param sdu Pointer to transport block @param sdu Pointer to transport block
@param sdu_len Length of transport block @param sdu_len Length of transport block
@param eNB_index Index of attached eNB @param eNB_index Index of attached eNB
@param sync_area the index of MBSFN sync area
*/ */
void ue_send_mch_sdu(u8 Mod_id,u32 frame,u8 *sdu,u16 sdu_len,u8 eNB_index) ; void ue_send_mch_sdu(u8 Mod_id,u32 frame,u8 *sdu,u16 sdu_len,u8 eNB_index,u8 sync_area) ;
/*\brief Function to check if UE PHY needs to decode MCH for MAC. /*\brief Function to check if UE PHY needs to decode MCH for MAC.
@param Mod_id Index of protocol instance @param Mod_id Index of protocol instance
@param frame Index of frame @param frame Index of frame
@param subframe Index of subframe @param subframe Index of subframe
@param eNB_index index of eNB for this MCH
@param[out] sync_area return the sync area
@param[out] mcch_active flag indicating whether this MCCH is active in this SF
*/ */
int ue_query_mch(uint8_t Mod_id,uint32_t frame,uint32_t subframe); int ue_query_mch(uint8_t Mod_id,uint32_t frame,uint32_t subframe, uint8_t eNB_index, uint8_t *sync_area, uint8_t *mcch_active);
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
...@@ -859,10 +859,10 @@ BOOL pdcp_config_req_asn1 (module_id_t module_id, u32 frame, u8_t eNB_flag, u16 ...@@ -859,10 +859,10 @@ BOOL pdcp_config_req_asn1 (module_id_t module_id, u32 frame, u8_t eNB_flag, u16
break; break;
case ACTION_MBMS_ADD: case ACTION_MBMS_ADD:
case ACTION_MBMS_MODIFY: case ACTION_MBMS_MODIFY:
pdcp_mbms_array[module_id][lc_id].instanciated_instance = module_id + 1 ; pdcp_mbms_array[module_id][rb_id].instanciated_instance = module_id + 1 ;
pdcp_mbms_array[module_id][lc_id].service_id = mch_id; pdcp_mbms_array[module_id][rb_id].service_id = mch_id;
pdcp_mbms_array[module_id][lc_id].session_id = lc_id; pdcp_mbms_array[module_id][rb_id].session_id = lc_id;
pdcp_mbms_array[module_id][lc_id].rb_id = rb_id; pdcp_mbms_array[module_id][rb_id].rb_id = rb_id;
LOG_I(PDCP,"[%s %d] Config request : ACTION_MBMS_ADD: Frame %d service_id/mch index %d, session_id/lcid %d, rbid %d configured\n", LOG_I(PDCP,"[%s %d] Config request : ACTION_MBMS_ADD: Frame %d service_id/mch index %d, session_id/lcid %d, rbid %d configured\n",
(eNB_flag == 1) ? "eNB" : "UE", module_id, frame, mch_id, lc_id, rb_id); (eNB_flag == 1) ? "eNB" : "UE", module_id, frame, mch_id, lc_id, rb_id);
break; break;
......
...@@ -597,7 +597,7 @@ int ...@@ -597,7 +597,7 @@ int
LOG_E(PDCP, "Received packet for non-instanciated instance %u with rb_id %u\n", LOG_E(PDCP, "Received packet for non-instanciated instance %u with rb_id %u\n",
pdcp_read_header.inst, pdcp_read_header.rb_id); pdcp_read_header.inst, pdcp_read_header.rb_id);
} }
} else if (eNB_flag) { } else if (eNB_flag) { // rb_id =0, thus interpreated as broadcast and transported as multiple unicast
// is a broadcast packet, we have to send this packet on all default RABS of all connected UEs // is a broadcast packet, we have to send this packet on all default RABS of all connected UEs
#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES #warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
for (rab_id = DEFAULT_RAB_ID; rab_id < MAX_RB; rab_id = rab_id + NB_RB_MAX) { for (rab_id = DEFAULT_RAB_ID; rab_id < MAX_RB; rab_id = rab_id + NB_RB_MAX) {
...@@ -636,7 +636,7 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index ...@@ -636,7 +636,7 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
int src_id, module_id; // src for otg int src_id, module_id; // src for otg
int dst_id, rb_id; // dst for otg int dst_id, rb_id; // dst for otg
int pkt_size=0, pkt_cnt=0; int pkt_size=0, pkt_cnt=0;
u8 pdcp_mode; u8 pdcp_mode, is_ue=0;
Packet_otg_elt * otg_pkt_info; Packet_otg_elt * otg_pkt_info;
// we need to add conditions to avoid transmitting data when the UE is not RRC connected. // we need to add conditions to avoid transmitting data when the UE is not RRC connected.
...@@ -644,50 +644,39 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index ...@@ -644,50 +644,39 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
if (oai_emulation.info.otg_enabled ==1 ){ if (oai_emulation.info.otg_enabled ==1 ){
module_id = (eNB_flag == 1) ? eNB_index : NB_eNB_INST + UE_index ; module_id = (eNB_flag == 1) ? eNB_index : NB_eNB_INST + UE_index ;
//rb_id = (eNB_flag == 1) ? eNB_index * MAX_NUM_RB + DTCH : (NB_eNB_INST + UE_index -1 ) * MAX_NUM_RB + DTCH ; //rb_id = (eNB_flag == 1) ? eNB_index * MAX_NUM_RB + DTCH : (NB_eNB_INST + UE_index -1 ) * MAX_NUM_RB + DTCH ;
if (eNB_flag == 1) { // search for DL traffic
//for (dst_id = NB_eNB_INST; dst_id < NB_UE_INST + NB_eNB_INST; dst_id++) { while ((otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]))) != NULL) {
while ((otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]))) != NULL) { LOG_I(OTG,"Mod_id %d Frame %d Got a packet (%p), HEAD of otg_pdcp_buffer[%d] is %p and Nb elements is %d\n",
LOG_I(EMU,"HEAD of otg_pdcp_buffer[%d] is %p but Nb elts = %d\n", module_id, pkt_list_get_head(&(otg_pdcp_buffer[module_id])), otg_pdcp_buffer[module_id].nb_elements); module_id,frame, otg_pkt_info, module_id, pkt_list_get_head(&(otg_pdcp_buffer[module_id])), otg_pdcp_buffer[module_id].nb_elements);
//otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id])); //otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]));
dst_id = (otg_pkt_info->otg_pkt).dst_id; dst_id = (otg_pkt_info->otg_pkt).dst_id;
module_id = (otg_pkt_info->otg_pkt).module_id; module_id = (otg_pkt_info->otg_pkt).module_id;
rb_id = (otg_pkt_info->otg_pkt).rb_id; rb_id = (otg_pkt_info->otg_pkt).rb_id;
pdcp_mode = (otg_pkt_info->otg_pkt).mode; is_ue = (otg_pkt_info->otg_pkt).is_ue;
// LOG_I(PDCP,"pdcp_fifo, pdcp mode is= %d\n",pdcp_mode); pdcp_mode = (otg_pkt_info->otg_pkt).mode;
// LOG_I(PDCP,"pdcp_fifo, pdcp mode is= %d\n",pdcp_mode);
// generate traffic if the ue is rrc reconfigured state // generate traffic if the ue is rrc reconfigured state
// if (mac_get_rrc_status(module_id, eNB_flag, dst_id ) > 2 /*RRC_CONNECTED*/) { // not needed: this test is already done in update_otg_enb // if (mac_get_rrc_status(module_id, eNB_flag, dst_id ) > 2 /*RRC_CONNECTED*/) { // not needed: this test is already done in update_otg_enb
otg_pkt = (u8*) (otg_pkt_info->otg_pkt).sdu_buffer; otg_pkt = (u8*) (otg_pkt_info->otg_pkt).sdu_buffer;
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size; pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL) { if (otg_pkt != NULL) {
if (is_ue == 0 ) {
//rb_id = (/*NB_eNB_INST +*/ dst_id -1 ) * MAX_NUM_RB + DTCH; //rb_id = (/*NB_eNB_INST +*/ dst_id -1 ) * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d for pdcp mode %d\n", eNB_index, frame, pkt_cnt++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode); LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d for pdcp mode %d\n",
eNB_index, frame, pkt_cnt++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode);
pdcp_data_req(module_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,pdcp_mode); pdcp_data_req(module_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,pdcp_mode);
free(otg_pkt);
} }
// } //else LOG_D(OTG,"frame %d enb %d-> ue %d link not yet established state %d \n", frame, eNB_index,dst_id - NB_eNB_INST, mac_get_rrc_status(module_id, eNB_flag, dst_id - NB_eNB_INST)); else {
}
}
else {
while ((otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]))) != NULL) {
//otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]));
dst_id = (otg_pkt_info->otg_pkt).dst_id;
module_id = (otg_pkt_info->otg_pkt).module_id;
rb_id = (otg_pkt_info->otg_pkt).rb_id;
src_id = module_id;
// if (mac_get_rrc_status(module_id, eNB_flag, eNB_index ) > 2 /*RRC_CONNECTED*/) { // not needed: this test is already done in update_otg_ue
otg_pkt = (u8*) (otg_pkt_info->otg_pkt).sdu_buffer;
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL){
//rb_id= eNB_index * MAX_NUM_RB + DTCH; //rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n", UE_index, src_id, rb_id, src_id, dst_id, pkt_size); LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n",
UE_index, src_id, rb_id, src_id, dst_id, pkt_size);
pdcp_data_req(src_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO,pkt_size, otg_pkt, PDCP_DATA_PDU); pdcp_data_req(src_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO,pkt_size, otg_pkt, PDCP_DATA_PDU);
free(otg_pkt);
} }
//} //else LOG_D(OTG,"frame %d ue %d-> enb %d link not yet established state %d \n", frame, UE_index, eNB_index, mac_get_rrc_status(module_id, eNB_flag, eNB_index )); free(otg_pkt);
} }
// } //else LOG_D(OTG,"frame %d enb %d-> ue %d link not yet established state %d \n", frame, eNB_index,dst_id - NB_eNB_INST, mac_get_rrc_status(module_id, eNB_flag, dst_id - NB_eNB_INST));
} }
} }
#else #else
......
...@@ -137,11 +137,11 @@ typedef struct ...@@ -137,11 +137,11 @@ typedef struct
#ifdef Rel10 #ifdef Rel10
/// Send a received MCH sdu to MAC /// Send a received MCH sdu to MAC
void (*ue_send_mch_sdu)(u8 Mod_id,u32 frame,u8 *sdu,u16 sdu_len,u8 CH_index); void (*ue_send_mch_sdu)(u8 Mod_id,u32 frame,u8 *sdu,u16 sdu_len,u8 eNB_index,u8 sync_area);
/// Function to check if UE PHY needs to decode MCH for MAC /// Function to check if UE PHY needs to decode MCH for MAC
/// Return MCS value if need to decode, otherwise -1 /// get the sync area id, and teturn MCS value if need to decode, otherwise -1
int (*ue_query_mch)(uint8_t Mod_id,uint32_t frame,uint32_t subframe); int (*ue_query_mch)(uint8_t Mod_id,uint32_t frame,uint32_t subframe,uint8_t eNB_index,uint8_t *sync_area, uint8_t *mcch_active);
#endif #endif
/// Retrieve ULSCH sdu from MAC /// Retrieve ULSCH sdu from MAC
......
/*________________________openair_rrc_L2_interface.c________________________ /*******************************************************************************
Authors : Hicham Anouar Eurecom OpenAirInterface 2
Company : EURECOM Copyright(c) 1999 - 2010 Eurecom
Emails : anouar@eurecom.fr
________________________________________________________________*/ 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 l2_interface.c
* \brief layer 2 interface
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
#ifdef USER_MODE #ifdef USER_MODE
#include <fcntl.h> #include <fcntl.h>
...@@ -56,22 +87,20 @@ ________________________________________________________________*/ ...@@ -56,22 +87,20 @@ ________________________________________________________________*/
#include "openair_rrc_L2_interface.h" #include "openair_rrc_L2_interface.h"
/********************************************************************************************************************/ /********************************************************************************************************************/
s8 mac_rrc_data_req(u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag,u8 eNB_index){ s8 mac_rrc_data_req(u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area){
/********************************************************************************************************************/ /********************************************************************************************************************/
#ifdef CELLULAR #ifdef CELLULAR
return(rrc_L2_data_req_rx(Mod_id,Srb_id,Nb_tb,Buffer,eNB_index)); return(rrc_L2_data_req_rx(Mod_id,Srb_id,Nb_tb,Buffer,eNB_index));
#else #else
return(mac_rrc_lite_data_req(Mod_id,frame,Srb_id,Nb_tb,Buffer,eNB_flag,eNB_index)); return(mac_rrc_lite_data_req(Mod_id,frame,Srb_id,Nb_tb,Buffer,eNB_flag,eNB_index,mbsfn_sync_area));
#endif //CELLULAR #endif //CELLULAR
} }
/********************************************************************************************************************/ s8 mac_rrc_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu,u16 Sdu_len,u8 eNB_flag, u8 eNB_index,u8 mbsfn_sync_area){
s8 mac_rrc_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu,u16 Sdu_len,u8 eNB_flag, u8 eNB_index ){
/********************************************************************************************************************/
#ifdef CELLULAR #ifdef CELLULAR
return(rrc_L2_mac_data_ind_rx(Mod_id, Srb_id, Sdu, Sdu_len, eNB_index)); return(rrc_L2_mac_data_ind_rx(Mod_id, Srb_id, Sdu, Sdu_len, eNB_index));
#else #else
return(mac_rrc_lite_data_ind(Mod_id,frame,Srb_id,Sdu,Sdu_len,eNB_flag,eNB_index)); return(mac_rrc_lite_data_ind(Mod_id,frame,Srb_id,Sdu,Sdu_len,eNB_flag,eNB_index,mbsfn_sync_area));
#endif //CELLULAR #endif //CELLULAR
} }
......
/*________________________openair_rrc_L2_interface.h________________________ /*******************************************************************************
Authors : Hicham Anouar Eurecom OpenAirInterface 2
Company : EURECOM Copyright(c) 1999 - 2010 Eurecom
Emails : anouar@eurecom.fr
________________________________________________________________*/
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 l2_interface.c
* \brief layer 2 interface
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 1.0
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
*/
#ifndef __OPENAIR_RRC_L2_INTERFACE_H__ #ifndef __OPENAIR_RRC_L2_INTERFACE_H__
#define __OPENAIR_RRC_L2_INTERFACE_H__ #define __OPENAIR_RRC_L2_INTERFACE_H__
#include "COMMON/mac_rrc_primitives.h" #include "COMMON/mac_rrc_primitives.h"
s8 mac_rrc_data_req( u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8,u8); s8 mac_rrc_data_req( u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area);
s8 mac_rrc_data_ind( u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_len,u8,u8 Mui); s8 mac_rrc_data_ind( u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_len,u8 eNB_flag, u8 eNB_index,u8 mbsfn_sync_area);
void mac_lite_sync_ind( u8 Mod_id, u8 status); void mac_lite_sync_ind( u8 Mod_id, u8 status);
void mac_rrc_meas_ind(u8,MAC_MEAS_REQ_ENTRY*); void mac_rrc_meas_ind(u8,MAC_MEAS_REQ_ENTRY*);
void rlcrrc_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag,unsigned int Rb_id, u32 sdu_size,u8 *Buffer); void rlcrrc_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag,unsigned int Rb_id, u32 sdu_size,u8 *Buffer);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/*! \file l2_interface.c /*! \file l2_interface.c
* \brief layer 2 interface * \brief layer 2 interface
* \author Raymond Knopp * \author Raymond Knopp and Navid Nikaein
* \date 2011 * \date 2011
* \version 1.0 * \version 1.0
* \company Eurecom * \company Eurecom
...@@ -53,10 +53,9 @@ extern UE_MAC_INST *UE_mac_inst; ...@@ -53,10 +53,9 @@ extern UE_MAC_INST *UE_mac_inst;
#endif #endif
//#define RRC_DATA_REQ_DEBUG //#define RRC_DATA_REQ_DEBUG
//#define DEBUG_RRC #define DEBUG_RRC
u32 mui=0; u32 mui=0;
//---------------------------------------------------------------------------------------------//
s8 mac_rrc_lite_data_req( u8 Mod_id, s8 mac_rrc_lite_data_req( u8 Mod_id,
u32 frame, u32 frame,
...@@ -64,16 +63,15 @@ s8 mac_rrc_lite_data_req( u8 Mod_id, ...@@ -64,16 +63,15 @@ s8 mac_rrc_lite_data_req( u8 Mod_id,
u8 Nb_tb, u8 Nb_tb,
char *Buffer, char *Buffer,
u8 eNB_flag, u8 eNB_flag,
u8 eNB_index){ u8 eNB_index,
//------------------------------------------------------------------------------------------------------------------// u8 mbsfn_sync_area){
SRB_INFO *Srb_info; SRB_INFO *Srb_info;
u8 Sdu_size=0; u8 Sdu_size=0;
#ifdef DEBUG_RRC #ifdef DEBUG_RRC
int i; int i;
LOG_T(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_id,Srb_id); LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_id,Srb_id);
#endif #endif
if( eNB_flag == 1){ if( eNB_flag == 1){
...@@ -134,21 +132,24 @@ s8 mac_rrc_lite_data_req( u8 Mod_id, ...@@ -134,21 +132,24 @@ s8 mac_rrc_lite_data_req( u8 Mod_id,
#ifdef Rel10 #ifdef Rel10
if((Srb_id & RAB_OFFSET) == MCCH){ if((Srb_id & RAB_OFFSET) == MCCH){
if(eNB_rrc_inst[Mod_id].MCCH_MESS.Active==0) return 0; // this parameter is set in function init_mcch in rrc_eNB.c if(eNB_rrc_inst[Mod_id].MCCH_MESS[mbsfn_sync_area].Active==0) return 0; // this parameter is set in function init_mcch in rrc_eNB.c
if (eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE == 255) { // this part not needed as it is done in init_mcch
/* if (eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area] == 255) {
LOG_E(RRC,"[eNB %d] MAC Request for MCCH MESSAGE and MCCH MESSAGE is not initialized\n",Mod_id); LOG_E(RRC,"[eNB %d] MAC Request for MCCH MESSAGE and MCCH MESSAGE is not initialized\n",Mod_id);
mac_xface->macphy_exit(""); mac_xface->macphy_exit("");
} }*/
memcpy(&Buffer[0],eNB_rrc_inst[Mod_id].MCCH_MESSAGE,eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE); memcpy(&Buffer[0],
eNB_rrc_inst[Mod_id].MCCH_MESSAGE[mbsfn_sync_area],
eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
#ifdef DEBUG_RRC #ifdef DEBUG_RRC
LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_id,frame); LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_id,frame);
for (i=0;i<eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE;i++) for (i=0;i<eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area];i++)
LOG_T(RRC,"%x.",Buffer[i]); LOG_T(RRC,"%x.",Buffer[i]);
LOG_T(RRC,"\n"); LOG_T(RRC,"\n");
#endif #endif
return (eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE); return (eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
// } // }
//else //else
//return(0); //return(0);
...@@ -177,9 +178,7 @@ s8 mac_rrc_lite_data_req( u8 Mod_id, ...@@ -177,9 +178,7 @@ s8 mac_rrc_lite_data_req( u8 Mod_id,
return(0); return(0);
} }
//--------------------------------------------------------------------------------------------// s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_len,u8 eNB_flag,u8 eNB_index,u8 mbsfn_sync_area){
s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_len,u8 eNB_flag,u8 eNB_index ){
//------------------------------------------------------------------------------------------//
SRB_INFO *Srb_info; SRB_INFO *Srb_info;
int si_window; int si_window;
...@@ -246,8 +245,9 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le ...@@ -246,8 +245,9 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le
#ifdef Rel10 #ifdef Rel10
if ((Srb_id & RAB_OFFSET) == MCCH) { if ((Srb_id & RAB_OFFSET) == MCCH) {
LOG_T(RRC,"[UE %d] Received SDU for MCCH on SRB %d from eNB %d\n",Mod_id,Srb_id & RAB_OFFSET,eNB_index); LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %d from eNB %d\n",
decode_MCCH_Message(Mod_id, frame, eNB_index, Sdu, Sdu_len); Mod_id,frame, mbsfn_sync_area, Srb_id & RAB_OFFSET,eNB_index);
decode_MCCH_Message(Mod_id, frame, eNB_index, Sdu, Sdu_len,mbsfn_sync_area);
} }
#endif // Rel10 #endif // Rel10
......
...@@ -723,7 +723,7 @@ uint8_t do_SIB23(uint8_t Mod_id, ...@@ -723,7 +723,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
#ifdef Rel10 #ifdef Rel10
if (MBMS_flag > 0) { if (MBMS_flag > 0) {
LOG_I(RRC,"Adding MBSFN Configuration to SIB2\n"); LOG_I(RRC,"Adding MBSFN subframe Configuration 1 to SIB2\n");
MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1; MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1;
(*sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct MBSFN_SubframeConfigList)); (*sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct MBSFN_SubframeConfigList));
MBSFNSubframeConfigList = (*sib2)->mbsfn_SubframeConfigList; MBSFNSubframeConfigList = (*sib2)->mbsfn_SubframeConfigList;
...@@ -737,13 +737,34 @@ uint8_t do_SIB23(uint8_t Mod_id, ...@@ -737,13 +737,34 @@ uint8_t do_SIB23(uint8_t Mod_id,
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1); sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1; sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2; sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
if (frame_parms->frame_type == TDD) {// pattern 001110 for TDD if (frame_parms->frame_type == TDD) {
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused. sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused.
} }
else { // pattern 101010 for FDD) else {/// 111000
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x30<<2; sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2;
} }
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
if (MBMS_flag == 4 ) {
LOG_I(RRC,"Adding MBSFN subframe Configuration 2 to SIB2\n");
MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig2;
sib2_mbsfn_SubframeConfig2= CALLOC(1,sizeof(*sib2_mbsfn_SubframeConfig2));
memset((void*)sib2_mbsfn_SubframeConfig2,0,sizeof(*sib2_mbsfn_SubframeConfig2));
sib2_mbsfn_SubframeConfig2->radioframeAllocationPeriod= MBSFN_SubframeConfig__radioframeAllocationPeriod_n4;
sib2_mbsfn_SubframeConfig2->radioframeAllocationOffset= 1;
sib2_mbsfn_SubframeConfig2->subframeAllocation.present= MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame;
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.bits_unused= 2;
if (frame_parms->frame_type == TDD) {
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused.
}
else { ///000111
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2;
}
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig2);
}
} }
#else // no MBMS transmission #else // no MBMS transmission
(*sib2)->mbsfn_SubframeConfigList = NULL; (*sib2)->mbsfn_SubframeConfigList = NULL;
...@@ -813,7 +834,7 @@ uint8_t do_SIB23(uint8_t Mod_id, ...@@ -813,7 +834,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
} }
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2; MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n13; MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7;
ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1); ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1);
...@@ -836,7 +857,7 @@ uint8_t do_SIB23(uint8_t Mod_id, ...@@ -836,7 +857,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
else { else {
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6 MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6
} }
MBSFN_Area2->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n2; MBSFN_Area2->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7;
ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area2); ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area2);
} }
...@@ -1488,6 +1509,7 @@ uint8_t TMGI[5] = {4,3,2,1,0};//TMGI is a string of octet, ref. TS 24.008 fig. 1 ...@@ -1488,6 +1509,7 @@ uint8_t TMGI[5] = {4,3,2,1,0};//TMGI is a string of octet, ref. TS 24.008 fig. 1
#ifdef Rel10 #ifdef Rel10
uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms, uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t sync_area,
uint8_t *buffer, uint8_t *buffer,
MCCH_Message_t *mcch_message, MCCH_Message_t *mcch_message,
MBSFNAreaConfiguration_r9_t **mbsfnAreaConfiguration) { MBSFNAreaConfiguration_r9_t **mbsfnAreaConfiguration) {
...@@ -1513,11 +1535,25 @@ uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1513,11 +1535,25 @@ uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms,
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1); mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1; mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2; mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
if (frame_parms->frame_type == TDD) {// pattern 001110 for TDD // CURRENTLY WE ARE SUPPORITNG ONLY ONE sf ALLOCATION
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2bits cuz 2last bits are unused. switch (sync_area) {
} case 0:
else { // pattern 101010 for FDD) if (frame_parms->frame_type == TDD) {// pattern 001110 for TDD
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x30<<2; mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2bits cuz 2last bits are unused.
}
else { //111000
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2;
}
break;
case 1:
if (frame_parms->frame_type == TDD) {
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2bits cuz 2last bits are unused.
}
else { // 000111
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2;
}
default :
break;
} }
ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1); ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1);
...@@ -1530,7 +1566,7 @@ uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1530,7 +1566,7 @@ uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms,
memset((void*)pmch_Info_1,0,sizeof(PMCH_Info_r9_t)); memset((void*)pmch_Info_1,0,sizeof(PMCH_Info_r9_t));
pmch_Info_1->pmch_Config_r9.sf_AllocEnd_r9= 3;//take the value of last mbsfn subframe in this CSA period because there is only one PMCH in this mbsfn area pmch_Info_1->pmch_Config_r9.sf_AllocEnd_r9= 3;//take the value of last mbsfn subframe in this CSA period because there is only one PMCH in this mbsfn area
pmch_Info_1->pmch_Config_r9.dataMCS_r9= 13; pmch_Info_1->pmch_Config_r9.dataMCS_r9= 17;
pmch_Info_1->pmch_Config_r9.mch_SchedulingPeriod_r9= PMCH_Config_r9__mch_SchedulingPeriod_r9_rf16; pmch_Info_1->pmch_Config_r9.mch_SchedulingPeriod_r9= PMCH_Config_r9__mch_SchedulingPeriod_r9_rf16;
// MBMSs-SessionInfoList-r9 // MBMSs-SessionInfoList-r9
......
...@@ -127,11 +127,25 @@ uint8_t do_RRCConnectionReconfiguration(uint8_t Mod_id ...@@ -127,11 +127,25 @@ uint8_t do_RRCConnectionReconfiguration(uint8_t Mod_id
uint8_t *nas_pdu, uint8_t *nas_pdu,
uint32_t nas_length); uint32_t nas_length);
/** /***
\brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data) * \brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data)
@param buffer Pointer to PER-encoded ASN.1 description of MCCH-Message PDU * @param buffer Pointer to PER-encoded ASN.1 description of MCCH-Message PDU
@returns Size of encoded bit stream in bytes*/ * @returns Size of encoded bit stream in bytes
*/
uint8_t do_MCCHMessage(uint8_t *buffer); uint8_t do_MCCHMessage(uint8_t *buffer);
#ifdef Rel10
/***
* \brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data)
* @param buffer Pointer to PER-encoded ASN.1 description of MCCH-Message PDU
* @returns Size of encoded bit stream in bytes
*/
uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t sync_area,
uint8_t *buffer,
MCCH_Message_t *mcch_message,
MBSFNAreaConfiguration_r9_t **mbsfnAreaConfiguration);
#endif
OAI_UECapability_t *fill_ue_capability(); OAI_UECapability_t *fill_ue_capability();
......
...@@ -123,7 +123,7 @@ typedef struct{ ...@@ -123,7 +123,7 @@ typedef struct{
u8 SIB1Status; u8 SIB1Status;
u8 SIStatus; u8 SIStatus;
#ifdef Rel10 #ifdef Rel10
u8 MCCH_MESSAGEStatus; u8 MCCHStatus[8]; // MAX_MBSFN_AREA
#endif #endif
u8 SIwindowsize; u8 SIwindowsize;
u16 SIperiod; u16 SIperiod;
...@@ -214,11 +214,12 @@ typedef struct{ ...@@ -214,11 +214,12 @@ typedef struct{
#ifdef Rel10 #ifdef Rel10
SystemInformationBlockType13_r9_t *sib13; SystemInformationBlockType13_r9_t *sib13;
uint8_t MBMS_flag; uint8_t MBMS_flag;
uint8_t *MCCH_MESSAGE; uint8_t num_mbsfn_sync_area;
uint8_t sizeof_MCCH_MESSAGE; uint8_t **MCCH_MESSAGE; // MAX_MBSFN_AREA
uint8_t sizeof_MCCH_MESSAGE[8];// MAX_MBSFN_AREA
MCCH_Message_t mcch; MCCH_Message_t mcch;
MBSFNAreaConfiguration_r9_t *mcch_message; MBSFNAreaConfiguration_r9_t *mcch_message;
SRB_INFO MCCH_MESS; SRB_INFO MCCH_MESS[8];// MAX_MBSFN_AREA
#endif #endif
#ifdef CBA #ifdef CBA
uint8_t num_active_cba_groups; uint8_t num_active_cba_groups;
...@@ -460,12 +461,15 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(u8 Mod_id, u32 frame, ...@@ -460,12 +461,15 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(u8 Mod_id, u32 frame,
//L2_interface.c //L2_interface.c
s8 mac_rrc_lite_data_req( u8 Mod_id, u32 frame, unsigned short Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag,u8 eNB_index); s8 mac_rrc_lite_data_req( u8 Mod_id, u32 frame, unsigned short Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag, u8 eNB_index, u8 mbsfn_sync_area);
s8 mac_rrc_lite_data_ind( u8 Mod_id, u32 frame, unsigned short Srb_id, char *Sdu, unsigned short Sdu_len,u8 eNB_flag,u8 Mui); s8 mac_rrc_lite_data_ind( u8 Mod_id, u32 frame, unsigned short Srb_id, char *Sdu, unsigned short Sdu_len,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area);
void mac_sync_ind( u8 Mod_id, u8 status); void mac_sync_ind( u8 Mod_id, u8 status);
void rrc_lite_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag, u32 Rb_id, u32 sdu_size,u8 *Buffer); void rrc_lite_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag, u32 Rb_id, u32 sdu_size,u8 *Buffer);
void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, unsigned short eNB_index); void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, unsigned short eNB_index);
int decode_MCCH_Message(u8 Mod_id, u32 frame, u8 eNB_index, u8 *Sdu, u8 Sdu_len,u8 mbsfn_sync_area);
void decode_MBSFNAreaConfiguration(u8 Mod_id, u8 eNB_index, u32 frame,u8 mbsfn_sync_area);
int decode_SIB1(u8 Mod_id,u8 CH_index); int decode_SIB1(u8 Mod_id,u8 CH_index);
int decode_SI(u8 Mod_id,u32 frame,u8 CH_index,u8 si_window); int decode_SI(u8 Mod_id,u32 frame,u8 CH_index,u8 si_window);
......
...@@ -110,11 +110,12 @@ void init_SI_UE(u8 Mod_id,u8 eNB_index) { ...@@ -110,11 +110,12 @@ void init_SI_UE(u8 Mod_id,u8 eNB_index) {
#ifdef Rel10 #ifdef Rel10
void init_MCCH_UE(u8 Mod_id, u8 eNB_index) { void init_MCCH_UE(u8 Mod_id, u8 eNB_index) {
int i;
UE_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[eNB_index] = 0; UE_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[eNB_index] = 0;
UE_rrc_inst[Mod_id].MCCH_MESSAGE[eNB_index] = (u8 *)malloc16(32); UE_rrc_inst[Mod_id].MCCH_MESSAGE[eNB_index] = (u8 *)malloc16(32);
UE_rrc_inst[Mod_id].mcch_message[eNB_index] = (MBSFNAreaConfiguration_r9_t *)malloc16(sizeof(MBSFNAreaConfiguration_r9_t)); UE_rrc_inst[Mod_id].mcch_message[eNB_index] = (MBSFNAreaConfiguration_r9_t *)malloc16(sizeof(MBSFNAreaConfiguration_r9_t));
UE_rrc_inst[Mod_id].Info[eNB_index].MCCH_MESSAGEStatus = 0; for (i=0; i<8;i++) // MAX MBSFN Area
UE_rrc_inst[Mod_id].Info[eNB_index].MCCHStatus[i] = 0;
} }
#endif #endif
...@@ -1450,9 +1451,9 @@ void dump_sib2(SystemInformationBlockType2_t *sib2) { ...@@ -1450,9 +1451,9 @@ void dump_sib2(SystemInformationBlockType2_t *sib2) {
LOG_D(RRC,"ue_TimersAndConstants.n311 : %ld\n", sib2->ue_TimersAndConstants.n311); LOG_D(RRC,"ue_TimersAndConstants.n311 : %ld\n", sib2->ue_TimersAndConstants.n311);
LOG_D(RRC,"freqInfo.additionalSpectrumEmission : %ld\n",sib2->freqInfo.additionalSpectrumEmission); LOG_D(RRC,"freqInfo.additionalSpectrumEmission : %ld\n",sib2->freqInfo.additionalSpectrumEmission);
LOG_D(RRC,"freqInfo.ul_CarrierFreq : %ld\n", sib2->freqInfo.ul_CarrierFreq); LOG_D(RRC,"freqInfo.ul_CarrierFreq : %p\n", sib2->freqInfo.ul_CarrierFreq);
LOG_D(RRC,"freqInfo.ul_Bandwidth : %ld\n", sib2->freqInfo.ul_Bandwidth); LOG_D(RRC,"freqInfo.ul_Bandwidth : %p\n", sib2->freqInfo.ul_Bandwidth);
LOG_D(RRC,"mbsfn_SubframeConfigList : %ld\n", sib2->mbsfn_SubframeConfigList); LOG_D(RRC,"mbsfn_SubframeConfigList : %p\n", sib2->mbsfn_SubframeConfigList);
LOG_D(RRC,"timeAlignmentTimerCommon : %ld\n", sib2->timeAlignmentTimerCommon); LOG_D(RRC,"timeAlignmentTimerCommon : %ld\n", sib2->timeAlignmentTimerCommon);
...@@ -1636,14 +1637,15 @@ int decode_SI(u8 Mod_id,u32 frame,u8 eNB_index,u8 si_window) { ...@@ -1636,14 +1637,15 @@ int decode_SI(u8 Mod_id,u32 frame,u8 eNB_index,u8 si_window) {
} }
#ifdef Rel10 #ifdef Rel10
int decode_MCCH_Message(u8 Mod_id, u32 frame, u8 eNB_index, u8 *Sdu, u8 Sdu_len) { int decode_MCCH_Message(u8 Mod_id, u32 frame, u8 eNB_index, u8 *Sdu, u8 Sdu_len,u8 mbsfn_sync_area) {
MCCH_Message_t *mcch=NULL; MCCH_Message_t *mcch=NULL;
MBSFNAreaConfiguration_r9_t **mcch_message=&UE_rrc_inst[Mod_id].mcch_message[eNB_index]; MBSFNAreaConfiguration_r9_t **mcch_message=&UE_rrc_inst[Mod_id].mcch_message[eNB_index];
asn_dec_rval_t dec_rval; asn_dec_rval_t dec_rval;
if (UE_rrc_inst[Mod_id].Info[eNB_index].MCCH_MESSAGEStatus == 1) { if (UE_rrc_inst[Mod_id].Info[eNB_index].MCCHStatus[mbsfn_sync_area] == 1) {
LOG_D(RRC,"MCCH MESSAGE has been already received!\n"); LOG_D(RRC,"[UE %d] Frame %d: MCCH MESSAGE for MBSFN sync area %d has been already received!\n",
Mod_id, frame, mbsfn_sync_area);
return 0; // avoid decoding to prevent memory bloating return 0; // avoid decoding to prevent memory bloating
} }
else { else {
...@@ -1671,7 +1673,7 @@ int decode_MCCH_Message(u8 Mod_id, u32 frame, u8 eNB_index, u8 *Sdu, u8 Sdu_len) ...@@ -1671,7 +1673,7 @@ int decode_MCCH_Message(u8 Mod_id, u32 frame, u8 eNB_index, u8 *Sdu, u8 Sdu_len)
sizeof(MBSFNAreaConfiguration_r9_t)); */ sizeof(MBSFNAreaConfiguration_r9_t)); */
*mcch_message = &mcch->message.choice.c1.choice.mbsfnAreaConfiguration_r9; *mcch_message = &mcch->message.choice.c1.choice.mbsfnAreaConfiguration_r9;
LOG_I(RRC,"[UE %d] Frame %d : Found MBSFNAreaConfiguration from eNB %d \n",Mod_id, frame, eNB_index); LOG_I(RRC,"[UE %d] Frame %d : Found MBSFNAreaConfiguration from eNB %d \n",Mod_id, frame, eNB_index);
decode_MBSFNAreaConfiguration(Mod_id,eNB_index,frame); decode_MBSFNAreaConfiguration(Mod_id,eNB_index,frame, mbsfn_sync_area);
} }
} }
...@@ -1679,8 +1681,9 @@ int decode_MCCH_Message(u8 Mod_id, u32 frame, u8 eNB_index, u8 *Sdu, u8 Sdu_len) ...@@ -1679,8 +1681,9 @@ int decode_MCCH_Message(u8 Mod_id, u32 frame, u8 eNB_index, u8 *Sdu, u8 Sdu_len)
return 0; return 0;
} }
void decode_MBSFNAreaConfiguration(u8 Mod_id, u8 eNB_index, u32 frame) { void decode_MBSFNAreaConfiguration(u8 Mod_id, u8 eNB_index, u32 frame,u8 mbsfn_sync_area) {
LOG_D(RRC,"[UE %d] Number of MCH(s) in this MBSFN Area is %d\n", Mod_id, UE_rrc_inst[Mod_id].mcch_message[eNB_index]->pmch_InfoList_r9.list.count); LOG_D(RRC,"[UE %d] Frame %d : Number of MCH(s) in the MBSFN Sync Area %d is %d\n",
Mod_id, frame, mbsfn_sync_area, UE_rrc_inst[Mod_id].mcch_message[eNB_index]->pmch_InfoList_r9.list.count);
// store to MAC/PHY necessary parameters for receiving MTCHs // store to MAC/PHY necessary parameters for receiving MTCHs
rrc_mac_config_req(Mod_id,0,0,eNB_index, rrc_mac_config_req(Mod_id,0,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL, (RadioResourceConfigCommonSIB_t *)NULL,
...@@ -1710,15 +1713,19 @@ void decode_MBSFNAreaConfiguration(u8 Mod_id, u8 eNB_index, u32 frame) { ...@@ -1710,15 +1713,19 @@ void decode_MBSFNAreaConfiguration(u8 Mod_id, u8 eNB_index, u32 frame) {
#endif #endif
); );
UE_rrc_inst[Mod_id].Info[eNB_index].MCCH_MESSAGEStatus = 1; UE_rrc_inst[Mod_id].Info[eNB_index].MCCHStatus[mbsfn_sync_area] = 1;
// Config Radio Bearer for MBMS user data (similar way to configure for eNB side in init_MBMS function) // Config Radio Bearer for MBMS user data (similar way to configure for eNB side in init_MBMS function)
rrc_pdcp_config_asn1_req(NB_eNB_INST+Mod_id,frame, rrc_pdcp_config_asn1_req(NB_eNB_INST+Mod_id,frame,
0,// eNB_flag 0,// eNB_flag
eNB_index,// 0,// index eNB_index,// 0,// index
NULL, // SRB_ToAddModList NULL, // SRB_ToAddModList
NULL, // DRB_ToAddModList NULL, // DRB_ToAddModList
(DRB_ToReleaseList_t*)NULL (DRB_ToReleaseList_t*)NULL,
0, // security mode
NULL, // key rrc encryption
NULL, // key rrc integrity
NULL // key encryption
#ifdef Rel10 #ifdef Rel10
, ,
&(UE_rrc_inst[Mod_id].mcch_message[eNB_index]->pmch_InfoList_r9) &(UE_rrc_inst[Mod_id].mcch_message[eNB_index]->pmch_InfoList_r9)
......
...@@ -85,11 +85,11 @@ extern void *bigphys_malloc (int); ...@@ -85,11 +85,11 @@ extern void *bigphys_malloc (int);
extern inline unsigned int taus (void); extern inline unsigned int taus (void);
void void
init_SI (u8 Mod_id) init_SI (u8 Mod_id) {
{
u8 SIwindowsize = 1; u8 SIwindowsize = 1;
u16 SIperiod = 8; u16 SIperiod = 8;
int i;
/* /*
uint32_t mib=0; uint32_t mib=0;
int i; int i;
...@@ -170,8 +170,7 @@ init_SI (u8 Mod_id) ...@@ -170,8 +170,7 @@ init_SI (u8 Mod_id)
mac_xface->macphy_exit (""); mac_xface->macphy_exit ("");
eNB_rrc_inst[Mod_id].SIB23 = (u8 *) malloc16 (64); eNB_rrc_inst[Mod_id].SIB23 = (u8 *) malloc16 (64);
if (eNB_rrc_inst[Mod_id].SIB23) if (eNB_rrc_inst[Mod_id].SIB23) {
{
eNB_rrc_inst[Mod_id].sizeof_SIB23 = do_SIB23 (Mod_id, eNB_rrc_inst[Mod_id].sizeof_SIB23 = do_SIB23 (Mod_id,
mac_xface-> mac_xface->
...@@ -233,34 +232,37 @@ init_SI (u8 Mod_id) ...@@ -233,34 +232,37 @@ init_SI (u8 Mod_id)
#ifdef Rel10 #ifdef Rel10
if (eNB_rrc_inst[Mod_id].MBMS_flag > 0) if (eNB_rrc_inst[Mod_id].MBMS_flag > 0) {
{
for (i=0;
i< eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.count;
i++){
// SIB 2
// LOG_D(RRC, "[eNB %d] mbsfn_SubframeConfigList.list.count = %ld\n", Mod_id, eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.count); // LOG_D(RRC, "[eNB %d] mbsfn_SubframeConfigList.list.count = %ld\n", Mod_id, eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.count);
LOG_D (RRC, "[eNB %d] mbsfn_Subframe_pattern is = %ld\n", Mod_id, LOG_D (RRC, "[eNB %d] SIB13 contents for MBSFN subframe allocation %d/%d(partial)\n",
eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list. Mod_id,i,eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.count);
array[0]->subframeAllocation.choice.oneFrame.buf[0]); LOG_D (RRC, "[eNB %d] mbsfn_Subframe_pattern is = %x\n", Mod_id,
LOG_D (RRC, "[eNB %d] radioframe_allocation_period = %ld (just index number, not the real value)\n", Mod_id, eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.array[0]->radioframeAllocationPeriod); // need to display the real value, using array of char (like in dumping SIB2) eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]>>0);
LOG_D (RRC, "[eNB %d] radioframe_allocation_period = %ld (just index number, not the real value)\n", Mod_id, eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod); // need to display the real value, using array of char (like in dumping SIB2)
LOG_D (RRC, "[eNB %d] radioframe_allocation_offset = %ld\n", LOG_D (RRC, "[eNB %d] radioframe_allocation_offset = %ld\n",
Mod_id, Mod_id,
eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list. eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset);
array[0]->radioframeAllocationOffset); }
// SIB13 // SIB13
LOG_D (RRC, "[eNB %d] SIB13 contents (partial)\n", Mod_id); for (i=0;
LOG_D (RRC, "[eNB %d] Number of MBSFN Area: %ld\n", Mod_id, i< eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9.list.count;
eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9.list. i++){
count); LOG_D (RRC,"[eNB %d] SIB13 contents for MBSFN sync area %d/2 (partial)\n",
LOG_D (RRC, "[eNB %d] MCCH Info of first MBSFN Area(partial)\n", Mod_id, i,
Mod_id); eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9.list.count);
LOG_D (RRC, LOG_D (RRC,"[eNB %d] MCCH Repetition Period: %d (just index number, not real value)\n",
"[eNB %d] MCCH Repetition Period: %d (just index number, not real value)\n",
Mod_id, Mod_id,
eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9.list. eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9.list.array[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
array[0]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
LOG_D (RRC, "[eNB %d] MCCH Offset: %d\n", Mod_id, LOG_D (RRC, "[eNB %d] MCCH Offset: %d\n", Mod_id,
eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9.list. eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9.list.array[i]->mcch_Config_r9.mcch_Offset_r9);
array[0]->mcch_Config_r9.mcch_Offset_r9);
} }
}
#endif #endif
LOG_D (RRC, LOG_D (RRC,
...@@ -306,46 +308,50 @@ init_SI (u8 Mod_id) ...@@ -306,46 +308,50 @@ init_SI (u8 Mod_id)
#ifdef Rel10 #ifdef Rel10
void void
init_MCCH (u8 Mod_id) init_MCCH (u8 Mod_id) {
{
int sync_area=0;
// initialize RRC_eNB_INST MCCH entry // initialize RRC_eNB_INST MCCH entry
eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE = 0; eNB_rrc_inst[Mod_id].MCCH_MESSAGE=malloc(eNB_rrc_inst[Mod_id].num_mbsfn_sync_area*sizeof(uint32_t*));
eNB_rrc_inst[Mod_id].MCCH_MESSAGE = (u8 *) malloc16 (32); for (sync_area = 0;
if (eNB_rrc_inst[Mod_id].MCCH_MESSAGE) sync_area < eNB_rrc_inst[Mod_id].num_mbsfn_sync_area;
{ sync_area++){
eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE =
do_MBSFNAreaConfig (mac_xface->lte_frame_parms, eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[sync_area] = 0;
(uint8_t *) eNB_rrc_inst[Mod_id].MCCH_MESSAGE, eNB_rrc_inst[Mod_id].MCCH_MESSAGE[sync_area] = (u8 *) malloc16 (32);
&eNB_rrc_inst[Mod_id].mcch,
&eNB_rrc_inst[Mod_id].mcch_message); if (eNB_rrc_inst[Mod_id].MCCH_MESSAGE[sync_area] == NULL) {
LOG_E(RRC,"[eNB %d][MAIN] init_MCCH: FATAL, no memory for MCCH MESSAGE allocated \n", Mod_id);
LOG_D (RRC, "[eNB %d] MCCH_MESSAGE contents (partial)\n", Mod_id); mac_xface->macphy_exit("[RRC][init_MCCH] not enough memory\n");
} else {
eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[sync_area] = do_MBSFNAreaConfig (mac_xface->lte_frame_parms,
sync_area,
(uint8_t *) eNB_rrc_inst[Mod_id].MCCH_MESSAGE[sync_area],
&eNB_rrc_inst[Mod_id].mcch,
&eNB_rrc_inst[Mod_id].mcch_message);
LOG_I(RRC,"mcch message pointer %p for sync area %d \n", eNB_rrc_inst[Mod_id].MCCH_MESSAGE[sync_area],sync_area);
LOG_D (RRC, "[eNB %d] MCCH_MESSAGE contents for Sync Area %d (partial)\n", Mod_id,sync_area);
LOG_D (RRC, "[eNB %d] CommonSF_AllocPeriod_r9 %d\n", Mod_id, LOG_D (RRC, "[eNB %d] CommonSF_AllocPeriod_r9 %d\n", Mod_id,
eNB_rrc_inst[Mod_id].mcch_message->commonSF_AllocPeriod_r9); eNB_rrc_inst[Mod_id].mcch_message->commonSF_AllocPeriod_r9);
LOG_D (RRC, LOG_D (RRC,
"[eNB %d] CommonSF_Alloc_r9.list.count (number of MBSFN Subframe Pattern) %d\n", "[eNB %d] CommonSF_Alloc_r9.list.count (number of MBSFN Subframe Pattern) %d\n",
Mod_id, Mod_id,
eNB_rrc_inst[Mod_id].mcch_message->commonSF_Alloc_r9.list.count); eNB_rrc_inst[Mod_id].mcch_message->commonSF_Alloc_r9.list.count);
LOG_D (RRC, "[eNB %d] First MBSFN Subframe Pattern: %02x (in hex)\n", LOG_D (RRC, "[eNB %d] MBSFN Subframe Pattern: %02x (in hex)\n",
Mod_id, Mod_id,
eNB_rrc_inst[Mod_id].mcch_message->commonSF_Alloc_r9.list. eNB_rrc_inst[Mod_id].mcch_message->commonSF_Alloc_r9.list.
array[0]->subframeAllocation.choice.oneFrame.buf[0]); array[0]->subframeAllocation.choice.oneFrame.buf[0]);
if (eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[sync_area] == 255)
mac_xface->macphy_exit ("");
else
eNB_rrc_inst[Mod_id].MCCH_MESS[sync_area].Active = 1;
} }
else }
{
LOG_E (RRC,
"[eNB] init_MCCH: FATAL, no memory for MCCH MESSAGE allocated\n");
mac_xface->macphy_exit ("");
}
if (eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE == 255)
mac_xface->macphy_exit ("");
//Set the eNB_rrc_inst[Mod_id].MCCH_MESS.Active to 1 (allow to transfer MCCH message RRC->MAC in function mac_rrc_data_req) //Set the eNB_rrc_inst[Mod_id].MCCH_MESS.Active to 1 (allow to transfer MCCH message RRC->MAC in function mac_rrc_data_req)
eNB_rrc_inst[Mod_id].MCCH_MESS.Active = 1;
// ??Configure MCCH logical channel // ??Configure MCCH logical channel
// call mac_config_req with appropriate structure from ASN.1 description // call mac_config_req with appropriate structure from ASN.1 description
...@@ -368,9 +374,7 @@ init_MCCH (u8 Mod_id) ...@@ -368,9 +374,7 @@ init_MCCH (u8 Mod_id)
, ,
0, 0,
(MBSFN_AreaInfoList_r9_t *) NULL, (MBSFN_AreaInfoList_r9_t *) NULL,
(PMCH_InfoList_r9_t *) & (eNB_rrc_inst[Mod_id]. (PMCH_InfoList_r9_t *) & (eNB_rrc_inst[Mod_id].mcch_message->pmch_InfoList_r9)
mcch_message->
pmch_InfoList_r9)
#endif #endif
#ifdef CBA #ifdef CBA
, 0, 0 , 0, 0
...@@ -382,23 +386,25 @@ init_MCCH (u8 Mod_id) ...@@ -382,23 +386,25 @@ init_MCCH (u8 Mod_id)
} }
void void
init_MBMS (u8 Mod_id, u32 frame) init_MBMS (u8 Mod_id, u32 frame) {
{ // init the configuration for MTCH // init the configuration for MTCH
if (eNB_rrc_inst[Mod_id].MBMS_flag > 0) if (eNB_rrc_inst[Mod_id].MBMS_flag > 0) {
{
// LOG_I(RRC,"[eNB %d] Frame %d : Configuring Radio Bearer for MBMS service in MCH[%d]\n", Mod_id, frame,i); //check the lcid LOG_D(RRC,"[eNB %d] Frame %d : Radio Bearer config request for MBMS\n", Mod_id, frame); //check the lcid
// Configuring PDCP and RLC for MBMS Radio Bearer // Configuring PDCP and RLC for MBMS Radio Bearer
rrc_pdcp_config_asn1_req (Mod_id, frame, 1, 0, rrc_pdcp_config_asn1_req (Mod_id, frame, 1, 0,
NULL, // SRB_ToAddModList NULL, // SRB_ToAddModList
NULL, // DRB_ToAddModList NULL, // DRB_ToAddModList
(DRB_ToReleaseList_t *) NULL (DRB_ToReleaseList_t *) NULL,
0, // security mode
NULL, // key rrc encryption
NULL, // key rrc integrity
NULL // key encryption
#ifdef Rel10 #ifdef Rel10
, ,
&(eNB_rrc_inst[Mod_id].mcch_message-> &(eNB_rrc_inst[Mod_id].mcch_message->pmch_InfoList_r9)
pmch_InfoList_r9)
#endif #endif
); );
...@@ -507,13 +513,29 @@ openair_rrc_lite_eNB_init (u8 Mod_id) ...@@ -507,13 +513,29 @@ openair_rrc_lite_eNB_init (u8 Mod_id)
init_SI (Mod_id); init_SI (Mod_id);
#ifdef Rel10 #ifdef Rel10
if (eNB_rrc_inst[Mod_id].MBMS_flag > 0) switch (eNB_rrc_inst[Mod_id].MBMS_flag) {
{ case 1:
/// MCCH INIT case 2:
init_MCCH (Mod_id); case 3:
/// MTCH data bearer init LOG_I(RRC,"[eNB %d] Configuring 1 MBSFN sync area\n", Mod_id);
init_MBMS (Mod_id, 0); eNB_rrc_inst[Mod_id].num_mbsfn_sync_area=1;
} break;
case 4:
LOG_I(RRC,"[eNB %d] Configuring 2 MBSFN sync area\n", Mod_id);
eNB_rrc_inst[Mod_id].num_mbsfn_sync_area=2;
break;
default:
eNB_rrc_inst[Mod_id].num_mbsfn_sync_area=0;
break;
}
// if we are here the eNB_rrc_inst[Mod_id].MBMS_flag > 0,
/// MCCH INIT
if (eNB_rrc_inst[Mod_id].MBMS_flag > 0 ) {
init_MCCH (Mod_id);
/// MTCH data bearer init
init_MBMS (Mod_id, 0);
}
#endif #endif
#ifdef NO_RRM //init ch SRB0, SRB1 & BDTCH #ifdef NO_RRM //init ch SRB0, SRB1 & BDTCH
......
...@@ -32,12 +32,13 @@ typedef struct Signal_buffers { // (s = transmit, r,r0 = receive) ...@@ -32,12 +32,13 @@ typedef struct Signal_buffers { // (s = transmit, r,r0 = receive)
/*!\brief sybframe type : DL, UL, SF, */ /*!\brief sybframe type : DL, UL, SF, */
typedef struct Packet_otg { typedef struct Packet_otg {
unsigned int sdu_buffer_size; unsigned int sdu_buffer_size;
unsigned char *sdu_buffer; unsigned char *sdu_buffer;
int module_id; int module_id;
int rb_id; int rb_id;
int dst_id; int dst_id;
u8 mode; u8 is_ue;
u8 mode;
} Packet_otg; } Packet_otg;
typedef struct Event { typedef struct Event {
......
...@@ -662,6 +662,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need ...@@ -662,6 +662,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
unsigned char cba_group_active; unsigned char cba_group_active;
char * otg_traffic; char * otg_traffic;
unsigned char otg_bg_traffic_enabled; unsigned char otg_bg_traffic_enabled;
unsigned char omg_model_rn;
unsigned char omg_model_enb; unsigned char omg_model_enb;
unsigned char omg_model_ue; unsigned char omg_model_ue;
unsigned char omg_model_ue_current; // when mixed mbility is used unsigned char omg_model_ue_current; // when mixed mbility is used
......
...@@ -147,13 +147,13 @@ void update_nodes(double cur_time){ ...@@ -147,13 +147,13 @@ void update_nodes(double cur_time){
//LOG_D(OMG, "UPDATE NODES" ); //LOG_D(OMG, "UPDATE NODES" );
int i = 0; int i = 0;
for (i=(STATIC+1); i<MAX_NUM_MOB_TYPES; i++){ for (i=(STATIC+1); i<MAX_NUM_MOB_TYPES; i++){
if (Node_Vector[i] != NULL){ if (Node_Vector[i] != NULL){
//printf(" Mob model to update is: %d \n ", i); //printf(" Mob model to update is: %d \n ", i);
LOG_I(OMG, " Mob model to update is: %d \n ", i); LOG_I(OMG, " Mob model to update is: %d \n ", i);
update_node_vector(i, cur_time); update_node_vector(i, cur_time);
} }
} }
} }
...@@ -186,7 +186,7 @@ Node_list get_current_positions(int mobility_type, int node_type, double cur_tim ...@@ -186,7 +186,7 @@ Node_list get_current_positions(int mobility_type, int node_type, double cur_tim
switch (mobility_type) { switch (mobility_type) {
case STATIC: case STATIC:
Vector = (Node_list)Node_Vector[STATIC]; Vector = (Node_list)Node_Vector[STATIC];
LOG_I(OMG,"static vector %p is \n",Vector); LOG_T(OMG,"static vector %p is \n",Vector);
break; break;
case RWP: case RWP:
get_rwp_positions_updated(cur_time); get_rwp_positions_updated(cur_time);
......
...@@ -52,7 +52,7 @@ MAX_NUM_MOB_TYPES /*!< The maximum number of mobility models. Used to adjust the ...@@ -52,7 +52,7 @@ MAX_NUM_MOB_TYPES /*!< The maximum number of mobility models. Used to adjust the
typedef enum { typedef enum {
eNB=0, /*!< enhanced Node B */ eNB=0, /*!< enhanced Node B */
UE, /*!< User Equipement */ UE, /*!< User Equipement */
ALL, /*!< All the types. Used to perform the same operations to all the types of nodes */ ALL /*!< All the types. Used to perform the same operations to all the types of nodes */
}node_types; }node_types;
......
...@@ -166,7 +166,7 @@ void place_trace_node(NodePtr node) { ...@@ -166,7 +166,7 @@ void place_trace_node(NodePtr node) {
LOG_D(OMG,"--------INITIALIZE TRACE NODE-------- \n "); LOG_D(OMG,"--------INITIALIZE TRACE NODE-------- \n ");
LOG_I(OMG,"Initial position of node ID: %d type: %d (X = %.2f, Y = %.2f) speed = 0.0\n ", node->ID, node->type, node->X_pos, node->Y_pos); LOG_I(OMG,"Initial position of node ID: %d type: %d (X = %.2f, Y = %.2f) speed = %d\n ", node->ID, node->type, node->X_pos, node->Y_pos, node->mob->speed);
Node_Vector[TRACE] = (Node_list) add_entry(node, Node_Vector[TRACE]); Node_Vector[TRACE] = (Node_list) add_entry(node, Node_Vector[TRACE]);
Node_Vector_len[TRACE]++; Node_Vector_len[TRACE]++;
......
...@@ -62,7 +62,11 @@ typedef enum { ...@@ -62,7 +62,11 @@ typedef enum {
NO_PREDEFINED_MULTICAST_TRAFFIC =0, NO_PREDEFINED_MULTICAST_TRAFFIC =0,
MSCBR, MSCBR,
MMCBR, MMCBR,
MBCBR MBCBR,
MSVBR,
MMVBR,
MBVBR,
MVIDEO_VBR_4MBPS
}Multicast_Application; }Multicast_Application;
/** /**
...@@ -329,7 +333,6 @@ typedef struct { ...@@ -329,7 +333,6 @@ typedef struct {
int size_min[NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][MAX_NUM_APPLICATION]; /*!\brief Min Payload size, for uniform distrib */ int size_min[NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][MAX_NUM_APPLICATION]; /*!\brief Min Payload size, for uniform distrib */
int size_max[NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][MAX_NUM_APPLICATION]; /*!\brief payload, Max Inter Departure Time, for uniform distrib */ int size_max[NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_SERVICE_MAX][MAX_NUM_APPLICATION]; /*!\brief payload, Max Inter Departure Time, for uniform distrib */
}otg_multicast_t; }otg_multicast_t;
...@@ -483,6 +486,10 @@ typedef struct { ...@@ -483,6 +486,10 @@ typedef struct {
unsigned int rx_total_bytes_dl; unsigned int rx_total_bytes_dl;
/*TARMA parameteres*/
tarmaStream_t *mtarma_stream[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_NUM_APPLICATION];
tarmaVideo_t *mtarma_video[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_NUM_APPLICATION];
}otg_multicast_info_t; }otg_multicast_info_t;
......
...@@ -435,7 +435,7 @@ int check_data_transmit(int src,int dst, int app, int ctime){ ...@@ -435,7 +435,7 @@ int check_data_transmit(int src,int dst, int app, int ctime){
otg_info->ptime[src][dst][app]=ctime; otg_info->ptime[src][dst][app]=ctime;
if (state==PE_STATE) //compute the IDT only for PE STATE if (state==PE_STATE) //compute the IDT only for PE STATE
tarmaUpdateInputSample(otg_info->tarma_stream[src][dst][app]); tarmaUpdateInputSample(otg_info->tarma_stream[src][dst][app]);
otg_info->idt[src][dst][app]=time_dist(src, dst, app,state); otg_info->idt[src][dst][app]=time_dist(src, dst, app,state);
otg_info->gen_pkts=1; otg_info->gen_pkts=1;
header_size_gen(src,dst, app); header_size_gen(src,dst, app);
...@@ -662,27 +662,134 @@ unsigned char * serialize_buffer(char* header, char* payload, unsigned int buffe ...@@ -662,27 +662,134 @@ unsigned char * serialize_buffer(char* header, char* payload, unsigned int buffe
void init_predef_multicast_traffic() { void init_predef_multicast_traffic() {
int i, j, k; int i, j, k;
for (i=0; i<1; i++){ // src //maxServiceCount for (i=0; i<2; i++){ // src //maxServiceCount
for (j=1; j<2; j++){ // dst // maxSessionPerPMCH for (j=1; j<3; j++){ // dst // maxSessionPerPMCH
for (k=0; k<1/*MAX_NUM_APPLICATION*/; k++){ for (k=0; k<1/*MAX_NUM_APPLICATION*/; k++){
switch(g_otg_multicast->application_type[i][j][k]){ switch(g_otg_multicast->application_type[i][j][k]){
case MSCBR : case MSCBR :
//LOG_D(OTG, "configure MSCBR for MBMS (service %d, session %d, app %d)\n", i, j, k); LOG_D(OTG, "configure MSCBR for eMBMS (service %d, session %d, app %d)\n", i, j, k);
g_otg_multicast->trans_proto[i][j][k]= UDP; g_otg_multicast->trans_proto[i][j][k]= UDP;
g_otg_multicast->ip_v[i][j][k]= IPV4; g_otg_multicast->ip_v[i][j][k]= IPV4;
g_otg_multicast->idt_dist[i][j][k]= UNIFORM; g_otg_multicast->idt_dist[i][j][k]= FIXED;
g_otg_multicast->idt_min[i][j][k]= 20;// can modify here to increase the frequency of generate data g_otg_multicast->idt_min[i][j][k]= 40;// can modify here to increase the frequency of generate data
g_otg_multicast->idt_max[i][j][k]= 50; g_otg_multicast->idt_max[i][j][k]= 40;
g_otg_multicast->size_dist[i][j][k]= UNIFORM; g_otg_multicast->size_dist[i][j][k]= FIXED;
g_otg_multicast->size_min[i][j][k]= 768; g_otg_multicast->size_min[i][j][k]= 256;
g_otg_multicast->size_max[i][j][k]= 1024 ;//can not be greater than 1500 which is max_ip_packet_size in pdcp.c g_otg_multicast->size_max[i][j][k]= 256;//can not be greater than 1500 which is max_ip_packet_size in pdcp.c
g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration
header_size_gen_multicast(i,j,k); header_size_gen_multicast(i,j,k);
break; break;
case MMCBR :
LOG_D(OTG, "configure MSCBR for eMBMS (service %d, session %d, app %d)\n", i, j, k);
g_otg_multicast->trans_proto[i][j][k]= UDP;
g_otg_multicast->ip_v[i][j][k]= IPV4;
g_otg_multicast->idt_dist[i][j][k]= FIXED;
g_otg_multicast->idt_min[i][j][k]= 30;// can modify here to increase the frequency of generate data
g_otg_multicast->idt_max[i][j][k]= 40;
g_otg_multicast->size_dist[i][j][k]= FIXED;
g_otg_multicast->size_min[i][j][k]= 768;
g_otg_multicast->size_max[i][j][k]= 768 ;//can not be greater than 1500 which is max_ip_packet_size in pdcp.c
g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration
header_size_gen_multicast(i,j,k);
break;
case MBCBR :
LOG_D(OTG, "configure MSCBR for eMBMS (service %d, session %d, app %d)\n", i, j, k);
g_otg_multicast->trans_proto[i][j][k]= UDP;
g_otg_multicast->ip_v[i][j][k]= IPV4;
g_otg_multicast->idt_dist[i][j][k]=FIXED;
g_otg_multicast->idt_min[i][j][k]= 20;// can modify here to increase the frequency of generate data
g_otg_multicast->idt_max[i][j][k]= 20;
g_otg_multicast->size_dist[i][j][k]= FIXED;
g_otg_multicast->size_min[i][j][k]= 1400;
g_otg_multicast->size_max[i][j][k]= 1400 ;//can not be greater than 1500 which is max_ip_packet_size in pdcp.c
g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration
header_size_gen_multicast(i,j,k);
break;
case MSVBR:
LOG_D(OTG, "configure MSCBR for eMBMS (service %d, session %d, app %d)\n", i, j, k);
g_otg_multicast->trans_proto[i][j][k]= UDP;
g_otg_multicast->ip_v[i][j][k]= IPV4;
g_otg_multicast->idt_dist[i][j][k]=UNIFORM;
g_otg_multicast->idt_min[i][j][k]= 20;// can modify here to increase the frequency of generate data
g_otg_multicast->idt_max[i][j][k]= 40;
g_otg_multicast->size_dist[i][j][k]= UNIFORM;
g_otg_multicast->size_min[i][j][k]= 64;
g_otg_multicast->size_max[i][j][k]= 512 ;//can not be greater than 1500 which is max_ip_packet_size in pdcp.c
g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration
header_size_gen_multicast(i,j,k);
break;
case MMVBR:
LOG_D(OTG, "configure MSCBR for eMBMS (service %d, session %d, app %d)\n", i, j, k);
g_otg_multicast->trans_proto[i][j][k]= UDP;
g_otg_multicast->ip_v[i][j][k]= IPV4;
g_otg_multicast->idt_dist[i][j][k]=UNIFORM;
g_otg_multicast->idt_min[i][j][k]= 15;// can modify here to increase the frequency of generate data
g_otg_multicast->idt_max[i][j][k]= 30;
g_otg_multicast->size_dist[i][j][k]= UNIFORM;
g_otg_multicast->size_min[i][j][k]= 512;
g_otg_multicast->size_max[i][j][k]= 1024 ;//can not be greater than 1500 which is max_ip_packet_size in pdcp.c
g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration
header_size_gen_multicast(i,j,k);
break;
case MBVBR:
LOG_D(OTG, "configure MSCBR for eMBMS (service %d, session %d, app %d)\n", i, j, k);
g_otg_multicast->trans_proto[i][j][k]= UDP;
g_otg_multicast->ip_v[i][j][k]= IPV4;
g_otg_multicast->idt_dist[i][j][k]=UNIFORM;
g_otg_multicast->idt_min[i][j][k]= 5;// can modify here to increase the frequency of generate data
g_otg_multicast->idt_max[i][j][k]= 15;
g_otg_multicast->size_dist[i][j][k]= UNIFORM;
g_otg_multicast->size_min[i][j][k]= 1024;
g_otg_multicast->size_max[i][j][k]= 1400 ;//can not be greater than 1500 which is max_ip_packet_size in pdcp.c
g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration
header_size_gen_multicast(i,j,k);
break;
case MVIDEO_VBR_4MBPS :
LOG_D(OTG,"Configure MSCBR for eMBMS (service %d, session %d, app %d)\n", i, j, k);
g_otg_multicast->trans_proto[i][j][k]= UDP;
g_otg_multicast->ip_v[i][j][k]= IPV4;
g_otg_multicast->idt_dist[i][j][k]= FIXED;
g_otg_multicast->idt_min[i][j][k]= 40;// can modify here to increase the frequency of generate data
g_otg_multicast->idt_max[i][j][k]= 40;
/*the tarma initialization*/
otg_multicast_info->mtarma_video[i][j][k]=tarmaInitVideo(0);
tarmaSetupVideoGop12(otg_multicast_info->mtarma_video[i][j][k],2.5);
LOG_I(OTG,"[CONFIG] Multicast Video VBR 4MBPS, src = %d, dst = %d, dist IDT = %d\n", i, j, g_otg_multicast->idt_dist[i][j][k]);
//g_otg_multicast->duration[i][j][k] = 1000; // the packet will be generated after duration
header_size_gen_multicast(i,j,k);
break;
default : default :
LOG_W(OTG, "not supported model for multicast traffic\n"); LOG_W(OTG, "not supported model for multicast traffic\n");
......
...@@ -559,7 +559,7 @@ static void *eNB_thread(void *arg) ...@@ -559,7 +559,7 @@ static void *eNB_thread(void *arg)
if (fs4_test==0) if (fs4_test==0)
{ {
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0, 0); phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0, 0,NULL);
#ifndef IFFT_FPGA #ifndef IFFT_FPGA
slot_offset_F = (next_slot)* slot_offset_F = (next_slot)*
(PHY_vars_eNB_g[0]->lte_frame_parms.ofdm_symbol_size)* (PHY_vars_eNB_g[0]->lte_frame_parms.ofdm_symbol_size)*
...@@ -781,7 +781,7 @@ static void *UE_thread(void *arg) ...@@ -781,7 +781,7 @@ static void *UE_thread(void *arg)
*/ */
in = rt_get_time_ns(); in = rt_get_time_ns();
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[0], 0, 0,mode,0); phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[0], 0, 0,mode,0,NULL);
out = rt_get_time_ns(); out = rt_get_time_ns();
diff = out-in; diff = out-in;
......
<OAI_EMULATION>
-
<ENVIRONMENT_SYSTEM_CONFIG>
<FADING>
<LARGE_SCALE>urban</LARGE_SCALE>
<FREE_SPACE_MODEL_PARAMETERS>
<PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT>
<PATHLOSS_0_dB>-111</PATHLOSS_0_dB>
</FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>Rayleigh1</SMALL_SCALE>
</FADING>
<SYSTEM_BANDWIDTH_MB>7.68</SYSTEM_BANDWIDTH_MB>
<SYSTEM_FREQUENCY_GHz>1.9</SYSTEM_FREQUENCY_GHz>
<TRANSMISSION_MODE>1</TRANSMISSION_MODE>
<ANTENNA>
<eNB_ANTENNA>
<RX_NOISE_LEVEL_dB>0</RX_NOISE_LEVEL_dB>
<NUMBER_OF_SECTORS>1</NUMBER_OF_SECTORS>
<BEAM_WIDTH_dB>0</BEAM_WIDTH_dB>
<ANTENNA_GAIN_dBi>0</ANTENNA_GAIN_dBi>
<TX_POWER_dBm>15</TX_POWER_dBm>
</eNB_ANTENNA>
<UE_ANTENNA>
<RX_NOISE_LEVEL_dB>0</RX_NOISE_LEVEL_dB>
<ANTENNA_GAIN_dBi>0</ANTENNA_GAIN_dBi>
<TX_POWER_dBm>20</TX_POWER_dBm>
</UE_ANTENNA>
</ANTENNA>
</ENVIRONMENT_SYSTEM_CONFIG>
<TOPOLOGY_CONFIG>
<AREA>
<X_m>800</X_m>
<Y_m>800</Y_m>
</AREA>
<MOBILITY>
<UE_MOBILITY>
<UE_INITIAL_DISTRIBUTION>random</UE_INITIAL_DISTRIBUTION>
<RANDOM_UE_DISTRIBUTION>
<NUMBER_OF_NODES>1</NUMBER_OF_NODES>
</RANDOM_UE_DISTRIBUTION>
<UE_MOBILITY_TYPE>TRACE</UE_MOBILITY_TYPE>
<TRACE_MOBILITY_FILE>static_1ue.tr</TRACE_MOBILITY_FILE>
</UE_MOBILITY>
<eNB_MOBILITY>
<eNB_INITIAL_DISTRIBUTION>random</eNB_INITIAL_DISTRIBUTION>
<RANDOM_eNB_DISTRIBUTION>
<NUMBER_OF_CELLS>1</NUMBER_OF_CELLS>
</RANDOM_eNB_DISTRIBUTION>
<eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE>
</eNB_MOBILITY>
</MOBILITY>
</TOPOLOGY_CONFIG>
<EMULATION_CONFIG>
<EMULATION_TIME_ms>1200</EMULATION_TIME_ms>
<CURVE>disable</CURVE>
<LOG> <!-- set the global log level -->
<LEVEL>info</LEVEL>
<VERBOSITY>low</VERBOSITY> <!-- low, medium, high, full -->
<INTERVAL>1</INTERVAL>
</LOG>
<SEED_VALUE>69</SEED_VALUE> <!-- value 0 means randomly generated by OAI -->
</EMULATION_CONFIG>
<PROFILE>eMBMS_OMG_REF_1</PROFILE>
</OAI_EMULATION>
...@@ -59,7 +59,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame,u16 next_slot ...@@ -59,7 +59,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame,u16 next_slot
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
if (is_pmch_subframe(frame,next_slot>>1,frame_parms)) { if (is_pmch_subframe(frame,next_slot>>1,frame_parms)) {
if ((next_slot%2)==0) { if ((next_slot%2)==0) {
printf("MBSFN eNB sim: Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset); LOG_D(OCM,"Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset);
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
&txdata[aa][slot_offset], // output &txdata[aa][slot_offset], // output
frame_parms->log2_symbol_size, // log2_fft_size frame_parms->log2_symbol_size, // log2_fft_size
...@@ -79,7 +79,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame,u16 next_slot ...@@ -79,7 +79,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame,u16 next_slot
frame_parms->rev, // bit-reversal permutation frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX); CYCLIC_PREFIX);
else { else {
printf("MBSFN eNB sim: Frame %d, subframe %d: Doing PDCCH modulation\n",frame,next_slot>>1); LOG_D(OCM,"Frame %d, subframe %d: Doing PDCCH modulation\n",frame,next_slot>>1);
normal_prefix_mod(&txdataF[aa][slot_offset_F], normal_prefix_mod(&txdataF[aa][slot_offset_F],
&txdata[aa][slot_offset], &txdata[aa][slot_offset],
2, 2,
......
...@@ -59,9 +59,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -59,9 +59,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
exit(-1); exit(-1);
} }
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL, 0); // this is the transmission mode for the signalling channels
// this is the transmission mode for the signalling channels
// this will be overwritten with the real transmission mode by the RRC once the UE is connected // this will be overwritten with the real transmission mode by the RRC once the UE is connected
PHY_vars_eNB->transmission_mode[i] = transmission_mode; PHY_vars_eNB->transmission_mode[i] = transmission_mode;
...@@ -78,7 +76,10 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -78,7 +76,10 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
LOG_D(PHY,"eNB %d : SI %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_SI); LOG_D(PHY,"eNB %d : SI %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_SI);
PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,1,frame_parms->N_RB_DL, abstraction_flag); PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,1,frame_parms->N_RB_DL, abstraction_flag);
LOG_D(PHY,"eNB %d : RA %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_ra); LOG_D(PHY,"eNB %d : RA %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_ra);
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_MCH);
PHY_vars_eNB->rx_total_gain_eNB_dB=140; PHY_vars_eNB->rx_total_gain_eNB_dB=140;
for(i=0;i<NUMBER_OF_UE_MAX;i++) for(i=0;i<NUMBER_OF_UE_MAX;i++)
...@@ -138,7 +139,26 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -138,7 +139,26 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
return (PHY_vars_UE); return (PHY_vars_UE);
} }
PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
u8 RN_id,
u8 eMBMS_active_state) {
int i;
PHY_VARS_RN* PHY_vars_RN = malloc(sizeof(PHY_VARS_RN));
memset(PHY_vars_RN,0,sizeof(PHY_VARS_RN));
PHY_vars_RN->Mod_id=RN_id;
if (eMBMS_active_state == multicast_relay) {
for (i=0; i < 10 ; i++){ // num SF in a frame
PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH[%d] %p\n",RN_id,i,PHY_vars_RN->dlsch_rn_MCH[i]);
}
} else {
PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH[0] %p\n",RN_id,PHY_vars_RN->dlsch_rn_MCH[0]);
}
return (PHY_vars_RN);
}
void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms, void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 frame_type, u8 frame_type,
u8 tdd_config, u8 tdd_config,
...@@ -147,9 +167,9 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms, ...@@ -147,9 +167,9 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 N_RB_DL, u8 N_RB_DL,
u16 Nid_cell, u16 Nid_cell,
u8 cooperation_flag,u8 transmission_mode,u8 abstraction_flag, u8 cooperation_flag,u8 transmission_mode,u8 abstraction_flag,
int nb_antennas_rx) { int nb_antennas_rx, u8 eMBMS_active_state) {
u8 eNB_id,UE_id; u8 eNB_id,UE_id,RN_id;
mac_xface = malloc(sizeof(MAC_xface)); mac_xface = malloc(sizeof(MAC_xface));
...@@ -192,9 +212,15 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms, ...@@ -192,9 +212,15 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
(*frame_parms)->nb_antennas_rx = nb_antennas_rx; (*frame_parms)->nb_antennas_rx = nb_antennas_rx;
PHY_vars_UE_g = malloc(NB_UE_INST*sizeof(PHY_VARS_UE*)); PHY_vars_UE_g = malloc(NB_UE_INST*sizeof(PHY_VARS_UE*));
for (UE_id=0; UE_id<NB_UE_INST;UE_id++){ // begin navid for (UE_id=0; UE_id<NB_UE_INST;UE_id++){
PHY_vars_UE_g[UE_id] = init_lte_UE(*frame_parms, UE_id,abstraction_flag,transmission_mode); PHY_vars_UE_g[UE_id] = init_lte_UE(*frame_parms, UE_id,abstraction_flag,transmission_mode);
} }
if (NB_RN_INST > 0) {
PHY_vars_RN_g = malloc(NB_RN_INST*sizeof(PHY_VARS_RN*));
for (RN_id=0; RN_id<NB_RN_INST;RN_id++){
PHY_vars_RN_g[RN_id] = init_lte_RN(*frame_parms,RN_id,eMBMS_active_state);
}
}
} }
...@@ -13,6 +13,9 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -13,6 +13,9 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
u8 abstraction_flag, u8 abstraction_flag,
u8 transmission_mode); u8 transmission_mode);
PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
u8 RN_id,
u8 eMBMS_active_state);
void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms, void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 frame_type, u8 frame_type,
...@@ -24,4 +27,5 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms, ...@@ -24,4 +27,5 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 cooperation_flag, u8 cooperation_flag,
u8 transmission_mode, u8 transmission_mode,
u8 abstraction_flag, u8 abstraction_flag,
int nb_antennas_rx); int nb_antennas_rx,
u8 eMBMS_active_state);
...@@ -329,7 +329,7 @@ int omv_write (int pfd, Node_list enb_node_list, Node_list ue_node_list, Data_F ...@@ -329,7 +329,7 @@ int omv_write (int pfd, Node_list enb_node_list, Node_list ue_node_list, Data_F
} }
} }
} }
LOG_E(OMG,"pfd %d \n", pfd);
if( write( pfd, &omv_data, sizeof(struct Data_Flow_Unit) ) == -1 ) if( write( pfd, &omv_data, sizeof(struct Data_Flow_Unit) ) == -1 )
perror( "write omv failed" ); perror( "write omv failed" );
return 1; return 1;
...@@ -343,16 +343,16 @@ void omv_end (int pfd, Data_Flow_Unit omv_data) { ...@@ -343,16 +343,16 @@ void omv_end (int pfd, Data_Flow_Unit omv_data) {
#endif #endif
Packet_OTG_List *otg_pdcp_buffer; Packet_OTG_List *otg_pdcp_buffer;
#ifdef OPENAIR2
int pfd[2]; // fd for omv : fixme: this could be a local var
#endif
int main (int argc, char **argv) {
int
main (int argc, char **argv)
{
s32 i; s32 i;
// pointers signal buffers (s = transmit, r,r0 = receive) // pointers signal buffers (s = transmit, r,r0 = receive)
clock_t t; clock_t t;
// Framing variables // Framing variables
s32 slot, last_slot, next_slot; s32 slot, last_slot, next_slot;
...@@ -373,9 +373,7 @@ int ...@@ -373,9 +373,7 @@ int
lte_subframe_t direction; lte_subframe_t direction;
#ifdef OPENAIR2
int pfd[2]; // fd for omv : fixme: this could be a local var
#endif
char fname[64],vname[64]; char fname[64],vname[64];
// u8 awgn_flag = 0; // u8 awgn_flag = 0;
...@@ -420,8 +418,8 @@ int ...@@ -420,8 +418,8 @@ int
//Default values if not changed by the user in get_simulation_options(); //Default values if not changed by the user in get_simulation_options();
pdcp_period = 1; pdcp_period = 1;
omg_period = 10; omg_period = 1;
// start thread for log gen // start thread for log gen
log_thread_init(); log_thread_init();
init_oai_emulation(); // to initialize everything !!! init_oai_emulation(); // to initialize everything !!!
...@@ -448,14 +446,20 @@ int ...@@ -448,14 +446,20 @@ int
// configure oaisim with OCG // configure oaisim with OCG
oaisim_config(); // config OMG and OCG, OPT, OTG, OLG oaisim_config(); // config OMG and OCG, OPT, OTG, OLG
if (ue_connection_test == 1) {
snr_direction = -snr_step;
snr_dB=20;
sinr_dB=-20;
}
#ifdef OPENAIR2 #ifdef OPENAIR2
init_omv(); init_omv();
#endif #endif
//Before this call, NB_UE_INST and NB_eNB_INST are not set correctly //Before this call, NB_UE_INST and NB_eNB_INST are not set correctly
check_and_adjust_params(); check_and_adjust_params();
init_otg_pdcp_buffer();
#ifdef PRINT_STATS #ifdef PRINT_STATS
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
sprintf(UE_stats_filename,"UE_stats%d.txt",UE_id); sprintf(UE_stats_filename,"UE_stats%d.txt",UE_id);
...@@ -487,31 +491,11 @@ int ...@@ -487,31 +491,11 @@ int
#endif #endif
#endif #endif
if (NB_RN_INST > 0 ) {
LOG_N(EMU,"Total number of RN %d (local %d, remote %d) mobility (the same as eNB) %s \n", NB_RN_INST,oai_emulation.info.nb_rn_local,oai_emulation.info.nb_rn_remote, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_N(EMU,"Adjust the number of eNB inst (%d->%d) and UE inst (%d->%d)\n ",
NB_eNB_INST, NB_eNB_INST+NB_RN_INST,
NB_UE_INST, NB_UE_INST+NB_RN_INST);
NB_eNB_INST+=NB_RN_INST;
NB_UE_INST+=NB_RN_INST;
}
LOG_I(EMU,"Total number of UE %d (local %d, remote %d, relay %d) mobility %s \n",
NB_UE_INST,oai_emulation.info.nb_ue_local,oai_emulation.info.nb_ue_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_I(EMU,"Total number of eNB %d (local %d, remote %d, relay %d) mobility %s \n",
NB_eNB_INST,oai_emulation.info.nb_enb_local,oai_emulation.info.nb_enb_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option);
LOG_I(OCM,"Running with frame_type %d, Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n",
oai_emulation.info.frame_type, Nid_cell, oai_emulation.info.N_RB_DL, oai_emulation.info.extended_prefix_flag, oai_emulation.info.transmission_mode,target_dl_mcs,rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option);
set_seed = oai_emulation.emulation_config.seed.value; set_seed = oai_emulation.emulation_config.seed.value;
init_otg_pdcp_buffer();
init_seed(set_seed); init_seed(set_seed);
init_openair1(); init_openair1();
...@@ -551,23 +535,13 @@ int ...@@ -551,23 +535,13 @@ int
init_time(); init_time();
LOG_I(EMU,">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
LOG_I (EMU,"after init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell);
LOG_I(EMU,"after 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);
if (ue_connection_test == 1) {
snr_direction = -snr_step;
snr_dB=20;
sinr_dB=-20;
}
init_slot_isr(); init_slot_isr();
t = clock(); t = clock();
LOG_N(EMU,"\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
for (frame=0; frame<oai_emulation.info.n_frames; frame++) { for (frame=0; frame<oai_emulation.info.n_frames; frame++) {
/* /*
// Handling the cooperation Flag // Handling the cooperation Flag
...@@ -658,7 +632,8 @@ int ...@@ -658,7 +632,8 @@ int
pdcp_run(frame, 1, 0, eNB_id);//PHY_vars_eNB_g[eNB_id]->Mod_id pdcp_run(frame, 1, 0, eNB_id);//PHY_vars_eNB_g[eNB_id]->Mod_id
// PHY_vars_eNB_g[eNB_id]->frame = frame; // PHY_vars_eNB_g[eNB_id]->frame = frame;
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag, no_relay); phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag,
no_relay,NULL);
#ifdef PRINT_STATS #ifdef PRINT_STATS
if(last_slot==9 && frame%10==0) if(last_slot==9 && frame%10==0)
...@@ -704,7 +679,8 @@ int ...@@ -704,7 +679,8 @@ int
//Access layer //Access layer
pdcp_run(frame, 0, UE_id, 0); pdcp_run(frame, 0, UE_id, 0);
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx, no_relay); phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx,
no_relay,NULL);
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id]->tx_power_dBm; ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id]->tx_power_dBm;
} }
} }
...@@ -759,6 +735,7 @@ int ...@@ -759,6 +735,7 @@ int
LOG_E(EMU,"Not supported eMBMS option when relaying is enabled %d\n", r_type); LOG_E(EMU,"Not supported eMBMS option when relaying is enabled %d\n", r_type);
exit(-1); exit(-1);
} }
PHY_vars_RN_g[RN_id]->frame = frame;
if ( oai_emulation.info.frame_type == 0) { if ( oai_emulation.info.frame_type == 0) {
// RN == UE // RN == UE
if (frame>0) { if (frame>0) {
...@@ -766,17 +743,17 @@ int ...@@ -766,17 +743,17 @@ int
LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, UE_id, frame, slot, next_slot >> 1,last_slot>>1); RN_id, UE_id, frame, slot, next_slot >> 1,last_slot>>1);
PHY_vars_UE_g[UE_id]->frame = frame; PHY_vars_UE_g[UE_id]->frame = frame;
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx, r_type); phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx,
r_type, PHY_vars_RN_g[RN_id]);
} else if (last_slot == (LTE_SLOTS_PER_FRAME-2)) { } else if (last_slot == (LTE_SLOTS_PER_FRAME-2)) {
initial_sync(PHY_vars_UE_g[UE_id],normal_txrx); initial_sync(PHY_vars_UE_g[UE_id],normal_txrx);
} }
} }
// RN == eNB // RN == eNB
LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n", LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, eNB_id, frame, slot, next_slot >> 1,last_slot>>1); RN_id, eNB_id, frame, slot, next_slot >> 1,last_slot>>1);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag, r_type); phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag,
r_type, PHY_vars_RN_g[RN_id]);
} }
else{ else{
LOG_E(EMU,"TDD is not supported for multicast relaying %d\n", r_type); LOG_E(EMU,"TDD is not supported for multicast relaying %d\n", r_type);
......
...@@ -50,6 +50,12 @@ mapping omg_model_names[] = ...@@ -50,6 +50,12 @@ mapping omg_model_names[] =
mapping otg_multicast_app_type_names[] = { mapping otg_multicast_app_type_names[] = {
{"no_predefined_multicast_traffic", 0}, {"no_predefined_multicast_traffic", 0},
{"mscbr", 1}, {"mscbr", 1},
{"mmcbr", 2},
{"mbcbr", 3},
{"msvbr", 4},
{"mmvbr", 5},
{"mbvbr", 6},
{"mvideo_vbr_4mbps", 7},
{NULL, -1} {NULL, -1}
} ; } ;
...@@ -150,8 +156,8 @@ void init_oai_emulation() { ...@@ -150,8 +156,8 @@ void init_oai_emulation() {
int i; int i;
oai_emulation.environment_system_config.fading.large_scale.selected_option = "free_space"; oai_emulation.environment_system_config.fading.large_scale.selected_option = "free_space";
oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_exponent = 2.0; oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_exponent = 3.00;
oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_0_dB = -50; oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_0_dB = -100;
oai_emulation.environment_system_config.fading.small_scale.selected_option = "AWGN"; oai_emulation.environment_system_config.fading.small_scale.selected_option = "AWGN";
oai_emulation.environment_system_config.fading.ricean_8tap.rice_factor_dB = 0; oai_emulation.environment_system_config.fading.ricean_8tap.rice_factor_dB = 0;
oai_emulation.environment_system_config.fading.shadowing.decorrelation_distance_m = 0; oai_emulation.environment_system_config.fading.shadowing.decorrelation_distance_m = 0;
...@@ -163,14 +169,14 @@ void init_oai_emulation() { ...@@ -163,14 +169,14 @@ void init_oai_emulation() {
oai_emulation.environment_system_config.antenna.eNB_antenna.alpha_rad[2] = 0; oai_emulation.environment_system_config.antenna.eNB_antenna.alpha_rad[2] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.alpha_rad[3] = 0; oai_emulation.environment_system_config.antenna.eNB_antenna.alpha_rad[3] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_gain_dBi = 0; oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_gain_dBi = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.tx_power_dBm = 43; oai_emulation.environment_system_config.antenna.eNB_antenna.tx_power_dBm = 15;
oai_emulation.environment_system_config.antenna.eNB_antenna.rx_noise_level_dB = 0; oai_emulation.environment_system_config.antenna.eNB_antenna.rx_noise_level_dB = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[1] = 0; oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[1] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[2] = 0; oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[2] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[3] = 0; oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[3] = 0;
oai_emulation.environment_system_config.antenna.UE_antenna.antenna_gain_dBi = 0; oai_emulation.environment_system_config.antenna.UE_antenna.antenna_gain_dBi = 0;
oai_emulation.environment_system_config.antenna.UE_antenna.tx_power_dBm = 20; oai_emulation.environment_system_config.antenna.UE_antenna.tx_power_dBm = 20;
oai_emulation.environment_system_config.antenna.UE_antenna.rx_noise_level_dB = 0; oai_emulation.environment_system_config.antenna.UE_antenna.rx_noise_level_dB = 0; // noise figure
oai_emulation.environment_system_config.wall_penetration_loss_dB = 5; oai_emulation.environment_system_config.wall_penetration_loss_dB = 5;
oai_emulation.environment_system_config.system_bandwidth_MB = 7.68; oai_emulation.environment_system_config.system_bandwidth_MB = 7.68;
oai_emulation.environment_system_config.system_frequency_GHz = 1.9; oai_emulation.environment_system_config.system_frequency_GHz = 1.9;
...@@ -320,9 +326,9 @@ void init_oai_emulation() { ...@@ -320,9 +326,9 @@ void init_oai_emulation() {
oai_emulation.info.cba_group_active=0; oai_emulation.info.cba_group_active=0;
oai_emulation.info.eMBMS_active_state=0; oai_emulation.info.eMBMS_active_state=0;
oai_emulation.info.omg_model_enb=STATIC; //default to static mobility model 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=STATIC; //default to static mobility model
oai_emulation.info.omg_model_ue_current=STATIC; //default to static mobility model oai_emulation.info.omg_model_ue_current=STATIC; //default to static mobility model
oai_emulation.info.otg_enabled=0;// T flag with arg
oai_emulation.info.otg_bg_traffic_enabled = 0; // G flag oai_emulation.info.otg_bg_traffic_enabled = 0; // G flag
oai_emulation.info.frame = 0; // frame counter of emulation oai_emulation.info.frame = 0; // frame counter of emulation
oai_emulation.info.time_s = 0; // time of emulation oai_emulation.info.time_s = 0; // time of emulation
...@@ -490,7 +496,7 @@ int ocg_config_topo() { ...@@ -490,7 +496,7 @@ int ocg_config_topo() {
// init OMG for eNBs // init OMG for eNBs
if ((oai_emulation.info.omg_model_enb = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option))== -1) if ((oai_emulation.info.omg_model_enb = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option))== -1)
oai_emulation.info.omg_model_ue = STATIC; oai_emulation.info.omg_model_enb = STATIC;
LOG_I(OMG,"eNB mobility model is (%s, %d)\n", LOG_I(OMG,"eNB mobility model is (%s, %d)\n",
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option,
oai_emulation.info.omg_model_enb); oai_emulation.info.omg_model_enb);
...@@ -506,14 +512,15 @@ int ocg_config_topo() { ...@@ -506,14 +512,15 @@ int ocg_config_topo() {
} }
omg_param_list.mobility_type = oai_emulation.info.omg_model_enb; omg_param_list.mobility_type = oai_emulation.info.omg_model_enb;
omg_param_list.nodes_type = eNB; //eNB omg_param_list.nodes_type = eNB; //eNB or eNB + RN
omg_param_list.nodes = oai_emulation.info.nb_enb_local; omg_param_list.nodes = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local;
omg_param_list.seed = oai_emulation.info.seed; // specific seed for enb and ue to avoid node overlapping omg_param_list.seed = oai_emulation.info.seed; // specific seed for enb and ue to avoid node overlapping
// at this moment, we use the above moving dynamics for mobile eNB // at this moment, we use the above moving dynamics for mobile eNB
if (omg_param_list.nodes >0 ) if (omg_param_list.nodes >0 )
init_mobility_generator(omg_param_list); init_mobility_generator(omg_param_list);
// init OMG for UE // init OMG for UE
// input of OMG: STATIC: 0, RWP: 1, RWALK 2, or TRACE 3, or SUMO // input of OMG: STATIC: 0, RWP: 1, RWALK 2, or TRACE 3, or SUMO
if ((oai_emulation.info.omg_model_ue = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option))== -1) if ((oai_emulation.info.omg_model_ue = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option))== -1)
...@@ -523,7 +530,7 @@ int ocg_config_topo() { ...@@ -523,7 +530,7 @@ int ocg_config_topo() {
oai_emulation.info.omg_model_ue); oai_emulation.info.omg_model_ue);
omg_param_list.mobility_type = oai_emulation.info.omg_model_ue; omg_param_list.mobility_type = oai_emulation.info.omg_model_ue;
omg_param_list.nodes_type = UE;//UE omg_param_list.nodes_type = UE;//UE
omg_param_list.nodes = oai_emulation.info.nb_ue_local; omg_param_list.nodes = oai_emulation.info.nb_ue_local+ oai_emulation.info.nb_rn_local;
omg_param_list.seed = oai_emulation.info.seed + oai_emulation.info.nb_ue_local; //fixme: specific seed for enb and ue to avoid node overlapping omg_param_list.seed = oai_emulation.info.seed + oai_emulation.info.nb_ue_local; //fixme: specific seed for enb and ue to avoid node overlapping
omg_param_list.min_speed = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps; omg_param_list.min_speed = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps;
...@@ -955,7 +962,8 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1; ...@@ -955,7 +962,8 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1;
} }
} }
} else { // OCG not used, but -T option is used, so config here }
if ( oai_emulation.info.otg_enabled==1){ // OCG not used, but -T option is used, so config here
LOG_I(OTG,"configure OTG through options %s\n", oai_emulation.info.otg_traffic); LOG_I(OTG,"configure OTG through options %s\n", oai_emulation.info.otg_traffic);
for (i=0; i<g_otg->num_nodes; i++){ for (i=0; i<g_otg->num_nodes; i++){
for (j=0; j<g_otg->num_nodes; j++){ for (j=0; j<g_otg->num_nodes; j++){
...@@ -978,7 +986,7 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1; ...@@ -978,7 +986,7 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1;
} }
} }
init_predef_multicast_traffic(); init_predef_multicast_traffic();
LOG_I(OTG,"initilizae multicast traffic \n"); LOG_I(OTG,"initilizae multicast traffic %s\n",oai_emulation.info.otg_traffic);
} }
return 1; return 1;
......
This diff is collapsed.
...@@ -69,21 +69,39 @@ void extract_position (Node_list input_node_list, node_desc_t **node_data, int n ...@@ -69,21 +69,39 @@ void extract_position (Node_list input_node_list, node_desc_t **node_data, int n
} }
} }
} }
void extract_position_fixed_enb (node_desc_t **node_data, int nb_nodes, u32 frame){
int i;
for (i=0;i<nb_nodes;i++) {
if (i==0) {
node_data[i]->x = 0;
node_data[i]->y = 500;
}
else if (i == 1 ){
node_data[i]->x = 866;//
node_data[i]->y = 1000;
}
else if (i == 2 ){
node_data[i]->x = 866;
node_data[i]->y = 0;
}
}
}
void extract_position_fixed_ue (node_desc_t **node_data, int nb_nodes, u32 frame){ void extract_position_fixed_ue (node_desc_t **node_data, int nb_nodes, u32 frame){
int i; int i;
if(frame<50) if(frame<50)
for (i=0;i<nb_nodes;i++) { for (i=0;i<nb_nodes;i++) {
if (i==0) { if (i==0) {
node_data[i]->x = 2050; node_data[i]->x = 2050;
node_data[i]->y = 1500; node_data[i]->y = 1500;
} }
else { else {
node_data[i]->x = 2150; node_data[i]->x = 2150;
node_data[i]->y = 1500; node_data[i]->y = 1500;
} }
} }
else else
{ {
for (i=0;i<nb_nodes;i++) { for (i=0;i<nb_nodes;i++) {
if (i==0) { if (i==0) {
...@@ -200,7 +218,7 @@ void init_snr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_dat ...@@ -200,7 +218,7 @@ void init_snr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_dat
//for (aarx=0; aarx<eNB2UE->nb_rx; aarx++) //for (aarx=0; aarx<eNB2UE->nb_rx; aarx++)
*N0 = thermal_noise + ue_data->rx_noise_level;//? all the element have the same noise level????? *N0 = thermal_noise + ue_data->rx_noise_level;//? all the element have the same noise level?????
LOG_D(OCM,"Path loss %lf, noise %lf, signal %lf, snr %lf\n", LOG_D(OCM,"Path loss %lf, noise (N0) %lf, signal %lf, snr %lf\n",
eNB2UE->path_loss_dB, eNB2UE->path_loss_dB,
thermal_noise + ue_data->rx_noise_level, thermal_noise + ue_data->rx_noise_level,
enb_data->tx_power_dBm + eNB2UE->path_loss_dB, enb_data->tx_power_dBm + eNB2UE->path_loss_dB,
......
...@@ -109,6 +109,8 @@ def execute(oai, user, pw, logfile): ...@@ -109,6 +109,8 @@ def execute(oai, user, pw, logfile):
else : else :
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim ;') oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim ;')
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;') oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;')
time.sleep(1)
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;')
except log.err, e: except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile) log.fail(case, test, name, conf, e.value, diag, logfile)
......
...@@ -154,3 +154,13 @@ def execute(oai, user, pw, logfile): ...@@ -154,3 +154,13 @@ def execute(oai, user, pw, logfile):
else: else:
log.ok(case, test, name, conf, 'Note: check the packet loss from the OTG stats', logfile) log.ok(case, test, name, conf, 'Note: check the packet loss from the OTG stats', logfile)
# try:
# test = '08'
# name = 'Run oai.rel10.phy.eMBMS.Relay.OTG.fdd'
# diag = 'eMBMS multicast/broadcast DF relaying is not working properly in fdd mode, make sure that the SIB13/MCCH/MTCH have been correclty received by UEs'
# conf = '-c43 -F -T mbvbr -Q4 -j1 -n120'
# oai.send_expect('./oaisim.rel10 ' + conf, ' MTCH for sync area 1', 100)
# except log.err, e:
# log.fail(case, test, name, conf, e.value, diag, logfile)
# else:
# log.ok(case, test, name, conf, 'Note: check the packet loss from the OTG stats', logfile)
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