Required changes/modifications are done at both eNB and gNB side
This commit is contained in:
@@ -40,6 +40,10 @@
|
||||
#include "rrc_types.h"
|
||||
//#include "PHY/phy_defs.h"
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "RRC/NR/nr_rrc_types.h"
|
||||
#include "NR_UE-MRDC-Capability.h"
|
||||
#include "NR_UE-NR-Capability.h"
|
||||
|
||||
|
||||
#include "COMMON/platform_constants.h"
|
||||
#include "COMMON/platform_types.h"
|
||||
@@ -569,6 +573,10 @@ typedef struct eNB_RRC_UE_s {
|
||||
|
||||
LTE_UE_EUTRA_Capability_t *UE_Capability;
|
||||
int UE_Capability_size;
|
||||
NR_UE_MRDC_Capability_t *UE_Capability_MRDC;
|
||||
int UE_MRDC_Capability_size;
|
||||
NR_UE_NR_Capability_t *UE_Capability_nr;
|
||||
int UE_NR_Capability_size;
|
||||
ImsiMobileIdentity_t imsi;
|
||||
|
||||
/* KeNB as derived from KASME received from EPC */
|
||||
@@ -614,7 +622,7 @@ typedef struct eNB_RRC_UE_s {
|
||||
/* Number of e_rab to be modified in the list */
|
||||
uint8_t nb_of_modify_e_rabs;
|
||||
uint8_t nb_of_failed_e_rabs;
|
||||
uint8_t nb_of_modify_endc_e_rabs;
|
||||
uint8_t nb_of_modify_endc_e_rabs;
|
||||
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||
|
||||
+429
-423
File diff suppressed because it is too large
Load Diff
+51
-91
@@ -95,12 +95,10 @@ mui_t rrc_gNB_mui = 0;
|
||||
|
||||
void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) {
|
||||
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",PROTOCOL_NR_RRC_CTXT_ARGS(ctxt_pP));
|
||||
|
||||
rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier.SI, BCCH, 1);
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier.SI.Active = 1;
|
||||
rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier.Srb0, CCCH, 1);
|
||||
RC.nrrrc[ctxt_pP->module_id]->carrier.Srb0.Active = 1;
|
||||
|
||||
}
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
@@ -173,7 +171,6 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
|
||||
ue_context_pP->ue_context.primaryCC_id,
|
||||
physicalCellGroupConfig,
|
||||
physicalcellgroup_config);
|
||||
|
||||
do_SpCellConfig(RC.nrrrc[ctxt_pP->module_id],
|
||||
spCellConfig);
|
||||
}
|
||||
@@ -182,57 +179,47 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
|
||||
static void init_NR_SI(gNB_RRC_INST *rrc) {
|
||||
|
||||
|
||||
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
|
||||
|
||||
|
||||
|
||||
rrc->carrier.MIB = (uint8_t*) malloc16(4);
|
||||
rrc->carrier.MIB = (uint8_t *) malloc16(4);
|
||||
rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0);
|
||||
|
||||
|
||||
LOG_I(NR_RRC,"Done init_NR_SI\n");
|
||||
|
||||
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.pdsch_AntennaPorts,
|
||||
(NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon,
|
||||
0,
|
||||
0, // WIP hardcoded rnti
|
||||
(NR_CellGroupConfig_t *)NULL
|
||||
);
|
||||
|
||||
0,
|
||||
0, // WIP hardcoded rnti
|
||||
(NR_CellGroupConfig_t *)NULL
|
||||
);
|
||||
|
||||
if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) {
|
||||
// This is for phytest only, emulate first X2 message if uecap.raw file is present
|
||||
FILE *fd;
|
||||
|
||||
fd = fopen("uecap.raw","r");
|
||||
|
||||
if (fd != NULL) {
|
||||
char buffer[4096];
|
||||
int msg_len=fread(buffer,1,4096,fd);
|
||||
LOG_I(RRC,"Read in %d bytes for uecap\n",msg_len);
|
||||
LTE_UL_DCCH_Message_t *LTE_UL_DCCH_Message;
|
||||
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_LTE_UL_DCCH_Message,
|
||||
(void **)<E_UL_DCCH_Message,
|
||||
(uint8_t *)buffer,
|
||||
msg_len);
|
||||
|
||||
&asn_DEF_LTE_UL_DCCH_Message,
|
||||
(void **)<E_UL_DCCH_Message,
|
||||
(uint8_t *)buffer,
|
||||
msg_len);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message, 1 );
|
||||
return;
|
||||
}
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message, 1 );
|
||||
return;
|
||||
}
|
||||
|
||||
fclose(fd);
|
||||
xer_fprint(stdout,&asn_DEF_LTE_UL_DCCH_Message, LTE_UL_DCCH_Message);
|
||||
// recreate enough of X2 EN-DC Container
|
||||
AssertFatal(LTE_UL_DCCH_Message->message.choice.c1.present == LTE_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation,
|
||||
"ueCapabilityInformation not present\n");
|
||||
"ueCapabilityInformation not present\n");
|
||||
NR_CG_ConfigInfo_t *CG_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo));
|
||||
CG_ConfigInfo->criticalExtensions.present = NR_CG_ConfigInfo__criticalExtensions_PR_c1;
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1 = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1));
|
||||
@@ -240,42 +227,37 @@ static void init_NR_SI(gNB_RRC_INST *rrc) {
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo));
|
||||
NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo;
|
||||
cg_ConfigInfo->ue_CapabilityInfo = calloc(1,sizeof(*cg_ConfigInfo->ue_CapabilityInfo));
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,NULL,(void*)<E_UL_DCCH_Message->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList,buffer,4096);
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,NULL,
|
||||
(void *)<E_UL_DCCH_Message->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList,buffer,4096);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
OCTET_STRING_fromBuf(cg_ConfigInfo->ue_CapabilityInfo,
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
parse_CG_ConfigInfo(rrc,CG_ConfigInfo,NULL);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(rrc);
|
||||
|
||||
LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p);
|
||||
LOG_I(NR_RRC,"Adding new user (%p)\n",ue_context_p);
|
||||
rrc_add_nsa_user(rrc,ue_context_p,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigurationReq *configuration) {
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
gNB_RRC_INST *rrc=RC.nrrrc[gnb_mod_idP];
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, GNB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP);
|
||||
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_FMT" Init...\n",
|
||||
PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
|
||||
|
||||
AssertFatal(rrc != NULL, "RC.nrrrc not initialized!");
|
||||
AssertFatal(NUMBER_OF_UE_MAX < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
|
||||
AssertFatal(configuration!=NULL,"configuration input is null\n");
|
||||
rrc->module_id = gnb_mod_idP;
|
||||
rrc->Nb_ue = 0;
|
||||
|
||||
rrc->carrier.Srb0.Active = 0;
|
||||
|
||||
nr_uid_linear_allocator_init(&rrc->uid_allocator);
|
||||
RB_INIT(&rrc->rrc_ue_head);
|
||||
rrc->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
@@ -285,7 +267,6 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
|
||||
rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts;
|
||||
/// System Information INIT
|
||||
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" Checking release \n",PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
|
||||
|
||||
init_NR_SI(rrc);
|
||||
rrc_init_nr_global_param();
|
||||
openair_nr_rrc_on(&ctxt);
|
||||
@@ -294,46 +275,26 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
|
||||
|
||||
|
||||
void rrc_gNB_process_AdditionRequestInformation(const module_id_t gnb_mod_idP, x2ap_ENDC_sgnb_addition_req_t *m) {
|
||||
struct NR_CG_ConfigInfo *cg_configinfo = NULL;
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
|
||||
&asn_DEF_NR_CG_ConfigInfo,
|
||||
(void **)&cg_configinfo,
|
||||
(uint8_t *)m->rrc_buffer,
|
||||
(int) m->rrc_buffer_size);//m->rrc_buffer_size);
|
||||
gNB_RRC_INST *rrc=RC.nrrrc[gnb_mod_idP];
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free(&asn_DEF_NR_CG_ConfigInfo, cg_configinfo, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
//LTE_UL_DCCH_Message_t *LTE_UL_DCCH_Message = NULL;
|
||||
struct NR_CG_ConfigInfo *cg_configinfo = NULL;
|
||||
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_CG_ConfigInfo,
|
||||
(void **)&cg_configinfo,
|
||||
(uint8_t *)m->rrc_buffer,
|
||||
(int) m->rrc_buffer_size);//m->rrc_buffer_size);
|
||||
|
||||
gNB_RRC_INST *rrc=RC.nrrrc[gnb_mod_idP];
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"NR_UL_DCCH_MESSAGE decode error\n");
|
||||
// free the memory
|
||||
SEQUENCE_free(&asn_DEF_NR_CG_ConfigInfo, cg_configinfo, 1);
|
||||
return;
|
||||
}
|
||||
xer_fprint(stdout,&asn_DEF_NR_CG_ConfigInfo, cg_configinfo);
|
||||
// recreate enough of X2 EN-DC Container
|
||||
AssertFatal(cg_configinfo->criticalExtensions.choice.c1->present == NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo,
|
||||
"ueCapabilityInformation not present\n");
|
||||
#if 0
|
||||
NR_CG_ConfigInfo_t *CG_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo));
|
||||
CG_ConfigInfo->criticalExtensions.present = NR_CG_ConfigInfo__criticalExtensions_PR_c1;
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1 = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1));
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1->present = NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo;
|
||||
CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo = calloc(1,sizeof(*CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo));
|
||||
NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo;
|
||||
cg_ConfigInfo->ue_CapabilityInfo = calloc(1,sizeof(*cg_ConfigInfo->ue_CapabilityInfo));
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,NULL,(void*)<E_UL_DCCH_Message->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList,m->rrc_buffer,m->rrc_buffer_size);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
OCTET_STRING_fromBuf(cg_ConfigInfo->ue_CapabilityInfo,
|
||||
(const char *)m->rrc_buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
#endif
|
||||
parse_CG_ConfigInfo(rrc,cg_configinfo,m);
|
||||
|
||||
xer_fprint(stdout,&asn_DEF_NR_CG_ConfigInfo, cg_configinfo);
|
||||
// recreate enough of X2 EN-DC Container
|
||||
AssertFatal(cg_configinfo->criticalExtensions.choice.c1->present == NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo,
|
||||
"ueCapabilityInformation not present\n");
|
||||
parse_CG_ConfigInfo(rrc,cg_configinfo,m);
|
||||
}
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
@@ -431,16 +392,15 @@ void *rrc_gnb_task(void *args_p) {
|
||||
openair_rrc_gNB_configuration(GNB_INSTANCE_TO_MODULE_ID(instance), &NRRRC_CONFIGURATION_REQ(msg_p));
|
||||
break;
|
||||
|
||||
/* Messages from X2AP */
|
||||
/* Messages from X2AP */
|
||||
case X2AP_ENDC_SGNB_ADDITION_REQ:
|
||||
LOG_I(NR_RRC, "Received ENDC sgNB addition request from X2AP \n");
|
||||
rrc_gNB_process_AdditionRequestInformation(GNB_INSTANCE_TO_MODULE_ID(instance), &X2AP_ENDC_SGNB_ADDITION_REQ(msg_p));
|
||||
break;
|
||||
LOG_I(NR_RRC, "Received ENDC sgNB addition request from X2AP \n");
|
||||
rrc_gNB_process_AdditionRequestInformation(GNB_INSTANCE_TO_MODULE_ID(instance), &X2AP_ENDC_SGNB_ADDITION_REQ(msg_p));
|
||||
break;
|
||||
|
||||
case X2AP_ENDC_SGNB_RECONF_COMPLETE:
|
||||
LOG_I(NR_RRC, "Handling of reconfiguration complete message at RRC gNB is pending \n");
|
||||
break;
|
||||
|
||||
LOG_I(NR_RRC, "Handling of reconfiguration complete message at RRC gNB is pending \n");
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(NR_RRC, "[gNB %d] Received unexpected message %s\n", instance, msg_name_p);
|
||||
|
||||
@@ -39,47 +39,48 @@
|
||||
#include "NR_CG-Config.h"
|
||||
|
||||
int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2ap_ENDC_sgnb_addition_req_t *m) {
|
||||
|
||||
if (CG_ConfigInfo->criticalExtensions.present == NR_CG_ConfigInfo__criticalExtensions_PR_c1) {
|
||||
if (CG_ConfigInfo->criticalExtensions.choice.c1) {
|
||||
if (CG_ConfigInfo->criticalExtensions.choice.c1->present == NR_CG_ConfigInfo__criticalExtensions__c1_PR_cg_ConfigInfo) {
|
||||
NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo;
|
||||
if (cg_ConfigInfo->ue_CapabilityInfo) {
|
||||
// Decode UE-CapabilityRAT-ContainerList
|
||||
NR_CG_ConfigInfo_IEs_t *cg_ConfigInfo = CG_ConfigInfo->criticalExtensions.choice.c1->choice.cg_ConfigInfo;
|
||||
|
||||
if (cg_ConfigInfo->ue_CapabilityInfo) {
|
||||
// Decode UE-CapabilityRAT-ContainerList
|
||||
LTE_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList=NULL;
|
||||
asn_dec_rval_t dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,
|
||||
(void**)&UE_CapabilityRAT_ContainerList,
|
||||
cg_ConfigInfo->ue_CapabilityInfo->buf,
|
||||
cg_ConfigInfo->ue_CapabilityInfo->size, 0, 0);
|
||||
UE_CapabilityRAT_ContainerList = calloc(1,sizeof(LTE_UE_CapabilityRAT_ContainerList_t));
|
||||
asn_dec_rval_t dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_LTE_UE_CapabilityRAT_ContainerList,
|
||||
(void **)&UE_CapabilityRAT_ContainerList,
|
||||
cg_ConfigInfo->ue_CapabilityInfo->buf,
|
||||
cg_ConfigInfo->ue_CapabilityInfo->size, 0, 0);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"[InterNode] Failed to decode NR_UE_CapabilityRAT_ContainerList (%zu bits), size of OCTET_STRING %lu\n",
|
||||
dec_rval.consumed, cg_ConfigInfo->ue_CapabilityInfo->size);
|
||||
}
|
||||
rrc_parse_ue_capabilities(rrc,UE_CapabilityRAT_ContainerList, m,cg_ConfigInfo);
|
||||
}
|
||||
if (cg_ConfigInfo->candidateCellInfoListMN) AssertFatal(1==0,"Can't handle candidateCellInfoListMN yet\n");
|
||||
}
|
||||
else AssertFatal(1==0,"c1 extension is not cg_ConfigInfo, returning\n");
|
||||
}
|
||||
else {
|
||||
AssertFatal(1==0,"[InterNode] Failed to decode NR_UE_CapabilityRAT_ContainerList (%zu bits), size of OCTET_STRING %lu\n",
|
||||
dec_rval.consumed, cg_ConfigInfo->ue_CapabilityInfo->size);
|
||||
}
|
||||
|
||||
rrc_parse_ue_capabilities(rrc,UE_CapabilityRAT_ContainerList, m,cg_ConfigInfo);
|
||||
}
|
||||
|
||||
if (cg_ConfigInfo->candidateCellInfoListMN) AssertFatal(1==0,"Can't handle candidateCellInfoListMN yet\n");
|
||||
} else AssertFatal(1==0,"c1 extension is not cg_ConfigInfo, returning\n");
|
||||
} else {
|
||||
LOG_E(RRC,"c1 extension not found, returning\n");
|
||||
return(-1);
|
||||
return(-1);
|
||||
}
|
||||
} else {
|
||||
LOG_E(RRC,"Ignoring unknown CG_ConfigInfo extensions\n");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
NR_CG_Config_t *cg_Config,
|
||||
NR_RRCReconfiguration_t *reconfig,
|
||||
NR_RadioBearerConfig_t *rbconfig) {
|
||||
|
||||
|
||||
int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
NR_CG_Config_t *cg_Config,
|
||||
NR_RRCReconfiguration_t *reconfig,
|
||||
NR_RadioBearerConfig_t *rbconfig) {
|
||||
cg_Config->criticalExtensions.present = NR_CG_Config__criticalExtensions_PR_c1;
|
||||
cg_Config->criticalExtensions.choice.c1 = calloc(1,sizeof(*cg_Config->criticalExtensions.choice.c1));
|
||||
cg_Config->criticalExtensions.choice.c1->present = NR_CG_Config__criticalExtensions__c1_PR_cg_Config;
|
||||
@@ -91,36 +92,37 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig = calloc(1,sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_CellGroupConfig,
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
total_size = (enc_rval.encoded+7)>>3;
|
||||
|
||||
LOG_I(RRC,"Dumping NR_RRCReconfiguration message (%jd bytes)\n",(enc_rval.encoded+7)>>3);
|
||||
for (int i=0;i<(enc_rval.encoded+7)>>3;i++) {
|
||||
|
||||
for (int i=0; i<(enc_rval.encoded+7)>>3; i++) {
|
||||
printf("%02x",((uint8_t *)buffer)[i]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
FILE *fd = fopen("reconfig.raw","w");
|
||||
fwrite((void*)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
|
||||
fwrite((void *)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
|
||||
fclose(fd);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_RadioBearerConfig, NULL, (void *)rbconfig, buffer, 1024);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config = calloc(1,sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(cg_Config->criticalExtensions.choice.c1->choice.cg_Config->scg_RB_Config,
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
(const char *)buffer,
|
||||
(enc_rval.encoded+7)>>3);
|
||||
LOG_I(RRC,"Dumping scg_RB_Config message (%jd bytes)\n",(enc_rval.encoded+7)>>3);
|
||||
for (int i=0;i<(enc_rval.encoded+7)>>3;i++) {
|
||||
printf("%02x",((uint8_t*)buffer)[i]);
|
||||
|
||||
for (int i=0; i<(enc_rval.encoded+7)>>3; i++) {
|
||||
printf("%02x",((uint8_t *)buffer)[i]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
fd = fopen("rbconfig.raw","w");
|
||||
fwrite((void*)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
|
||||
fwrite((void *)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
|
||||
fclose(fd);
|
||||
total_size = total_size + ((enc_rval.encoded+7)>>3);
|
||||
|
||||
return(total_size);
|
||||
}
|
||||
|
||||
|
||||
+112
-126
@@ -40,7 +40,6 @@
|
||||
#include "openair2/RRC/LTE/rrc_eNB_GTPV1U.h"
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, LTE_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) {
|
||||
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
|
||||
OCTET_STRING_t *ueCapabilityRAT_Container_nr = NULL;
|
||||
OCTET_STRING_t *ueCapabilityRAT_Container_MRDC = NULL;
|
||||
@@ -48,10 +47,11 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, LTE_UE_CapabilityRAT_Container
|
||||
asn_dec_rval_t dec_rval;
|
||||
AssertFatal(UE_CapabilityRAT_ContainerList!=NULL,"UE_CapabilityRAT_ContainerList is null\n");
|
||||
AssertFatal((list_size=UE_CapabilityRAT_ContainerList->list.count) >= 2, "UE_CapabilityRAT_ContainerList->list.size %d < 2\n",UE_CapabilityRAT_ContainerList->list.count);
|
||||
for (int i=0;i<list_size;i++) {
|
||||
|
||||
for (int i=0; i<list_size; i++) {
|
||||
if (UE_CapabilityRAT_ContainerList->list.array[i]->rat_Type == LTE_RAT_Type_nr) ueCapabilityRAT_Container_nr = &UE_CapabilityRAT_ContainerList->list.array[i]->ueCapabilityRAT_Container;
|
||||
else if (UE_CapabilityRAT_ContainerList->list.array[i]->rat_Type == LTE_RAT_Type_eutra_nr) ueCapabilityRAT_Container_MRDC = &UE_CapabilityRAT_ContainerList->list.array[i]->ueCapabilityRAT_Container;
|
||||
}
|
||||
}
|
||||
|
||||
// decode and store capabilities
|
||||
ue_context_p = rrc_gNB_allocate_new_UE_context(rrc);
|
||||
@@ -65,10 +65,10 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, LTE_UE_CapabilityRAT_Container
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC, "Failed to decode UE NR capabilities (%zu bytes) container size %lu\n", dec_rval.consumed,ueCapabilityRAT_Container_nr->size);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,
|
||||
ue_context_p->ue_context.UE_Capability_nr);
|
||||
ue_context_p->ue_context.UE_Capability_nr = 0;
|
||||
AssertFatal(1==0,"exiting\n");
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,
|
||||
ue_context_p->ue_context.UE_Capability_nr);
|
||||
ue_context_p->ue_context.UE_Capability_nr = 0;
|
||||
AssertFatal(1==0,"exiting\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,172 +80,158 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, LTE_UE_CapabilityRAT_Container
|
||||
ueCapabilityRAT_Container_MRDC->size, 0, 0);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
LOG_E(RRC, "Failed to decode UE MRDC capabilities (%zu bytes)\n", dec_rval.consumed);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_MRDC_Capability,
|
||||
ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
ue_context_p->ue_context.UE_Capability_MRDC = 0;
|
||||
AssertFatal(1==0,"exiting\n");
|
||||
LOG_E(RRC, "Failed to decode UE MRDC capabilities (%zu bytes)\n", dec_rval.consumed);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_UE_MRDC_Capability,
|
||||
ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
ue_context_p->ue_context.UE_Capability_MRDC = 0;
|
||||
AssertFatal(1==0,"exiting\n");
|
||||
}
|
||||
}
|
||||
|
||||
// dump ue_capabilities
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1 && ueCapabilityRAT_Container_nr != NULL) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_UE_NR_Capability, ue_context_p->ue_context.UE_Capability_nr);
|
||||
}
|
||||
xer_fprint(stdout, &asn_DEF_NR_UE_NR_Capability, ue_context_p->ue_context.UE_Capability_nr);
|
||||
}
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1 && ueCapabilityRAT_Container_MRDC != NULL) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_UE_MRDC_Capability, ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
}
|
||||
|
||||
if(cg_config_info->mcg_RB_Config) {
|
||||
asn_dec_rval_t dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_RadioBearerConfig,
|
||||
(void**)&ue_context_p->ue_context.rb_config,
|
||||
cg_config_info->mcg_RB_Config->buf,
|
||||
cg_config_info->mcg_RB_Config->size, 0, 0);
|
||||
|
||||
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"[InterNode] Failed to decode mcg_rb_config (%zu bits), size of OCTET_STRING %lu\n",
|
||||
dec_rval.consumed, cg_config_info->mcg_RB_Config->size);
|
||||
xer_fprint(stdout, &asn_DEF_NR_UE_MRDC_Capability, ue_context_p->ue_context.UE_Capability_MRDC);
|
||||
}
|
||||
|
||||
if(cg_config_info && cg_config_info->mcg_RB_Config) {
|
||||
asn_dec_rval_t dec_rval = uper_decode(NULL,
|
||||
&asn_DEF_NR_RadioBearerConfig,
|
||||
(void **)&ue_context_p->ue_context.rb_config,
|
||||
cg_config_info->mcg_RB_Config->buf,
|
||||
cg_config_info->mcg_RB_Config->size, 0, 0);
|
||||
|
||||
if((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
AssertFatal(1==0,"[InterNode] Failed to decode mcg_rb_config (%zu bits), size of OCTET_STRING %lu\n",
|
||||
dec_rval.consumed, cg_config_info->mcg_RB_Config->size);
|
||||
}
|
||||
}
|
||||
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)ue_context_p->ue_context.rb_config);
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *)ue_context_p->ue_context.rb_config);
|
||||
rrc_add_nsa_user(rrc,ue_context_p, m);
|
||||
}
|
||||
|
||||
void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_p, x2ap_ENDC_sgnb_addition_req_t *m) {
|
||||
|
||||
// generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331)
|
||||
|
||||
// generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331)
|
||||
rrc_gNB_carrier_data_t *carrier=&rrc->carrier;
|
||||
|
||||
MessageDef *msg;
|
||||
msg = itti_alloc_new_message(TASK_RRC_ENB, X2AP_ENDC_SGNB_ADDITION_REQ_ACK);
|
||||
gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
// NR RRCReconfiguration
|
||||
|
||||
// NR RRCReconfiguration
|
||||
AssertFatal(rrc->Nb_ue < MAX_NR_RRC_UE_CONTEXTS,"cannot add another UE\n");
|
||||
|
||||
ue_context_p->ue_context.reconfig = calloc(1,sizeof(NR_RRCReconfiguration_t));
|
||||
ue_context_p->ue_context.secondaryCellGroup = calloc(1,sizeof(NR_CellGroupConfig_t));
|
||||
memset((void*)ue_context_p->ue_context.reconfig,0,sizeof(NR_RRCReconfiguration_t));
|
||||
memset((void *)ue_context_p->ue_context.reconfig,0,sizeof(NR_RRCReconfiguration_t));
|
||||
ue_context_p->ue_context.reconfig->rrc_TransactionIdentifier=0;
|
||||
ue_context_p->ue_context.reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
|
||||
NR_RRCReconfiguration_IEs_t *reconfig_ies=calloc(1,sizeof(NR_RRCReconfiguration_IEs_t));
|
||||
ue_context_p->ue_context.reconfig->criticalExtensions.choice.rrcReconfiguration = reconfig_ies;
|
||||
carrier->initial_csi_index[rrc->Nb_ue] = 0;
|
||||
fill_default_reconfig(carrier->servingcellconfigcommon,
|
||||
reconfig_ies,
|
||||
ue_context_p->ue_context.secondaryCellGroup,
|
||||
carrier->pdsch_AntennaPorts,
|
||||
carrier->initial_csi_index[rrc->Nb_ue]);
|
||||
|
||||
reconfig_ies,
|
||||
ue_context_p->ue_context.secondaryCellGroup,
|
||||
carrier->pdsch_AntennaPorts,
|
||||
carrier->initial_csi_index[rrc->Nb_ue]);
|
||||
ue_context_p->ue_context.rb_config = calloc(1,sizeof(NR_RRCReconfiguration_t));
|
||||
|
||||
//fill_default_rbconfig(ue_context_p->ue_context.rb_config,m, cg_config_info);
|
||||
ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config));
|
||||
memset((void*)CG_Config,0,sizeof(*CG_Config));
|
||||
__attribute__((unused))int CG_Config_size = generate_CG_Config(rrc,CG_Config,ue_context_p->ue_context.reconfig,ue_context_p->ue_context.rb_config);
|
||||
memset((void *)CG_Config,0,sizeof(*CG_Config));
|
||||
//int CG_Config_size = generate_CG_Config(rrc,CG_Config,ue_context_p->ue_context.reconfig,ue_context_p->ue_context.rb_config);
|
||||
generate_CG_Config(rrc,CG_Config,ue_context_p->ue_context.reconfig,ue_context_p->ue_context.rb_config);
|
||||
|
||||
if(m!=NULL){
|
||||
uint8_t inde_list[m->nb_e_rabs_tobeadded];
|
||||
memset(inde_list, 0, m->nb_e_rabs_tobeadded*sizeof(uint8_t));
|
||||
if(m!=NULL) {
|
||||
uint8_t inde_list[m->nb_e_rabs_tobeadded];
|
||||
memset(inde_list, 0, m->nb_e_rabs_tobeadded*sizeof(uint8_t));
|
||||
|
||||
if (m->nb_e_rabs_tobeadded>0){
|
||||
for (int i=0; i<m->nb_e_rabs_tobeadded; i++){
|
||||
// Add the new E-RABs at the corresponding rrc ue context of the gNB
|
||||
ue_context_p->ue_context.e_rab[i].param.e_rab_id = m->e_rabs_tobeadded[i].e_rab_id;
|
||||
ue_context_p->ue_context.e_rab[i].param.gtp_teid = m->e_rabs_tobeadded[i].gtp_teid;
|
||||
memcpy(&ue_context_p->ue_context.e_rab[i].param.sgw_addr, &m->e_rabs_tobeadded[i].sgw_addr, sizeof(transport_layer_addr_t));
|
||||
ue_context_p->ue_context.nb_of_e_rabs++;
|
||||
//Fill the required E-RAB specific information for the creation of the S1-U tunnel between the gNB and the SGW
|
||||
create_tunnel_req.eps_bearer_id[i] = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||
create_tunnel_req.sgw_S1u_teid[i] = ue_context_p->ue_context.e_rab[i].param.gtp_teid;
|
||||
memcpy(&create_tunnel_req.sgw_addr[i], &ue_context_p->ue_context.e_rab[i].param.sgw_addr, sizeof(transport_layer_addr_t));
|
||||
inde_list[i] = i;
|
||||
LOG_I(RRC,"S1-U tunnel: index %d target sgw ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||
i,
|
||||
create_tunnel_req.sgw_addr[i].buffer[0],
|
||||
create_tunnel_req.sgw_addr[i].buffer[1],
|
||||
create_tunnel_req.sgw_addr[i].buffer[2],
|
||||
create_tunnel_req.sgw_addr[i].buffer[3],
|
||||
create_tunnel_req.sgw_addr[i].length,
|
||||
create_tunnel_req.sgw_S1u_teid[i]);
|
||||
}
|
||||
//PM: Is this where we should extract the rnti from?
|
||||
create_tunnel_req.rnti = ue_context_p->ue_id_rnti;
|
||||
create_tunnel_req.num_tunnels = m->nb_e_rabs_tobeadded;
|
||||
RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[rrc->module_id]->rrc_ue_head, ue_context_p);
|
||||
if (m->nb_e_rabs_tobeadded>0) {
|
||||
for (int i=0; i<m->nb_e_rabs_tobeadded; i++) {
|
||||
// Add the new E-RABs at the corresponding rrc ue context of the gNB
|
||||
ue_context_p->ue_context.e_rab[i].param.e_rab_id = m->e_rabs_tobeadded[i].e_rab_id;
|
||||
ue_context_p->ue_context.e_rab[i].param.gtp_teid = m->e_rabs_tobeadded[i].gtp_teid;
|
||||
memcpy(&ue_context_p->ue_context.e_rab[i].param.sgw_addr, &m->e_rabs_tobeadded[i].sgw_addr, sizeof(transport_layer_addr_t));
|
||||
ue_context_p->ue_context.nb_of_e_rabs++;
|
||||
//Fill the required E-RAB specific information for the creation of the S1-U tunnel between the gNB and the SGW
|
||||
create_tunnel_req.eps_bearer_id[i] = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||
create_tunnel_req.sgw_S1u_teid[i] = ue_context_p->ue_context.e_rab[i].param.gtp_teid;
|
||||
memcpy(&create_tunnel_req.sgw_addr[i], &ue_context_p->ue_context.e_rab[i].param.sgw_addr, sizeof(transport_layer_addr_t));
|
||||
inde_list[i] = i;
|
||||
LOG_I(RRC,"S1-U tunnel: index %d target sgw ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||
i,
|
||||
create_tunnel_req.sgw_addr[i].buffer[0],
|
||||
create_tunnel_req.sgw_addr[i].buffer[1],
|
||||
create_tunnel_req.sgw_addr[i].buffer[2],
|
||||
create_tunnel_req.sgw_addr[i].buffer[3],
|
||||
create_tunnel_req.sgw_addr[i].length,
|
||||
create_tunnel_req.sgw_S1u_teid[i]);
|
||||
}
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id);
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
ctxt.instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
&ctxt,
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).nb_e_rabs_admitted_tobeadded = m->nb_e_rabs_tobeadded;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).target_assoc_id = m->target_assoc_id;
|
||||
//PM: Is this where we should extract the rnti from?
|
||||
create_tunnel_req.rnti = ue_context_p->ue_id_rnti;
|
||||
create_tunnel_req.num_tunnels = m->nb_e_rabs_tobeadded;
|
||||
RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[rrc->module_id]->rrc_ue_head, ue_context_p);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id);
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
ctxt.instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
&ctxt,
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).nb_e_rabs_admitted_tobeadded = m->nb_e_rabs_tobeadded;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).target_assoc_id = m->target_assoc_id;
|
||||
|
||||
for(int i=0; i<ue_context_p->ue_context.nb_of_e_rabs; i++){
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].e_rab_id = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid = create_tunnel_resp.enb_S1u_teid[i];
|
||||
memcpy(&X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr, &create_tunnel_resp.enb_addr, sizeof(transport_layer_addr_t));
|
||||
|
||||
//The length field in the X2AP targetting structure is expected in bits but the create_tunnel_resp returns the address length in bytes
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.length = create_tunnel_resp.enb_addr.length*8;
|
||||
|
||||
LOG_I(RRC,"S1-U create_tunnel_resp tunnel: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||
i,
|
||||
create_tunnel_resp.enb_addr.buffer[0],
|
||||
create_tunnel_resp.enb_addr.buffer[1],
|
||||
create_tunnel_resp.enb_addr.buffer[2],
|
||||
create_tunnel_resp.enb_addr.buffer[3],
|
||||
create_tunnel_resp.enb_addr.length,
|
||||
create_tunnel_resp.enb_S1u_teid[i]);
|
||||
LOG_I(RRC,"X2AP sGNB Addition Request: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||
i,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[0],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[1],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[2],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[3],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.length,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid);
|
||||
}
|
||||
}
|
||||
else
|
||||
LOG_W(RRC, "No E-RAB to be added received from SgNB Addition Request message \n");
|
||||
for(int i=0; i<ue_context_p->ue_context.nb_of_e_rabs; i++) {
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].e_rab_id = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid = create_tunnel_resp.enb_S1u_teid[i];
|
||||
memcpy(&X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr, &create_tunnel_resp.enb_addr, sizeof(transport_layer_addr_t));
|
||||
//The length field in the X2AP targetting structure is expected in bits but the create_tunnel_resp returns the address length in bytes
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.length = create_tunnel_resp.enb_addr.length*8;
|
||||
LOG_I(RRC,"S1-U create_tunnel_resp tunnel: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||
i,
|
||||
create_tunnel_resp.enb_addr.buffer[0],
|
||||
create_tunnel_resp.enb_addr.buffer[1],
|
||||
create_tunnel_resp.enb_addr.buffer[2],
|
||||
create_tunnel_resp.enb_addr.buffer[3],
|
||||
create_tunnel_resp.enb_addr.length,
|
||||
create_tunnel_resp.enb_S1u_teid[i]);
|
||||
LOG_I(RRC,"X2AP sGNB Addition Request: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||
i,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[0],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[1],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[2],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.buffer[3],
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr.length,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid);
|
||||
}
|
||||
} else
|
||||
LOG_W(RRC, "No E-RAB to be added received from SgNB Addition Request message \n");
|
||||
}
|
||||
|
||||
|
||||
//X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = CG_Config_size; //Need to verify correct value for the buffer_size
|
||||
// Send to X2 entity to transport to MeNB
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CG_Config,
|
||||
NULL,
|
||||
(void *)CG_Config,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer,
|
||||
1024);
|
||||
|
||||
NULL,
|
||||
(void *)CG_Config,
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer,
|
||||
1024);
|
||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = (enc_rval.encoded+7)>>3;
|
||||
|
||||
itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(0), msg); //Check right id instead of hardcoding
|
||||
|
||||
rrc->Nb_ue++;
|
||||
// configure MAC and RLC
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.pdsch_AntennaPorts,
|
||||
NULL,
|
||||
1, // add_ue flag
|
||||
ue_context_p->ue_id_rnti,
|
||||
ue_context_p->ue_context.secondaryCellGroup);
|
||||
NULL,
|
||||
1, // add_ue flag
|
||||
ue_context_p->ue_id_rnti,
|
||||
ue_context_p->ue_context.secondaryCellGroup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1720
-1896
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user