Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pasolini/openairinterface5g
  • odukan/openairinterface5g
  • ewa/openairinterface5g
  • deksprime/openairinterface5g
  • jackokie/openairinterface5g
  • Srushti16/openairinterface5g
  • BRodolphe/openairinterface5g
  • kramantas/openairinterface5g
  • suraj_4g5g/openairinterface5g
  • turletti/openairinterface5g
  • anandriisc/openairinterface5g
  • lvguorong/openairinterface5g
  • dast/openairinterface5g
  • yashwanthr/openairinterface5g
  • ajiti2tb/openairinterface5g
  • qzhou/openairinterface5g
  • nickmxxx/openairinterface5g
  • bin_he4/openairinterface5g
  • delarco/openairinterface5g
  • limx1980/openairinterface5g
  • Aniq/openairinterface5g
  • yassir63/openairinterface5g
  • orc318/openairinterface5g
  • vader/openairinterface5g
  • limx59/openairinterface5g
  • nadavaati_12345/openairinterface5g
  • jenshz/openairinterface5g
  • kuldeep/openairinterface5g
  • lurker/openairinterface5g
  • shariat/openairinterface5g
  • Alireza.najafzadeh/openairinterface5g
  • Ling/openairinterface5g
  • EvanKrall/openairinterface5g
  • youyih/openairinterface5g
  • anindya/openairinterface5g
  • ahan/openairinterface5g
  • beraoud/openairinterface5g
  • obejarano/openairinterface5g
  • Monti/openairinterface5g
  • akhamsi/openairinterface5g
  • Worker.N/openairinterface5g
  • zhangtu/openairinterface5g
  • desouza/openairinterface5g
  • zhijun/openairinterface5g
  • sureshkumar/openairinterface5g
  • milan/openairinterface5g
  • bigbangbingo/openairinterface5g
  • platini/openairinterface5g
  • muralir-nv/openairinterface5g
  • Joshua_Zhang/openairinterface5g
  • siddharthmurali1/openairinterface5g
  • sorinros/openairinterface5g
  • elainecao/openairinterface5g
  • sneltved/openairinterface5g
  • aikaterini.trilyraki/openairinterface5g
  • wujunning11/openairinterface5g
  • magounak/openairinterface5g
  • ycl1729020039/openairinterface5g
  • mayukhweb/openairinterface5g
  • wataru/openairinterface5g
  • afonsoli/openairinterface5g
  • ppokar/openairinterface5g
  • emest/openairinterface5g
  • Najib/openairinterface5g
  • liqing/openairinterface5g
  • gprshome/openairinterface5g
  • Dvevgedveccc/openairinterface5g
  • Elena_Lukashova/openairinterface5g
  • imaneouss/openairinterface5g
  • yangyuan/openairinterface5g
  • ycliang/openairinterface5g
  • rohanfds/openairinterface5g
  • cong2008abc/openairinterface5g
  • Giovanni/openairinterface5g
  • willvegapunk/openairinterface5g
  • Chen/openairinterface5g
  • Ella/openairinterface5g
  • kollabalu/openairinterface5g
  • tsaichanglan/openairinterface5g
  • Artifice/openairinterface5g
  • HJR0129/openairinterface5g
  • alextp/openairinterface5g
  • Changron/openairinterface5g
  • pedosb/openairinterface5g
  • Flozzen/openairinterface5g
  • hobei/openairinterface5g
  • WP_Jing/openairinterface5g
  • reset4/openairinterface5g
  • alexjoseph/openairinterface5g
  • latuan1710/openairinterface5g
  • wynter-wang/openairinterface5g
  • stt12706/openairinterface5g
  • sy/openairinterface5g
  • dzxu/openairinterface5g
  • ptizoom/openairinterface5g
  • Thierry/openairinterface5g
  • tjamc80/openairinterface5g
  • yenmuse/openairinterface5g
  • archerling/openairinterface5g
  • grahul/openairinterface5g
  • ashish.shri/openairinterface5g
  • TianyuChen/openairinterface5g
  • cuixf1/openairinterface5g
  • Jan/openairinterface5g
  • jboatenng/openairinterface5g_gpio
  • geokal/openairinterface5g
  • johannhg/openairinterface5g
  • TofunmiA/openairinterface5g
  • razvanursu/openairinterface5g-mac-scheduling
  • Julio/openairinterface5g
  • fredrichx/openairinterface5g
  • nems/openairinterface5g
  • wb_li/openairinterface5g
  • ferrieux/openairinterface5g
  • prajna_g/openairinterface-5-g-xnap-ho
  • mtinasc/openairinterface5g
  • Hofschroeer/openairinterface5g
  • buptxiaofeng/openairinterface5g
  • fjgh_759/openairinterface5g
  • calcel/openairinterface5g
  • Reem/openairinterface5g
  • havar_mind/openairinterface5g
  • shrinish/openairinterface5g
  • YANGHELINDE/openairinterface5g
  • lool/openairinterface5g
  • raghav1900/openairinterface5g
  • allan1201/openairinterface5g
  • ferris/openairinterface5g
  • seanzw/openairinterface5g
  • emad72/openairinterface5g
  • guojilong123/openairinterface5g
  • Rony99/openairinterface5g
  • lity/openairinterface5g
  • sshrivastava/openairinterface5g
  • zhihengzhang/openairinterface5g
  • Rakesh_B_B/openairinterface5g
  • baleeiro/openairinterface5g
  • 19125064/openairinterface5g
  • linlin/openairinterface5g
  • NA1VE/openairinterface5g
  • oai1B/openairinterface5g
  • daveprice/openairinterface5g
  • mo/openairinterface5g
  • dhanmeet/openairinterface5g
  • mv2290/openairinterface-5-g-test
  • pagmatt/openairinterface5g
  • mmTestNYU/openairinterface5g
  • mmezzavilla/openairinterface5g
  • sudhakarb/openairinterface5g
  • mekki/openairinterface5g
  • virtanen/openairinterface5g
  • dyyu/openairinterface5g
  • mohammed_safwan/openairinterface5g
  • venkat/openairinterface5g
  • rupadhya/openairinterface5g
  • adjou/openairinterface5g
  • samiemostafavi/openairinterface5g-edaf
  • oliverxsch/openairinterface5g
  • Simewu/openairinterface5g
  • Sreeram/openairinterface5g
  • oai/openairinterface5g
161 results
Show changes
Showing
with 658 additions and 376 deletions
...@@ -144,7 +144,7 @@ void store_dlsch_buffer (module_id_t Mod_id, ...@@ -144,7 +144,7 @@ void store_dlsch_buffer (module_id_t Mod_id,
*/ */
if (UE_template->dl_buffer_info[i]>0) if (UE_template->dl_buffer_info[i]>0)
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] Frame %d Subframe %d : RLC status for UE %d in LCID%d: total of %d pdus and size %d, head sdu queuing time %d, remaining size %d, is segmeneted %d \n", "[eNB %d] Frame %d Subframe %d : RLC status for UE %d in LCID%d: total of %d pdus and size %d, head sdu queuing time %d, remaining size %d, is segmented %d \n",
Mod_id, frameP, subframeP, UE_id, Mod_id, frameP, subframeP, UE_id,
i, UE_template->dl_pdus_in_buffer[i],UE_template->dl_buffer_info[i], i, UE_template->dl_pdus_in_buffer[i],UE_template->dl_buffer_info[i],
UE_template->dl_buffer_head_sdu_creation_time[i], UE_template->dl_buffer_head_sdu_creation_time[i],
...@@ -230,7 +230,7 @@ void assign_rbs_required (module_id_t Mod_id, ...@@ -230,7 +230,7 @@ void assign_rbs_required (module_id_t Mod_id,
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1,nb_rbs_required[CC_id][UE_id]); TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1,nb_rbs_required[CC_id][UE_id]);
LOG_D(MAC,"[preprocessor] start RB assignement for UE %d CC_id %d dl buffer %d (RB unit %d, MCS %d, TBS %d) \n", LOG_D(MAC,"[preprocessor] start RB assignment for UE %d CC_id %d dl buffer %d (RB unit %d, MCS %d, TBS %d) \n",
UE_id, CC_id, UE_list->UE_template[pCCid][UE_id].dl_buffer_total, UE_id, CC_id, UE_list->UE_template[pCCid][UE_id].dl_buffer_total,
nb_rbs_required[CC_id][UE_id],eNB_UE_stats->dlsch_mcs1,TBS); nb_rbs_required[CC_id][UE_id],eNB_UE_stats->dlsch_mcs1,TBS);
...@@ -607,7 +607,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, ...@@ -607,7 +607,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
/* /*
* If schedule is enabled and if the priority of the UEs is modified * If schedule is enabled and if the priority of the UEs is modified
* The average rbs per logical channel per user will depend on the level of * The average rbs per logical channel per user will depend on the level of
* priority. Concerning the hypothetical assignement, we should assign more * priority. Concerning the hypothetical assignment, we should assign more
* rbs to prioritized users. Maybe, we can do a mapping between the * rbs to prioritized users. Maybe, we can do a mapping between the
* average rbs per user and the level of priority or multiply the average rbs * average rbs per user and the level of priority or multiply the average rbs
* per user by a coefficient which represents the degree of priority. * per user by a coefficient which represents the degree of priority.
...@@ -668,7 +668,7 @@ if (nb_rbs_required_remaining[CC_id][i]<0) abort(); ...@@ -668,7 +668,7 @@ if (nb_rbs_required_remaining[CC_id][i]<0) abort();
} }
if (nb_rbs_required[CC_id][i]> 0 ) if (nb_rbs_required[CC_id][i]> 0 )
LOG_D(MAC,"round %d : nb_rbs_required_remaining[%d][%d]= %d (remaining_1 %d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)\n", if (0)LOG_D(MAC,"round %d : nb_rbs_required_remaining[%d][%d]= %d (remaining_1 %d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)\n",
r1, CC_id, i, r1, CC_id, i,
nb_rbs_required_remaining[CC_id][i], nb_rbs_required_remaining[CC_id][i],
nb_rbs_required_remaining_1[CC_id][i], nb_rbs_required_remaining_1[CC_id][i],
...@@ -848,17 +848,17 @@ if (nb_rbs_required_remaining[CC_id][i]<0) abort(); ...@@ -848,17 +848,17 @@ if (nb_rbs_required_remaining[CC_id][i]<0) abort();
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].dl_pow_off = dl_pow_off[UE_id]; //PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].dl_pow_off = dl_pow_off[UE_id];
if (ue_sched_ctl->pre_nb_available_rbs[CC_id] > 0 ) { if (ue_sched_ctl->pre_nb_available_rbs[CC_id] > 0 ) {
LOG_D(MAC,"******************DL Scheduling Information for UE%d ************************\n",UE_id); //LOG_D(MAC,"******************DL Scheduling Information for UE%d ************************\n",UE_id);
LOG_D(MAC,"dl power offset UE%d = %d \n",UE_id,ue_sched_ctl->dl_pow_off[CC_id]); //LOG_D(MAC,"dl power offset UE%d = %d \n",UE_id,ue_sched_ctl->dl_pow_off[CC_id]);
LOG_D(MAC,"***********RB Alloc for every subband for UE%d ***********\n",UE_id); //LOG_D(MAC,"***********RB Alloc for every subband for UE%d ***********\n",UE_id);
for(j=0; j<N_RBG[CC_id]; j++) { for(j=0; j<N_RBG[CC_id]; j++) {
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].rballoc_sub[i] = rballoc_sub_UE[CC_id][UE_id][i]; //PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].rballoc_sub[i] = rballoc_sub_UE[CC_id][UE_id][i];
LOG_D(MAC,"RB Alloc for UE%d and Subband%d = %d\n",UE_id,j,ue_sched_ctl->rballoc_sub_UE[CC_id][j]); //LOG_D(MAC,"RB Alloc for UE%d and Subband%d = %d\n",UE_id,j,ue_sched_ctl->rballoc_sub_UE[CC_id][j]);
} }
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = pre_nb_available_rbs[CC_id][UE_id]; //PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = pre_nb_available_rbs[CC_id][UE_id];
LOG_D(MAC,"Total RBs allocated for UE%d = %d\n",UE_id,ue_sched_ctl->pre_nb_available_rbs[CC_id]); //LOG_D(MAC,"Total RBs allocated for UE%d = %d\n",UE_id,ue_sched_ctl->pre_nb_available_rbs[CC_id]);
} }
} }
} }
...@@ -881,7 +881,6 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ...@@ -881,7 +881,6 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
int i,j; int i,j;
UE_list_t *UE_list=&RC.mac[module_idP]->UE_list; UE_list_t *UE_list=&RC.mac[module_idP]->UE_list;
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
rnti_t rnti = UE_RNTI(module_idP,UE_id);
uint8_t *vrb_map = RC.mac[module_idP]->common_channels[CC_id].vrb_map; uint8_t *vrb_map = RC.mac[module_idP]->common_channels[CC_id].vrb_map;
int N_RB_DL = to_prb(RC.mac[module_idP]->common_channels[CC_id].mib->message.dl_Bandwidth); int N_RB_DL = to_prb(RC.mac[module_idP]->common_channels[CC_id].mib->message.dl_Bandwidth);
...@@ -891,7 +890,8 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ...@@ -891,7 +890,8 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
#endif #endif
LOG_D(MAC,"Running preprocessor for UE %d (%x)\n",UE_id,rnti); //rnti_t rnti = UE_RNTI(module_idP,UE_id);
//LOG_D(MAC,"Running preprocessor for UE %d (%x)\n",UE_id,rnti);
// initialize harq_pid and round // initialize harq_pid and round
if (ue_sched_ctl->ta_timer) ue_sched_ctl->ta_timer--; if (ue_sched_ctl->ta_timer) ue_sched_ctl->ta_timer--;
...@@ -1014,11 +1014,11 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ...@@ -1014,11 +1014,11 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
for (j = 0; j < rb_size; j++) { for (j = 0; j < rb_size; j++) {
if (vrb_map[j+(i*RBGsize)] != 0) { if (vrb_map[j+(i*RBGsize)] != 0) {
rballoc_sub[CC_id][i] = 1; rballoc_sub[CC_id][i] = 1;
LOG_D(MAC,"Frame %d, subframe %d : vrb %d allocated\n",frameP,subframeP,j+(i*RBGsize)); //LOG_D(MAC,"Frame %d, subframe %d : vrb %d allocated\n",frameP,subframeP,j+(i*RBGsize));
break; break;
} }
} }
LOG_D(MAC,"Frame %d Subframe %d CC_id %d RBG %i : rb_alloc %d\n",frameP,subframeP,CC_id,i,rballoc_sub[CC_id][i]); //LOG_D(MAC,"Frame %d Subframe %d CC_id %d RBG %i : rb_alloc %d\n",frameP,subframeP,CC_id,i,rballoc_sub[CC_id][i]);
MIMO_mode_indicator[CC_id][i] = 2; MIMO_mode_indicator[CC_id][i] = 2;
} }
} }
...@@ -1101,11 +1101,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1101,11 +1101,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
UE_TEMPLATE *UE_template = 0; UE_TEMPLATE *UE_template = 0;
int N_RB_DL; int N_RB_DL;
int N_RB_UL; int N_RB_UL;
LOG_D(MAC,"In ulsch_preprocessor: assign max mcs min rb\n"); //LOG_D(MAC,"In ulsch_preprocessor: assign max mcs min rb\n");
// maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB
assign_max_mcs_min_rb(module_idP,frameP, subframeP, first_rb); assign_max_mcs_min_rb(module_idP,frameP, subframeP, first_rb);
LOG_D(MAC,"In ulsch_preprocessor: sort ue \n"); //LOG_D(MAC,"In ulsch_preprocessor: sort ue \n");
// sort ues // sort ues
sort_ue_ul (module_idP,frameP, subframeP); sort_ue_ul (module_idP,frameP, subframeP);
...@@ -1124,7 +1124,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1124,7 +1124,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
} }
} }
LOG_D(MAC,"In ulsch_preprocessor: step2 \n"); //LOG_D(MAC,"In ulsch_preprocessor: step2 \n");
// step 2: calculate the average rb per UE // step 2: calculate the average rb per UE
total_ue_count =0; total_ue_count =0;
max_num_ue_to_be_scheduled=0; max_num_ue_to_be_scheduled=0;
...@@ -1142,11 +1142,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1142,11 +1142,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
UE_id = i; UE_id = i;
LOG_D(MAC,"In ulsch_preprocessor: handling UE %d/%x\n",UE_id,rnti); //LOG_D(MAC,"In ulsch_preprocessor: handling UE %d/%x\n",UE_id,rnti);
for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) { for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
// This is the actual CC_id in the list // This is the actual CC_id in the list
CC_id = UE_list->ordered_ULCCids[n][UE_id]; CC_id = UE_list->ordered_ULCCids[n][UE_id];
LOG_D(MAC,"In ulsch_preprocessor: handling UE %d/%x CCid %d\n",UE_id,rnti,CC_id); //LOG_D(MAC,"In ulsch_preprocessor: handling UE %d/%x CCid %d\n",UE_id,rnti,CC_id);
UE_template = &UE_list->UE_template[CC_id][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id];
average_rbs_per_user[CC_id]=0; average_rbs_per_user[CC_id]=0;
...@@ -1177,9 +1177,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1177,9 +1177,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
} }
} }
} }
if (total_ue_count > 0) //if (total_ue_count > 0) LOG_D(MAC,"[eNB %d] Frame %d subframe %d: total ue to be scheduled %d/%d\n", module_idP, frameP, subframeP,total_ue_count, max_num_ue_to_be_scheduled);
LOG_D(MAC,"[eNB %d] Frame %d subframe %d: total ue to be scheduled %d/%d\n",
module_idP, frameP, subframeP,total_ue_count, max_num_ue_to_be_scheduled);
//LOG_D(MAC,"step3\n"); //LOG_D(MAC,"step3\n");
...@@ -1209,7 +1207,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1209,7 +1207,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
} }
total_allocated_rbs[CC_id]+= nb_allocated_rbs[CC_id][UE_id]; total_allocated_rbs[CC_id]+= nb_allocated_rbs[CC_id][UE_id];
LOG_D(MAC,"In ulsch_preprocessor: assigning %d RBs for UE %d/%x CCid %d, harq_pid %d\n",nb_allocated_rbs[CC_id][UE_id],UE_id,rnti,CC_id,harq_pid); //LOG_D(MAC,"In ulsch_preprocessor: assigning %d RBs for UE %d/%x CCid %d, harq_pid %d\n",nb_allocated_rbs[CC_id][UE_id],UE_id,rnti,CC_id,harq_pid);
} }
} }
...@@ -1245,8 +1243,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1245,8 +1243,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
} }
} else { } else {
UE_template->pre_allocated_nb_rb_ul= nb_allocated_rbs[CC_id][UE_id]; UE_template->pre_allocated_nb_rb_ul= nb_allocated_rbs[CC_id][UE_id];
LOG_D(MAC,"******************UL Scheduling Information for UE%d CC_id %d ************************\n",UE_id, CC_id); //LOG_D(MAC,"******************UL Scheduling Information for UE%d CC_id %d ************************\n",UE_id, CC_id);
LOG_D(MAC,"[eNB %d] total RB allocated for UE%d CC_id %d = %d\n", module_idP, UE_id, CC_id, UE_template->pre_allocated_nb_rb_ul); //LOG_D(MAC,"[eNB %d] total RB allocated for UE%d CC_id %d = %d\n", module_idP, UE_id, CC_id, UE_template->pre_allocated_nb_rb_ul);
} }
} }
} }
...@@ -1255,7 +1253,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1255,7 +1253,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
if (total_allocated_rbs[CC_id]>0) { if (total_allocated_rbs[CC_id]>0) {
LOG_D(MAC,"[eNB %d] total RB allocated for all UEs = %d/%d\n", module_idP, total_allocated_rbs[CC_id], N_RB_UL - first_rb[CC_id]); //LOG_D(MAC,"[eNB %d] total RB allocated for all UEs = %d/%d\n", module_idP, total_allocated_rbs[CC_id], N_RB_UL - first_rb[CC_id]);
} }
} }
} }
...@@ -1277,11 +1275,15 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra ...@@ -1277,11 +1275,15 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
int Ncp; int Ncp;
int N_RB_UL; int N_RB_UL;
//LOG_D(MAC, "%s() Enter\n", __FUNCTION__);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) { for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_list->active[i] != TRUE) continue; if (UE_list->active[i] != TRUE) continue;
rnti = UE_RNTI(module_idP,i); rnti = UE_RNTI(module_idP,i);
//LOG_D(MAC, "%s() UE active rnti:%04x UE_list->UE_sched_ctrl[i].ul_out_of_sync:%d UE_list->UE_sched_ctrl[i].phr_received:%d numactiveULCCs[UE_id]:%d UE_list->UE_template[CC_id][UE_id].ul_total_buffer:%d\n", __FUNCTION__, rnti, UE_list->UE_sched_ctrl[i].ul_out_of_sync, UE_list->UE_sched_ctrl[i].phr_received, UE_list->numactiveULCCs[i], UE_list->UE_template[CC_id][i].ul_total_buffer);
if (rnti==NOT_A_RNTI) if (rnti==NOT_A_RNTI)
continue; continue;
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
...@@ -1330,7 +1332,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra ...@@ -1330,7 +1332,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
while ((((UE_template->phr_info - tx_power) < 0 ) || (tbs > UE_template->ul_total_buffer))&& while ((((UE_template->phr_info - tx_power) < 0 ) || (tbs > UE_template->ul_total_buffer))&&
(mcs > 3)) { (mcs > 3)) {
// LOG_I(MAC,"UE_template->phr_info %d tx_power %d mcs %d\n", UE_template->phr_info,tx_power, mcs); LOG_I(MAC,"UE_template->phr_info %d tx_power %d mcs %d\n", UE_template->phr_info,tx_power, mcs);
mcs--; mcs--;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3;
tx_power = estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,Ncp,0); // fixme: set use_srs tx_power = estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,Ncp,0); // fixme: set use_srs
...@@ -1367,13 +1369,17 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra ...@@ -1367,13 +1369,17 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
UE_template->pre_allocated_nb_rb_ul, UE_template->pre_allocated_nb_rb_ul,
UE_template->phr_info,tx_power); UE_template->phr_info,tx_power);
} else { } else {
//LOG_E(MAC,"no ul buffer");
/* if UE has pending scheduling request then pre-allocate 3 RBs */ /* if UE has pending scheduling request then pre-allocate 3 RBs */
//if (UE_template->ul_active == 1 && UE_template->ul_SR == 1) { //if (UE_template->ul_active == 1 && UE_template->ul_SR == 1) {
if (UE_is_to_be_scheduled(module_idP, CC_id, i)) { if (UE_is_to_be_scheduled(module_idP, CC_id, i)) {
UE_template->pre_assigned_mcs_ul = 10;
UE_template->pre_allocated_rb_table_index_ul = 2; UE_template->pre_allocated_rb_table_index_ul = 2;
UE_template->pre_allocated_nb_rb_ul = 3; UE_template->pre_allocated_nb_rb_ul = 3;
} else { } else {
UE_template->pre_allocated_rb_table_index_ul=-1; UE_template->pre_assigned_mcs_ul = 0;
UE_template->pre_allocated_rb_table_index_ul =-1;
UE_template->pre_allocated_nb_rb_ul=0; UE_template->pre_allocated_nb_rb_ul=0;
} }
} }
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include "SIMULATION/TOOLS/defs.h" // for taus #include "SIMULATION/TOOLS/defs.h" // for taus
extern UE_MODE_t get_ue_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id) int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id)
{ {
......
...@@ -91,6 +91,8 @@ extern Packet_OTG_List_t *otg_pdcp_buffer; ...@@ -91,6 +91,8 @@ extern Packet_OTG_List_t *otg_pdcp_buffer;
# include "gtpv1u_eNB_task.h" # include "gtpv1u_eNB_task.h"
#endif #endif
extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP);
/* Prevent de-queueing the same PDCP SDU from the queue twice /* Prevent de-queueing the same PDCP SDU from the queue twice
* by multiple threads. This has happened in TDD when thread-odd * by multiple threads. This has happened in TDD when thread-odd
* is flushing a PDCP SDU after UE_RX() processing; whereas * is flushing a PDCP SDU after UE_RX() processing; whereas
......
...@@ -10,21 +10,29 @@ ...@@ -10,21 +10,29 @@
IF_Module_t *if_inst[MAX_IF_MODULES]; IF_Module_t *if_inst[MAX_IF_MODULES];
Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs]; Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs];
extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind);
extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern uint8_t nfapi_mode;
extern uint16_t sf_ahead;
void handle_rach(UL_IND_t *UL_info) { void handle_rach(UL_IND_t *UL_info) {
int i; int i;
if (UL_info->rach_ind.number_of_preambles>0) { if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
AssertFatal(UL_info->rach_ind.number_of_preambles==1,"More than 1 preamble not supported\n"); AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
UL_info->rach_ind.number_of_preambles=0; UL_info->rach_ind.rach_indication_body.number_of_preambles=0;
LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc\n",UL_info->frame,UL_info->subframe); LOG_E(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf));
initiate_ra_proc(UL_info->module_id, initiate_ra_proc(UL_info->module_id,
UL_info->CC_id, UL_info->CC_id,
UL_info->frame, NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf),
UL_info->subframe, NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf),
UL_info->rach_ind.preamble_list[0].preamble_rel8.preamble, UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
UL_info->rach_ind.preamble_list[0].preamble_rel8.timing_advance, UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
UL_info->rach_ind.preamble_list[0].preamble_rel8.rnti UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
#ifdef Rel14 #ifdef Rel14
,0 ,0
#endif #endif
...@@ -32,24 +40,24 @@ void handle_rach(UL_IND_t *UL_info) { ...@@ -32,24 +40,24 @@ void handle_rach(UL_IND_t *UL_info) {
} }
#ifdef Rel14 #ifdef Rel14
if (UL_info->rach_ind_br.number_of_preambles>0) { if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) {
AssertFatal(UL_info->rach_ind_br.number_of_preambles<5,"More than 4 preambles not supported\n"); AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n");
for (i=0;i<UL_info->rach_ind_br.number_of_preambles;i++) { for (i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) {
AssertFatal(UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type>0, AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0,
"Got regular PRACH preamble, not BL/CE\n"); "Got regular PRACH preamble, not BL/CE\n");
LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe, LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe,
UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type-1); UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type-1);
initiate_ra_proc(UL_info->module_id, initiate_ra_proc(UL_info->module_id,
UL_info->CC_id, UL_info->CC_id,
UL_info->frame, UL_info->frame,
UL_info->subframe, UL_info->subframe,
UL_info->rach_ind_br.preamble_list[i].preamble_rel8.preamble, UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble,
UL_info->rach_ind_br.preamble_list[i].preamble_rel8.timing_advance, UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance,
UL_info->rach_ind_br.preamble_list[i].preamble_rel8.rnti, UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti,
UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type); UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type);
} }
UL_info->rach_ind.number_of_preambles=0; UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0;
} }
#endif #endif
} }
...@@ -58,91 +66,169 @@ void handle_sr(UL_IND_t *UL_info) { ...@@ -58,91 +66,169 @@ void handle_sr(UL_IND_t *UL_info) {
int i; int i;
for (i=0;i<UL_info->sr_ind.number_of_srs;i++) if (nfapi_mode == 1) // PNF
SR_indication(UL_info->module_id, {
UL_info->CC_id, if (UL_info->sr_ind.sr_indication_body.number_of_srs>0)
UL_info->frame, {
UL_info->subframe, oai_nfapi_sr_indication(&UL_info->sr_ind);
UL_info->sr_ind.sr_pdu_list[i].rx_ue_information.rnti, }
UL_info->sr_ind.sr_pdu_list[i].ul_cqi_information.ul_cqi); }
else
{
for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
SR_indication(UL_info->module_id,
UL_info->CC_id,
UL_info->frame,
UL_info->subframe,
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
}
UL_info->sr_ind.number_of_srs=0; UL_info->sr_ind.sr_indication_body.number_of_srs=0;
} }
void handle_cqi(UL_IND_t *UL_info) { void handle_cqi(UL_IND_t *UL_info) {
int i; int i;
for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++) if (nfapi_mode == 1)
cqi_indication(UL_info->module_id, {
UL_info->CC_id, if (UL_info->cqi_ind.number_of_cqis>0)
UL_info->frame, {
UL_info->subframe, LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis);
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti, nfapi_cqi_indication_t ind;
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu, ind.header.message_id = NFAPI_RX_CQI_INDICATION;
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information); ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe;
ind.cqi_indication_body = UL_info->cqi_ind;
UL_info->cqi_ind.number_of_cqis=0;
oai_nfapi_cqi_indication(&ind);
UL_info->cqi_ind.number_of_cqis=0;
}
}
else
{
for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++)
cqi_indication(UL_info->module_id,
UL_info->CC_id,
UL_info->frame,
UL_info->subframe,
UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti,
&UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9,
UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu,
&UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information);
UL_info->cqi_ind.number_of_cqis=0;
}
} }
void handle_harq(UL_IND_t *UL_info) { void handle_harq(UL_IND_t *UL_info) {
int i; int i;
for (i=0;i<UL_info->harq_ind.number_of_harqs;i++) //if (UL_info->harq_ind.number_of_harqs>0)
harq_indication(UL_info->module_id,
UL_info->CC_id,
UL_info->frame,
UL_info->subframe,
&UL_info->harq_ind.harq_pdu_list[i]);
UL_info->harq_ind.number_of_harqs=0; if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF
{
LOG_E(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
int retval = oai_nfapi_harq_indication(&UL_info->harq_ind);
if (retval!=0)
{
LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval);
}
UL_info->harq_ind.harq_indication_body.number_of_harqs = 0;
}
else
{
for (i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
harq_indication(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf),
&UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]);
UL_info->harq_ind.harq_indication_body.number_of_harqs=0;
}
} }
void handle_ulsch(UL_IND_t *UL_info) { void handle_ulsch(UL_IND_t *UL_info) {
int i,j; int i,j;
for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) { if(nfapi_mode == 1)
{
for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) { if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0)
// find crc_indication j corresponding rx_indication i {
if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti == LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) {
if (UL_info->crc_ind.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication oai_nfapi_crc_indication(&UL_info->crc_ind);
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
rx_sdu(UL_info->module_id, UL_info->crc_ind.crc_indication_body.number_of_crcs = 0;
UL_info->CC_id, }
UL_info->frame,
UL_info->subframe, if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0)
UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti, {
(uint8_t *)NULL, LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length, oai_nfapi_rx_ind(&UL_info->rx_ind);
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance, UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi); }
} }
else { else
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe); {
rx_sdu(UL_info->module_id, for (i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) {
UL_info->CC_id, for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) {
UL_info->frame, // find crc_indication j corresponding rx_indication i
UL_info->subframe, LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti, if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti ==
UL_info->rx_ind.rx_pdu_list[i].data, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) {
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.length, LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag);
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.timing_advance, if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
UL_info->rx_ind.rx_pdu_list[i].rx_indication_rel8.ul_cqi); LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe);
} rx_sdu(UL_info->module_id,
break; UL_info->CC_id,
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti == NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
// UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) { NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
} // for (j=0;j<UL_info->crc_ind.number_of_crcs;j++) { UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
AssertFatal(j<UL_info->crc_ind.number_of_crcs,"Couldn't find matchin CRC indication\n"); (uint8_t *)NULL,
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) { UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
UL_info->rx_ind.number_of_pdus=0; UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
UL_info->crc_ind.number_of_crcs=0; }
else {
LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe);
rx_sdu(UL_info->module_id,
UL_info->CC_id,
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe,
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
}
break;
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
// UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti)
} // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++)
AssertFatal(j<UL_info->crc_ind.crc_indication_body.number_of_crcs,"Couldn't find matchin CRC indication\n");
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
}
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0)
{
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
LOG_D(PHY, "UL_INFO:SFN/SF:%d%d ZEROING rx_ind[SFN/SF:%d number_of_pdus:%d]\n", UL_info->frame, UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf), UL_info->rx_ind.rx_indication_body.number_of_pdus);
}
if (UL_info->subframe && UL_info->crc_ind.crc_indication_body.number_of_crcs>0)
{
LOG_D(PHY, "UL_INFO:SFN/SF:%d%d ZEROING crc_ind[SFN/SF:%d crcs:%d]\n", UL_info->frame, UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf), UL_info->crc_ind.crc_indication_body.number_of_crcs);
UL_info->crc_ind.crc_indication_body.number_of_crcs=0;
}
} }
/****************************************************************************/ /****************************************************************************/
...@@ -184,22 +270,22 @@ static void dump_ul(UL_IND_t *u) ...@@ -184,22 +270,22 @@ static void dump_ul(UL_IND_t *u)
A("XXXX UL mod %d CC %d f.sf %d.%d\n", A("XXXX UL mod %d CC %d f.sf %d.%d\n",
u->module_id, u->CC_id, u->frame, u->subframe); u->module_id, u->CC_id, u->frame, u->subframe);
A("XXXX harq_ind %d\n", u->harq_ind.number_of_harqs); A("XXXX harq_ind %d\n", u->harq_ind.harq_indication_body.number_of_harqs);
for (i = 0; i < u->harq_ind.number_of_harqs; i++) { for (i = 0; i < u->harq_ind.harq_indication_body.number_of_harqs; i++) {
nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_pdu_list[i]; nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_indication_body.harq_pdu_list[i];
A("XXXX harq ind %d\n", i); A("XXXX harq ind %d\n", i);
A("XXXX rnti %d\n", v->rx_ue_information.rnti); A("XXXX rnti %d\n", v->rx_ue_information.rnti);
A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1, A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1,
v->harq_indication_fdd_rel8.harq_tb2); v->harq_indication_fdd_rel8.harq_tb2);
A("XXXX number_of_ack_nack %d\n", A("XXXX number_of_ack_nack %d\n",
v->harq_indication_fdd_rel9.number_of_ack_nack); v->harq_indication_fdd_rel9.number_of_ack_nack);
A("XXXX harq[0] = %d\n", A("XXXX harq[0] = %d\n",
v->harq_indication_fdd_rel9.harq_tb_n[0]); v->harq_indication_fdd_rel9.harq_tb_n[0]);
A("XXXX harq ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi, A("XXXX harq ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi,
v->ul_cqi_information.channel); v->ul_cqi_information.channel);
} }
A("XXXX crc_ind %d\n", u->crc_ind.number_of_crcs); A("XXXX crc_ind %d\n", u->crc_ind.crc_indication_body.number_of_crcs);
A("XXXX sr_ind %d\n", u->sr_ind.number_of_srs); A("XXXX sr_ind %d\n", u->sr_ind.number_of_srs);
...@@ -211,11 +297,11 @@ static void dump_ul(UL_IND_t *u) ...@@ -211,11 +297,11 @@ static void dump_ul(UL_IND_t *u)
v->ul_cqi_information.channel); v->ul_cqi_information.channel);
} }
A("XXXX rach_ind %d\n", u->rach_ind.number_of_preambles); A("XXXX rach_ind %d\n", u->rach_ind.rach_indication_body.number_of_preambles);
A("XXXX rx_ind %d\n", u->rx_ind.number_of_pdus); A("XXXX rx_ind %d\n", u->rx_ind.rx_indication_body.number_of_pdus);
for (i = 0; i < u->rx_ind.number_of_pdus; i++) { for (i = 0; i < u->rx_ind.rx_indication_body.number_of_pdus; i++) {
nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_pdu_list[i]; nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_indication_body.rx_pdu_list[i];
A("XXXX rx ind %d\n", i); A("XXXX rx ind %d\n", i);
A("XXXX timing_advance %d\n", A("XXXX timing_advance %d\n",
v->rx_indication_rel8.timing_advance); v->rx_indication_rel8.timing_advance);
...@@ -442,25 +528,31 @@ void UL_indication(UL_IND_t *UL_info) ...@@ -442,25 +528,31 @@ void UL_indication(UL_IND_t *UL_info)
IF_Module_t *ifi = if_inst[module_id]; IF_Module_t *ifi = if_inst[module_id];
eNB_MAC_INST *mac = RC.mac[module_id]; eNB_MAC_INST *mac = RC.mac[module_id];
LOG_D(PHY,"UL_Indication: frame %d, subframe %d, module_id %d, CC_id %d\n", LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
UL_info->frame,UL_info->subframe, UL_info->frame,UL_info->subframe,
module_id,CC_id); module_id,CC_id,
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs);
if (ifi->CC_mask==0) { if (nfapi_mode != 1)
ifi->current_frame = UL_info->frame; {
ifi->current_subframe = UL_info->subframe; if (ifi->CC_mask==0) {
} ifi->current_frame = UL_info->frame;
else { ifi->current_subframe = UL_info->subframe;
AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask); }
AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask); else {
AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask);
AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask);
}
ifi->CC_mask |= (1<<CC_id);
} }
ifi->CC_mask |= (1<<CC_id);
//LOG_D(PHY,"%s() SFN_SF:%d%d About to call clear_nfapi_information()\n", __FUNCTION__, UL_info->frame, UL_info->subframe);
// clear DL/UL info for new scheduling round // clear DL/UL info for new scheduling round
clear_nfapi_information(RC.mac[module_id],CC_id, clear_nfapi_information(RC.mac[module_id],CC_id,
UL_info->frame,UL_info->subframe); UL_info->frame,UL_info->subframe);
//LOG_D(PHY,"%s() SFN_SF:%d%d Returned from call clear_nfapi_information()\n", __FUNCTION__, UL_info->frame, UL_info->subframe);
handle_rach(UL_info); handle_rach(UL_info);
...@@ -470,61 +562,68 @@ void UL_indication(UL_IND_t *UL_info) ...@@ -470,61 +562,68 @@ void UL_indication(UL_IND_t *UL_info)
handle_harq(UL_info); handle_harq(UL_info);
// clear HI prior to hanling ULSCH // clear HI prior to handling ULSCH
mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0; mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0;
handle_ulsch(UL_info); handle_ulsch(UL_info);
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) { if (nfapi_mode != 1)
{
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
eNB_dlsch_ulsch_scheduler(module_id, eNB_dlsch_ulsch_scheduler(module_id,
(UL_info->frame+((UL_info->subframe>5)?1:0)) % 1024, (UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024,
(UL_info->subframe+4)%10); (UL_info->subframe+sf_ahead)%10);
ifi->CC_mask = 0; ifi->CC_mask = 0;
sched_info->module_id = module_id; sched_info->module_id = module_id;
sched_info->CC_id = CC_id; sched_info->CC_id = CC_id;
sched_info->frame = (UL_info->frame + ((UL_info->subframe>5) ? 1 : 0)) % 1024; sched_info->frame = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024;
sched_info->subframe = (UL_info->subframe+4)%10; sched_info->subframe = (UL_info->subframe+sf_ahead)%10;
sched_info->DL_req = &mac->DL_req[CC_id]; sched_info->DL_req = &mac->DL_req[CC_id];
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id]; sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
if ((mac->common_channels[CC_id].tdd_Config==NULL) || if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
(is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+4)%10)>0)) (is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+sf_ahead)%10)>0))
sched_info->UL_req = &mac->UL_req[CC_id]; sched_info->UL_req = &mac->UL_req[CC_id];
else else
sched_info->UL_req = NULL; sched_info->UL_req = NULL;
sched_info->TX_req = &mac->TX_req[CC_id]; sched_info->TX_req = &mac->TX_req[CC_id];
#ifdef DUMP_FAPI #ifdef DUMP_FAPI
dump_dl(sched_info); dump_dl(sched_info);
#endif #endif
AssertFatal(ifi->schedule_response!=NULL, if (ifi->schedule_response)
"UL_indication is null (mod %d, cc %d)\n", {
module_id, AssertFatal(ifi->schedule_response!=NULL,
CC_id); "schedule_response is null (mod %d, cc %d)\n",
ifi->schedule_response(sched_info); module_id,
CC_id);
ifi->schedule_response(sched_info);
}
LOG_D(PHY,"Schedule_response: frame %d, subframe %d (dl_pdus %d / %p)\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu, LOG_D(PHY,"Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu);
&sched_info->DL_req->dl_config_request_body.number_pdu); }
} }
} }
IF_Module_t *IF_Module_init(int Mod_id){ IF_Module_t *IF_Module_init(int Mod_id){
AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES); AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
if (if_inst[Mod_id]==NULL) { if (if_inst[Mod_id]==NULL) {
if_inst[Mod_id] = (IF_Module_t*)malloc(sizeof(IF_Module_t)); if_inst[Mod_id] = (IF_Module_t*)malloc(sizeof(IF_Module_t));
memset((void*)if_inst[Mod_id],0,sizeof(IF_Module_t)); memset((void*)if_inst[Mod_id],0,sizeof(IF_Module_t));
if_inst[Mod_id]->CC_mask=0; if_inst[Mod_id]->CC_mask=0;
if_inst[Mod_id]->UL_indication = UL_indication; if_inst[Mod_id]->UL_indication = UL_indication;
AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0, AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0,
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id); "allocation of if_inst[%d]->if_mutex fails\n",Mod_id);
} }
return if_inst[Mod_id]; return if_inst[Mod_id];
} }
......
...@@ -61,30 +61,30 @@ typedef struct{ ...@@ -61,30 +61,30 @@ typedef struct{
sub_frame_t subframe; sub_frame_t subframe;
/// harq indication list /// harq indication list
nfapi_harq_indication_body_t harq_ind; nfapi_harq_indication_t harq_ind;
/// crc indication list /// crc indication list
nfapi_crc_indication_body_t crc_ind; nfapi_crc_indication_t crc_ind;
/// SR indication list /// SR indication list
nfapi_sr_indication_body_t sr_ind; nfapi_sr_indication_t sr_ind;
/// CQI indication list /// CQI indication list
nfapi_cqi_indication_body_t cqi_ind; nfapi_cqi_indication_body_t cqi_ind;
/// RACH indication list /// RACH indication list
nfapi_rach_indication_body_t rach_ind; nfapi_rach_indication_t rach_ind;
#ifdef Rel14 #ifdef Rel14
/// RACH indication list for BR UEs /// RACH indication list for BR UEs
nfapi_rach_indication_body_t rach_ind_br; nfapi_rach_indication_t rach_ind_br;
#endif #endif
/// SRS indication list /// SRS indication list
nfapi_srs_indication_body_t srs_ind; nfapi_srs_indication_body_t srs_ind;
/// RX indication /// RX indication
nfapi_rx_indication_body_t rx_ind; nfapi_rx_indication_t rx_ind;
} UL_IND_t; } UL_IND_t;
......
...@@ -81,7 +81,6 @@ mac_rrc_data_req( ...@@ -81,7 +81,6 @@ mac_rrc_data_req(
uint8_t sfn = (uint8_t)((frameP>>2)&0xff); uint8_t sfn = (uint8_t)((frameP>>2)&0xff);
#ifdef DEBUG_RRC #ifdef DEBUG_RRC
int i; int i;
LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id); LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
...@@ -148,6 +147,7 @@ mac_rrc_data_req( ...@@ -148,6 +147,7 @@ mac_rrc_data_req(
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
} // All RFN mod 8 transmit SIB2-3 in SF 5 } // All RFN mod 8 transmit SIB2-3 in SF 5
else if ((frameP%8) == 1) { else if ((frameP%8) == 1) {
//LOG_D(RRC, "%s() frameP mod 8==1 (frameP:%d) copy into buffer SIB23 size:%d\n", __FUNCTION__, frameP, RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23, RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
...@@ -197,7 +197,7 @@ mac_rrc_data_req( ...@@ -197,7 +197,7 @@ mac_rrc_data_req(
(void*)mib, (void*)mib,
carrier->MIB, carrier->MIB,
24); 24);
LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded); //LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded);
buffer_pP[0]=carrier->MIB[0]; buffer_pP[0]=carrier->MIB[0];
buffer_pP[1]=carrier->MIB[1]; buffer_pP[1]=carrier->MIB[1];
buffer_pP[2]=carrier->MIB[2]; buffer_pP[2]=carrier->MIB[2];
...@@ -312,7 +312,7 @@ mac_rrc_data_req( ...@@ -312,7 +312,7 @@ mac_rrc_data_req(
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
} }
if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3 if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR, RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR,
......
...@@ -65,7 +65,7 @@ openair_rrc_on( ...@@ -65,7 +65,7 @@ openair_rrc_on(
int CC_id; int CC_id;
if (ctxt_pP->enb_flag == ENB_FLAG_YES) { if (ctxt_pP->enb_flag == ENB_FLAG_YES) {
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n", LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" ENB:OPENAIR RRC IN....\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1); rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
...@@ -74,7 +74,7 @@ openair_rrc_on( ...@@ -74,7 +74,7 @@ openair_rrc_on(
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1; RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
} }
} else { } else {
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n", LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" UE?:OPENAIR RRC IN....\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
for (i = 0; i < NB_eNB_INST; i++) { for (i = 0; i < NB_eNB_INST; i++) {
......
...@@ -282,6 +282,8 @@ init_SI( ...@@ -282,6 +282,8 @@ init_SI(
} }
#endif #endif
LOG_I(RRC, "About to call rrc_mac_config_req_eNB\n");
rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id, rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId,
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB,
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define COMPONENT_LOG #define COMPONENT_LOG
#define COMPONENT_LOG_IF #define COMPONENT_LOG_IF
#include <ctype.h>
#include "log.h" #include "log.h"
#include "vcd_signal_dumper.h" #include "vcd_signal_dumper.h"
#include "assertions.h" #include "assertions.h"
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
# define FIFO_PRINTF_NO 62 # define FIFO_PRINTF_NO 62
# define FIFO_PRINTF_SIZE 65536 # define FIFO_PRINTF_SIZE 65536
#endif #endif
#include "common/config/config_userapi.h"
// main log variables // main log variables
log_t *g_log; log_t *g_log;
...@@ -103,65 +103,6 @@ static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG ...@@ -103,65 +103,6 @@ static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG
static log_instance_type_t log_instance_type; static log_instance_type_t log_instance_type;
#endif #endif
/* get log parameters from configuration file */
void log_getconfig(log_t *g_log) {
char *gloglevel = NULL;
char *glogverbo = NULL;
int level,verbosity;
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
paramdef_t logparams_level[MAX_LOG_COMPONENTS];
paramdef_t logparams_verbosity[MAX_LOG_COMPONENTS];
paramdef_t logparams_logfile[MAX_LOG_COMPONENTS];
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
if (ret <0) {
fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed");
return;
}
memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS);
memset(logparams_verbosity,0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS);
memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS);
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
if(g_log->log_component[i].name == NULL) {
g_log->log_component[i].name = malloc(16);
sprintf((char *)g_log->log_component[i].name,"comp%i?",i);
logparams_logfile[i].paramflags = PARAMFLAG_DONOTREAD;
logparams_level[i].paramflags = PARAMFLAG_DONOTREAD;
logparams_verbosity[i].paramflags = PARAMFLAG_DONOTREAD;
}
sprintf(logparams_level[i].optname, LOG_CONFIG_LEVEL_FORMAT, g_log->log_component[i].name);
sprintf(logparams_verbosity[i].optname,LOG_CONFIG_VERBOSITY_FORMAT, g_log->log_component[i].name);
sprintf(logparams_logfile[i].optname, LOG_CONFIG_LOGFILE_FORMAT, g_log->log_component[i].name);
/* workaround: all log options in existing configuration files use lower case component names
where component names include uppercase char in log.h.... */
for (int j=0 ; j<strlen(logparams_level[i].optname); j++)
logparams_level[i].optname[j] = tolower(logparams_level[i].optname[j]);
for (int j=0 ; j<strlen(logparams_level[i].optname); j++)
logparams_verbosity[i].optname[j] = tolower(logparams_verbosity[i].optname[j]);
for (int j=0 ; j<strlen(logparams_level[i].optname); j++)
logparams_logfile[i].optname[j] = tolower(logparams_logfile[i].optname[j]);
/* */
logparams_level[i].defstrval = gloglevel;
logparams_verbosity[i].defstrval = glogverbo;
logparams_level[i].type = TYPE_STRING;
logparams_verbosity[i].type = TYPE_STRING;
logparams_logfile[i].type = TYPE_UINT;
logparams_logfile[i].paramflags = logparams_logfile[i].paramflags|PARAMFLAG_BOOL;
}
config_get( logparams_level, MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_verbosity,MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_logfile, MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
verbosity = map_str_to_int(log_verbosity_names,*(logparams_verbosity[i].strptr));
level = map_str_to_int(log_level_names, *(logparams_level[i].strptr));
set_comp_log(i, level,verbosity,1);
set_component_filelog(*(logparams_logfile[i].uptr));
}
}
int logInit (void) int logInit (void)
{ {
#ifdef USER_MODE #ifdef USER_MODE
...@@ -500,7 +441,7 @@ int logInit (void) ...@@ -500,7 +441,7 @@ int logInit (void)
openlog(g_log->log_component[EMU].name, LOG_PID, g_log->config.facility); openlog(g_log->log_component[EMU].name, LOG_PID, g_log->config.facility);
#endif // ! defined(CN_BUILD) #endif // ! defined(CN_BUILD)
} }
log_getconfig(g_log);
if (g_log->filelog) { if (g_log->filelog) {
gfd = open(g_log->filelog_name, O_WRONLY | O_CREAT, 0666); gfd = open(g_log->filelog_name, O_WRONLY | O_CREAT, 0666);
} }
...@@ -528,8 +469,50 @@ int logInit (void) ...@@ -528,8 +469,50 @@ int logInit (void)
return 0; return 0;
} }
void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args)
{
LOG_params log_params;
int len;
len = vsnprintf(log_params.l_buff_info, MAX_LOG_INFO-1, format, args);
//2 first parameters must be passed as 'const' to the thread function
log_params.file = strdup(file);
log_params.func = strdup(func);
log_params.line = line;
log_params.comp = comp;
log_params.level = level;
log_params.format = format;
log_params.len = len;
if (pthread_mutex_lock(&log_lock) != 0) {
return;
}
log_list_tail++;
log_list[log_list_tail - 1] = log_params;
if (log_list_tail >= 1000) {
log_list_tail = 0;
}
if (log_list_nb_elements < 1000) {
log_list_nb_elements++;
}
if(pthread_cond_signal(&log_notify) != 0) {
pthread_mutex_unlock(&log_lock);
return;
}
if(pthread_mutex_unlock(&log_lock) != 0) {
return;
}
}
//log record: add to a list //log record: add to a list
void logRecord(const char *file, const char *func, int line, int comp, void logRecord(const char *file, const char *func, int line, pthread_t thread_id, int comp,
int level, const char *format, ...) int level, const char *format, ...)
{ {
va_list args; va_list args;
...@@ -544,6 +527,7 @@ void logRecord(const char *file, const char *func, int line, int comp, ...@@ -544,6 +527,7 @@ void logRecord(const char *file, const char *func, int line, int comp,
log_params.file = strdup(file); log_params.file = strdup(file);
log_params.func = strdup(func); log_params.func = strdup(func);
log_params.line = line; log_params.line = line;
log_params.thread_id = thread_id;
log_params.comp = comp; log_params.comp = comp;
log_params.level = level; log_params.level = level;
log_params.format = format; log_params.format = format;
...@@ -582,7 +566,7 @@ void logRecord(const char *file, const char *func, int line, int comp, ...@@ -582,7 +566,7 @@ void logRecord(const char *file, const char *func, int line, int comp,
} }
void logRecord_thread_safe(const char *file, const char *func, void logRecord_thread_safe(const char *file, const char *func,
int line, int comp, int level, int line, pthread_t thread_id, int comp, int level,
int len, const char *params_string) int len, const char *params_string)
{ {
log_component_t *c; log_component_t *c;
...@@ -634,6 +618,8 @@ void logRecord_thread_safe(const char *file, const char *func, ...@@ -634,6 +618,8 @@ void logRecord_thread_safe(const char *file, const char *func,
func); func);
} }
total_len += snprintf(&log_buffer[total_len], MAX_LOG_TOTAL - total_len, "[%08lx] ", thread_id);
if ((g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) { if ((g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) {
total_len += snprintf(&log_buffer[total_len], MAX_LOG_TOTAL - total_len, "[%s:%d]", total_len += snprintf(&log_buffer[total_len], MAX_LOG_TOTAL - total_len, "[%s:%d]",
file, line); file, line);
...@@ -733,6 +719,7 @@ void *log_thread_function(void *list) ...@@ -733,6 +719,7 @@ void *log_thread_function(void *list)
logRecord_thread_safe(log_params.file, logRecord_thread_safe(log_params.file,
log_params.func, log_params.func,
log_params.line, log_params.line,
log_params.thread_id,
log_params.comp, log_params.comp,
log_params.level, log_params.level,
log_params.len, log_params.len,
...@@ -1021,8 +1008,8 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, ...@@ -1021,8 +1008,8 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
#endif /* #if 0 */ #endif /* #if 0 */
//log record, format, and print: executed in the main thread (mt) //log record, format, and print: executed in the main thread (mt)
void logRecord_mt(const char *file, const char *func, int line, int comp, void logRecord_mt(const char *file, const char *func, int line,
int level, const char *format, ...) pthread_t thread_id, int comp, int level, const char *format, ...)
{ {
int len = 0; int len = 0;
va_list args; va_list args;
...@@ -1117,13 +1104,16 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, ...@@ -1117,13 +1104,16 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
} }
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%08lx]", thread_id);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args); len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
log_end = log_buffer + len; log_end = log_buffer + len;
if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) { if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s", len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
log_level_highlight_end[level]); log_level_highlight_end[level]);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
} }
} }
...@@ -1142,7 +1132,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, ...@@ -1142,7 +1132,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
} }
#else #else
fwrite(log_buffer, len, 1, stdout); fwrite(log_buffer, len, 1, stdout);
#endif #endif
#ifndef RTAI #ifndef RTAI
...@@ -1378,8 +1368,8 @@ int set_comp_log(int component, int level, int verbosity, int interval) ...@@ -1378,8 +1368,8 @@ int set_comp_log(int component, int level, int verbosity, int interval)
void set_glog(int level, int verbosity) void set_glog(int level, int verbosity)
{ {
if( g_log->level >= 0) g_log->level = level; g_log->level = level;
if( g_log->flag >= 0) g_log->flag = verbosity; g_log->flag = verbosity;
} }
void set_glog_syslog(int enable) void set_glog_syslog(int enable)
{ {
......
...@@ -240,6 +240,7 @@ typedef struct LOG_params { ...@@ -240,6 +240,7 @@ typedef struct LOG_params {
const char *file; const char *file;
const char *func; const char *func;
int line; int line;
pthread_t thread_id;
int comp; int comp;
int level; int level;
const char *format; const char *format;
...@@ -262,8 +263,8 @@ void log_set_instance_type (log_instance_type_t instance); ...@@ -262,8 +263,8 @@ void log_set_instance_type (log_instance_type_t instance);
# include "log_if.h" # include "log_if.h"
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int logInit (void); int logInit (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void logRecord_mt(const char *file, const char *func, int line,pthread_t thread_id, int comp, int level, const char *format, ...) __attribute__ ((format (printf, 7, 8)));
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void logRecord(const char *file, const char *func, int line, pthread_t thread_id, int comp, int level, const char *format, ...) __attribute__ ((format (printf, 7, 8)));
int set_comp_log(int component, int level, int verbosity, int interval); int set_comp_log(int component, int level, int verbosity, int interval);
int set_log(int component, int level, int interval); int set_log(int component, int level, int interval);
void set_glog(int level, int verbosity); void set_glog(int level, int verbosity);
...@@ -285,15 +286,15 @@ void *log_thread_function(void * list); ...@@ -285,15 +286,15 @@ void *log_thread_function(void * list);
#ifdef USER_MODE #ifdef USER_MODE
//#define logIt(component, level, format, args...) do {logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args);} while(0); //#define logIt(component, level, format, args...) do {logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args);} while(0);
#ifdef LOG_NO_THREAD #ifdef LOG_NO_THREAD
#define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args) #define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#else //default #else //default
#define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args) #define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#endif #endif
#else #else
#ifdef LOG_NO_THREAD #ifdef LOG_NO_THREAD
#define logIt(component, level, format, args...) logRecord_mt(NULL, __FUNCTION__, __LINE__, component, level, format, ##args) #define logIt(component, level, format, args...) logRecord_mt(NULL, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#else // default #else // default
#define logIt(component, level, format, args...) logRecord(NULL, __FUNCTION__, __LINE__, component, level, format, ##args) #define logIt(component, level, format, args...) logRecord(NULL, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#endif #endif
#endif #endif
/* @}*/ /* @}*/
...@@ -352,6 +353,19 @@ void *log_thread_function(void * list); ...@@ -352,6 +353,19 @@ void *log_thread_function(void * list);
# define LOG_N(c, x...) /* */ # define LOG_N(c, x...) /* */
# define LOG_F(c, x...) /* */ # define LOG_F(c, x...) /* */
# else /*DISABLE_LOG_X*/ # else /*DISABLE_LOG_X*/
#if 0
extern log_t *g_log;
# define LOG_G(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_EMERG > g_log->log_component[c].level || LOG_EMERG > g_log->level) logIt(c, LOG_EMERG, x); } while(0)
# define LOG_A(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_ALERT > g_log->log_component[c].level || LOG_ALERT > g_log->level) logIt(c, LOG_ALERT, x); } while(0)
# define LOG_C(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_CRIT > g_log->log_component[c].level || LOG_CRIT > g_log->level) logIt(c, LOG_CRIT, x); } while(0)
# define LOG_E(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_ERR > g_log->log_component[c].level || LOG_ERR > g_log->level) logIt(c, LOG_ERR, x); } while(0)
# define LOG_W(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_WARNING > g_log->log_component[c].level || LOG_WARNING > g_log->level) logIt(c, LOG_WARNING, x); } while(0)
# define LOG_N(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_NOTICE > g_log->log_component[c].level || LOG_NOTICE > g_log->level) logIt(c, LOG_NOTICE, x); } while(0)
# define LOG_I(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_INFO > g_log->log_component[c].level || LOG_INFO > g_log->level) logIt(c, LOG_INFO, x); } while(0)
# define LOG_D(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_DEBUG > g_log->log_component[c].level || LOG_DEBUG > g_log->level) logIt(c, LOG_DEBUG, x); } while(0)
# define LOG_F(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_FILE > g_log->log_component[c].level || LOG_FILE > g_log->level) logIt(c, LOG_FILE, x); } while(0)
# define LOG_T(c, x...) do { if (g_log->log_component[c].level > g_log->level || LOG_TRACE > g_log->log_component[c].level || LOG_TRACE > g_log->level) logIt(c, LOG_TRACE, x); } while(0)
#else
# define LOG_G(c, x...) logIt(c, LOG_EMERG, x) # define LOG_G(c, x...) logIt(c, LOG_EMERG, x)
# define LOG_A(c, x...) logIt(c, LOG_ALERT, x) # define LOG_A(c, x...) logIt(c, LOG_ALERT, x)
# define LOG_C(c, x...) logIt(c, LOG_CRIT, x) # define LOG_C(c, x...) logIt(c, LOG_CRIT, x)
...@@ -362,6 +376,7 @@ void *log_thread_function(void * list); ...@@ -362,6 +376,7 @@ void *log_thread_function(void * list);
# define LOG_D(c, x...) logIt(c, LOG_DEBUG, x) # define LOG_D(c, x...) logIt(c, LOG_DEBUG, x)
# define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation # define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation
# define LOG_T(c, x...) logIt(c, LOG_TRACE, x) # define LOG_T(c, x...) logIt(c, LOG_TRACE, x)
# endif /* 0 */
# endif /*DISABLE_LOG_X*/ # endif /*DISABLE_LOG_X*/
# endif /* T_TRACER */ # endif /* T_TRACER */
#else /* USER_MODE */ #else /* USER_MODE */
......
...@@ -399,6 +399,17 @@ const char* eurecomFunctionsNames[] = { ...@@ -399,6 +399,17 @@ const char* eurecomFunctionsNames[] = {
"compress_if", "compress_if",
"decompress_if", "decompress_if",
"nfapi_subframe",
"generate_pcfich",
"generate_dci0",
"generate_dlsch",
"generate_phich",
"pdcch_scrambling",
"pdcch_modulation",
"pdcch_interleaving",
"pdcch_tx",
}; };
struct vcd_module_s vcd_modules[] = { struct vcd_module_s vcd_modules[] = {
......
...@@ -376,6 +376,16 @@ typedef enum { ...@@ -376,6 +376,16 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF,
VCD_SIGNAL_DUMPER_FUNCTIONS_NFAPI,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PCFICH,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_MODULATION,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_END VCD_SIGNAL_DUMPER_FUNCTIONS_END
} vcd_signal_dump_functions; } vcd_signal_dump_functions;
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "COMMON/platform_constants.h" #include "COMMON/platform_constants.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "common/ran_context.h" #include "common/ran_context.h"
#include "gtpv1u_eNB_defs.h"
#undef GTP_DUMP_SOCKET #undef GTP_DUMP_SOCKET
......
...@@ -427,7 +427,7 @@ on_error: ...@@ -427,7 +427,7 @@ on_error:
return NULL; return NULL;
} }
int udp_enb_init() int udp_enb_init(void)
{ {
LOG_I(UDP_, "Initializing UDP task interface\n"); LOG_I(UDP_, "Initializing UDP task interface\n");
STAILQ_INIT(&udp_socket_list); STAILQ_INIT(&udp_socket_list);
......
...@@ -331,10 +331,10 @@ static void trx_usrp_end(openair0_device *device) { ...@@ -331,10 +331,10 @@ static void trx_usrp_end(openair0_device *device) {
/*! \brief Called to send samples to the USRP RF target /*! \brief Called to send samples to the USRP RF target
@param device pointer to the device structure specific to the RF hardware target @param device pointer to the device structure specific to the RF hardware target
@param timestamp The timestamp at whicch the first sample MUST be sent @param timestamp The timestamp at which the first sample MUST be sent
@param buff Buffer which holds the samples @param buff Buffer which holds the samples
@param nsamps number of samples to be sent @param nsamps number of samples to be sent
@param antenna_id index of the antenna if the device has multiple anteannas @param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied @param flags flags must be set to TRUE if timestamp parameter needs to be applied
*/ */
static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
...@@ -743,6 +743,8 @@ extern "C" { ...@@ -743,6 +743,8 @@ extern "C" {
openair0_cfg[0].rx_gain_calib_table = calib_table_x310; openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
LOG_I(PHY,"%s() sample_rate:%u\n", __FUNCTION__, (int)openair0_cfg[0].sample_rate);
switch ((int)openair0_cfg[0].sample_rate) { switch ((int)openair0_cfg[0].sample_rate) {
case 30720000: case 30720000:
// from usrp_time_offset // from usrp_time_offset
...@@ -879,6 +881,8 @@ extern "C" { ...@@ -879,6 +881,8 @@ extern "C" {
s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i); s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i); s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i);
LOG_I(PHY,"USRP TX_GAIN:%3.2lf gain_range:%3.2lf tx_gain:%3.2lf\n", gain_range_tx.stop()-openair0_cfg[0].tx_gain[i], gain_range_tx.stop(), openair0_cfg[0].tx_gain[i]);
} }
} }
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
int create_tasks(uint32_t enb_nb, uint32_t ue_nb) int create_tasks(uint32_t enb_nb, uint32_t ue_nb)
{ {
LOG_E(ENB_APP, "%s(enb_nb:%d ue_nb:%d)\n", __FUNCTION__, enb_nb, ue_nb);
itti_wait_ready(1); itti_wait_ready(1);
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) { if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(PDCP, "Create task for L2L1 failed\n"); LOG_E(PDCP, "Create task for L2L1 failed\n");
......
...@@ -17,7 +17,8 @@ eNBs = ...@@ -17,7 +17,8 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "93"; #mobile_network_code = "93";
mobile_network_code = "92";
tr_s_preference = "local_mac" tr_s_preference = "local_mac"
...@@ -36,7 +37,8 @@ eNBs = ...@@ -36,7 +37,8 @@ eNBs =
downlink_frequency = 2685000000L; downlink_frequency = 2685000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
N_RB_DL = 50; // N_RB_DL = 50;
N_RB_DL = 25;
Nid_cell_mbsfn = 0; Nid_cell_mbsfn = 0;
nb_antenna_ports = 1; nb_antenna_ports = 1;
nb_antennas_tx = 1; nb_antennas_tx = 1;
...@@ -140,7 +142,7 @@ eNBs = ...@@ -140,7 +142,7 @@ eNBs =
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26"; mme_ip_address = ( { ipv4 = "192.168.1.78";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -150,10 +152,10 @@ eNBs = ...@@ -150,10 +152,10 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; ENB_INTERFACE_NAME_FOR_S1_MME = "eno1";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.1.74/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_INTERFACE_NAME_FOR_S1U = "eno1";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.1.74/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
} }
...@@ -176,34 +178,31 @@ L1s = ( ...@@ -176,34 +178,31 @@ L1s = (
RUs = ( RUs = (
{ {
local_rf = "yes" local_rf = "yes"
nb_tx = 1 nb_tx = 1
nb_rx = 1 nb_rx = 1
att_tx = 0 att_tx = 0
att_rx = 0; att_rx = 0;
bands = [7]; bands = [7];
max_pdschReferenceSignalPower = -27; max_pdschReferenceSignalPower = -27;
max_rxgain = 125; max_rxgain = 125;
eNB_instances = [0]; eNB_instances = [0];
} }
); );
log_config : log_config = {
{ global_log_level ="debug";
global_log_level ="info"; global_log_verbosity ="medium";
global_log_verbosity ="medium"; hw_log_level ="info";
hw_log_level ="info"; hw_log_verbosity ="medium";
hw_log_verbosity ="medium"; phy_log_level ="debug";
phy_log_level ="info"; phy_log_verbosity ="medium";
phy_log_verbosity ="medium"; mac_log_level ="info";
mac_log_level ="info"; mac_log_verbosity ="high";
mac_log_verbosity ="high"; rlc_log_level ="info";
rlc_log_level ="info"; rlc_log_verbosity ="medium";
rlc_log_verbosity ="medium"; pdcp_log_level ="info";
pdcp_log_level ="info"; pdcp_log_verbosity ="medium";
pdcp_log_verbosity ="medium"; rrc_log_level ="info";
rrc_log_level ="info"; rrc_log_verbosity ="medium";
rrc_log_verbosity ="medium"; };
};
log_config = {
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="debug";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
L1s = ( L1s = (
{ {
num_cc = 1; num_cc = 1;
tr_n_preference = "nfapi"; tr_n_preference = "nfapi";
local_n_if_name = "lo"; local_n_if_name = "eno1";
remote_n_address = "127.0.0.2"; remote_n_address = "192.168.1.28";
local_n_address = "127.0.0.1"; local_n_address = "192.168.1.74";
local_n_portc = 50000; local_n_portc = 50000;
remote_n_portc = 50000; remote_n_portc = 50001;
local_n_portd = 50001; local_n_portd = 50010;
remote_n_portd = 50001; remote_n_portd = 50011;
} }
); );
...@@ -17,11 +34,10 @@ RUs = ( ...@@ -17,11 +34,10 @@ RUs = (
local_rf = "yes" local_rf = "yes"
nb_tx = 1 nb_tx = 1
nb_rx = 1 nb_rx = 1
att_tx = 0 att_tx = 90
att_rx = 0; att_rx = 0;
bands = [7,38,42,43]; bands = [7,38,42,43];
max_pdschReferenceSignalPower = -27; max_pdschReferenceSignalPower = -27;
max_rxgain = 125; max_rxgain = 125;
eNB_instances = [0];
} }
); );
...@@ -17,7 +17,8 @@ eNBs = ...@@ -17,7 +17,8 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "93"; #mobile_network_code = "93";
mobile_network_code = "92";
tr_s_preference = "local_mac" tr_s_preference = "local_mac"
...@@ -36,7 +37,8 @@ eNBs = ...@@ -36,7 +37,8 @@ eNBs =
downlink_frequency = 2685000000L; downlink_frequency = 2685000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
N_RB_DL = 50; #N_RB_DL = 50;
N_RB_DL = 25;
Nid_cell_mbsfn = 0; Nid_cell_mbsfn = 0;
nb_antenna_ports = 1; nb_antenna_ports = 1;
nb_antennas_tx = 1; nb_antennas_tx = 1;
...@@ -53,7 +55,8 @@ eNBs = ...@@ -53,7 +55,8 @@ eNBs =
pucch_nRB_CQI = 1; pucch_nRB_CQI = 1;
pucch_nCS_AN = 0; pucch_nCS_AN = 0;
pucch_n1_AN = 32; pucch_n1_AN = 32;
pdsch_referenceSignalPower = -27; #pdsch_referenceSignalPower = -27;
pdsch_referenceSignalPower = -30;
pdsch_p_b = 0; pdsch_p_b = 0;
pusch_n_SB = 1; pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE"; pusch_enable64QAM = "DISABLE";
...@@ -89,7 +92,8 @@ eNBs = ...@@ -89,7 +92,8 @@ eNBs =
rach_messagePowerOffsetGroupB = ; rach_messagePowerOffsetGroupB = ;
*/ */
rach_powerRampingStep = 4; rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108; #rach_preambleInitialReceivedTargetPower = -108;
rach_preambleInitialReceivedTargetPower = -104;
rach_preambleTransMax = 10; rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10; rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48; rach_macContentionResolutionTimer = 48;
...@@ -140,7 +144,7 @@ eNBs = ...@@ -140,7 +144,7 @@ eNBs =
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "127.0.0.3"; mme_ip_address = ( { ipv4 = "192.168.1.78";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -150,45 +154,45 @@ eNBs = ...@@ -150,45 +154,45 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; ENB_INTERFACE_NAME_FOR_S1_MME = "eno1";
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.1.28/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo"; ENB_INTERFACE_NAME_FOR_S1U = "eno1";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.1.28/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
} }
); );
log_config = {
global_log_level ="crit";
global_log_verbosity ="high";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="debug";
phy_log_verbosity ="high";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="debug";
rlc_log_verbosity ="high";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="debug";
rrc_log_verbosity ="high";
};
MACRLCs = ( MACRLCs = (
{ {
num_cc = 1; num_cc = 1;
local_s_if_name = "lo"; local_s_if_name = "eno1";
remote_s_address = "127.0.0.1"; remote_s_address = "192.168.1.74";
local_s_address = "127.0.0.2"; #local_s_address = "192.168.1.78";
local_s_portc = 50000; local_s_address = "192.168.1.28";
local_s_portc = 50001;
remote_s_portc = 50000; remote_s_portc = 50000;
local_s_portd = 50001; local_s_portd = 50011;
remote_s_portd = 50001; remote_s_portd = 50010;
tr_s_preference = "nfapi"; tr_s_preference = "nfapi";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
} }
); );
...@@ -121,6 +121,8 @@ extern int transmission_mode; ...@@ -121,6 +121,8 @@ extern int transmission_mode;
extern int oaisim_flag; extern int oaisim_flag;
uint16_t sf_ahead=2;
//pthread_t main_eNB_thread; //pthread_t main_eNB_thread;
time_stats_t softmodem_stats_mt; // main thread time_stats_t softmodem_stats_mt; // main thread
...@@ -151,48 +153,92 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); ...@@ -151,48 +153,92 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe); void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
#endif #endif
extern uint8_t nfapi_mode;
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf); start_meas(&softmodem_stats_rxtx_sf);
// *******************************************************************
if (nfapi_mode == 1)
{
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
uint16_t frame = proc->frame_rx;
uint16_t subframe = proc->subframe_rx;
//add_subframe(&frame, &subframe, 4);
//oai_subframe_ind(proc->frame_tx, proc->subframe_tx);
//LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe);
oai_subframe_ind(frame, subframe);
LOG_D(PHY, "UL_info[rx_ind:%d:%d number_of_harqs:%d:%d number_of_crcs:%d:%d number_of_preambles:%d:%d number_of_cqis:%d] RX:%d%d TX:%d%d num_pdcch_symbols:%d\n",
NFAPI_SFNSF2DEC(eNB->UL_INFO.rx_ind.sfn_sf), eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus,
NFAPI_SFNSF2DEC(eNB->UL_INFO.harq_ind.sfn_sf), eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs,
NFAPI_SFNSF2DEC(eNB->UL_INFO.crc_ind.sfn_sf), eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs,
NFAPI_SFNSF2DEC(eNB->UL_INFO.rach_ind.sfn_sf), eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles,
eNB->UL_INFO.cqi_ind.number_of_cqis,
proc->frame_rx, proc->subframe_rx,
proc->frame_tx, proc->subframe_tx, eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols);
}
if (nfapi_mode == 1 && eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols == 0)
{
LOG_E(PHY, "eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols == 0");
return 0;
}
// **************************************** // ****************************************
// Common RX procedures subframe n // Common RX procedures subframe n
T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx)); T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx));
// if this is IF5 or 3GPP_eNB // if this is IF5 or 3GPP_eNB
if (eNB->RU_list[0]->function < NGFI_RAU_IF4p5) { if (eNB && eNB->RU_list && eNB->RU_list[0] && eNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
//LOG_D(PHY,"%s:%s() %u/%u Before wakeup_prach_eNB() proc->instance_cnt_rxtx:%d\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->instance_cnt_rxtx);
wakeup_prach_eNB(eNB,NULL,proc->frame_rx,proc->subframe_rx); wakeup_prach_eNB(eNB,NULL,proc->frame_rx,proc->subframe_rx);
//LOG_D(PHY,"%s:%s() %u/%u Before wakeup_prach_eNB_br() proc->instance_cnt_rxtx:%d\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->instance_cnt_rxtx);
#ifdef Rel14 #ifdef Rel14
wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx); wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx);
//LOG_D(PHY,"%s:%s() %u/%u proc->instance_cnt_rxtx:%d\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->instance_cnt_rxtx);
#endif #endif
} }
// UE-specific RX processing for subframe n // UE-specific RX processing for subframe n
phy_procedures_eNB_uespec_RX(eNB, proc, no_relay ); if (nfapi_mode == 0 || nfapi_mode == 1) {
phy_procedures_eNB_uespec_RX(eNB, proc, no_relay );
}
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.frame = proc->frame_rx; eNB->UL_INFO.frame = proc->frame_rx;
eNB->UL_INFO.subframe = proc->subframe_rx; eNB->UL_INFO.subframe = proc->subframe_rx;
eNB->UL_INFO.module_id = eNB->Mod_id; eNB->UL_INFO.module_id = eNB->Mod_id;
eNB->UL_INFO.CC_id = eNB->CC_id; eNB->UL_INFO.CC_id = eNB->CC_id;
eNB->if_inst->UL_indication(&eNB->UL_INFO); eNB->if_inst->UL_indication(&eNB->UL_INFO);
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
// ***************************************** // *****************************************
// TX processing for subframe n+4 // TX processing for subframe n+sf_ahead
// run PHY TX procedures the one after the other for all CCs to avoid race conditions // run PHY TX procedures the one after the other for all CCs to avoid race conditions
// (may be relaxed in the future for performance reasons) // (may be relaxed in the future for performance reasons)
// ***************************************** // *****************************************
//if (wait_CCs(proc)<0) return(-1); //if (wait_CCs(proc)<0) return(-1);
if (oai_exit) return(-1); if (oai_exit) return(-1);
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1); if (nfapi_mode == 0 || nfapi_mode == 1)
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1);
stop_meas( &softmodem_stats_rxtx_sf ); stop_meas( &softmodem_stats_rxtx_sf );
LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d] time[in:%lld diff:%lld max:%lld]\n\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx,
softmodem_stats_rxtx_sf.in, softmodem_stats_rxtx_sf.diff_now, softmodem_stats_rxtx_sf.max);
return(0); return(0);
} }
...@@ -213,28 +259,40 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -213,28 +259,40 @@ static void* eNB_thread_rxtx( void* param ) {
char thread_name[100]; char thread_name[100];
//LOG_D(PHY,"%s()\n", __FUNCTION__);
// set default return value // set default return value
eNB_thread_rxtx_status = 0; eNB_thread_rxtx_status = 0;
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1); sprintf(thread_name,"RXn_TXnp4_%d",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
thread_top_init(thread_name,1,850000L,1000000L,2000000L); thread_top_init(thread_name,1,850000L,1000000L,2000000L);
//LOG_D(PHY,"%s() thread_name:%s\n", __FUNCTION__, thread_name);
while (!oai_exit) { while (!oai_exit) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
//LOG_D(PHY,"%s:%s() TX:%u/%u About to wait on proc->instance_cnt_rxtx:%d\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->instance_cnt_rxtx);
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break; if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
//LOG_D(PHY,"%s:%s() TX:%u/%u - WOKEN on proc->instance_cnt_rxtx proc->instance_cnt_rxtx:%d \n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->instance_cnt_rxtx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
if (oai_exit) break; if (oai_exit) break;
//LOG_D(PHY,"%s:%s() TX:%u/%u About to rxtx()\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx);
if (eNB->CC_id==0) if (eNB->CC_id==0)
{
if (rxtx(eNB,proc,thread_name) < 0) break; if (rxtx(eNB,proc,thread_name) < 0) break;
}
//LOG_D(PHY,"%s:%s() TX:%u/%u DONE rxtx()\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx);
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
} // while !oai_exit } // while !oai_exit
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
...@@ -278,21 +336,20 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) ...@@ -278,21 +336,20 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string)
proc->subframe_rx = subframe_rx; proc->subframe_rx = subframe_rx;
if (!oai_exit) { if (!oai_exit) {
LOG_D(PHY,"eNB_top in %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n", //LOG_D(PHY,"eNB_top in %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n",
(void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach); //(void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
proc_rxtx->subframe_rx = proc->subframe_rx; proc_rxtx->subframe_rx = proc->subframe_rx;
proc_rxtx->frame_rx = proc->frame_rx; proc_rxtx->frame_rx = proc->frame_rx;
proc_rxtx->subframe_tx = (proc->subframe_rx+4)%10; proc_rxtx->subframe_tx = (proc->subframe_rx+sf_ahead)%10;
proc_rxtx->frame_tx = (proc->subframe_rx>5) ? (1+proc->frame_rx)&1023 : proc->frame_rx; proc_rxtx->frame_tx = (proc->subframe_rx>(9-sf_ahead)) ? (1+proc->frame_rx)&1023 : proc->frame_rx;
proc->frame_tx = proc_rxtx->frame_tx; proc->frame_tx = proc_rxtx->frame_tx;
proc_rxtx->timestamp_tx = proc->timestamp_tx; proc_rxtx->timestamp_tx = proc->timestamp_tx;
if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
LOG_D(PHY,"eNB_top out %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n", //LOG_D(PHY,"eNB_top out %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n", (void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
(void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
} }
} }
...@@ -308,9 +365,14 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -308,9 +365,14 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
int i; int i;
struct timespec wait; struct timespec wait;
LOG_D(PHY,"About to wake RUs\n");
pthread_mutex_lock(&proc->mutex_RU); pthread_mutex_lock(&proc->mutex_RU);
LOG_D(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
for (i=0;i<eNB->num_RU;i++) { for (i=0;i<eNB->num_RU;i++) {
LOG_D(PHY,"eNB->RU_list[%d]:%p\n",i,eNB->RU_list[i]);
if (ru == eNB->RU_list[i]) { if (ru == eNB->RU_list[i]) {
LOG_D(PHY,"proc->RU_mask:%02x\n", proc->RU_mask);
if ((proc->RU_mask&(1<<i)) > 0) if ((proc->RU_mask&(1<<i)) > 0)
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU %d (num_RU %d,mask %x) has not been served yet!\n", LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU %d (num_RU %d,mask %x) has not been served yet!\n",
eNB->Mod_id,proc->frame_rx,proc->subframe_rx,ru->idx,eNB->num_RU,proc->RU_mask); eNB->Mod_id,proc->frame_rx,proc->subframe_rx,ru->idx,eNB->num_RU,proc->RU_mask);
...@@ -318,6 +380,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -318,6 +380,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
} }
} }
if (proc->RU_mask != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return if (proc->RU_mask != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
LOG_E(PHY,"Not all RUs have provided their info\n");
pthread_mutex_unlock(&proc->mutex_RU); pthread_mutex_unlock(&proc->mutex_RU);
return(0); return(0);
} }
...@@ -332,17 +395,19 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -332,17 +395,19 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
#if 0
/* accept some delay in processing - up to 5ms */ /* accept some delay in processing - up to 5ms */
for (i = 0; i < 10 && proc_rxtx->instance_cnt_rxtx == 0; i++) { for (i = 0; i < 10 && proc_rxtx->instance_cnt_rxtx == 0; i++) {
LOG_W( PHY,"[eNB] Frame %d, eNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", proc_rxtx->frame_tx, proc_rxtx->instance_cnt_rxtx); LOG_W( PHY,"[eNB] Frame %d Subframe %d, eNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", proc_rxtx->frame_tx, proc_rxtx->subframe_tx, proc_rxtx->instance_cnt_rxtx);
usleep(500); usleep(500);
} }
if (proc_rxtx->instance_cnt_rxtx == 0) { if (proc_rxtx->instance_cnt_rxtx == 0) {
exit_fun( "TX thread busy" ); //exit_fun( "TX thread busy" ); - DJP - this is commented out just whilst I work out what has gone wrong
return(-1); return(-1);
} }
#endif
// wake up TX for subframe n+4 // wake up TX for subframe n+2
// lock the TX mutex and make sure the thread is ready // lock the TX mutex and make sure the thread is ready
if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) { if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx->subframe_rx&1,proc_rxtx->instance_cnt_rxtx ); LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", proc_rxtx->subframe_rx&1,proc_rxtx->instance_cnt_rxtx );
...@@ -351,19 +416,22 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -351,19 +416,22 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
} }
++proc_rxtx->instance_cnt_rxtx; ++proc_rxtx->instance_cnt_rxtx;
LOG_D(PHY,"%s() %u/%u Just incremented proc->instance_cnt_rxtx:%d\n", __FUNCTION__, proc_rxtx->frame_tx, proc_rxtx->subframe_tx, proc_rxtx->instance_cnt_rxtx);
// We have just received and processed the common part of a subframe, say n. // We have just received and processed the common part of a subframe, say n.
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired // TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
// transmitted timestamp of the next TX slot (first). // transmitted timestamp of the next TX slot (first).
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
// we want to generate subframe (n+4), so TS_tx = TX_rx+4*samples_per_tti, // we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti,
// and proc->subframe_tx = proc->subframe_rx+4 // and proc->subframe_tx = proc->subframe_rx+sf_ahead
proc_rxtx->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti); proc_rxtx->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
proc_rxtx->frame_rx = proc->frame_rx; proc_rxtx->frame_rx = proc->frame_rx;
proc_rxtx->subframe_rx = proc->subframe_rx; proc_rxtx->subframe_rx = proc->subframe_rx;
proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > 5) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx; proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + 4)%10; proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10;
LOG_D(PHY,"Signal &proc_rxtx->cond_rxtx\n");
// the thread can now be woken up // the thread can now be woken up
if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) { if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n"); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n");
...@@ -405,7 +473,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { ...@@ -405,7 +473,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
// check if we have to detect PRACH first // check if we have to detect PRACH first
if (is_prach_subframe(fp,frame,subframe)>0) { if (is_prach_subframe(fp,frame,subframe)>0) {
LOG_D(PHY,"Triggering prach processing, frame %d, subframe %d\n",frame,subframe); //LOG_D(PHY,"Triggering prach processing, frame %d, subframe %d\n",frame,subframe);
if (proc->instance_cnt_prach == 0) { if (proc->instance_cnt_prach == 0) {
LOG_W(PHY,"[eNB] Frame %d Subframe %d, dropping PRACH\n", frame,subframe); LOG_W(PHY,"[eNB] Frame %d Subframe %d, dropping PRACH\n", frame,subframe);
return; return;
...@@ -521,7 +589,7 @@ static void* eNB_thread_prach( void* param ) { ...@@ -521,7 +589,7 @@ static void* eNB_thread_prach( void* param ) {
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"eNB_prach_thread") < 0) break; if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"eNB_prach_thread") < 0) break;
LOG_D(PHY,"Running eNB prach procedures\n"); //LOG_D(PHY,"Running eNB prach procedures\n");
prach_procedures(eNB prach_procedures(eNB
#ifdef Rel14 #ifdef Rel14
,0 ,0
...@@ -562,7 +630,7 @@ static void* eNB_thread_prach_br( void* param ) { ...@@ -562,7 +630,7 @@ static void* eNB_thread_prach_br( void* param ) {
if (wait_on_condition(&proc->mutex_prach_br,&proc->cond_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break; if (wait_on_condition(&proc->mutex_prach_br,&proc->cond_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break;
LOG_D(PHY,"Running eNB prach procedures for BL/CE UEs\n"); //LOG_D(PHY,"Running eNB prach procedures for BL/CE UEs\n");
prach_procedures(eNB,1); prach_procedures(eNB,1);
if (release_thread(&proc->mutex_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break; if (release_thread(&proc->mutex_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break;
...@@ -594,10 +662,12 @@ void init_eNB_proc(int inst) { ...@@ -594,10 +662,12 @@ void init_eNB_proc(int inst) {
pthread_attr_t *attr_prach_br=NULL; pthread_attr_t *attr_prach_br=NULL;
#endif #endif
LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]);
for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) { for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
eNB = RC.eNB[inst][CC_id]; eNB = RC.eNB[inst][CC_id];
#ifndef OCP_FRAMEWORK #ifndef OCP_FRAMEWORK
LOG_I(PHY,"Initializing eNB processes %d CC_id %d \n",inst,CC_id); LOG_I(PHY,"Initializing eNB processes instance:%d CC_id %d \n",inst,CC_id);
#endif #endif
proc = &eNB->proc; proc = &eNB->proc;
...@@ -653,6 +723,8 @@ void init_eNB_proc(int inst) { ...@@ -653,6 +723,8 @@ void init_eNB_proc(int inst) {
// attr_te = &proc->attr_te; // attr_te = &proc->attr_te;
#endif #endif
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
if (eNB->single_thread_flag==0) { if (eNB->single_thread_flag==0) {
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, &proc_rxtx[0] ); pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, &proc_rxtx[0] );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] ); pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] );
...@@ -788,6 +860,8 @@ void init_transport(PHY_VARS_eNB *eNB) { ...@@ -788,6 +860,8 @@ void init_transport(PHY_VARS_eNB *eNB) {
int j; int j;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
LOG_E(PHY, "Initialise transport\n");
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i); LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
for (j=0; j<2; j++) { for (j=0; j<2; j++) {
...@@ -796,8 +870,8 @@ void init_transport(PHY_VARS_eNB *eNB) { ...@@ -796,8 +870,8 @@ void init_transport(PHY_VARS_eNB *eNB) {
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i); LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
exit(-1); exit(-1);
} else { } else {
LOG_D(PHY,"dlsch[%d][%d] => %p\n",i,j,eNB->dlsch[i][j]);
eNB->dlsch[i][j]->rnti=0; eNB->dlsch[i][j]->rnti=0;
LOG_D(PHY,"dlsch[%d][%d] => %p rnti:%d\n",i,j,eNB->dlsch[i][j], eNB->dlsch[i][j]->rnti);
} }
} }
...@@ -850,20 +924,33 @@ void init_eNB_afterRU(void) { ...@@ -850,20 +924,33 @@ void init_eNB_afterRU(void) {
int inst,CC_id,ru_id,i,aa; int inst,CC_id,ru_id,i,aa;
PHY_VARS_eNB *eNB; PHY_VARS_eNB *eNB;
LOG_I(PHY,"%s() RC.nb_inst:%d\n", __FUNCTION__, RC.nb_inst);
for (inst=0;inst<RC.nb_inst;inst++) { for (inst=0;inst<RC.nb_inst;inst++) {
LOG_I(PHY,"RC.nb_CC[inst]:%d\n", RC.nb_CC[inst]);
for (CC_id=0;CC_id<RC.nb_CC[inst];CC_id++) { for (CC_id=0;CC_id<RC.nb_CC[inst];CC_id++) {
LOG_I(PHY,"RC.nb_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.eNB[inst][CC_id]);
eNB = RC.eNB[inst][CC_id]; eNB = RC.eNB[inst][CC_id];
phy_init_lte_eNB(eNB,0,0); phy_init_lte_eNB(eNB,0,0);
// map antennas and PRACH signals to eNB RX // map antennas and PRACH signals to eNB RX
AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id); if (0) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id); LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id);
eNB->frame_parms.nb_antennas_rx = 0; eNB->frame_parms.nb_antennas_rx = 0;
LOG_E(PHY,"Overwriting eNB->prach_vars.rxsigF[0]:%p\n", eNB->prach_vars.rxsigF[0]);
eNB->prach_vars.rxsigF[0] = (int16_t**)malloc16(64*sizeof(int16_t*)); eNB->prach_vars.rxsigF[0] = (int16_t**)malloc16(64*sizeof(int16_t*));
#ifdef Rel14 #ifdef Rel14
for (int ce_level=0;ce_level<4;ce_level++) for (int ce_level=0;ce_level<4;ce_level++) {
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*)); LOG_E(PHY,"Overwriting eNB->prach_vars_br.rxsigF.rxsigF[0]:%p\n", eNB->prach_vars_br.rxsigF[ce_level]);
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*));
}
#endif #endif
LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) { for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) {
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx; eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
...@@ -885,6 +972,33 @@ void init_eNB_afterRU(void) { ...@@ -885,6 +972,33 @@ void init_eNB_afterRU(void) {
eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i]; eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
} }
} }
if (eNB->frame_parms.nb_antennas_rx < 1)
{
LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_rx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_rx);
eNB->frame_parms.nb_antennas_rx = 1;
}
else
{
LOG_I(PHY," Delete code\n");
}
if (eNB->frame_parms.nb_antennas_tx < 1)
{
LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_tx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_tx);
eNB->frame_parms.nb_antennas_tx = 1;
}
else
{
LOG_I(PHY," Delete code\n");
}
AssertFatal(eNB->frame_parms.nb_antennas_rx >0, AssertFatal(eNB->frame_parms.nb_antennas_rx >0,
"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx); "inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx); LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
...@@ -892,9 +1006,12 @@ void init_eNB_afterRU(void) { ...@@ -892,9 +1006,12 @@ void init_eNB_afterRU(void) {
init_transport(eNB); init_transport(eNB);
//init_precoding_weights(RC.eNB[inst][CC_id]); //init_precoding_weights(RC.eNB[inst][CC_id]);
} }
printf("RC.nb_CC[inst:%d]:%d CC_id:%d AFTER LOOP - About to init_eNB_proc\n", inst, RC.nb_CC[inst], CC_id);
init_eNB_proc(inst); init_eNB_proc(inst);
} }
printf("%s() RC.nb_inst:%d AFTER LOOP\n", __FUNCTION__, RC.nb_inst);
printf("%s:%d RC.nb_RU:%d\n", __FILE__, __LINE__, RC.nb_RU);
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) { for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
AssertFatal(RC.ru[ru_id]!=NULL,"ru_id %d is null\n",ru_id); AssertFatal(RC.ru[ru_id]!=NULL,"ru_id %d is null\n",ru_id);
...@@ -904,6 +1021,8 @@ void init_eNB_afterRU(void) { ...@@ -904,6 +1021,8 @@ void init_eNB_afterRU(void) {
RC.ru[ru_id]->wakeup_prach_eNB_br = wakeup_prach_eNB_br; RC.ru[ru_id]->wakeup_prach_eNB_br = wakeup_prach_eNB_br;
RC.ru[ru_id]->eNB_top = eNB_top; RC.ru[ru_id]->eNB_top = eNB_top;
} }
LOG_I(PHY,"%s() Exitting\n", __FUNCTION__);
} }
void init_eNB(int single_thread_flag,int wait_for_sync) { void init_eNB(int single_thread_flag,int wait_for_sync) {
...@@ -912,7 +1031,10 @@ void init_eNB(int single_thread_flag,int wait_for_sync) { ...@@ -912,7 +1031,10 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
int inst; int inst;
PHY_VARS_eNB *eNB; PHY_VARS_eNB *eNB;
LOG_I(PHY,"[lte-softmodem.c] eNB structure about to allocated RC.nb_L1_inst:%d RC.nb_L1_CC[0]:%d\n",RC.nb_L1_inst,RC.nb_L1_CC[0]);
if (RC.eNB == NULL) RC.eNB = (PHY_VARS_eNB***) malloc(RC.nb_L1_inst*sizeof(PHY_VARS_eNB **)); if (RC.eNB == NULL) RC.eNB = (PHY_VARS_eNB***) malloc(RC.nb_L1_inst*sizeof(PHY_VARS_eNB **));
LOG_I(PHY,"[lte-softmodem.c] eNB structure RC.eNB allocated\n");
for (inst=0;inst<RC.nb_L1_inst;inst++) { for (inst=0;inst<RC.nb_L1_inst;inst++) {
if (RC.eNB[inst] == NULL) RC.eNB[inst] = (PHY_VARS_eNB**) malloc(RC.nb_CC[inst]*sizeof(PHY_VARS_eNB *)); if (RC.eNB[inst] == NULL) RC.eNB[inst] = (PHY_VARS_eNB**) malloc(RC.nb_CC[inst]*sizeof(PHY_VARS_eNB *));
for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) { for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) {
...@@ -922,6 +1044,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) { ...@@ -922,6 +1044,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
eNB->single_thread_flag = single_thread_flag; eNB->single_thread_flag = single_thread_flag;
LOG_I(PHY,"Initializing eNB %d CC_id %d single_thread_flag:%d\n",inst,CC_id,single_thread_flag);
#ifndef OCP_FRAMEWORK #ifndef OCP_FRAMEWORK
LOG_I(PHY,"Initializing eNB %d CC_id %d\n",inst,CC_id); LOG_I(PHY,"Initializing eNB %d CC_id %d\n",inst,CC_id);
#endif #endif
...@@ -938,21 +1061,17 @@ void init_eNB(int single_thread_flag,int wait_for_sync) { ...@@ -938,21 +1061,17 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
memset((void*)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO)); memset((void*)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO));
memset((void*)&eNB->Sched_INFO,0,sizeof(eNB->Sched_INFO)); memset((void*)&eNB->Sched_INFO,0,sizeof(eNB->Sched_INFO));
LOG_I(PHY,"Setting indication lists\n"); LOG_I(PHY,"Setting indication lists\n");
eNB->UL_INFO.rx_ind.rx_pdu_list = eNB->rx_pdu_list; eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = eNB->rx_pdu_list;
eNB->UL_INFO.crc_ind.crc_pdu_list = eNB->crc_pdu_list; eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
eNB->UL_INFO.sr_ind.sr_pdu_list = eNB->sr_pdu_list; eNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = eNB->sr_pdu_list;
eNB->UL_INFO.harq_ind.harq_pdu_list = eNB->harq_pdu_list; eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list; eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list;
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list; eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
} }
} }
LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n"); LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n");
} }
......