Commit dcdee083 authored by Robert Schmidt's avatar Robert Schmidt

PreProc IF: RLC status per UE

parent d12180b2
...@@ -425,30 +425,14 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id, ...@@ -425,30 +425,14 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
const int UE_id = 0; const int UE_id = 0;
const int CC_id = 0; const int CC_id = 0;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
// TODO: reset per UE-info
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
sched_ctrl->search_space = get_searchspace(sched_ctrl->active_bwp, target_ss);
}
void nr_schedule_ue_spec(module_id_t module_id,
frame_t frame,
sub_frame_t slot,
int num_slots_per_tdd) {
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
NR_UE_list_t *UE_list = &gNB_mac->UE_list;
if (UE_list->num_UEs == 0)
return;
const int ta_len = gNB_mac->ta_len; // TODO: reset per UE-info
const int UE_id = 0;
const int CC_id = 0;
/* Retrieve amount of data to send for this UE */ /* Retrieve amount of data to send for this UE */
sched_ctrl->num_total_bytes = 0;
const int lcid = DL_SCH_LCID_DTCH; const int lcid = DL_SCH_LCID_DTCH;
const uint16_t rnti = UE_list->rnti[UE_id]; const uint16_t rnti = UE_list->rnti[UE_id];
const mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(module_id, sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id,
rnti, rnti,
module_id, module_id,
frame, frame,
...@@ -458,19 +442,40 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -458,19 +442,40 @@ void nr_schedule_ue_spec(module_id_t module_id,
lcid, lcid,
0, 0,
0); 0);
if (rlc_status.bytes_in_buffer == 0 && !get_softmodem_params()->phy_test) sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
if (sched_ctrl->num_total_bytes == 0 && !get_softmodem_params()->phy_test)
return; return;
LOG_D(MAC, LOG_D(MAC,
"%d.%d, DTCH%d->DLSCH, RLC status %d bytes\n", "%d.%d, DTCH%d->DLSCH, RLC status %d bytes\n",
frame, frame,
slot, slot,
lcid, lcid,
rlc_status.bytes_in_buffer); sched_ctrl->rlc_status[lcid].bytes_in_buffer);
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
sched_ctrl->search_space = get_searchspace(sched_ctrl->active_bwp, target_ss);
}
void nr_schedule_ue_spec(module_id_t module_id,
frame_t frame,
sub_frame_t slot,
int num_slots_per_tdd) {
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
NR_UE_list_t *UE_list = &gNB_mac->UE_list;
if (UE_list->num_UEs == 0)
return;
/* PREPROCESSOR */ /* PREPROCESSOR */
nr_simple_dlsch_preprocessor(module_id, frame, slot, num_slots_per_tdd); nr_simple_dlsch_preprocessor(module_id, frame, slot, num_slots_per_tdd);
const int ta_len = gNB_mac->ta_len;
const int UE_id = 0;
const int CC_id = 0;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
if (sched_ctrl->num_total_bytes == 0 && !get_softmodem_params()->phy_test)
return;
//if (sched_ctrl->rbSize < 0 && !get_softmodem_params()->phy_test) //if (sched_ctrl->rbSize < 0 && !get_softmodem_params()->phy_test)
// return; // return;
...@@ -556,7 +561,9 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -556,7 +561,9 @@ void nr_schedule_ue_spec(module_id_t module_id,
uint16_t sdu_lengths[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0};
uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES]; uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES];
unsigned char sdu_lcids[NB_RB_MAX] = {0}; unsigned char sdu_lcids[NB_RB_MAX] = {0};
if (rlc_status.bytes_in_buffer > 0) { const rnti_t rnti = UE_list->rnti[UE_id];
const int lcid = DL_SCH_LCID_DTCH;
if (sched_ctrl->num_total_bytes > 0) {
LOG_D(MAC, LOG_D(MAC,
"[gNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting " "[gNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting "
"%d bytes from RLC (lcid %d total hdr len %d), TBS: %d \n \n", "%d bytes from RLC (lcid %d total hdr len %d), TBS: %d \n \n",
......
...@@ -283,6 +283,11 @@ typedef struct NR_UE_ul_harq { ...@@ -283,6 +283,11 @@ typedef struct NR_UE_ul_harq {
/*! \brief scheduling control information set through an API */ /*! \brief scheduling control information set through an API */
typedef struct { typedef struct {
/// total amount of data awaiting for this UE
uint32_t num_total_bytes;
/// per-LC status data
mac_rlc_status_resp_t rlc_status[MAX_NUM_LCID];
/// the currently active BWP in DL /// the currently active BWP in DL
NR_BWP_Downlink_t *active_bwp; NR_BWP_Downlink_t *active_bwp;
NR_sched_pucch *sched_pucch; NR_sched_pucch *sched_pucch;
......
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