Commit 5fc5979b authored by Sakthivel Velumani's avatar Sakthivel Velumani

Create struct for MAC DL LCs

parent 6debc5dd
......@@ -62,9 +62,9 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo
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]) {
if (sched_ctrl->dl_lc[idx].id == *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);
memmove(&sched_ctrl->dl_lc[idx], &sched_ctrl->dl_lc[idx + 1], sizeof(sched_ctrl->dl_lc[idx]) * remaining_lcs);
sched_ctrl->dl_lc_num--;
break;
}
......@@ -78,7 +78,7 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo
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) {
if (sched_ctrl->dl_lc[idx].id == lcid) {
found = true;
break;
}
......@@ -86,7 +86,7 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo
if (!found) {
sched_ctrl->dl_lc_num++;
sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid;
sched_ctrl->dl_lc[sched_ctrl->dl_lc_num - 1].id = lcid;
LOG_D(NR_MAC, "Adding LCID %d (%s %d)\n", lcid, lcid < 4 ? "SRB" : "DRB", lcid);
}
}
......
......@@ -326,7 +326,7 @@ static void nr_store_dlsch_buffer(module_id_t module_id, frame_t frame, sub_fram
/* loop over all activated logical channels */
// Note: DL_SCH_LCID_DCCH, DL_SCH_LCID_DCCH1, DL_SCH_LCID_DTCH
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) {
const int lcid = sched_ctrl->dl_lc_ids[i];
const int lcid = sched_ctrl->dl_lc[i].id;
const uint16_t rnti = UE->rnti;
LOG_D(NR_MAC, "In %s: UE %x: LCID %d\n", __FUNCTION__, rnti, lcid);
if (lcid == DL_SCH_LCID_DTCH && sched_ctrl->rrc_processing_timer > 0) {
......@@ -1246,7 +1246,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
if (sched_ctrl->num_total_bytes > 0) {
/* loop over all activated logical channels */
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) {
const int lcid = sched_ctrl->dl_lc_ids[i];
const int lcid = sched_ctrl->dl_lc[i].id;
if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0)
continue; // no data for this LC tbs_size_t len = 0;
......
......@@ -99,7 +99,7 @@ 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;
sched_ctrl->dl_lc[sched_ctrl->dl_lc_num - 1].id = lcid;
const uint16_t rnti = UE->rnti;
/* update sched_ctrl->num_total_bytes so that postprocessor schedules data,
* if available */
......
......@@ -238,7 +238,7 @@ static void set_nssaiConfig(const int drb_len, const f1ap_drb_to_be_setup_t *req
const f1ap_drb_to_be_setup_t *drb = &req_drbs[i];
long lcid = get_lcid_from_drbid(drb->drb_id);
sched_ctrl->dl_lc_nssai[lcid] = drb->nssai;
sched_ctrl->dl_lc[lcid].nssai = drb->nssai;
LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for DRB: %ld\n", drb->nssai.sst, drb->nssai.sd, drb->drb_id);
}
}
......
......@@ -166,7 +166,7 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
stats->ulsch_total_bytes_scheduled, stats->ul.total_bytes);
for (int i = 0; i < sched_ctrl->dl_lc_num; i++) {
int lc_id = sched_ctrl->dl_lc_ids[i];
int lc_id = sched_ctrl->dl_lc[i].id;
output += snprintf(output,
end - output,
"UE %04x: LCID %d: TX %14"PRIu64" RX %14"PRIu64" bytes\n",
......
......@@ -536,6 +536,11 @@ typedef struct NR_UE_ul_harq {
NR_sched_pusch_t sched_pusch;
} NR_UE_ul_harq_t;
typedef struct {
uint8_t id;
nssai_t nssai;
} NR_LC_info_t;
/*! \brief scheduling control information set through an API */
#define MAX_CSI_REPORTS 48
typedef struct {
......@@ -626,15 +631,13 @@ typedef struct {
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_LC_info_t dl_lc[NR_MAX_NUM_LCID];
/// Timer for RRC processing procedures
uint32_t rrc_processing_timer;
/// sri, ul_ri and tpmi based on SRS
nr_srs_feedback_t srs_feedback;
nssai_t dl_lc_nssai[NR_MAX_NUM_LCID];
} NR_UE_sched_ctrl_t;
typedef struct {
......
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