Configure CU/DU UE IDs in NSA/do-ra/phytest
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "openair2/RRC/LTE/rrc_eNB_GTPV1U.h"
|
||||
#include "openair2/F1AP/f1ap_ids.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/nr-softmodem.h"
|
||||
#include <openair2/RRC/NR/rrc_gNB_UE_context.h>
|
||||
@@ -342,19 +343,30 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(0), msg); //Check right id instead of hardcoding
|
||||
}
|
||||
|
||||
// below we configure the stack. In SA, we fully adopted F1, meaning that
|
||||
// layers use different IDs (MAC/RLC use RNTI as DU UE ID, above use NGAP ID
|
||||
// as CU UE ID.
|
||||
uint32_t du_ue_id = ue_context_p->ue_context.rnti;
|
||||
uint32_t cu_ue_id = ue_context_p->ue_context.rnti;
|
||||
f1_ue_data_t du_ue_data = {.secondary_ue = cu_ue_id};
|
||||
du_add_f1_ue_data(du_ue_id, &du_ue_data);
|
||||
f1_ue_data_t cu_ue_data = {.secondary_ue = du_ue_id};
|
||||
cu_add_f1_ue_data(cu_ue_id, &cu_ue_data);
|
||||
LOG_I(RRC, "Assign CU UE ID %d and DU UE ID %d to UE RNTI %04x\n", cu_ue_id, du_ue_id, ue_context_p->ue_context.rnti);
|
||||
|
||||
// configure MAC and RLC
|
||||
bool ret = false;
|
||||
if (get_softmodem_params()->phy_test) {
|
||||
// phytest mode: we don't set up RA, etc
|
||||
ret = nr_mac_add_test_ue(RC.nrmac[rrc->module_id] , ue_context_p->ue_context.rnti, ue_context_p->ue_context.secondaryCellGroup);
|
||||
ret = nr_mac_add_test_ue(RC.nrmac[rrc->module_id], du_ue_id, ue_context_p->ue_context.secondaryCellGroup);
|
||||
} else {
|
||||
NR_SCHED_LOCK(&RC.nrmac[rrc->module_id]->sched_lock);
|
||||
ret = nr_mac_prepare_ra_ue(RC.nrmac[rrc->module_id], ue_context_p->ue_context.rnti, ue_context_p->ue_context.secondaryCellGroup);
|
||||
ret = nr_mac_prepare_ra_ue(RC.nrmac[rrc->module_id], du_ue_id, ue_context_p->ue_context.secondaryCellGroup);
|
||||
NR_SCHED_UNLOCK(&RC.nrmac[rrc->module_id]->sched_lock);
|
||||
}
|
||||
AssertFatal(ret, "cannot add NSA UE in MAC, aborting\n");
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0, rrc->module_id);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, cu_ue_id, 0, 0, rrc->module_id);
|
||||
if (get_softmodem_params()->do_ra) ctxt.enb_flag = 0;
|
||||
LOG_W(RRC,
|
||||
"Calling RRC PDCP/RLC ASN1 request functions for protocol context %p with module_id %d, rnti %lx, frame %d, subframe %d eNB_index %d \n",
|
||||
@@ -366,7 +378,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
ctxt.eNB_index);
|
||||
|
||||
nr_pdcp_add_drbs(ctxt.enb_flag,
|
||||
ctxt.rntiMaybeUEid,
|
||||
cu_ue_id,
|
||||
0,
|
||||
ue_context_p->ue_context.rb_config->drb_ToAddModList,
|
||||
(ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm,
|
||||
@@ -374,6 +386,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
kUPint,
|
||||
ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList);
|
||||
|
||||
ctxt.rntiMaybeUEid = du_ue_id;
|
||||
// assume only a single bearer
|
||||
const NR_DRB_ToAddModList_t *drb_list = ue_context_p->ue_context.rb_config->drb_ToAddModList;
|
||||
DevAssert(drb_list->list.count == 1);
|
||||
|
||||
Reference in New Issue
Block a user