Commit 7684803c authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/nr-lc-sched' into integration_2022_wk12_a

parents de824b7b e3901a49
......@@ -58,19 +58,42 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list,
NR_UE_sched_ctrl_t *sched_ctrl) {
if (rlc_bearer2release_list) {
for (int i = 0; i < rlc_bearer2release_list->list.count; i++) {
for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) {
if (sched_ctrl->dl_lc_ids[idx] == *rlc_bearer2release_list->list.array[i]) {
const int remaining_lcs = sched_ctrl->dl_lc_num - idx - 1;
memmove(&sched_ctrl->dl_lc_ids[idx], &sched_ctrl->dl_lc_ids[idx + 1], sizeof(sched_ctrl->dl_lc_ids[idx]) * remaining_lcs);
sched_ctrl->dl_lc_num--;
break;
}
}
}
}
if (rlc_bearer2add_list) {
// keep lcids
for (int i = 0; i < rlc_bearer2add_list->list.count; i++) {
const int lcid = rlc_bearer2add_list->list.array[i]->logicalChannelIdentity;
bool found = false;
for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) {
if (sched_ctrl->dl_lc_ids[idx] == lcid) {
found = true;
break;
}
}
if (rlc_bearer2add_list)
// keep lcids
for (int i=0;i<rlc_bearer2add_list->list.count;i++) {
sched_ctrl->lcid_mask |= (1<<rlc_bearer2add_list->list.array[i]->logicalChannelIdentity);
LOG_I(NR_MAC,"Adding LCID %d (%s %d)\n",
(int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity,
rlc_bearer2add_list->list.array[i]->logicalChannelIdentity<4 ? "SRB" : "DRB",
(int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity);
if (!found) {
sched_ctrl->dl_lc_num++;
sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid;
LOG_D(NR_MAC, "Adding LCID %d (%s %d)\n", lcid, lcid < 4 ? "SRB" : "DRB", lcid);
}
}
if (rlc_bearer2release_list)
for (int i=0;i<rlc_bearer2release_list->list.count;i++)
sched_ctrl->lcid_mask |= (1<<*rlc_bearer2release_list->list.array[i]);
}
LOG_D(NR_MAC, "In %s: total num of active bearers %d) \n",
__FUNCTION__,
sched_ctrl->dl_lc_num);
}
......
......@@ -312,7 +312,9 @@ void nr_preprocessor_phytest(module_id_t module_id,
}
sched_ctrl->num_total_bytes = 0;
sched_ctrl->dl_lc_num = 1;
const int lcid = DL_SCH_LCID_DTCH;
sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid;
const uint16_t rnti = UE_info->rnti[UE_id];
/* update sched_ctrl->num_total_bytes so that postprocessor schedules data,
* if available */
......@@ -327,7 +329,6 @@ void nr_preprocessor_phytest(module_id_t module_id,
0,
0);
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
sched_ctrl->lcid_to_schedule = lcid;
uint8_t nr_of_candidates;
for (int i=0; i<5; i++) {
......
......@@ -2209,10 +2209,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
memset(sched_ctrl, 0, sizeof(*sched_ctrl));
sched_ctrl->set_mcs = TRUE;
sched_ctrl->lcid_mask = 0;
if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) {
sched_ctrl->lcid_mask = 1<<DL_SCH_LCID_DTCH;
}
sched_ctrl->ta_frame = 0;
sched_ctrl->ta_update = 31;
sched_ctrl->ta_apply = false;
......
......@@ -818,6 +818,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
UE_info->active[UE_id] = true;
process_CellGroup(ra->CellGroup, UE_scheduling_control);
} else {
LOG_A(NR_MAC,"[RAPROC] RA-Msg3 received (sdu_lenP %d)\n",sdu_lenP);
......
......@@ -603,14 +603,13 @@ typedef struct {
/// total amount of data awaiting for this UE
uint32_t num_total_bytes;
uint16_t dl_pdus_total;
/// per-LC status data
mac_rlc_status_resp_t rlc_status[MAX_NUM_LCID];
mac_rlc_status_resp_t rlc_status[NR_MAX_NUM_LCID];
/// Estimation of HARQ from BLER
NR_DL_bler_stats_t dl_bler_stats;
int lcid_mask;
int lcid_to_schedule;
uint16_t ta_frame;
int16_t ta_update;
bool ta_apply;
......@@ -646,6 +645,12 @@ typedef struct {
/// UL HARQ processes that await retransmission
NR_list_t retrans_ul_harq;
NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl;// MAC CE related information
/// number of active DL LCs
uint8_t dl_lc_num;
/// order in which DLSCH scheduler should allocate LCs
uint8_t dl_lc_ids[NR_MAX_NUM_LCID];
} NR_UE_sched_ctrl_t;
typedef struct {
......
......@@ -1149,9 +1149,9 @@ void nr_DRB_preconfiguration(uint16_t crnti)
drb_ToAddMod->pdcp_Config->drb->discardTimer = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->discardTimer));
*drb_ToAddMod->pdcp_Config->drb->discardTimer=NR_PDCP_Config__drb__discardTimer_infinity;
drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL));
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len12bits;
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits;
drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL));
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len12bits;
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits;
drb_ToAddMod->pdcp_Config->drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
drb_ToAddMod->pdcp_Config->drb->headerCompression.choice.notUsed = 0;
......@@ -1181,7 +1181,8 @@ void nr_DRB_preconfiguration(uint16_t crnti)
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
nr_rlc_bearer_init(RLC_BearerConfig,NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity);
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional);
//nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig);
Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list));
......
......@@ -94,10 +94,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
secondaryCellGroup->cellGroupId = scg_id;
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
nr_rlc_bearer_init(RLC_BearerConfig, NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity);
if (get_softmodem_params()->do_ra || get_softmodem_params()->sa)
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional);
else
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional);
//nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig);
secondaryCellGroup->rlc_BearerToAddModList = calloc(1,sizeof(*secondaryCellGroup->rlc_BearerToAddModList));
......
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