Commit 36000a3e authored by Laurent Thomas's avatar Laurent Thomas

add F1-U callbacks implem

parent e9421938
...@@ -26,14 +26,8 @@ ...@@ -26,14 +26,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h> #include <inttypes.h>
#include <platform_types.h> #include <platform_types.h>
#include <common/utils/backtrace.h>
#if defined(ENB_MODE)
# define display_backtrace()
#else
# include "backtrace.h"
#endif
void output_log_mem(void);
#define _Assert_Exit_ \ #define _Assert_Exit_ \
fprintf(stderr, "\nExiting execution\n"); \ fprintf(stderr, "\nExiting execution\n"); \
display_backtrace(); \ display_backtrace(); \
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <signal.h> #include <signal.h>
#include <execinfo.h> #include <execinfo.h>
#include "backtrace.h" #include <common/utils/backtrace.h>
/* Obtain a backtrace and print it to stdout. */ /* Obtain a backtrace and print it to stdout. */
void display_backtrace(void) { void display_backtrace(void) {
...@@ -49,8 +49,3 @@ void display_backtrace(void) { ...@@ -49,8 +49,3 @@ void display_backtrace(void) {
free(strings); free(strings);
} }
void backtrace_handle_signal(siginfo_t *info) {
display_backtrace();
//exit(EXIT_FAILURE);
}
...@@ -26,10 +26,7 @@ ...@@ -26,10 +26,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void display_backtrace(void); void display_backtrace(void);
void backtrace_handle_signal(siginfo_t *info);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -52,6 +52,10 @@ boolean_t DURecvCb( protocol_ctxt_t *ctxt_pP, ...@@ -52,6 +52,10 @@ boolean_t DURecvCb( protocol_ctxt_t *ctxt_pP,
const pdcp_transmission_mode_t modeP, const pdcp_transmission_mode_t modeP,
const uint32_t *sourceL2Id, const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id) { const uint32_t *destinationL2Id) {
// The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue
mem_block_t *sdu=get_free_mem_block(sdu_buffer_sizeP, __func__);
memcpy(sdu->data, sdu_buffer_pP, sdu_buffer_sizeP);
du_rlc_data_req(ctxt_pP,srb_flagP, false, rb_idP,muiP, confirmP, sdu_buffer_sizeP, sdu);
return true; return true;
} }
...@@ -64,6 +68,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -64,6 +68,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
F1AP_UEContextSetupRequest_t *container; F1AP_UEContextSetupRequest_t *container;
int i; int i;
DevAssert(pdu); DevAssert(pdu);
AssertFatal(0,"");
msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_UE_CONTEXT_SETUP_REQ); msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_UE_CONTEXT_SETUP_REQ);
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req = &F1AP_UE_CONTEXT_SETUP_REQ(msg_p); f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req = &F1AP_UE_CONTEXT_SETUP_REQ(msg_p);
container = &pdu->choice.initiatingMessage->value.choice.UEContextSetupRequest; container = &pdu->choice.initiatingMessage->value.choice.UEContextSetupRequest;
......
...@@ -160,8 +160,7 @@ static void enqueue_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, ...@@ -160,8 +160,7 @@ static void enqueue_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
const mui_t muiP, const mui_t muiP,
confirm_t confirmP, confirm_t confirmP,
sdu_size_t sdu_sizeP, sdu_size_t sdu_sizeP,
mem_block_t *sdu_pP, mem_block_t *sdu_pP)
void *_unused1, void *_unused2)
{ {
int i; int i;
int logged = 0; int logged = 0;
...@@ -206,9 +205,7 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, ...@@ -206,9 +205,7 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
rb_idP, muiP, rb_idP, muiP,
confirmP, confirmP,
sdu_sizeP, sdu_sizeP,
sdu_pP, sdu_pP);
NULL,
NULL);
} }
/****************************************************************************/ /****************************************************************************/
...@@ -529,7 +526,7 @@ rb_found: ...@@ -529,7 +526,7 @@ rb_found:
LOG_D(PDCP, "%s(): (srb %d) calling rlc_data_req size %d\n", __func__, rb_id, size); LOG_D(PDCP, "%s(): (srb %d) calling rlc_data_req size %d\n", __func__, rb_id, size);
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]); //for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
//printf("\n"); //printf("\n");
enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock, NULL, NULL); enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock);
} }
static void deliver_sdu_srb(void *_ue, nr_pdcp_entity_t *entity, static void deliver_sdu_srb(void *_ue, nr_pdcp_entity_t *entity,
...@@ -613,7 +610,7 @@ srb_found: ...@@ -613,7 +610,7 @@ srb_found:
memblock = get_free_mem_block(size, __FUNCTION__); memblock = get_free_mem_block(size, __FUNCTION__);
memcpy(memblock->data, buf, size); memcpy(memblock->data, buf, size);
enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock, NULL, NULL); enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock);
} }
else { else {
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_DL_RRC_MESSAGE); MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_DL_RRC_MESSAGE);
...@@ -1225,9 +1222,25 @@ boolean_t cu_f1u_data_req( ...@@ -1225,9 +1222,25 @@ boolean_t cu_f1u_data_req(
,const uint32_t *const sourceL2Id ,const uint32_t *const sourceL2Id
,const uint32_t *const destinationL2Id ,const uint32_t *const destinationL2Id
#endif #endif
) ) {
{ MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
LOG_E(PDCP, "Implementation is pending"); GTPV1U_GNB_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t)
+ sdu_buffer_size
+ GTPU_HEADER_OVERHEAD_MAX);
AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(message_p);
uint8_t *gtpu_buffer_p = (uint8_t*)(req+1);
memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX,
sdu_buffer, sdu_buffer_size);
req->buffer = gtpu_buffer_p;
req->length = sdu_buffer_size;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ctxt_pP->rnti;
req->pdusession_id = rb_id;
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
__func__, rb_id, sdu_buffer_size);
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
return true; return true;
} }
......
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