Commit 3b80c73f authored by Robert Schmidt's avatar Robert Schmidt

FlexRAN: Loop over UEs using UE_id, not index

parent 9399bed2
...@@ -894,7 +894,6 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -894,7 +894,6 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
for (j = 0; j < 8; j++) { for (j = 0; j < 8; j++) {
if (RC.mac && RC.mac[mod_id] && RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid == 1) { if (RC.mac && RC.mac[mod_id] && RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][i].harq_pid == 1) {
available_harq[i] = j; available_harq[i] = j;
sf_trigger_msg->n_dl_info++;
break; break;
} }
} }
...@@ -903,10 +902,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -903,10 +902,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
// LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10); // LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10);
/*TODO: Fill in the number of dl HARQ related info, based on the number of currently sf_trigger_msg->n_dl_info = flexran_get_num_ues(mod_id);
*transmitting UEs
*/
// sf_trigger_msg->n_dl_info = flexran_get_num_ues(mod_id);
Protocol__FlexDlInfo **dl_info = NULL; Protocol__FlexDlInfo **dl_info = NULL;
...@@ -916,33 +912,31 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -916,33 +912,31 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
goto error; goto error;
i = -1; i = -1;
//Fill the status of the current HARQ process for each UE //Fill the status of the current HARQ process for each UE
for(UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { for(i = 0; i < sf_trigger_msg->n_dl_info; i++) {
if (available_harq[UE_id] < 0) { if (available_harq[i] < 0)
continue; continue;
} else {
i++;
}
dl_info[i] = malloc(sizeof(Protocol__FlexDlInfo)); dl_info[i] = malloc(sizeof(Protocol__FlexDlInfo));
if(dl_info[i] == NULL) if(dl_info[i] == NULL)
goto error; goto error;
UE_id = flexran_get_ue_id(mod_id, i);
protocol__flex_dl_info__init(dl_info[i]); protocol__flex_dl_info__init(dl_info[i]);
dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id); dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id);
dl_info[i]->has_rnti = 1; dl_info[i]->has_rnti = 1;
/*Fill in the right id of this round's HARQ process for this UE*/ /*Fill in the right id of this round's HARQ process for this UE*/
// uint8_t harq_id; // uint8_t harq_id;
//uint8_t harq_status; //uint8_t harq_status;
// flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status); // flexran_get_harq(mod_id, UE_PCCID(mod_id, UE_id), i, frame, subframe, &harq_id, &harq_status);
dl_info[i]->harq_process_id = available_harq[UE_id]; dl_info[i]->harq_process_id = available_harq[UE_id];
if (RC.mac && RC.mac[mod_id]) if (RC.mac && RC.mac[mod_id])
RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id,i)][UE_id].harq_pid = 0; RC.mac[mod_id]->UE_list.eNB_UE_stats[UE_PCCID(mod_id, UE_id)][UE_id].harq_pid = 0;
dl_info[i]->has_harq_process_id = 1; dl_info[i]->has_harq_process_id = 1;
/* Fill in the status of the HARQ process (2 TBs)*/ /* Fill in the status of the HARQ process (2 TBs)*/
dl_info[i]->n_harq_status = 2; dl_info[i]->n_harq_status = 2;
dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status); dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status);
for (j = 0; j < dl_info[i]->n_harq_status; j++) { for (j = 0; j < dl_info[i]->n_harq_status; j++) {
dl_info[i]->harq_status[j] = RC.mac[mod_id]->UE_list.UE_sched_ctrl[i].round[UE_PCCID(mod_id,i)][j]; dl_info[i]->harq_status[j] = RC.mac[mod_id]->UE_list.UE_sched_ctrl[UE_id].round[UE_PCCID(mod_id, UE_id)][j];
// TODO: This should be different per TB // TODO: This should be different per TB
} }
// LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d and harq %d (round %d)\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10, dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]); // LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d and harq %d (round %d)\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10, dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]);
...@@ -950,7 +944,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -950,7 +944,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
// LOG_I(FLEXRAN_AGENT, "[Frame %d][Subframe %d]Need to make a retransmission for harq %d (round %d)\n", flexran_get_current_frame(mod_id), flexran_get_current_subframe(mod_id), dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]); // LOG_I(FLEXRAN_AGENT, "[Frame %d][Subframe %d]Need to make a retransmission for harq %d (round %d)\n", flexran_get_current_frame(mod_id), flexran_get_current_subframe(mod_id), dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]);
} }
/*Fill in the serving cell index for this UE */ /*Fill in the serving cell index for this UE */
dl_info[i]->serv_cell_index = UE_PCCID(mod_id,i); dl_info[i]->serv_cell_index = UE_PCCID(mod_id, UE_id);
dl_info[i]->has_serv_cell_index = 1; dl_info[i]->has_serv_cell_index = 1;
} }
} }
...@@ -974,18 +968,21 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -974,18 +968,21 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
if(ul_info[i] == NULL) if(ul_info[i] == NULL)
goto error; goto error;
protocol__flex_ul_info__init(ul_info[i]); protocol__flex_ul_info__init(ul_info[i]);
ul_info[i]->rnti = flexran_get_ue_crnti(mod_id, i);
UE_id = flexran_get_ue_id(mod_id, i);
ul_info[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id);
ul_info[i]->has_rnti = 1; ul_info[i]->has_rnti = 1;
/* Fill in the Tx power control command for this UE (if available), /* Fill in the Tx power control command for this UE (if available),
* primary carrier */ * primary carrier */
if(flexran_get_tpc(mod_id, i, 0) != 1){ if(flexran_get_tpc(mod_id, UE_id, 0) != 1){
/* assume primary carrier */ /* assume primary carrier */
ul_info[i]->tpc = flexran_get_tpc(mod_id, i, 0); ul_info[i]->tpc = flexran_get_tpc(mod_id, UE_id, 0);
ul_info[i]->has_tpc = 1; ul_info[i]->has_tpc = 1;
} }
else{ else{
/* assume primary carrier */ /* assume primary carrier */
ul_info[i]->tpc = flexran_get_tpc(mod_id, i, 0); ul_info[i]->tpc = flexran_get_tpc(mod_id, UE_id, 0);
ul_info[i]->has_tpc = 0; ul_info[i]->has_tpc = 0;
} }
/*TODO: fill in the amount of data in bytes in the MAC SDU received in this subframe for the /*TODO: fill in the amount of data in bytes in the MAC SDU received in this subframe for the
...@@ -999,7 +996,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -999,7 +996,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
ul_info[i]->reception_status = PROTOCOL__FLEX_RECEPTION_STATUS__FLRS_OK; ul_info[i]->reception_status = PROTOCOL__FLEX_RECEPTION_STATUS__FLRS_OK;
ul_info[i]->has_reception_status = 1; ul_info[i]->has_reception_status = 1;
/*Fill in the serving cell index for this UE */ /*Fill in the serving cell index for this UE */
ul_info[i]->serv_cell_index = UE_PCCID(mod_id,i); ul_info[i]->serv_cell_index = UE_PCCID(mod_id, UE_id);
ul_info[i]->has_serv_cell_index = 1; ul_info[i]->has_serv_cell_index = 1;
} }
} }
......
...@@ -264,27 +264,31 @@ int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg) { ...@@ -264,27 +264,31 @@ int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg) {
/* this is called by RRC as a part of rrc xface . The controller previously requested this*/ /* this is called by RRC as a part of rrc xface . The controller previously requested this*/
void flexran_trigger_rrc_measurements (mid_t mod_id, MeasResults_t* measResults) { void flexran_trigger_rrc_measurements (mid_t mod_id, MeasResults_t* measResults) {
int i; //int i;
// int priority = 0; // Warning Preventing // int priority = 0; // Warning Preventing
// void *data; // void *data;
// int size; // int size;
// err_code_t err_code = -100; // err_code_t err_code = -100;
triggered_rrc = true; triggered_rrc = true;
int num; //int num;
/* TODO do we need this at the current state? meas_stats is never put into a
* protobuf message?!
num = flexran_get_num_ues (mod_id); num = flexran_get_num_ues (mod_id);
meas_stats = malloc(sizeof(rrc_meas_stats) * num); meas_stats = malloc(sizeof(rrc_meas_stats) * num);
for (i = 0; i < num; i++){ for (i = 0; i < num; i++){
meas_stats[i].rnti = flexran_get_ue_crnti(mod_id, i); UE_id = flexran_get_ue_id(mod_id, i);
meas_stats[i].meas_id = flexran_get_rrc_pcell_measid(mod_id,i); meas_stats[i].rnti = flexran_get_ue_crnti(mod_id, UE_id);
meas_stats[i].rsrp = flexran_get_rrc_pcell_rsrp(mod_id,i) - 140; meas_stats[i].meas_id = flexran_get_rrc_pcell_measid(mod_id, UE_id);
meas_stats[i].rsrp = flexran_get_rrc_pcell_rsrp(mod_id, UE_id) - 140;
// measResults->measResultPCell.rsrpResult - 140; // measResults->measResultPCell.rsrpResult - 140;
meas_stats[i].rsrq = flexran_get_rrc_pcell_rsrq(mod_id,i)/2 - 20; meas_stats[i].rsrq = flexran_get_rrc_pcell_rsrq(mod_id, UE_id)/2 - 20;
// (measResults->measResultPCell.rsrqResult)/2 - 20; // (measResults->measResultPCell.rsrqResult)/2 - 20;
} }
*/
// repl->neigh_meas = NULL; // repl->neigh_meas = NULL;
// if (meas->measResultNeighCells != NULL) { // if (meas->measResultNeighCells != NULL) {
......
...@@ -459,6 +459,7 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -459,6 +459,7 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl
xid = (lc_config_request_msg->header)->xid; xid = (lc_config_request_msg->header)->xid;
int i, j; int i, j;
int UE_id;
Protocol__FlexLcConfigReply *lc_config_reply_msg; Protocol__FlexLcConfigReply *lc_config_reply_msg;
lc_config_reply_msg = malloc(sizeof(Protocol__FlexLcConfigReply)); lc_config_reply_msg = malloc(sizeof(Protocol__FlexLcConfigReply));
...@@ -484,13 +485,15 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -484,13 +485,15 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl
lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig)); lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig));
protocol__flex_lc_ue_config__init(lc_ue_config[i]); protocol__flex_lc_ue_config__init(lc_ue_config[i]);
UE_id = flexran_get_ue_id(mod_id, i);
lc_ue_config[i]->has_rnti = 1; lc_ue_config[i]->has_rnti = 1;
lc_ue_config[i]->rnti = flexran_get_ue_crnti(mod_id,i); lc_ue_config[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id);
//TODO: Set the number of LC configurations that will be reported for this UE //TODO: Set the number of LC configurations that will be reported for this UE
//Set this according to the current state of the UE. This is only a temporary fix //Set this according to the current state of the UE. This is only a temporary fix
int status = 0; int status = 0;
status = mac_eNB_get_rrc_status(mod_id, flexran_get_ue_crnti(mod_id, i)); status = mac_eNB_get_rrc_status(mod_id, flexran_get_ue_crnti(mod_id, UE_id));
/* TODO needs to be revised and appropriate API to be implemented */ /* TODO needs to be revised and appropriate API to be implemented */
if (status < RRC_CONNECTED) { if (status < RRC_CONNECTED) {
lc_ue_config[i]->n_lc_config = 0; lc_ue_config[i]->n_lc_config = 0;
...@@ -513,14 +516,14 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -513,14 +516,14 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl
lc_config[j]->has_lcid = 1; lc_config[j]->has_lcid = 1;
lc_config[j]->lcid = j+1; lc_config[j]->lcid = j+1;
int lcg = flexran_get_lcg(mod_id, i, j+1); int lcg = flexran_get_lcg(mod_id, UE_id, j+1);
if (lcg >= 0 && lcg <= 3) { if (lcg >= 0 && lcg <= 3) {
lc_config[j]->has_lcg = 1; lc_config[j]->has_lcg = 1;
lc_config[j]->lcg = flexran_get_lcg(mod_id, i,j+1); lc_config[j]->lcg = flexran_get_lcg(mod_id, UE_id, j+1);
} }
lc_config[j]->has_direction = 1; lc_config[j]->has_direction = 1;
lc_config[j]->direction = flexran_get_direction(i,j+1); lc_config[j]->direction = flexran_get_direction(UE_id, j+1);
//TODO: Bearer type. One of FLQBT_* values. Currently only default bearer supported //TODO: Bearer type. One of FLQBT_* values. Currently only default bearer supported
lc_config[j]->has_qos_bearer_type = 1; lc_config[j]->has_qos_bearer_type = 1;
lc_config[j]->qos_bearer_type = PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_NON_GBR; lc_config[j]->qos_bearer_type = PROTOCOL__FLEX_QOS_BEARER_TYPE__FLQBT_NON_GBR;
...@@ -587,6 +590,7 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -587,6 +590,7 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl
xid = (ue_config_request_msg->header)->xid; xid = (ue_config_request_msg->header)->xid;
int i; int i;
int UE_id;
Protocol__FlexUeConfigReply *ue_config_reply_msg; Protocol__FlexUeConfigReply *ue_config_reply_msg;
ue_config_reply_msg = malloc(sizeof(Protocol__FlexUeConfigReply)); ue_config_reply_msg = malloc(sizeof(Protocol__FlexUeConfigReply));
...@@ -611,30 +615,31 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -611,30 +615,31 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl
ue_config[i] = malloc(sizeof(Protocol__FlexUeConfig)); ue_config[i] = malloc(sizeof(Protocol__FlexUeConfig));
protocol__flex_ue_config__init(ue_config[i]); protocol__flex_ue_config__init(ue_config[i]);
ue_config[i]->rnti = flexran_get_ue_crnti(mod_id,i); UE_id = flexran_get_ue_id(mod_id, i);
ue_config[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id);
ue_config[i]->has_rnti = 1; ue_config[i]->has_rnti = 1;
ue_config[i]->imsi = flexran_get_ue_imsi(mod_id, i); ue_config[i]->imsi = flexran_get_ue_imsi(mod_id, UE_id);
ue_config[i]->has_imsi = 1; ue_config[i]->has_imsi = 1;
ue_config[i]->dl_slice_id = flexran_get_ue_dl_slice_id(mod_id, i); ue_config[i]->dl_slice_id = flexran_get_ue_dl_slice_id(mod_id, UE_id);
ue_config[i]->has_dl_slice_id = 1; ue_config[i]->has_dl_slice_id = 1;
ue_config[i]->ul_slice_id = flexran_get_ue_ul_slice_id(mod_id, i); ue_config[i]->ul_slice_id = flexran_get_ue_ul_slice_id(mod_id, UE_id);
ue_config[i]->has_ul_slice_id = 1; ue_config[i]->has_ul_slice_id = 1;
//TODO: Set the DRX configuration (optional) //TODO: Set the DRX configuration (optional)
//Not supported for now, so we do not set it //Not supported for now, so we do not set it
if (flexran_get_time_alignment_timer(mod_id,i) != -1) { if (flexran_get_time_alignment_timer(mod_id, UE_id) != -1) {
ue_config[i]->time_alignment_timer = flexran_get_time_alignment_timer(mod_id,i); ue_config[i]->time_alignment_timer = flexran_get_time_alignment_timer(mod_id, UE_id);
ue_config[i]->has_time_alignment_timer = 1; ue_config[i]->has_time_alignment_timer = 1;
} }
if (flexran_get_meas_gap_config(mod_id,i) != -1) { if (flexran_get_meas_gap_config(mod_id, UE_id) != -1) {
ue_config[i]->meas_gap_config_pattern = flexran_get_meas_gap_config(mod_id,i); ue_config[i]->meas_gap_config_pattern = flexran_get_meas_gap_config(mod_id, UE_id);
ue_config[i]->has_meas_gap_config_pattern = 1; ue_config[i]->has_meas_gap_config_pattern = 1;
} }
if (ue_config[i]->has_meas_gap_config_pattern == 1 && if (ue_config[i]->has_meas_gap_config_pattern == 1 &&
ue_config[i]->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) { ue_config[i]->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) {
ue_config[i]->meas_gap_config_sf_offset = flexran_get_meas_gap_config_offset(mod_id,i); ue_config[i]->meas_gap_config_sf_offset = flexran_get_meas_gap_config_offset(mod_id, UE_id);
ue_config[i]->has_meas_gap_config_sf_offset = 1; ue_config[i]->has_meas_gap_config_sf_offset = 1;
} }
//TODO: Set the SPS configuration (Optional) //TODO: Set the SPS configuration (Optional)
...@@ -646,77 +651,77 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -646,77 +651,77 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl
//TODO: Set the CQI configuration (Optional) //TODO: Set the CQI configuration (Optional)
//We do not set it for now //We do not set it for now
if (flexran_get_ue_transmission_mode(mod_id,i) != -1) { if (flexran_get_ue_transmission_mode(mod_id, UE_id) != -1) {
ue_config[i]->transmission_mode = flexran_get_ue_transmission_mode(mod_id,i); ue_config[i]->transmission_mode = flexran_get_ue_transmission_mode(mod_id, UE_id);
ue_config[i]->has_transmission_mode = 1; ue_config[i]->has_transmission_mode = 1;
} }
ue_config[i]->ue_aggregated_max_bitrate_ul = flexran_get_ue_aggregated_max_bitrate_ul(mod_id,i); ue_config[i]->ue_aggregated_max_bitrate_ul = flexran_get_ue_aggregated_max_bitrate_ul(mod_id, UE_id);
ue_config[i]->has_ue_aggregated_max_bitrate_ul = 1; ue_config[i]->has_ue_aggregated_max_bitrate_ul = 1;
ue_config[i]->ue_aggregated_max_bitrate_dl = flexran_get_ue_aggregated_max_bitrate_dl(mod_id,i); ue_config[i]->ue_aggregated_max_bitrate_dl = flexran_get_ue_aggregated_max_bitrate_dl(mod_id, UE_id);
ue_config[i]->has_ue_aggregated_max_bitrate_dl = 1; ue_config[i]->has_ue_aggregated_max_bitrate_dl = 1;
Protocol__FlexUeCapabilities *capabilities; Protocol__FlexUeCapabilities *capabilities;
capabilities = malloc(sizeof(Protocol__FlexUeCapabilities)); capabilities = malloc(sizeof(Protocol__FlexUeCapabilities));
protocol__flex_ue_capabilities__init(capabilities); protocol__flex_ue_capabilities__init(capabilities);
capabilities->has_half_duplex = 1; capabilities->has_half_duplex = 1;
capabilities->half_duplex = flexran_get_half_duplex(mod_id, i); capabilities->half_duplex = flexran_get_half_duplex(mod_id, UE_id);
capabilities->has_intra_sf_hopping = 1; capabilities->has_intra_sf_hopping = 1;
capabilities->intra_sf_hopping = flexran_get_intra_sf_hopping(mod_id, i); capabilities->intra_sf_hopping = flexran_get_intra_sf_hopping(mod_id, UE_id);
capabilities->has_type2_sb_1 = 1; capabilities->has_type2_sb_1 = 1;
capabilities->type2_sb_1 = flexran_get_type2_sb_1(mod_id, i); capabilities->type2_sb_1 = flexran_get_type2_sb_1(mod_id, UE_id);
capabilities->has_ue_category = 1; capabilities->has_ue_category = 1;
capabilities->ue_category = flexran_get_ue_category(mod_id, i); capabilities->ue_category = flexran_get_ue_category(mod_id, UE_id);
capabilities->has_res_alloc_type1 = 1; capabilities->has_res_alloc_type1 = 1;
capabilities->res_alloc_type1 = flexran_get_res_alloc_type1(mod_id, i); capabilities->res_alloc_type1 = flexran_get_res_alloc_type1(mod_id, UE_id);
//Set the capabilites to the message //Set the capabilites to the message
ue_config[i]->capabilities = capabilities; ue_config[i]->capabilities = capabilities;
if (flexran_get_ue_transmission_antenna(mod_id,i) != -1) { if (flexran_get_ue_transmission_antenna(mod_id, UE_id) != -1) {
ue_config[i]->has_ue_transmission_antenna = 1; ue_config[i]->has_ue_transmission_antenna = 1;
ue_config[i]->ue_transmission_antenna = flexran_get_ue_transmission_antenna(mod_id,i); ue_config[i]->ue_transmission_antenna = flexran_get_ue_transmission_antenna(mod_id, UE_id);
} }
if (flexran_get_tti_bundling(mod_id,i) != -1) { if (flexran_get_tti_bundling(mod_id, UE_id) != -1) {
ue_config[i]->has_tti_bundling = 1; ue_config[i]->has_tti_bundling = 1;
ue_config[i]->tti_bundling = flexran_get_tti_bundling(mod_id,i); ue_config[i]->tti_bundling = flexran_get_tti_bundling(mod_id, UE_id);
} }
if (flexran_get_maxHARQ_TX(mod_id,i) != -1) { if (flexran_get_maxHARQ_TX(mod_id, UE_id) != -1) {
ue_config[i]->has_max_harq_tx = 1; ue_config[i]->has_max_harq_tx = 1;
ue_config[i]->max_harq_tx = flexran_get_maxHARQ_TX(mod_id,i); ue_config[i]->max_harq_tx = flexran_get_maxHARQ_TX(mod_id, UE_id);
} }
if (flexran_get_beta_offset_ack_index(mod_id,i) != -1) { if (flexran_get_beta_offset_ack_index(mod_id, UE_id) != -1) {
ue_config[i]->has_beta_offset_ack_index = 1; ue_config[i]->has_beta_offset_ack_index = 1;
ue_config[i]->beta_offset_ack_index = flexran_get_beta_offset_ack_index(mod_id,i); ue_config[i]->beta_offset_ack_index = flexran_get_beta_offset_ack_index(mod_id, UE_id);
} }
if (flexran_get_beta_offset_ri_index(mod_id,i) != -1) { if (flexran_get_beta_offset_ri_index(mod_id, UE_id) != -1) {
ue_config[i]->has_beta_offset_ri_index = 1; ue_config[i]->has_beta_offset_ri_index = 1;
ue_config[i]->beta_offset_ri_index = flexran_get_beta_offset_ri_index(mod_id,i); ue_config[i]->beta_offset_ri_index = flexran_get_beta_offset_ri_index(mod_id, UE_id);
} }
if (flexran_get_beta_offset_cqi_index(mod_id,i) != -1) { if (flexran_get_beta_offset_cqi_index(mod_id, UE_id) != -1) {
ue_config[i]->has_beta_offset_cqi_index = 1; ue_config[i]->has_beta_offset_cqi_index = 1;
ue_config[i]->beta_offset_cqi_index = flexran_get_beta_offset_cqi_index(mod_id,i); ue_config[i]->beta_offset_cqi_index = flexran_get_beta_offset_cqi_index(mod_id, UE_id);
} }
/* assume primary carrier */ /* assume primary carrier */
if (flexran_get_ack_nack_simultaneous_trans(mod_id, i, 0) != -1) { if (flexran_get_ack_nack_simultaneous_trans(mod_id, UE_id, 0) != -1) {
ue_config[i]->has_ack_nack_simultaneous_trans = 1; ue_config[i]->has_ack_nack_simultaneous_trans = 1;
ue_config[i]->ack_nack_simultaneous_trans = flexran_get_ack_nack_simultaneous_trans(mod_id, i, 0); ue_config[i]->ack_nack_simultaneous_trans = flexran_get_ack_nack_simultaneous_trans(mod_id, UE_id, 0);
} }
if (flexran_get_simultaneous_ack_nack_cqi(mod_id,i) != -1) { if (flexran_get_simultaneous_ack_nack_cqi(mod_id, UE_id) != -1) {
ue_config[i]->has_simultaneous_ack_nack_cqi = 1; ue_config[i]->has_simultaneous_ack_nack_cqi = 1;
ue_config[i]->simultaneous_ack_nack_cqi = flexran_get_simultaneous_ack_nack_cqi(mod_id,i); ue_config[i]->simultaneous_ack_nack_cqi = flexran_get_simultaneous_ack_nack_cqi(mod_id, UE_id);
} }
if (flexran_get_aperiodic_cqi_rep_mode(mod_id,i) != -1) { if (flexran_get_aperiodic_cqi_rep_mode(mod_id, UE_id) != -1) {
ue_config[i]->has_aperiodic_cqi_rep_mode = 1; ue_config[i]->has_aperiodic_cqi_rep_mode = 1;
int mode = flexran_get_aperiodic_cqi_rep_mode(mod_id,i); int mode = flexran_get_aperiodic_cqi_rep_mode(mod_id, UE_id);
if (mode > 4) { if (mode > 4) {
ue_config[i]->aperiodic_cqi_rep_mode = PROTOCOL__FLEX_APERIODIC_CQI_REPORT_MODE__FLACRM_NONE; ue_config[i]->aperiodic_cqi_rep_mode = PROTOCOL__FLEX_APERIODIC_CQI_REPORT_MODE__FLACRM_NONE;
} else { } else {
...@@ -724,26 +729,26 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -724,26 +729,26 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl
} }
} }
if (flexran_get_tdd_ack_nack_feedback_mode(mod_id, i) != -1) { if (flexran_get_tdd_ack_nack_feedback_mode(mod_id, UE_id) != -1) {
ue_config[i]->has_tdd_ack_nack_feedback = 1; ue_config[i]->has_tdd_ack_nack_feedback = 1;
ue_config[i]->tdd_ack_nack_feedback = flexran_get_tdd_ack_nack_feedback_mode(mod_id,i); ue_config[i]->tdd_ack_nack_feedback = flexran_get_tdd_ack_nack_feedback_mode(mod_id, UE_id);
} }
if(flexran_get_ack_nack_repetition_factor(mod_id, i) != -1) { if(flexran_get_ack_nack_repetition_factor(mod_id, UE_id) != -1) {
ue_config[i]->has_ack_nack_repetition_factor = 1; ue_config[i]->has_ack_nack_repetition_factor = 1;
ue_config[i]->ack_nack_repetition_factor = flexran_get_ack_nack_repetition_factor(mod_id,i); ue_config[i]->ack_nack_repetition_factor = flexran_get_ack_nack_repetition_factor(mod_id, UE_id);
} }
if (flexran_get_extended_bsr_size(mod_id, i) != -1) { if (flexran_get_extended_bsr_size(mod_id, UE_id) != -1) {
ue_config[i]->has_extended_bsr_size = 1; ue_config[i]->has_extended_bsr_size = 1;
ue_config[i]->extended_bsr_size = flexran_get_extended_bsr_size(mod_id,i); ue_config[i]->extended_bsr_size = flexran_get_extended_bsr_size(mod_id, UE_id);
} }
//TODO: Set carrier aggregation support (boolean) //TODO: Set carrier aggregation support (boolean)
ue_config[i]->has_ca_support = 0; ue_config[i]->has_ca_support = 0;
ue_config[i]->ca_support = 0; ue_config[i]->ca_support = 0;
ue_config[i]->has_pcell_carrier_index = 1; ue_config[i]->has_pcell_carrier_index = 1;
ue_config[i]->pcell_carrier_index = UE_PCCID(mod_id, i); ue_config[i]->pcell_carrier_index = UE_PCCID(mod_id, UE_id);
if(ue_config[i]->has_ca_support){ if(ue_config[i]->has_ca_support){
//TODO: Set cross carrier scheduling support (boolean) //TODO: Set cross carrier scheduling support (boolean)
ue_config[i]->has_cross_carrier_sched_support = 0; ue_config[i]->has_cross_carrier_sched_support = 0;
...@@ -858,8 +863,8 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F ...@@ -858,8 +863,8 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F
cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig)); cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig));
protocol__flex_cell_config__init(cell_conf[i]); protocol__flex_cell_config__init(cell_conf[i]);
cell_conf[i]->phy_cell_id = 1; cell_conf[i]->phy_cell_id = flexran_get_cell_id(mod_id,i);
cell_conf[i]->has_phy_cell_id = flexran_get_cell_id(mod_id,i); cell_conf[i]->has_phy_cell_id = 1;
cell_conf[i]->cell_id = i; cell_conf[i]->cell_id = i;
cell_conf[i]->has_cell_id = 1; cell_conf[i]->has_cell_id = 1;
......
...@@ -210,6 +210,7 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr ...@@ -210,6 +210,7 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
//TODO: We do not deal with multiple CCs at the moment and eNB id is 0 //TODO: We do not deal with multiple CCs at the moment and eNB id is 0
int enb_id = mod_id; int enb_id = mod_id;
int UE_id;
//eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id]; //eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id];
//UE_list_t *eNB_UE_list= &eNB->UE_list; //UE_list_t *eNB_UE_list= &eNB->UE_list;
...@@ -249,7 +250,8 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr ...@@ -249,7 +250,8 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
goto error; goto error;
} }
for (i = 0; i < report_config.nr_ue; i++) { for (i = 0; i < report_config.nr_ue; i++) {
report_config.ue_report_type[i].ue_rnti = flexran_get_ue_crnti(enb_id, i); //eNB_UE_list->eNB_UE_stats[UE_PCCID(enb_id,i)][i].crnti; UE_id = flexran_get_ue_id(mod_id, i);
report_config.ue_report_type[i].ue_rnti = flexran_get_ue_crnti(enb_id, UE_id); //eNB_UE_list->eNB_UE_stats[UE_PCCID(enb_id,i)][i].crnti;
report_config.ue_report_type[i].ue_report_flags = ue_flags; report_config.ue_report_type[i].ue_report_flags = ue_flags;
} }
//Set the number of CCs and create a list with the cell stats configs //Set the number of CCs and create a list with the cell stats configs
...@@ -359,7 +361,8 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr ...@@ -359,7 +361,8 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
goto error; goto error;
} }
for (i = 0; i < report_config.nr_ue; i++) { for (i = 0; i < report_config.nr_ue; i++) {
report_config.ue_report_type[i].ue_rnti = ue_req->rnti[i]; UE_id = flexran_get_ue_id(mod_id, i);
report_config.ue_report_type[i].ue_rnti = ue_req->rnti[UE_id];
report_config.ue_report_type[i].ue_report_flags = ue_req->flags; report_config.ue_report_type[i].ue_report_flags = ue_req->flags;
} }
break; break;
......
...@@ -113,6 +113,21 @@ int flexran_get_num_ues(mid_t mod_id) ...@@ -113,6 +113,21 @@ int flexran_get_num_ues(mid_t mod_id)
return RC.mac[mod_id]->UE_list.num_UEs; return RC.mac[mod_id]->UE_list.num_UEs;
} }
int flexran_get_ue_id(mid_t mod_id, int i)
{
int n;
if (!mac_is_present(mod_id)) return 0;
/* get the (i+1)'th active UE */
for (n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
if (RC.mac[mod_id]->UE_list.active[n] == TRUE) {
if (i == 0)
return n;
--i;
}
}
return 0;
}
rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id) rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id)
{ {
return UE_RNTI(mod_id, ue_id); return UE_RNTI(mod_id, ue_id);
......
...@@ -73,6 +73,10 @@ uint16_t flexran_get_future_sfn_sf(mid_t mod_id, int ahead_of_time); ...@@ -73,6 +73,10 @@ uint16_t flexran_get_future_sfn_sf(mid_t mod_id, int ahead_of_time);
/* Return the number of attached UEs */ /* Return the number of attached UEs */
int flexran_get_num_ues(mid_t mod_id); int flexran_get_num_ues(mid_t mod_id);
/* Return the UE id of attached UE as opposed to the index [0,NUM UEs] (i.e.,
* the i'th active UE). Returns 0 if the i'th active UE could not be found. */
int flexran_get_ue_id(mid_t mod_id, int i);
/* Get the rnti of a UE with id ue_id */ /* Get the rnti of a UE with id ue_id */
rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id); rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id);
......
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