Commit 6a6729bd authored by Robert Schmidt's avatar Robert Schmidt

fix various compilaton errors due to merge

parent dfece3ff
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "assertions.h" #include "assertions.h"
#include "enb_app.h" #include "enb_app.h"
#if 0
void handle_reconfiguration(mid_t mod_id) void handle_reconfiguration(mid_t mod_id)
{ {
/* NOTE: this function might be extended by using stop_modem() /* NOTE: this function might be extended by using stop_modem()
...@@ -69,6 +70,7 @@ void handle_reconfiguration(mid_t mod_id) ...@@ -69,6 +70,7 @@ void handle_reconfiguration(mid_t mod_id)
LOG_I(ENB_APP, "lte-softmodem restart succeeded in %d ms\n", diff_ms); LOG_I(ENB_APP, "lte-softmodem restart succeeded in %d ms\n", diff_ms);
} }
} }
#endif
int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) { int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) {
...@@ -109,7 +111,8 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy ...@@ -109,7 +111,8 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
if (parse_enb_id(mod_id, &parser) == -1) { if (parse_enb_id(mod_id, &parser) == -1) {
goto error; goto error;
} else { // succeful parse and setting } else { // succeful parse and setting
handle_reconfiguration(mod_id); /* TODO implement */
//handle_reconfiguration(mod_id);
} }
} else if (strcmp((char *) event.data.scalar.value, "mac") == 0) { } else if (strcmp((char *) event.data.scalar.value, "mac") == 0) {
LOG_D(ENB_APP, "This is intended for the mac system\n"); LOG_D(ENB_APP, "This is intended for the mac system\n");
...@@ -293,8 +296,7 @@ int parse_enb_config_parameters(mid_t mod_id, yaml_parser_t *parser) { ...@@ -293,8 +296,7 @@ int parse_enb_config_parameters(mid_t mod_id, yaml_parser_t *parser) {
yaml_event_delete(&event); yaml_event_delete(&event);
} }
/* reflect in RAN API */ /* TODO: reflect in RAN API */
flexran_set_enb_vars(mod_id, RAN_LTE_OAI);
return 0; return 0;
......
...@@ -800,6 +800,7 @@ typedef struct { ...@@ -800,6 +800,7 @@ typedef struct {
///Contention resolution timer used during random access ///Contention resolution timer used during random access
uint8_t mac_ContentionResolutionTimer; uint8_t mac_ContentionResolutionTimer;
/* TODO Navid MAX_NUM_LCID -> MAX_NUM_CCs? */
uint16_t max_rbs_allowed_slice[MAX_NUM_LCID][MAX_NUM_SLICES]; uint16_t max_rbs_allowed_slice[MAX_NUM_LCID][MAX_NUM_SLICES];
uint8_t max_mcs[MAX_NUM_LCID]; uint8_t max_mcs[MAX_NUM_LCID];
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
#include "flexran.pb-c.h" #include "flexran.pb-c.h"
#endif #endif
#include <dlfcn.h> #include <dlfcn.h>
#endif
#include "T.h" #include "T.h"
...@@ -449,7 +448,7 @@ set_ul_DAI(int module_idP, int UE_idP, int CC_idP, int frameP, ...@@ -449,7 +448,7 @@ set_ul_DAI(int module_idP, int UE_idP, int CC_idP, int frameP,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
schedule_dlsch(module_id_ module_idP, schedule_dlsch(module_id_t module_idP,
frame_t frameP, sub_frame_t subframeP, int *mbsfn_flag) frame_t frameP, sub_frame_t subframeP, int *mbsfn_flag)
//------------------------------------------------------------------------------{ //------------------------------------------------------------------------------{
{ {
...@@ -466,7 +465,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -466,7 +465,7 @@ schedule_dlsch(module_id_ module_idP,
for (i = 0; i < n_active_slices; i++) { for (i = 0; i < n_active_slices; i++) {
if (slice_percentage[i] < 0 ){ if (slice_percentage[i] < 0 ){
LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero", LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero",
mod_id, frame, subframe, i, slice_percentage[i]); module_idP, frameP, subframeP, i, slice_percentage[i]);
slice_percentage[i]=0; slice_percentage[i]=0;
} }
total_slice_percentage+=slice_percentage[i]; total_slice_percentage+=slice_percentage[i];
...@@ -488,7 +487,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -488,7 +487,7 @@ schedule_dlsch(module_id_ module_idP,
if (n_active_slices_current != n_active_slices ){ if (n_active_slices_current != n_active_slices ){
if ((n_active_slices > 0) && (n_active_slices <= MAX_NUM_SLICES)) { if ((n_active_slices > 0) && (n_active_slices <= MAX_NUM_SLICES)) {
LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active DL slices has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active DL slices has changed: %d-->%d\n",
mod_id, frame, subframe, n_active_slices_current, n_active_slices); module_idP, frameP, subframeP, n_active_slices_current, n_active_slices);
n_active_slices_current = n_active_slices; n_active_slices_current = n_active_slices;
...@@ -501,7 +500,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -501,7 +500,7 @@ schedule_dlsch(module_id_ module_idP,
// check if the slice rb share has changed, and log the console // check if the slice rb share has changed, and log the console
if (slice_percentage_current[i] != slice_percentage[i]){ // new slice percentage if (slice_percentage_current[i] != slice_percentage[i]){ // new slice percentage
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n", LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
mod_id, i, frame, subframe, total_slice_percentage_current, total_slice_percentage, slice_percentage_current[i], slice_percentage[i]); module_idP, i, frameP, subframeP, total_slice_percentage_current, total_slice_percentage, slice_percentage_current[i], slice_percentage[i]);
total_slice_percentage_current= total_slice_percentage; total_slice_percentage_current= total_slice_percentage;
slice_percentage_current[i] = slice_percentage[i]; slice_percentage_current[i] = slice_percentage[i];
...@@ -511,10 +510,10 @@ schedule_dlsch(module_id_ module_idP, ...@@ -511,10 +510,10 @@ schedule_dlsch(module_id_ module_idP,
if (slice_maxmcs_current[i] != slice_maxmcs[i]){ if (slice_maxmcs_current[i] != slice_maxmcs[i]){
if ((slice_maxmcs[i] >= 0) && (slice_maxmcs[i] < 29)){ if ((slice_maxmcs[i] >= 0) && (slice_maxmcs[i] < 29)){
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
mod_id, i, frame, subframe, slice_maxmcs_current[i], slice_maxmcs[i]); module_idP, i, frameP, subframeP, slice_maxmcs_current[i], slice_maxmcs[i]);
slice_maxmcs_current[i] = slice_maxmcs[i]; slice_maxmcs_current[i] = slice_maxmcs[i];
} else { } else {
LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid slice max mcs %d, revert the previous value %d\n",mod_id, i, slice_maxmcs[i],slice_maxmcs_current[i]); LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid slice max mcs %d, revert the previous value %d\n",module_idP, i, slice_maxmcs[i],slice_maxmcs_current[i]);
slice_maxmcs[i]= slice_maxmcs_current[i]; slice_maxmcs[i]= slice_maxmcs_current[i];
} }
} }
...@@ -522,7 +521,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -522,7 +521,7 @@ schedule_dlsch(module_id_ module_idP,
// check if a new scheduler, and log the console // check if a new scheduler, and log the console
if (update_dl_scheduler_current[i] != update_dl_scheduler[i]){ if (update_dl_scheduler_current[i] != update_dl_scheduler[i]){
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: DL scheduler for this slice is updated: %s \n", LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: DL scheduler for this slice is updated: %s \n",
mod_id, i, frame, subframe, dl_scheduler_type[i]); module_idP, i, frameP, subframeP, dl_scheduler_type[i]);
update_dl_scheduler_current[i] = update_dl_scheduler[i]; update_dl_scheduler_current[i] = update_dl_scheduler[i];
} }
...@@ -531,16 +530,14 @@ schedule_dlsch(module_id_ module_idP, ...@@ -531,16 +530,14 @@ schedule_dlsch(module_id_ module_idP,
if (n_active_slices == n_active_slices_current){ if (n_active_slices == n_active_slices_current){
LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n", LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n",
mod_id,i, module_idP, i, total_slice_percentage_current, total_slice_percentage);
total_slice_percentage_current, total_slice_percentage);
if (slice_percentage[i] >= avg_slice_percentage){ if (slice_percentage[i] >= avg_slice_percentage){
slice_percentage[i]-=0.1; slice_percentage[i]-=0.1;
total_slice_percentage-=0.1; total_slice_percentage-=0.1;
} }
} else { } else {
LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n", LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n",
mod_id,i, module_idP, i, total_slice_percentage_current, total_slice_percentage,
total_slice_percentage_current, total_slice_percentage,
n_active_slices, n_active_slices_current ); n_active_slices, n_active_slices_current );
n_active_slices = n_active_slices_current; n_active_slices = n_active_slices_current;
slice_percentage[i] = slice_percentage_current[i]; slice_percentage[i] = slice_percentage_current[i];
...@@ -548,7 +545,8 @@ schedule_dlsch(module_id_ module_idP, ...@@ -548,7 +545,8 @@ schedule_dlsch(module_id_ module_idP,
} }
// Run each enabled slice-specific schedulers one by one // Run each enabled slice-specific schedulers one by one
slice_sched_dl[i](mod_id, i, frame, subframe, mbsfn_flag,dl_info); /* TODO Navid took out the dl_info additional information */
slice_sched_dl[i](module_idP, i, frameP, subframeP, mbsfn_flag/*, dl_info*/);
} }
} }
...@@ -806,7 +804,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP, ...@@ -806,7 +804,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
*/ */
eNB_UE_stats->dlsch_mcs1 = eNB_UE_stats->dlsch_mcs1 =
cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]]; cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]];
eNB_UE_stats->dlsch_mcs1 =cmin(eNB_UE_stats->dlsch_mcs1, flexran_slice_maxmcs(slice_idP));//openair_daq_vars.target_ue_dl_mcs); eNB_UE_stats->dlsch_mcs1 =cmin(eNB_UE_stats->dlsch_mcs1, slice_maxmcs[slice_idP]);//openair_daq_vars.target_ue_dl_mcs);
// store stats // store stats
......
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
#define ENABLE_MAC_PAYLOAD_DEBUG #define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1 #define DEBUG_eNB_SCHEDULER 1
extern int n_active_slices;
int choose(int n, int k) int choose(int n, int k)
{ {
int res = 1; int res = 1;
...@@ -1927,7 +1929,7 @@ int UE_num_active_CC(UE_list_t * listP, int ue_idP) ...@@ -1927,7 +1929,7 @@ int UE_num_active_CC(UE_list_t * listP, int ue_idP)
int UE_PCCID(module_id_t mod_idP, int ue_idP) int UE_PCCID(module_id_t mod_idP, int ue_idP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
if (RC.mac[mod_idP] == NULL) return 0; if (!RC.mac || !RC.mac[mod_idP]) return 0;
return (RC.mac[mod_idP]->UE_list.pCC_id[ue_idP]); return (RC.mac[mod_idP]->UE_list.pCC_id[ue_idP]);
} }
...@@ -1935,7 +1937,7 @@ int UE_PCCID(module_id_t mod_idP, int ue_idP) ...@@ -1935,7 +1937,7 @@ int UE_PCCID(module_id_t mod_idP, int ue_idP)
rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP) rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
if (RC.mac[mod_idP] == NULL) return 0; if (!RC.mac || !RC.mac[mod_idP]) return 0;
rnti_t rnti = rnti_t rnti =
RC.mac[mod_idP]-> RC.mac[mod_idP]->
UE_list.UE_template[UE_PCCID(mod_idP, ue_idP)][ue_idP].rnti; UE_list.UE_template[UE_PCCID(mod_idP, ue_idP)][ue_idP].rnti;
...@@ -1953,7 +1955,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP) ...@@ -1953,7 +1955,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP)
boolean_t is_UE_active(module_id_t mod_idP, int ue_idP) boolean_t is_UE_active(module_id_t mod_idP, int ue_idP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
if (RC.mac[mod_idP] == NULL) return 0; if (!RC.mac || !RC.mac[mod_idP]) return 0;
return (RC.mac[mod_idP]->UE_list.active[ue_idP]); return (RC.mac[mod_idP]->UE_list.active[ue_idP]);
} }
......
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
#include "header.pb-c.h" #include "header.pb-c.h"
#include "flexran.pb-c.h" #include "flexran.pb-c.h"
#include "flexran_agent_mac.h" #include "flexran_agent_mac.h"
#include <dlfcn.h>
#endif #endif
#include <dlfcn.h>
#include "T.h" #include "T.h"
...@@ -943,13 +943,13 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header, ...@@ -943,13 +943,13 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
* (done below in schedule_ulsch). * (done below in schedule_ulsch).
*/ */
void void
set_msg3_subframe(module_id_t Mod_id, set_msg3_subframe(module_id_t mod_id,
int CC_id, int CC_id,
int frame, int frame,
int subframe, int rnti, int Msg3_frame, int subframe, int rnti, int Msg3_frame,
int Msg3_subframe) int Msg3_subframe)
{ {
eNB_MAC_INST *mac = RC.mac[Mod_id]; eNB_MAC_INST *mac = RC.mac[mod_id];
int i; int i;
for (i = 0; i < NB_RA_PROC_MAX; i++) { for (i = 0; i < NB_RA_PROC_MAX; i++) {
if (mac->common_channels[CC_id].ra[i].state != IDLE && if (mac->common_channels[CC_id].ra[i].state != IDLE &&
...@@ -1086,7 +1086,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1086,7 +1086,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
for (i = 0; i < n_active_slices_uplink; i++) { for (i = 0; i < n_active_slices_uplink; i++) {
if (slice_percentage_uplink[i] < 0 ){ if (slice_percentage_uplink[i] < 0 ){
LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero", LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero",
mod_id, frame, subframe, i, slice_percentage_uplink[i]); module_idP, frameP, subframeP, i, slice_percentage_uplink[i]);
slice_percentage_uplink[i]=0; slice_percentage_uplink[i]=0;
} }
total_slice_percentage_uplink+=slice_percentage_uplink[i]; total_slice_percentage_uplink+=slice_percentage_uplink[i];
...@@ -1112,7 +1112,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1112,7 +1112,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
if (n_active_slices_current_uplink != n_active_slices_uplink ){ if (n_active_slices_current_uplink != n_active_slices_uplink ){
if ((n_active_slices_uplink > 0) && (n_active_slices_uplink <= MAX_NUM_SLICES)) { if ((n_active_slices_uplink > 0) && (n_active_slices_uplink <= MAX_NUM_SLICES)) {
LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active UL slices has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active UL slices has changed: %d-->%d\n",
mod_id, frame, subframe, n_active_slices_current_uplink, n_active_slices_uplink); module_idP, frameP, subframeP, n_active_slices_current_uplink, n_active_slices_uplink);
n_active_slices_current_uplink = n_active_slices_uplink; n_active_slices_current_uplink = n_active_slices_uplink;
...@@ -1125,7 +1125,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1125,7 +1125,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
// check if the slice rb share has changed, and log the console // check if the slice rb share has changed, and log the console
if (slice_percentage_current_uplink[i] != slice_percentage_uplink[i]){ if (slice_percentage_current_uplink[i] != slice_percentage_uplink[i]){
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n", LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
mod_id, i, frame, subframe, total_slice_percentage_current_uplink, total_slice_percentage_uplink, slice_percentage_current_uplink[i], slice_percentage_uplink[i]); module_idP, i, frameP, subframeP, total_slice_percentage_current_uplink, total_slice_percentage_uplink, slice_percentage_current_uplink[i], slice_percentage_uplink[i]);
total_slice_percentage_current_uplink= total_slice_percentage_uplink; total_slice_percentage_current_uplink= total_slice_percentage_uplink;
slice_percentage_current_uplink[i] = slice_percentage_uplink[i]; slice_percentage_current_uplink[i] = slice_percentage_uplink[i];
...@@ -1135,10 +1135,10 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1135,10 +1135,10 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
if (slice_maxmcs_current_uplink[i] != slice_maxmcs_uplink[i]){ if (slice_maxmcs_current_uplink[i] != slice_maxmcs_uplink[i]){
if ((slice_maxmcs_uplink[i] >= 0) && (slice_maxmcs_uplink[i] <= 16)){ if ((slice_maxmcs_uplink[i] >= 0) && (slice_maxmcs_uplink[i] <= 16)){
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
mod_id, i, frame, subframe, slice_maxmcs_current_uplink[i], slice_maxmcs_uplink[i]); module_idP, i, frameP, subframeP, slice_maxmcs_current_uplink[i], slice_maxmcs_uplink[i]);
slice_maxmcs_current_uplink[i] = slice_maxmcs_uplink[i]; slice_maxmcs_current_uplink[i] = slice_maxmcs_uplink[i];
} else { } else {
LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid slice max mcs %d, revert the previous value %d\n",mod_id, i, slice_maxmcs_uplink[i],slice_maxmcs_current_uplink[i]); LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid slice max mcs %d, revert the previous value %d\n",module_idP, i, slice_maxmcs_uplink[i],slice_maxmcs_current_uplink[i]);
slice_maxmcs_uplink[i]= slice_maxmcs_current_uplink[i]; slice_maxmcs_uplink[i]= slice_maxmcs_current_uplink[i];
} }
...@@ -1147,7 +1147,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1147,7 +1147,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
// check if a new scheduler, and log the console // check if a new scheduler, and log the console
if (update_ul_scheduler_current[i] != update_ul_scheduler[i]){ if (update_ul_scheduler_current[i] != update_ul_scheduler[i]){
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: UL scheduler for this slice is updated: %s \n", LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: UL scheduler for this slice is updated: %s \n",
mod_id, i, frame, subframe, ul_scheduler_type[i]); module_idP, i, frameP, subframeP, ul_scheduler_type[i]);
update_ul_scheduler_current[i] = update_ul_scheduler[i]; update_ul_scheduler_current[i] = update_ul_scheduler[i];
} }
...@@ -1156,8 +1156,8 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1156,8 +1156,8 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
if (n_active_slices_uplink == n_active_slices_current_uplink){ if (n_active_slices_uplink == n_active_slices_current_uplink){
LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n", LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n",
mod_id,i, module_idP, i, total_slice_percentage_current_uplink,
total_slice_percentage_current_uplink, total_slice_percentage_uplink); total_slice_percentage_uplink);
if (slice_percentage_uplink[i] > avg_slice_percentage_uplink){ if (slice_percentage_uplink[i] > avg_slice_percentage_uplink){
slice_percentage_uplink[i]-=0.1; slice_percentage_uplink[i]-=0.1;
total_slice_percentage_uplink-=0.1; total_slice_percentage_uplink-=0.1;
...@@ -1165,9 +1165,9 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1165,9 +1165,9 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
} else { } else {
// here we can correct the values, e.g. reduce proportionally // here we can correct the values, e.g. reduce proportionally
LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n", LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n",
mod_id,i, module_idP, i, total_slice_percentage_current_uplink,
total_slice_percentage_current_uplink, total_slice_percentage_uplink, total_slice_percentage_uplink, n_active_slices_uplink,
n_active_slices_uplink, n_active_slices_current_uplink); n_active_slices_current_uplink);
n_active_slices_uplink = n_active_slices_current_uplink; n_active_slices_uplink = n_active_slices_current_uplink;
slice_percentage_uplink[i] = slice_percentage_current_uplink[i]; slice_percentage_uplink[i] = slice_percentage_current_uplink[i];
} }
......
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
#define DEBUG_HEADER_PARSING 1 #define DEBUG_HEADER_PARSING 1
//#define DEBUG_PACKET_TRACE 1 //#define DEBUG_PACKET_TRACE 1
extern float slice_percentage[MAX_NUM_SLICES];
//#define ICIC 0 //#define ICIC 0
/* /*
...@@ -267,7 +269,8 @@ assign_rbs_required(module_id_t Mod_id, ...@@ -267,7 +269,8 @@ assign_rbs_required(module_id_t Mod_id,
to_prb(RC.mac[Mod_id]->common_channels[CC_id]. to_prb(RC.mac[Mod_id]->common_channels[CC_id].
mib->message.dl_Bandwidth); mib->message.dl_Bandwidth);
UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL); /* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? or bug in definition? */
UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL);
/* calculating required number of RBs for each UE */ /* calculating required number of RBs for each UE */
while (TBS < while (TBS <
...@@ -275,10 +278,13 @@ assign_rbs_required(module_id_t Mod_id, ...@@ -275,10 +278,13 @@ assign_rbs_required(module_id_t Mod_id,
dl_buffer_total) { dl_buffer_total) {
nb_rbs_required[CC_id][UE_id] += min_rb_unit[CC_id]; nb_rbs_required[CC_id][UE_id] += min_rb_unit[CC_id];
if (nb_rbs_required[CC_id][UE_id] > UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]) { /* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? or bug in definition? */
if (nb_rbs_required[CC_id][UE_id] > UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id]) {
TBS = TBS =
get_TBS_DL(eNB_UE_stats->dlsch_mcs1, UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]); /* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? or bug in definition? */
nb_rbs_required[CC_id][UE_id] = UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]; get_TBS_DL(eNB_UE_stats->dlsch_mcs1, UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id]);
/* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? */
nb_rbs_required[CC_id][UE_id] = UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id];
break; break;
} }
...@@ -614,7 +620,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -614,7 +620,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
if (UE_list->active[i] != TRUE) if (UE_list->active[i] != TRUE)
continue; continue;
if (!flexran_slice_member(UE_id, slice_id)) if (!flexran_slice_member(i, slice_id))
continue; continue;
UE_id = i; UE_id = i;
...@@ -724,13 +730,15 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -724,13 +730,15 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
message.dl_Bandwidth) - total_rbs_used[CC_id]; message.dl_Bandwidth) - total_rbs_used[CC_id];
//recalcualte based on the what is left after retransmission //recalcualte based on the what is left after retransmission
ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL); ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
/* TODO Navid: as above */
ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL);
if (total_ue_count[CC_id] == 0) { if (total_ue_count[CC_id] == 0) {
average_rbs_per_user[CC_id] = 0; average_rbs_per_user[CC_id] = 0;
} else if ((min_rb_unit[CC_id] * total_ue_count[CC_id]) <= (ue_sched_ctl.max_allowed_rbs[CC_id][slice_id])) { } else if ((min_rb_unit[CC_id] * total_ue_count[CC_id]) <= (ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_id])) {
average_rbs_per_user[CC_id] = average_rbs_per_user[CC_id] =
(uint16_t) floor(ue_sched_ctl.max_allowed_rbs[CC_id][slice_id] / total_ue_count[CC_id]); (uint16_t) floor(ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_id] / total_ue_count[CC_id]);
} else { } else {
average_rbs_per_user[CC_id] = min_rb_unit[CC_id]; // consider the total number of use that can be scheduled UE average_rbs_per_user[CC_id] = min_rb_unit[CC_id]; // consider the total number of use that can be scheduled UE
} }
...@@ -1390,7 +1398,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1390,7 +1398,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP,
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, slice_id, 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
......
...@@ -217,6 +217,8 @@ void dlsch_scheduler_pre_processor_reset(int module_idP, int UE_id, ...@@ -217,6 +217,8 @@ void dlsch_scheduler_pre_processor_reset(int module_idP, int UE_id,
uint16_t uint16_t
nb_rbs_required_remaining nb_rbs_required_remaining
[MAX_NUM_CCs][NUMBER_OF_UE_MAX], [MAX_NUM_CCs][NUMBER_OF_UE_MAX],
unsigned char total_ue_count[MAX_NUM_CCs],
unsigned char total_rbs_used[MAX_NUM_CCs],
unsigned char unsigned char
rballoc_sub[MAX_NUM_CCs] rballoc_sub[MAX_NUM_CCs]
[N_RBG_MAX], [N_RBG_MAX],
...@@ -665,7 +667,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, slice_id_t slice_id, ...@@ -665,7 +667,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, slice_id_t slice_id,
void store_ulsch_buffer(module_id_t module_idP, int frameP, void store_ulsch_buffer(module_id_t module_idP, int frameP,
sub_frame_t subframeP); sub_frame_t subframeP);
void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP); void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP);
void assign_max_mcs_min_rb(module_id_t module_idP, int frameP, void assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP,
sub_frame_t subframeP, uint16_t * first_rb); sub_frame_t subframeP, uint16_t * first_rb);
void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, void adjust_bsr_info(int buffer_occupancy, uint16_t TBS,
UE_TEMPLATE * UE_template); UE_TEMPLATE * UE_template);
......
...@@ -2156,7 +2156,7 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt ...@@ -2156,7 +2156,7 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
int i; int i;
// configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE // configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE
eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id]; eNB_RRC_INST* rrc_inst = RC.rrc[ctxt_pP->module_id];
struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated; struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
struct SRB_ToAddMod *SRB2_config = NULL; struct SRB_ToAddMod *SRB2_config = NULL;
......
...@@ -239,9 +239,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -239,9 +239,7 @@ static void* eNB_thread_rxtx( void* param ) {
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 );
#ifdef DEBUG_THREADS LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n");
printf(" *** Exiting eNB thread RXn_TXnp4\n");
#endif
eNB_thread_rxtx_status = 0; eNB_thread_rxtx_status = 0;
return &eNB_thread_rxtx_status; return &eNB_thread_rxtx_status;
...@@ -624,8 +622,6 @@ void init_eNB_proc(int inst) { ...@@ -624,8 +622,6 @@ void init_eNB_proc(int inst) {
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL); pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
pthread_mutex_init( &proc->mutex_RU,NULL); pthread_mutex_init( &proc->mutex_RU,NULL);
pthread_mutex_init( &proc->mutex_RU_PRACH,NULL); pthread_mutex_init( &proc->mutex_RU_PRACH,NULL);
pthread_mutex_init( &proc->mutex_synch,NULL);
pthread_mutex_init( &proc->mutex_FH, NULL);
pthread_cond_init( &proc->cond_prach, NULL); pthread_cond_init( &proc->cond_prach, NULL);
pthread_cond_init( &proc->cond_asynch_rxtx, NULL); pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
...@@ -727,22 +723,12 @@ void kill_eNB_proc(int inst) { ...@@ -727,22 +723,12 @@ void kill_eNB_proc(int inst) {
proc_rxtx[1].instance_cnt_rxtx = 0; proc_rxtx[1].instance_cnt_rxtx = 0;
pthread_mutex_unlock(&proc_rxtx[1].mutex_rxtx); pthread_mutex_unlock(&proc_rxtx[1].mutex_rxtx);
} }
pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc.mutex_synch);
PHY_vars_eNB_g[0][CC_id]->proc.instance_cnt_synch = 1;
pthread_mutex_unlock(&PHY_vars_eNB_g[0][CC_id]->proc.mutex_synch);
proc->instance_cnt_prach = 0; proc->instance_cnt_prach = 0;
pthread_cond_signal( &proc->cond_prach ); pthread_cond_signal( &proc->cond_prach );
pthread_cond_signal( &proc->cond_FH );
pthread_cond_signal( &proc->cond_asynch_rxtx ); pthread_cond_signal( &proc->cond_asynch_rxtx );
pthread_cond_signal( &proc->cond_synch );
pthread_cond_broadcast(&sync_phy_proc.cond_phy_proc_tx); pthread_cond_broadcast(&sync_phy_proc.cond_phy_proc_tx);
LOG_D(PHY, "joining pthread_FH\n");
pthread_join( proc->pthread_FH, (void**)&status );
pthread_mutex_destroy( &proc->mutex_FH );
pthread_cond_destroy( &proc->cond_FH );
LOG_D(PHY, "joining pthread_prach\n"); LOG_D(PHY, "joining pthread_prach\n");
pthread_join( proc->pthread_prach, (void**)&status ); pthread_join( proc->pthread_prach, (void**)&status );
...@@ -776,12 +762,7 @@ void kill_eNB_proc(int inst) { ...@@ -776,12 +762,7 @@ void kill_eNB_proc(int inst) {
LOG_D(PHY, "joining pthread_single\n"); LOG_D(PHY, "joining pthread_single\n");
pthread_join(proc->pthread_single, (void**)&status ); pthread_join(proc->pthread_single, (void**)&status );
LOG_D(PHY, "joined all eNB threads\n");
LOG_D(PHY, "joining pthread_synch\n");
pthread_join(proc->pthread_synch, (void**)&status );
pthread_mutex_destroy(&proc->mutex_synch);
pthread_cond_destroy(&proc->cond_synch);
LOG_D(PHY, "joined all threads\n");
} }
} }
......
...@@ -229,8 +229,6 @@ uint8_t abstraction_flag=0; ...@@ -229,8 +229,6 @@ uint8_t abstraction_flag=0;
/* forward declarations */ /* forward declarations */
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
/* override the enb configuration parameters */
static void reconfigure_enb_params(int enb_id);
/*---------------------BMC: timespec helpers -----------------------------*/ /*---------------------BMC: timespec helpers -----------------------------*/
...@@ -691,54 +689,6 @@ static void get_options(void) { ...@@ -691,54 +689,6 @@ static void get_options(void) {
} }
static void reconfigure_enb_params(int enb_id)
{
int CC_id, k;
const Enb_properties_array_t *enb_properties=enb_config_get();
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
node_function[CC_id] = enb_properties->properties[enb_id]->cc_node_function[CC_id];
node_timing[CC_id] = enb_properties->properties[enb_id]->cc_node_timing[CC_id];
node_synch_ref[CC_id] = enb_properties->properties[enb_id]->cc_node_synch_ref[CC_id];
frame_parms[CC_id]->frame_type = enb_properties->properties[enb_id]->frame_type[CC_id];
frame_parms[CC_id]->tdd_config = enb_properties->properties[enb_id]->tdd_config[CC_id];
frame_parms[CC_id]->tdd_config_S = enb_properties->properties[enb_id]->tdd_config_s[CC_id];
frame_parms[CC_id]->Ncp = enb_properties->properties[enb_id]->prefix_type[CC_id];
//for (j=0; j < enb_properties->properties[i]->nb_cc; j++ ){
frame_parms[CC_id]->Nid_cell = enb_properties->properties[enb_id]->Nid_cell[CC_id];
frame_parms[CC_id]->N_RB_DL = enb_properties->properties[enb_id]->N_RB_DL[CC_id];
frame_parms[CC_id]->N_RB_UL = enb_properties->properties[enb_id]->N_RB_DL[CC_id];
frame_parms[CC_id]->nb_antennas_tx = enb_properties->properties[enb_id]->nb_antennas_tx[CC_id];
frame_parms[CC_id]->nb_antenna_ports_eNB = enb_properties->properties[enb_id]->nb_antenna_ports[CC_id];
frame_parms[CC_id]->nb_antennas_rx = enb_properties->properties[enb_id]->nb_antennas_rx[CC_id];
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_ConfigIndex = enb_properties->properties[enb_id]->prach_config_index[CC_id];
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset = enb_properties->properties[enb_id]->prach_freq_offset[CC_id];
frame_parms[CC_id]->mode1_flag = (frame_parms[CC_id]->nb_antenna_ports_eNB == 1) ? 1 : 0;
frame_parms[CC_id]->threequarter_fs = threequarter_fs;
for (k = 0 ; k < 4; k++) {
downlink_frequency[CC_id][k] = enb_properties->properties[enb_id]->downlink_frequency[CC_id];
uplink_frequency_offset[CC_id][k] = enb_properties->properties[enb_id]->uplink_frequency_offset[CC_id];
rx_gain[CC_id][k] = (double)enb_properties->properties[enb_id]->rx_gain[CC_id];
tx_gain[CC_id][k] = (double)enb_properties->properties[enb_id]->tx_gain[CC_id];
}
printf("Downlink frequency/ uplink offset of CC_id %d set to %ju/%d\n", CC_id,
enb_properties->properties[enb_id]->downlink_frequency[CC_id],
enb_properties->properties[enb_id]->uplink_frequency_offset[CC_id]);
init_ul_hopping(frame_parms[CC_id]);
init_frame_parms(frame_parms[CC_id],1);
// phy_init_top(frame_parms[CC_id]);
phy_init_lte_top(frame_parms[CC_id]);
} // CC_id
}
#if T_TRACER #if T_TRACER
int T_nowait = 0; /* by default we wait for the tracer */ int T_nowait = 0; /* by default we wait for the tracer */
int T_port = 2021; /* default port to listen to to wait for the tracer */ int T_port = 2021; /* default port to listen to to wait for the tracer */
...@@ -887,6 +837,7 @@ void init_openair0() { ...@@ -887,6 +837,7 @@ void init_openair0() {
} }
} }
void wait_RUs(void) { void wait_RUs(void) {
LOG_I(PHY,"Waiting for RUs to be configured ...\n"); LOG_I(PHY,"Waiting for RUs to be configured ...\n");
...@@ -923,70 +874,6 @@ void wait_eNBs(void) { ...@@ -923,70 +874,6 @@ void wait_eNBs(void) {
printf("eNB L1 are configured\n"); printf("eNB L1 are configured\n");
} }
void fill_PHY_vars_eNB_g(uint8_t abstraction_flag, uint8_t beta_ACK, uint8_t beta_RI, uint8_t beta_CQI)
{
int CC_id, i, j, k, re;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],
0,
frame_parms[CC_id]->Nid_cell,
node_function[CC_id],
abstraction_flag);
PHY_vars_eNB_g[0][CC_id]->ue_dl_rb_alloc = 0x1fff;
PHY_vars_eNB_g[0][CC_id]->target_ue_dl_mcs = target_dl_mcs;
PHY_vars_eNB_g[0][CC_id]->ue_ul_nb_rb = 6;
PHY_vars_eNB_g[0][CC_id]->target_ue_ul_mcs = target_ul_mcs;
// initialization for phy-test
for (k = 0; k < NUMBER_OF_UE_MAX; k++) {
PHY_vars_eNB_g[0][CC_id]->transmission_mode[k] = transmission_mode;
if (transmission_mode == 7)
lte_gold_ue_spec_port5(PHY_vars_eNB_g[0][CC_id]->lte_gold_uespec_port5_table[k],
frame_parms[CC_id]->Nid_cell,
0x1235+k);
}
if ((transmission_mode == 1) || (transmission_mode == 7)) {
for (j = 0; j < frame_parms[CC_id]->nb_antennas_tx; j++)
for (re = 0; re < frame_parms[CC_id]->ofdm_symbol_size; re++)
PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff / frame_parms[CC_id]->nb_antennas_tx;
}
if (phy_test==1)
PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0;
else
PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
if (PHY_vars_eNB_g[0][CC_id]->mac_enabled == 0) { //set default parameters for testing mode
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index = beta_RI;
PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI;
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = i;
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3);
PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
}
}
compute_prach_seq(&PHY_vars_eNB_g[0][CC_id]->frame_parms.prach_config_common,
PHY_vars_eNB_g[0][CC_id]->frame_parms.frame_type,
PHY_vars_eNB_g[0][CC_id]->X_u);
PHY_vars_eNB_g[0][CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0];
if (frame_parms[CC_id]->frame_type == FDD) {
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 0;
} else {
if (frame_parms[CC_id]->N_RB_DL == 100)
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624;
else if (frame_parms[CC_id]->N_RB_DL == 50)
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624/2;
else if (frame_parms[CC_id]->N_RB_DL == 25)
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 624/4;
}
}
}
#if defined(ENABLE_ITTI) && defined(FLEXRAN_AGENT_SB_IF) #if defined(ENABLE_ITTI) && defined(FLEXRAN_AGENT_SB_IF)
/* /*
* helper function to terminate a certain ITTI task * helper function to terminate a certain ITTI task
...@@ -999,6 +886,7 @@ void terminate_task(task_id_t task_id, mid_t mod_id) ...@@ -999,6 +886,7 @@ void terminate_task(task_id_t task_id, mid_t mod_id)
itti_send_msg_to_task (task_id, ENB_MODULE_ID_TO_INSTANCE(mod_id), msg); itti_send_msg_to_task (task_id, ENB_MODULE_ID_TO_INSTANCE(mod_id), msg);
} }
#if 0
int stop_L1L2(int enb_id) int stop_L1L2(int enb_id)
{ {
int CC_id; int CC_id;
...@@ -1107,6 +995,7 @@ int restart_L1L2(int enb_id) ...@@ -1107,6 +995,7 @@ int restart_L1L2(int enb_id)
return 0; return 0;
} }
#endif #endif
#endif
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
...@@ -1274,19 +1163,14 @@ int main( int argc, char **argv ) ...@@ -1274,19 +1163,14 @@ int main( int argc, char **argv )
flexran_agent_start(i); flexran_agent_start(i);
} }
LOG_I(ENB_APP, " * Waiting for FlexRAN RTController command *\n"); /* TODO handle restart/initial blocking */
pthread_mutex_lock(&mutex_node_ctrl); //LOG_I(ENB_APP, " * Waiting for FlexRAN RTController command *\n");
while (ENB_NORMAL_OPERATION != node_control_state) //pthread_mutex_lock(&mutex_node_ctrl);
pthread_cond_wait(&cond_node_ctrl, &mutex_node_ctrl); //while (ENB_NORMAL_OPERATION != node_control_state)
pthread_mutex_unlock(&mutex_node_ctrl); // pthread_cond_wait(&cond_node_ctrl, &mutex_node_ctrl);
//pthread_mutex_unlock(&mutex_node_ctrl);
/* reconfigure eNB in case FlexRAN controller applied changes */
/* TODO needs to be done? */ /* TODO do eNB reconfiguration (handled implicitly?) */
//for (i=0; i < NB_eNB_INST; i++){
// LOG_I(ENB_APP, "Reconfigure eNB module %d and FlexRAN eNB variables\n", i);
// reconfigure_enb_params(i);
// flexran_set_enb_vars(i, RAN_LTE_OAI);
//}
#endif #endif
if (UE_flag==1) { if (UE_flag==1) {
...@@ -1611,6 +1495,7 @@ int main( int argc, char **argv ) ...@@ -1611,6 +1495,7 @@ int main( int argc, char **argv )
} }
} }
} }
#endif #endif
printf("stopping MODEM threads\n"); printf("stopping MODEM threads\n");
......
...@@ -269,7 +269,7 @@ extern int restart_L1L2(int enb_id); ...@@ -269,7 +269,7 @@ extern int restart_L1L2(int enb_id);
#ifdef FLEXRAN_AGENT_SB_IF #ifdef FLEXRAN_AGENT_SB_IF
#include "flexran_agent.h" // for locking #include "flexran_agent.h" // for locking
volatile ENB_MODULE_STATE node_control_state; //volatile ENB_MODULE_STATE node_control_state;
pthread_cond_t cond_node_ctrl; pthread_cond_t cond_node_ctrl;
pthread_mutex_t mutex_node_ctrl; pthread_mutex_t mutex_node_ctrl;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment