Commit 1fc057cb authored by Guido Casati's avatar Guido Casati

Optimize PLMN identity assignment in handover procedures

Replace field-by-field assignment with struct copy for plmn_identity.
Both source and destination use identical plmn_id_t type, making
this change safe and more maintainable.

- Reduces lines of code
- More readable and less error-prone
- Single memory copy operation instead of multiple field assignments
parent c6a06dc8
...@@ -1466,11 +1466,11 @@ void rrc_gNB_send_NGAP_HANDOVER_NOTIFY(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) ...@@ -1466,11 +1466,11 @@ void rrc_gNB_send_NGAP_HANDOVER_NOTIFY(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE)
ho_notify->gNB_ue_ngap_id = UE->rrc_ue_id; ho_notify->gNB_ue_ngap_id = UE->rrc_ue_id;
ho_notify->amf_ue_ngap_id = UE->amf_ue_ngap_id; ho_notify->amf_ue_ngap_id = UE->amf_ue_ngap_id;
ho_notify->user_info.nrCellIdentity = rrc->nr_cellid; ho_notify->user_info.nrCellIdentity = rrc->nr_cellid;
ho_notify->user_info.target_ng_ran.tac = *du->setup_req->cell->info.tac;
ho_notify->user_info.target_ng_ran.targetgNBId = rrc->node_id; target_ran_node_id_t *target_ng_ran = &ho_notify->user_info.target_ng_ran;
ho_notify->user_info.target_ng_ran.plmn_identity.mcc = du->setup_req->cell->info.plmn.mcc; target_ng_ran->tac = *du->setup_req->cell->info.tac;
ho_notify->user_info.target_ng_ran.plmn_identity.mnc = du->setup_req->cell->info.plmn.mnc; target_ng_ran->targetgNBId = rrc->node_id;
ho_notify->user_info.target_ng_ran.plmn_identity.mnc_digit_length = du->setup_req->cell->info.plmn.mnc_digit_length; target_ng_ran->plmn_identity = du->setup_req->cell->info.plmn;
itti_send_msg_to_task(TASK_NGAP, rrc->module_id, msg_p); itti_send_msg_to_task(TASK_NGAP, rrc->module_id, msg_p);
} }
...@@ -1626,10 +1626,7 @@ void rrc_gNB_send_NGAP_HANDOVER_REQUIRED(gNB_RRC_INST *rrc, ...@@ -1626,10 +1626,7 @@ void rrc_gNB_send_NGAP_HANDOVER_REQUIRED(gNB_RRC_INST *rrc,
{ {
LOG_I(NR_RRC, "Handover Preparation: send Handover Required (target gNB ID=%d, PCI=%d)\n", neighbour->gNB_ID, neighbour->physicalCellId); LOG_I(NR_RRC, "Handover Preparation: send Handover Required (target gNB ID=%d, PCI=%d)\n", neighbour->gNB_ID, neighbour->physicalCellId);
const plmn_id_t plmn = {.mcc = neighbour->plmn.mnc, const plmn_id_t plmn = neighbour->plmn;
.mnc = neighbour->plmn.mnc,
.mnc_digit_length = neighbour->plmn.mnc_digit_length};
const target_ran_node_id_t target = { const target_ran_node_id_t target = {
.plmn_identity = plmn, .plmn_identity = plmn,
.tac = neighbour->tac, .tac = neighbour->tac,
......
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