Commit e2b68a99 authored by Raymond Knopp's avatar Raymond Knopp

CU/DU support for most recent changes. UE continues as far as in monolithic...

CU/DU support for most recent changes. UE continues as far as in monolithic mode. Still to apply masterCellGroupConfig in DU from RRCReconfiguration. This has to be detected in DU and applied after decoding the RRC message intended for UE.
parent 50365402
......@@ -985,135 +985,6 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
msg->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (msg->srb_id == 1 || msg->srb_id == 2) {
struct rrc_gNB_ue_context_s* ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti);
NR_UL_DCCH_Message_t* ul_dcch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
&asn_DEF_NR_UL_DCCH_Message,
(void**)&ul_dcch_msg,
&ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header
msg->rrc_container_length, 0, 0);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(F1AP, " Failed to decode UL-DCCH (%zu bytes)\n",dec_rval.consumed);
/* for rfsim, because UE send RRCSetupRequest in SRB1 */
// NR_UL_CCCH_Message_t *ul_ccch_msg;
// dec_rval = uper_decode(NULL,
// &asn_DEF_NR_UL_CCCH_Message,
// (void**)&ul_ccch_msg,
// &ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header
// msg->rrc_container_length, 0, 0);
// if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
// LOG_E(F1AP, " Failed to decode UL-CCCH (%zu bytes)\n",dec_rval.consumed);
// } else {
// LOG_I(F1AP, "decode UL-CCCH success \n");
// LOG_I(F1AP, "Received message: present %d and c1 present %d\n",
// ul_ccch_msg->message.present, ul_ccch_msg->message.choice.c1->present);
// if (ul_ccch_msg->message.present == NR_UL_CCCH_MessageType_PR_c1) {
// if (ul_ccch_msg->message.choice.c1->present == NR_UL_CCCH_MessageType__c1_PR_rrcSetupRequest) {
// LOG_I(F1AP, "[MSG] RRC Setup Request\n");
// }
// }
// }
}
else
LOG_I(F1AP, "Received message: present %d and c1 present %d\n",
ul_dcch_msg->message.present, ul_dcch_msg->message.choice.c1->present);
if (ul_dcch_msg->message.present == NR_UL_DCCH_MessageType_PR_c1) {
switch (ul_dcch_msg->message.choice.c1->present) {
case NR_UL_DCCH_MessageType__c1_PR_NOTHING: /* No components present */
break;
case NR_UL_DCCH_MessageType__c1_PR_measurementReport:
break;
case NR_UL_DCCH_MessageType__c1_PR_rrcReconfigurationComplete:
LOG_I(F1AP, "[MSG] RRC UL rrcReconfigurationComplete\n");
/* CDRX: activated when RRC Connection Reconfiguration Complete is received */
#if(0)
int UE_id_mac = find_nr_UE_id(instance, rnti);
if (UE_id_mac == -1) {
LOG_E(F1AP, "Can't find UE_id(MAC) of UE rnti %x\n", rnti);
break;
}
UE_sched_ctrl_t *UE_scheduling_control = &(RC.nrmac[instance]->UE_info.UE_sched_ctrl[UE_id_mac]);
if (UE_scheduling_control->cdrx_waiting_ack == TRUE) {
UE_scheduling_control->cdrx_waiting_ack = FALSE;
UE_scheduling_control->cdrx_configured = TRUE; // Set to TRUE when RRC Connection Reconfiguration Complete is received
LOG_I(F1AP, "CDRX configuration activated after RRC Connection Reconfiguration Complete reception\n");
}
/* End of CDRX processing */
#endif
break;
case NR_UL_DCCH_MessageType__c1_PR_rrcSetupComplete:
LOG_I(F1AP, "[MSG] RRC UL rrcSetupComplete \n");
if(!ue_context_p){
LOG_E(F1AP, "Did not find the UE context associated with UE RNTOI %x, ue_context_p is NULL\n", rnti);
} else {
LOG_I(F1AP, "Processing RRCSetupComplete UE %x\n", rnti);
ue_context_p->ue_context.Status = NR_RRC_CONNECTED;
}
break;
case NR_UL_DCCH_MessageType__c1_PR_rrcReestablishmentComplete:
LOG_I(F1AP, "[MSG] RRC ReestablishmentComplete \n");
break;
case NR_UL_DCCH_MessageType__c1_PR_rrcResumeComplete:
LOG_I(F1AP, "[MSG] RRC ResumeComplete \n");
break;
case NR_UL_DCCH_MessageType__c1_PR_securityModeComplete:
LOG_I(F1AP, "[MSG] RRC securityModeComplete \n");
break;
case NR_UL_DCCH_MessageType__c1_PR_securityModeFailure:
LOG_I(F1AP, "[MSG] RRC securityModeFailure \n");
break;
case NR_UL_DCCH_MessageType__c1_PR_ulInformationTransfer:
LOG_I(F1AP, "[MSG] RRC UL Information Transfer \n");
break;
case NR_UL_DCCH_MessageType__c1_PR_locationMeasurementIndication:
break;
case NR_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation:
LOG_I(F1AP, "[MSG] RRC ueCapabilityInformation \n");
break;
case NR_UL_DCCH_MessageType__c1_PR_ueAssistanceInformation:
break;
case NR_UL_DCCH_MessageType__c1_PR_failureInformation:
break;
case NR_UL_DCCH_MessageType__c1_PR_scgFailureInformation:
break;
case NR_UL_DCCH_MessageType__c1_PR_scgFailureInformationEUTRA:
break;
default:
LOG_E(NR_RRC, "Unknown UL DCCH message type, present %d \n", ul_dcch_msg->message.choice.c1->present);
break;
}
}
}
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 UL RRC MESSAGE TRANSFER \n");
......@@ -1291,44 +1162,17 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
rrcSetup_ies->masterCellGroup.size,0,0);
AssertFatal(dec_rval.code == RC_OK, "could not decode masterCellGroup\n");
// configure MAC
rrc_mac_config_req_gNB(ctxt.module_id,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
NULL,
0,
ue_context_p->ue_context.rnti,
ue_context_p->ue_context.masterCellGroup
);
// rrc_rlc_config_asn1_req
nr_rrc_rlc_config_asn1_req(&ctxt,
ue_context_p->ue_context.SRB_configList,
NULL,
NULL,
NULL,
NULL,
NULL);
// This should be somewhere in the f1ap_cudu_ue_inst_t
/*int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[0], du_ue_f1ap_id);
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[macrlc_instance],rnti);
*/
gNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
AssertFatal(ue_p->Srb0.Active == 1,"SRB0 is not active\n");
apply_macrlc_config(rrc,ue_context_p,&ctxt);
memcpy((void*)ue_p->Srb0.Tx_buffer.Payload,
(void*)ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len); // ie->value.choice.RRCContainer.size
gNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
AssertFatal(ue_p->Srb0.Active == 1,"SRB0 is not active\n");
ue_p->Srb0.Tx_buffer.payload_size = rrc_dl_sdu_len;
memcpy((void*)ue_p->Srb0.Tx_buffer.Payload,
(void*)ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len); // ie->value.choice.RRCContainer.size
// NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = NULL;
// if (cellGroupConfig->mac_CellGroupConfig)
// mac_CellGroupConfig = cellGroupConfig->mac_CellGroupConfig;
ue_p->Srb0.Tx_buffer.payload_size = rrc_dl_sdu_len;
// rrc_mac_config_req_gNB
break;
} // case
......
......@@ -188,7 +188,7 @@ void *gNB_app_task(void *args_p)
/* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info
* can originate from the DU. */
if (AMF_MODE_ENABLED && !NODE_IS_DU(RC.nrrrc[0]->node_type) && !NODE_IS_CU(RC.nrrrc[0]->node_type)) {
if (AMF_MODE_ENABLED && !NODE_IS_DU(RC.nrrrc[0]->node_type)) {
/* Try to register each gNB */
//registered_gnb = 0;
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
......
......@@ -48,7 +48,6 @@ extern RAN_CONTEXT_t RC;
#include <stdint.h>
static nr_rlc_ue_manager_t *nr_rlc_ue_manager;
uint8_t ccch_flag = 1;
/* TODO: handle time a bit more properly */
static uint64_t nr_rlc_current_time;
......@@ -490,23 +489,6 @@ rb_found:
if (NODE_IS_DU(type) && is_srb == 1) {
MessageDef *msg;
if (ccch_flag) {
/* for rfsim, because UE send RRCSetupRequest in SRB1 */
LOG_I(RLC, "[MSG] RRC Setup Request\n");
msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_INITIAL_UL_RRC_MESSAGE);
F1AP_INITIAL_UL_RRC_MESSAGE(msg).gNB_DU_ue_id = 0;
F1AP_INITIAL_UL_RRC_MESSAGE(msg).mcc = RC.nrrrc[0]->configuration.mcc[0];
F1AP_INITIAL_UL_RRC_MESSAGE(msg).mnc = RC.nrrrc[0]->configuration.mnc[0];
F1AP_INITIAL_UL_RRC_MESSAGE(msg).mnc_digit_length = RC.nrrrc[0]->configuration.mnc_digit_length[0];
F1AP_INITIAL_UL_RRC_MESSAGE(msg).nr_cellid = RC.nrrrc[0]->nr_cellid;
F1AP_INITIAL_UL_RRC_MESSAGE(msg).crnti = ue->rnti;
F1AP_INITIAL_UL_RRC_MESSAGE(msg).rrc_container = (unsigned char *)buf;
F1AP_INITIAL_UL_RRC_MESSAGE(msg).rrc_container_length = size;
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0), msg);
ccch_flag = 0;
return;
}
msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE);
F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti;
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id;
......
......@@ -1358,7 +1358,6 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,cellGroupConfig,scc);
ue_p->masterCellGroup = cellGroupConfig;
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL,
......@@ -1378,6 +1377,8 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
}
}
ue_p->masterCellGroup = cellGroupConfig;
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_DL_CCCH_Message, (void *)&dl_ccch_msg);
}
......
......@@ -104,6 +104,13 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
NR_RRCReconfiguration_t *reconfig,
NR_RadioBearerConfig_t *rbconfig);
void apply_macrlc_config(gNB_RRC_INST *rrc,
rrc_gNB_ue_context_t *const ue_context_pP,
const protocol_ctxt_t *const ctxt_pP );
void apply_pdcp_config(rrc_gNB_ue_context_t *const ue_context_pP,
const protocol_ctxt_t *const ctxt_pP );
void
rrc_gNB_generate_RRCSetup(
const protocol_ctxt_t *const ctxt_pP,
......
......@@ -379,6 +379,46 @@ rrc_gNB_get_next_transaction_identifier(
return nr_rrc_transaction_identifier[gnb_mod_idP];
}
void apply_macrlc_config(gNB_RRC_INST *rrc,
rrc_gNB_ue_context_t *const ue_context_pP,
const protocol_ctxt_t *const ctxt_pP ) {
rrc_mac_config_req_gNB(rrc->module_id,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
NULL,
0,
ue_context_pP->ue_context.rnti,
ue_context_pP->ue_context.masterCellGroup
);
nr_rrc_rlc_config_asn1_req(ctxt_pP,
ue_context_pP->ue_context.SRB_configList,
NULL,
NULL,
NULL,
ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList,
NULL);
}
void apply_pdcp_config(rrc_gNB_ue_context_t *const ue_context_pP,
const protocol_ctxt_t *const ctxt_pP ) {
nr_rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_pP->ue_context.SRB_configList,
NULL,
NULL,
0xff,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList);
}
//-----------------------------------------------------------------------------
void
rrc_gNB_generate_RRCSetup(
......@@ -489,34 +529,9 @@ rrc_gNB_generate_RRCSetup(
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
// configure MAC
rrc_mac_config_req_gNB(rrc->module_id,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
NULL,
0,
ue_context_pP->ue_context.rnti,
ue_context_pP->ue_context.masterCellGroup
);
nr_rrc_rlc_config_asn1_req(ctxt_pP,
ue_context_pP->ue_context.SRB_configList,
NULL,
NULL,
NULL,
ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList,
NULL);
nr_rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_pP->ue_context.SRB_configList,
NULL,
NULL,
0xff,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList);
apply_macrlc_config(rrc,ue_context_pP,ctxt_pP);
apply_pdcp_config(ue_context_pP,ctxt_pP);
#endif
}
break;
......
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