Commit b64cb5b2 authored by Xenofon Foukas's avatar Xenofon Foukas

Added rank indication and timing advance indication support

parent a6636544
......@@ -400,6 +400,31 @@ int get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id)
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO,channel_id,0);
return rlc_status.bytes_in_buffer;
}
int get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id)
{
if((((UE_list_t *)enb_ue[mod_id])->UE_sched_ctrl[ue_id].ta_update) > 0)
return 1;
else
return 0;
}
int get_active_CC(mid_t mod_id, mid_t ue_id)
{
return ((UE_list_t *)enb_ue[mod_id])->numactiveCCs[ue_id];
}
int get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id)
{
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
int pCCid = UE_PCCID(mod_id,ue_id);
rnti_t rnti = get_ue_crnti(mod_id,ue_id);
eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti);
return eNB_UE_stats[CC_id].rank;
}
/*
* timer primitives
*/
......
......@@ -150,6 +150,11 @@ int get_ue_wcqi (mid_t mod_id, mid_t ue_id);
int get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
int get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id);
int get_active_CC(mid_t mod_id, mid_t ue_id);
int get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id);
......
......@@ -453,7 +453,7 @@ int enb_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__PRP_UE_STATS_TYPE__PRUST_MAC_CE_BS) {
// TODO: Fill in the actual MAC CE buffer status report
ue_report[i]->pending_mac_ces = -1; /* Use as bitmap. Set one or more of the
ue_report[i]->pending_mac_ces = (get_MAC_CE_bitmap_TA(enb_id,i) | (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
PROTOCOL__PRP_CE_TYPE__PRPCET_ values
found in stats_common.pb-c.h. See
prp_ce_type in progRAN specification */
......@@ -472,7 +472,7 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
dl_report->sfn_sn = get_sfn_sf(enb_id);
dl_report->has_sfn_sn = 1;
//TODO:Set the number of DL CQI reports for this UE. One for each CC
dl_report->n_csi_report = 1;
dl_report->n_csi_report = get_active_CC(enb_id,i);
//TODO:Create the actual CSI reports.
Protocol__PrpDlCsi **csi_reports;
csi_reports = malloc(sizeof(Protocol__PrpDlCsi *)*dl_report->n_csi_report);
......@@ -484,10 +484,10 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
goto error;
protocol__prp_dl_csi__init(csi_reports[j]);
//TODO: the servCellIndex for this report
csi_reports[j]->serv_cell_index = 0;
csi_reports[j]->serv_cell_index = j;
csi_reports[j]->has_serv_cell_index = 1;
//TODO: the rank indicator value for this cc
csi_reports[j]->ri = 1;
csi_reports[j]->ri = get_current_RI(enb_id,i,j);
csi_reports[j]->has_ri = 1;
//TODO: the type of CSI report based on the configuration of the UE
//For this example we use type P10, which only needs a wideband value
......@@ -496,6 +496,7 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
csi_reports[j]->type = PROTOCOL__PRP_CSI_TYPE__PRCSIT_P10;
csi_reports[j]->has_type = 1;
csi_reports[j]->report_case = PROTOCOL__PRP_DL_CSI__REPORT_P10CSI;
if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P10CSI){
Protocol__PrpCsiP10 *csi10;
csi10 = malloc(sizeof(Protocol__PrpCsiP10));
if (csi10 == NULL)
......@@ -508,6 +509,31 @@ int enb_agent_mac_stats_reply(mid_t mod_id,
//Add the type of measurements to the csi report in the proper union type
csi_reports[j]->p10csi = csi10;
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P11CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P20CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_P21CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A12CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A22CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A20CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A30CSI){
}
else if(csi_reports[j]->report_case == PROTOCOL__PRP_DL_CSI__REPORT_A31CSI){
}
}
//Add the csi reports to the full DL CQI report
dl_report->csi_report = csi_reports;
//Add the DL CQI report to the stats report
......
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