Commit 1e5f95cd authored by Raymond Knopp's avatar Raymond Knopp

fixes for monolithic case. Still doesn't work to RRCConnectionSetup, context allocation problem.

parent 34172c7a
......@@ -822,7 +822,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc) {
RRC_CONFIGURATION_REQ (msg_p).nb_antenna_ports[j] = nb_antenna_ports;
}
else {//this is CU, SIB2-20 in CU
if (rrc->node_type != ngran_eNB_DU) {//this is CU or eNB, SIB2-20 in CU
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (!pbch_repetition)
......
......@@ -314,6 +314,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
"Unknown message\n");
break;
}// switch case
return(0);
} else if (srb_id == 1) {
// rrc_rlc_config_asn1_req(&ctxt,
// SRB_configList,
......@@ -325,7 +326,90 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
// # endif
// );
LOG_I(DU_F1AP, "Received DL RRC Transfer on srb_id 1\n");
DL_DCCH_Message_t* dl_dcch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
&asn_DEF_DL_DCCH_Message,
(void**)&dl_dcch_msg,
ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len,0,0);
if (dl_dcch_msg->message.present == DL_DCCH_MessageType_PR_c1) {
switch (dl_dcch_msg->message.choice.c1.present) {
case DL_DCCH_MessageType__c1_PR_NOTHING:
LOG_I(RRC, "Received PR_NOTHING on DL-DCCH-Message\n");
return;
case DL_DCCH_MessageType__c1_PR_csfbParametersResponseCDMA2000:
case DL_DCCH_MessageType__c1_PR_dlInformationTransfer:
case DL_DCCH_MessageType__c1_PR_handoverFromEUTRAPreparationRequest:
case DL_DCCH_MessageType__c1_PR_mobilityFromEUTRACommand:
break;
case DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration:
// handle RRCConnectionReconfiguration
LOG_I(RRC,
"Logical Channel DL-DCCH (SRB1), Received RRCConnectionReconfiguration DU_ID %x/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_ue[instance],du_ue_f1ap_id));
RRCConnectionReconfiguration_t* rrcConnectionReconfiguration = &dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration;
if (rrcConnectionReconfiguration->criticalExtensions.present == RRCConnectionReconfiguration__criticalExtensions_PR_c1) {
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.present ==
RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8) {
RRCConnectionReconfiguration_r8_IEs_t* rrcConnectionReconfiguration_r8 =
&rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8;
if (rrcConnectionReconfiguration_r8->mobilityControlInfo) {
LOG_I(RRC,"Mobility Control Information is present\n");
AssertFatal(1==0,"Can't handle this yet in DU\n");
}
if (rrcConnectionReconfiguration_r8->measConfig != NULL) {
LOG_I(RRC,"Measurement Configuration is present\n");
}
if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated) {
LOG_I(RRC,"Radio Resource Configuration is present\n");
RadioResourceConfigDedicated_t* radioResourceConfigDedicated = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated;
long SRB_id,DRB_id;
int i,cnt;
LogicalChannelConfig_t *SRB1_logicalChannelConfig,*SRB2_logicalChannelConfig;
// radioResourceConfigDedicated->physicalConfigDedicated;
}
break;
case DL_DCCH_MessageType__c1_PR_rrcConnectionRelease:
// handle RRCConnectionRelease
break;
case DL_DCCH_MessageType__c1_PR_securityModeCommand:
case DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry:
case DL_DCCH_MessageType__c1_PR_counterCheck:
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
case DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r10:
case DL_DCCH_MessageType__c1_PR_rnReconfiguration_r10:
#endif
case DL_DCCH_MessageType__c1_PR_spare1:
case DL_DCCH_MessageType__c1_PR_spare2:
case DL_DCCH_MessageType__c1_PR_spare3:
#if (RRC_VERSION < MAKE_VERSION(14, 0, 0))
case DL_DCCH_MessageType__c1_PR_spare4:
#endif
break;
}
}
}
}
}
else if (srb_id == 2) {
}
LOG_I(DU_F1AP, "Received DL RRC Transfer on srb_id %d\n",srb_id);
rlc_op_status_t rlc_status;
boolean_t ret = TRUE;
mem_block_t *pdcp_pdu_p = NULL;
......@@ -376,9 +460,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
return ret;
} // if pdcp_pdu_p
} else if (srb_id == 2) {
}
#endif
return 0;
......
......@@ -59,11 +59,12 @@ int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p)
{
int channel_id;
/*
DevAssert(p->local_ipv4_address);
DevAssert(p->local_port > 1024); // "unprivileged" port
DevAssert(p->remote_ipv4_address);
DevAssert(p->remote_port > 1024); // "unprivileged" port
*/
proto_agent[mod_id].mod_id = mod_id;
/* Initialize the channel container */
......
......@@ -150,7 +150,7 @@ mac_rrc_data_req(
LOG_T(RRC,"[eNB %d] Frame %d CCCH request (Srb_id %d, rnti %x)\n",Mod_idP,frameP, Srb_id,rnti);
if(ue_p->Srb0.Active==0) {
LOG_E(RRC,"[eNB %d] CCCH Not active\n",Mod_idP);
LOG_E(RRC,"[eNB %d] CCCH Not active (%p, rnti %x)\n",Mod_idP,ue_p,ue_p->rnti);
return(0);
}
......@@ -304,7 +304,29 @@ mac_rrc_data_ind(
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rntiP, frameP, sub_frameP,0);
if((srb_idP & RAB_OFFSET) == CCCH) {
LOG_D(RRC,"[eNB %d] Received SDU for CCCH on SRB 0\n",module_idP);
LOG_I(RRC,"[eNB %d] Received SDU for CCCH on SRB 0 (%d,%x)\n",module_idP,
ctxt.module_id,ctxt.rnti);
// create a ue_context with rnti as random value, will be updated when Attach Request is received
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_next_free_ue_context(&ctxt,
rntiP
);
eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
SRB_INFO *srb_info_p = &ue_p->Srb0;
LOG_I(RRC,"Decoding CCCH : inst %d, CC_id %d, ue_context %p (rnti %x), sib_info_p->Rx_buffer.payload_size %d\n",
module_idP,CC_id,ue_p, ue_p->rnti,sdu_lenP);
AssertFatal(sdu_lenP <= RRC_BUFFER_SIZE_MAX,
"CCCH message has size %d > %d\n",sdu_lenP,RRC_BUFFER_SIZE_MAX);
memcpy(srb_info_p->Rx_buffer.Payload,
sduP,
sdu_lenP);
srb_info_p->Rx_buffer.payload_size = sdu_lenP;
srb_info_p->Active = 1;
// msg("\n******INST %d Srb_info %p, Srb_id=%d****\n\n",Mod_id,Srb_info,Srb_info->Srb_id);
if (sdu_lenP > 0) rrc_eNB_decode_ccch(&ctxt, sduP, sdu_lenP, CC_id);
......
......@@ -204,7 +204,7 @@ init_SI(
AssertFatal(carrier->sizeof_SIB1 != 255,"FATAL, RC.rrc[enb_mod_idP].carrier[CC_id].sizeof_SIB1 == 255");
}
else if (rrc->node_type != ngran_eNB_DU) {
if (rrc->node_type != ngran_eNB_DU) {
carrier->SIB23 = (uint8_t*) malloc16(64);
AssertFatal(carrier->SIB23!=NULL,"cannot allocate memory for SIB");
......@@ -625,9 +625,9 @@ static void init_MBMS(
#endif
,NULL);
if ( (RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) ||
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU) ||
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
if ( (RC.rrc[enb_mod_idP]->node_type != ngran_eNB_CU) ||
(RC.rrc[enb_mod_idP]->node_type != ngran_ng_eNB_CU) ||
(RC.rrc[enb_mod_idP]->node_type != ngran_gNB_CU) ) {
rrc_rlc_config_asn1_req(&ctxt,
NULL, // SRB_ToAddModList
NULL, // DRB_ToAddModList
......@@ -737,7 +737,7 @@ rrc_eNB_ue_context_stmsi_exist(
//-----------------------------------------------------------------------------
// return a new ue context structure if ue_identityP, ctxt_pP->rnti not found in collection
static struct rrc_eNB_ue_context_s*
struct rrc_eNB_ue_context_s*
rrc_eNB_get_next_free_ue_context(
const protocol_ctxt_t* const ctxt_pP,
const uint64_t ue_identityP
......@@ -775,6 +775,7 @@ rrc_eNB_get_next_free_ue_context(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
return NULL;
}
return(ue_context_p);
}
//-----------------------------------------------------------------------------
......@@ -1338,7 +1339,7 @@ rrc_eNB_generate_RRCConnectionReestablishment(
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
if (rrc->node_type == ngran_eNB) {
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) {
rrc_mac_config_req_eNB(ctxt_pP->module_id,
ue_context_pP->ue_context.primaryCC_id,
0,0,0,0,0,
......@@ -4782,7 +4783,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
LOG_D(RRC,
"handover_config [FRAME %05d][RRC_eNB][MOD %02d][][--- MAC_CONFIG_REQ (SRB1 UE %x) --->][MAC_eNB][MOD %02d][]\n",
ctxt_pP->frame, ctxt_pP->module_id, ue_context_pP->ue_context.rnti, ctxt_pP->module_id);
if (rrc->node_type == ngran_eNB) {
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) {
rrc_mac_config_req_eNB(
ctxt_pP->module_id,
ue_context_pP->ue_context.primaryCC_id,
......@@ -5373,7 +5374,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
//rrc_rlc_data_req(ctxt_pP->module_id,frameP, 1,(ue_mod_idP*NB_RB_MAX)+DCCH,rrc_eNB_mui++,0,size,(char*)buffer);
//pdcp_data_req (ctxt_pP->module_id, frameP, 1, (ue_mod_idP * NB_RB_MAX) + DCCH,rrc_eNB_mui++, 0, size, (char *) buffer, 1);
if (rrc->node_type == ngran_eNB) {
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) {
rrc_mac_config_req_eNB(
ctxt_pP->module_id,
ue_context_pP->ue_context.primaryCC_id,
......@@ -5649,7 +5650,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
}
if (rrc->node_type == ngran_eNB) {
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) {
rrc_mac_config_req_eNB(
ctxt_pP->module_id,
ue_context_pP->ue_context.primaryCC_id,
......@@ -5710,7 +5711,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (DRB) ---> MAC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
if (rrc->node_type == ngran_eNB) {
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) {
rrc_mac_config_req_eNB(ctxt_pP->module_id,
ue_context_pP->ue_context.primaryCC_id,
0,0,0,0,0,
......@@ -5854,7 +5855,7 @@ rrc_eNB_generate_RRCConnectionSetup(
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
if (rrc->node_type == ngran_eNB) {
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) {
rrc_mac_config_req_eNB(
ctxt_pP->module_id,
ue_context_pP->ue_context.primaryCC_id,
......@@ -7558,8 +7559,8 @@ rrc_enb_task(
eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
srb_info_p = &ue_p->Srb0;
LOG_I(RRC,"Decoding CCCH : inst %d, CC_id %d, ctxt %p, sib_info_p->Rx_buffer.payload_size %d\n",
rrc_inst,CC_id,&ctxt, RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size);
LOG_I(RRC,"Decoding CCCH : inst %d, CC_id %d, ue_context %p (rnti %x), sib_info_p->Rx_buffer.payload_size %d\n",
rrc_inst,CC_id,ue_p, ue_p->rnti,RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size);
if (RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size >= RRC_BUFFER_SIZE_MAX) {
LOG_I(RRC, "CCCH message has size %d > %d\n",RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size,RRC_BUFFER_SIZE_MAX);
break;
......@@ -7568,6 +7569,7 @@ rrc_enb_task(
RRC_MAC_CCCH_DATA_IND(msg_p).sdu,
RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size);
srb_info_p->Rx_buffer.payload_size = RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size;
srb_info_p->Active = 1;
rrc_eNB_decode_ccch(&ctxt, srb_info_p->Rx_buffer.Payload,srb_info_p->Rx_buffer.payload_size, CC_id);
break;
......
......@@ -24,12 +24,12 @@ eNBs =
tr_s_preference = "f1"
local_s_if_name = "lo";
remote_s_address = "127.0.0.1";
local_s_address = "127.0.0.2";
local_s_portc = 60001;
remote_s_portc = 60000;
local_s_portd = 60011;
remote_s_portd = 60010;
remote_s_address = "127.0.0.3";
local_s_address = "127.0.0.4";
local_s_portc = 501;
remote_s_portc = 500;
local_s_portd = 601;
remote_s_portd = 600;
////////// Physical parameters:
......
......@@ -13,9 +13,9 @@ eNBs =
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "001";
mobile_country_code = "208";
mobile_network_code = "01";
mobile_network_code = "93";
nr_cellid = 12345678L
......@@ -60,13 +60,13 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "f1";
local_n_if_name = "vlan203";
remote_n_address = "192.168.203.16";
local_n_address = "192.168.203.242";
local_n_portc = 60000;
remote_n_portc = 60001;
local_n_portd = 60010;
remote_n_portd = 60011;
local_n_if_name = "lo";
remote_n_address = "127.0.0.4";
local_n_address = "127.0.0.3";
local_n_portc = 500;
remote_n_portc = 501;
local_n_portd = 600;
remote_n_portd = 601;
}
);
......@@ -80,8 +80,8 @@ L1s = (
RUs = (
{
local_if_name = "enp4s0f1";
local_address = "192.168.41.3";
remote_address = "192.168.41.1";
local_address = "127.0.0.1";
remote_address = "127.0.0.2";
local_portc = 50000;
remote_portc = 50000;
local_portd = 50001;
......
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