Commit 9fc584d1 authored by Xenofon Foukas's avatar Xenofon Foukas

Fixed FlexRAN-related warnings

parent dc8190dc
Branches unavailable
2023.w22 2023.w21 2023.w20 2023.w19 2023.w18 2023.w18b 2023.w16 2023.w15 2023.w14 2023.w13 2023.w12 2023.w11 2023.w11b 2023.w10 2023.w10b 2023.w09 2023.w08 2023.w08b 2023.w07 2023.w06 2023.w05 2023.w03 2023.w02 2022.42 2022.41 2022.w51 2022.w50 2022.w49 2022.w48 2022.w47 2022.w46 2022.w45 2022.w43 2022.w42 2022.w42b 2022.w41 2022.w40 2022.w39 2022.w38 2022.w37 2022.w37b 2022.w36 2022.w35 2022.w33 2022.w32 2022.w31 2022.w31b 2022.w30 2022.w29 2022.w26 2022.w25 2022.w24 2022.w24b 2022.w23 2022.w22 2022.w21 2022.w20 2022.w19 2022.w18 2022.w17 2022.w15 2022.w15b 2022.w14a 2022.w13 2022.w13b 2022.w13a 2022.w12 2022.w10 2022.w09 2022.w09b 2022.w08 2022.w08b 2022.w07 2022.w07b 2022.w06 2022.w06a 2022.w05 2022.w05b 2022.w03_hotfix 2022.w03_b 2022.w02 2022.w01 2021.wk46 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w51_c 2021.w51_a 2021.w50_a 2021.w49_b 2021.w49_a 2021.w48 2021.w47 2021.w46 2021.w46-powder 2021.w45 2021.w45_b 2021.w44 2021.w43 2021.w42 2021.w37 2021.w36 2021.w35 2021.w34 2021.w33 2021.w32 2021.w31 2021.w30 2021.w29 2021.w28 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 2020.w47 2020.w46_2 2020.w46 2020.w45_2 2020.w45 2020.w44 2020.w42_2 2020.w42 2020.w41 2020.w39 2020.w38 2020.w37 2020.w36 2020.w34 2020.w33 2020.w31 2020.w30 2020.w29 2020.w28 2020.w26 2020.w25 2020.w24 2020.w23 2020.w22 2020.w19 2020.w17 2020.w16 2020.w15 2020.w11 2020.w09 2020.w06 2020.w05 2020.w04 2020.w03 2019.w51 2019.w44 2019.w41 2019.w36 2019.w30 2019.w28 2019.w27 2019.w25 2019.w23 2019.w21 2019.w17 2019.w15 2019.w13 2019.w11 2019.w10 2019.w09 2019.w08 2019.w07 2019.w06 2019.w04 2019.w03 2018.w51 2018.w48 2018.w47 2018.w46 2018.w44 2018.w41 2018.w40 2018.w39 2018.w36 2018.w33 2018.w31 2018.w29 2018.w25 2018.w19 2018.w15 2018.w12 2018.w11 2018.w10 2018.w09 2018.w08 2018.w07 2018.w06 2018.w05 2018.w04 2018.w03 2018.w02 2017.w48 2017.w46 2017.w43 2017.w42 2017.w34 2017.w30 2017.w25 2017.w24 2017.w22 2017.w20 2017.w19 2017.w15 2017.w14 2017.w13 2017.w12 2017.w11 2017.w10 2017.w09 2017.w08 2017.w07 2017.w06 2017.w05 2017.w04 2017.w03 v1.2.2 v1.2.1 v1.2.0 v1.1.1 v1.1.0 v1.0.3 v1.0.2 v1.0.1 v1.0.0 v0.6.1 v0.6.1_tdd v0.6 setparam osa-etsi-ws-ue osa-etsi-ws-try2 osa-etsi-ws-try1 osa-etsi-ws-gNB oai_nr_sync nr-ip-over-lte nr-ip-over-lte-v.1.5 nr-ip-over-lte-v.1.4 nr-ip-over-lte-v.1.3 nr-ip-over-lte-v.1.2 nr-ip-over-lte-v.1.1 nr-ip-over-lte-v.1.0 flexran-eol develop-nr-pdcch develop-nr-2020w03 develop-nr-2020w02 develop-nr-2019w51 develop-nr-2019w50 develop-nr-2019w48 develop-nr-2019w47 develop-nr-2019w45 develop-nr-2019w43 develop-nr-2019w42 develop-nr-2019w40 develop-nr-2019w28 develop-nr-2019w23 benetel_phase_rotation benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0
No related merge requests found
......@@ -30,6 +30,7 @@
#include "flexran_agent_extern.h"
#include "flexran_agent_common.h"
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_net_comm.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/flexran_agent_mac_proto.h"
......@@ -60,14 +61,11 @@ int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__F
// TODO: Must resolve conflicts among stats requests
int i;
void *buffer;
int size;
err_code_t err_code;
xid_t xid;
uint32_t usec_interval, sec_interval;
//TODO: We do not deal with multiple CCs at the moment and eNB id is 0
int cc_id = 0;
int enb_id = mod_id;
//eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id];
......@@ -250,15 +248,15 @@ int flexran_agent_mac_stats_request(mid_t mod_id,
Protocol__FlexHeader *header;
int i;
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
goto error;
Protocol__FlexStatsRequest *stats_request_msg;
stats_request_msg = malloc(sizeof(Protocol__FlexStatsRequest));
if(stats_request_msg == NULL)
goto error;
protocol__flex_stats_request__init(stats_request_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
goto error;
stats_request_msg->header = header;
stats_request_msg->type = report_config->report_type;
......@@ -375,20 +373,19 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
Protocol__FlexranMessage **msg) {
Protocol__FlexHeader *header;
int i, j, k;
int cc_id = 0;
int enb_id = mod_id;
//eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id];
//UE_list_t *eNB_UE_list= &eNB->UE_list;
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0)
goto error;
Protocol__FlexStatsReply *stats_reply_msg;
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
if (stats_reply_msg == NULL)
goto error;
protocol__flex_stats_reply__init(stats_reply_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0)
goto error;
stats_reply_msg->header = header;
stats_reply_msg->n_ue_report = report_config->nr_ue;
......@@ -419,7 +416,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
elem = (uint32_t *) malloc(sizeof(uint32_t)*ue_report[i]->n_bsr);
if (elem == NULL)
goto error;
for (j = 0; j++; j < ue_report[i]->n_bsr) {
for (j = 0; j < ue_report[i]->n_bsr; j++) {
// NN: we need to know the cc_id here, consider the first one
elem[j] = flexran_get_ue_bsr (enb_id, i, j);
}
......@@ -472,7 +469,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
/* Check flag for creation of MAC CE buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) {
// TODO: Fill in the actual MAC CE buffer status report
ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the; /* Use as bitmap. Set one or more of the
ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the
PROTOCOL__FLEX_CE_TYPE__FLPCET_ values
found in stats_common.pb-c.h. See
flex_ce_type in FlexRAN specification */
......@@ -802,6 +799,8 @@ int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) {
}
free(dl_report->csi_report[j]->a31csi->sb_cqi);
break;
default:
break;
}
free(dl_report->csi_report[j]);
......@@ -856,8 +855,6 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra
Protocol__FlexHeader *header;
int i;
const int xid = *((int *)params);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0)
goto error;
Protocol__FlexUlSrInfo *ul_sr_info_msg;
ul_sr_info_msg = malloc(sizeof(Protocol__FlexUlSrInfo));
......@@ -866,6 +863,9 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra
}
protocol__flex_ul_sr_info__init(ul_sr_info_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0)
goto error;
ul_sr_info_msg->header = header;
ul_sr_info_msg->has_sfn_sf = 1;
ul_sr_info_msg->sfn_sf = flexran_get_sfn_sf(mod_id);
......@@ -923,8 +923,6 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
Protocol__FlexHeader *header;
int i,j;
const int xid = *((int *)params);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0)
goto error;
Protocol__FlexSfTrigger *sf_trigger_msg;
sf_trigger_msg = malloc(sizeof(Protocol__FlexSfTrigger));
......@@ -933,6 +931,9 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
}
protocol__flex_sf_trigger__init(sf_trigger_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0)
goto error;
frame_t frame;
sub_frame_t subframe;
......@@ -975,8 +976,8 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i);
dl_info[i]->has_rnti = 1;
/*Fill in the right id of this round's HARQ process for this UE*/
int harq_id;
int harq_status;
unsigned char harq_id;
unsigned char harq_status;
flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status);
dl_info[i]->harq_process_id = harq_id;
dl_info[i]->has_harq_process_id = 1;
......@@ -1060,10 +1061,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
for (i = 0; i < sf_trigger_msg->n_dl_info; i++) {
free(sf_trigger_msg->dl_info[i]->harq_status);
}
free(sf_trigger_msg->dl_info);
for (i = 0; i < sf_trigger_msg->n_ul_info; i++) {
free(sf_trigger_msg->ul_info[i]->reception_status);
}
free(sf_trigger_msg->dl_info);
free(sf_trigger_msg->ul_info);
free(sf_trigger_msg);
}
......@@ -1230,9 +1228,9 @@ int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Pro
*msg = NULL;
return 2;
error:
*msg = NULL;
return -1;
// error:
//*msg = NULL;
//return -1;
}
void flexran_agent_init_mac_agent(mid_t mod_id) {
......@@ -1252,7 +1250,7 @@ void flexran_agent_send_sr_info(mid_t mod_id) {
int size;
Protocol__FlexranMessage *msg;
void *data;
int priority;
int priority = 0;
err_code_t err_code;
int xid = 0;
......@@ -1282,7 +1280,7 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
int size;
Protocol__FlexranMessage *msg;
void *data;
int priority;
int priority = 0;
err_code_t err_code;
int xid = 0;
......@@ -1310,13 +1308,11 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
void flexran_agent_send_update_mac_stats(mid_t mod_id) {
Protocol__FlexranMessage *current_report = NULL, *msg;
Protocol__FlexranMessage *current_report = NULL;
void *data;
int size;
err_code_t err_code;
int priority;
mac_stats_updates_context_t stats_context = mac_stats_context[mod_id];
int priority = 0;
if (pthread_mutex_lock(mac_stats_context[mod_id].mutex)) {
goto error;
......@@ -1437,7 +1433,7 @@ err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id) {
flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply);
free(mac_stats_context[mod_id].mutex);
mac_agent_registered[mod_id] = NULL;
mac_agent_registered[mod_id] = 0;
return 1;
}
......
......@@ -63,8 +63,8 @@ typedef struct {
/// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint32_t state_change);
int (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint8_t state_change);
void *dl_scheduler_loaded_lib;
......
......@@ -29,6 +29,7 @@
#include <string.h>
#include <dlfcn.h>
#include "flexran_agent_common_internal.h"
#include "flexran_agent_mac_internal.h"
Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message,
......@@ -49,11 +50,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
old_report = old_message->stats_reply_msg;
new_report = new_message->stats_reply_msg;
/*Flags to designate changes in various levels of the message*/
int stats_had_changes = 0;
int ue_had_change = 0;
int cell_had_change = 0;
/*See how many and which UE reports should be included in the final stats message*/
int n_ue_report = 0;
int ue_found = 0;
......@@ -101,23 +97,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
}
cell_found = 0;
}
/*TODO: create the reply message based on the findings*/
/*Create ue report list*/
if (n_ue_report > 0) {
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *));
for (i = 0; i<n_ue_report; i++) {
ue_report[i] = tmp_ue_report[i];
}
}
/*Create cell report list*/
if (n_cell_report > 0) {
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *));
for (i = 0; i<n_cell_report; i++) {
cell_report[i] = tmp_cell_report[i];
}
}
if (n_cell_report > 0 || n_ue_report > 0) {
/*Create header*/
......@@ -128,11 +107,30 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
}
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
protocol__flex_stats_reply__init(stats_reply_msg);
stats_reply_msg->header = header;
/*TODO: create the reply message based on the findings*/
/*Create ue report list*/
stats_reply_msg->n_ue_report = n_ue_report;
stats_reply_msg->ue_report = ue_report;
if (n_ue_report > 0) {
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *));
for (i = 0; i<n_ue_report; i++) {
ue_report[i] = tmp_ue_report[i];
}
stats_reply_msg->ue_report = ue_report;
}
/*Create cell report list*/
stats_reply_msg->n_cell_report = n_cell_report;
stats_reply_msg->cell_report = cell_report;
if (n_cell_report > 0) {
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *));
for (i = 0; i<n_cell_report; i++) {
cell_report[i] = tmp_cell_report[i];
}
stats_reply_msg->cell_report = cell_report;
}
msg = malloc(sizeof(Protocol__FlexranMessage));
if(msg == NULL)
goto error;
......@@ -270,7 +268,7 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi
ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas);
if(ul_report == NULL)
goto error;
for(i = 0; i++; i < full_ul_report->n_cqi_meas) {
for(i = 0; i < full_ul_report->n_cqi_meas; i++) {
ul_report[i] = malloc(sizeof(Protocol__FlexUlCqi));
if(ul_report[i] == NULL)
goto error;
......@@ -597,22 +595,22 @@ int parse_mac_config(mid_t mod_id, yaml_parser_t *parser) {
goto error;
}
// Check the types of subsystems offered and handle their values accordingly
if (strcmp(event.data.scalar.value, "dl_scheduler") == 0) {
if (strcmp((char *) event.data.scalar.value, "dl_scheduler") == 0) {
LOG_D(ENB_APP, "This is for the dl_scheduler subsystem\n");
// Call the proper handler
if (parse_dl_scheduler_config(mod_id, parser) == -1) {
LOG_D(ENB_APP, "An error occured\n");
goto error;
}
} else if (strcmp(event.data.scalar.value, "ul_scheduler") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "ul_scheduler") == 0) {
// Call the proper handler
LOG_D(ENB_APP, "This is for the ul_scheduler subsystem\n");
goto error;
// TODO
} else if (strcmp(event.data.scalar.value, "ra_scheduler") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "ra_scheduler") == 0) {
// Call the proper handler
// TODO
} else if (strcmp(event.data.scalar.value, "page_scheduler") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "page_scheduler") == 0) {
// Call the proper handler
// TODO
} else {
......@@ -665,20 +663,20 @@ int parse_dl_scheduler_config(mid_t mod_id, yaml_parser_t *parser) {
goto error;
}
// Check what key needs to be set
if (strcmp(event.data.scalar.value, "behavior") == 0) {
if (strcmp((char *) event.data.scalar.value, "behavior") == 0) {
LOG_I(ENB_APP, "Time to set the behavior attribute\n");
yaml_event_delete(&event);
if (!yaml_parser_parse(parser, &event)) {
goto error;
}
if (event.type == YAML_SCALAR_EVENT) {
if (load_dl_scheduler_function(mod_id, event.data.scalar.value) == -1) {
if (load_dl_scheduler_function(mod_id, (char *) event.data.scalar.value) == -1) {
goto error;
}
} else {
goto error;
}
} else if (strcmp(event.data.scalar.value, "parameters") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "parameters") == 0) {
LOG_D(ENB_APP, "Now it is time to set the parameters for this subsystem\n");
if (parse_dl_scheduler_parameters(mod_id, parser) == -1) {
goto error;
......@@ -731,7 +729,7 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
if (mac_agent_registered[mod_id]) {
LOG_D(ENB_APP, "Setting parameter %s\n", event.data.scalar.value);
param = dlsym(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib,
event.data.scalar.value);
(char *) event.data.scalar.value);
if (param == NULL) {
goto error;
}
......
......@@ -344,7 +344,7 @@ void enb_config_display(void)
#if defined(FLEXRAN_AGENT_SB_IF)
printf( "\nFLEXRAN AGENT CONFIG : \n\n");
printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->flexran_agent_interface_name);
printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address);
// printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address);
printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->flexran_agent_port);
printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->flexran_agent_cache);
......@@ -2494,10 +2494,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name);
cidr = flexran_agent_ipv4_address;
address = strtok(cidr, "/");
enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address);
/* if (address) {
//enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address);
if (address) {
IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" );
}*/
}
enb_properties.properties[enb_properties_index]->flexran_agent_port = flexran_agent_port;
enb_properties.properties[enb_properties_index]->flexran_agent_cache = strdup(flexran_agent_cache);
......
......@@ -30,6 +30,8 @@
#include "log.h"
#include "flexran_agent.h"
#include "flexran_agent_mac_defs.h"
#include "flexran_agent_mac.h"
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_extern.h"
......@@ -38,6 +40,8 @@
#include "flexran_agent_net_comm.h"
#include "flexran_agent_async.h"
#include <arpa/inet.h>
//#define TEST_TIMER
flexran_agent_instance_t flexran_agent[NUM_MAX_ENB];
......@@ -64,11 +68,10 @@ void *flexran_agent_task(void *args){
void *data;
int size;
err_code_t err_code;
int priority;
int priority = 0;
MessageDef *msg_p = NULL;
const char *msg_name = NULL;
instance_t instance;
int result;
struct flexran_agent_timer_element_s * elem = NULL;
......@@ -79,7 +82,6 @@ void *flexran_agent_task(void *args){
itti_receive_msg (TASK_FLEXRAN_AGENT, &msg_p);
DevAssert(msg_p != NULL);
msg_name = ITTI_MSG_NAME (msg_p);
instance = ITTI_MSG_INSTANCE (msg_p);
switch (ITTI_MSG_ID(msg_p)) {
case TERMINATE_MESSAGE:
......@@ -212,9 +214,8 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
strcpy(local_cache, DEFAULT_FLEXRAN_AGENT_CACHE);
}
if (enb_properties->properties[mod_id]->flexran_agent_ipv4_address != NULL) {
strncpy(in_ip, enb_properties->properties[mod_id]->flexran_agent_ipv4_address, sizeof(in_ip) );
in_ip[sizeof(in_ip) - 1] = 0; // terminate string
if (enb_properties->properties[mod_id]->flexran_agent_ipv4_address != 0) {
inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN);
} else {
strcpy(in_ip, DEFAULT_FLEXRAN_AGENT_IPv4_ADDRESS );
}
......@@ -237,7 +238,7 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
channel_container_init = 1;
}
/*Create the async channel info*/
flexran_agent_instance_t *channel_info = flexran_agent_async_channel_info(mod_id, in_ip, in_port);
flexran_agent_async_channel_t *channel_info = flexran_agent_async_channel_info(mod_id, in_ip, in_port);
/*Create a channel using the async channel info*/
channel_id = flexran_agent_create_channel((void *) channel_info,
......
This diff is collapsed.
......@@ -72,7 +72,7 @@ int flexran_agent_deserialize_message(void *data, int size, Protocol__FlexranMes
/* Serialize message and then destroy the input flexran msg. Should be called when protocol
message is created dynamically */
void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
uint32_t * size);
int * size);
/* Calls destructor of the given message */
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg);
......@@ -271,7 +271,7 @@ int flexran_get_tpc(mid_t mod_id, mid_t ue_id);
a designated frame and subframe. Returns 0 for success. The id and the
status of the HARQ process are stored in id and status respectively */
int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id,
const int frame, const uint8_t subframe, int *id, int *round);
const int frame, const uint8_t subframe, unsigned char *id, unsigned char *round);
/* Uplink power control management*/
int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id);
......
......@@ -38,13 +38,12 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
yaml_event_t event;
int done = 0;
int mapping_started = 0;
LOG_I(ENB_APP, "Time to apply a new policy \n");
yaml_parser_initialize(&parser);
yaml_parser_set_input_string(&parser, policy, strlen(policy));
yaml_parser_set_input_string(&parser, (unsigned char *) policy, strlen(policy));
while (!done) {
if (!yaml_parser_parse(&parser, &event))
......@@ -52,39 +51,40 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
switch (event.type) {
case YAML_STREAM_START_EVENT:
break;
case YAML_STREAM_END_EVENT:
break;
case YAML_DOCUMENT_START_EVENT:
break;
case YAML_DOCUMENT_END_EVENT:
break;
case YAML_MAPPING_START_EVENT:
mapping_started = 1;
break;
case YAML_MAPPING_END_EVENT:
mapping_started = 0;
break;
case YAML_SCALAR_EVENT:
// Check the system name and call the proper handler
if (strcmp(event.data.scalar.value, "mac") == 0) {
if (strcmp((char *) event.data.scalar.value, "mac") == 0) {
LOG_D(ENB_APP, "This is intended for the mac system\n");
// Call the mac handler
if (parse_mac_config(mod_id, &parser) == -1) {
goto error;
}
} else if (strcmp(event.data.scalar.value, "rlc") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "rlc") == 0) {
// Call the RLC handler
LOG_D(ENB_APP, "This is intended for the rlc system\n");
// TODO : Just skip it for now
if (skip_system_section(&parser) == -1) {
goto error;
}
} else if (strcmp(event.data.scalar.value, "pdcp") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "pdcp") == 0) {
// Call the PDCP handler
LOG_D(ENB_APP, "This is intended for the pdcp system\n");
// TODO : Just skip it for now
if (skip_system_section(&parser) == -1) {
goto error;
}
} else if (strcmp(event.data.scalar.value, "rrc") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "rrc") == 0) {
// Call the RRC handler
LOG_D(ENB_APP, "This is intended for the rrc system\n");
// TODO : Just skip it for now
......@@ -159,8 +159,9 @@ int skip_system_section(yaml_parser_t *parser) {
if (skip_subsystem_section(parser) == -1) {
goto error;
}
default:
break;
}
done = (event.type == YAML_SEQUENCE_END_EVENT);
yaml_event_delete(&event);
......@@ -199,7 +200,7 @@ int skip_subsystem_section(yaml_parser_t *parser) {
goto error;
}
// Check what key needs to be set
if (strcmp(event.data.scalar.value, "behavior") == 0) {
if (strcmp((char *) event.data.scalar.value, "behavior") == 0) {
LOG_D(ENB_APP, "Skipping the behavior attribute\n");
yaml_event_delete(&event);
if (!yaml_parser_parse(parser, &event)) {
......@@ -210,7 +211,7 @@ int skip_subsystem_section(yaml_parser_t *parser) {
} else {
goto error;
}
} else if (strcmp(event.data.scalar.value, "parameters") == 0) {
} else if (strcmp((char *) event.data.scalar.value, "parameters") == 0) {
LOG_D(ENB_APP, "Skipping the parameters for this subsystem\n");
if (skip_subsystem_parameters_config(parser) == -1) {
goto error;
......@@ -235,8 +236,6 @@ int skip_subsystem_section(yaml_parser_t *parser) {
int skip_subsystem_parameters_config(yaml_parser_t *parser) {
yaml_event_t event;
void *param;
int done = 0;
int mapping_started = 0;
......@@ -299,10 +298,10 @@ int skip_parameter_modification(yaml_parser_t *parser) {
is_array = 1;
break;
case YAML_SCALAR_EVENT:
if ((strcmp(event.data.scalar.tag, YAML_INT_TAG) == 0) ||
(strcmp(event.data.scalar.tag, YAML_FLOAT_TAG) == 0) ||
(strcmp(event.data.scalar.tag, YAML_STR_TAG) == 0) ||
(strcmp(event.data.scalar.tag, YAML_BOOL_TAG) == 0)) {
if ((strcmp((char *) event.data.scalar.tag, YAML_INT_TAG) == 0) ||
(strcmp((char *) event.data.scalar.tag, YAML_FLOAT_TAG) == 0) ||
(strcmp((char *) event.data.scalar.tag, YAML_STR_TAG) == 0) ||
(strcmp((char *) event.data.scalar.tag, YAML_BOOL_TAG) == 0)) {
// Do nothing
} else {
// No other type is supported at the moment, so it should be considered an error
......@@ -351,14 +350,14 @@ int apply_parameter_modification(void *parameter, yaml_parser_t *parser) {
is_array = 1;
break;
case YAML_SCALAR_EVENT:
if (strcmp(event.data.scalar.tag, YAML_INT_TAG) == 0) {
((int *) parameter)[i] = strtol(event.data.scalar.value, &endptr, 10);
} else if (strcmp(event.data.scalar.tag, YAML_FLOAT_TAG) == 0) {
((float *) parameter)[i] = strtof(event.data.scalar.value, &endptr);
} else if (strcmp(event.data.scalar.tag, YAML_STR_TAG) == 0) {
strncpy(&((char *) parameter)[i], event.data.scalar.value, event.data.scalar.length);
} else if (strcmp(event.data.scalar.tag, YAML_BOOL_TAG) == 0) {
if (strcmp(event.data.scalar.value, "true") == 0) {
if (strcmp((char *) event.data.scalar.tag, YAML_INT_TAG) == 0) {
((int *) parameter)[i] = strtol((char *) event.data.scalar.value, &endptr, 10);
} else if (strcmp((char *) event.data.scalar.tag, YAML_FLOAT_TAG) == 0) {
((float *) parameter)[i] = strtof((char *) event.data.scalar.value, &endptr);
} else if (strcmp((char *) event.data.scalar.tag, YAML_STR_TAG) == 0) {
strncpy(&((char *) parameter)[i], (char *) event.data.scalar.value, event.data.scalar.length);
} else if (strcmp((char *) event.data.scalar.tag, YAML_BOOL_TAG) == 0) {
if (strcmp((char *) event.data.scalar.value, "true") == 0) {
((int *) parameter)[i] = 1;
} else {
((int *) parameter)[i] = 0;
......
......@@ -73,12 +73,12 @@ flexran_agent_message_destruction_callback message_destruction_callback[] = {
flexran_agent_destroy_agent_reconfiguration,
};
static const char *flexran_agent_direction2String[] = {
"", /* not_set */
"originating message", /* originating message */
"successfull outcome", /* successfull outcome */
"unsuccessfull outcome", /* unsuccessfull outcome */
};
/* static const char *flexran_agent_direction2String[] = { */
/* "", /\* not_set *\/ */
/* "originating message", /\* originating message *\/ */
/* "successfull outcome", /\* successfull outcome *\/ */
/* "unsuccessfull outcome", /\* unsuccessfull outcome *\/ */
/* }; */
Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
......@@ -123,7 +123,7 @@ error:
void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
uint32_t * size){
int * size){
void * buffer;
err_code_t err_code = PROTOCOL__FLEXRAN_ERR__NO_ERR;
......@@ -181,7 +181,7 @@ Protocol__FlexranMessage* flexran_agent_process_timeout(long timer_id, void* tim
error:
LOG_E(FLEXRAN_AGENT, "can't get the timer element\n");
return TIMER_ELEMENT_NOT_FOUND;
return NULL;
}
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) {
......
......@@ -442,7 +442,7 @@ schedule_ue_spec(
// unsigned char rballoc_sub_UE[MAX_NUM_CCs][NUMBER_OF_UE_MAX][N_RBG_MAX];
// uint16_t pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int mcs;
uint16_t min_rb_unit[MAX_NUM_CCs];
int min_rb_unit[MAX_NUM_CCs];
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
UE_list_t *UE_list = &eNB->UE_list;
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
......
......@@ -46,17 +46,17 @@ void flexran_schedule_ue_spec_default(mid_t mod_id, uint32_t frame, uint32_t sub
* Data plane function for applying the DL decisions of the scheduler
*/
void flexran_apply_dl_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
const Protocol__FlexranMessage *dl_scheduling_info);
Protocol__FlexranMessage *dl_scheduling_info);
/*
* Data plane function for applying the UE specific DL decisions of the scheduler
*/
void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, uint32_t frame, uint32_t subframe, int *mbsfn_flag,
uint32_t n_dl_ue_data, const Protocol__FlexDlData **dl_ue_data);
uint32_t n_dl_ue_data, Protocol__FlexDlData **dl_ue_data);
/*
* Data plane function for filling the DCI structure
*/
void flexran_fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, const Protocol__FlexDlDci *dl_dci);
void flexran_fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti, Protocol__FlexDlDci *dl_dci);
#endif
......@@ -56,12 +56,11 @@
#include "SIMULATION/TOOLS/defs.h" // for taus
void flexran_apply_dl_scheduling_decisions(mid_t mod_id,
uint32_t frame,
uint32_t subframe,
int *mbsfn_flag,
const Protocol__FlexranMessage *dl_scheduling_info) {
Protocol__FlexranMessage *dl_scheduling_info) {
Protocol__FlexDlMacConfig *mac_config = dl_scheduling_info->dl_mac_config_msg;
......@@ -89,33 +88,26 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
uint32_t subframe,
int *mbsfn_flag,
uint32_t n_dl_ue_data,
const Protocol__FlexDlData **dl_ue_data) {
Protocol__FlexDlData **dl_ue_data) {
uint8_t CC_id;
int UE_id;
int N_RBG[MAX_NUM_CCs];
unsigned char aggregation;
mac_rlc_status_resp_t rlc_status;
unsigned char ta_len=0;
unsigned char header_len = 0, header_len_tmp = 0;
unsigned char sdu_lcids[11],offset,num_sdus=0;
uint16_t nb_rb,nb_rb_temp,total_nb_available_rb[MAX_NUM_CCs],nb_available_rb;
uint16_t nb_rb;
uint16_t TBS,j,sdu_lengths[11],rnti,padding=0,post_padding=0;
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES];
unsigned char round = 0;
unsigned char harq_pid = 0;
// LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
uint16_t sdu_length_total = 0;
int mcs;
uint16_t min_rb_unit[MAX_NUM_CCs];
short ta_update = 0;
eNB_MAC_INST *eNB = &eNB_mac_inst[mod_id];
UE_list_t *UE_list = &eNB->UE_list;
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int32_t normalized_rx_power, target_rx_power;
int32_t tpc=1;
static int32_t tpc_accumulated=0;
// static int32_t tpc_accumulated=0;
UE_sched_ctrl *ue_sched_ctl;
int last_sdu_header_len = 0;
......@@ -135,7 +127,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
dl_dci = dl_data->dl_dci;
CC_id = dl_data->serv_cell_index;
frame_parms[CC_id] = mac_xface->get_lte_frame_parms(mod_id, CC_id);
// frame_parms[CC_id] = mac_xface->get_lte_frame_parms(mod_id, CC_id);
rnti = dl_data->rnti;
UE_id = find_ue(rnti, PHY_vars_eNB_g[mod_id][CC_id]);
......@@ -357,20 +349,19 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
eNB_UE_stats->dlsch_mcs1 = dl_dci->mcs[0];
//Fill the proper DCI of OAI
fill_oai_dci(mod_id, CC_id, rnti, dl_dci);
flexran_fill_oai_dci(mod_id, CC_id, rnti, dl_dci);
}
}
void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
const Protocol__FlexDlDci *dl_dci) {
void flexran_fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
Protocol__FlexDlDci *dl_dci) {
void *DLSCH_dci = NULL;
DCI_PDU *DCI_pdu;
unsigned char round = 0;
unsigned char harq_pid = 0;
// unsigned char round = 0;
LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int size_bits, size_bytes;
int size_bits = 0, size_bytes = 0;
eNB_MAC_INST *eNB = &eNB_mac_inst[mod_id];
UE_list_t *UE_list = &eNB->UE_list;
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
......@@ -380,7 +371,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
uint32_t format;
harq_pid = dl_dci->harq_process;
round = dl_dci->rv[0];
// round = dl_dci->rv[0];
// Note this code is for a specific DCI format
DLSCH_dci = (void *)UE_list->UE_template[CC_id][UE_id].DLSCH_DCI[harq_pid];
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -61,9 +61,9 @@ static void *link_manager_sender_thread(void *_manager)
return NULL;
error:
LOG_E(MAC, "%s: error\n", __FUNCTION__);
return NULL;
//error:
//LOG_E(MAC, "%s: error\n", __FUNCTION__);
//return NULL;
}
/* that thread receives messages from the link and puts them in the queue */
......@@ -118,7 +118,6 @@ link_manager_t *create_link_manager(
// Make the async interface threads real-time
//#ifndef LOWLATENCY
struct sched_param sched_param_recv_thread;
struct sched_param sched_param_send_thread;
sched_param_recv_thread.sched_priority = sched_get_priority_max(SCHED_RR) - 1;
pthread_attr_setschedparam(&attr, &sched_param_recv_thread);
......
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