Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
404801ee
Commit
404801ee
authored
Dec 08, 2017
by
Xu Bo
Browse files
merge develop 2017.w48 into issue255_256_257_paging_reesta_release
parents
d81438cd
a2d16b34
Changes
58
Expand all
Show whitespace changes
Inline
Side-by-side
cmake_targets/CMakeLists.txt
View file @
404801ee
...
...
@@ -241,6 +241,7 @@ add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs
add_boolean_option
(
UE_DEBUG_TRACE False
"Activate UE debug trace"
)
add_boolean_option
(
UE_TIMING_TRACE False
"Activate UE timing trace"
)
add_boolean_option
(
DISABLE_LOG_X False
"Deactivate all LOG_* macros"
)
add_boolean_option
(
USRP_REC_PLAY False
"Enable USRP record playback mode"
)
add_boolean_option
(
DEBUG_CONSOLE False
"makes debugging easier, disables stdout/stderr buffering"
)
...
...
@@ -1803,6 +1804,7 @@ add_executable(lte-softmodem-nos1
${
OPENAIR_TARGETS
}
/RT/USER/rt_wrapper.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-ue.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-enb.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-ru.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-softmodem.c
${
OPENAIR1_DIR
}
/SIMULATION/TOOLS/taus.c
${
OPENAIR_TARGETS
}
/SIMU/USER/init_lte.c
...
...
@@ -1933,7 +1935,7 @@ add_executable(oaisim_nos1
${
x2ap_h
}
${
OPENAIR_BIN_DIR
}
/messages_xml.h
${
OPENAIR_TARGETS
}
/RT/USER/lte-ue.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-
enb
.c
${
OPENAIR_TARGETS
}
/RT/USER/lte-
ru
.c
${
OPENAIR_TARGETS
}
/RT/USER/rt_wrapper.c
${
OPENAIR_TARGETS
}
/SIMU/USER/channel_sim.c
${
OPENAIR_TARGETS
}
/SIMU/USER/init_lte.c
...
...
cmake_targets/build_oai
View file @
404801ee
...
...
@@ -66,6 +66,7 @@ UE_AUTOTEST_TRACE="False"
UE_DEBUG_TRACE
=
"False"
UE_TIMING_TRACE
=
"False"
DISABLE_LOG_X
=
"False"
USRP_REC_PLAY
=
"False"
BUILD_ECLIPSE
=
0
trap
handle_ctrl_c INT
...
...
@@ -158,6 +159,8 @@ Options
Disable all LOG_* macros
--build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh
--usrp-recplay
Build for I/Q record-playback modes
Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
...
...
@@ -350,6 +353,10 @@ function main() {
BUILD_TELNETSRV
=
1
echo_info
"Build embedded telnet server"
shift
;;
--usrp-recplay
)
USRP_REC_PLAY
=
"True"
echo_info
"Enabling USRP record playback mode"
shift
1
;;
-h
|
--help
)
print_help
exit
1
;;
...
...
@@ -540,6 +547,7 @@ function main() {
echo
"set (UE_DEBUG_TRACE
$UE_DEBUG_TRACE
)"
>>
$cmake_file
echo
"set (UE_TIMING_TRACE
$UE_TIMING_TRACE
)"
>>
$cmake_file
echo
"set (DISABLE_LOG_X
$DISABLE_LOG_X
)"
>>
$cmake_file
echo
"set (USRP_REC_PLAY
$USRP_REC_PLAY
)"
>>
$cmake_file
if
[
"
$UE
"
=
1
-a
"
$NOS1
"
=
"0"
]
;
then
echo_info
"Compiling UE S1 build : enabling Linux and NETLINK"
echo
"set (LINUX True )"
>>
$cmake_file
...
...
common/config/config_cmdline.c
View file @
404801ee
...
...
@@ -52,9 +52,12 @@ char defbool[2]="1";
switch
(
cfgoptions
->
type
)
{
case
TYPE_STRING
:
config_check_valptr
(
cfgoptions
,
(
char
**
)(
cfgoptions
->
strptr
),
sizeof
(
char
*
));
config_check_valptr
(
cfgoptions
,
cfgoptions
->
strptr
,
strlen
(
tmpval
+
1
)
)
;
if
(
cfgoptions
->
numelt
==
0
)
{
config_check_valptr
(
cfgoptions
,
cfgoptions
->
strptr
,
strlen
(
tmpval
)
+
1
);
sprintf
(
*
(
cfgoptions
->
strptr
),
"%s"
,
tmpval
);
}
else
{
sprintf
(
(
char
*
)(
cfgoptions
->
strptr
),
"%s"
,
tmpval
);
}
printf_cmdl
(
"[CONFIG] %s set to %s from command line
\n
"
,
cfgoptions
->
optname
,
tmpval
);
optisset
=
1
;
break
;
...
...
common/config/config_load_configmodule.c
View file @
404801ee
...
...
@@ -129,20 +129,21 @@ int i;
/* default */
if
(
cfgparam
==
NULL
)
{
cfgparam
=
"libconfig:oaisoftmodem.conf"
;
tmpflags
=
tmpflags
|
CONFIG_NOOOPT
;
cfgparam
=
DEFAULT_CFGMODE
":"
DEFAULT_CFGFILENAME
;
}
/* parse the config parameters to set the config source */
i
=
sscanf
(
cfgparam
,
"%m[^':']:%ms"
,
&
cfgmode
,
&
modeparams
);
if
(
i
<
0
)
{
fprintf
(
stderr
,
"[CONFIG] %s, %d, sscanf error parsing config source %s: %s
\n
"
,
__FILE__
,
__LINE__
,
cfgparam
,
strerror
(
errno
));
cfgmode
=
strdup
(
"libconfig"
);
modeparams
=
strdup
(
"oaisoftmodem.conf"
);
cfgmode
=
strdup
(
DEFAULT_CFGMODE
);
modeparams
=
strdup
(
DEFAULT_CFGFILENAME
);
}
else
if
(
i
==
1
)
{
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
with one parameter, the path to the configuration file */
modeparams
=
cfgmode
;
cfgmode
=
strdup
(
"libconfig"
);
cfgmode
=
strdup
(
DEFAULT_CFGMODE
);
}
cfgptr
=
malloc
(
sizeof
(
configmodule_interface_t
));
...
...
common/config/config_load_configmodule.h
View file @
404801ee
...
...
@@ -46,6 +46,7 @@
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
#define CONFIG_HELP 8 // print help message
#define CONFIG_ABORT 16 // config failed,abort execution
#define CONFIG_NOOOPT 32 // no -O option found when parsing command line
typedef
int
(
*
configmodule_initfunc_t
)(
char
*
cfgP
[],
int
numP
);
...
...
common/config/config_userapi.c
View file @
404801ee
...
...
@@ -50,7 +50,11 @@ configmodule_interface_t *config_get_if(void)
char
*
config_check_valptr
(
paramdef_t
*
cfgoptions
,
char
**
ptr
,
int
length
)
{
printf_ptrs
(
"-- %s 0x%08lx %i
\n
"
,
cfgoptions
->
optname
,(
uintptr_t
)(
*
ptr
),
length
);
printf_ptrs
(
"[CONFIG] %s ptr: 0x%08lx requested size: %i
\n
"
,
cfgoptions
->
optname
,(
uintptr_t
)(
ptr
),
length
);
if
(
cfgoptions
->
numelt
>
0
)
{
/* already allocated */
return
*
ptr
;
}
if
(
*
ptr
==
NULL
)
{
*
ptr
=
malloc
(
length
);
if
(
*
ptr
!=
NULL
)
{
...
...
@@ -147,3 +151,7 @@ int config_isparamset(paramdef_t *params,int paramidx)
return
0
;
}
}
int
config_getparamval_fromparamdefidx
(
paramdef_t
*
cfgoptions
,
int
paramidx
)
{
return
-
1
;
}
common/config/config_userapi.h
View file @
404801ee
...
...
@@ -38,6 +38,9 @@
extern
"C"
{
#endif
#define DEFAULT_CFGFILENAME "oaisoftmodem.conf"
#define DEFAULT_CFGMODE "libconfig"
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
...
...
@@ -51,6 +54,7 @@ extern int config_get(paramdef_t *params,int numparams, char *prefix);
extern
int
config_isparamset
(
paramdef_t
*
params
,
int
paramidx
);
extern
void
config_assign_int
(
paramdef_t
*
cfgoptions
,
char
*
fullname
,
int
val
);
extern
int
config_process_cmdline
(
paramdef_t
*
cfgoptions
,
int
numoptions
,
char
*
prefix
);
extern
int
config_getparamval_fromparamdefidx
(
paramdef_t
*
cfgoptions
,
int
paramidx
);
#define config_getlist config_get_if()->getlist
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
...
...
common/config/libconfig/config_libconfig.c
View file @
404801ee
...
...
@@ -104,17 +104,28 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
cfgpath
,
str
,
cfgoptions
[
i
].
numelt
);
str
[
strlen
(
str
)
-
1
]
=
0
;
}
if
(
cfgoptions
[
i
].
numelt
==
0
)
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
str
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
)
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s: %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
)
);
}
else
{
sprintf
(
(
char
*
)(
cfgoptions
[
i
].
strptr
)
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s: %s
\n
"
,
cfgpath
,(
char
*
)
cfgoptions
[
i
].
strptr
);
}
}
else
{
if
(
cfgoptions
[
i
].
defstrval
!=
NULL
)
{
defval
=
1
;
if
(
cfgoptions
[
i
].
numelt
==
0
)
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
cfgoptions
[
i
].
defstrval
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
),
"%s"
,
cfgoptions
[
i
].
defstrval
);
printf_params
(
"[LIBCONFIG] %s set to default value %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
));
}
else
{
sprintf
((
char
*
)(
cfgoptions
[
i
].
strptr
),
"%s"
,
cfgoptions
[
i
].
defstrval
);
printf_params
(
"[LIBCONFIG] %s set to default value %s
\n
"
,
cfgpath
,
(
char
*
)
cfgoptions
[
i
].
strptr
);
}
}
else
{
notfound
=
1
;
}
...
...
@@ -183,7 +194,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
read_intarray
(
&
cfgoptions
[
i
],
setting
,
cfgpath
);
}
else
{
if
(
cfgoptions
[
i
].
defintarrayval
!=
NULL
)
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),(
char
**
)
&
(
cfgoptions
[
i
].
iptr
),
sizeof
(
int32_t
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),(
char
**
)
&
(
cfgoptions
[
i
].
iptr
),
sizeof
(
int32_t
*
));
cfgoptions
[
i
].
iptr
=
cfgoptions
[
i
].
defintarrayval
;
defval
=
1
;
for
(
int
j
=
0
;
j
<
cfgoptions
[
i
].
numelt
;
j
++
)
{
...
...
openair1/PHY/LTE_TRANSPORT/if4_tools.c
View file @
404801ee
...
...
@@ -58,7 +58,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
uint16_t db_fulllength, db_halflength;
int slotoffsetF=0, blockoffsetF=0;
uint16_t *data_block=NULL, *i=NULL;
uint16_t *data_block=NULL, *i=NULL
, *d=NULL
;
IF4p5_header_t *packet_header=NULL;
eth_state_t *eth = (eth_state_t*) (ru->ifdevice.priv);
...
...
@@ -138,23 +138,48 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
if (packet_type == IF4p5_PULFFT) {
uint16_t *rx0 = (uint16_t*) &rxdataF[0][blockoffsetF];
uint16_t *rx1 = (uint16_t*) &rxdataF[0][slotoffsetF];
for (symbol_id=fp->symbols_per_tti-nsym; symbol_id<fp->symbols_per_tti; symbol_id++) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF4_SYMBOL, symbol_id );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 1 );
for (element_id=0; element_id<db_halflength; element_id++) {
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | ((uint16_t)(lin2alaw_if4p5[*(i+1)]<<8));
i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id];
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | ((uint16_t)(lin2alaw_if4p5[*(i+1)]<<8));
//if (element_id==0) LOG_I(PHY,"send_if4p5: symbol %d rxdata0 = (%d,%d)\n",symbol_id,*i,*(i+1));
start_meas(&ru->compression);
for (element_id=0; element_id<db_halflength; element_id+=8) {
i = (uint16_t*) &rx0[element_id];
d = (uint16_t*) &data_block[element_id];
d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8));
d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8));
d[2] = ((uint16_t) lin2alaw_if4p5[i[4]]) | ((uint16_t)(lin2alaw_if4p5[i[5]]<<8));
d[3] = ((uint16_t) lin2alaw_if4p5[i[6]]) | ((uint16_t)(lin2alaw_if4p5[i[7]]<<8));
d[4] = ((uint16_t) lin2alaw_if4p5[i[8]]) | ((uint16_t)(lin2alaw_if4p5[i[9]]<<8));
d[5] = ((uint16_t) lin2alaw_if4p5[i[10]]) | ((uint16_t)(lin2alaw_if4p5[i[11]]<<8));
d[6] = ((uint16_t) lin2alaw_if4p5[i[12]]) | ((uint16_t)(lin2alaw_if4p5[i[13]]<<8));
d[7] = ((uint16_t) lin2alaw_if4p5[i[14]]) | ((uint16_t)(lin2alaw_if4p5[i[15]]<<8));
i = (uint16_t*) &rx1[element_id];
d = (uint16_t*) &data_block[element_id+db_halflength];
d[0] = ((uint16_t) lin2alaw_if4p5[i[0]]) | ((uint16_t)(lin2alaw_if4p5[i[1]]<<8));
d[1] = ((uint16_t) lin2alaw_if4p5[i[2]]) | ((uint16_t)(lin2alaw_if4p5[i[3]]<<8));
d[2] = ((uint16_t) lin2alaw_if4p5[i[4]]) | ((uint16_t)(lin2alaw_if4p5[i[5]]<<8));
d[3] = ((uint16_t) lin2alaw_if4p5[i[6]]) | ((uint16_t)(lin2alaw_if4p5[i[7]]<<8));
d[4] = ((uint16_t) lin2alaw_if4p5[i[8]]) | ((uint16_t)(lin2alaw_if4p5[i[9]]<<8));
d[5] = ((uint16_t) lin2alaw_if4p5[i[10]]) | ((uint16_t)(lin2alaw_if4p5[i[11]]<<8));
d[6] = ((uint16_t) lin2alaw_if4p5[i[12]]) | ((uint16_t)(lin2alaw_if4p5[i[13]]<<8));
d[7] = ((uint16_t) lin2alaw_if4p5[i[14]]) | ((uint16_t)(lin2alaw_if4p5[i[15]]<<8));
}
stop_meas(&ru->compression);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
packet_header->frame_status &= ~(0x000f<<26);
packet_header->frame_status |= (symbol_id&0x000f)<<26;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
start_meas(&ru->transport);
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
symbol_id,
&tx_buffer,
...
...
@@ -163,6 +188,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
IF4p5_PULFFT)) < 0) {
perror("ETHERNET write for IF4p5_PULFFT\n");
}
stop_meas(&ru->transport);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size;
...
...
@@ -181,7 +207,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
} else if (packet_type >= IF4p5_PRACH &&
packet_type <= IF4p5_PRACH+4) {
// FIX: hard coded prach samples length
LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe);
LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d
,packet type %x
\n",frame,subframe
,packet_type
);
db_fulllength = PRACH_NUM_SAMPLES;
if (eth->flags == ETH_RAW_IF4p5_MODE) {
...
...
@@ -222,6 +248,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
packet_type)) < 0) {
perror("ETHERNET write for IF4p5_PRACH\n");
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
} else {
AssertFatal(1==0, "send_IF4p5 - Unknown packet_type %x", packet_type);
...
...
@@ -283,7 +310,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
*subframe = ((packet_header->frame_status)>>22)&0x000f;
*packet_type = packet_header->sub_type;
LOG_D(PHY,"recv_IF4p5: Frame %d, Subframe %d: packet_type %x\n",*frame,*subframe,*packet_type);
if (*packet_type == IF4p5_PDLFFT) {
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF4_SYMBOL, *symbol_number );
...
...
@@ -313,7 +340,6 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size);
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 );
if (ru->idx==0) LOG_D(PHY,"UL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",ru->idx,*frame,*subframe,*symbol_number);
for (element_id=0; element_id<db_halflength; element_id++) {
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
*i = alaw2lin_if4p5[ (data_block[element_id] & 0xff) ];
...
...
@@ -353,8 +379,8 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
PRACH_BLOCK_SIZE_BYTES);
}
//
LOG_D(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d => %d dB\n",ru->idx,*frame,*subframe,
//
dB_fixed(signal_energy((int*)&prach_rxsigF[0][0],839)));
LOG_D(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d => %d dB\n",ru->idx,*frame,*subframe,
dB_fixed(signal_energy((int*)&prach_rxsigF[0][0],839)));
for (idx=0;idx<ru->num_eNB;idx++) ru->wakeup_prach_eNB(ru->eNB_list[idx],ru,*frame,*subframe);
} else if (*packet_type == IF4p5_PULTICK) {
...
...
openair1/PHY/LTE_TRANSPORT/if4_tools.h
View file @
404801ee
...
...
@@ -39,11 +39,11 @@
#define IF4p5_PULFFT 0x0019
#define IF4p5_PDLFFT 0x0020
#define IF4p5_PRACH 0x0021
#define IF4p5_PRACH_BR_CE0 0x002
1
#define IF4p5_PRACH_BR_CE1 0x002
2
#define IF4p5_PRACH_BR_CE2 0x002
3
#define IF4p5_PRACH_BR_CE3 0x002
4
#define IF4p5_PULTICK 0x002
5
#define IF4p5_PRACH_BR_CE0 0x002
2
#define IF4p5_PRACH_BR_CE1 0x002
3
#define IF4p5_PRACH_BR_CE2 0x002
4
#define IF4p5_PRACH_BR_CE3 0x002
5
#define IF4p5_PULTICK 0x002
6
struct
IF4p5_header
{
/// Type
...
...
openair1/PHY/LTE_TRANSPORT/pucch.c
View file @
404801ee
...
...
@@ -1871,6 +1871,23 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
eNB
->
pucch1ab_stats_cnt
[
j
][
i
]
=
0
;
}
}
#if defined(USRP_REC_PLAY)
// It's probably bad to do this statically only once.
// Looks like the above is incomplete.
// Such reset needs to be done once a UE PHY structure is being used/re-used
// Don't know if this is ever possible in current architecture
for
(
i
=
0
;
i
<
10240
;
i
++
)
{
for
(
j
=
0
;
j
<
NUMBER_OF_UE_MAX
;
j
++
)
{
eNB
->
pucch1_stats
[
j
][
i
]
=
0
;
eNB
->
pucch1_stats_thres
[
j
][
i
]
=
0
;
}
}
for
(
i
=
0
;
i
<
20480
;
i
++
)
{
for
(
j
=
0
;
j
<
NUMBER_OF_UE_MAX
;
j
++
)
{
eNB
->
pucch1ab_stats
[
j
][
i
]
=
0
;
}
}
#endif
first_call
=
0
;
}
...
...
@@ -2154,6 +2171,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// stat_max *= nsymb; // normalize to energy per symbol
// stat_max /= (frame_parms->N_RB_UL*12); //
stat_max
/=
(
nsymb
*
12
);
#ifdef DEBUG_PUCCH_RX
printf
(
"[eNB] PUCCH: stat %d, stat_max %d, phase_max %d
\n
"
,
stat
,
stat_max
,
phase_max
);
#endif
...
...
@@ -2289,8 +2307,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
stat_im
=
0
;
// Do detection now
#if defined(USRP_REC_PLAY)
// It looks like the value is a bit messy when RF is replayed.
// For instance i assume to skip pucch1_thres from the test below.
if
(
sigma2_dB
<
(
dB_fixed
(
stat_max
)))
{
//
#else
if
(
sigma2_dB
<
(
dB_fixed
(
stat_max
)
-
pucch1_thres
))
{
//
#endif
chL
=
(
nsymb
>>
1
)
-
4
;
chest_mag
=
0
;
cfo
=
(
frame_parms
->
Ncp
==
0
)
?
&
cfo_pucch_np
[
14
*
phase_max
]
:
&
cfo_pucch_ep
[
12
*
phase_max
];
...
...
@@ -2431,7 +2454,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
if
(
fmt
==
pucch_format1b
)
*
(
1
+
payload
)
=
(
stat_im
<
0
)
?
1
:
2
;
}
else
{
// insufficient energy on PUCCH so NAK
#if defined(USRP_REC_PLAY)
LOG_I
(
PHY
,
"PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d
\n
"
,
subframe
,
sigma2_dB
,
dB_fixed
(
stat_max
),
pucch1_thres
);
#else
LOG_I
(
PHY
,
"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d
\n
"
,
subframe
,
sigma2_dB
,
dB_fixed
(
stat_max
),
pucch1_thres
);
#endif
*
payload
=
4
;
// DTX
((
int16_t
*
)
&
eNB
->
pucch1ab_stats
[
UE_id
][(
subframe
<<
10
)
+
(
eNB
->
pucch1ab_stats_cnt
[
UE_id
][
subframe
])])[
0
]
=
(
int16_t
)(
stat_re
);
((
int16_t
*
)
&
eNB
->
pucch1ab_stats
[
UE_id
][(
subframe
<<
10
)
+
(
eNB
->
pucch1ab_stats_cnt
[
UE_id
][
subframe
])])[
1
]
=
(
int16_t
)(
stat_im
);
...
...
openair1/PHY/defs.h
View file @
404801ee
...
...
@@ -756,6 +756,10 @@ typedef struct RU_t_s{
time_stats_t
rx_fhaul
;
/// Timing statistics (TX Fronthaul + Compression)
time_stats_t
tx_fhaul
;
/// Timong statistics (Compression)
time_stats_t
compression
;
/// Timing statistics (Fronthaul transport)
time_stats_t
transport
;
/// RX and TX buffers for precoder output
RU_COMMON
common
;
/// beamforming weight vectors per eNB
...
...
openair1/SCHED/phy_procedures_lte_ue.c
View file @
404801ee
...
...
@@ -2939,7 +2939,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
//dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
ue
->
UE_mode
[
eNB_id
]
=
PUSCH
;
}
}
else
{
LOG_E
(
PHY
,
"[UE %d] Frame %d, subframe %d: Problem in DCI!
\n
"
,
ue
->
Mod_id
,
frame_rx
,
subframe_rx
);
dump_dci
(
&
ue
->
frame_parms
,
&
dci_alloc_rx
[
i
]);
...
...
@@ -2977,7 +2977,6 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
}
}
}
else
if
((
dci_alloc_rx
[
i
].
rnti
==
P_RNTI
)
&&
((
dci_alloc_rx
[
i
].
format
==
format1A
)
||
(
dci_alloc_rx
[
i
].
format
==
format1C
)))
{
...
...
openair2/ENB_APP/enb_config.c
View file @
404801ee
...
...
@@ -2593,6 +2593,8 @@ void RCConfig(void) {
/* get global parameters, defined outside any section in the config file */
printf
(
"Getting ENBSParams
\n
"
);
config_get
(
ENBSParams
,
sizeof
(
ENBSParams
)
/
sizeof
(
paramdef_t
),
NULL
);
RC
.
nb_inst
=
ENBSParams
[
ENB_ACTIVE_ENBS_IDX
].
numelt
;
...
...
openair2/LAYER2/MAC/config.c
View file @
404801ee
This diff is collapsed.
Click to expand it.
openair2/LAYER2/MAC/defs.h
View file @
404801ee
...
...
@@ -90,12 +90,12 @@
#if defined(Rel10) || defined(Rel14)
// Mask for identifying subframe for MBMS
#define MBSFN_TDD_SF3 0x80// for TDD
#define MBSFN_TDD_SF3 0x80
// for TDD
#define MBSFN_TDD_SF4 0x40
#define MBSFN_TDD_SF7 0x20
#define MBSFN_TDD_SF8 0x10
#define MBSFN_TDD_SF9 0x08
#define MBSFN_FDD_SF1 0x80// for FDD
#define MBSFN_FDD_SF1 0x80
// for FDD
#define MBSFN_FDD_SF2 0x40
#define MBSFN_FDD_SF3 0x20
#define MBSFN_FDD_SF6 0x10
...
...
@@ -128,7 +128,11 @@
/*!\brief Maximum number od control elemenets */
#define MAX_NUM_CE 5
/*!\brief Maximum number of random access process */
#if defined(USRP_REC_PLAY)
#define NB_RA_PROC_MAX 1
#else
#define NB_RA_PROC_MAX 4
#endif
/*!\brief size of buffer status report table */
#define BSR_TABLE_SIZE 64
/*!\brief The power headroom reporting range is from -23 ...+40 dB and beyond, with step 1 */
...
...
@@ -174,7 +178,7 @@ typedef struct {
uint8_t
RAPID
:
6
;
uint8_t
T
:
1
;
uint8_t
E
:
1
;
}
__attribute__
((
__packed__
))
RA_HEADER_RAPID
;
}
__attribute__
((
__packed__
))
RA_HEADER_RAPID
;
/*!\brief MAC header of Random Access Response for backoff indicator (BI)*/
typedef
struct
{
...
...
@@ -182,7 +186,7 @@ typedef struct {
uint8_t
R
:
2
;
uint8_t
T
:
1
;
uint8_t
E
:
1
;
}
__attribute__
((
__packed__
))
RA_HEADER_BI
;
}
__attribute__
((
__packed__
))
RA_HEADER_BI
;
/*
typedef struct {
uint64_t padding:16;
...
...
@@ -219,7 +223,7 @@ typedef struct {
uint8_t
R
:
2
;
// octet 1 MSB
uint8_t
L
:
7
;
// octet 2 LSB
uint8_t
F
:
1
;
// octet 2 MSB
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_SHORT
;
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_SHORT
;
/*!\brief MAC subheader long with 15bit Length field */
typedef
struct
{
uint8_t
LCID
:
5
;
// octet 1 LSB
...
...
@@ -229,19 +233,19 @@ typedef struct {
uint8_t
F
:
1
;
// octet 2 MSB
uint8_t
L_LSB
:
8
;
uint8_t
padding
;
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_LONG
;
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_LONG
;
/*!\brief MAC subheader short without length field */
typedef
struct
{
uint8_t
LCID
:
5
;
uint8_t
E
:
1
;
uint8_t
R
:
2
;
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_FIXED
;
}
__attribute__
((
__packed__
))
SCH_SUBHEADER_FIXED
;
/*!\brief mac control element: short buffer status report for a specific logical channel group ID*/
typedef
struct
{
uint8_t
Buffer_size
:
6
;
// octet 1 LSB
uint8_t
LCGID
:
2
;
// octet 1 MSB
}
__attribute__
((
__packed__
))
BSR_SHORT
;
}
__attribute__
((
__packed__
))
BSR_SHORT
;
typedef
BSR_SHORT
BSR_TRUNCATED
;
/*!\brief mac control element: long buffer status report for all logical channel group ID*/
...
...
@@ -250,63 +254,63 @@ typedef struct {
uint8_t
Buffer_size2
:
6
;
uint8_t
Buffer_size1
:
6
;
uint8_t
Buffer_size0
:
6
;
}
__attribute__
((
__packed__
))
BSR_LONG
;
}
__attribute__
((
__packed__
))
BSR_LONG
;
#define BSR_LONG_SIZE (sizeof(BSR_LONG))
/*!\brief mac control element: timing advance */
typedef
struct
{
uint8_t
TA
:
6
;
uint8_t
R
:
2
;
}
__attribute__
((
__packed__
))
TIMING_ADVANCE_CMD
;
}
__attribute__
((
__packed__
))
TIMING_ADVANCE_CMD
;
/*!\brief mac control element: power headroom report */
typedef
struct
{
uint8_t
PH
:
6
;
uint8_t
R
:
2
;
}
__attribute__
((
__packed__
))
POWER_HEADROOM_CMD
;
}
__attribute__
((
__packed__
))
POWER_HEADROOM_CMD
;
/*! \brief MIB payload */
typedef
struct
{
uint8_t
payload
[
3
]
;
}
__attribute__
((
__packed__
))
MIB_PDU
;
uint8_t
payload
[
3
];
}
__attribute__
((
__packed__
))
MIB_PDU
;
/*! \brief CCCH payload */
typedef
struct
{
uint8_t
payload
[
CCCH_PAYLOAD_SIZE_MAX
]
;
}
__attribute__
((
__packed__
))
CCCH_PDU
;
uint8_t
payload
[
CCCH_PAYLOAD_SIZE_MAX
];
}
__attribute__
((
__packed__
))
CCCH_PDU
;
/*! \brief BCCH payload */
typedef
struct
{
uint8_t
payload
[
BCCH_PAYLOAD_SIZE_MAX
]
;
}
__attribute__
((
__packed__
))
BCCH_PDU
;
uint8_t
payload
[
BCCH_PAYLOAD_SIZE_MAX
];
}
__attribute__
((
__packed__
))
BCCH_PDU
;
/*! \brief RAR payload */
typedef
struct
{
uint8_t
payload
[
RAR_PAYLOAD_SIZE_MAX
];
}
__attribute__
((
__packed__
))
RAR_PDU
;
/*! \brief BCCH payload */
typedef
struct
{
uint8_t
payload
[
PCCH_PAYLOAD_SIZE_MAX
]
;
}
__attribute__
((
__packed__
))
PCCH_PDU
;
uint8_t
payload
[
PCCH_PAYLOAD_SIZE_MAX
];
}
__attribute__
((
__packed__
))
PCCH_PDU
;
#if defined(Rel10) || defined(Rel14)
/*! \brief MCCH payload */
typedef
struct
{
uint8_t
payload
[
MCCH_PAYLOAD_SIZE_MAX
]
;
}
__attribute__
((
__packed__
))
MCCH_PDU
;
uint8_t
payload
[
MCCH_PAYLOAD_SIZE_MAX
];
}
__attribute__
((
__packed__
))
MCCH_PDU
;
/*!< \brief MAC control element for activation and deactivation of component carriers */
typedef
struct
{
uint8_t
C7
:
1
;
/*!< \brief Component carrier 7 */
uint8_t
C6
:
1
;
/*!< \brief Component carrier 6 */
uint8_t
C5
:
1
;
/*!< \brief Component carrier 5 */
uint8_t
C4
:
1
;
/*!< \brief Component carrier 4 */
uint8_t
C3
:
1
;
/*!< \brief Component carrier 3 */
uint8_t
C2
:
1
;
/*!< \brief Component carrier 2 */
uint8_t
C1
:
1
;
/*!< \brief Component carrier 1 */
uint8_t
R
:
1
;
/*!< \brief Reserved */
}
__attribute__
((
__packed__
))
CC_ELEMENT
;
uint8_t
C7
:
1
;
/*!< \brief Component carrier 7 */
uint8_t
C6
:
1
;
/*!< \brief Component carrier 6 */
uint8_t
C5
:
1
;
/*!< \brief Component carrier 5 */
uint8_t
C4
:
1
;
/*!< \brief Component carrier 4 */
uint8_t
C3
:
1
;
/*!< \brief Component carrier 3 */
uint8_t
C2
:
1
;
/*!< \brief Component carrier 2 */
uint8_t
C1
:
1
;
/*!< \brief Component carrier 1 */
uint8_t
R
:
1
;
/*!< \brief Reserved */
}
__attribute__
((
__packed__
))
CC_ELEMENT
;
/*! \brief MAC control element: MCH Scheduling Information */
typedef
struct
{
uint8_t
stop_sf_MSB
:
3
;
// octet 1 LSB
uint8_t
lcid
:
5
;
// octet 2 MSB
uint8_t
stop_sf_LSB
:
8
;
}
__attribute__
((
__packed__
))
MSI_ELEMENT
;
}
__attribute__
((
__packed__
))
MSI_ELEMENT
;
#endif
/*! \brief Values of CCCH LCID for DLSCH */
#define CCCH_LCHANID 0
...
...
@@ -398,9 +402,18 @@ typedef struct {
#include "PHY/impl_defs_top.h"
/*!\brief RA process state*/
typedef
enum
{
IDLE
=
0
,
MSG2
,
WAITMSG3
,
MSG4
,
WAITMSG4ACK
}
RA_state
;
/*!\brief UE ULSCH scheduling states*/
typedef
enum
{
S_UL_NONE
=
0
,
S_UL_NONE
=
0
,
S_UL_WAITING
,
S_UL_SCHEDULED
,
S_UL_BUFFERED
,
...
...
@@ -409,7 +422,7 @@ typedef enum {
/*!\brief UE DLSCH scheduling states*/
typedef
enum
{
S_DL_NONE
=
0
,
S_DL_NONE
=
0
,
S_DL_WAITING
,
S_DL_SCHEDULED
,
S_DL_BUFFERED
,
...
...
@@ -418,7 +431,7 @@ typedef enum {
/*!\brief scheduling policy for the contention-based access */
typedef
enum
{
CBA_ES
=
0
,
/// equal share of RB among groups w