Commit a8cd2394 authored by Xenofon Foukas's avatar Xenofon Foukas

Progran scheduler fixes

parent 07edce17
...@@ -487,6 +487,8 @@ schedule_ue_spec_default( ...@@ -487,6 +487,8 @@ schedule_ue_spec_default(
//TBS = mac_xface->get_TBS(eNB_UE_stats->DL_cqi[0]<<1,nb_available_rb); //TBS = mac_xface->get_TBS(eNB_UE_stats->DL_cqi[0]<<1,nb_available_rb);
TBS = mac_xface->get_TBS_DL(mcs, nb_available_rb); TBS = mac_xface->get_TBS_DL(mcs, nb_available_rb);
dci_tbs = TBS; dci_tbs = TBS;
// check first for RLC data on DCCH // check first for RLC data on DCCH
// add the length for all the control elements (timing adv, drx, etc) : header + payload // add the length for all the control elements (timing adv, drx, etc) : header + payload
...@@ -511,7 +513,8 @@ schedule_ue_spec_default( ...@@ -511,7 +513,8 @@ schedule_ue_spec_default(
// Need to see if we have space for data from this channel // Need to see if we have space for data from this channel
if ( TBS-ta_len-header_len_dcch > 0 ) { if ( TBS-ta_len-header_len_dcch > 0 ) {
LOG_D(MAC, "[TEST]Requested %d bytes in DCCH buffer during first call\n", dci_tbs-ta_len-header_len_dcch);
LOG_D(MAC, "DCCH dci_tbus is %d\n", dci_tbs);
//If we have space, we need to see how much data we can request at most (if any available) //If we have space, we need to see how much data we can request at most (if any available)
rlc_status = mac_rlc_status_ind(mod_id, rlc_status = mac_rlc_status_ind(mod_id,
rnti, rnti,
...@@ -524,10 +527,10 @@ schedule_ue_spec_default( ...@@ -524,10 +527,10 @@ schedule_ue_spec_default(
//If data are available in the DCCH //If data are available in the DCCH
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
LOG_D(MAC, "[TEST]Have %d bytes in buffer during first call\n", rlc_status.bytes_in_buffer); LOG_D(MAC, "[TEST]Have %d bytes in DCCH buffer during first call\n", rlc_status.bytes_in_buffer);
//Fill in as much as possible //Fill in as much as possible
data_to_request = cmin(dci_tbs-ta_len-header_len_dcch, rlc_status.bytes_in_buffer) + 1; data_to_request = cmin(dci_tbs-ta_len-header_len_dcch, rlc_status.bytes_in_buffer) + 1;
LOG_D(MAC, "[TEST]Will request %d \n", data_to_request); LOG_D(MAC, "[TEST]Will request %d from DCCH\n", data_to_request);
rlc_pdus[channels_added] = (Protocol__PrpRlcPdu *) malloc(sizeof(Protocol__PrpRlcPdu)); rlc_pdus[channels_added] = (Protocol__PrpRlcPdu *) malloc(sizeof(Protocol__PrpRlcPdu));
protocol__prp_rlc_pdu__init(rlc_pdus[channels_added]); protocol__prp_rlc_pdu__init(rlc_pdus[channels_added]);
rlc_pdus[channels_added]->n_rlc_pdu_tb = 2; rlc_pdus[channels_added]->n_rlc_pdu_tb = 2;
...@@ -1257,9 +1260,6 @@ void apply_scheduling_decisions(mid_t mod_id, ...@@ -1257,9 +1260,6 @@ void apply_scheduling_decisions(mid_t mod_id,
rlc_size = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->size; rlc_size = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->size;
LOG_D(MAC,"[TEST]Have to check %d channels\n", n_lc); LOG_D(MAC,"[TEST]Have to check %d channels\n", n_lc);
if (rlc_size > 0) { if (rlc_size > 0) {
if (lcid == 3) {
rlc_size--;
}
rlc_status = mac_rlc_status_ind(mod_id, rlc_status = mac_rlc_status_ind(mod_id,
rnti, rnti,
mod_id, mod_id,
...@@ -1283,7 +1283,7 @@ void apply_scheduling_decisions(mid_t mod_id, ...@@ -1283,7 +1283,7 @@ void apply_scheduling_decisions(mid_t mod_id,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
(char *)&dlsch_buffer[sdu_lengths[sdu_length_total]]); (char *)&dlsch_buffer[sdu_length_total]);
LOG_D(MAC, "[TEST] This is what I actually got from LCID %d -> %d\n",lcid, sdu_lengths[i]); LOG_D(MAC, "[TEST] This is what I actually got from LCID %d -> %d\n",lcid, sdu_lengths[i]);
...@@ -1302,7 +1302,8 @@ void apply_scheduling_decisions(mid_t mod_id, ...@@ -1302,7 +1302,8 @@ void apply_scheduling_decisions(mid_t mod_id,
} else { } else {
header_len_dtch = 3; header_len_dtch = 3;
} }
} }
num_sdus++; num_sdus++;
} }
} // SDU creation end } // SDU creation end
......
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