Commit f04e5d97 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/NR_UE_use_MAC_pointer_internally' into integration_2024_w06

parents 4ca52ef4 9cf44c11
...@@ -343,7 +343,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -343,7 +343,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
if (is_nr_UL_slot(mac->tdd_UL_DL_ConfigurationCommon, ul_info.slot, mac->frame_type)) { if (is_nr_UL_slot(mac->tdd_UL_DL_ConfigurationCommon, ul_info.slot, mac->frame_type)) {
LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind()\n", ul_info.slot); LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind()\n", ul_info.slot);
nr_ue_ul_scheduler(&ul_info); nr_ue_ul_scheduler(mac, &ul_info);
} }
process_queued_nr_nfapi_msgs(mac, sfn_slot); process_queued_nr_nfapi_msgs(mac, sfn_slot);
} }
......
...@@ -106,11 +106,10 @@ void set_tdd_config_nr_ue(fapi_nr_tdd_table_t *tdd_table, ...@@ -106,11 +106,10 @@ void set_tdd_config_nr_ue(fapi_nr_tdd_table_t *tdd_table,
static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, static void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
NR_ServingCellConfigCommonSIB_t *scc, NR_ServingCellConfigCommonSIB_t *scc,
module_id_t module_id,
int cc_idP) int cc_idP)
{ {
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
mac->phy_config.Mod_id = module_id; mac->phy_config.Mod_id = mac->ue_id;
mac->phy_config.CC_id = cc_idP; mac->phy_config.CC_id = cc_idP;
LOG_D(MAC, "Entering SA UE Config Common\n"); LOG_D(MAC, "Entering SA UE Config Common\n");
...@@ -245,12 +244,11 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, ...@@ -245,12 +244,11 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
static void config_common_ue(NR_UE_MAC_INST_t *mac, static void config_common_ue(NR_UE_MAC_INST_t *mac,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
module_id_t module_id,
int cc_idP) int cc_idP)
{ {
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
mac->phy_config.Mod_id = module_id; mac->phy_config.Mod_id = mac->ue_id;
mac->phy_config.CC_id = cc_idP; mac->phy_config.CC_id = cc_idP;
// carrier config // carrier config
...@@ -699,12 +697,10 @@ static void nr_configure_lc_config(NR_UE_MAC_INST_t *mac, ...@@ -699,12 +697,10 @@ static void nr_configure_lc_config(NR_UE_MAC_INST_t *mac,
lc_info->bucket_size = get_lc_bucket_size(ul_parm->prioritisedBitRate, ul_parm->bucketSizeDuration); lc_info->bucket_size = get_lc_bucket_size(ul_parm->prioritisedBitRate, ul_parm->bucketSizeDuration);
} }
static void configure_logicalChannelBearer(module_id_t module_id, static void configure_logicalChannelBearer(NR_UE_MAC_INST_t *mac,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_toadd_list, struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_toadd_list,
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_list) struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_list)
{ {
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
if (rlc_torelease_list) { if (rlc_torelease_list) {
for (int i = 0; i < rlc_torelease_list->list.count; i++) { for (int i = 0; i < rlc_torelease_list->list.count; i++) {
long id = *rlc_torelease_list->list.array[i]; long id = *rlc_torelease_list->list.array[i];
...@@ -809,7 +805,7 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id, ...@@ -809,7 +805,7 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
mac->get_sib1 = true; mac->get_sib1 = true;
else if (sched_sib == 2) else if (sched_sib == 2)
mac->get_otherSI = true; mac->get_otherSI = true;
nr_ue_decode_mib(module_id, cc_idP); nr_ue_decode_mib(mac, cc_idP);
} }
static void setup_puschpowercontrol(NR_PUSCH_PowerControl_t *source, NR_PUSCH_PowerControl_t *target) static void setup_puschpowercontrol(NR_PUSCH_PowerControl_t *source, NR_PUSCH_PowerControl_t *target)
...@@ -1363,7 +1359,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, ...@@ -1363,7 +1359,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id,
reset_mac_inst(mac); reset_mac_inst(mac);
reset_ra(&mac->ra); reset_ra(&mac->ra);
release_mac_configuration(mac); release_mac_configuration(mac);
nr_ue_init_mac(module_id); nr_ue_init_mac(mac);
// Sending to PHY a request to resync // Sending to PHY a request to resync
// with no target cell ID // with no target cell ID
...@@ -1386,7 +1382,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, ...@@ -1386,7 +1382,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
UPDATE_MAC_IE(mac->tdd_UL_DL_ConfigurationCommon, scc->tdd_UL_DL_ConfigurationCommon, NR_TDD_UL_DL_ConfigCommon_t); UPDATE_MAC_IE(mac->tdd_UL_DL_ConfigurationCommon, scc->tdd_UL_DL_ConfigurationCommon, NR_TDD_UL_DL_ConfigCommon_t);
UPDATE_MAC_IE(mac->si_SchedulingInfo, si_SchedulingInfo, NR_SI_SchedulingInfo_t); UPDATE_MAC_IE(mac->si_SchedulingInfo, si_SchedulingInfo, NR_SI_SchedulingInfo_t);
config_common_ue_sa(mac, scc, module_id, cc_idP); config_common_ue_sa(mac, scc, cc_idP);
configure_common_BWP_dl(mac, configure_common_BWP_dl(mac,
0, // bwp-id 0, // bwp-id
&scc->downlinkConfigCommon.initialDownlinkBWP); &scc->downlinkConfigCommon.initialDownlinkBWP);
...@@ -1412,7 +1408,6 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, ...@@ -1412,7 +1408,6 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
} }
static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac, static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
module_id_t module_id,
int cc_idP, int cc_idP,
const NR_ReconfigurationWithSync_t *reconfigurationWithSync) const NR_ReconfigurationWithSync_t *reconfigurationWithSync)
{ {
...@@ -1433,7 +1428,7 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac, ...@@ -1433,7 +1428,7 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
mac->physCellId = *scc->physCellId; mac->physCellId = *scc->physCellId;
mac->dmrs_TypeA_Position = scc->dmrs_TypeA_Position; mac->dmrs_TypeA_Position = scc->dmrs_TypeA_Position;
UPDATE_MAC_IE(mac->tdd_UL_DL_ConfigurationCommon, scc->tdd_UL_DL_ConfigurationCommon, NR_TDD_UL_DL_ConfigCommon_t); UPDATE_MAC_IE(mac->tdd_UL_DL_ConfigurationCommon, scc->tdd_UL_DL_ConfigurationCommon, NR_TDD_UL_DL_ConfigCommon_t);
config_common_ue(mac, scc, module_id, cc_idP); config_common_ue(mac, scc, cc_idP);
if (scc->downlinkConfigCommon) if (scc->downlinkConfigCommon)
configure_common_BWP_dl(mac, configure_common_BWP_dl(mac,
0, // bwp-id 0, // bwp-id
...@@ -1449,7 +1444,7 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac, ...@@ -1449,7 +1444,7 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
nr_ue_mac_default_configs(mac); nr_ue_mac_default_configs(mac);
if (!get_softmodem_params()->emulate_l1) { if (!get_softmodem_params()->emulate_l1) {
mac->synch_request.Mod_id = module_id; mac->synch_request.Mod_id = mac->ue_id;
mac->synch_request.CC_id = cc_idP; mac->synch_request.CC_id = cc_idP;
mac->synch_request.synch_req.target_Nid_cell = mac->physCellId; mac->synch_request.synch_req.target_Nid_cell = mac->physCellId;
mac->if_module->synch_request(&mac->synch_request); mac->if_module->synch_request(&mac->synch_request);
...@@ -1930,7 +1925,7 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id, ...@@ -1930,7 +1925,7 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id,
mac->servCellIndex = spCellConfig->servCellIndex ? *spCellConfig->servCellIndex : 0; mac->servCellIndex = spCellConfig->servCellIndex ? *spCellConfig->servCellIndex : 0;
if (spCellConfig->reconfigurationWithSync) { if (spCellConfig->reconfigurationWithSync) {
LOG_A(NR_MAC, "Received reconfigurationWithSync\n"); LOG_A(NR_MAC, "Received reconfigurationWithSync\n");
handle_reconfiguration_with_sync(mac, module_id, cc_idP, spCellConfig->reconfigurationWithSync); handle_reconfiguration_with_sync(mac, cc_idP, spCellConfig->reconfigurationWithSync);
} }
if (scd) { if (scd) {
configure_servingcell_info(&mac->sc_info, scd); configure_servingcell_info(&mac->sc_info, scd);
...@@ -1938,7 +1933,7 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id, ...@@ -1938,7 +1933,7 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id,
} }
} }
configure_logicalChannelBearer(module_id, configure_logicalChannelBearer(mac,
cell_group_config->rlc_BearerToAddModList, cell_group_config->rlc_BearerToAddModList,
cell_group_config->rlc_BearerToReleaseList); cell_group_config->rlc_BearerToReleaseList);
......
This diff is collapsed.
...@@ -53,10 +53,9 @@ void send_srb0_rrc(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data ...@@ -53,10 +53,9 @@ void send_srb0_rrc(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data
itti_send_msg_to_task(TASK_RRC_NRUE, ue_id, message_p); itti_send_msg_to_task(TASK_RRC_NRUE, ue_id, message_p);
} }
void nr_ue_init_mac(module_id_t module_idP) void nr_ue_init_mac(NR_UE_MAC_INST_t *mac)
{ {
LOG_I(NR_MAC, "[UE%d] Applying default macMainConfig\n", module_idP); LOG_I(NR_MAC, "[UE%d] Initializing MAC\n", mac->ue_id);
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
mac->first_sync_frame = -1; mac->first_sync_frame = -1;
mac->get_sib1 = false; mac->get_sib1 = false;
mac->get_otherSI = false; mac->get_otherSI = false;
...@@ -112,9 +111,9 @@ NR_UE_MAC_INST_t *nr_l2_init_ue(int nb_inst) ...@@ -112,9 +111,9 @@ NR_UE_MAC_INST_t *nr_l2_init_ue(int nb_inst)
AssertFatal(nr_ue_mac_inst, "Couldn't allocate %d instances of MAC module\n", nb_inst); AssertFatal(nr_ue_mac_inst, "Couldn't allocate %d instances of MAC module\n", nb_inst);
for (int j = 0; j < nb_inst; j++) { for (int j = 0; j < nb_inst; j++) {
nr_ue_init_mac(j);
NR_UE_MAC_INST_t *mac = get_mac_inst(j); NR_UE_MAC_INST_t *mac = get_mac_inst(j);
mac->ue_id = j; mac->ue_id = j;
nr_ue_init_mac(mac);
nr_ue_mac_default_configs(mac); nr_ue_mac_default_configs(mac);
if (get_softmodem_params()->sa) if (get_softmodem_params()->sa)
ue_init_config_request(mac, get_softmodem_params()->numerology); ue_init_config_request(mac, get_softmodem_params()->numerology);
...@@ -134,6 +133,7 @@ NR_UE_MAC_INST_t *get_mac_inst(module_id_t module_id) ...@@ -134,6 +133,7 @@ NR_UE_MAC_INST_t *get_mac_inst(module_id_t module_id)
{ {
NR_UE_MAC_INST_t *mac = &nr_ue_mac_inst[(int)module_id]; NR_UE_MAC_INST_t *mac = &nr_ue_mac_inst[(int)module_id];
AssertFatal(mac, "Couldn't get MAC inst %d\n", module_id); AssertFatal(mac, "Couldn't get MAC inst %d\n", module_id);
AssertFatal(mac->ue_id == module_id, "MAC ID %d doesn't match with input %d\n", mac->ue_id, module_id);
return mac; return mac;
} }
......
This diff is collapsed.
This diff is collapsed.
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