Commit 899c178d authored by gauthier's avatar gauthier

Now virtualization should be OK.

TO DO :test RF and ethernet emulation.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5086 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 791d449b
......@@ -144,6 +144,7 @@
#include "PHY/TOOLS/time_meas.h"
#include "PHY/CODING/defs.h"
#include "PHY/TOOLS/defs.h"
#include "platform_types.h"
#ifdef OPENAIR_LTE
......@@ -180,30 +181,30 @@ enum transmission_access_mode{
/// Top-level PHY Data Structure for eNB
typedef struct {
/// Module ID indicator for this instance
u8 Mod_id;
u8 local_flag;
unsigned int rx_total_gain_eNB_dB;
u32 frame;
LTE_DL_FRAME_PARMS lte_frame_parms;
module_id_t Mod_id;
u8 local_flag;
unsigned int rx_total_gain_eNB_dB;
frame_t frame;
LTE_DL_FRAME_PARMS lte_frame_parms;
PHY_MEASUREMENTS_eNB PHY_measurements_eNB[NUMBER_OF_eNB_SECTORS_MAX]; /// Measurement variables
LTE_eNB_COMMON lte_eNB_common_vars;
LTE_eNB_SRS lte_eNB_srs_vars[NUMBER_OF_UE_MAX];
LTE_eNB_PBCH lte_eNB_pbch;
LTE_eNB_PUSCH *lte_eNB_pusch_vars[NUMBER_OF_UE_MAX];
LTE_eNB_PRACH lte_eNB_prach_vars;
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
LTE_eNB_COMMON lte_eNB_common_vars;
LTE_eNB_SRS lte_eNB_srs_vars[NUMBER_OF_UE_MAX];
LTE_eNB_PBCH lte_eNB_pbch;
LTE_eNB_PUSCH *lte_eNB_pusch_vars[NUMBER_OF_UE_MAX];
LTE_eNB_PRACH lte_eNB_prach_vars;
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
// old: LTE_eNB_DLSCH_t **dlsch_eNB[2]; // Nusers times two spatial streams
LTE_eNB_ULSCH_t *ulsch_eNB[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA
LTE_eNB_DLSCH_t *dlsch_eNB_SI,*dlsch_eNB_ra;
LTE_eNB_DLSCH_t *dlsch_eNB_MCH;
LTE_eNB_UE_stats eNB_UE_stats[NUMBER_OF_UE_MAX];
LTE_eNB_UE_stats *eNB_UE_stats_ptr[NUMBER_OF_UE_MAX];
LTE_eNB_ULSCH_t *ulsch_eNB[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA
LTE_eNB_DLSCH_t *dlsch_eNB_SI,*dlsch_eNB_ra;
LTE_eNB_DLSCH_t *dlsch_eNB_MCH;
LTE_eNB_UE_stats eNB_UE_stats[NUMBER_OF_UE_MAX];
LTE_eNB_UE_stats *eNB_UE_stats_ptr[NUMBER_OF_UE_MAX];
/// cell-specific reference symbols
unsigned int lte_gold_table[20][2][14];
unsigned int lte_gold_table[20][2][14];
/// mbsfn reference symbols
unsigned int lte_gold_mbsfn_table[10][3][42];
unsigned int lte_gold_mbsfn_table[10][3][42];
u32 X_u[64][839];
......
......@@ -1010,7 +1010,7 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
// Check for SR and do ACK/NACK accordingly
if (is_SR_TXOp(phy_vars_ue,eNB_id,next_slot>>1)==1) {
LOG_I(PHY,"[UE %d][SR %x] Frame %d subframe %d: got SR_TXOp, Checking for SR for PUSCH from MAC\n",
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d: got SR_TXOp, Checking for SR for PUSCH from MAC\n",
phy_vars_ue->Mod_id,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,phy_vars_ue->frame,next_slot>>1);
#ifdef OPENAIR2
SR_payload = mac_xface->ue_get_SR(phy_vars_ue->Mod_id,
......@@ -1024,7 +1024,7 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
if (SR_payload>0) {
generate_ul_signal = 1;
LOG_I(PHY,"[UE %d][SR %x] Frame %d subframe %d got the SR for PUSCH is %d\n",
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d got the SR for PUSCH is %d\n",
phy_vars_ue->Mod_id,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,phy_vars_ue->frame,next_slot>>1,SR_payload);
}
else {
......
......@@ -333,8 +333,8 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS
char (*openair_rrc_eNB_init)(u8 );
char (*openair_rrc_UE_init)(u8, u8);
RRC_status_t (*rrc_rx_tx)(u8,u32,u8,u8);
u8 (*mac_rrc_data_ind)(u8,u32,u16,u8 *,u16,u8 eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_req)(u8,u32,u16,u8,u8 *,u8 eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_ind)(u8,u32,u16,u8 *,u16,eNB_flag_t eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_req)(u8,u32,u16,u8,u8 *,eNB_flag_t eNB_flag, u8 eNB_index);
void (*mac_rrc_meas_ind)(u8,MAC_MEAS_REQ_ENTRY*);
void (*def_meas_ind)(u8, u8);
void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*);
......@@ -352,12 +352,7 @@ typedef struct{
unsigned short (*mac_config_req)(u8,u8,MAC_CONFIG_REQ*);
MAC_MEAS_REQ_ENTRY* (*mac_meas_req)(u8 , MAC_MEAS_REQ*);
void (*mac_out_of_sync_ind)(u8,u32,unsigned short);
//u8 (*mac_rrc_data_ind)(u8,unsigned short,char *,u8);
//u8 (*mac_rrc_data_req)( u8, unsigned short, u8,char *);
//void (*mac_switch_node_function)(u8);
// void (*mac_rlc_exit)(void);
//RLC_INTERFACE_FUNCTIONS
// void (*pdcp_run)(unsigned int);
void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
......@@ -373,21 +368,18 @@ typedef struct{
u16 *SIperiod
#ifdef Rel10
,
u8 MBMS_Flag,
MBMS_flag_t MBMS_Flag,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
struct PMCH_InfoList_r9 *pmch_InfoList
#endif
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, char*);
void (*mac_rlc_data_ind)(module_id_t, chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t, chan_id_t, tb_size_t, num_tb_t);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t, logical_chan_id_t, tb_size_t, num_tb_t);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
void (*rrc_data_confP) (module_id_t , rb_id_t , mui_t ) ) ;
//rlc_op_status_t rrc_rlc_config_req (module_id_t, rb_id_t, rb_type_t, rlc_info_t );
//rlc_op_status_t rrc_rlc_data_req (module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, mem_block_t*);
//void rrc_rlc_register_rrc ( void(*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , mem_block_t*),void(*rrc_data_conf) (module_id_t , rb_id_t , mui_t) );
void (*mrbch_phy_sync_failure) (u8 Mod_id, u32 frame, u8 Free_ch_index);
void (*dl_phy_sync_success) (u8 Mod_id, u32 frame, u8 eNB_index);
}MAC_RLC_XFACE;
......
......@@ -55,8 +55,8 @@
#define MAX_MANAGED_RG_PER_MOBILE 2
#define DEFAULT_RAB_ID 3
#define NB_RB_MAX 11
#define NB_RAB_MAX 8
#define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#define NB_RAB_MAX maxDRB /* was 8, now 11 */
#define RAB_SHIFT1 9
#define RAB_SHIFT2 3
#define RAB_OFFSET 0x0007
......@@ -69,36 +69,36 @@
#ifdef MESH
# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
# define MAX_RAB_MOBILE NB_RAB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
# define MAX_RB_RG MAX_RB_MOBILE //NB_RB_MAX * MAX_MOBILES_PER_RG
# define MAX_RAB_RG (NB_RB_MAX+1) * (MAX_MOBILES_PER_RG + 1)
# define MAX_RAB MAX_RAB_RG
# define MAX_RB MAX_RB_RG
//# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//# define MAX_RAB_MOBILE NB_RAB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//# define MAX_RB_RG MAX_RB_MOBILE //NB_RB_MAX * MAX_MOBILES_PER_RG
//# define MAX_RAB_RG (NB_RB_MAX+1) * (MAX_MOBILES_PER_RG + 1)
//# define MAX_RAB MAX_RAB_RG
//# define MAX_RB MAX_RB_RG
#else
# define MAX_RB_MOBILE NB_RB_MAX * MAX_MANAGED_RG_PER_MOBILE
# define MAX_RAB_MOBILE NB_RAB_MAX * MAX_MANAGED_RG_PER_MOBILE
# define MAX_RB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
# define MAX_RAB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
# //ifdef NODE_RG
# define MAX_RAB MAX_RAB_RG
# define MAX_RB MAX_RB_RG
# //else
# // ifdef NODE_MT
# // define MAX_RAB MAX_RAB_MOBILE
# // define MAX_RB MAX_RB_MOBILE
# //else
# //error NODE_RG or NODE_MT must be defined
# //endif
//# define MAX_RB_MOBILE NB_RB_MAX * MAX_MANAGED_RG_PER_MOBILE
//# define MAX_RAB_MOBILE NB_RAB_MAX * MAX_MANAGED_RG_PER_MOBILE
//# define MAX_RB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
//# define MAX_RAB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
//# ifdef NODE_RG
//# define MAX_RAB MAX_RAB_RG
//# define MAX_RB MAX_RB_RG
//# else
//# // ifdef NODE_MT
//# // define MAX_RAB MAX_RAB_MOBILE
//# // define MAX_RB MAX_RB_MOBILE
//# //else
//# //error NODE_RG or NODE_MT must be defined
//# //endif
//# endif
#endif //MESH
// RLC_MODE
# define RLC_NONE 0
# define RLC_MODE_AM 1
# define RLC_MODE_TM 2
# define RLC_MODE_UM 3
# define RLC_NONE (rlc_mode_t)0
# define RLC_MODE_AM (rlc_mode_t)1
# define RLC_MODE_TM (rlc_mode_t)2
# define RLC_MODE_UM (rlc_mode_t)3
//E_R
# define E_R_RLC_ER_RELEASE 1
......
......@@ -25,19 +25,29 @@ typedef signed long int s64_t;
typedef unsigned int config_action_t;
typedef unsigned int sdu_size_t;
typedef u16_t sdu_size_t;
typedef s16_t sdu_ssize_t;
typedef unsigned int tbs_size_t;
typedef unsigned int tb_size_t;
typedef unsigned int rb_id_t;
typedef unsigned int module_id_t;
typedef u16_t rb_id_t;
typedef u16_t srb_id_t;
typedef u32_t frame_t;
typedef u32_t sub_frame_t;
typedef u8_t module_id_t;
typedef unsigned int mui_t;
typedef unsigned int confirm_t;
typedef unsigned int rb_type_t;
typedef rb_id_t chan_id_t;
typedef unsigned int logical_chan_id_t;
typedef unsigned int num_tb_t;
typedef unsigned int crc_t;
typedef unsigned int rlc_tx_status_t;
typedef unsigned int rlc_mode_t;
typedef s16_t rlc_sn_t;
typedef u16_t rlc_usn_t;
typedef int traffic_type_t;
typedef u32_t mbms_session_id_t;
typedef u16_t mbms_service_id_t;
typedef u16_t rnti_t;
typedef signed int rlc_op_status_t;
......@@ -47,8 +57,17 @@ typedef unsigned int crc32_t;
typedef signed char boolean_t;
typedef enum MBMS_flag_e {
MBMS_FLAG_NO = 0,
MBMS_FLAG_YES = 1,
} MBMS_flag_t;
typedef enum eNB_flag_e {
ENB_FLAG_NO = 0,
ENB_FLAG_YES = 1,
} eNB_flag_t;
// just for integration
extern unsigned int frame;
extern frame_t frame;
#endif
......@@ -10,7 +10,7 @@
***************************************************************************/
#ifdef OLD_RRC_CELLULAR
# ifndef __RRM_CONFIG_STRUCTS_H__
# define __RRM_CONFIG_STRUCTS_H__
......@@ -171,4 +171,4 @@ typedef volatile struct {
//typedef RG_CONFIG MAIN_RADIO_GATEWAY;
# endif
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -39,23 +39,23 @@
#include "extern.h"
#include "UTIL/LOG/log.h"
s8 get_Po_NOMINAL_PUSCH(u8 Mod_id) {
s8 get_Po_NOMINAL_PUSCH(module_id_t module_idP) {
RACH_ConfigCommon_t *rach_ConfigCommon = NULL;
if (UE_mac_inst[Mod_id].radioResourceConfigCommon)
rach_ConfigCommon = &UE_mac_inst[Mod_id].radioResourceConfigCommon->rach_ConfigCommon;
if (UE_mac_inst[module_idP].radioResourceConfigCommon)
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
else {
LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",Mod_id);
LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",module_idP);
mac_xface->macphy_exit("");
}
return(-120 + (rach_ConfigCommon->powerRampingParameters.preambleInitialReceivedTargetPower<<1) +
get_DELTA_PREAMBLE(Mod_id));
get_DELTA_PREAMBLE(module_idP));
}
s8 get_deltaP_rampup(u8 Mod_id) {
s8 get_deltaP_rampup(module_id_t module_idP) {
LOG_D(MAC,"[PUSCH]%d dB\n",UE_mac_inst[Mod_id].RA_PREAMBLE_TRANSMISSION_COUNTER<<1);
return((s8)(UE_mac_inst[Mod_id].RA_PREAMBLE_TRANSMISSION_COUNTER<<1));
LOG_D(MAC,"[PUSCH]%d dB\n",UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER<<1);
return((s8)(UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER<<1));
}
......@@ -25,16 +25,16 @@
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
*******************************************************************************/
/*! \file main.c
* \brief top init of Layer 2
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 0.5
* \email: navid.nikaein@eurecom.fr
* @ingroup _mac
* \brief top init of Layer 2
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 0.5
* \email: navid.nikaein@eurecom.fr
* @ingroup _mac
*/
*/
#ifdef USER_MODE
#include "LAYER2/register.h"
......@@ -74,98 +74,94 @@
/***********************************************************************/
void dl_phy_sync_success(unsigned char Mod_id,
u32 frame,
unsigned char eNB_index,
u8 first_sync){ //init as MR
/***********************************************************************/
LOG_D(MAC,"[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n", Mod_id, frame, eNB_index);
void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP,
unsigned char eNB_index,
u8 first_sync){ //init as MR
/***********************************************************************/
LOG_D(MAC,"[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n", module_idP, frameP, eNB_index);
if (first_sync==1) {
layer2_init_UE(Mod_id);
openair_rrc_ue_init(Mod_id,eNB_index);
layer2_init_UE(module_idP);
openair_rrc_ue_init(module_idP,eNB_index);
}
else {
mac_in_sync_ind(Mod_id,frame,eNB_index);
mac_in_sync_ind(module_idP,frameP,eNB_index);
}
}
/***********************************************************************/
void mrbch_phy_sync_failure(u8 Mod_id, u32 frame, u8 free_eNB_index){//init as CH
void mrbch_phy_sync_failure(module_id_t module_idP, frame_t frameP, u8 free_eNB_index){//init as CH
/***********************************************************************/
LOG_I(MAC,"[eNB %d] Frame %d: PHY Sync failure \n",Mod_id,frame);
layer2_init_eNB(Mod_id, free_eNB_index);
openair_rrc_eNB_init(Mod_id);
LOG_I(MAC,"[eNB %d] Frame %d: PHY Sync failure \n",module_idP,frameP);
layer2_init_eNB(module_idP, free_eNB_index);
openair_rrc_eNB_init(module_idP);
}
char layer2_init_eNB(unsigned char Mod_id, unsigned char eNB_index){
char layer2_init_eNB(module_id_t module_idP, unsigned char eNB_index){
return 0;
}
/***********************************************************************/
char layer2_init_UE(unsigned char Mod_id){
char layer2_init_UE(module_id_t module_idP){
return 0;
}
/***********************************************************************/
void mac_UE_out_of_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index){
/***********************************************************************/
void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, u16 eNB_index){
/***********************************************************************/
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frame, eNB_index);
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
}
/***********************************************************************/
int mac_top_init(int eMBMS_active, u8 cba_group_active, u8 HO_active){
/***********************************************************************/
unsigned char Mod_id,i,j;
/***********************************************************************/
module_id_t Mod_id,i,j;
RA_TEMPLATE *RA_template;
UE_TEMPLATE *UE_template;
int size_bytes1,size_bytes2,size_bits1,size_bits2;
LOG_I(MAC,"[MAIN] Init function start:Nb_UE_INST=%d\n",NB_UE_INST);
if (NB_UE_INST>0) {
UE_mac_inst = (UE_MAC_INST*)malloc16(NB_UE_INST*sizeof(UE_MAC_INST));
if (UE_mac_inst == NULL) {
LOG_C(MAC,"[MAIN] Can't ALLOCATE %d Bytes for %d UE_MAC_INST with size %d \n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,sizeof(UE_MAC_INST));
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for UEs \n");
}
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d UE_MAC_INST @ %p\n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,UE_mac_inst);
bzero(UE_mac_inst,NB_UE_INST*sizeof(UE_MAC_INST));
for(i=0;i<NB_UE_INST; i++)
ue_init_mac(i);
UE_mac_inst = (UE_MAC_INST*)malloc16(NB_UE_INST*sizeof(UE_MAC_INST));
if (UE_mac_inst == NULL) {
LOG_C(MAC,"[MAIN] Can't ALLOCATE %d Bytes for %d UE_MAC_INST with size %d \n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,sizeof(UE_MAC_INST));
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for UEs \n");
}
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d UE_MAC_INST @ %p\n",NB_UE_INST*sizeof(UE_MAC_INST),NB_UE_INST,UE_mac_inst);
bzero(UE_mac_inst,NB_UE_INST*sizeof(UE_MAC_INST));
for(i=0;i<NB_UE_INST; i++)
ue_init_mac(i);
}
else
UE_mac_inst = NULL;
LOG_I(MAC,"[MAIN] Init function start:Nb_eNB_INST=%d\n",NB_eNB_INST);
if (NB_eNB_INST>0) {
eNB_mac_inst = (eNB_MAC_INST*)malloc16(NB_eNB_INST*sizeof(eNB_MAC_INST));
if (eNB_mac_inst == NULL){
LOG_D(MAC,"[MAIN] can't ALLOCATE %d Bytes for %d eNB_MAC_INST with size %d \n",NB_eNB_INST*sizeof(eNB_MAC_INST),NB_eNB_INST,sizeof(eNB_MAC_INST));
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for eNB \n");
}
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d eNB_MAC_INST @ %p\n",NB_eNB_INST*sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst);
bzero(eNB_mac_inst,NB_eNB_INST*sizeof(eNB_MAC_INST));
eNB_mac_inst = (eNB_MAC_INST*)malloc16(NB_eNB_INST*sizeof(eNB_MAC_INST));
if (eNB_mac_inst == NULL){
LOG_D(MAC,"[MAIN] can't ALLOCATE %d Bytes for %d eNB_MAC_INST with size %d \n",NB_eNB_INST*sizeof(eNB_MAC_INST),NB_eNB_INST,sizeof(eNB_MAC_INST));
mac_xface->macphy_exit("[MAC][MAIN] not enough memory for eNB \n");
}
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d eNB_MAC_INST @ %p\n",NB_eNB_INST*sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst);
bzero(eNB_mac_inst,NB_eNB_INST*sizeof(eNB_MAC_INST));
}
else
eNB_mac_inst = NULL;
for(Mod_id=0;Mod_id<NB_eNB_INST;Mod_id++){
#ifdef PHY_EMUL
Mac_rlc_xface->Is_cluster_head[Mod_id]=2;//0: MR, 1: CH, 2: not CH neither MR
Mac_rlc_xface->Is_cluster_head[Mod_id]=2;//0: MR, 1: CH, 2: not CH neither MR
#endif
/*#ifdef Rel10
/*#ifdef Rel10
int n;
for (n=0;n<4096;n++)
eNB_mac_inst[Mod_id].MCH_pdu.payload[n] = taus();
......@@ -176,18 +172,18 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active, u8 HO_active){
if (Is_rrc_registered == 1){
LOG_I(MAC,"[MAIN] calling RRC\n");
LOG_I(MAC,"[MAIN] calling RRC\n");
#ifndef CELLULAR //nothing to be done yet for cellular
openair_rrc_top_init(eMBMS_active, cba_group_active,HO_active);
openair_rrc_top_init(eMBMS_active, cba_group_active,HO_active);
#endif
}
else {
else {
LOG_I(MAC,"[MAIN] Running without an RRC\n");
}
}
#ifndef USER_MODE
#ifndef PHY_EMUL
LOG_I(MAC,"[MAIN] add openair2 proc\n");
//// add_openair2_stats();
//// add_openair2_stats();
#endif
#endif
......@@ -196,102 +192,102 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active, u8 HO_active){
// Set up DCIs for TDD 5MHz Config 1..6
for (i=0;i<NB_eNB_INST;i++) {
LOG_D(MAC,"[MAIN][eNB %d] initializing RA_template\n",i);
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", i);
RA_template = (RA_TEMPLATE *)&eNB_mac_inst[i].RA_template[0];
for (j=0;j<NB_RA_PROC_MAX;j++) {
if (mac_xface->lte_frame_parms->frame_type == TDD) {
switch (mac_xface->lte_frame_parms->N_RB_DL) {
case 6:
size_bytes1 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
break;
case 25:
size_bytes1 = sizeof(DCI1A_5MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_5MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_5MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_5MHz_TDD_1_6_t;
break;
case 50:
size_bytes1 = sizeof(DCI1A_10MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_10MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_10MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_10MHz_TDD_1_6_t;
break;
case 100:
size_bytes1 = sizeof(DCI1A_20MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_20MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_20MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_20MHz_TDD_1_6_t;
break;
default:
size_bytes1 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
break;
}
LOG_D(MAC,"[MAIN][eNB %d] initializing RA_template\n",i);
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", i);
RA_template = (RA_TEMPLATE *)&eNB_mac_inst[i].RA_template[0];
for (j=0;j<NB_RA_PROC_MAX;j++) {
if (mac_xface->lte_frame_parms->frame_type == TDD) {
switch (mac_xface->lte_frame_parms->N_RB_DL) {
case 6:
size_bytes1 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
break;
case 25:
size_bytes1 = sizeof(DCI1A_5MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_5MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_5MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_5MHz_TDD_1_6_t;
break;
case 50:
size_bytes1 = sizeof(DCI1A_10MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_10MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_10MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_10MHz_TDD_1_6_t;
break;
case 100:
size_bytes1 = sizeof(DCI1A_20MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_20MHz_TDD_1_6_t);
size_bits1 = sizeof_DCI1A_20MHz_TDD_1_6_t;
size_bits2 = sizeof_DCI1A_20MHz_TDD_1_6_t;
break;
default:
size_bytes1 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
size_bytes2 = sizeof(DCI1A_1_5MHz_TDD_1_6_t);