first pass
This commit is contained in:
@@ -45,6 +45,8 @@ include_directories(${CONFIG_INCLUDE_DIRS})
|
||||
pkg_search_module(CRYPTO libcrypto REQUIRED)
|
||||
include_directories(${CRYPTO_INCLUDE_DIRS})
|
||||
|
||||
#uhd 4.0 and iris installs by default in /usr/local
|
||||
include_directories("/usr/local/include/")
|
||||
#use native cmake method as this package is not in pkg-config
|
||||
if (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
find_package(Boost REQUIRED)
|
||||
@@ -52,7 +54,7 @@ if (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_IRIS")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/")
|
||||
include_directories("/usr/local/include/")
|
||||
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp)
|
||||
LINK_DIRECTORIES("/usr/local/lib")
|
||||
@@ -336,11 +338,11 @@ endif ()
|
||||
add_definitions("-DASN_DISABLE_OER_SUPPORT")
|
||||
|
||||
#########################
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sanitize=address -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
|
||||
#########################
|
||||
# set a flag for changes in the source code
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0 -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0 --sanitize=address -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2 -fno-delete-null-pointer-checks")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
|
||||
|
||||
@@ -3088,6 +3090,7 @@ add_executable(ocp-gnb
|
||||
${OPENAIR_DIR}/common/utils/nr/nr_common.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${OPENAIR3_DIR}/GTPV1-U/gtpv1u_gNB.c
|
||||
${GTPU_need_ITTI}
|
||||
${XFORMS_SOURCE_NR}
|
||||
${T_SOURCE}
|
||||
|
||||
@@ -77,7 +77,6 @@ int config_sync_var=-1;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
int nfapi_sync_var=-1;
|
||||
uint8_t nfapi_mode = NFAPI_MONOLITHIC; // Default to monolithic mode
|
||||
double cpuf;
|
||||
|
||||
|
||||
@@ -95,6 +94,7 @@ time_stats_t nfapi_meas; // total tx time
|
||||
time_stats_t softmodem_stats_rx_sf; // total rx time
|
||||
// not used but needed for link
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
uint16_t slot_ahead=6;
|
||||
|
||||
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
|
||||
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
|
||||
|
||||
@@ -798,11 +798,11 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
n is the size in bits of the coded block, with the tail */
|
||||
int n2;
|
||||
llr_t y8[3*(n+16)] __attribute__((aligned(16)));
|
||||
llr_t systematic0[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t systematic1[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t systematic2[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t yparity1[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t yparity2[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t systematic0[n+32] __attribute__ ((aligned(16)));
|
||||
llr_t systematic1[n+32] __attribute__ ((aligned(16)));
|
||||
llr_t systematic2[n+32] __attribute__ ((aligned(16)));
|
||||
llr_t yparity1[n+32] __attribute__ ((aligned(16)));
|
||||
llr_t yparity2[n+32] __attribute__ ((aligned(16)));
|
||||
llr_t ext[n+128] __attribute__((aligned(16)));
|
||||
llr_t ext2[n+128] __attribute__((aligned(16)));
|
||||
llr_t alpha[(n+16)*8] __attribute__ ((aligned(16)));
|
||||
@@ -811,7 +811,7 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
llr_t m10[n+16] __attribute__ ((aligned(16)));
|
||||
// int *pi2_p,*pi4_p,*pi5_p,*pi6_p;
|
||||
int *pi4_p,*pi5_p,*pi6_p;
|
||||
llr_t *s,*s1,*s2,*yp1,*yp2,*yp;
|
||||
llr_t *s1,*s2,*yp1,*yp2,*yp;
|
||||
unsigned int i,j,iind;//,pi;
|
||||
unsigned char iteration_cnt=0;
|
||||
unsigned int crc,oldcrc,crc_len;
|
||||
@@ -927,7 +927,6 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
|
||||
yp128 = (int8x16_t *)y8;
|
||||
#endif
|
||||
s = systematic0;
|
||||
s1 = systematic1;
|
||||
s2 = systematic2;
|
||||
yp1 = yparity1;
|
||||
@@ -938,7 +937,7 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
for (i=0; i<16 ; i++ )
|
||||
for (j=0; j<n2; j+=16) {
|
||||
int k=i+j;
|
||||
s[k]=*yp++;
|
||||
systematic0[k]=*yp++;
|
||||
yp1[k]=*yp++;
|
||||
yp2[k]=*yp++;
|
||||
}
|
||||
@@ -948,8 +947,8 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
|
||||
if (n2>n) {
|
||||
/*
|
||||
s[n]=0;s[n+1]=0;s[n+2]=0;s[n+3]=0;
|
||||
s[n+4]=0;s[n+5]=0;s[n+6]=0;s[n+7]=0;
|
||||
systematic0[n]=0;systematic0[n+1]=0;systematic0[n+2]=0;systematic0[n+3]=0;
|
||||
systematic0[n+4]=0;s[n+5]=0;s[n+6]=0;s[n+7]=0;
|
||||
s1[n]=0;s1[n+1]=0;s1[n+2]=0;s1[n+3]=0;
|
||||
s1[n+4]=0;s1[n+5]=0;s1[n+6]=0;s1[n+7]=0;
|
||||
s2[n]=0;s2[n+1]=0;s2[n+2]=0;s2[n+3]=0;
|
||||
@@ -961,26 +960,26 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
|
||||
// Termination
|
||||
for (i=n2; i<n2+3; i++) {
|
||||
s[i]= *yp;
|
||||
s1[i] = s[i] ;
|
||||
s2[i] = s[i];
|
||||
systematic0[i]= *yp;
|
||||
s1[i] = systematic0[i] ;
|
||||
s2[i] = systematic0[i];
|
||||
yp++;
|
||||
yp1[i] = *yp;
|
||||
yp++;
|
||||
#ifdef DEBUG_LOGMAP
|
||||
printf("Term 1 (%u): %d %d\n",i,s[i],yp1[i]);
|
||||
printf("Term 1 (%u): %d %d\n",i,systematic0[i],yp1[i]);
|
||||
#endif //DEBUG_LOGMAP
|
||||
}
|
||||
|
||||
for (i=n2+16; i<n2+19; i++) {
|
||||
s[i]= *yp;
|
||||
s1[i] = s[i] ;
|
||||
s2[i] = s[i];
|
||||
systematic0[i]= *yp;
|
||||
s1[i] = systematic0[i] ;
|
||||
s2[i] = systematic0[i];
|
||||
yp++;
|
||||
yp2[i-16] = *yp;
|
||||
yp++;
|
||||
#ifdef DEBUG_LOGMAP
|
||||
printf("Term 2 (%u): %d %d\n",i-16,s[i],yp2[i-16]);
|
||||
printf("Term 2 (%u): %d %d\n",i-16,systematic0[i],yp2[i-16]);
|
||||
#endif //DEBUG_LOGMAP
|
||||
}
|
||||
|
||||
|
||||
@@ -37,266 +37,82 @@
|
||||
// Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs)
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
|
||||
int* sync_corr_ue0 = NULL;
|
||||
int* sync_corr_ue1 = NULL;
|
||||
int* sync_corr_ue2 = NULL;
|
||||
int sync_tmp[2048*4] __attribute__((aligned(32)));
|
||||
short syncF_tmp[2048*2] __attribute__((aligned(32)));
|
||||
static struct complex16 *primary_synch0_time __attribute__((aligned(32)));
|
||||
static struct complex16 *primary_synch1_time __attribute__((aligned(32)));
|
||||
static struct complex16 *primary_synch2_time __attribute__((aligned(32)));
|
||||
|
||||
static void doIdft(int size, short *in, short *out) {
|
||||
switch (size) {
|
||||
case 6:
|
||||
idft(IDFT_128,in,out,1);
|
||||
break;
|
||||
|
||||
int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *common_vars
|
||||
{
|
||||
int i,k;
|
||||
case 25:
|
||||
idft(IDFT_512,in,out,1);
|
||||
break;
|
||||
|
||||
sync_corr_ue0 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
sync_corr_ue1 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
sync_corr_ue2 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
case 50:
|
||||
idft(IDFT_1024,in,out,1);
|
||||
break;
|
||||
|
||||
if (sync_corr_ue0) {
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"[openair][LTE_PHY][SYNC] sync_corr_ue allocated at %p\n", sync_corr_ue0);
|
||||
#endif
|
||||
//common_vars->sync_corr = sync_corr;
|
||||
} else {
|
||||
LOG_E(PHY,"[openair][LTE_PHY][SYNC] sync_corr_ue0 not allocated\n");
|
||||
return(-1);
|
||||
case 75:
|
||||
idft(IDFT_1536,in,out,1);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
idft(IDFT_2048,in,out,1);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"Unsupported N_RB_DL %d\n",size);
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sync_corr_ue1) {
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"[openair][LTE_PHY][SYNC] sync_corr_ue allocated at %p\n", sync_corr_ue1);
|
||||
#endif
|
||||
//common_vars->sync_corr = sync_corr;
|
||||
} else {
|
||||
LOG_E(PHY,"[openair][LTE_PHY][SYNC] sync_corr_ue1 not allocated\n");
|
||||
return(-1);
|
||||
static void copyPrimary( struct complex16 *out, struct complex16 *in, int ofdmSize) {
|
||||
int k=ofdmSize-36;
|
||||
|
||||
for (int i=0; i<72; i++) {
|
||||
out[k].r = in[i].r>>2; //we need to shift input to avoid overflow in fft
|
||||
out[k].i = in[i].i>>2;
|
||||
k++;
|
||||
|
||||
if (k >= ofdmSize) {
|
||||
k++; // skip DC carrier
|
||||
k-=ofdmSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sync_corr_ue2) {
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"[openair][LTE_PHY][SYNC] sync_corr_ue allocated at %p\n", sync_corr_ue2);
|
||||
#endif
|
||||
//common_vars->sync_corr = sync_corr;
|
||||
} else {
|
||||
LOG_E(PHY,"[openair][LTE_PHY][SYNC] sync_corr_ue2 not allocated\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// primary_synch0_time = (int *)malloc16((frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
primary_synch0_time = (int16_t *)malloc16((frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
|
||||
if (primary_synch0_time) {
|
||||
// bzero(primary_synch0_time,(frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
bzero(primary_synch0_time,(frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"[openair][LTE_PHY][SYNC] primary_synch0_time allocated at %p\n", primary_synch0_time);
|
||||
#endif
|
||||
} else {
|
||||
LOG_E(PHY,"[openair][LTE_PHY][SYNC] primary_synch0_time not allocated\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// primary_synch1_time = (int *)malloc16((frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
primary_synch1_time = (int16_t *)malloc16((frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
|
||||
if (primary_synch1_time) {
|
||||
// bzero(primary_synch1_time,(frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
bzero(primary_synch1_time,(frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"[openair][LTE_PHY][SYNC] primary_synch1_time allocated at %p\n", primary_synch1_time);
|
||||
#endif
|
||||
} else {
|
||||
LOG_E(PHY,"[openair][LTE_PHY][SYNC] primary_synch1_time not allocated\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// primary_synch2_time = (int *)malloc16((frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
primary_synch2_time = (int16_t *)malloc16((frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
|
||||
if (primary_synch2_time) {
|
||||
// bzero(primary_synch2_time,(frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
bzero(primary_synch2_time,(frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"[openair][LTE_PHY][SYNC] primary_synch2_time allocated at %p\n", primary_synch2_time);
|
||||
#endif
|
||||
} else {
|
||||
LOG_E(PHY,"[openair][LTE_PHY][SYNC] primary_synch2_time not allocated\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) { // LTE_UE_COMMON *common_vars
|
||||
struct complex16 syncF_tmp[2048]__attribute__((aligned(32)))= {0};
|
||||
int sz=frame_parms->ofdm_symbol_size*sizeof(*primary_synch0_time);
|
||||
AssertFatal( NULL != (primary_synch0_time = (struct complex16 *)malloc16(sz)),"");
|
||||
bzero(primary_synch0_time,sz);
|
||||
AssertFatal( NULL != (primary_synch1_time = (struct complex16 *)malloc16(sz)),"");
|
||||
bzero(primary_synch1_time,sz);
|
||||
AssertFatal( NULL != (primary_synch2_time = (struct complex16 *)malloc16(sz)),"");
|
||||
bzero(primary_synch2_time,sz);
|
||||
// generate oversampled sync_time sequences
|
||||
k=frame_parms->ofdm_symbol_size-36;
|
||||
copyPrimary( syncF_tmp, (struct complex16 *) primary_synch0, frame_parms->ofdm_symbol_size);
|
||||
doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch0_time);
|
||||
copyPrimary( syncF_tmp, (struct complex16 *) primary_synch1, frame_parms->ofdm_symbol_size);
|
||||
doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch1_time);
|
||||
copyPrimary( syncF_tmp, (struct complex16 *) primary_synch2, frame_parms->ofdm_symbol_size);
|
||||
doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch2_time);
|
||||
|
||||
for (i=0; i<72; i++) {
|
||||
syncF_tmp[2*k] = primary_synch0[2*i]>>2; //we need to shift input to avoid overflow in fft
|
||||
syncF_tmp[2*k+1] = primary_synch0[2*i+1]>>2;
|
||||
k++;
|
||||
|
||||
if (k >= frame_parms->ofdm_symbol_size) {
|
||||
k++; // skip DC carrier
|
||||
k-=frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft(IDFT_128,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft(IDFT_512,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft(IDFT_1024,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft(IDFT_1536,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp,
|
||||
1); /// complex output
|
||||
break;
|
||||
case 100:
|
||||
idft(IDFT_2048,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0; i<frame_parms->ofdm_symbol_size; i++)
|
||||
((int32_t*)primary_synch0_time)[i] = sync_tmp[i];
|
||||
|
||||
k=frame_parms->ofdm_symbol_size-36;
|
||||
|
||||
for (i=0; i<72; i++) {
|
||||
syncF_tmp[2*k] = primary_synch1[2*i]>>2; //we need to shift input to avoid overflow in fft
|
||||
syncF_tmp[2*k+1] = primary_synch1[2*i+1]>>2;
|
||||
k++;
|
||||
|
||||
if (k >= frame_parms->ofdm_symbol_size) {
|
||||
k++; // skip DC carrier
|
||||
k-=frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft(IDFT_128,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft(IDFT_512,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft(IDFT_1024,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft(IDFT_1536,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft(IDFT_2048,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0; i<frame_parms->ofdm_symbol_size; i++)
|
||||
((int32_t*)primary_synch1_time)[i] = sync_tmp[i];
|
||||
|
||||
k=frame_parms->ofdm_symbol_size-36;
|
||||
|
||||
for (i=0; i<72; i++) {
|
||||
syncF_tmp[2*k] = primary_synch2[2*i]>>2; //we need to shift input to avoid overflow in fft
|
||||
syncF_tmp[2*k+1] = primary_synch2[2*i+1]>>2;
|
||||
k++;
|
||||
|
||||
if (k >= frame_parms->ofdm_symbol_size) {
|
||||
k++; // skip DC carrier
|
||||
k-=frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft(IDFT_128,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft(IDFT_512,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft(IDFT_1024,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft(IDFT_1536,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft(IDFT_2048,(short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0; i<frame_parms->ofdm_symbol_size; i++)
|
||||
((int32_t*)primary_synch2_time)[i] = sync_tmp[i];
|
||||
|
||||
|
||||
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){
|
||||
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)) {
|
||||
LOG_M("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
LOG_M("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
LOG_M("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
void lte_sync_time_free(void)
|
||||
{
|
||||
if (sync_corr_ue0) {
|
||||
LOG_D(PHY,"Freeing sync_corr_ue (%p)...\n",sync_corr_ue0);
|
||||
free(sync_corr_ue0);
|
||||
}
|
||||
|
||||
if (sync_corr_ue1) {
|
||||
LOG_D(PHY,"Freeing sync_corr_ue (%p)...\n",sync_corr_ue1);
|
||||
free(sync_corr_ue1);
|
||||
}
|
||||
|
||||
if (sync_corr_ue2) {
|
||||
LOG_D(PHY,"Freeing sync_corr_ue (%p)...\n",sync_corr_ue2);
|
||||
free(sync_corr_ue2);
|
||||
}
|
||||
|
||||
void lte_sync_time_free(void) {
|
||||
if (primary_synch0_time) {
|
||||
LOG_D(PHY,"Freeing primary_sync0_time ...\n");
|
||||
free(primary_synch0_time);
|
||||
@@ -312,126 +128,81 @@ void lte_sync_time_free(void)
|
||||
free(primary_synch2_time);
|
||||
}
|
||||
|
||||
sync_corr_ue0 = NULL;
|
||||
sync_corr_ue1 = NULL;
|
||||
sync_corr_ue2 = NULL;
|
||||
primary_synch0_time = NULL;
|
||||
primary_synch1_time = NULL;
|
||||
primary_synch2_time = NULL;
|
||||
}
|
||||
|
||||
|
||||
static inline int abs32(int x)
|
||||
{
|
||||
return (((int)((short*)&x)[0])*((int)((short*)&x)[0]) + ((int)((short*)&x)[1])*((int)((short*)&x)[1]));
|
||||
static inline int abs32(int x) {
|
||||
return (((int)((short *)&x)[0])*((int)((short *)&x)[0]) + ((int)((short *)&x)[1])*((int)((short *)&x)[1]));
|
||||
}
|
||||
|
||||
static inline double absF(struct complexd x) {
|
||||
return x.r*x.r+x.i*x.i;
|
||||
}
|
||||
|
||||
#define complexNull(c) bzero((void*) &(c), sizeof(c))
|
||||
|
||||
#define SHIFT 17
|
||||
|
||||
|
||||
int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int *eNB_id)
|
||||
{
|
||||
int *eNB_id) {
|
||||
// perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
unsigned int n, ar, s, peak_pos, peak_val, sync_source;
|
||||
int result,result2;
|
||||
int sync_out[3] = {0,0,0},sync_out2[3] = {0,0,0};
|
||||
int tmp[3] = {0,0,0};
|
||||
struct complexd sync_out[3]= {0}, sync_out2[3]= {0};
|
||||
int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti>>1;
|
||||
|
||||
//LOG_D(PHY,"[SYNC TIME] Calling sync_time.\n");
|
||||
AssertFatal(sync_corr_ue0 != NULL,
|
||||
"sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
AssertFatal(sync_corr_ue1 != NULL,
|
||||
"sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
AssertFatal(sync_corr_ue2 != NULL,
|
||||
"sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
|
||||
peak_val = 0;
|
||||
peak_pos = 0;
|
||||
sync_source = 0;
|
||||
|
||||
|
||||
for (n=0; n<length; n+=4) {
|
||||
|
||||
sync_corr_ue0[n] = 0;
|
||||
sync_corr_ue0[n+length] = 0;
|
||||
sync_corr_ue1[n] = 0;
|
||||
sync_corr_ue1[n+length] = 0;
|
||||
sync_corr_ue2[n] = 0;
|
||||
sync_corr_ue2[n+length] = 0;
|
||||
|
||||
for (s=0; s<3; s++) {
|
||||
sync_out[s]=0;
|
||||
sync_out2[s]=0;
|
||||
complexNull(sync_out[s]);
|
||||
complexNull(sync_out2[s]);
|
||||
}
|
||||
|
||||
// if (n<(length-frame_parms->ofdm_symbol_size-frame_parms->nb_prefix_samples)) {
|
||||
if (n<(length-frame_parms->ofdm_symbol_size)) {
|
||||
|
||||
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
result = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
|
||||
((short*)sync_corr_ue0)[2*n] += ((short*) &result)[0];
|
||||
((short*)sync_corr_ue0)[2*n+1] += ((short*) &result)[1];
|
||||
((short*)sync_corr_ue0)[2*(length+n)] += ((short*) &result2)[0];
|
||||
((short*)sync_corr_ue0)[(2*(length+n))+1] += ((short*) &result2)[1];
|
||||
((short*)sync_out)[0] += ((short*) &result)[0];
|
||||
((short*)sync_out)[1] += ((short*) &result)[1];
|
||||
((short*)sync_out2)[0] += ((short*) &result2)[0];
|
||||
((short*)sync_out2)[1] += ((short*) &result2)[1];
|
||||
result = dot_product((short *)primary_synch0_time, (short *) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short *)primary_synch0_time, (short *) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
sync_out[0].r += ((short *) &result)[0];
|
||||
sync_out[0].i += ((short *) &result)[1];
|
||||
sync_out2[0].r += ((short *) &result2)[0];
|
||||
sync_out2[0].i += ((short *) &result2)[1];
|
||||
}
|
||||
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
((short*)sync_corr_ue1)[2*n] += ((short*) &result)[0];
|
||||
((short*)sync_corr_ue1)[2*n+1] += ((short*) &result)[1];
|
||||
((short*)sync_corr_ue1)[2*(length+n)] += ((short*) &result2)[0];
|
||||
((short*)sync_corr_ue1)[(2*(length+n))+1] += ((short*) &result2)[1];
|
||||
|
||||
((short*)sync_out)[2] += ((short*) &result)[0];
|
||||
((short*)sync_out)[3] += ((short*) &result)[1];
|
||||
((short*)sync_out2)[2] += ((short*) &result2)[0];
|
||||
((short*)sync_out2)[3] += ((short*) &result2)[1];
|
||||
result = dot_product((short *)primary_synch1_time, (short *) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short *)primary_synch1_time, (short *) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
sync_out[1].r += ((short *) &result)[0];
|
||||
sync_out[1].i += ((short *) &result)[1];
|
||||
sync_out2[1].r += ((short *) &result2)[0];
|
||||
sync_out2[1].i += ((short *) &result2)[1];
|
||||
}
|
||||
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
((short*)sync_corr_ue2)[2*n] += ((short*) &result)[0];
|
||||
((short*)sync_corr_ue2)[2*n+1] += ((short*) &result)[1];
|
||||
((short*)sync_corr_ue2)[2*(length+n)] += ((short*) &result2)[0];
|
||||
((short*)sync_corr_ue2)[(2*(length+n))+1] += ((short*) &result2)[1];
|
||||
((short*)sync_out)[4] += ((short*) &result)[0];
|
||||
((short*)sync_out)[5] += ((short*) &result)[1];
|
||||
((short*)sync_out2)[4] += ((short*) &result2)[0];
|
||||
((short*)sync_out2)[5] += ((short*) &result2)[1];
|
||||
result = dot_product((short *)primary_synch2_time, (short *) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short *)primary_synch2_time, (short *) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
sync_out[2].r += ((short *) &result)[0];
|
||||
sync_out[2].i += ((short *) &result)[1];
|
||||
sync_out2[2].r += ((short *) &result2)[0];
|
||||
sync_out2[2].i += ((short *) &result2)[1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// calculate the absolute value of sync_corr[n]
|
||||
|
||||
sync_corr_ue0[n] = abs32(sync_corr_ue0[n]);
|
||||
sync_corr_ue0[n+length] = abs32(sync_corr_ue0[n+length]);
|
||||
sync_corr_ue1[n] = abs32(sync_corr_ue1[n]);
|
||||
sync_corr_ue1[n+length] = abs32(sync_corr_ue1[n+length]);
|
||||
sync_corr_ue2[n] = abs32(sync_corr_ue2[n]);
|
||||
sync_corr_ue2[n+length] = abs32(sync_corr_ue2[n+length]);
|
||||
|
||||
for (s=0; s<3; s++) {
|
||||
tmp[s] = (abs32(sync_out[s])>>1) + (abs32(sync_out2[s])>>1);
|
||||
double tmp = absF(sync_out[s]) + absF(sync_out2[s]);
|
||||
|
||||
if (tmp[s]>peak_val) {
|
||||
peak_val = tmp[s];
|
||||
if (tmp>peak_val) {
|
||||
peak_val = tmp;
|
||||
peak_pos = n;
|
||||
sync_source = s;
|
||||
/*
|
||||
@@ -443,42 +214,22 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
}
|
||||
|
||||
*eNB_id = sync_source;
|
||||
|
||||
LOG_I(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
|
||||
|
||||
|
||||
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){
|
||||
static int debug_cnt;
|
||||
if (debug_cnt == 0) {
|
||||
LOG_M("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
|
||||
LOG_M("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
|
||||
LOG_M("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2);
|
||||
LOG_M("rxdata0.m","rxd0",rxdata[0],length<<1,1,1);
|
||||
// exit(-1);
|
||||
} else {
|
||||
debug_cnt++;
|
||||
}
|
||||
}
|
||||
LOG_I(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val/2,dB_fixed(peak_val/2)/2);
|
||||
return(peak_pos);
|
||||
}
|
||||
|
||||
|
||||
int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
|
||||
{
|
||||
int ru_sync_time_init(RU_t *ru) { // LTE_UE_COMMON *common_vars
|
||||
/*
|
||||
int16_t dmrs[2048];
|
||||
int16_t *dmrsp[2] = {dmrs,NULL};
|
||||
*/
|
||||
|
||||
int32_t dmrs[ru->frame_parms->ofdm_symbol_size*14] __attribute__((aligned(32)));
|
||||
//int32_t *dmrsp[2] = {&dmrs[(3-ru->frame_parms->Ncp)*ru->frame_parms->ofdm_symbol_size],NULL};
|
||||
int32_t *dmrsp[2] = {&dmrs[0],NULL};
|
||||
|
||||
generate_ul_ref_sigs();
|
||||
|
||||
ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms->ofdm_symbol_size*2*sizeof(int16_t));
|
||||
ru->dmrs_corr = (uint64_t*)malloc16_clear(ru->frame_parms->samples_per_tti*10*sizeof(uint64_t));
|
||||
|
||||
ru->dmrssync = (int16_t *)malloc16_clear(ru->frame_parms->ofdm_symbol_size*2*sizeof(int16_t));
|
||||
ru->dmrs_corr = (uint64_t *)malloc16_clear(ru->frame_parms->samples_per_tti*10*sizeof(uint64_t));
|
||||
generate_drs_pusch(NULL,
|
||||
NULL,
|
||||
ru->frame_parms,
|
||||
@@ -491,35 +242,39 @@ int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
|
||||
0);
|
||||
|
||||
switch (ru->frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft(IDFT_128,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft(IDFT_512,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft(IDFT_1024,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft(IDFT_1536,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync,
|
||||
1); /// complex output
|
||||
break;
|
||||
case 100:
|
||||
idft(IDFT_2048,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Unsupported N_RB_DL %d\n",ru->frame_parms->N_RB_DL);
|
||||
break;
|
||||
case 6:
|
||||
idft(IDFT_128,(int16_t *)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
idft(IDFT_512,(int16_t *)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
idft(IDFT_1024,(int16_t *)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft(IDFT_1536,(int16_t *)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync,
|
||||
1); /// complex output
|
||||
break;
|
||||
|
||||
case 100:
|
||||
idft(IDFT_2048,(int16_t *)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Unsupported N_RB_DL %d\n",ru->frame_parms->N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
return(0);
|
||||
@@ -527,10 +282,11 @@ int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
|
||||
|
||||
|
||||
void ru_sync_time_free(RU_t *ru) {
|
||||
|
||||
AssertFatal(ru->dmrssync!=NULL,"ru->dmrssync is NULL\n");
|
||||
free(ru->dmrssync);
|
||||
if (ru->dmrs_corr) free(ru->dmrs_corr);
|
||||
|
||||
if (ru->dmrs_corr)
|
||||
free(ru->dmrs_corr);
|
||||
}
|
||||
|
||||
//#define DEBUG_PHY
|
||||
@@ -539,10 +295,8 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t length,
|
||||
uint32_t *peak_val_out,
|
||||
uint32_t *sync_corr_eNB)
|
||||
{
|
||||
uint32_t *sync_corr_eNB) {
|
||||
// perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
unsigned int n, ar, peak_val, peak_pos;
|
||||
uint64_t mean_val;
|
||||
int result;
|
||||
@@ -556,21 +310,21 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
}
|
||||
|
||||
switch (eNB_id) {
|
||||
case 0:
|
||||
primary_synch_time = (short*)primary_synch0_time;
|
||||
break;
|
||||
case 0:
|
||||
primary_synch_time = (short *)primary_synch0_time;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
primary_synch_time = (short*)primary_synch1_time;
|
||||
break;
|
||||
case 1:
|
||||
primary_synch_time = (short *)primary_synch1_time;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
primary_synch_time = (short*)primary_synch2_time;
|
||||
break;
|
||||
case 2:
|
||||
primary_synch_time = (short *)primary_synch2_time;
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"[SYNC TIME] Illegal eNB_id!\n");
|
||||
return (-1);
|
||||
default:
|
||||
LOG_E(PHY,"[SYNC TIME] Illegal eNB_id!\n");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
peak_val = 0;
|
||||
@@ -578,21 +332,16 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
mean_val = 0;
|
||||
|
||||
for (n=0; n<length; n+=4) {
|
||||
|
||||
sync_corr_eNB[n] = 0;
|
||||
|
||||
if (n<(length-frame_parms->ofdm_symbol_size-frame_parms->nb_prefix_samples)) {
|
||||
|
||||
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result = dot_product((short *)primary_synch_time, (short *) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
//((short*)sync_corr)[2*n] += ((short*) &result)[0];
|
||||
//((short*)sync_corr)[2*n+1] += ((short*) &result)[1];
|
||||
sync_corr_eNB[n] += abs32(result);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -610,7 +359,6 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
}
|
||||
|
||||
mean_val/=length;
|
||||
|
||||
*peak_val_out = peak_val;
|
||||
|
||||
if (peak_val <= (40*(uint32_t)mean_val)) {
|
||||
@@ -620,88 +368,91 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
LOG_I(PHY,"[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %"PRIu64"\n",peak_pos,peak_val,mean_val);
|
||||
return(peak_pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static inline int64_t abs64(int64_t x)
|
||||
{
|
||||
return (((int64_t)((int32_t*)&x)[0])*((int64_t)((int32_t*)&x)[0]) + ((int64_t)
|
||||
((int32_t*)&x)[1])*((int64_t)((int32_t*)&x)[1]));
|
||||
static inline int64_t abs64(int64_t x) {
|
||||
return (((int64_t)((int32_t *)&x)[0])*((int64_t)((int32_t *)&x)[0]) + ((int64_t)
|
||||
((int32_t *)&x)[1])*((int64_t)((int32_t *)&x)[1]));
|
||||
}
|
||||
|
||||
|
||||
int ru_sync_time(RU_t *ru,
|
||||
int64_t *lev,
|
||||
int64_t *avg)
|
||||
{
|
||||
int64_t *avg) {
|
||||
LTE_DL_FRAME_PARMS *frame_parms = ru->frame_parms;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
|
||||
// perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti;
|
||||
|
||||
|
||||
// circular copy of beginning to end of rxdata buffer. Note: buffer should be big enough upon calling this function
|
||||
for (int ar=0;ar<ru->nb_rx;ar++) memcpy((void*)&ru->common.rxdata[ar][2*length],
|
||||
(void*)&ru->common.rxdata[ar][0],
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
for (int ar=0; ar<ru->nb_rx; ar++)
|
||||
memcpy((void *)&ru->common.rxdata[ar][2*length],
|
||||
(void *)&ru->common.rxdata[ar][0],
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
int32_t maxlev0=0;
|
||||
int maxpos0=0;
|
||||
int64_t avg0=0;
|
||||
int64_t result;
|
||||
int64_t dmrs_corr;
|
||||
|
||||
int maxval=0;
|
||||
for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) {
|
||||
|
||||
for (int i=0; i<2*(frame_parms->ofdm_symbol_size); i++) {
|
||||
maxval = max(maxval,ru->dmrssync[i]);
|
||||
maxval = max(maxval,-ru->dmrssync[i]);
|
||||
}
|
||||
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) {
|
||||
maxval = max(maxval,calibration->drs_ch_estimates_time[0][i]);
|
||||
maxval = max(maxval,-calibration->drs_ch_estimates_time[0][i]);
|
||||
}
|
||||
for (int i=0; i<2*(frame_parms->ofdm_symbol_size); i++) {
|
||||
maxval = max(maxval,calibration->drs_ch_estimates_time[0][i]);
|
||||
maxval = max(maxval,-calibration->drs_ch_estimates_time[0][i]);
|
||||
}
|
||||
}
|
||||
|
||||
int shift = log2_approx(maxval);
|
||||
|
||||
for (int n=0; n<length; n+=4) {
|
||||
|
||||
dmrs_corr = 0;
|
||||
|
||||
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
for (int ar=0; ar<ru->nb_rx; ar++) {
|
||||
|
||||
result = dot_product64(ru->dmrssync,
|
||||
(int16_t*) &ru->common.rxdata[ar][n],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
shift);
|
||||
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
result = dot_product64((int16_t*) &calibration->drs_ch_estimates_time[ar],
|
||||
(int16_t*) &ru->common.rxdata[ar][n],
|
||||
(int16_t *) &ru->common.rxdata[ar][n],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
shift);
|
||||
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
result = dot_product64((int16_t *) &calibration->drs_ch_estimates_time[ar],
|
||||
(int16_t *) &ru->common.rxdata[ar][n],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
shift);
|
||||
}
|
||||
|
||||
dmrs_corr += abs64(result);
|
||||
}
|
||||
if (ru->dmrs_corr != NULL) ru->dmrs_corr[n] = dmrs_corr;
|
||||
|
||||
if (ru->dmrs_corr != NULL)
|
||||
ru->dmrs_corr[n] = dmrs_corr;
|
||||
|
||||
// tmpi holds <synchi,rx0>+<synci,rx1>+...+<synchi,rx_{nbrx-1}>
|
||||
|
||||
if (dmrs_corr>maxlev0) {
|
||||
maxlev0 = dmrs_corr;
|
||||
maxpos0 = n;
|
||||
}
|
||||
|
||||
if (dmrs_corr>maxlev0) { maxlev0 = dmrs_corr; maxpos0 = n; }
|
||||
avg0 += dmrs_corr;
|
||||
}
|
||||
avg0/=(length/4);
|
||||
|
||||
avg0/=(length/4);
|
||||
int dmrsoffset = frame_parms->samples_per_tti + (3*frame_parms->ofdm_symbol_size)+(3*frame_parms->nb_prefix_samples) + frame_parms->nb_prefix_samples0;
|
||||
|
||||
if ((int64_t)maxlev0 > (10*avg0)) {*lev = maxlev0; *avg=avg0; return((length+maxpos0-dmrsoffset)%length);}
|
||||
|
||||
if ((int64_t)maxlev0 > (10*avg0)) {
|
||||
*lev = maxlev0;
|
||||
*avg=avg0;
|
||||
return((length+maxpos0-dmrsoffset)%length);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
short primary_synch0[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-26120,-19785,11971,-30502,-24020,-22288,32117,6492,31311,9658,-16384,-28378,25100,-21063,-7292,-31946,20429,25618,14948,29158,11971,-30502,31311,9658,25100,-21063,-16384,28377,-24020,22287,32117,6492,-7292,31945,20429,25618,-26120,-19785,-16384,-28378,-16384,28377,-26120,-19785,-32402,4883,31311,-9659,32117,6492,-7292,-31946,32767,-1,25100,-21063,-24020,22287,-32402,4883,-32402,4883,-24020,22287,25100,-21063,32767,-1,-7292,-31946,32117,6492,31311,-9659,-32402,4883,-26120,-19785,-16384,28377,-16384,-28378,-26120,-19785,20429,25618,-7292,31945,32117,6492,-24020,22287,-16384,28377,25100,-21063,31311,9658,11971,-30502,14948,29158,20429,25618,-7292,-31946,25100,-21063,-16384,-28378,31311,9658,32117,6492,-24020,-22288,11971,-30502,-26120,-19785,32767,0,0,0,0,0,0,0,0,0,0,0};
|
||||
short primary_synch1[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,-8086,-24020,-22288,2448,32675,-26120,19784,27073,18458,-16384,28377,25100,21062,-29523,14217,-7292,31945,-13477,-29868,-24020,-22288,27073,18458,25100,21062,-16384,-28378,2448,-32676,-26120,19784,-29523,-14218,-7292,31945,-31754,-8086,-16384,28377,-16384,-28378,-31754,-8086,31311,-9659,27073,-18459,-26120,19784,-29523,14217,32767,-1,25100,21062,2448,-32676,31311,-9659,31311,-9659,2448,-32676,25100,21062,32767,0,-29523,14217,-26120,19784,27073,-18459,31311,-9659,-31754,-8086,-16384,-28378,-16384,28377,-31754,-8086,-7292,31945,-29523,-14218,-26120,19784,2448,-32676,-16384,-28378,25100,21062,27073,18458,-24020,-22288,-13477,-29868,-7292,31945,-29523,14217,25100,21062,-16384,28377,27073,18458,-26120,19784,2448,32675,-24020,-22288,-31754,-8086,32767,0,0,0,0,0,0,0,0,0,0,0};
|
||||
short primary_synch2[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,8085,-24020,22287,2448,-32676,-26120,-19785,27073,-18459,-16384,-28378,25100,-21063,-29523,-14218,-7292,-31946,-13477,29867,-24020,22287,27073,-18459,25100,-21063,-16384,28377,2448,32675,-26120,-19785,-29523,14217,-7292,-31946,-31754,8085,-16384,-28378,-16384,28377,-31754,8085,31311,9658,27073,18458,-26120,-19785,-29523,-14218,32767,0,25100,-21063,2448,32675,31311,9658,31311,9658,2448,32675,25100,-21063,32767,0,-29523,-14218,-26120,-19785,27073,18458,31311,9658,-31754,8085,-16384,28377,-16384,-28378,-31754,8085,-7292,-31946,-29523,14217,-26120,-19785,2448,32675,-16384,28377,25100,-21063,27073,-18459,-24020,22287,-13477,29867,-7292,-31946,-29523,-14218,25100,-21063,-16384,-28378,27073,-18459,-26120,-19785,2448,-32676,-24020,22287,-31754,8085,32767,-1,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
@@ -153,7 +153,6 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
int16_t **chest_t;
|
||||
int16_t **chest_f;
|
||||
int16_t *pusch_llr;
|
||||
int32_t *pusch_comp;
|
||||
int32_t *pucch1_comp;
|
||||
int32_t *pucch1_thres;
|
||||
int32_t *pucch1ab_comp;
|
||||
@@ -189,7 +188,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
chest_t = (int16_t **) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates;
|
||||
chest_f = (int16_t **) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates;
|
||||
pusch_llr = (int16_t *) phy_vars_enb->pusch_vars[UE_id]->llr;
|
||||
pusch_comp = (int32_t *) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[0];
|
||||
int16_t *pusch_comp= (int16_t *) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[0];
|
||||
pucch1_comp = (int32_t *) phy_vars_enb->pucch1_stats[UE_id];
|
||||
pucch1_thres = (int32_t *) phy_vars_enb->pucch1_stats_thres[UE_id];
|
||||
pucch1ab_comp = (int32_t *) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
@@ -684,7 +683,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
if (frame_parms->N_RB_DL != 100) {
|
||||
fl_set_xyplot_data(form->pdcch_llr,bit_pdcch,llr_pdcch,12*frame_parms->N_RB_DL*2*num_pdcch_symbols,"","","");
|
||||
} else {
|
||||
LOG_D(PHY,"UE PDCCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
LOG_D(HW,"UE PDCCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -698,7 +697,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
if (frame_parms->N_RB_DL != 100) {
|
||||
fl_set_xyplot_data(form->pdcch_comp,I,Q,12*frame_parms->N_RB_DL*num_pdcch_symbols,"","","");
|
||||
} else {
|
||||
LOG_D(PHY,"UE PDCCH COMP plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
LOG_D(HW,"UE PDCCH COMP plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,7 +713,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
if (frame_parms->N_RB_DL != 100) {
|
||||
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword,"","","");
|
||||
} else {
|
||||
LOG_D(PHY,"UE PDSCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
LOG_D(HW,"UE PDSCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,11 @@ struct complex {
|
||||
double y;
|
||||
};
|
||||
|
||||
struct complexd {
|
||||
double r;
|
||||
double i;
|
||||
};
|
||||
|
||||
struct complexf {
|
||||
float r;
|
||||
float i;
|
||||
|
||||
@@ -48,12 +48,6 @@ extern short primary_synch2[144];
|
||||
extern unsigned char primary_synch0_tab[72];
|
||||
extern unsigned char primary_synch1_tab[72];
|
||||
extern unsigned char primary_synch2_tab[72];
|
||||
extern int16_t *primary_synch0_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int16_t *primary_synch1_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int16_t *primary_synch2_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int *sync_corr_ue0; //!< index [0..10*samples_per_tti[
|
||||
extern int *sync_corr_ue1; //!< index [0..10*samples_per_tti[
|
||||
extern int *sync_corr_ue2; //!< index [0..10*samples_per_tti[
|
||||
|
||||
extern int flagMag;
|
||||
//extern short **txdataF_rep_tmp;
|
||||
|
||||
@@ -55,9 +55,6 @@ extern unsigned char primary_synch2_tab[72];
|
||||
extern int16_t *primary_synch0_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int16_t *primary_synch1_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int16_t *primary_synch2_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int *sync_corr_ue0; //!< index [0..10*samples_per_tti[
|
||||
extern int *sync_corr_ue1; //!< index [0..10*samples_per_tti[
|
||||
extern int *sync_corr_ue2; //!< index [0..10*samples_per_tti[
|
||||
|
||||
extern int flagMag;
|
||||
//extern short **txdataF_rep_tmp;
|
||||
|
||||
@@ -47,12 +47,6 @@ extern short primary_synch2[144];
|
||||
extern unsigned char primary_synch0_tab[72];
|
||||
extern unsigned char primary_synch1_tab[72];
|
||||
extern unsigned char primary_synch2_tab[72];
|
||||
extern int16_t *primary_synch0_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int16_t *primary_synch1_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int16_t *primary_synch2_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int *sync_corr_ue0; //!< index [0..10*samples_per_tti[
|
||||
extern int *sync_corr_ue1; //!< index [0..10*samples_per_tti[
|
||||
extern int *sync_corr_ue2; //!< index [0..10*samples_per_tti[
|
||||
|
||||
extern int flagMag;
|
||||
//extern short **txdataF_rep_tmp;
|
||||
|
||||
@@ -33,9 +33,6 @@ char* namepointer_log2;
|
||||
|
||||
|
||||
#include "PHY/LTE_REFSIG/primary_synch.h"
|
||||
int16_t *primary_synch0_time;
|
||||
int16_t *primary_synch1_time;
|
||||
int16_t *primary_synch2_time;
|
||||
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/transport_vars.h"
|
||||
|
||||
@@ -33,9 +33,6 @@ char *namepointer_log2;
|
||||
|
||||
|
||||
#include "PHY/LTE_REFSIG/primary_synch.h"
|
||||
int16_t *primary_synch0_time;
|
||||
int16_t *primary_synch1_time;
|
||||
int16_t *primary_synch2_time;
|
||||
|
||||
PHY_VARS_UE ***PHY_vars_UE_g;
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble = CALLOC(1,sizeof(long));
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant = CALLOC(1,sizeof(long));
|
||||
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PUCCH_ConfigCommon));
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(*scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon));
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->present= NR_SetupRelease_PUCCH_ConfigCommon_PR_setup;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUCCH_ConfigCommon));
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal = CALLOC(1,sizeof(long));
|
||||
@@ -297,7 +297,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
|
||||
void prepare_scd(NR_ServingCellConfig_t *scd) {
|
||||
// Allocate downlink structures
|
||||
|
||||
scd->downlinkBWP_ToAddModList = CALLOC(1, sizeof(scd->downlinkBWP_ToAddModList));
|
||||
scd->downlinkBWP_ToAddModList = CALLOC(1, sizeof(*scd->downlinkBWP_ToAddModList));
|
||||
|
||||
// Downlink bandwidth part
|
||||
NR_BWP_Downlink_t *bwp = calloc(1, sizeof(*bwp));
|
||||
@@ -318,14 +318,14 @@ void prepare_scd(NR_ServingCellConfig_t *scd) {
|
||||
NR_DMRS_DownlinkCfg->phaseTrackingRS->present = NR_SetupRelease_PTRS_DownlinkConfig_PR_setup;
|
||||
NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup = CALLOC(1, sizeof(*NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup));
|
||||
NR_PTRS_DownlinkConfig_t *NR_PTRS_DownlinkCfg = NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup;
|
||||
NR_PTRS_DownlinkCfg->frequencyDensity = CALLOC(1, sizeof(NR_PTRS_DownlinkCfg->frequencyDensity));
|
||||
AssertFatal( NULL!= (NR_PTRS_DownlinkCfg->frequencyDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->frequencyDensity))), "");
|
||||
int *dl_rbs[2];
|
||||
for (int i=0;i<2;i++) {
|
||||
dl_rbs[i] = CALLOC(1, sizeof(*dl_rbs[i]));
|
||||
*dl_rbs[i] = 0;
|
||||
ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->frequencyDensity->list, dl_rbs[i]);
|
||||
}
|
||||
NR_PTRS_DownlinkCfg->timeDensity = CALLOC(1, sizeof(NR_PTRS_DownlinkCfg->timeDensity));
|
||||
NR_PTRS_DownlinkCfg->timeDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->timeDensity));
|
||||
int *dl_mcs[3];
|
||||
for (int i=0;i<3;i++) {
|
||||
dl_mcs[i] = CALLOC(1, sizeof(*dl_mcs[i]));
|
||||
|
||||
@@ -337,7 +337,8 @@ config_sib2(int Mod_idP,
|
||||
LTE_ARFCN_ValueEUTRA_t *ul_CArrierFreqP,
|
||||
long *ul_BandwidthP,
|
||||
LTE_AdditionalSpectrumEmission_t *additionalSpectrumEmissionP,
|
||||
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigListP) {
|
||||
struct LTE_MBSFN_SubframeConfigList *mbsfn_SubframeConfigListP,
|
||||
int dl_Bandwidth) {
|
||||
nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
|
||||
cfg->subframe_config.pb.value = radioResourceConfigCommonP->pdsch_ConfigCommon.p_b;
|
||||
cfg->subframe_config.pb.tl.tag = NFAPI_SUBFRAME_CONFIG_PB_TAG;
|
||||
@@ -345,7 +346,7 @@ config_sib2(int Mod_idP,
|
||||
cfg->rf_config.reference_signal_power.value = radioResourceConfigCommonP->pdsch_ConfigCommon.referenceSignalPower;
|
||||
cfg->rf_config.reference_signal_power.tl.tag = NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->nfapi_config.max_transmit_power.value = cfg->rf_config.reference_signal_power.value + power_off_dB[cfg->rf_config.dl_channel_bandwidth.value];
|
||||
cfg->nfapi_config.max_transmit_power.value = cfg->rf_config.reference_signal_power.value + power_off_dB[dl_Bandwidth];
|
||||
cfg->nfapi_config.max_transmit_power.tl.tag = NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG;
|
||||
cfg->num_tlv++;
|
||||
cfg->prach_config.configuration_index.value = radioResourceConfigCommonP->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
|
||||
@@ -870,7 +871,8 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
config_sib2(Mod_idP, CC_idP, radioResourceConfigCommon,
|
||||
radioResourceConfigCommon_BR,
|
||||
NULL, ul_Bandwidth, additionalSpectrumEmission,
|
||||
mbsfn_SubframeConfigList);
|
||||
mbsfn_SubframeConfigList,
|
||||
mib->message.dl_Bandwidth);
|
||||
} // mib != NULL
|
||||
|
||||
if (mobilityControlInfo !=NULL) {
|
||||
|
||||
@@ -84,7 +84,7 @@ get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id,
|
||||
|
||||
static uint32_t bytes_in_buffer=0;
|
||||
static uint32_t msi_pmch_stop=0;
|
||||
uint16_t mbms_rab_id=2047;//[8] = {2047,2047,2047,2047,2047,2047,2047,2047};
|
||||
rb_id_t mbms_rab_id=2047;//[8] = {2047,2047,2047,2047,2047,2047,2047,2047};
|
||||
static uint32_t msi_sfs=0;
|
||||
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ extern const int cqi_to_mcs[16];
|
||||
extern uint32_t RRC_CONNECTION_FLAG;
|
||||
|
||||
extern uint8_t rb_table[34];
|
||||
extern rb_id_t mbms_rab_id;
|
||||
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
|
||||
@@ -72,7 +72,7 @@ extern UL_IND_t *UL_INFO;
|
||||
extern int next_ra_frame;
|
||||
extern module_id_t next_Mod_id;
|
||||
|
||||
int mbms_rab_id=2047;//[8] = {2047,2047,2047,2047,2047,2047,2047,2047};
|
||||
rb_id_t mbms_rab_id=2047;//[8] = {2047,2047,2047,2047,2047,2047,2047,2047};
|
||||
static int mbms_mch_i=0;
|
||||
//static int num_msi_per_CSA[28];
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ extern int nas_sock_fd[MAX_MOBILES_PER_ENB];
|
||||
|
||||
extern int nas_sock_mbms_fd;
|
||||
|
||||
extern int mbms_rab_id;
|
||||
|
||||
|
||||
extern struct msghdr nas_msg_tx;
|
||||
@@ -113,8 +112,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
|
||||
* PDCP packet to pick the right socket below */
|
||||
|
||||
int rb_id = pdcpHead->rb_id;
|
||||
int sizeToWrite= sizeof (pdcp_data_ind_header_t) +
|
||||
pdcpHead->data_size;
|
||||
void * pdcpData=(void*)(pdcpHead+1);
|
||||
if (rb_id == 10) { //hardcoded for PC5-Signaling
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
|
||||
@@ -128,24 +125,25 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
|
||||
} else if (UE_NAS_USE_TUN) {
|
||||
//ret = write(nas_sock_fd[pdcpHead->inst], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite );
|
||||
if(rb_id == mbms_rab_id){
|
||||
ret = write(nas_sock_mbms_fd, pdcpData,sizeToWrite );
|
||||
ret = write(nas_sock_mbms_fd, pdcpData, pdcpHead->data_size );
|
||||
LOG_I(PDCP,"[PDCP_FIFOS] ret %d TRIED TO PUSH MBMS DATA TO rb_id %d handle %d sizeToWrite %d\n",
|
||||
ret,rb_id,nas_sock_fd[pdcpHead->inst],sizeToWrite);
|
||||
ret,rb_id,nas_sock_fd[pdcpHead->inst],pdcpHead->data_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) )
|
||||
log_dump(PDCP, pdcpData, sizeToWrite, LOG_DUMP_CHAR,"PDCP output to be sent to TUN interface: \n");
|
||||
ret = write(nas_sock_fd[pdcpHead->inst], pdcpData,sizeToWrite );
|
||||
log_dump(PDCP, pdcpData, pdcpHead->data_size, LOG_DUMP_CHAR,"PDCP output to be sent to TUN interface: \n");
|
||||
ret = write(nas_sock_fd[pdcpHead->inst], pdcpData,pdcpHead->data_size );
|
||||
LOG_T(PDCP,"[UE PDCP_FIFOS] ret %d TRIED TO PUSH DATA TO rb_id %d handle %d sizeToWrite %d\n",
|
||||
ret,rb_id,nas_sock_fd[pdcpHead->inst],sizeToWrite);
|
||||
ret,rb_id,nas_sock_fd[pdcpHead->inst],pdcpHead->data_size);
|
||||
}
|
||||
} else if (ENB_NAS_USE_TUN) {
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) )
|
||||
log_dump(PDCP, pdcpData, sizeToWrite, LOG_DUMP_CHAR,"PDCP output to be sent to TUN interface: \n");
|
||||
ret = write(nas_sock_fd[0], pdcpData, sizeToWrite);
|
||||
LOG_T(PDCP,"[NB PDCP_FIFOS] ret %d TRIED TO PUSH DATA TO rb_id %d handle %d sizeToWrite %d\n",ret,rb_id,nas_sock_fd[0],sizeToWrite);
|
||||
log_dump(PDCP, pdcpData, pdcpHead->data_size, LOG_DUMP_CHAR,"PDCP output to be sent to TUN interface: \n");
|
||||
ret = write(nas_sock_fd[0], pdcpData, pdcpHead->data_size);
|
||||
LOG_T(PDCP,"[NB PDCP_FIFOS] ret %d TRIED TO PUSH DATA TO rb_id %d handle %d sizeToWrite %d\n",ret,rb_id,nas_sock_fd[0],pdcpHead->data_size);
|
||||
} else if (PDCP_USE_NETLINK) {
|
||||
int sizeToWrite= sizeof (pdcp_data_ind_header_t) + pdcpHead->data_size;
|
||||
memcpy(NLMSG_DATA(nas_nlh_tx), (uint8_t *) pdcpHead, sizeToWrite);
|
||||
nas_nlh_tx->nlmsg_len = sizeToWrite;
|
||||
ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0);
|
||||
@@ -154,7 +152,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
|
||||
AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s), nas_sock_fd[0]: %d\n", errno, strerror(errno), nas_sock_fd[0]);
|
||||
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) )
|
||||
log_dump(PDCP, pdcpData, min(sizeToWrite,30) , LOG_DUMP_CHAR,
|
||||
log_dump(PDCP, pdcpData, min(pdcpHead->data_size,30) , LOG_DUMP_CHAR,
|
||||
"Printing first bytes of PDCP SDU before removing it from the list: \n");
|
||||
delNotifiedFIFO_elt (sdu_p);
|
||||
pdcp_nb_sdu_sent ++;
|
||||
@@ -384,6 +382,7 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 1 );
|
||||
len = recvmsg(nas_sock_fd[0], &nas_msg_rx, 0);
|
||||
printf("recev: %d\n", len);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 0 );
|
||||
|
||||
if (len > 0) {
|
||||
|
||||
@@ -2231,7 +2231,7 @@ static const plmn_data_t plmn_data[] = {
|
||||
/*
|
||||
310 900 Mid-Rivers Communications Mid-Rivers Wireless Operational
|
||||
*/
|
||||
{310, 910, "Verizon Wireless", "Verizon USA"}
|
||||
{310, 910, "Verizon Wireless", "Verizon USA"},
|
||||
/*
|
||||
310 920 Get Mobile Inactive
|
||||
310 930 Copper Valley Wireless Inactive
|
||||
@@ -2295,6 +2295,7 @@ static const plmn_data_t plmn_data[] = {
|
||||
648 4 Econet Wireless Econet Operational
|
||||
|
||||
*/
|
||||
{0,0,"",""}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include <openair1/PHY/phy_extern_ue.h>
|
||||
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
|
||||
@@ -181,8 +181,7 @@ PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t abstraction_flag)
|
||||
|
||||
{
|
||||
PHY_VARS_UE *ue = (PHY_VARS_UE *)malloc(sizeof(PHY_VARS_UE));
|
||||
memset(ue,0,sizeof(PHY_VARS_UE));
|
||||
PHY_VARS_UE *ue = (PHY_VARS_UE *)calloc(1,sizeof(PHY_VARS_UE));
|
||||
|
||||
if (frame_parms!=(LTE_DL_FRAME_PARMS *)NULL) { // if we want to give initial frame parms, allocate the PHY_VARS_UE structure and put them in
|
||||
memcpy(&(ue->frame_parms), frame_parms, sizeof(LTE_DL_FRAME_PARMS));
|
||||
|
||||
Reference in New Issue
Block a user