Commit ca836b6d authored by heshanyun's avatar heshanyun Committed by Haruki NAOI

fix issue about build error of UE

(cherry picked from commit 9f170c0e55b770cb48d6ae0640e5ae647be21c3c)

# Conflicts:
#	targets/RT/USER/lte-enb.c
#	targets/RT/USER/lte-ru.c
parent 7f5b40b0
......@@ -1519,3 +1519,90 @@ void stop_eNB(int nb_inst) {
kill_eNB_proc(inst);
}
}
#if defined(PRE_SCD_THREAD)
void *pre_scd_task( void *param ) {
static int eNB_pre_scd_status;
protocol_ctxt_t ctxt;
int min_rb_unit[MAX_NUM_CCs];
int CC_id;
int Mod_id;
int old_subframe;
eNB_MAC_INST *eNB;
UE_list_t *UE_list;
MessageDef *msg_p = NULL;
/* init */
old_subframe = 0x7FFFFFFF;
itti_mark_task_ready (TASK_MAC_ENB_PRE_SCD);
LOG_I(MAC,"Entering main loop of eNB MAC PreSCD task\n");
// L2-emulator can work only one eNB
if( NFAPI_MODE==NFAPI_MODE_VNF)
Mod_id = 0;
else
Mod_id = RC.ru[0]->eNB_list[0]->Mod_id;
eNB = RC.mac[Mod_id];
UE_list = &eNB->UE_list;
if(g_dact_collection)
{
uint32_t meas_ret;
meas_ret = fjt_meas_ringbuff_create(PRE_THREAD_FLAG);
if( meas_ret == FJT_MEAS_RET_FATAL )
{
LOG_E(GTPU, "fjt_meas_ringbuff_create NG in pre_scd_thread.[ret=%u]",meas_ret);
oai_exit = 1;
return 0;
}
}
while (!oai_exit) {
if(oai_exit) {
break;
}
// Wait for a message
itti_poll_msg(TASK_MAC_ENB_PRE_SCD, &msg_p); /* reception of one message, non-blocking */
if (msg_p != NULL) {
switch (ITTI_MSG_ID(msg_p)) {
case TERMINATE_MESSAGE:
LOG_W(MAC, " *** Exiting eNB MAC PreSCD thread\n");
itti_exit_task();
break;
default:
break;
}
}
if(old_subframe == eNB->subframe){
usleep(100);
continue;
}
memcpy(&pre_scd_eNB_UE_stats,&UE_list->eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &UE_list->active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, Mod_id, ENB_FLAG_YES,
NOT_A_RNTI, eNB->frame, eNB->subframe,Mod_id);
pdcp_run(&ctxt);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_rx_tx(&ctxt, CC_id);
min_rb_unit[CC_id] = get_min_rb_unit(Mod_id, CC_id);
}
pre_scd_nb_rbs_required(Mod_id, eNB->frame, eNB->subframe,min_rb_unit);
old_subframe = eNB->subframe;
}
eNB_pre_scd_status = 0;
return &eNB_pre_scd_status;
}
#endif
......@@ -2089,85 +2089,6 @@ void *ru_thread_synch(void *arg) {
return &ru_thread_synch_status;
}
#if defined(PRE_SCD_THREAD)
void *pre_scd_task( void *param ) {
static int eNB_pre_scd_status;
protocol_ctxt_t ctxt;
int min_rb_unit[MAX_NUM_CCs];
int CC_id;
int Mod_id;
int old_subframe;
eNB_MAC_INST *eNB;
UE_list_t *UE_list;
MessageDef *msg_p = NULL;
/* init */
old_subframe = 0x7FFFFFFF;
itti_mark_task_ready (TASK_MAC_ENB_PRE_SCD);
LOG_I(MAC,"Entering main loop of eNB MAC PreSCD task\n");
// L2-emulator can work only one eNB
if( NFAPI_MODE==NFAPI_MODE_VNF)
Mod_id = 0;
else
Mod_id = RC.ru[0]->eNB_list[0]->Mod_id;
eNB = RC.mac[Mod_id];
UE_list = &eNB->UE_list;
while (!oai_exit) {
if(oai_exit) {
break;
}
// Wait for a message
itti_poll_msg(TASK_MAC_ENB_PRE_SCD, &msg_p); /* reception of one message, non-blocking */
if (msg_p != NULL) {
switch (ITTI_MSG_ID(msg_p)) {
case TERMINATE_MESSAGE:
LOG_W(MAC, " *** Exiting eNB MAC PreSCD thread\n");
itti_exit_task();
break;
default:
break;
}
}
if(old_subframe == eNB->subframe){
usleep(100);
continue;
}
memcpy(&pre_scd_eNB_UE_stats,&UE_list->eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &UE_list->active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, Mod_id, ENB_FLAG_YES,
NOT_A_RNTI, eNB->frame, eNB->subframe,Mod_id);
pdcp_run(&ctxt);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_rx_tx(&ctxt, CC_id);
min_rb_unit[CC_id] = get_min_rb_unit(Mod_id, CC_id);
if (min_rb_unit[CC_id] == -1) {
LOG_E(MAC, "get_min_rb_unit failed\n");
return NULL;
}
}
pre_scd_nb_rbs_required(Mod_id, eNB->frame, eNB->subframe,min_rb_unit);
old_subframe = eNB->subframe;
}
eNB_pre_scd_status = 0;
return &eNB_pre_scd_status;
}
#endif
#ifdef PHY_TX_THREAD
/*!
* \brief The phy tx thread of eNB.
......@@ -3072,13 +2993,6 @@ void init_ru_vnf(void) {
}
}
*/
{
int rc;
LOG_I(MAC,"Creating MAC eNB PreSCD Task\n");
rc = itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, (void *)ru);
AssertFatal(rc >= 0, "Create task for MAC eNB PreSCD failed\n");
}
} // for ru_id
// sleep(1);
......
......@@ -657,6 +657,10 @@ int main( int argc, char **argv ) {
if (NFAPI_MODE==NFAPI_MODE_VNF) {// VNF
#if defined(PRE_SCD_THREAD)
init_ru_vnf(); // ru pointer is necessary for pre_scd.
int rc;
LOG_I(MAC,"Creating MAC eNB PreSCD Task\n");
rc = itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL);
AssertFatal(rc >= 0, "Create task for MAC eNB PreSCD failed\n");
#endif
wait_nfapi_init("main?");
}
......@@ -690,6 +694,15 @@ int main( int argc, char **argv ) {
printf("Initializing RU threads\n");
init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->clock_source,get_softmodem_params()->timing_source,get_softmodem_params()->send_dmrs_sync);
#if defined(PRE_SCD_THREAD)
if (NFAPI_MODE == NFAPI_MONOLITHIC) {
int rc;
LOG_I(MAC,"Creating MAC eNB PreSCD Task\n");
rc = itti_create_task (TASK_MAC_ENB_PRE_SCD, pre_scd_task, NULL);
AssertFatal(rc >= 0, "Create task for MAC eNB PreSCD failed\n");
}
#endif
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
RC.ru[ru_id]->rf_map.card=0;
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
......
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