Commit 42713b95 authored by Robert Schmidt's avatar Robert Schmidt

Configure complete PDCP in lte-(ue)softmodem

* Instead of partly initializing in read_config_and_init(), everything of
  PDCP is initialized in main() of lte-softmodem
* Omit RC.rrc access in RRU through checking of RC.nb_inst > 0
* Includes FlexRAN, i.e. do not start FlexRAN in RRU
* Function pointers to PDCP functions have to be set explicitly (avoid
  confusion of multiply setting function pointers)
parent b4f462b9
......@@ -2569,12 +2569,4 @@ void read_config_and_init(void) {
memset((void *)RC.rrc[enb_id], 0, sizeof(eNB_RRC_INST));
RCconfig_RRC(enb_id, RC.rrc[enb_id],macrlc_has_f1[enb_id]);
}
if (!NODE_IS_DU(RC.rrc[0]->node_type)) {
pdcp_layer_init();
if ( NODE_IS_CU(RC.rrc[0]->node_type) ) {
pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req, (pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind);
}
}
}
......@@ -2175,9 +2175,6 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
netlink_init();
}
}
/* default interface with rlc (will be modified if CU) */
pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req, (pdcp_data_ind_func_t) pdcp_data_ind);
return pdcp_params.optmask ;
}
......
......@@ -52,10 +52,6 @@ extern boolean_t pdcp_data_ind(
//#define TRACE_RLC_PAYLOAD 1
#define DEBUG_RLC_DATA_REQ 1
#include "proto_agent.h"
//-----------------------------------------------------------------------------
void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char *dataP, const signed long sizeP)
//-----------------------------------------------------------------------------
......
......@@ -575,6 +575,27 @@ int restart_L1L2(module_id_t enb_id) {
return 0;
}
void init_pdcp(void) {
if (!NODE_IS_DU(RC.rrc[0]->node_type)) {
pdcp_layer_init();
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_NOS1)
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
pdcp_module_init(pdcp_initmask);
if (NODE_IS_CU(RC.rrc[0]->node_type)) {
pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req,
(pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind);
} else {
pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req,
(pdcp_data_ind_func_t) pdcp_data_ind);
}
} else {
pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req,
(pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind);
}
}
static void wait_nfapi_init(char *thread_name) {
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
......@@ -654,24 +675,19 @@ int main( int argc, char **argv ) {
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
/* Read configuration */
if (RC.nb_inst > 0)
if (RC.nb_inst > 0) {
read_config_and_init();
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_flexran();
for (i = 0; i < RC.nb_inst; i++) {
flexran_agent_start(i);
}
uint32_t pdcp_initmask = ( IS_SOFTMODEM_NOS1 )? ( PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if ( IS_SOFTMODEM_NOS1)
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_flexran();
for (i = 0; i < RC.nb_inst; i++) {
flexran_agent_start(i);
}
pdcp_module_init(pdcp_initmask);
/* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks
* for monolithic/F1 modes */
init_pdcp();
if (RC.nb_inst > 0) {
if (create_tasks(1) < 0) {
printf("cannot create ITTI tasks\n");
exit(-1);
......@@ -683,7 +699,7 @@ int main( int argc, char **argv ) {
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
} else {
printf("No ITTI, Initializing L1\n");
printf("RC.nb_inst = 0, Initializing L1\n");
RCconfig_L1();
}
......
......@@ -35,6 +35,7 @@
#include "flexran_agent.h"
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "proto_agent.h"
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
......
......@@ -659,6 +659,21 @@ int restart_L1L2(module_id_t enb_id) {
return 0;
}
void init_pdcp(void) {
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}
if (IS_SOFTMODEM_NOKRNMOD)
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
pdcp_module_init(pdcp_initmask);
pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req,
(pdcp_data_ind_func_t) pdcp_data_ind);
}
int main( int argc, char **argv ) {
#if defined (XFORMS)
void *status;
......@@ -734,16 +749,9 @@ int main( int argc, char **argv ) {
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
init_opt();
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1 )? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
if ( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF) ) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}
if ( IS_SOFTMODEM_NOKRNMOD)
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
init_pdcp();
pdcp_module_init( pdcp_initmask );
//TTN for D2D
printf ("RRC control socket\n");
rrc_control_socket_init();
......
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