Commit 353cacdc authored by Florian Kaltenberger's avatar Florian Kaltenberger

fixing bug in preprocessor (thanks to Niccolo) and some other warnings


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6542 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 1400edf6
......@@ -982,6 +982,8 @@ void itti_wait_tasks_end(void) {
signal_handle (&end);
}
printf("closing all tasks\n");
do {
ready_tasks = 0;
......@@ -1013,6 +1015,8 @@ void itti_wait_tasks_end(void) {
}
} while ((ready_tasks > 0) && (retries--));
printf("ready_tasks %d\n",ready_tasks);
itti_desc.running = 0;
#if defined(OAI_EMU) || defined(RTAI)
......
......@@ -134,7 +134,7 @@ int signal_handle(int *end)
break;
case SIGINT:
SIG_DEBUG("Received SIGINT\n");
printf("Received SIGINT\n");
itti_send_terminate_message(TASK_UNKNOWN);
*end = 1;
break;
......
......@@ -1312,6 +1312,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
// there is at least one allocation for PDCCH
uint8_t smbv_alloc_cnt = 1;
#endif
int frame = phy_vars_eNB->proc[sched_subframe].frame_tx;
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1);
......@@ -1320,8 +1321,23 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[%s %"PRIu8"] Frame %d subframe %d : Doing phy_procedures_eNB_TX(%d)\n",
(r_type == multicast_relay) ? "RN/eNB" : "eNB",
phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, subframe);
phy_vars_eNB->Mod_id, frame, subframe);
#endif
for (i=0;i<NUMBER_OF_UE_MAX;i++) {
// If we've dropped the UE, go back to PRACH mode for this UE
//#if !defined(EXMIMO_IOT)
if (phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) {
LOG_I(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n",
phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,frame,subframe, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors);
phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0;
}
//#endif
}
#ifdef OPENAIR2
// Get scheduling info for next subframe
if (phy_vars_eNB->CC_id == 0)
......@@ -3364,25 +3380,6 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors++;
//dump_ulsch(phy_vars_eNB, sched_subframe, i);
}
// If we've dropped the UE, go back to PRACH mode for this UE
//#if !defined(EXMIMO_IOT)
if (phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) {
LOG_I(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n",
phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,frame,subframe, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors);
// mac_xface->macphy_exit("Consecutive error count reached");
phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
#ifdef OPENAIR2
/* mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
frame,
phy_vars_eNB->eNB_UE_stats[i].crnti);*/
#endif
remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0;
}
//#endif
}
} // ulsch in error
else {
......
......@@ -97,7 +97,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
int CC_id,i,next_i;
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
// LOG_I(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
......@@ -110,8 +110,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
mbsfn_status[CC_id]=0;
}
// refresh UE list based on UEs dropped by PHY in previous subframe
for (i=UE_list->head;i>0;i=UE_list->next[i]) {
LOG_T(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)));
for (i=UE_list->head;i>=0;i=UE_list->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)));
if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL)
mac_remove_ue(module_idP,i,frameP);
}
......
......@@ -196,7 +196,8 @@ void assign_rbs_required (module_id_t Mod_id,
LOG_D(MAC,"[preprocessor] assign RB for UE %d\n",UE_id);
for (i=0;i<UE_list->numactiveCCs[UE_id];i++) {
CC_id = UE_list->ordered_CCids[i][UE_id];
frame_parms[CC_id] = mac_xface->get_lte_frame_parms(Mod_id,CC_id);
eNB_UE_stats[CC_id] = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti);
if (eNB_UE_stats[CC_id]->dlsch_mcs1==0) nb_rbs_required[CC_id][UE_id] = 4; // don't let the TBS get too small
else nb_rbs_required[CC_id][UE_id] = min_rb_unit[CC_id];
TBS = mac_xface->get_TBS_DL(eNB_UE_stats[CC_id]->dlsch_mcs1,nb_rbs_required[CC_id][UE_id]);
......@@ -421,6 +422,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
average_rbs_per_user[CC_id]=0;
frame_parms[CC_id] = mac_xface->get_lte_frame_parms(Mod_id,CC_id);
mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
if(round>0)
......@@ -694,7 +696,7 @@ void dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id,
if((rballoc_sub[CC_id][i] == 0) &&
(rballoc_sub_UE[CC_id][UE_id][i] == 0) &&
(nb_rbs_required_remaining[UE_id]>0) &&
(nb_rbs_required_remaining[CC_id][UE_id]>0) &&
(pre_nb_available_rbs[CC_id][UE_id] < nb_rbs_required[CC_id][UE_id])){
// if this UE is not scheduled for TM5
......@@ -739,7 +741,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
int16_t total_remaining_rbs[MAX_NUM_CCs];
uint16_t max_num_ue_to_be_scheduled=0,total_ue_count=0;
rnti_t rnti= -1;
uint32_t nCCE_to_be_used[CC_id];
uint32_t nCCE_to_be_used[MAX_NUM_CCs];
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
UE_TEMPLATE *UE_template;
LTE_DL_FRAME_PARMS *frame_parms;
......@@ -832,7 +834,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
if(round>0)
nb_allocated_rbs[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb_ul[harq_pid];
else
nb_allocated_rbs[CC_id][UE_id] = cmin(UE_template->pre_allocated_nb_rb_ul, average_rbs_per_user[CC_id]);
nb_allocated_rbs[CC_id][UE_id] = cmin(UE_list->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul, average_rbs_per_user[CC_id]);
total_allocated_rbs[CC_id]+= nb_allocated_rbs[CC_id][UE_id];
......
......@@ -1077,6 +1077,13 @@ uint8_t do_SIB23(uint8_t Mod_id,
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#ifdef XER_PRINT
int i=0;
for (i = 0; i < (enc_rval.encoded+7)/8; i++)
printf("%02x ", ((uint8_t*)buffer)[i]);
printf("\n");
#endif
#if defined(ENABLE_ITTI)
# if !defined(DISABLE_XER_SPRINT)
{
......
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