Commit c26a1300 authored by Cedric Roux's avatar Cedric Roux
Browse files

- Mapped malloc/free for ITTI to itti_malloc/itti_free functions for future...

- Mapped malloc/free for ITTI to itti_malloc/itti_free functions for future use within real-time softmodem
- Fixed softmodem build issues with RAL
- Merged ITTI into agilent softmodem for eNB

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4661 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 008c0adb
...@@ -37,10 +37,6 @@ ...@@ -37,10 +37,6 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#ifdef RTAI
# include <rtai_fifos.h>
#endif
#include "assertions.h" #include "assertions.h"
#include <sys/epoll.h> #include <sys/epoll.h>
...@@ -50,6 +46,10 @@ ...@@ -50,6 +46,10 @@
#include "intertask_interface.h" #include "intertask_interface.h"
#include "intertask_interface_dump.h" #include "intertask_interface_dump.h"
#ifdef RTAI
# include <rtai_shm.h>
#endif
#if defined(OAI_EMU) || defined(RTAI) #if defined(OAI_EMU) || defined(RTAI)
# include "vcd_signal_dumper.h" # include "vcd_signal_dumper.h"
#endif #endif
...@@ -87,6 +87,11 @@ const int itti_debug_poll = 0; ...@@ -87,6 +87,11 @@ const int itti_debug_poll = 0;
# define KERNEL_VERSION_PRE_2_6_30 1 # define KERNEL_VERSION_PRE_2_6_30 1
#endif #endif
#ifdef RTAI
# define ITTI_MEM_PAGE_SIZE (1024)
# define ITTI_MEM_SIZE (16 * 1024 * 1024)
#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;
...@@ -174,6 +179,32 @@ typedef struct itti_desc_s { ...@@ -174,6 +179,32 @@ typedef struct itti_desc_s {
static itti_desc_t itti_desc; static itti_desc_t itti_desc;
void *itti_malloc(task_id_t task_id, ssize_t size)
{
void *ptr = NULL;
#ifdef RTAI
// ptr = rt_malloc(size);
ptr = malloc(size);
#else
ptr = malloc(size);
#endif
DevCheck(ptr != NULL, ptr, size, task_id);
return ptr;
}
void itti_free(task_id_t task_id, void *ptr)
{
DevAssert(ptr != NULL);
#ifdef RTAI
free(ptr);
#else
free(ptr);
#endif
}
static inline message_number_t itti_increment_message_number(void) { static inline message_number_t itti_increment_message_number(void) {
/* Atomic operation supported by GCC: returns the current message number /* Atomic operation supported by GCC: returns the current message number
* and then increment it by 1. * and then increment it by 1.
...@@ -227,6 +258,7 @@ void itti_update_lte_time(uint32_t frame, uint8_t slot) ...@@ -227,6 +258,7 @@ void itti_update_lte_time(uint32_t frame, uint8_t slot)
int itti_send_broadcast_message(MessageDef *message_p) { int itti_send_broadcast_message(MessageDef *message_p) {
task_id_t destination_task_id; task_id_t destination_task_id;
task_id_t origin_task_id;
thread_id_t origin_thread_id; thread_id_t origin_thread_id;
uint32_t thread_id; uint32_t thread_id;
int ret = 0; int ret = 0;
...@@ -234,7 +266,8 @@ int itti_send_broadcast_message(MessageDef *message_p) { ...@@ -234,7 +266,8 @@ int itti_send_broadcast_message(MessageDef *message_p) {
DevAssert(message_p != NULL); DevAssert(message_p != NULL);
origin_thread_id = TASK_GET_THREAD_ID(message_p->ittiMsgHeader.originTaskId); origin_task_id = message_p->ittiMsgHeader.originTaskId;
origin_thread_id = TASK_GET_THREAD_ID(origin_task_id);
destination_task_id = TASK_FIRST; destination_task_id = TASK_FIRST;
for (thread_id = THREAD_FIRST; thread_id < itti_desc.thread_max; thread_id++) { for (thread_id = THREAD_FIRST; thread_id < itti_desc.thread_max; thread_id++) {
...@@ -248,7 +281,7 @@ int itti_send_broadcast_message(MessageDef *message_p) { ...@@ -248,7 +281,7 @@ int itti_send_broadcast_message(MessageDef *message_p) {
if (thread_id != origin_thread_id) { if (thread_id != origin_thread_id) {
/* Skip tasks which are not running */ /* Skip tasks which are not running */
if (itti_desc.threads[thread_id].task_state == TASK_STATE_READY) { if (itti_desc.threads[thread_id].task_state == TASK_STATE_READY) {
new_message_p = malloc (sizeof(MessageDef)); new_message_p = itti_malloc (origin_task_id, sizeof(MessageDef));
DevAssert(message_p != NULL); DevAssert(message_p != NULL);
memcpy (new_message_p, message_p, sizeof(MessageDef)); memcpy (new_message_p, message_p, sizeof(MessageDef));
...@@ -278,7 +311,7 @@ inline MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, Messag ...@@ -278,7 +311,7 @@ inline MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, Messag
origin_task_id = itti_get_current_task_id(); origin_task_id = itti_get_current_task_id();
} }
temp = malloc (sizeof(MessageHeader) + size); temp = itti_malloc (origin_task_id, sizeof(MessageHeader) + size);
DevAssert(temp != NULL); DevAssert(temp != NULL);
temp->ittiMsgHeader.messageId = message_id; temp->ittiMsgHeader.messageId = message_id;
...@@ -329,16 +362,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -329,16 +362,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
/* Increment the global message number */ /* Increment the global message number */
message_number = itti_increment_message_number (); message_number = itti_increment_message_number ();
/* itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name,
*
#ifdef RTAI
if ((pthread_self() == itti_desc.threads[TASK_GET_THREAD_ID(origin_task_id)].task_thread) ||
(task_id == TASK_UNKNOWN) ||
((TASK_GET_PARENT_TASK_ID(origin_task_id) != TASK_UNKNOWN) &&
(pthread_self() == itti_desc.threads[TASK_GET_PARENT_TASK_ID(origin_task_id)].task_thread)))
#endif
*/
itti_dump_queue_message (message_number, message, itti_desc.messages_info[message_id].name,
sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize); sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize);
if (destination_task_id != TASK_UNKNOWN) if (destination_task_id != TASK_UNKNOWN)
...@@ -364,7 +388,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -364,7 +388,7 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
itti_desc.threads[destination_thread_id].task_state, message_id); itti_desc.threads[destination_thread_id].task_state, message_id);
/* Allocate new list element */ /* Allocate new list element */
new = (message_list_t *) malloc (sizeof(struct message_list_s)); new = (message_list_t *) itti_malloc (origin_task_id, sizeof(struct message_list_s));
DevAssert(new != NULL); DevAssert(new != NULL);
/* Fill in members */ /* Fill in members */
...@@ -552,7 +576,7 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t ...@@ -552,7 +576,7 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t
} }
DevAssert(message != NULL); DevAssert(message != NULL);
*received_msg = message->msg; *received_msg = message->msg;
free (message); itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message);
return; return;
} }
} }
...@@ -659,6 +683,12 @@ void itti_mark_task_ready(task_id_t task_id) ...@@ -659,6 +683,12 @@ void itti_mark_task_ready(task_id_t task_id)
DevCheck(thread_id < itti_desc.thread_max, thread_id, itti_desc.thread_max, 0); DevCheck(thread_id < itti_desc.thread_max, thread_id, itti_desc.thread_max, 0);
/* Register the thread in itti dump */
itti_dump_thread_use_ring_buffer();
/* Mark the thread as using LFDS queue */
lfds611_queue_use(itti_desc.tasks[task_id].message_queue);
#ifdef RTAI #ifdef RTAI
/* Assign low priority to created threads */ /* Assign low priority to created threads */
{ {
...@@ -668,12 +698,6 @@ void itti_mark_task_ready(task_id_t task_id) ...@@ -668,12 +698,6 @@ void itti_mark_task_ready(task_id_t task_id)
} }
#endif #endif
/* Register the thread in itti dump */
itti_dump_thread_use_ring_buffer();
/* Mark the thread as using LFDS queue */
lfds611_queue_use(itti_desc.tasks[task_id].message_queue);
itti_desc.threads[thread_id].task_state = TASK_STATE_READY; itti_desc.threads[thread_id].task_state = TASK_STATE_READY;
} }
...@@ -779,13 +803,6 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i ...@@ -779,13 +803,6 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i
ITTI_ERROR("lfds611_queue_new failed for task %u\n", task_id); ITTI_ERROR("lfds611_queue_new failed for task %u\n", task_id);
DevAssert(0 == 1); DevAssert(0 == 1);
} }
# ifdef RTAI
if (task_id == TASK_L2L1)
{
ret = rtf_sem_init(56, 0);
}
# endif
} }
/* Initializing each thread */ /* Initializing each thread */
...@@ -844,6 +861,8 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i ...@@ -844,6 +861,8 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i
#ifdef RTAI #ifdef RTAI
/* Start RT relay thread */ /* Start RT relay thread */
DevAssert(pthread_create (&itti_desc.rt_relay_thread, NULL, itti_rt_relay_thread, NULL) >= 0); DevAssert(pthread_create (&itti_desc.rt_relay_thread, NULL, itti_rt_relay_thread, NULL) >= 0);
rt_global_heap_open();
#endif #endif
#if defined(OAI_EMU) || defined(RTAI) #if defined(OAI_EMU) || defined(RTAI)
......
...@@ -225,5 +225,9 @@ void itti_wait_tasks_end(void); ...@@ -225,5 +225,9 @@ void itti_wait_tasks_end(void);
**/ **/
void itti_send_terminate_message(task_id_t task_id); void itti_send_terminate_message(task_id_t task_id);
void *itti_malloc(task_id_t task_id, ssize_t size);
void itti_free(task_id_t task_id, void *ptr);
#endif /* INTERTASK_INTERFACE_H_ */ #endif /* INTERTASK_INTERFACE_H_ */
/* @} */ /* @} */
...@@ -90,12 +90,12 @@ static const int itti_dump_debug = 0; ...@@ -90,12 +90,12 @@ static const int itti_dump_debug = 0;
#define ITTI_DUMP_EXIT_SIGNAL 0x4 #define ITTI_DUMP_EXIT_SIGNAL 0x4
typedef struct itti_dump_queue_item_s { typedef struct itti_dump_queue_item_s {
void *data; MessageDef *data;
uint32_t data_size; uint32_t data_size;
uint32_t message_number; uint32_t message_number;
char message_name[SIGNAL_NAME_LENGTH]; char message_name[SIGNAL_NAME_LENGTH];
uint32_t message_type; uint32_t message_type;
uint32_t message_size; uint32_t message_size;
} itti_dump_queue_item_t; } itti_dump_queue_item_t;
typedef struct { typedef struct {
...@@ -215,6 +215,9 @@ static void itti_dump_fwrite_message(itti_dump_queue_item_t *message) ...@@ -215,6 +215,9 @@ static void itti_dump_fwrite_message(itti_dump_queue_item_t *message)
fwrite (&message->message_number, sizeof(message->message_number), 1, dump_file); fwrite (&message->message_number, sizeof(message->message_number), 1, dump_file);
fwrite (message->message_name, sizeof(message->message_name), 1, dump_file); fwrite (message->message_name, sizeof(message->message_name), 1, dump_file);
fwrite (message->data, message->data_size, 1, dump_file); fwrite (message->data, message->data_size, 1, dump_file);
// #if !defined(RTAI)
fflush (dump_file);
// #endif
} }
} }
...@@ -303,7 +306,8 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa ...@@ -303,7 +306,8 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
return 0; return 0;
} }
int itti_dump_queue_message(message_number_t message_number, int itti_dump_queue_message(task_id_t sender_task,
message_number_t message_number,
MessageDef *message_p, MessageDef *message_p,
const char *message_name, const char *message_name,
const uint32_t message_size) const uint32_t message_size)
...@@ -316,21 +320,22 @@ int itti_dump_queue_message(message_number_t message_number, ...@@ -316,21 +320,22 @@ int itti_dump_queue_message(message_number_t message_number,
DevAssert(message_name != NULL); DevAssert(message_name != NULL);
DevAssert(message_p != NULL); DevAssert(message_p != NULL);
new = malloc(sizeof(itti_dump_queue_item_t)); #if defined(OAI_EMU) || defined(RTAI)
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
if (new == NULL) { #endif
ITTI_DUMP_ERROR("Failed to allocate memory (%s:%d)\n", new = itti_malloc(sender_task, sizeof(itti_dump_queue_item_t));
__FILE__, __LINE__); #if defined(OAI_EMU) || defined(RTAI)
return -1; vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
} #endif
new->data = malloc(message_size); #if defined(OAI_EMU) || defined(RTAI)
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
#endif
new->data = itti_malloc(sender_task, message_size);
#if defined(OAI_EMU) || defined(RTAI)
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
#endif
if (new->data == NULL) {
ITTI_DUMP_ERROR("Failed to allocate memory (%s:%d)\n",
__FILE__, __LINE__);
return -1;
}
memcpy(new->data, message_p, message_size); memcpy(new->data, message_p, message_size);
new->data_size = message_size; new->data_size = message_size;
new->message_number = message_number; new->message_number = message_number;
...@@ -764,13 +769,16 @@ static void itti_dump_user_data_delete_function(void *user_data, void *user_stat ...@@ -764,13 +769,16 @@ static void itti_dump_user_data_delete_function(void *user_data, void *user_stat
if (user_data != NULL) if (user_data != NULL)
{ {
itti_dump_queue_item_t *item; itti_dump_queue_item_t *item;
task_id_t task_id;
item = (itti_dump_queue_item_t *)user_data; item = (itti_dump_queue_item_t *)user_data;
task_id = ITTI_MSG_ORIGIN_ID(item->data);
if (item->data != NULL) if (item->data != NULL)
{ {
free(item->data); itti_free(task_id, item->data);
} }
free(item); itti_free(task_id, item);
} }
} }
......
...@@ -31,13 +31,9 @@ ...@@ -31,13 +31,9 @@
#ifndef INTERTASK_INTERFACE_DUMP_H_ #ifndef INTERTASK_INTERFACE_DUMP_H_
#define INTERTASK_INTERFACE_DUMP_H_ #define INTERTASK_INTERFACE_DUMP_H_
int itti_dump_queue_message(message_number_t message_number, MessageDef *message_p, const char *message_name, int itti_dump_queue_message(task_id_t sender_task, message_number_t message_number, MessageDef *message_p, const char *message_name,
const uint32_t message_size); const uint32_t message_size);
int itti_dump_queue_generic_string_message(message_number_t message_number,
char *string_message,
const uint32_t string_message_length);
int itti_dump_init(const char * const messages_definition_xml, const char * const dump_file_name); int itti_dump_init(const char * const messages_definition_xml, const char * const dump_file_name);
void itti_dump_exit(void); void itti_dump_exit(void);
......
...@@ -76,7 +76,7 @@ void *nas_ue_task(void *args_p) { ...@@ -76,7 +76,7 @@ void *nas_ue_task(void *args_p) {
break; break;
} }
free (msg_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
msg_p = NULL; msg_p = NULL;
} }
} }
......
...@@ -288,7 +288,7 @@ void *s1ap_eNB_task(void *arg) ...@@ -288,7 +288,7 @@ void *s1ap_eNB_task(void *arg)
break; break;
} }
free(received_msg); itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
received_msg = NULL; received_msg = NULL;
} }
......
...@@ -25,7 +25,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -25,7 +25,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
{ {
static int max_pos_fil = 0; static int max_pos_fil = 0;
int temp, i, aa, max_val = 0, max_pos = 0; int temp = 0, i, aa, max_val = 0, max_pos = 0;
int diff; int diff;
short Re,Im,ncoef; short Re,Im,ncoef;
...@@ -73,7 +73,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -73,7 +73,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",phy_vars_ue->frame,phy_vars_ue->rx_offset,max_pos,max_pos_fil,temp); LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",
phy_vars_ue->frame,phy_vars_ue->rx_offset,max_pos,max_pos_fil,temp);
#endif //DEBUG_PHY #endif //DEBUG_PHY
#ifdef CBMIMO1 #ifdef CBMIMO1
......
...@@ -250,7 +250,7 @@ void *eNB_app_task(void *args_p) ...@@ -250,7 +250,7 @@ void *eNB_app_task(void *args_p)
break; break;
} }
free (msg_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
} while (1); } while (1);
#endif #endif
......
...@@ -4281,7 +4281,7 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf ...@@ -4281,7 +4281,7 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf
break; break;
} }
free (msg_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
} }
} while(msg_p != NULL); } while(msg_p != NULL);
#endif #endif
......
...@@ -1310,7 +1310,7 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire ...@@ -1310,7 +1310,7 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire
break; break;
} }
free (msg_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
} }
} while(msg_p != NULL); } while(msg_p != NULL);
#endif #endif
......
...@@ -519,7 +519,7 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) { ...@@ -519,7 +519,7 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) {
RRC_DCCH_DATA_REQ (msg_p).sdu_p, RRC_DCCH_DATA_REQ (msg_p).mode); RRC_DCCH_DATA_REQ (msg_p).sdu_p, RRC_DCCH_DATA_REQ (msg_p).mode);
// Message buffer has been processed, free it now. // Message buffer has been processed, free it now.
free (RRC_DCCH_DATA_REQ (msg_p).sdu_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_REQ (msg_p).sdu_p);
break; break;
default: default:
...@@ -527,7 +527,7 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) { ...@@ -527,7 +527,7 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) {
break; break;
} }
free (msg_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
} }
} while(msg_p != NULL); } while(msg_p != NULL);
#endif #endif
......
...@@ -485,7 +485,7 @@ u8 rrc_lite_data_req(u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 ...@@ -485,7 +485,7 @@ u8 rrc_lite_data_req(u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
u8 *message_buffer; u8 *message_buffer;
message_buffer = malloc (sdu_size); message_buffer = itti_malloc (eNB_flag ? TASK_RRC_ENB : TASK_RRC_UE, sdu_size);
memcpy (message_buffer, Buffer, sdu_size); memcpy (message_buffer, Buffer, sdu_size);
message_p = itti_alloc_new_message (eNB_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ); message_p = itti_alloc_new_message (eNB_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ);
...@@ -524,7 +524,7 @@ void rrc_lite_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u3 ...@@ -524,7 +524,7 @@ void rrc_lite_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u3
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
u8 *message_buffer; u8 *message_buffer;
message_buffer = malloc (sdu_size); message_buffer = itti_malloc (eNB_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, sdu_size);
memcpy (message_buffer, Buffer, sdu_size); memcpy (message_buffer, Buffer, sdu_size);
message_p = itti_alloc_new_message (eNB_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, RRC_DCCH_DATA_IND); message_p = itti_alloc_new_message (eNB_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, RRC_DCCH_DATA_IND);
......
...@@ -273,7 +273,8 @@ void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_ind ...@@ -273,7 +273,8 @@ void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_ind
u8 buffer[100]; u8 buffer[100];
u8 size; u8 size;
size = do_RRCConnectionSetupComplete(buffer, Transaction_id, sizeof(nas_attach_req_guti), nas_attach_req_guti); // size = do_RRCConnectionSetupComplete(buffer, Transaction_id, sizeof(nas_attach_req_guti), nas_attach_req_guti);
size = do_RRCConnectionSetupComplete(buffer, Transaction_id, sizeof(nas_attach_req_imsi), nas_attach_req_imsi);
LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n", LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n",
Mod_id,frame, size, eNB_index); Mod_id,frame, size, eNB_index);
...@@ -2496,7 +2497,7 @@ void *rrc_ue_task(void *args_p) { ...@@ -2496,7 +2497,7 @@ void *rrc_ue_task(void *args_p) {
RRC_DCCH_DATA_IND (msg_p).ue_index); RRC_DCCH_DATA_IND (msg_p).ue_index);
// Message buffer has been processed, free it now. // Message buffer has been processed, free it now.
free (RRC_DCCH_DATA_IND (msg_p).sdu_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND (msg_p).sdu_p);
break; break;
/* NAS messages */ /* NAS messages */
...@@ -2555,7 +2556,7 @@ void *rrc_ue_task(void *args_p) { ...@@ -2555,7 +2556,7 @@ void *rrc_ue_task(void *args_p) {
break; break;
} }
free (msg_p); itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
msg_p = NULL; msg_p = NULL;
} }
} }
......