Merge branch 'master' into develop_SA_rfsim_for_F1
Conflicts: openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c openair2/F1AP/f1ap_cu_interface_management.c openair2/F1AP/f1ap_cu_rrc_message_transfer.c openair2/F1AP/f1ap_cu_task.c openair2/F1AP/f1ap_du_interface_management.c openair2/F1AP/f1ap_du_task.c openair2/GNB_APP/gnb_app.c openair2/GNB_APP/gnb_config.c openair2/LAYER2/NR_MAC_UE/main_ue_nr.c openair2/RRC/NR/L2_nr_interface.c openair2/RRC/NR/MESSAGES/asn1_msg.c openair2/RRC/NR/rrc_gNB.c openair2/RRC/NR/rrc_gNB_NGAP.c openair2/RRC/NR_UE/L2_interface_ue.c openair2/RRC/NR_UE/rrc_UE.c openair3/NGAP/ngap_gNB.c
This commit is contained in:
@@ -303,87 +303,11 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
}
|
||||
|
||||
|
||||
void *l2l1_task(void *arg) {
|
||||
MessageDef *message_p = NULL;
|
||||
int result;
|
||||
itti_set_task_real_time(TASK_L2L1);
|
||||
itti_mark_task_ready(TASK_L2L1);
|
||||
/* Wait for the initialize message */
|
||||
printf("Wait for the ITTI initialize message\n");
|
||||
|
||||
do {
|
||||
if (message_p != NULL) {
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
|
||||
itti_receive_msg (TASK_L2L1, &message_p);
|
||||
|
||||
switch (ITTI_MSG_ID(message_p)) {
|
||||
case INITIALIZE_MESSAGE:
|
||||
/* Start gNB thread */
|
||||
LOG_D(EMU, "L2L1 TASK received %s\n", ITTI_MSG_NAME(message_p));
|
||||
start_gNB = 1;
|
||||
break;
|
||||
|
||||
case TERMINATE_MESSAGE:
|
||||
printf("received terminate message\n");
|
||||
oai_exit=1;
|
||||
start_gNB = 0;
|
||||
itti_exit_task ();
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
|
||||
break;
|
||||
}
|
||||
} while (ITTI_MSG_ID(message_p) != INITIALIZE_MESSAGE);
|
||||
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
/* ???? no else but seems to be UE only ???
|
||||
do {
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_L2L1, &message_p);
|
||||
|
||||
switch (ITTI_MSG_ID(message_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
oai_exit=1;
|
||||
itti_exit_task ();
|
||||
break;
|
||||
|
||||
case ACTIVATE_MESSAGE:
|
||||
start_UE = 1;
|
||||
break;
|
||||
|
||||
case DEACTIVATE_MESSAGE:
|
||||
start_UE = 0;
|
||||
break;
|
||||
|
||||
case MESSAGE_TEST:
|
||||
LOG_I(EMU, "Received %s\n", ITTI_MSG_NAME(message_p));
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
|
||||
break;
|
||||
}
|
||||
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
} while(!oai_exit);
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
LOG_D(GNB_APP, "%s(gnb_nb:%d)\n", __FUNCTION__, gnb_nb);
|
||||
itti_wait_ready(1);
|
||||
|
||||
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
|
||||
LOG_E(PDCP, "Create task for L2L1 failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (gnb_nb > 0) {
|
||||
/* Last task to create, others task must be ready before its start */
|
||||
@@ -422,7 +346,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
}
|
||||
|
||||
|
||||
if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
|
||||
if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0 && get_softmodem_params()->sa==0)) {
|
||||
if (gnb_nb > 0) {
|
||||
/*
|
||||
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
@@ -700,7 +624,7 @@ void wait_gNBs(void) {
|
||||
void terminate_task(task_id_t task_id, module_id_t mod_id) {
|
||||
LOG_I(GNB_APP, "sending TERMINATE_MESSAGE to task %s (%d)\n", itti_get_task_name(task_id), task_id);
|
||||
MessageDef *msg;
|
||||
msg = itti_alloc_new_message (ENB_APP, TERMINATE_MESSAGE);
|
||||
msg = itti_alloc_new_message (ENB_APP, 0, TERMINATE_MESSAGE);
|
||||
itti_send_msg_to_task (task_id, ENB_MODULE_ID_TO_INSTANCE(mod_id), msg);
|
||||
}
|
||||
|
||||
@@ -738,7 +662,6 @@ int stop_L1L2(module_id_t gnb_id) {
|
||||
|
||||
/* these tasks need to pick up new configuration */
|
||||
terminate_task(TASK_RRC_ENB, gnb_id);
|
||||
terminate_task(TASK_L2L1, gnb_id);
|
||||
LOG_I(GNB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id);
|
||||
kill_gNB_proc(gnb_id);
|
||||
LOG_I(GNB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id);
|
||||
@@ -774,16 +697,9 @@ int restart_L1L2(module_id_t gnb_id) {
|
||||
rrc_enb_init();
|
||||
itti_mark_task_ready(TASK_RRC_ENB);
|
||||
|
||||
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
|
||||
LOG_E(PDCP, "Create task for L2L1 failed\n");
|
||||
return -1;
|
||||
} else {
|
||||
LOG_I(PDCP, "Re-created task for L2L1 successfully\n");
|
||||
}
|
||||
|
||||
/* pass a reconfiguration request which will configure everything down to
|
||||
* RC.eNB[i][j]->frame_parms, too */
|
||||
msg_p = itti_alloc_new_message(TASK_ENB_APP, RRC_CONFIGURATION_REQ);
|
||||
msg_p = itti_alloc_new_message(TASK_ENB_APP, 0, RRC_CONFIGURATION_REQ);
|
||||
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[gnb_id]->configuration;
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
/* TODO XForms might need to be restarted, but it is currently (09/02/18)
|
||||
@@ -877,6 +793,9 @@ int main( int argc, char **argv )
|
||||
if (get_softmodem_params()->do_ra)
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
|
||||
|
||||
if (get_softmodem_params()->sa)
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"Standalone mode and phy_test are mutually exclusive\n");
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
@@ -889,9 +808,9 @@ int main( int argc, char **argv )
|
||||
}
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||
itti_init(TASK_MAX, tasks_info);
|
||||
// initialize mscgen log after ITTI
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
|
||||
|
||||
|
||||
init_opt();
|
||||
@@ -929,7 +848,7 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
|
||||
|
||||
for (int gnb_id = 0; gnb_id < RC.nb_nr_inst; gnb_id++) {
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ);
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, NRRRC_CONFIGURATION_REQ);
|
||||
NRRRC_CONFIGURATION_REQ(msg_p) = RC.nrrrc[gnb_id]->configuration;
|
||||
LOG_I(GNB_APP, "Sending configuration message to NR_RRC task\n");
|
||||
itti_send_msg_to_task (TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
|
||||
Reference in New Issue
Block a user