Commit 56c90005 authored by gauthier's avatar gauthier

branch LG_PRE_RELEASE_0.3 reintegration

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7117 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4f583e20
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#ifdef CMAKER
#include <platform_types.h>
#endif
......@@ -67,9 +68,13 @@ do { \
#define DevCheck(cOND, vALUE1, vALUE2, vALUE3) \
_Assert_(cOND, _Assert_Exit_, #vALUE1": %d\n"#vALUE2": %d\n"#vALUE3": %d\n\n", \
(int)vALUE1, (int)vALUE2, (int)vALUE3)
#define DevCheck(cOND, vALUE1, vALUE2, vALUE3) \
_Assert_(cOND, _Assert_Exit_, #vALUE1 ": %" PRIdMAX "\n" #vALUE2 ": %" PRIdMAX "\n" #vALUE3 ": %" PRIdMAX "\n\n", \
(intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3)
#define DevCheck4(cOND, vALUE1, vALUE2, vALUE3, vALUE4) \
_Assert_(cOND, _Assert_Exit_, #vALUE1": %"PRIdMAX"\n"#vALUE2": %"PRIdMAX"\n"#vALUE3": %"PRIdMAX"\n"#vALUE4": %"PRIdMAX"\n\n", \
(intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3, (intmax_t)vALUE4)
#define DevParam(vALUE1, vALUE2, vALUE3) DevCheck(0, vALUE1, vALUE2, vALUE3)
......
export OPENAIR_HOME=$(pwd)
export OPENAIR_DIR=$(pwd)
export OPENAIR1_DIR=$OPENAIR_HOME/openair1
export OPENAIR2_DIR=$OPENAIR_HOME/openair2
export OPENAIR3_DIR=$OPENAIR_HOME/openair3
......
......@@ -150,8 +150,9 @@ int main(int argc, char *argv[])
iw_field.rx_gi2);
//printf("read set %d, time %d:%d:%d\n",i,iw_field.hour,iw_field.min,iw_field.sec);
if (i==0)
if (i==0) {
printf("num, date; inactive_time; rx_bytes; rx_packets; tx_bytes; tx_packets; tx_retries; tx_failed; signal; signal0; signal1; tx_bitrate; tx_mcs; rx_bitrate; rx_mcs\n");
}
printf("%d; %d-%s-%d %d:%d:%d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %e; %d; %e; %d\n",
i,
......
......@@ -68,7 +68,7 @@ extern unsigned char NB_eNB_INST;
# endif
/*------------------------------------------------------------------------------*/
static void configure_phy(uint32_t enb_id, const Enb_properties_array_t *enb_properties)
static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_properties)
{
MessageDef *msg_p;
int CC_id;
......@@ -86,7 +86,7 @@ static void configure_phy(uint32_t enb_id, const Enb_properties_array_t *enb_pro
PHY_CONFIGURATION_REQ (msg_p).rx_gain[CC_id] = enb_properties->properties[enb_id]->rx_gain[CC_id];
}
itti_send_msg_to_task (TASK_PHY_ENB, enb_id, msg_p);
itti_send_msg_to_task (TASK_PHY_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
/*------------------------------------------------------------------------------*/
......@@ -189,7 +189,7 @@ static void configure_rrc(uint32_t enb_id, const Enb_properties_array_t *enb_pro
RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[CC_id] = enb_properties->properties[enb_id]->ue_TimersAndConstants_n311[CC_id];
}
itti_send_msg_to_task (TASK_RRC_ENB, enb_id, msg_p);
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
/*------------------------------------------------------------------------------*/
......@@ -231,7 +231,8 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
s1ap_register_eNB->default_drx = enb_properties->properties[enb_id]->pcch_defaultPagingCycle[0];
s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme;
AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme, S1AP_MAX_NB_MME_IP_ADDRESS);
AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme,
S1AP_MAX_NB_MME_IP_ADDRESS);
for (mme_id = 0; mme_id < s1ap_register_eNB->nb_mme; mme_id++) {
s1ap_register_eNB->mme_ip_address[mme_id].ipv4 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4;
......@@ -250,7 +251,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
str = inet_ntoa(addr);
strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str);
itti_send_msg_to_task (TASK_S1AP, enb_id, msg_p);
itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
register_enb_pending++;
}
......
This diff is collapsed.
......@@ -88,7 +88,12 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
}
int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,uint8_t eNB_index,
int
rrc_mac_config_req(
module_id_t Mod_id,
eNB_flag_t eNB_flagP,
rnti_t rntiP,
uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
#ifdef Rel10
......@@ -122,14 +127,17 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
int i,CC_id=0;
int UE_id = -1;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
if (eNB_flagP==0) {
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index);
if (tdd_Config != NULL)
if (tdd_Config != NULL) {
UE_mac_inst[Mod_id].tdd_Config = tdd_Config;
}
} else {
UE_id = find_UE_id(Mod_id, rntiP);
if (physicalConfigDedicated == NULL) {
LOG_I(MAC,"[CONFIG][eNB %d] Configuring MAC/PHY\n",Mod_id);
} else {
......@@ -138,10 +146,11 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
}
if (tdd_Config && SIwindowsize && SIperiod) {
if (eNB_flagP == ENB_FLAG_YES)
if (eNB_flagP == ENB_FLAG_YES) {
mac_xface->phy_config_sib1_eNB(Mod_id,0,tdd_Config,*SIwindowsize,*SIperiod);
else
} else {
mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
}
}
if (radioResourceConfigCommon!=NULL) {
......@@ -189,28 +198,32 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
if (mac_MainConfig->ul_SCH_Config) {
if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer)
if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) {
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
else
} else {
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
}
if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx)
if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) {
UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
else
} else {
UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
}
if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer)
if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) {
UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer;
else
} else {
UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
}
}
#ifdef Rel10
if (mac_MainConfig->sr_ProhibitTimer_r9)
if (mac_MainConfig->sr_ProhibitTimer_r9) {
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->sr_ProhibitTimer_r9;
else
} else {
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) 0;
}
#endif
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer);
......@@ -485,8 +498,9 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups;
for (i=0; i < num_active_cba_groups; i ++) {
if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i)
if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i) {
eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i;
}
//only configure UE ids up to num_active_cba_groups
//we use them as candidates for the transmission of dci format0)
......@@ -505,28 +519,32 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
return(0);
}
#ifdef LOCALIZATION
//------------------------------------------------------------------------------
double
rrc_get_estimated_ue_distance(module_id_t Mod_id, const frame_t frameP, uint8_t UE_id, int CC_id, uint8_t loc_type)
rrc_get_estimated_ue_distance(
const protocol_ctxt_t* const ctxt_pP,
const int CC_idP,
const uint8_t loc_typeP
)
//------------------------------------------------------------------------------
{
// localization types:
// 0: power based
// 1: time based
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
UE_list_t* UE_list = &eNB_mac_inst[ctxt_pP->module_id].UE_list;
int pCCid;
int UE_id;
uint16_t rnti;
//for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) {
pCCid = UE_PCCID(Mod_id,UE_id);
rnti = UE_list->UE_template[pCCid][UE_id].rnti;
if(rnti == 0)
if(ctxt_pP->rnti == NOT_A_RNTI) {
return -1;
}
eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,pCCid,rnti);
UE_id = find_UE_id(ctxt_pP->module_id,ctxt_pP->rnti);
pCCid = UE_PCCID(ctxt_pP->module_id,UE_id);
eNB_UE_stats = mac_xface->get_eNB_UE_stats(ctxt_pP->module_id,pCCid,ctxt_pP->rnti);
switch (loc_type) {
switch (loc_typeP) {
case 0:
return eNB_UE_stats->distance.power_based;
break;
......@@ -539,7 +557,7 @@ rrc_get_estimated_ue_distance(module_id_t Mod_id, const frame_t frameP, uint8_t
return eNB_UE_stats->distance.power_based;
}
// LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[Mod_id].UE_list.UE_template[CC_id][UE_id].distance.power_based);
// LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_id][UE_id].distance.power_based);
}
......
......@@ -97,6 +97,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
DCI_PDU *DCI_pdu[MAX_NUM_CCs];
int CC_id,i,next_i;
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
rnti_t rnti;
LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
......@@ -112,12 +113,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
}
// refresh UE list based on UEs dropped by PHY in previous subframe
for (i=UE_list->head; i>=0; i=i=next_i) {
LOG_D(MAC,"UE %d: rnti %x (%p)\n",i,UE_RNTI(module_idP,i),mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i)));
i = UE_list->head;
while (i>=0) {
rnti = UE_RNTI(module_idP,i);
LOG_D(MAC,"UE %d: rnti %x (%p)\n",i,rnti,mac_xface->get_eNB_UE_stats(module_idP,0,rnti));
next_i= UE_list->next[i];
if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL)
mac_remove_ue(module_idP,i,frameP);
if (mac_xface->get_eNB_UE_stats(module_idP,0,rnti)==NULL) {
mac_remove_ue(module_idP,i,frameP, subframeP);
}
i = next_i;
}
#if defined(ENABLE_ITTI)
......@@ -190,18 +197,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//if (subframeP%5 == 0)
//#ifdef EXMIMO
ctxt.enb_module_id = module_idP;
ctxt.ue_module_id = 0;
ctxt.frame = frameP;
ctxt.enb_flag = ENB_FLAG_YES;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, 0);
pdcp_run(&ctxt);
//#endif
// check HO
rrc_rx_tx(module_idP,
frameP,
1,
module_idP,
rrc_rx_tx(&ctxt,
0, // eNB index, unused in eNB
CC_id);
#ifdef Rel10
......@@ -235,7 +237,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6)
// Schedule Normal DLSCH
//
schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD
schedule_ulsch(module_idP,frameP,cooperation_flag,0,4,nCCE);//,calibration_flag);
......@@ -247,8 +249,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
//schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
//fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
break;
......@@ -531,8 +532,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
}
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
DCI_pdu[CC_id]->nCCE = nCCE[CC_id];
}
LOG_D(MAC,"frameP %d, subframeP %d nCCE %d\n",frameP,subframeP,nCCE[0]);
......
......@@ -27,7 +27,7 @@
*******************************************************************************/
/*! \file eNB_scheduler_RAs.c
/*! \file eNB_scheduler_RA.c
* \brief primitives used for random access
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
......@@ -38,6 +38,7 @@
*/
#include "assertions.h"
#include "platform_types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
......@@ -108,9 +109,10 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
// Get RRCConnectionSetup for Piggyback
rrc_sdu_length = mac_rrc_data_req(module_idP,
frameP,
CCCH,1,
CCCH,
1, // 1 transport block
&eNB->common_channels[CC_id].CCCH_pdu.payload[0],
1,
ENB_FLAG_YES,
module_idP,
0); // not used in this case
......@@ -381,8 +383,9 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
&eNB->common_channels[CC_id].CCCH_pdu.payload[0],
rrc_sdu_length);
#if defined(USER_MODE) && defined(OAI_EMU)
if (opt_enabled==1) {
if (oai_emulation.info.opt_enabled) {
trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
eNB->subframe,0,0);
......@@ -390,6 +393,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
}
#endif
nprb[CC_id]= nprb[CC_id] + 3;
nCCE[CC_id] = nCCE[CC_id] + 4;
}
......@@ -416,7 +420,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
stop_meas(&eNB->schedule_ra);
}
void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t preamble_index,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframeP,uint8_t f_id)
void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t preamble_index,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframeP,
uint8_t f_id)
{
uint8_t i;
......
......@@ -67,7 +67,15 @@
#define DEBUG_eNB_SCHEDULER 1
void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsigned int *nCCEP)
//------------------------------------------------------------------------------
void
schedule_SI(
module_id_t module_idP,
frame_t frameP,
unsigned int* nprbP,
unsigned int* nCCEP
)
//------------------------------------------------------------------------------
{
......@@ -96,24 +104,25 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,CC_id,frameP,bcch_sdu_length);
if (bcch_sdu_length <= (mac_xface->get_TBS_DL(0,3)))
if (bcch_sdu_length <= (mac_xface->get_TBS_DL(0,3))) {
mcs=0;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(1,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(1,3))) {
mcs=1;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(2,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(2,3))) {
mcs=2;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(3,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(3,3))) {
mcs=3;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(4,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(4,3))) {
mcs=4;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(5,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(5,3))) {
mcs=5;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(6,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(6,3))) {
mcs=6;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(7,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(7,3))) {
mcs=7;
else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(8,3)))
} else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(8,3))) {
mcs=8;
}
if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
......@@ -132,8 +141,8 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
case 100:
((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
break;
}
} else {
switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
case 6:
......@@ -155,7 +164,9 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
}
}
if (opt_enabled == 1) {
#if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.opt_enabled) {
trace_pdu(1,
&eNB->common_channels[CC_id].BCCH_pdu.payload[0],
bcch_sdu_length,
......@@ -165,9 +176,10 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi
eNB->subframe,
0,
0);
}
LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, 0xffff, bcch_sdu_length);
}
#endif
if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for SI %d bytes (mcs %d, rb 3, TBS %d)\n",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -51,8 +51,9 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
return 0; // not reached
}
if (UE_mac_inst[module_idP].radioResourceConfigCommon)
if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
}
else {
LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id);
mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
......
......@@ -115,10 +115,11 @@ void init_transport_channels(unsigned char transmission_mode)
DLSCH_alloc_pdu1.rv1 = 0;
// Forget second codeword
if (transmission_mode == 6)
if (transmission_mode == 6) {
DLSCH_alloc_pdu1.tpmi = 5; // PUSCH_PRECODING0
else
} else {
DLSCH_alloc_pdu1.tpmi = 0;
}
DLSCH_alloc_pdu2.rah = 0;
DLSCH_alloc_pdu2.rballoc = DLSCH_RB_ALLOC;
......@@ -131,9 +132,9 @@ void init_transport_channels(unsigned char transmission_mode)
DLSCH_alloc_pdu2.rv1 = 0;
// Forget second codeword
if (transmission_mode == 6)
if (transmission_mode == 6) {
DLSCH_alloc_pdu2.tpmi = 5; // PUSCH_PRECODING0
else
} else {
DLSCH_alloc_pdu2.tpmi = 0;
}
}
......@@ -142,11 +142,12 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
bzero(UE_mac_inst,NB_UE_INST*sizeof(UE_MAC_INST));
for(i=0; i<NB_UE_INST; i++)
for(i=0; i<NB_UE_INST; i++) {
ue_init_mac(i);
} else
}
} else {
UE_mac_inst = NULL;
}
LOG_I(MAC,"[MAIN] Init function start:Nb_eNB_INST=%d\n",NB_eNB_INST);
......@@ -160,8 +161,9 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
LOG_D(MAC,"[MAIN] ALLOCATE %d Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst);
bzero(eNB_mac_inst,NB_eNB_INST*sizeof(eNB_MAC_INST));
}
} else
} else {
eNB_mac_inst = NULL;
}
// Initialize Linked-List for Active UEs
for(Mod_id=0; Mod_id<NB_eNB_INST; Mod_id++) {
......@@ -335,8 +337,9 @@ int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, ui
eNB_mac_inst[j][CC_id].sbmap_conf.sb_size=SB_size;
eNB_mac_inst[j][CC_id].sbmap_conf.nb_active_sb=1;
for(i=0; i<NUMBER_OF_SUBBANDS; i++)
for(i=0; i<NUMBER_OF_SUBBANDS; i++) {
eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[i]=1;
}
eNB_mac_inst[j][CC_id].sbmap_conf.sbmap[rand()%NUMBER_OF_SUBBANDS]=0;
......@@ -359,8 +362,9 @@ int mac_init_global_param(void)
Mac_rlc_xface = NULL;
LOG_I(MAC,"[MAIN] CALLING RLC_MODULE_INIT...\n");
if (rlc_module_init()!=0)
if (rlc_module_init()!=0) {
return(-1);
}
LOG_I(MAC,"[MAIN] RLC_MODULE_INIT OK, malloc16 for mac_rlc_xface...\n");
......@@ -421,11 +425,13 @@ void mac_top_cleanup(void)
pdcp_module_cleanup ();
#endif
if (NB_UE_INST>0)
if (NB_UE_INST>0) {
free (UE_mac_inst);
}
if (NB_eNB_INST>0)
if (NB_eNB_INST>0) {
free(eNB_mac_inst);
}
free( Mac_rlc_xface);
}
......
......@@ -107,8 +107,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
len+=sprintf(&buffer[len],"CH %d: Subband SINR (dB) :",
CH_index);
for (fg=0; fg<NUMBER_OF_MEASUREMENT_SUBBANDS; fg++)
for (fg=0; fg<NUMBER_OF_MEASUREMENT_SUBBANDS; fg++) {
len+=sprintf(&buffer[len],"%d ",UE_mac_inst[Mod_id].Def_meas[CH_index].Sinr_meas[0][fg]);
}
len+=sprintf(&buffer[len],"\n");
......@@ -141,7 +142,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
if(Overhead<0) {
Overhead=-Overhead;
Sign=-1;
} else Sign=1;
} else {
Sign=1;
}
len+=sprintf(&buffer[len],"[PDCP]LCHAN %d: NB_TX = %d ,Tx_rate =(%d bits/TTI ,%d Kbits/s), NB_RX = %d ,Rx_rate =(%d bits/TTI ,%d Kbits/s) , LAYER2 TX OVERHEAD: %d Kbits/s\n",
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.Lchan_id.Index,
......@@ -215,8 +218,9 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_RX_ERRORS);
len+=sprintf(&buffer[len]," TX per TB: ");
for(kk=0; kk<MAX_NUMBER_TB_PER_LCHAN/2; kk++)
for(kk=0; kk<MAX_NUMBER_TB_PER_LCHAN/2; kk++) {
len+=sprintf(&buffer[len],"%d . ",UE_mac_inst[Mod_id].Dtch_lchan[i][CH_index].Lchan_info.NB_TX_TB[kk]);
}
len+=sprintf(&buffer[len],"\n");
len+=sprintf(&buffer[len]," RXerr per TB: ");
......@@ -241,7 +245,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
else if(Mac_rlc_xface->Is_cluster_head[k] ==1) {
Mod_id=k;
len+=sprintf(&buffer[len],"-------------------------------------------------------------------CH %d: TTI: %d------------------------------------------------------------------\n",
len+=sprintf(&buffer[len],
"-------------------------------------------------------------------CH %d: TTI: %d------------------------------------------------------------------\n",
NODE_ID[Mod_id],Mac_rlc_xface->frame);
for(i=1; i<=NB_CNX_CH; i++) {
......@@ -251,7 +256,8 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)