Commit 7ed0aa1d authored by Robert Schmidt's avatar Robert Schmidt

Add F1U proto_agent calls, remove old code

parent eacd1cfb
...@@ -524,11 +524,6 @@ static inline void updateTimes(uint64_t start, Meas *M, int period, char * txt) ...@@ -524,11 +524,6 @@ static inline void updateTimes(uint64_t start, Meas *M, int period, char * txt)
} }
#endif #endif
pthread_mutex_t async_server_lock;
pthread_cond_t async_server_notify;
int async_server_shutdown;
#endif #endif
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "f1ap_cu_interface_management.h" #include "f1ap_cu_interface_management.h"
#include "f1ap_cu_rrc_message_transfer.h" #include "f1ap_cu_rrc_message_transfer.h"
#include "f1ap_cu_task.h" #include "f1ap_cu_task.h"
#include "proto_agent.h"
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
...@@ -64,6 +65,17 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat ...@@ -64,6 +65,17 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data_from_du->assoc_id = sctp_new_association_resp->assoc_id; f1ap_du_data_from_du->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data_from_du->sctp_in_streams = sctp_new_association_resp->in_streams; f1ap_du_data_from_du->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams; f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
/* setup parameters for F1U and start the server */
const cudu_params_t params = {
.local_interface = NULL, /* is not used */
.local_ipv4_address = RC.rrc[instance]->eth_params_s.my_addr,
.local_port = RC.rrc[instance]->eth_params_s.my_portd,
.remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr,
.remote_port = RC.rrc[instance]->eth_params_s.remote_portd
};
AssertFatal(proto_agent_start(instance, &params) == 0,
"could not start PROTO_AGENT for F1U on instance %d!\n", instance);
} }
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) { void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
#include "f1ap_handlers.h" #include "f1ap_handlers.h"
#include "f1ap_du_interface_management.h" #include "f1ap_du_interface_management.h"
#include "f1ap_du_task.h" #include "f1ap_du_task.h"
#include "proto_agent.h"
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data; f1ap_setup_req_t *f1ap_du_data;
...@@ -95,6 +98,16 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat ...@@ -95,6 +98,16 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams; f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
f1ap_du_data->default_sctp_stream_id = 0; f1ap_du_data->default_sctp_stream_id = 0;
/* setup parameters for F1U and start the server */
const cudu_params_t params = {
.local_interface = NULL, /* is not used */
.local_ipv4_address = RC.mac[instance]->eth_params_n.my_addr,
.local_port = RC.mac[instance]->eth_params_n.my_portd,
.remote_ipv4_address = RC.mac[instance]->eth_params_n.remote_addr,
.remote_port = RC.mac[instance]->eth_params_n.remote_portd
};
AssertFatal(proto_agent_start(instance, &params) == 0,
"could not start PROTO_AGENT for F1U on instance %d!\n", instance);
DU_send_F1_SETUP_REQUEST(instance); DU_send_F1_SETUP_REQUEST(instance);
} }
......
...@@ -189,11 +189,23 @@ boolean_t pdcp_data_req( ...@@ -189,11 +189,23 @@ boolean_t pdcp_data_req(
(unsigned char*)&pdcp_pdu_p->data[0], (unsigned char*)&pdcp_pdu_p->data[0],
sdu_buffer_sizeP); sdu_buffer_sizeP);
#endif #endif
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
/* currently, there is no support to send also the source/destinationL2Id */
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
/* assume good status */
rlc_status = RLC_OP_STATUS_OK;
} else {
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP,
confirmP, sdu_buffer_sizeP, pdcp_pdu_p
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,NULL, NULL ,NULL, NULL
#endif #endif
); );
}
} else { } else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES; rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
LOG_W(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n", LOG_W(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
...@@ -377,21 +389,24 @@ boolean_t pdcp_data_req( ...@@ -377,21 +389,24 @@ boolean_t pdcp_data_req(
#ifndef UETARGET #ifndef UETARGET
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1)) if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1))
{ {
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
/* currently, there is no support to send also the source/destinationL2Id */
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
confirmP, pdcp_pdu_size, pdcp_pdu_p);
/* assume good status */
rlc_status = RLC_OP_STATUS_OK;
} else {
{ rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
LOG_E(PDCP, "proto_agent_send_rlc_data_req()\n"); confirmP, pdcp_pdu_size, pdcp_pdu_p
{
//proto_agent_send_rlc_data_req(0,cudu->cu[j].du_type, ctxt_pP, srb_flagP,
//MBMS_FLAG_NO,rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p);
}
//rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
//,sourceL2Id ,sourceL2Id
//,destinationL2Id ,destinationL2Id
#endif #endif
//); );
} /* end if node_type is CU */
}
free_mem_block(pdcp_pdu_p, __FUNCTION__); free_mem_block(pdcp_pdu_p, __FUNCTION__);
rlc_status = ack_result; rlc_status = ack_result;
......
...@@ -54,68 +54,7 @@ extern boolean_t pdcp_data_ind( ...@@ -54,68 +54,7 @@ extern boolean_t pdcp_data_ind(
#include "rlc_proto_agent_primitives.h" #include "proto_agent.h"
// PROTO AGENT
#ifndef UETARGET
void
async_server_thread_init (void)
{
//create log_list
//log_list_init(&log_list);
//AssertFatal(0, "this should not be reached!\n");
async_server_shutdown = 0;
if ((pthread_mutex_init (&async_server_lock, NULL) != 0)
|| (pthread_cond_init (&async_server_notify, NULL) != 0)) {
return;
}
//if (pthread_create (&async_server_thread, NULL, proto_server_init, (void*) NULL)
// != 0) {
// async_server_thread_finalize();
// return;
//}
}
int
async_server_thread_finalize (void)
{
int err = 0;
if (pthread_mutex_lock (&async_server_lock) != 0) {
return -1;
}
async_server_shutdown = 1;
/* Wake up LOG thread */
if ((pthread_cond_broadcast (&async_server_notify) != 0)
|| (pthread_mutex_unlock (&async_server_lock) != 0)) {
err = -1;
}
if (pthread_join (async_server_thread, NULL) != 0) {
err = -1;
}
if (pthread_mutex_unlock (&async_server_lock) != 0) {
err = -1;
}
if (!err) {
//log_list_free(&log_list);
pthread_mutex_lock (&async_server_lock);
pthread_mutex_destroy (&async_server_lock);
pthread_cond_destroy (&async_server_notify);
}
return err;
}
#endif /*UETARGET*/
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, const signed long sizeP) void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, const signed long sizeP)
...@@ -680,24 +619,13 @@ void rlc_data_ind ( ...@@ -680,24 +619,13 @@ void rlc_data_ind (
T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP)); T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
#endif #endif
#ifndef UETARGET #ifndef UETARGET
if ((!srb_flagP) && (ctxt_pP->enb_flag == 1)) if (ctxt_pP->enb_flag == 1)
{ {
proto_agent_send_pdcp_data_ind(ctxt_pP,
srb_flagP,
MBMS_flagP,
rb_idP,
sdu_sizeP,
sdu_pP);
}
else
{
switch (RC.rrc[ctxt_pP->module_id]->node_type){ switch (RC.rrc[ctxt_pP->module_id]->node_type){
case ngran_eNB_CU : case ngran_eNB_CU :
case ngran_ng_eNB_CU : case ngran_ng_eNB_CU :
case ngran_gNB_CU : case ngran_gNB_CU :
pdcp_data_ind ( proto_agent_send_pdcp_data_ind (
ctxt_pP, ctxt_pP,
1, // srb_flagP, 1, // srb_flagP,
0, // MBMS_flagP, 0, // MBMS_flagP,
...@@ -804,19 +732,6 @@ rlc_module_init (void) ...@@ -804,19 +732,6 @@ rlc_module_init (void)
pool_buffer_init(); pool_buffer_init();
/*
#ifndef UETARGET
// Launch the RLC listening server
// as a separate thread
static int started = 0;
if (started == 0)
{
async_server_thread_init();
started = 1;
}
#endif
*/
return(0); return(0);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -682,14 +682,4 @@ int rlc_module_init(void); ...@@ -682,14 +682,4 @@ int rlc_module_init(void);
#define RLC_REVERSE_VIDEO "\e[7m" #define RLC_REVERSE_VIDEO "\e[7m"
#define RLC_NORMAL_VIDEO "\e[27m" #define RLC_NORMAL_VIDEO "\e[27m"
// PROTO AGENT
pthread_t async_server_thread;
int async_server_thread_finalize (void);
void async_server_thread_init (void);
#endif #endif
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