diff --git a/openair2/ENB_APP/enb_agent_common.c b/openair2/ENB_APP/enb_agent_common.c index 7c820bfa5c03d801f67fa1a2527d12eb31140514..5ddcb3986817beee2f9a906c9c07f6167c31df87 100644 --- a/openair2/ENB_APP/enb_agent_common.c +++ b/openair2/ENB_APP/enb_agent_common.c @@ -393,6 +393,13 @@ int get_ue_wcqi (mid_t mod_id, mid_t ue_id) { return ((UE_list_t *)enb_ue[mod_id])->eNB_UE_stats[UE_PCCID(mod_id,ue_id)][ue_id].dl_cqi; } +int get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) +{ + rnti_t rnti = get_ue_crnti(mod_id,ue_id); + uint16_t frame = (uint16_t) get_current_frame(mod_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; +} /* * timer primitives */ diff --git a/openair2/ENB_APP/enb_agent_common.h b/openair2/ENB_APP/enb_agent_common.h index afa2179ff4d8bd334c71b90cf108271121b64fcc..784c86bf6a253cca1e897c1d1fdadf2b902b9620 100644 --- a/openair2/ENB_APP/enb_agent_common.h +++ b/openair2/ENB_APP/enb_agent_common.h @@ -148,7 +148,7 @@ int get_ue_phr (mid_t mod_id, mid_t ue_id); 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); diff --git a/openair2/ENB_APP/enb_agent_mac.c b/openair2/ENB_APP/enb_agent_mac.c index df614df60c31ce936c1b362a734e8d48f443758b..4a62c9dcbbc773374adb977009d39c3ae6cabaf2 100644 --- a/openair2/ENB_APP/enb_agent_mac.c +++ b/openair2/ENB_APP/enb_agent_mac.c @@ -413,9 +413,9 @@ int enb_agent_mac_stats_reply(mid_t mod_id, /* Check flag for creation of RLC buffer status report */ if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__PRP_UE_STATS_TYPE__PRUST_RLC_BS) { // TODO: Fill in the actual RLC buffer status reports - ue_report[i]->n_rlc_report = 1; // Set this to the number of LCs for this UE + ue_report[i]->n_rlc_report = 3; // Set this to the number of LCs for this UE Protocol__PrpRlcBsr ** rlc_reports; - rlc_reports = malloc(sizeof(Protocol__PrpRlcBsr) * ue_report[i]->n_rlc_report); + rlc_reports = malloc(sizeof(Protocol__PrpRlcBsr *) * ue_report[i]->n_rlc_report); if (rlc_reports == NULL) goto error; @@ -427,10 +427,10 @@ int enb_agent_mac_stats_reply(mid_t mod_id, goto error; protocol__prp_rlc_bsr__init(rlc_reports[j]); //TODO:Set logical channel id - rlc_reports[j]->lc_id = 1; + rlc_reports[j]->lc_id = j+1; rlc_reports[j]->has_lc_id = 1; //TODO:Set tx queue size in bytes - rlc_reports[j]->tx_queue_size = 10; + rlc_reports[j]->tx_queue_size = get_tx_queue_size(enb_id,i,j+1); rlc_reports[j]->has_tx_queue_size = 1; //TODO:Set tx queue head of line delay in ms rlc_reports[j]->tx_queue_hol_delay = 100;