Commit ee0e6bc4 authored by laurent's avatar laurent Committed by frtabu

Open Cells RF simulator first commit

parent f6cab340
...@@ -585,6 +585,8 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE ...@@ -585,6 +585,8 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE
add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} ) add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} )
set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
add_library(rfsimulator MODULE ${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c)
########################################################## ##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
...@@ -607,7 +609,6 @@ add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmes ...@@ -607,7 +609,6 @@ add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmes
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????") add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c") add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams")
...@@ -628,7 +629,6 @@ add_boolean_option(ENB_MODE True "Swap the include directories between openair2 ...@@ -628,7 +629,6 @@ add_boolean_option(ENB_MODE True "Swap the include directories between openair2
add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: disable it if perf issues") add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: disable it if perf issues")
add_boolean_option(ENABLE_VCD True "always true now, time measurements of proc calls and var displays") add_boolean_option(ENABLE_VCD True "always true now, time measurements of proc calls and var displays")
add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)") add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)")
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False") add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true") add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
...@@ -2239,16 +2239,6 @@ endif (${T_TRACER}) ...@@ -2239,16 +2239,6 @@ endif (${T_TRACER})
# this is documented as https://www.kernel.org/doc/Documentation/kbuild/modules.txt # this is documented as https://www.kernel.org/doc/Documentation/kbuild/modules.txt
###################################### ######################################
# retrieve the compiler options to send it to gccxml
get_directory_property(DirDefs COMPILE_DEFINITIONS )
foreach( d ${DirDefs} )
set(module_cc_opt "${module_cc_opt} -D${d}")
endforeach()
get_directory_property( DirDefs INCLUDE_DIRECTORIES )
foreach( d ${DirDefs} )
set(module_cc_opt "${module_cc_opt} -I${d}")
endforeach()
EXECUTE_PROCESS(COMMAND uname -r EXECUTE_PROCESS(COMMAND uname -r
OUTPUT_VARIABLE os_release OUTPUT_VARIABLE os_release
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
...@@ -2275,7 +2265,6 @@ endfunction(make_driver name dir src) ...@@ -2275,7 +2265,6 @@ endfunction(make_driver name dir src)
# nashmesh module # nashmesh module
################ ################
list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c) list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK")
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag # legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere # so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
if (OAI_NW_DRIVER_USE_NETLINK) if (OAI_NW_DRIVER_USE_NETLINK)
......
This diff is collapsed.
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
//static uint8_t d[3*(MAX_DCI_SIZE_BITS + 16) + 96]; //static uint8_t d[3*(MAX_DCI_SIZE_BITS + 16) + 96];
//static uint8_t w[3*3*(MAX_DCI_SIZE_BITS+16)]; //static uint8_t w[3*3*(MAX_DCI_SIZE_BITS+16)];
void dci_encoding(uint8_t *a, static uint dci_encoding(uint8_t *a,
uint8_t A, uint8_t A,
uint16_t E, uint16_t E,
uint8_t *e, uint8_t *e,
...@@ -98,18 +98,19 @@ void dci_encoding(uint8_t *a, ...@@ -98,18 +98,19 @@ void dci_encoding(uint8_t *a,
#endif #endif
RCC = sub_block_interleaving_cc(D,d+96,w); RCC = sub_block_interleaving_cc(D,d+96,w);
//#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
if (E>1000) printf("Doing DCI rate matching for %d channel bits, RCC %d, e %p\n",E,RCC,e); printf("Doing DCI rate matching for %d channel bits, RCC %d, e %p\n",E,RCC,e);
//#endif #endif
lte_rate_matching_cc(RCC,E,w,e); return lte_rate_matching_cc(RCC,E,w,e);
} }
uint8_t *generate_dci0(uint8_t *dci, uint generate_dci0(uint8_t *dci,
uint8_t *e, uint8_t *eee,
uint8_t DCI_LENGTH, uint8_t DCI_LENGTH,
uint16_t coded_bits, uint16_t coded_bits,
uint16_t rnti) uint16_t rnti)
...@@ -148,9 +149,7 @@ uint8_t *generate_dci0(uint8_t *dci, ...@@ -148,9 +149,7 @@ uint8_t *generate_dci0(uint8_t *dci,
#endif #endif
} }
dci_encoding(dci_flip,DCI_LENGTH,coded_bits,e,rnti); return dci_encoding(dci_flip,DCI_LENGTH,coded_bits,eee,rnti);
return(e+coded_bits);
} }
//uint32_t Y; //uint32_t Y;
...@@ -267,13 +266,12 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -267,13 +266,12 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
{ {
uint8_t *e_ptr;
int8_t L; int8_t L;
uint32_t i, lprime; uint32_t i, lprime;
uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset; uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset;
int16_t re_offset; int16_t re_offset;
uint8_t mi = get_mi(frame_parms,subframe); uint8_t mi = get_mi(frame_parms,subframe);
uint8_t e[DCI_BITS_MAX]; uint8_t eee[DCI_BITS_MAX];
uint32_t Msymb=(DCI_BITS_MAX/2); uint32_t Msymb=(DCI_BITS_MAX/2);
int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb]; int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
...@@ -333,14 +331,14 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -333,14 +331,14 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
* but it has to be validated for all the various cases * but it has to be validated for all the various cases
* so let's just do it for the basic simulator * so let's just do it for the basic simulator
*/ */
memset(e, 2, DCI_BITS_MAX); memset(eee, 2, DCI_BITS_MAX);
#else #else
#if 1 #if 1
// reset all bits to <NIL>, here we set <NIL> elements as 2 // reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX); // memset(e, 2, DCI_BITS_MAX);
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier. // here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0; i<DCI_BITS_MAX; i++) for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1; eee[i]=taus()&1;
#endif #endif
/* clear all bits, the above code may generate too much false detections /* clear all bits, the above code may generate too much false detections
...@@ -349,7 +347,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -349,7 +347,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
//memset(e, 0, DCI_BITS_MAX); //memset(e, 0, DCI_BITS_MAX);
#endif /* BASIC_SIMULATOR */ #endif /* BASIC_SIMULATOR */
e_ptr = e; uint8_t * e_ptr = eee;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,1);
...@@ -366,8 +364,8 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -366,8 +364,8 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
dci_alloc[i].rnti); dci_alloc[i].rnti);
if (dci_alloc[i].firstCCE>=0) { if (dci_alloc[i].firstCCE>=0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu, e_ptr += generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].firstCCE), e_ptr,
dci_alloc[i].dci_length, dci_alloc[i].dci_length,
72*dci_alloc[i].L, 72*dci_alloc[i].L,
dci_alloc[i].rnti); dci_alloc[i].rnti);
...@@ -384,9 +382,19 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -384,9 +382,19 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
//LOG_D(PHY, "num_pdcch_symbols:%d mi:%d nquad:%d\n", num_pdcch_symbols, mi, get_nquad(num_pdcch_symbols, frame_parms, mi)); //LOG_D(PHY, "num_pdcch_symbols:%d mi:%d nquad:%d\n", num_pdcch_symbols, mi, get_nquad(num_pdcch_symbols, frame_parms, mi));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,1);
// Regular 0/1 alternates seems never detected as wrong DCI
// It should be better for spectrum measurements than all 0
// random value creates wrong DCI detection
// scrambler will do some randomization
if ( getenv("RFSIMULATOR") != NULL) {
uint8_t*end=eee+8*get_nquad(num_pdcch_symbols, frame_parms, mi);
uint8_t dummy=0;
for (uint8_t* p=e_ptr; p < end ; p++)
*p=dummy++&1;
}
pdcch_scrambling(frame_parms, pdcch_scrambling(frame_parms,
subframe, subframe,
e, eee,
8*get_nquad(num_pdcch_symbols, frame_parms, mi)); 8*get_nquad(num_pdcch_symbols, frame_parms, mi));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,0);
//72*get_nCCE(num_pdcch_symbols,frame_parms,mi)); //72*get_nCCE(num_pdcch_symbols,frame_parms,mi));
...@@ -401,7 +409,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -401,7 +409,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
else else
gain_lin_QPSK = amp/2; gain_lin_QPSK = amp/2;
e_ptr = e; e_ptr = eee;
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
printf(" PDCCH Modulation, Msymb %d, Msymb2 %d,gain_lin_QPSK %d\n",Msymb,Msymb2,gain_lin_QPSK); printf(" PDCCH Modulation, Msymb %d, Msymb2 %d,gain_lin_QPSK %d\n",Msymb,Msymb2,gain_lin_QPSK);
......
...@@ -351,18 +351,6 @@ int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch, ...@@ -351,18 +351,6 @@ int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch,
/*! \brief DCI Encoding. This routine codes an arbitrary DCI PDU after appending the 8-bit 3GPP CRC. It then applied sub-block interleaving and rate matching.
\param a Pointer to DCI PDU (coded in bytes)
\param A Length of DCI PDU in bits
\param E Length of DCI PDU in coded bits
\param e Pointer to sequence
\param rnti RNTI for CRC scrambling*/
void dci_encoding(uint8_t *a,
uint8_t A,
uint16_t E,
uint8_t *e,
uint16_t rnti);
/*! \brief Top-level DCI entry point. This routine codes an set of DCI PDUs and performs PDCCH modulation, interleaving and mapping. /*! \brief Top-level DCI entry point. This routine codes an set of DCI PDUs and performs PDCCH modulation, interleaving and mapping.
\param num_dci Number of pdcch symbols \param num_dci Number of pdcch symbols
\param num_dci Number of DCI pdus to encode \param num_dci Number of DCI pdus to encode
......
...@@ -56,7 +56,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -56,7 +56,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
uint8_t preamble_index = ue->prach_resources[eNB_id]->ra_PreambleIndex; uint8_t preamble_index = ue->prach_resources[eNB_id]->ra_PreambleIndex;
uint8_t tdd_mapindex = ue->prach_resources[eNB_id]->ra_TDD_map_index; uint8_t tdd_mapindex = ue->prach_resources[eNB_id]->ra_TDD_map_index;
int16_t *prachF = ue->prach_vars[eNB_id]->prachF; int16_t *prachF = ue->prach_vars[eNB_id]->prachF;
static int16_t prach_tmp[45600*2] __attribute__((aligned(32))); static int16_t prach_tmp[45600*4] __attribute__((aligned(32)));
int16_t *prach = prach_tmp; int16_t *prach = prach_tmp;
int16_t *prach2; int16_t *prach2;
int16_t amp = ue->prach_vars[eNB_id]->amp; int16_t amp = ue->prach_vars[eNB_id]->amp;
......
...@@ -380,10 +380,8 @@ int pdcp_module_init (void); ...@@ -380,10 +380,8 @@ int pdcp_module_init (void);
void pdcp_module_cleanup (void); void pdcp_module_cleanup (void);
void pdcp_layer_init (void); void pdcp_layer_init (void);
void pdcp_layer_cleanup (void); void pdcp_layer_cleanup (void);
#if defined(PDCP_USE_NETLINK_QUEUES)
int pdcp_netlink_init (void); int pdcp_netlink_init (void);
#endif
#define PDCP2NW_DRIVER_FIFO 21 #define PDCP2NW_DRIVER_FIFO 21
#define NW_DRIVER2PDCP_FIFO 22 #define NW_DRIVER2PDCP_FIFO 22
......
...@@ -62,7 +62,6 @@ extern int otg_enabled; ...@@ -62,7 +62,6 @@ extern int otg_enabled;
#include "assertions.h" #include "assertions.h"
#ifdef PDCP_USE_NETLINK
#include <sys/socket.h> #include <sys/socket.h>
#include <linux/netlink.h> #include <linux/netlink.h>
#include "NETWORK_DRIVER/UE_IP/constant.h" #include "NETWORK_DRIVER/UE_IP/constant.h"
...@@ -86,7 +85,8 @@ extern uint8_t nfapi_mode; ...@@ -86,7 +85,8 @@ extern uint8_t nfapi_mode;
#ifdef UESIM_EXPANSION #ifdef UESIM_EXPANSION
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX]; extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
#endif #endif
#endif
extern Packet_OTG_List_t *otg_pdcp_buffer; extern Packet_OTG_List_t *otg_pdcp_buffer;
#if defined(LINK_ENB_PDCP_TO_GTPV1U) #if defined(LINK_ENB_PDCP_TO_GTPV1U)
...@@ -118,9 +118,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -118,9 +118,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//#if defined(PDCP_USE_NETLINK) && defined(LINUX)
int ret = 0; int ret = 0;
//#endif
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU #ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
#define THREAD_NAME_LEN 16 #define THREAD_NAME_LEN 16
...@@ -253,11 +251,9 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -253,11 +251,9 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
#else #else
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
#ifdef LINUX
memcpy(NLMSG_DATA(nas_nlh_tx), &(((uint8_t *) sdu_p->data)[sizeof (pdcp_data_ind_header_t) - pdcp_output_header_bytes_to_write]), memcpy(NLMSG_DATA(nas_nlh_tx), &(((uint8_t *) sdu_p->data)[sizeof (pdcp_data_ind_header_t) - pdcp_output_header_bytes_to_write]),
pdcp_output_header_bytes_to_write); pdcp_output_header_bytes_to_write);
nas_nlh_tx->nlmsg_len = pdcp_output_header_bytes_to_write; nas_nlh_tx->nlmsg_len = pdcp_output_header_bytes_to_write;
#endif //LINUX
#endif //PDCP_USE_NETLINK #endif //PDCP_USE_NETLINK
bytes_wrote = pdcp_output_header_bytes_to_write; bytes_wrote = pdcp_output_header_bytes_to_write;
...@@ -281,7 +277,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -281,7 +277,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
#else #else
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
#ifdef LINUX
memcpy(NLMSG_DATA(nas_nlh_tx)+sizeof(pdcp_data_ind_header_t), &(sdu_p->data[sizeof (pdcp_data_ind_header_t)]), pdcp_output_sdu_bytes_to_write); memcpy(NLMSG_DATA(nas_nlh_tx)+sizeof(pdcp_data_ind_header_t), &(sdu_p->data[sizeof (pdcp_data_ind_header_t)]), pdcp_output_sdu_bytes_to_write);
nas_nlh_tx->nlmsg_len += pdcp_output_sdu_bytes_to_write; nas_nlh_tx->nlmsg_len += pdcp_output_sdu_bytes_to_write;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE_PDCP_FLUSH_SIZE, pdcp_output_sdu_bytes_to_write); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_UE_PDCP_FLUSH_SIZE, pdcp_output_sdu_bytes_to_write);
...@@ -319,7 +314,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -319,7 +314,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
((pdcp_data_ind_header_t *)(sdu_p->data))->data_size); ((pdcp_data_ind_header_t *)(sdu_p->data))->data_size);
} }
#endif // LINUX
#endif //PDCP_USE_NETLINK #endif //PDCP_USE_NETLINK
bytes_wrote= pdcp_output_sdu_bytes_to_write; bytes_wrote= pdcp_output_sdu_bytes_to_write;
#endif // PDCP_USE_RT_FIFO #endif // PDCP_USE_RT_FIFO
......
...@@ -70,7 +70,6 @@ extern struct iovec nas_iov_rx; ...@@ -70,7 +70,6 @@ extern struct iovec nas_iov_rx;
extern int nas_sock_fd; extern int nas_sock_fd;
extern struct msghdr nas_msg_rx; extern struct msghdr nas_msg_rx;
#if defined(PDCP_USE_NETLINK_QUEUES)
static pthread_t pdcp_netlink_thread; static pthread_t pdcp_netlink_thread;
/* We use lock-free queues between the User-plane driver running in kernel-space /* We use lock-free queues between the User-plane driver running in kernel-space
...@@ -248,7 +247,7 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -248,7 +247,7 @@ void *pdcp_netlink_thread_fct(void *arg)
new_data_p->pdcp_read_header.data_size); new_data_p->pdcp_read_header.data_size);
} else { } else {
LOG_E(PDCP, "[NETLINK_THREAD] WRONG size %d should be sizeof " LOG_E(PDCP, "[NETLINK_THREAD] WRONG size %d should be sizeof "
"%d ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n", "%ld ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n",
nas_nlh_rx->nlmsg_len, nas_nlh_rx->nlmsg_len,
sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)); sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
} }
...@@ -263,7 +262,7 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -263,7 +262,7 @@ void *pdcp_netlink_thread_fct(void *arg)
if (pdcp_netlink_nb_element_enb[module_id] if (pdcp_netlink_nb_element_enb[module_id]
> PDCP_QUEUE_NB_ELEMENTS) { > PDCP_QUEUE_NB_ELEMENTS) {
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%d)\n", LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%d)\n",
module_id, pdcp_netlink_nb_element_enb); module_id, pdcp_netlink_nb_element_enb[module_id]);
} }
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d\n", module_id); LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d\n", module_id);
...@@ -276,7 +275,7 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -276,7 +275,7 @@ void *pdcp_netlink_thread_fct(void *arg)
if (pdcp_netlink_nb_element_ue[module_id] if (pdcp_netlink_nb_element_ue[module_id]
> PDCP_QUEUE_NB_ELEMENTS) { > PDCP_QUEUE_NB_ELEMENTS) {
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%d)\n", LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%d)\n",
module_id, pdcp_netlink_nb_element_ue); module_id, pdcp_netlink_nb_element_ue[module_id]);
} }
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d\n", module_id); LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d\n", module_id);
...@@ -293,4 +292,3 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -293,4 +292,3 @@ void *pdcp_netlink_thread_fct(void *arg)
return NULL; return NULL;
} }
#endif
...@@ -53,10 +53,8 @@ ...@@ -53,10 +53,8 @@
struct net_device *nasdev[NB_INSTANCES_MAX]; struct net_device *nasdev[NB_INSTANCES_MAX];
#ifdef PDCP_USE_NETLINK
extern void nas_netlink_release(void); extern void nas_netlink_release(void);
extern int nas_netlink_init(void); extern int nas_netlink_init(void);
#endif
//int bytes_wrote; //int bytes_wrote;
//int bytes_read; //int bytes_read;
...@@ -80,39 +78,6 @@ int find_inst(struct net_device *dev) ...@@ -80,39 +78,6 @@ int find_inst(struct net_device *dev)
return(-1); return(-1);
} }
//---------------------------------------------------------------------------
#ifndef PDCP_USE_NETLINK
//void interrupt(void){
void *nas_interrupt(void)
{
//---------------------------------------------------------------------------
uint8_t cxi;
// struct nas_priv *priv=netdev_priv(dev_id);
// unsigned int flags;
// priv->lock = SPIN_LOCK_UNLOCKED;
#ifdef DEBUG_INTERRUPT
printk("INTERRUPT - begin\n");
#endif
// spin_lock_irqsave(&priv->lock,flags);
cxi=0;
// mesh_GC_receive();
// mesh_DC_receive(naspriv->cx+cxi);
#ifndef PDCP_USE_NETLINK
nas_COMMON_QOS_receive();
#endif
// spin_unlock_irqrestore(&priv->lock,flags);
#ifdef DEBUG_INTERRUPT
printk("INTERRUPT: end\n");
#endif
// return 0;
return NULL;
}
#endif //NETLINK
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Called by ifconfig when the device is activated by ifconfig // Called by ifconfig when the device is activated by ifconfig
int nas_open(struct net_device *dev) int nas_open(struct net_device *dev)
......
...@@ -186,9 +186,7 @@ extern struct net_device *nasdev[NB_INSTANCES_MAX]; ...@@ -186,9 +186,7 @@ extern struct net_device *nasdev[NB_INSTANCES_MAX];
extern uint8_t NAS_NULL_IMEI[14]; extern uint8_t NAS_NULL_IMEI[14];
//global variables shared with RRC //global variables shared with RRC
#ifndef PDCP_USE_NETLINK
extern int pdcp_2_nas_irq; extern int pdcp_2_nas_irq;
#endif
//extern uint8_t nas_IMEI[14]; //extern uint8_t nas_IMEI[14];
#endif #endif
...@@ -293,10 +293,6 @@ int nas_mesh_DC_send_cx_establish_request(struct cx_entity *cx,struct nas_priv * ...@@ -293,10 +293,6 @@ int nas_mesh_DC_send_cx_establish_request(struct cx_entity *cx,struct nas_priv *
nas_tool_print_buffer((char *)p,p->length); nas_tool_print_buffer((char *)p,p->length);
#endif #endif
++cx->retry; ++cx->retry;
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
cx->countimer=gpriv->timer_establishment; cx->countimer=gpriv->timer_establishment;
if (bytes_wrote==p->length) { if (bytes_wrote==p->length) {
...@@ -353,11 +349,6 @@ int nas_mesh_DC_send_cx_release_request(struct cx_entity *cx, ...@@ -353,11 +349,6 @@ int nas_mesh_DC_send_cx_release_request(struct cx_entity *cx,
p->length = NAS_TL_SIZE + sizeof(struct NASConnReleaseReq); p->length = NAS_TL_SIZE + sizeof(struct NASConnReleaseReq);
p->nasUEDCPrimitive.conn_release_req.localConnectionRef = cx->lcr; p->nasUEDCPrimitive.conn_release_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.conn_release_req.releaseCause = NAS_CX_RELEASE_UNDEF_CAUSE; p->nasUEDCPrimitive.conn_release_req.releaseCause = NAS_CX_RELEASE_UNDEF_CAUSE;
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
if (bytes_wrote==p->length) { if (bytes_wrote==p->length) {
cx->state=NAS_IDLE; cx->state=NAS_IDLE;
...@@ -441,22 +432,12 @@ void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb, ...@@ -441,22 +432,12 @@ void nas_mesh_DC_send_sig_data_request(struct sk_buff *skb,
p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr; p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD
p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (skb->len)+1; //adds category character p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (skb->len)+1; //adds category character
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
if (bytes_wrote!=p->length) { if (bytes_wrote!=p->length) {
printk("NAS_MESH_DC_SEND_SIG: Header sent failure in DC-FIFO\n"); printk("NAS_MESH_DC_SEND_SIG: Header sent failure in DC-FIFO\n");
return; return;
} }
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], &data_type, 1);
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], skb->data, skb->len);
#endif
if (bytes_wrote != p->length + skb->len + 1) { if (bytes_wrote != p->length + skb->len + 1) {
printk("NAS_MESH_DC_SEND_SIG: Data sent failure in DC-FIFO\n"); printk("NAS_MESH_DC_SEND_SIG: Data sent failure in DC-FIFO\n");
return; return;
...@@ -511,22 +492,12 @@ void nas_mesh_DC_send_peer_sig_data_request(struct cx_entity *cx, uint8_t sig_ca ...@@ -511,22 +492,12 @@ void nas_mesh_DC_send_peer_sig_data_request(struct cx_entity *cx, uint8_t sig_ca
p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr; p->nasUEDCPrimitive.data_transfer_req.localConnectionRef = cx->lcr;
p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD p->nasUEDCPrimitive.data_transfer_req.priority = 3; // TBD
p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (nas_length)+1; //adds category character p->nasUEDCPrimitive.data_transfer_req.nasDataLength = (nas_length)+1; //adds category character
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif
if (bytes_wrote!=p->length) { if (bytes_wrote!=p->length) {
printk("NAS_MESH_DC_PEER_SEND_SIG: Header sent failure in DC-FIFO\n"); printk("NAS_MESH_DC_PEER_SEND_SIG: Header sent failure in DC-FIFO\n");
return; return;
} }
#ifdef PDCP_USE_NETLINK
#else
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], &data_type, 1);
// bytes_wrote += rtf_put(cx->sap[NAS_DC_INPUT_SAPI], (char *)nas_data, nas_length);
#endif
if (bytes_wrote != p->length + nas_length + 1) { if (bytes_wrote != p->length + nas_length + 1) {
printk("NAS_MESH_DC_PEER_SEND_SIG: Data sent failure in DC-FIFO\n"); printk("NAS_MESH_DC_PEER_SEND_SIG: Data sent failure in DC-FIFO\n");
return; return;
...@@ -665,9 +636,6 @@ void nas_mesh_DC_decode_sig_data_ind(struct cx_entity *cx, struct nas_ue_dc_elem ...@@ -665,9 +636,6 @@ void nas_mesh_DC_decode_sig_data_ind(struct cx_entity *cx, struct nas_ue_dc_elem
} }
// End debug information // End debug information
#ifndef PDCP_USE_NETLINK
// nas_COMMON_receive(p->length, p->nasUEDCPrimitive.data_transfer_ind.nasDataLength, cx->sap[NAS_DC_OUTPUT_SAPI]);
#endif
#ifdef NAS_DEBUG_DC #ifdef NAS_DEBUG_DC
printk("NAS_MESH_DC_RECEIVE: DATA_TRANSFER_IND reception\n"); printk("NAS_MESH_DC_RECEIVE: DATA_TRANSFER_IND reception\n");
printk(" Local Connection reference %u\n",p->nasUEDCPrimitive.data_transfer_ind.localConnectionRef); printk(" Local Connection reference %u\n",p->nasUEDCPrimitive.data_transfer_ind.localConnectionRef);
...@@ -842,20 +810,11 @@ int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv) ...@@ -842,20 +810,11 @@ int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv)
} }
// End debug information // End debug information
#ifdef PDCP_USE_NETLINK
#else
// bytes_read = rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI] , gpriv->rbuffer, NAS_TL_SIZE);
#endif
if (bytes_read>0) { if (bytes_read>0) {
struct nas_ue_dc_element *p; struct nas_ue_dc_element *p;
p= (struct nas_ue_dc_element *)(gpriv->rbuffer); p= (struct nas_ue_dc_element *)(gpriv->rbuffer);
//get the rest of the primitive //get the rest of the primitive
#ifdef PDCP_USE_NETLINK
#else
// bytes_read += rtf_get(cx->sap[NAS_DC_OUTPUT_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
#endif
if (bytes_read!=p->length) { if (bytes_read!=p->length) {
printk("NAS_MESH_DC_RECEIVE: Problem while reading primitive header\n"); printk("NAS_MESH_DC_RECEIVE: Problem while reading primitive header\n");
...@@ -981,20 +940,11 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv) ...@@ -981,20 +940,11 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv)
#ifdef NAS_DEBUG_GC #ifdef NAS_DEBUG_GC
printk("NAS_MESH_GC_RECEIVE - begin \n"); printk("NAS_MESH_GC_RECEIVE - begin \n");
#endif #endif
#ifdef PDCP_USE_NETLINK
#else
// bytes_read = rtf_get(gpriv->sap[NAS_GC_SAPI], gpriv->rbuffer, NAS_TL_SIZE);
#endif
if (bytes_read>0) { if (bytes_read>0) {
struct nas_ue_gc_element *p; struct nas_ue_gc_element *p;
p= (struct nas_ue_gc_element *)(gpriv->rbuffer); p= (struct nas_ue_gc_element *)(gpriv->rbuffer);
//get the rest of the primitive //get the rest of the primitive
#ifdef PDCP_USE_NETLINK
#else
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+NAS_TL_SIZE, p->length-NAS_TL_SIZE);
#endif
if (bytes_read!=p->length) { if (bytes_read!=p->length) {
printk("NAS_MESH_GC_RECEIVE: Problem while reading primitive's header\n"); printk("NAS_MESH_GC_RECEIVE: Problem while reading primitive's header\n");
return bytes_read; return bytes_read;
...@@ -1003,10 +953,6 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv) ...@@ -1003,10 +953,6 @@ int nas_mesh_GC_receive(struct nas_priv *gpriv)
// start decoding message // start decoding message
switch (p->type) { switch (p->type) {
case INFO_BROADCAST_IND : case INFO_BROADCAST_IND :
#ifdef PDCP_USE_NETLINK
#else
// bytes_read += rtf_get(gpriv->sap[NAS_GC_SAPI], (uint8_t *)p+p->length, p->nasUEGCPrimitive.broadcast_ind.nasDataLength);
#endif
if (bytes_read!=p->length+p->nasUEGCPrimitive.broadcast_ind.nasDataLength) { if (bytes_read!=p->length+p->nasUEGCPrimitive.broadcast_ind.nasDataLength) {
printk("NAS_MESH_GC_RECEIVE: INFO_BROADCAST_IND reception, Problem while reading primitive's data\n"); printk("NAS_MESH_GC_RECEIVE: INFO_BROADCAST_IND reception, Problem while reading primitive's data\n");
return bytes_read; return bytes_read;
......
...@@ -110,13 +110,11 @@ void nas_COMMON_del_send(struct sk_buff *skb, ...@@ -110,13 +110,11 @@ void nas_COMMON_del_send(struct sk_buff *skb,
struct cx_entity *cx, struct cx_entity *cx,
struct classifier_entity *gc,int inst, struct nas_priv *gpriv); struct classifier_entity *gc,int inst, struct nas_priv *gpriv);
#ifndef PDCP_USE_NETLINK
/** /**
\fn void nas_COMMON_QOS_receive() \fn void nas_COMMON_QOS_receive()
\brief Retrieve PDU from PDCP for connection \brief Retrieve PDU from PDCP for connection
*/ */
void nas_COMMON_QOS_receive(void); void nas_COMMON_QOS_receive(void);
#endif //PDCP_USE_NETLINK
/** /**
\fn struct rb_entity *nas_COMMON_add_rb(struct cx_entity *cx, nasRadioBearerId_t rabi, nasQoSTrafficClass_t qos) \fn struct rb_entity *nas_COMMON_add_rb(struct cx_entity *cx, nasRadioBearerId_t rabi, nasQoSTrafficClass_t qos)
...@@ -168,7 +166,6 @@ struct classifier_entity ...@@ -168,7 +166,6 @@ struct classifier_entity
*/ */
void nas_COMMON_flush_rb(struct cx_entity *cx); void nas_COMMON_flush_rb(struct cx_entity *cx);
#ifdef PDCP_USE_NETLINK
/** /**
\fn int nas_netlink_send(unsigned char *data,unsigned int len) \fn int nas_netlink_send(unsigned char *data,unsigned int len)
\brief Request the transfer of data by PDCP via netlink socket \brief Request the transfer of data by PDCP via netlink socket
...@@ -185,7 +182,6 @@ int nas_netlink_send(unsigned char *data,unsigned int len); ...@@ -185,7 +182,6 @@ int nas_netlink_send(unsigned char *data,unsigned int len);
*/ */
void nas_COMMON_QOS_receive(struct nlmsghdr *nlh); void nas_COMMON_QOS_receive(struct nlmsghdr *nlh);
#endif //PDCP_USE_NETLINK
//nasmesh.c //nasmesh.c
/** /**
...@@ -305,13 +301,11 @@ void nas_tool_print_buffer(char * buffer,int length); ...@@ -305,13 +301,11 @@ void nas_tool_print_buffer(char * buffer,int length);
void nas_print_rb_entity(struct rb_entity *rb); void nas_print_rb_entity(struct rb_entity *rb);
void nas_print_classifier(struct classifier_entity *gc); void nas_print_classifier(struct classifier_entity *gc);
#ifdef PDCP_USE_NETLINK
// nas_netlink.c // nas_netlink.c
void nas_netlink_release(void); void nas_netlink_release(void);
int nas_netlink_init(void); int nas_netlink_init(void);
#endif
/** @} */ /** @} */
#endif #endif
...@@ -800,13 +800,11 @@ rrc_ue_establish_drb( ...@@ -800,13 +800,11 @@ rrc_ue_establish_drb(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
// add descriptor from RRC PDU // add descriptor from RRC PDU
#ifdef PDCP_USE_NETLINK
int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0; int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
/* avoid gcc warnings */ /* avoid gcc warnings */
(void)oip_ifup; (void)oip_ifup;
(void)ip_addr_offset3; (void)ip_addr_offset3;
(void)ip_addr_offset4; (void)ip_addr_offset4;
#endif
LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n", LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity); ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity);
/* /*
......
...@@ -6295,13 +6295,11 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -6295,13 +6295,11 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int i, drb_id; int i, drb_id;
#ifdef PDCP_USE_NETLINK
int oip_ifup = 0; int oip_ifup = 0;
int dest_ip_offset = 0; int dest_ip_offset = 0;
/* avoid gcc warnings */ /* avoid gcc warnings */
(void)oip_ifup; (void)oip_ifup;
(void)dest_ip_offset; (void)dest_ip_offset;
#endif
uint8_t *kRRCenc = NULL; uint8_t *kRRCenc = NULL;
uint8_t *kRRCint = NULL; uint8_t *kRRCint = NULL;
uint8_t *kUPenc = NULL; uint8_t *kUPenc = NULL;
......
...@@ -203,9 +203,6 @@ int nas_timer_init(void) ...@@ -203,9 +203,6 @@ int nas_timer_init(void)
(void) sigdelset (&act.sa_mask, SIGILL); (void) sigdelset (&act.sa_mask, SIGILL);
(void) sigdelset (&act.sa_mask, SIGTRAP); (void) sigdelset (&act.sa_mask, SIGTRAP);
(void) sigdelset (&act.sa_mask, SIGIOT); (void) sigdelset (&act.sa_mask, SIGIOT);
# ifndef LINUX
(void) sigdelset (&act.sa_mask, SIGEMT);
# endif
(void) sigdelset (&act.sa_mask, SIGFPE); (void) sigdelset (&act.sa_mask, SIGFPE);
(void) sigdelset (&act.sa_mask, SIGBUS); (void) sigdelset (&act.sa_mask, SIGBUS);
(void) sigdelset (&act.sa_mask, SIGSEGV); (void) sigdelset (&act.sa_mask, SIGSEGV);
......
...@@ -280,9 +280,6 @@ static int _set_signal_handler(int signal, void (handler)(int)) ...@@ -280,9 +280,6 @@ static int _set_signal_handler(int signal, void (handler)(int))
(void) sigdelset (&act.sa_mask, SIGILL); (void) sigdelset (&act.sa_mask, SIGILL);
(void) sigdelset (&act.sa_mask, SIGTRAP); (void) sigdelset (&act.sa_mask, SIGTRAP);
(void) sigdelset (&act.sa_mask, SIGIOT); (void) sigdelset (&act.sa_mask, SIGIOT);
#ifndef LINUX
(void) sigdelset (&act.sa_mask, SIGEMT);
#endif
(void) sigdelset (&act.sa_mask, SIGFPE); (void) sigdelset (&act.sa_mask, SIGFPE);
(void) sigdelset (&act.sa_mask, SIGBUS); (void) sigdelset (&act.sa_mask, SIGBUS);
(void) sigdelset (&act.sa_mask, SIGSEGV); (void) sigdelset (&act.sa_mask, SIGSEGV);
......
...@@ -353,9 +353,6 @@ static int _set_signal_handler(int signal, void (handler)(int)) ...@@ -353,9 +353,6 @@ static int _set_signal_handler(int signal, void (handler)(int))
(void) sigdelset (&act.sa_mask, SIGILL); (void) sigdelset (&act.sa_mask, SIGILL);
(void) sigdelset (&act.sa_mask, SIGTRAP); (void) sigdelset (&act.sa_mask, SIGTRAP);
(void) sigdelset (&act.sa_mask, SIGIOT); (void) sigdelset (&act.sa_mask, SIGIOT);
#ifndef LINUX
(void) sigdelset (&act.sa_mask, SIGEMT);
#endif
(void) sigdelset (&act.sa_mask, SIGFPE); (void) sigdelset (&act.sa_mask, SIGFPE);
(void) sigdelset (&act.sa_mask, SIGBUS); (void) sigdelset (&act.sa_mask, SIGBUS);
(void) sigdelset (&act.sa_mask, SIGSEGV); (void) sigdelset (&act.sa_mask, SIGSEGV);
......
...@@ -258,9 +258,6 @@ static int _set_signal_handler(int signal, void (handler)(int)) ...@@ -258,9 +258,6 @@ static int _set_signal_handler(int signal, void (handler)(int))
(void) sigdelset (&act.sa_mask, SIGILL); (void) sigdelset (&act.sa_mask, SIGILL);
(void) sigdelset (&act.sa_mask, SIGTRAP); (void) sigdelset (&act.sa_mask, SIGTRAP);
(void) sigdelset (&act.sa_mask, SIGIOT); (void) sigdelset (&act.sa_mask, SIGIOT);
#ifndef LINUX
(void) sigdelset (&act.sa_mask, SIGEMT);
#endif
(void) sigdelset (&act.sa_mask, SIGFPE); (void) sigdelset (&act.sa_mask, SIGFPE);
(void) sigdelset (&act.sa_mask, SIGBUS); (void) sigdelset (&act.sa_mask, SIGBUS);
(void) sigdelset (&act.sa_mask, SIGSEGV); (void) sigdelset (&act.sa_mask, SIGSEGV);
......
...@@ -348,9 +348,6 @@ static int _nas_set_signal_handler(int signal, void (handler)(int)) ...@@ -348,9 +348,6 @@ static int _nas_set_signal_handler(int signal, void (handler)(int))
(void) sigdelset (&act.sa_mask, SIGILL); (void) sigdelset (&act.sa_mask, SIGILL);
(void) sigdelset (&act.sa_mask, SIGTRAP); (void) sigdelset (&act.sa_mask, SIGTRAP);
(void) sigdelset (&act.sa_mask, SIGIOT); (void) sigdelset (&act.sa_mask, SIGIOT);
#ifndef LINUX
(void) sigdelset (&act.sa_mask, SIGEMT);
#endif
(void) sigdelset (&act.sa_mask, SIGFPE); (void) sigdelset (&act.sa_mask, SIGFPE);
(void) sigdelset (&act.sa_mask, SIGBUS); (void) sigdelset (&act.sa_mask, SIGBUS);
(void) sigdelset (&act.sa_mask, SIGSEGV); (void) sigdelset (&act.sa_mask, SIGSEGV);
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <dlfcn.h> #include <dlfcn.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include "common_lib.h" #include "common_lib.h"
#include "common/utils/load_module_shlib.h" #include "common/utils/load_module_shlib.h"
...@@ -97,8 +98,11 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param ...@@ -97,8 +98,11 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
int ret=0; int ret=0;
char *libname; char *libname;
if (flag == RAU_LOCAL_RADIO_HEAD) { if (flag == RAU_LOCAL_RADIO_HEAD) {
libname=OAI_RF_LIBNAME; if (getenv("RFSIMULATOR") != NULL)
shlib_fdesc[0].fname="device_init"; libname="rfsimulator";
else
libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="device_init";
} else { } else {
libname=OAI_TP_LIBNAME; libname=OAI_TP_LIBNAME;
shlib_fdesc[0].fname="transport_init"; shlib_fdesc[0].fname="transport_init";
......
This diff is collapsed.
...@@ -83,9 +83,7 @@ ...@@ -83,9 +83,7 @@
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
#if defined(ENABLE_USE_MME) #if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h" #include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h" #include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif #endif
#endif #endif
......
...@@ -99,9 +99,7 @@ static int DEFENBS[] = {0}; ...@@ -99,9 +99,7 @@ static int DEFENBS[] = {0};
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# if defined(ENABLE_USE_MME) # if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
# include "SIMULATION/ETH_TRANSPORT/proto.h" # include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
# endif # endif
#endif #endif
......
...@@ -33,16 +33,12 @@ ...@@ -33,16 +33,12 @@
#include "SIMULATION/ETH_TRANSPORT/proto.h" #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "flexran_agent.h" #include "flexran_agent.h"
#if defined(ENABLE_USE_MME)
#if defined(ENABLE_ITTI) #include "s1ap_eNB.h"
#if defined(ENABLE_USE_MME) #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif
#endif #endif
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ /* 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" #define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
#define CONFIG_HLP_ULMAXE "set the eNodeB max ULSCH erros\n" #define CONFIG_HLP_ULMAXE "set the eNodeB max ULSCH erros\n"
......
...@@ -1532,7 +1532,6 @@ void *UE_thread(void *arg) { ...@@ -1532,7 +1532,6 @@ void *UE_thread(void *arg) {
PHY_VARS_UE *UE = (PHY_VARS_UE *) arg; PHY_VARS_UE *UE = (PHY_VARS_UE *) arg;
// int tx_enabled = 0; // int tx_enabled = 0;
int dummy_rx[UE->frame_parms.nb_antennas_rx][UE->frame_parms.samples_per_tti] __attribute__((aligned(32)));
openair0_timestamp timestamp,timestamp1; openair0_timestamp timestamp,timestamp1;
void* rxp[NB_ANTENNAS_RX], *txp[NB_ANTENNAS_TX]; void* rxp[NB_ANTENNAS_RX], *txp[NB_ANTENNAS_TX];
int start_rx_stream = 0; int start_rx_stream = 0;
...@@ -1585,67 +1584,107 @@ void *UE_thread(void *arg) { ...@@ -1585,67 +1584,107 @@ void *UE_thread(void *arg) {
if (is_synchronized == 0) { if (is_synchronized == 0) {
if (instance_cnt_synch < 0) { // we can invoke the synch if (instance_cnt_synch < 0) { // we can invoke the synch
// grab 10 ms of signal and wakeup synch thread // grab 10 ms of signal and wakeup synch thread
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) if (UE->mode != loop_through_memory) {
rxp[i] = (void*)&UE->common_vars.rxdata[i][0]; void *dummy_tx[UE->frame_parms.nb_antennas_tx];
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
if (UE->mode != loop_through_memory) dummy_tx[i]=malloc16_clear(UE->frame_parms.samples_per_tti*4);
AssertFatal( UE->frame_parms.samples_per_tti*10 == for(int x=0; x<10; x++) {
UE->rfdevice.trx_read_func(&UE->rfdevice, for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
&timestamp, rxp[i] = ((void*)&UE->common_vars.rxdata[i][0]) + 4*x*UE->frame_parms.samples_per_tti;
rxp, AssertFatal( UE->frame_parms.samples_per_tti ==
UE->frame_parms.samples_per_tti*10, UE->rfdevice.trx_read_func(&UE->rfdevice,
UE->frame_parms.nb_antennas_rx), ""); &timestamp,
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), ""); rxp,
instance_cnt_synch = ++UE->proc.instance_cnt_synch; UE->frame_parms.samples_per_tti,
if (instance_cnt_synch == 0) { UE->frame_parms.nb_antennas_rx), "");
AssertFatal( 0 == pthread_cond_signal(&UE->proc.cond_synch), ""); AssertFatal( UE->frame_parms.samples_per_tti ==
} else { UE->rfdevice.trx_write_func(&UE->rfdevice,
LOG_E( PHY, "[SCHED][UE] UE sync thread busy!!\n" ); timestamp+(2*UE->frame_parms.samples_per_tti) -
exit_fun("nothing to add"); openair0_cfg[0].tx_sample_advance,
dummy_tx,
UE->frame_parms.samples_per_tti,
UE->frame_parms.nb_antennas_tx,
1),"");
}
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
free(dummy_tx[i]);
} }
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
AssertFatal( 0 == ++UE->proc.instance_cnt_synch, "[SCHED][UE] UE sync thread busy!!\n" );
AssertFatal( 0 == pthread_cond_signal(&UE->proc.cond_synch), "");
AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), ""); AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), "");
} else { } else {
#if OAISIM // grab 10 ms of signal into dummy buffer to wait result of sync detection
(void)dummy_rx; /* avoid gcc warnings */
usleep(500);
#else
// grab 10 ms of signal into dummy buffer
if (UE->mode != loop_through_memory) { if (UE->mode != loop_through_memory) {
void *dummy_tx[UE->frame_parms.nb_antennas_tx];
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
dummy_tx[i]=malloc16_clear(UE->frame_parms.samples_per_tti*4);
void *dummy_rx[UE->frame_parms.nb_antennas_rx];
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void*)&dummy_rx[i][0]; dummy_rx[i]=malloc16(UE->frame_parms.samples_per_tti*4);
for (int sf=0; sf<10; sf++) for (int sf=0; sf<10; sf++) {
// printf("Reading dummy sf %d\n",sf); // printf("Reading dummy sf %d\n",sf);
UE->rfdevice.trx_read_func(&UE->rfdevice, UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp, &timestamp,
rxp, dummy_rx,
UE->frame_parms.samples_per_tti, UE->frame_parms.samples_per_tti,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
AssertFatal( UE->frame_parms.samples_per_tti ==
UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+(2*UE->frame_parms.samples_per_tti) -
openair0_cfg[0].tx_sample_advance,
dummy_tx,
UE->frame_parms.samples_per_tti,
UE->frame_parms.nb_antennas_tx,
1),"");
usleep(900); // this sleep improves in the case of simulated RF and doesn't harm with true radio
}
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
free(dummy_tx[i]);
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
free(dummy_rx[i]);
} }
#endif }
}
} // UE->is_synchronized==0
} // UE->is_synchronized==0
else { else {
if (start_rx_stream==0) { if (start_rx_stream==0) {
start_rx_stream=1; start_rx_stream=1;
if (UE->mode != loop_through_memory) { if (UE->mode != loop_through_memory) {
if (UE->no_timing_correction==0) { if (UE->no_timing_correction==0) {
LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode); LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode);
AssertFatal(UE->rx_offset == void *dummy_tx[UE->frame_parms.nb_antennas_tx];
UE->rfdevice.trx_read_func(&UE->rfdevice, for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
&timestamp, dummy_tx[i]=malloc16_clear(UE->frame_parms.samples_per_tti*4);
(void**)UE->common_vars.rxdata, for ( int size=UE->rx_offset ; size > 0 ; size -= UE->frame_parms.samples_per_tti ) {
UE->rx_offset, int unitTransfer=size>UE->frame_parms.samples_per_tti ? UE->frame_parms.samples_per_tti : size ;
UE->frame_parms.nb_antennas_rx),""); AssertFatal(unitTransfer ==
} UE->rfdevice.trx_read_func(&UE->rfdevice,
UE->rx_offset=0; &timestamp,
UE->time_sync_cell=0; (void**)UE->common_vars.rxdata,
//UE->proc.proc_rxtx[0].frame_rx++; unitTransfer,
//UE->proc.proc_rxtx[1].frame_rx++; UE->frame_parms.nb_antennas_rx),"");
for (th_id=0; th_id < RX_NB_TH; th_id++) { AssertFatal( unitTransfer ==
UE->proc.proc_rxtx[th_id].frame_rx++; UE->rfdevice.trx_write_func(&UE->rfdevice,
} timestamp+(2*UE->frame_parms.samples_per_tti) -
openair0_cfg[0].tx_sample_advance,
dummy_tx,
unitTransfer,
UE->frame_parms.nb_antennas_tx,
1),"");
}
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
free(dummy_tx[i]);
}
UE->rx_offset=0;
UE->time_sync_cell=0;
//UE->proc.proc_rxtx[0].frame_rx++;
//UE->proc.proc_rxtx[1].frame_rx++;
for (th_id=0; th_id < RX_NB_TH; th_id++) {
UE->proc.proc_rxtx[th_id].frame_rx++;
}
// read in first symbol // read in first symbol
AssertFatal (UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0 == AssertFatal (UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0 ==
UE->rfdevice.trx_read_func(&UE->rfdevice, UE->rfdevice.trx_read_func(&UE->rfdevice,
...@@ -1703,6 +1742,10 @@ void *UE_thread(void *arg) { ...@@ -1703,6 +1742,10 @@ void *UE_thread(void *arg) {
// compute TO compensation that should be applied for this frame // compute TO compensation that should be applied for this frame
if (UE->no_timing_correction == 0) { if (UE->no_timing_correction == 0) {
if ( getenv(RFSIMULATOR) != NULL && UE->rx_offset) {
//LOG_E(HW,"in simu, rx_offset is not null (impossible): %d\n", UE->rx_offset);
UE->rx_offset=0;
}
if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti && if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti &&
UE->rx_offset > 0 ) UE->rx_offset > 0 )
UE->rx_offset_diff = -1 ; UE->rx_offset_diff = -1 ;
......
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