diff --git a/openair2/COMMON/rrc_messages_def.h b/openair2/COMMON/rrc_messages_def.h index 639043ddd0..0ab7dcde59 100644 --- a/openair2/COMMON/rrc_messages_def.h +++ b/openair2/COMMON/rrc_messages_def.h @@ -19,6 +19,9 @@ MESSAGE_DEF(RRC_UL_DCCH_MESSAGE, MESSAGE_PRIORITY_MED_PLUS, RrcUlDcchMes #endif //-------------------------------------------------------------------------------------------// +// eNB: ENB_APP -> RRC messages +MESSAGE_DEF(RRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, RrcConfigurationReq, rrc_configuration_req) + // UE: NAS -> RRC messages MESSAGE_DEF(NAS_CELL_SELECTION_REQ, MESSAGE_PRIORITY_MED, NasCellSelectionReq, nas_cell_selection_req) MESSAGE_DEF(NAS_CONN_ESTABLI_REQ, MESSAGE_PRIORITY_MED, NasConnEstabliReq, nas_conn_establi_req) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index ed5fbc1f92..6ffb391c2a 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -30,21 +30,33 @@ typedef UL_DCCH_Message_t RrcUlDcchMessage; //-------------------------------------------------------------------------------------------// // Defines to access message fields. -#define NAS_CELL_SELECTION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_req -#define NAS_CONN_ESTABLI_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_establi_req -#define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_req +#define RRC_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_configuration_req -#define NAS_RAB_ESTABLI_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_rab_est_rsp +#define NAS_CELL_SELECTION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_req +#define NAS_CONN_ESTABLI_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_establi_req +#define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_req -#define NAS_CELL_SELECTION_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_cnf -#define NAS_CELL_SELECTION_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_ind -#define NAS_PAGING_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_paging_ind -#define NAS_CONN_ESTABLI_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_establi_cnf -#define NAS_CONN_RELEASE_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_release_ind -#define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_cnf -#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_ind +#define NAS_RAB_ESTABLI_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_rab_est_rsp + +#define NAS_CELL_SELECTION_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_cnf +#define NAS_CELL_SELECTION_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_ind +#define NAS_PAGING_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_paging_ind +#define NAS_CONN_ESTABLI_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_establi_cnf +#define NAS_CONN_RELEASE_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_release_ind +#define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_cnf +#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_ind //-------------------------------------------------------------------------------------------// +// eNB: ENB_APP -> RRC messages +typedef struct RrcConfigurationReq_s { + uint32_t cell_identity; + + uint16_t tac; + + uint16_t mcc; + uint16_t mnc; +} RrcConfigurationReq; + // UE: NAS -> RRC messages typedef cell_info_req_t NasCellSelectionReq; typedef nas_establish_req_t NasConnEstabliReq; diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 9fd1276cd2..4f9d5598ee 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -161,6 +161,31 @@ static Enb_properties_t *enb_properties[] = }; /*------------------------------------------------------------------------------*/ +static void configure_rrc() +{ + uint32_t eNB_id_start = 0; + uint32_t eNB_id_end = 1; + uint32_t eNB_id; + MessageDef *msg_p; + +# if defined(OAI_EMU) + eNB_id_start = oai_emulation.info.first_enb_local; + eNB_id_end = oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local; +# endif + + for (eNB_id = eNB_id_start; (eNB_id < eNB_id_end) ; eNB_id++) + { + msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ); + + RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_properties[eNB_id]->eNB_id; + RRC_CONFIGURATION_REQ (msg_p).tac = enb_properties[eNB_id]->tac; + RRC_CONFIGURATION_REQ (msg_p).mcc = enb_properties[eNB_id]->mcc; + RRC_CONFIGURATION_REQ (msg_p).mnc = enb_properties[eNB_id]->mnc; + + itti_send_msg_to_task (TASK_RRC_ENB, eNB_id, msg_p); + } +} + static uint32_t eNB_app_register() { uint32_t eNB_id_start = 0; @@ -256,6 +281,8 @@ void *eNB_app_task(void *args_p) # endif # endif + configure_rrc(); + # if defined(ENABLE_USE_MME) /* Try to register each eNB */ registered_enb = 0;