Commit 5521ba10 authored by winckel's avatar winckel

Reorganized RTAI and SIMU makefiles to factorize some common code.

Added some NAS primitive handling on UE side.

pre-ci Ok.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4625 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4711d8da
...@@ -60,6 +60,10 @@ void *nas_ue_task(void *args_p) { ...@@ -60,6 +60,10 @@ void *nas_ue_task(void *args_p) {
LOG_I(NAS, "[UE %d] Received %s\n", Mod_id, msg_name); LOG_I(NAS, "[UE %d] Received %s\n", Mod_id, msg_name);
break; break;
case NAS_DOWNLINK_DATA_IND:
LOG_I(NAS, "[UE %d] Received %s: UEid %u, lenght %u\n", Mod_id, msg_name,
NAS_DOWNLINK_DATA_IND (msg_p).UEid, NAS_DOWNLINK_DATA_IND (msg_p).nasMsg.length);
break;
default: default:
LOG_E(NAS, "[UE %d] Received unexpected message %s\n", Mod_id, msg_name); LOG_E(NAS, "[UE %d] Received unexpected message %s\n", Mod_id, msg_name);
......
...@@ -134,8 +134,8 @@ static ...@@ -134,8 +134,8 @@ static
void openair_rrc_lite_ue_init_security(u8 Mod_id) void openair_rrc_lite_ue_init_security(u8 Mod_id)
{ {
#if defined(ENABLE_SECURITY) #if defined(ENABLE_SECURITY)
uint8_t *kRRCenc; // uint8_t *kRRCenc;
uint8_t *kRRCint; // uint8_t *kRRCint;
char ascii_buffer[65]; char ascii_buffer[65];
uint8_t i; uint8_t i;
...@@ -145,8 +145,7 @@ void openair_rrc_lite_ue_init_security(u8 Mod_id) ...@@ -145,8 +145,7 @@ void openair_rrc_lite_ue_init_security(u8 Mod_id)
sprintf(&ascii_buffer[2 * i], "%02X", UE_rrc_inst[Mod_id].kenb[i]); sprintf(&ascii_buffer[2 * i], "%02X", UE_rrc_inst[Mod_id].kenb[i]);
} }
LOG_T(RRC, "[OSA][UE %02d] kenb = %s\n", LOG_T(RRC, "[OSA][UE %02d] kenb = %s\n", Mod_id, ascii_buffer);
Mod_id, ascii_buffer);
#endif #endif
} }
...@@ -196,7 +195,6 @@ char openair_rrc_lite_ue_init(u8 Mod_id, unsigned char eNB_index){ ...@@ -196,7 +195,6 @@ char openair_rrc_lite_ue_init(u8 Mod_id, unsigned char eNB_index){
return 0; return 0;
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void rrc_ue_generate_RRCConnectionRequest(u8 Mod_id, u32 frame, u8 eNB_index){ void rrc_ue_generate_RRCConnectionRequest(u8 Mod_id, u32 frame, u8 eNB_index){
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
...@@ -288,8 +286,6 @@ void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_ind ...@@ -288,8 +286,6 @@ void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_ind
} }
void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame, u8 eNB_index, uint8_t Transaction_id) { void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame, u8 eNB_index, uint8_t Transaction_id) {
u8 buffer[32], size; u8 buffer[32], size;
...@@ -432,9 +428,8 @@ int rrc_ue_decode_ccch(u8 Mod_id, u32 frame, SRB_INFO *Srb_info, u8 eNB_index){ ...@@ -432,9 +428,8 @@ int rrc_ue_decode_ccch(u8 Mod_id, u32 frame, SRB_INFO *Srb_info, u8 eNB_index){
return rval; return rval;
} }
s32 rrc_ue_establish_srb1(u8 Mod_id,u32 frame,u8 eNB_index, struct SRB_ToAddMod *SRB_config) {
s32 rrc_ue_establish_srb1(u8 Mod_id,u32 frame,u8 eNB_index, // add descriptor from RRC PDU
struct SRB_ToAddMod *SRB_config) { // add descriptor from RRC PDU
u8 lchan_id = DCCH; u8 lchan_id = DCCH;
...@@ -458,8 +453,8 @@ s32 rrc_ue_establish_srb1(u8 Mod_id,u32 frame,u8 eNB_index, ...@@ -458,8 +453,8 @@ s32 rrc_ue_establish_srb1(u8 Mod_id,u32 frame,u8 eNB_index,
return(0); return(0);
} }
s32 rrc_ue_establish_srb2(u8 Mod_id,u32 frame,u8 eNB_index, s32 rrc_ue_establish_srb2(u8 Mod_id,u32 frame,u8 eNB_index, struct SRB_ToAddMod *SRB_config) {
struct SRB_ToAddMod *SRB_config) { // add descriptor from RRC PDU // add descriptor from RRC PDU
u8 lchan_id = DCCH1; u8 lchan_id = DCCH1;
...@@ -576,8 +571,6 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t * ...@@ -576,8 +571,6 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
measObj->measObject.choice.measObjectEUTRA.presenceAntennaPort1, measObj->measObject.choice.measObjectEUTRA.presenceAntennaPort1,
measObj->measObject.choice.measObjectEUTRA.neighCellConfig.buf[0]); measObj->measObject.choice.measObjectEUTRA.neighCellConfig.buf[0]);
UE_rrc_inst[Mod_id].MeasObj[eNB_index][ind-1]=measObj; UE_rrc_inst[Mod_id].MeasObj[eNB_index][ind-1]=measObj;
} }
} }
} }
...@@ -717,7 +710,6 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t * ...@@ -717,7 +710,6 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
} }
} }
void void
rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index, rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
RadioResourceConfigDedicated_t *radioResourceConfigDedicated) { RadioResourceConfigDedicated_t *radioResourceConfigDedicated) {
...@@ -845,7 +837,6 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index, ...@@ -845,7 +837,6 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
} }
LOG_D(RRC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (SRB1 eNB %d) --->][MAC_UE][MOD %02d][]\n", LOG_D(RRC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (SRB1 eNB %d) --->][MAC_UE][MOD %02d][]\n",
frame, Mod_id, eNB_index, Mod_id); frame, Mod_id, eNB_index, Mod_id);
rrc_mac_config_req(Mod_id,0,0,eNB_index, rrc_mac_config_req(Mod_id,0,0,eNB_index,
...@@ -1183,24 +1174,48 @@ void rrc_ue_process_rrcConnectionReconfiguration(u8 Mod_id, u32 frame, ...@@ -1183,24 +1174,48 @@ void rrc_ue_process_rrcConnectionReconfiguration(u8 Mod_id, u32 frame,
LOG_I(RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing RRCConnectionReconfiguration (eNB %d)\n", LOG_I(RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing RRCConnectionReconfiguration (eNB %d)\n",
Mod_id,frame,eNB_index); Mod_id,frame,eNB_index);
if (rrcConnectionReconfiguration->criticalExtensions.present == RRCConnectionReconfiguration__criticalExtensions_PR_c1) { if (rrcConnectionReconfiguration->criticalExtensions.present == RRCConnectionReconfiguration__criticalExtensions_PR_c1) {
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.present == RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8) { if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.present ==
RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8) {
RRCConnectionReconfiguration_r8_IEs_t *rrcConnectionReconfiguration_r8 = &rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8;
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo) { if (rrcConnectionReconfiguration_r8->mobilityControlInfo) {
LOG_I(RRC,"Mobility Control Information is present\n"); LOG_I(RRC,"Mobility Control Information is present\n");
rrc_ue_process_mobilityControlInfo(Mod_id,frame, eNB_index, rrc_ue_process_mobilityControlInfo(Mod_id,frame, eNB_index, rrcConnectionReconfiguration_r8->mobilityControlInfo);
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo);
} }
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig != NULL) { if (rrcConnectionReconfiguration_r8->measConfig != NULL) {
LOG_I(RRC,"Measurement Configuration is present\n"); LOG_I(RRC,"Measurement Configuration is present\n");
rrc_ue_process_measConfig(Mod_id,frame, eNB_index, rrc_ue_process_measConfig(Mod_id,frame, eNB_index,
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig); rrcConnectionReconfiguration_r8->measConfig);
} }
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated) { if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated) {
LOG_I(RRC,"Radio Resource Configuration is present\n"); LOG_I(RRC,"Radio Resource Configuration is present\n");
rrc_ue_process_radioResourceConfigDedicated(Mod_id,frame,eNB_index, rrc_ue_process_radioResourceConfigDedicated(Mod_id,frame,eNB_index, rrcConnectionReconfiguration_r8->radioResourceConfigDedicated);
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated);
} }
#if defined(ENABLE_ITTI)
/* Check if there is dedicated NAS information to forward to NAS */
if (rrcConnectionReconfiguration_r8->dedicatedInfoNASList != NULL) {
int list_count;
uint32_t pdu_length;
uint8_t *pdu_buffer;
MessageDef *msg_p;
for (list_count = 0; list_count < rrcConnectionReconfiguration_r8->dedicatedInfoNASList->list.count; list_count++) {
pdu_length = rrcConnectionReconfiguration_r8->dedicatedInfoNASList->list.array[list_count]->size;
pdu_buffer = rrcConnectionReconfiguration_r8->dedicatedInfoNASList->list.array[list_count]->buf;
msg_p = itti_alloc_new_message(TASK_RRC_UE, NAS_DOWNLINK_DATA_IND);
NAS_DOWNLINK_DATA_IND(msg_p).UEid = Mod_id; // TODO set the UEid to something else ?
NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length = pdu_length;
NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data = pdu_buffer;
itti_send_msg_to_task(TASK_NAS_UE, Mod_id + NB_eNB_INST, msg_p);
}
free (rrcConnectionReconfiguration_r8->dedicatedInfoNASList);
}
#endif
} // c1 present } // c1 present
} // critical extensions present } // critical extensions present
} }
...@@ -1610,7 +1625,6 @@ int decode_BCCH_DLSCH_Message(u8 Mod_id,u32 frame,u8 eNB_index,u8 *Sdu,u8 Sdu_le ...@@ -1610,7 +1625,6 @@ int decode_BCCH_DLSCH_Message(u8 Mod_id,u32 frame,u8 eNB_index,u8 *Sdu,u8 Sdu_le
LOG_D(RRC,"[UE %d] Decoding First SIB1\n",Mod_id); LOG_D(RRC,"[UE %d] Decoding First SIB1\n",Mod_id);
decode_SIB1(Mod_id,eNB_index); decode_SIB1(Mod_id,eNB_index);
//mac_xface->macphy_exit("after decode_SIB1"); //mac_xface->macphy_exit("after decode_SIB1");
} }
} }
break; break;
...@@ -1802,9 +1816,6 @@ void dump_sib2(SystemInformationBlockType2_t *sib2) { ...@@ -1802,9 +1816,6 @@ void dump_sib2(SystemInformationBlockType2_t *sib2) {
LOG_D(RRC,"freqInfo.ul_Bandwidth : %p\n", sib2->freqInfo.ul_Bandwidth); LOG_D(RRC,"freqInfo.ul_Bandwidth : %p\n", sib2->freqInfo.ul_Bandwidth);
LOG_D(RRC,"mbsfn_SubframeConfigList : %p\n", sib2->mbsfn_SubframeConfigList); LOG_D(RRC,"mbsfn_SubframeConfigList : %p\n", sib2->mbsfn_SubframeConfigList);
LOG_D(RRC,"timeAlignmentTimerCommon : %ld\n", sib2->timeAlignmentTimerCommon); LOG_D(RRC,"timeAlignmentTimerCommon : %ld\n", sib2->timeAlignmentTimerCommon);
} }
void dump_sib3(SystemInformationBlockType3_t *sib3) { void dump_sib3(SystemInformationBlockType3_t *sib3) {
......
...@@ -5,6 +5,8 @@ ITTI_MESSAGES_XML = messages.xml ...@@ -5,6 +5,8 @@ ITTI_MESSAGES_XML = messages.xml
ITTI_MESSAGES_FILE = $(ITTI_DIR)/intertask_interface_types.h ITTI_MESSAGES_FILE = $(ITTI_DIR)/intertask_interface_types.h
include $(COMMON_UTILS_DIR)/Makefile.inc include $(COMMON_UTILS_DIR)/Makefile.inc
include $(OPENAIR_TARGETS)/COMMON/Makefile.inc
include $(OPENAIR2_DIR)/NAS/Makefile.inc
$(ITTI_MESSAGES_XML): $(ITTI_MESSAGES_FILE) $(ITTI_MESSAGES_XML): $(ITTI_MESSAGES_FILE)
@echo "Generating messages.xml ..." @echo "Generating messages.xml ..."
...@@ -20,10 +22,6 @@ $(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML) ...@@ -20,10 +22,6 @@ $(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML)
@echo "Generating messages_xml.h ..." @echo "Generating messages_xml.h ..."
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@ @sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
ifdef ENABLE_ITTI
SHARED_DEPENDENCIES = $(ITTI_MESSAGES_H)
endif
ifdef USE_MME ifdef USE_MME
CFLAGS += -DENB_MODE -DENABLE_USE_MME -DENABLE_EVENT_FD -I$(S1AP_DIR) -I$(SCTP_DIR) CFLAGS += -DENB_MODE -DENABLE_USE_MME -DENABLE_EVENT_FD -I$(S1AP_DIR) -I$(SCTP_DIR)
S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl)
...@@ -38,6 +36,18 @@ $(S1AP_OBJ_DIR)/libs1ap.a: force_look ...@@ -38,6 +36,18 @@ $(S1AP_OBJ_DIR)/libs1ap.a: force_look
@$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR) @$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR)
$(SCTP_OBJ_DIR)/libsctp.a: force_look $(SCTP_OBJ_DIR)/libsctp.a: force_look
@$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR) @$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR)
CFLAGS += $(NAS_UE_incl)
OBJ = $(NAS_UE_OBJS)
endif
ifdef ENABLE_ITTI
SHARED_DEPENDENCIES = $(ITTI_MESSAGES_H)
CFLAGS += $(TARGETS_COMMON_incl)
OBJ += $(TARGETS_COMMON_OBJS)
endif endif
ifdef ENABLE_ITTI ifdef ENABLE_ITTI
......
...@@ -41,8 +41,8 @@ else ...@@ -41,8 +41,8 @@ else
RTAI_OBJ += lte-softmodem.o RTAI_OBJ += lte-softmodem.o
endif endif
else else
#OBJ = sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o lte-softmodem.o rt_wrapper.o #OBJ += sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o lte-softmodem.o rt_wrapper.o
OBJ = sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o rt_wrapper.o OBJ += sched_dlsch.o sched_ulsch.o sched_rx_pdsch.o rt_wrapper.o
ifeq ($(USRP),1) ifeq ($(USRP),1)
OBJ += lte-softmodem-usrp.o OBJ += lte-softmodem-usrp.o
else else
......
...@@ -101,14 +101,11 @@ unsigned short config_frames[4] = {2,9,11,13}; ...@@ -101,14 +101,11 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/MATH/oml.h" #include "UTIL/MATH/oml.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "enb_app.h"
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# include "intertask_interface_init.h" # include "intertask_interface_init.h"
# include "timer.h" # include "create_tasks.h"
# if defined(ENABLE_USE_MME) # if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif # endif
#endif #endif
...@@ -233,16 +230,23 @@ void signal_handler(int sig) ...@@ -233,16 +230,23 @@ void signal_handler(int sig)
exit(-1); exit(-1);
} }
else { else {
oai_exit=1; oai_exit = 1;
} }
} }
#endif #endif
void exit_fun(const char* s) void exit_fun(const char* s)
{ {
if (s != NULL) {
printf("Exiting: %s\n",s); printf("Exiting: %s\n",s);
}
oai_exit = 1;
#if defined(ENABLE_ITTI)
itti_send_terminate_message (TASK_UNKNOWN);
#endif
oai_exit=1;
//rt_sleep_ns(FRAME_PERIOD); //rt_sleep_ns(FRAME_PERIOD);
//exit (-1); //exit (-1);
...@@ -528,64 +532,6 @@ void *l2l1_task(void *arg) ...@@ -528,64 +532,6 @@ void *l2l1_task(void *arg)
} }
#endif #endif
#if defined(ENABLE_ITTI)
static int create_tasks(uint32_t enb_nb, uint32_t ue_nb) {
# if defined(ENABLE_USE_MME)
{
if (enb_nb > 0) {
if (itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing SCTP task interface: FAILED\n");
return -1;
}
if (itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing S1AP task interface: FAILED\n");
return -1;
}
}
}
# endif
# ifdef OPENAIR2
{
if (enb_nb > 0) {
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC eNB task interface: FAILED\n");
exit (-1);
}
}
if (ue_nb > 0) {
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC UE task interface: FAILED\n");
exit (-1);
}
}
}
# endif
if (itti_create_task(TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing L2L1 task interface: FAILED\n");
return -1;
}
if (enb_nb > 0) {
/* Last task to create, others task must be ready before its start */
if (itti_create_task(TASK_ENB_APP, eNB_app_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing eNB APP task interface: FAILED\n");
return -1;
}
}
return 0;
}
#endif
/* This is the main eNB thread. It gets woken up by the kernel driver using the RTAI message mechanism (rt_send and rt_receive). */ /* This is the main eNB thread. It gets woken up by the kernel driver using the RTAI message mechanism (rt_send and rt_receive). */
static void *eNB_thread(void *arg) static void *eNB_thread(void *arg)
{ {
...@@ -659,10 +605,7 @@ static void *eNB_thread(void *arg) ...@@ -659,10 +605,7 @@ static void *eNB_thread(void *arg)
LOG_D(HW,"eNB Frame %d, time %llu: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, rt_get_time_ns(), slot, hw_slot, diff); LOG_D(HW,"eNB Frame %d, time %llu: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, rt_get_time_ns(), slot, hw_slot, diff);
slot++; slot++;
if (frame > 0) { if (frame > 0) {
oai_exit = 1; exit_fun(NULL);
#if defined(ENABLE_ITTI)
itti_send_terminate_message (TASK_L2L1);
#endif
} }
if (slot==20){ if (slot==20){
slot=0; slot=0;
...@@ -687,8 +630,8 @@ static void *eNB_thread(void *arg) ...@@ -687,8 +630,8 @@ static void *eNB_thread(void *arg)
delay_cnt++; delay_cnt++;
if (delay_cnt == 10) if (delay_cnt == 10)
{ {
oai_exit = 1;
LOG_D(HW,"eNB Frame %d: HW stopped ... \n",frame); LOG_D(HW,"eNB Frame %d: HW stopped ... \n",frame);
exit_fun(NULL);
} }
mbox_current = ((volatile unsigned int *)DAQ_MBOX)[0]; mbox_current = ((volatile unsigned int *)DAQ_MBOX)[0];
if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround
...@@ -896,7 +839,7 @@ static void *UE_thread(void *arg) ...@@ -896,7 +839,7 @@ static void *UE_thread(void *arg)
if (diff2 <(-7)) { if (diff2 <(-7)) {
LOG_D(HW,"UE Frame %d: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, slot, hw_slot, diff2); LOG_D(HW,"UE Frame %d: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, slot, hw_slot, diff2);
if (frame>0) if (frame>0)
oai_exit=1; exit_fun(NULL);
slot++; slot++;
if (slot==20) { if (slot==20) {
slot=0; slot=0;
...@@ -930,8 +873,8 @@ static void *UE_thread(void *arg) ...@@ -930,8 +873,8 @@ static void *UE_thread(void *arg)
delay_cnt++; delay_cnt++;
if (delay_cnt == 30) if (delay_cnt == 30)
{ {
oai_exit = 1;
LOG_D(HW,"UE frame %d: HW stopped ... \n",frame); LOG_D(HW,"UE frame %d: HW stopped ... \n",frame);
exit_fun(NULL);
} }
mbox_current = ((volatile unsigned int *)DAQ_MBOX)[0]; mbox_current = ((volatile unsigned int *)DAQ_MBOX)[0];
if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround
...@@ -999,7 +942,7 @@ static void *UE_thread(void *arg) ...@@ -999,7 +942,7 @@ static void *UE_thread(void *arg)
PHY_vars_UE_g[0]->lte_frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)); PHY_vars_UE_g[0]->lte_frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int));
*/ */
if (mode == rx_calib_ue) { if (mode == rx_calib_ue) {
oai_exit=1; exit_fun(NULL);
} }
else { else {
is_synchronized = 1; is_synchronized = 1;
...@@ -1793,7 +1736,6 @@ int main(int argc, char **argv) { ...@@ -1793,7 +1736,6 @@ int main(int argc, char **argv) {
if (UE_flag!=1) if (UE_flag!=1)
openair0_start_rt_acquisition(card); openair0_start_rt_acquisition(card);
#ifdef XFORMS #ifdef XFORMS
if (do_forms==1) { if (do_forms==1) {
fl_initialize (&argc, argv, NULL, 0, 0); fl_initialize (&argc, argv, NULL, 0, 0);
......
...@@ -5,18 +5,18 @@ default: oaisim ...@@ -5,18 +5,18 @@ default: oaisim
include $(OPENAIR_TARGETS)/Makefile.common include $(OPENAIR_TARGETS)/Makefile.common
CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native
# FORCE ssse3 for compilation of openair on User Mode Linux
CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ; else if grep --silent User\ Mode\ Linux /proc/cpuinfo ; then echo "-mssse3" ; else echo ""; fi; fi)
CPUFLAGS += $(shell if grep --silent -w sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi)
linux = $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
TOP_DIR = $(OPENAIR1_DIR) TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR) OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR) OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3_TOP = $(OPENAIR3_DIR) OPENAIR3_TOP = $(OPENAIR3_DIR)
OPENAIR3 = $(OPENAIR3_DIR) OPENAIR3 = $(OPENAIR3_DIR)
CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native
# FORCE ssse3 for compilation of openair on User Mode Linux
CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ; else if grep --silent User\ Mode\ Linux /proc/cpuinfo ; then echo "-mssse3" ; else echo ""; fi; fi)
CPUFLAGS += $(shell if grep --silent -w sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi)
linux = $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
CFLAGS += $(COMMON_CFLAGS) -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat CFLAGS += $(COMMON_CFLAGS) -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
# Check if GCC version is greater or equal to 4.4 # Check if GCC version is greater or equal to 4.4
...@@ -187,7 +187,7 @@ include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc ...@@ -187,7 +187,7 @@ include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/ENB_APP/Makefile.inc include $(OPENAIR2_DIR)/ENB_APP/Makefile.inc
INCLUDES = -I$(TOP_DIR) INCLUDES += -I$(TOP_DIR)
INCLUDES += $(L2_incl) INCLUDES += $(L2_incl)
INCLUDES += $(ENB_APP_incl) INCLUDES += $(ENB_APP_incl)
INCLUDES += $(UTIL_incl) INCLUDES += $(UTIL_incl)
...@@ -251,7 +251,7 @@ CFLAGS += $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT ...@@ -251,7 +251,7 @@ CFLAGS += $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT
LIBS += $(PGM_LIBS) LIBS += $(PGM_LIBS)
endif endif
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(NAS_OBJS) OBJ += $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(NAS_OBJS)
OBJ += $(INT_OBJS) $(UTIL_OBJ) $(UTILS_OBJS) $(OAISIM_OBJS_COMMON) $(ENB_APP_OBJS) OBJ += $(INT_OBJS) $(UTIL_OBJ) $(UTILS_OBJS) $(OAISIM_OBJS_COMMON) $(ENB_APP_OBJS)
ifeq ($(OPENAIR2),1) ifeq ($(OPENAIR2),1)
OBJ += $(L2_OBJS) OBJ += $(L2_OBJS)
......
...@@ -71,15 +71,9 @@ char smbv_ip[16]; ...@@ -71,15 +71,9 @@ char smbv_ip[16];
#include "UTIL/OTG/otg_kpi.h" #include "UTIL/OTG/otg_kpi.h"
#include "assertions.h" #include "assertions.h"
#include "enb_app.h"
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
# include "timer.h" # include "create_tasks.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif #endif
#define RF #define RF
...@@ -375,7 +369,7 @@ static s32 UE_id = 0, eNB_id = 0; ...@@ -375,7 +369,7 @@ static s32 UE_id = 0, eNB_id = 0;
static s32 RN_id=0; static s32 RN_id=0;
#endif #endif
static void *l2l1_task(void *args_p) { void *l2l1_task(void *args_p) {
// Framing variables // Framing variables
s32 slot, last_slot, next_slot; s32 slot, last_slot, next_slot;
...@@ -951,64 +945,6 @@ static void *l2l1_task(void *args_p) { ...@@ -951,64 +945,6 @@ static void *l2l1_task(void *args_p) {
return NULL; return NULL;
} }
#if defined(ENABLE_ITTI)
static int create_tasks(uint32_t enb_nb, uint32_t ue_nb) {
# if defined(ENABLE_USE_MME)
{
if (enb_nb > 0) {
if (itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing SCTP task interface: FAILED\n");
return -1;
}
if (itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing S1AP task interface: FAILED\n");
return -1;
}
}
}
# endif
# ifdef OPENAIR2
{
if (enb_nb > 0) {
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC eNB task interface: FAILED\n");
exit (-1);
}
}
if (ue_nb > 0) {
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC UE task interface: FAILED\n");
exit (-1);
}
}
}
# endif
if (itti_create_task(TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing L2L1 task interface: FAILED\n");
return -1;
}
if (enb_nb > 0) {
/* Last task to create, others task must be ready before its start */
if (itti_create_task(TASK_ENB_APP, eNB_app_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing eNB APP task interface: FAILED\n");
return -1;
}
}
return 0;
}
#endif
Packet_OTG_List *otg_pdcp_buffer; Packet_OTG_List *otg_pdcp_buffer;
int main(int argc, char **argv) { int main(int argc, char **argv) {
......
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