Commit 83d45796 authored by Wang Tsu-Han's avatar Wang Tsu-Han

Bug fix for UDP loading

parent 34d73131
...@@ -99,6 +99,10 @@ const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS); ...@@ -99,6 +99,10 @@ const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS);
# define ITTI_MEM_SIZE (16 * 1024 * 1024) # define ITTI_MEM_SIZE (16 * 1024 * 1024)
#endif #endif
#ifndef EMULATE_RF
#define EMULATE_RF
#endif
typedef enum task_state_s { typedef enum task_state_s {
TASK_STATE_NOT_CONFIGURED, TASK_STATE_STARTING, TASK_STATE_READY, TASK_STATE_ENDED, TASK_STATE_MAX, TASK_STATE_NOT_CONFIGURED, TASK_STATE_STARTING, TASK_STATE_READY, TASK_STATE_ENDED, TASK_STATE_MAX,
} task_state_t; } task_state_t;
...@@ -436,6 +440,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -436,6 +440,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
destination_task_id, destination_task_id,
itti_get_task_name(destination_task_id)); itti_get_task_name(destination_task_id));
} else { } else {
#ifdef EMULATE_RF
#else
/* We cannot send a message if the task is not running */ /* We cannot send a message if the task is not running */
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY, AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
"Task %s Cannot send message %s (%d) to thread %d, it is not in ready state (%d)!\n", "Task %s Cannot send message %s (%d) to thread %d, it is not in ready state (%d)!\n",
...@@ -444,6 +450,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -444,6 +450,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
message_id, message_id,
destination_thread_id, destination_thread_id,
itti_desc.threads[destination_thread_id].task_state); itti_desc.threads[destination_thread_id].task_state);
#endif
/* Allocate new list element */ /* Allocate new list element */
new = (message_list_t *) itti_malloc (origin_task_id, destination_task_id, sizeof(struct message_list_s)); new = (message_list_t *) itti_malloc (origin_task_id, destination_task_id, sizeof(struct message_list_s));
......
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
# endif # endif
# include "enb_app.h" # include "enb_app.h"
#ifndef EMULATE_RF
#define EMULATE_RF
#endif
int create_tasks(uint32_t enb_nb, uint32_t ue_nb) int create_tasks(uint32_t enb_nb, uint32_t ue_nb)
{ {
itti_wait_ready(1); itti_wait_ready(1);
...@@ -71,11 +75,13 @@ int create_tasks(uint32_t enb_nb, uint32_t ue_nb) ...@@ -71,11 +75,13 @@ int create_tasks(uint32_t enb_nb, uint32_t ue_nb)
LOG_E(S1AP, "Create task for S1AP failed\n"); LOG_E(S1AP, "Create task for S1AP failed\n");
return -1; return -1;
} }
#ifdef EMULATE_RF
#else
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) { if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
LOG_E(UDP_, "Create task for UDP failed\n"); LOG_E(UDP_, "Create task for UDP failed\n");
return -1; return -1;
} }
#endif
if (itti_create_task (TASK_GTPV1_U, &gtpv1u_eNB_task, NULL) < 0) { if (itti_create_task (TASK_GTPV1_U, &gtpv1u_eNB_task, NULL) < 0) {
LOG_E(GTPU, "Create task for GTPV1U failed\n"); LOG_E(GTPU, "Create task for GTPV1U failed\n");
......
...@@ -715,7 +715,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { ...@@ -715,7 +715,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
proc->timestamp_rx = ts-ru->ts_offset; proc->timestamp_rx = -ru->ts_offset;//ts-ru->ts_offset;
if (rxs != fp->samples_per_tti) if (rxs != fp->samples_per_tti)
LOG_E(PHY,"rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs); LOG_E(PHY,"rx_rf: Asked for %d samples, got %d from USRP\n",fp->samples_per_tti,rxs);
...@@ -728,7 +728,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { ...@@ -728,7 +728,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
if (proc->timestamp_rx - old_ts != fp->samples_per_tti) { if (proc->timestamp_rx - old_ts != fp->samples_per_tti) {
//LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - fp->samples_per_tti,ru->ts_offset); //LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - fp->samples_per_tti,ru->ts_offset);
ru->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti); ru->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti);
proc->timestamp_rx = ts-ru->ts_offset; proc->timestamp_rx = -ru->ts_offset;//ts-ru->ts_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