Commit 0ed92011 authored by Robert Schmidt's avatar Robert Schmidt

Remove useless node_type switches in RRC

parent da193d1b
...@@ -549,30 +549,14 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co ...@@ -549,30 +549,14 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co
} }
} }
LOG_I(NR_RRC, "[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate NR_RRCReconfiguration (bytes %d, UE id %x)\n", ctxt_pP->module_id, ctxt_pP->frame, size, ue_p->rnti); LOG_I(NR_RRC, "[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate NR_RRCReconfiguration (bytes %d, UE id %x)\n",
switch (RC.nrrrc[ctxt_pP->module_id]->node_type) { ctxt_pP->module_id,
case ngran_gNB_CU: ctxt_pP->frame,
case ngran_gNB_CUCP: size,
case ngran_gNB: ue_context_pP->ue_context.rnti);
nr_rrc_data_req(ctxt_pP, AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
// rrc_pdcp_config_asn1_req
break;
case ngran_gNB_DU:
// nothing to do for DU
AssertFatal(1==0,"nothing to do for DU\n");
break;
default : nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
LOG_W(NR_RRC, "Unknown node type %d\n", RC.nrrrc[ctxt_pP->module_id]->node_type);
}
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
...@@ -3816,48 +3800,13 @@ rrc_gNB_generate_SecurityModeCommand( ...@@ -3816,48 +3800,13 @@ rrc_gNB_generate_SecurityModeCommand(
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Security Mode Command\n"); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Security Mode Command\n");
LOG_I(NR_RRC, "UE %04x Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d)\n", ue_p->rnti, size); LOG_I(NR_RRC, "UE %04x Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d)\n", ue_p->rnti, size);
switch (RC.nrrrc[ctxt_pP->module_id]->node_type) { gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
case ngran_gNB_CU: AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
case ngran_gNB_CUCP:
// create an ITTI message
memcpy(ue_p->Srb[1].Srb_info.Tx_buffer.Payload, buffer, size);
ue_p->Srb[1].Srb_info.Tx_buffer.payload_size = size;
LOG_I(NR_RRC,"calling rrc_data_req :securityModeCommand\n");
nr_rrc_data_req(ctxt_pP,
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
break;
case ngran_gNB_DU: memcpy(ue_context_pP->ue_context.Srb[1].Srb_info.Tx_buffer.Payload, buffer, size);
// nothing to do for DU ue_context_pP->ue_context.Srb[1].Srb_info.Tx_buffer.payload_size = size;
AssertFatal(1==0,"nothing to do for DU\n");
break;
case ngran_gNB: nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
LOG_D(NR_RRC,
PROTOCOL_NR_RRC_CTXT_UE_FMT" --- PDCP_DATA_REQ/%d Bytes (securityModeCommand to UE MUI %d) --->[PDCP][RB %02d]\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
size,
rrc_gNB_mui,
DCCH);
LOG_D(NR_RRC,"calling rrc_data_req :securityModeCommand\n");
nr_rrc_data_req(ctxt_pP,
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
break;
default :
LOG_W(NR_RRC, "Unknown node type %d\n", RC.nrrrc[ctxt_pP->module_id]->node_type);
}
} }
void void
...@@ -3879,44 +3828,11 @@ rrc_gNB_generate_UECapabilityEnquiry( ...@@ -3879,44 +3828,11 @@ rrc_gNB_generate_UECapabilityEnquiry(
PROTOCOL_NR_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d)\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
size); size);
switch (RC.nrrrc[ctxt_pP->module_id]->node_type) {
case ngran_gNB_CU:
case ngran_gNB_CUCP:
nr_rrc_data_req(
ctxt_pP,
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
break;
case ngran_gNB_DU: gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
// nothing to do for DU AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
AssertFatal(1==0,"nothing to do for DU\n");
break;
case ngran_gNB:
// rrc_mac_config_req_gNB
LOG_D(NR_RRC,
PROTOCOL_NR_RRC_CTXT_UE_FMT" --- PDCP_DATA_REQ/%d Bytes (NR UECapabilityEnquiry MUI %d) --->[PDCP][RB %02d]\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
size,
rrc_gNB_mui,
DCCH);
nr_rrc_data_req(ctxt_pP,
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
break;
default : nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
LOG_W(NR_RRC, "Unknown node type %d\n", RC.nrrrc[ctxt_pP->module_id]->node_type);
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -3950,6 +3866,12 @@ rrc_gNB_generate_RRCRelease( ...@@ -3950,6 +3866,12 @@ rrc_gNB_generate_RRCRelease(
rrc_gNB_mui, rrc_gNB_mui,
DCCH); DCCH);
nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(ctxt_pP->instance, ue_context_pP->ue_context.gNB_ue_ngap_id);
ue_context_pP->ue_context.ue_release_timer_rrc = 1;
// Use this in monolithic as well to free UE correctly
if (NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) { if (NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size); uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size);
memcpy (message_buffer, buffer, size); memcpy (message_buffer, buffer, size);
...@@ -3960,17 +3882,6 @@ rrc_gNB_generate_RRCRelease( ...@@ -3960,17 +3882,6 @@ rrc_gNB_generate_RRCRelease(
F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container = message_buffer; F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container = message_buffer;
F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container_length = size; F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container_length = size;
itti_send_msg_to_task(TASK_CU_F1, ctxt_pP->module_id, m); itti_send_msg_to_task(TASK_CU_F1, ctxt_pP->module_id, m);
} else {
nr_rrc_data_req(ctxt_pP,
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(ctxt_pP->instance, ue_p->gNB_ue_ngap_id);
ue_p->ue_release_timer_rrc = 1;
} }
} }
......
...@@ -622,29 +622,11 @@ int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mu ...@@ -622,29 +622,11 @@ int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mu
/* /*
* switch UL or DL NAS message without RRC piggybacked to SRB2 if active. * switch UL or DL NAS message without RRC piggybacked to SRB2 if active.
*/ */
switch (RC.nrrrc[ctxt.module_id]->node_type) { AssertFatal(!NODE_IS_DU(RC.nrrrc[ctxt.module_id]->node_type), "illegal node type DU: receiving NGAP messages at this node\n");
case ngran_gNB_CU: /* Transfer data to PDCP */
case ngran_gNB_CUCP: rb_id_t srb_id = UE->Srb[2].Active ? UE->Srb[2].Srb_info.Srb_id : UE->Srb[1].Srb_info.Srb_id;
case ngran_gNB: { nr_rrc_data_req(&ctxt, srb_id, (*rrc_gNB_mui)++, SDU_CONFIRM_NO, length, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
long srb_id; return 0;
if (UE->Srb[2].Active)
srb_id = UE->Srb[2].Srb_info.Srb_id;
else
srb_id = UE->Srb[1].Srb_info.Srb_id;
AssertFatal(srb_id > 0 && srb_id < maxSRBs, "");
/* Transfer data to PDCP */
nr_rrc_data_req(&ctxt, srb_id, (*rrc_gNB_mui)++, SDU_CONFIRM_NO, length, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
free(buffer); // nr_rrc_data_req do a second malloc and copy
} break;
case ngran_gNB_DU:
// nothing to do for DU
break;
default:
LOG_W(NR_RRC, "Unknown node type %d\n", RC.nrrrc[ctxt.module_id]->node_type);
}
return (0);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
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