Commit 0f574c35 authored by Sakthivel Velumani's avatar Sakthivel Velumani

Create struct for MAC DL LCs

parent 0accb601
...@@ -62,9 +62,9 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo ...@@ -62,9 +62,9 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo
if (rlc_bearer2release_list) { if (rlc_bearer2release_list) {
for (int i = 0; i < rlc_bearer2release_list->list.count; i++) { for (int i = 0; i < rlc_bearer2release_list->list.count; i++) {
for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) { 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; 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--; sched_ctrl->dl_lc_num--;
break; break;
} }
...@@ -78,7 +78,7 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo ...@@ -78,7 +78,7 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo
const int lcid = rlc_bearer2add_list->list.array[i]->logicalChannelIdentity; const int lcid = rlc_bearer2add_list->list.array[i]->logicalChannelIdentity;
bool found = false; bool found = false;
for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) { 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; found = true;
break; break;
} }
...@@ -86,7 +86,7 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo ...@@ -86,7 +86,7 @@ static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddMo
if (!found) { if (!found) {
sched_ctrl->dl_lc_num++; 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); 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 ...@@ -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 */ /* loop over all activated logical channels */
// Note: DL_SCH_LCID_DCCH, DL_SCH_LCID_DCCH1, DL_SCH_LCID_DTCH // Note: DL_SCH_LCID_DCCH, DL_SCH_LCID_DCCH1, DL_SCH_LCID_DTCH
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) { 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; const uint16_t rnti = UE->rnti;
LOG_D(NR_MAC, "In %s: UE %x: LCID %d\n", __FUNCTION__, rnti, lcid); 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) { if (lcid == DL_SCH_LCID_DTCH && sched_ctrl->rrc_processing_timer > 0) {
...@@ -1247,7 +1247,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1247,7 +1247,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
if (sched_ctrl->num_total_bytes > 0) { if (sched_ctrl->num_total_bytes > 0) {
/* loop over all activated logical channels */ /* loop over all activated logical channels */
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) { 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) if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0)
continue; // no data for this LC tbs_size_t len = 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, ...@@ -99,7 +99,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
sched_ctrl->num_total_bytes = 0; sched_ctrl->num_total_bytes = 0;
sched_ctrl->dl_lc_num = 1; sched_ctrl->dl_lc_num = 1;
const int lcid = DL_SCH_LCID_DTCH; 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; const uint16_t rnti = UE->rnti;
/* update sched_ctrl->num_total_bytes so that postprocessor schedules data, /* update sched_ctrl->num_total_bytes so that postprocessor schedules data,
* if available */ * if available */
......
...@@ -238,7 +238,7 @@ static void set_nssaiConfig(const int drb_len, const f1ap_drb_to_be_setup_t *req ...@@ -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]; const f1ap_drb_to_be_setup_t *drb = &req_drbs[i];
long lcid = get_lcid_from_drbid(drb->drb_id); 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); 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 ...@@ -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); stats->ulsch_total_bytes_scheduled, stats->ul.total_bytes);
for (int i = 0; i < sched_ctrl->dl_lc_num; i++) { 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, output += snprintf(output,
end - output, end - output,
"UE %04x: LCID %d: TX %14"PRIu64" RX %14"PRIu64" bytes\n", "UE %04x: LCID %d: TX %14"PRIu64" RX %14"PRIu64" bytes\n",
......
...@@ -536,6 +536,11 @@ typedef struct NR_UE_ul_harq { ...@@ -536,6 +536,11 @@ typedef struct NR_UE_ul_harq {
NR_sched_pusch_t sched_pusch; NR_sched_pusch_t sched_pusch;
} NR_UE_ul_harq_t; } 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 */ /*! \brief scheduling control information set through an API */
#define MAX_CSI_REPORTS 48 #define MAX_CSI_REPORTS 48
typedef struct { typedef struct {
...@@ -626,15 +631,13 @@ typedef struct { ...@@ -626,15 +631,13 @@ typedef struct {
NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl; // MAC CE related information NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl; // MAC CE related information
/// number of active DL LCs /// number of active DL LCs
uint8_t dl_lc_num; uint8_t dl_lc_num;
/// order in which DLSCH scheduler should allocate LCs NR_LC_info_t dl_lc[NR_MAX_NUM_LCID];
uint8_t dl_lc_ids[NR_MAX_NUM_LCID];
/// Timer for RRC processing procedures /// Timer for RRC processing procedures
uint32_t rrc_processing_timer; uint32_t rrc_processing_timer;
/// sri, ul_ri and tpmi based on SRS /// sri, ul_ri and tpmi based on SRS
nr_srs_feedback_t srs_feedback; nr_srs_feedback_t srs_feedback;
nssai_t dl_lc_nssai[NR_MAX_NUM_LCID];
} NR_UE_sched_ctrl_t; } NR_UE_sched_ctrl_t;
typedef struct { 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