Commit 02400771 authored by Robert Schmidt's avatar Robert Schmidt

Check type of node using NODE_IS_CU/DU/MONOLITHIC macros

parent f0fced85
......@@ -44,4 +44,8 @@ typedef enum {
ngran_gNB_DU = 7
} ngran_node_t;
#define NODE_IS_MONOLITHIC(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB || (nOdE_TyPe) == ngran_ng_eNB || (nOdE_TyPe) == ngran_gNB)
#define NODE_IS_CU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_CU || (nOdE_TyPe) == ngran_ng_eNB_CU || (nOdE_TyPe) == ngran_gNB_CU)
#define NODE_IS_DU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_DU || (nOdE_TyPe) == ngran_gNB_DU)
#endif
......@@ -69,7 +69,7 @@ static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, u
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
{
if (node_type == ngran_eNB_DU) { // F1AP registration
if (NODE_IS_DU(node_type)) { // F1AP registration
// configure F1AP here for F1C
LOG_I(ENB_APP,"ngran_eNB_DU: Allocating ITTI message for F1AP_SETUP_REQ\n");
msg_p = itti_alloc_new_message (TASK_ENB_APP, F1AP_SETUP_REQ);
......@@ -143,7 +143,7 @@ void *eNB_app_task(void *args_p) {
}
/* Try to register each eNB with each other */
if (is_x2ap_enabled() && RC.rrc[0]->node_type == ngran_eNB) { // CU or DU do not need
if (is_x2ap_enabled() && !NODE_IS_DU(RC.rrc[0]->node_type)) {
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
}
......@@ -167,7 +167,7 @@ void *eNB_app_task(void *args_p) {
break;
case S1AP_REGISTER_ENB_CNF:
AssertFatal(RC.rrc[0]->node_type != ngran_eNB_DU, "Should not have received S1AP_REGISTER_ENB_CNF\n");
AssertFatal(!NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received S1AP_REGISTER_ENB_CNF\n");
if (EPC_MODE_ENABLED) {
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
......@@ -206,7 +206,7 @@ void *eNB_app_task(void *args_p) {
break;
case F1AP_SETUP_RESP:
AssertFatal(RC.rrc[0]->node_type == ngran_eNB_DU, "Should not have received F1AP_REGISTER_ENB_CNF in CU/eNB\n");
AssertFatal(NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received F1AP_REGISTER_ENB_CNF in CU/eNB\n");
LOG_I(ENB_APP, "Received %s: associated ngran_eNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
......
......@@ -441,7 +441,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
//printf("Component carrier %d\n",component_carrier);
nb_cc++;
if (rrc->node_type != ngran_eNB_CU && rrc->node_type != ngran_ng_eNB_CU && rrc->node_type != ngran_gNB_CU) {
if (!NODE_IS_CU(rrc->node_type)) {
// Cell params, MIB/SIB1 in DU
RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = ccparams_lte.tdd_config;
AssertFatal (ccparams_lte.tdd_config <= LTE_TDD_Config__subframeAssignment_sa6,
......@@ -533,7 +533,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RRC_CONFIGURATION_REQ (msg_p).nb_antenna_ports[j] = ccparams_lte.nb_antenna_ports;
}
if (rrc->node_type != ngran_eNB_DU) {//this is CU or eNB, SIB2-20 in CU
if (!NODE_IS_DU(rrc->node_type)) { //this is CU or eNB, SIB2-20 in CU
// Radio Resource Configuration (SIB2)
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_root = ccparams_lte.prach_root;
......@@ -1295,10 +1295,10 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
if (SLconfig.sidelink_configured==1) fill_SL_configuration(msg_p,&SLconfig,i,j,RC.config_file_name);
else printf("No SL configuration skipping it\n");
} // node_type!=ngran_eNB_DU
} // !NODE_IS_DU(node_type)
}
if (rrc->node_type == ngran_eNB || rrc->node_type == ngran_eNB_CU || rrc->node_type == ngran_ng_eNB_CU || rrc->node_type == ngran_gNB_CU) {
if (!NODE_IS_DU(rrc->node_type)) {
char srb1path[MAX_OPTNAME_SIZE*2 + 8];
sprintf(srb1path,"%s.%s",enbpath,ENB_CONFIG_STRING_SRB1);
config_get( SRB1Params,sizeof(SRB1Params)/sizeof(paramdef_t), srb1path);
......@@ -2618,6 +2618,6 @@ void read_config_and_init(void)
RCconfig_RRC(enb_id, RC.rrc[enb_id],macrlc_has_f1[enb_id]);
}
if (RC.rrc[0]->node_type != ngran_eNB_DU)
if (!NODE_IS_DU(RC.rrc[0]->node_type))
pdcp_layer_init();
}
......@@ -404,8 +404,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
// check threshold
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) {
// note: probably ul_failure_timer should be less than UE radio link failure time(see T310/N310/N311)
if (RC.rrc[module_idP]->node_type == ngran_eNB_DU
|| RC.rrc[module_idP]->node_type == ngran_gNB_DU) {
if (NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
MessageDef *m = itti_alloc_new_message(TASK_MAC_ENB, F1AP_UE_CONTEXT_RELEASE_REQ);
F1AP_UE_CONTEXT_RELEASE_REQ(m).rnti = rnti;
F1AP_UE_CONTEXT_RELEASE_REQ(m).cause = F1AP_CAUSE_RADIO_NETWORK;
......
......@@ -191,9 +191,7 @@ boolean_t pdcp_data_req(
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
}
#ifndef UETARGET
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 (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
/* currently, there is no support to send also the source/destinationL2Id */
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
......@@ -374,9 +372,7 @@ boolean_t pdcp_data_req(
LOG_D(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n",
rb_idP, pdcp_pdu_size, ctxt_pP->rnti, RC.rrc[ctxt_pP->module_id]->node_type);
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 (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
/* currently, there is no support to send also the source/destinationL2Id */
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
confirmP, pdcp_pdu_size, pdcp_pdu_p);
......@@ -386,8 +382,7 @@ boolean_t pdcp_data_req(
LOG_D(PDCP, "proto_agent_send_rlc_data_req for UE RNTI %x, rb %d, pdu size %d \n",
ctxt_pP->rnti, rb_idP, pdcp_pdu_size);
} else if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_DU
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_DU){
} else if (NODE_IS_DU(RC.rrc[ctxt_pP->module_id]->node_type)){
LOG_E(PDCP, "Can't be DU, bad node type %d \n", RC.rrc[ctxt_pP->module_id]->node_type);
ret=FALSE;
} else
......@@ -429,9 +424,7 @@ boolean_t pdcp_data_req(
{
#ifndef UETARGET
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 (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
// DL transfer
MessageDef *message_p;
// Note: the acyual task must be TASK_PDCP_ENB, but this task is not created
......
......@@ -611,7 +611,7 @@ void rlc_data_ind (
AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU,
"Can't be CU, bad node type %d\n", type);
if (type == ngran_eNB_DU || type == ngran_gNB_DU) {
if (NODE_IS_DU(type)) {
if (srb_flagP == 1) {
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, F1AP_UL_RRC_MESSAGE);
F1AP_UL_RRC_MESSAGE(msg).rnti = ctxt_pP->rnti;
......
......@@ -244,7 +244,7 @@ mac_rrc_data_ind(
{
if ( RC.rrc[module_idP]->node_type == ngran_eNB_DU) {
if (NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
LOG_W(RRC,"[DU %d][RAPROC] Received SDU for CCCH on SRB %d length %d for UE id %d RNTI %x \n",
module_idP, srb_idP, sdu_lenP, UE_id, rntiP);
......
......@@ -111,7 +111,7 @@ rrc_data_req(
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
* messages automatically */
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 (NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
pdcp_run(ctxt_pP);
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
......
This diff is collapsed.
......@@ -64,39 +64,29 @@ int create_tasks(uint32_t enb_nb) {
}
switch (type) {
case ngran_eNB_CU:
case ngran_ng_eNB_CU:
case ngran_gNB_CU:
if (EPC_MODE_ENABLED && !NODE_IS_DU(type)) {
rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for S1AP failed\n");
if (!(get_softmodem_params()->emulate_rf)){
rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for UDP failed\n");
}
rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
if (is_x2ap_enabled()) {
rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
AssertFatal(rc >= 0, "Create task for X2AP failed\n");
} else {
LOG_I(X2AP, "X2AP is disabled.\n");
}
}
if (NODE_IS_CU(type)) {
rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
/* fall through */
case ngran_eNB:
case ngran_ng_eNB:
case ngran_gNB:
if (EPC_MODE_ENABLED) {
rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for S1AP failed\n");
if (!(get_softmodem_params()->emulate_rf)){
rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for UDP failed\n");
}
rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
if (is_x2ap_enabled()) {
rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
AssertFatal(rc >= 0, "Create task for X2AP failed\n");
} else {
LOG_I(X2AP, "X2AP is disabled.\n");
}
}
break;
default:
/* intentionally left blank */
break;
}
if (type == ngran_eNB_DU || type == ngran_gNB_DU) {
if (NODE_IS_DU(type)) {
rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
}
......
......@@ -688,8 +688,7 @@ int main( int argc, char **argv ) {
RCconfig_L1();
}
if (RC.nb_inst > 0
&& (RC.rrc[0]->node_type == ngran_eNB_CU || RC.rrc[0]->node_type == ngran_ng_eNB_CU)) {
if (RC.nb_inst > 0 && NODE_IS_CU(RC.rrc[0]->node_type)) {
protocol_ctxt_t ctxt;
ctxt.module_id = 0 ;
ctxt.instance = 0;
......@@ -699,8 +698,7 @@ int main( int argc, char **argv ) {
}
/* start threads if only L1 or not a CU */
if (RC.nb_inst == 0 ||
!(RC.rrc[0]->node_type == ngran_eNB_CU || RC.rrc[0]->node_type == ngran_ng_eNB_CU)) {
if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) {
// init UE_PF_PO and mutex lock
pthread_mutex_init(&ue_pf_po_mutex, NULL);
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*MAX_MOBILES_PER_ENB*MAX_NUM_CCs);
......@@ -851,8 +849,7 @@ int main( int argc, char **argv ) {
// stop threads
if (RC.nb_inst == 0 ||
!(RC.rrc[0]->node_type == ngran_eNB_CU || RC.rrc[0]->node_type == ngran_ng_eNB_CU)) {
if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) {
int UE_id;
#ifdef XFORMS
printf("waiting for XFORMS thread\n");
......
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