Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
72c11e64
Commit
72c11e64
authored
Jul 27, 2020
by
heshanyun
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/develop' into fujitsu_lte_contribution
parents
549d1748
e6e9ea28
Changes
37
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1651 additions
and
1393 deletions
+1651
-1393
cmake_targets/build_oai
cmake_targets/build_oai
+1
-1
common/utils/LOG/log.c
common/utils/LOG/log.c
+19
-5
common/utils/LOG/vcd_signal_dumper.c
common/utils/LOG/vcd_signal_dumper.c
+6
-0
common/utils/T/genids.c
common/utils/T/genids.c
+8
-0
common/utils/threadPool/measurement_display.c
common/utils/threadPool/measurement_display.c
+1
-1
common/utils/threadPool/thread-pool.c
common/utils/threadPool/thread-pool.c
+1
-1
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+9
-2
openair1/PHY/LTE_TRANSPORT/prach_common.c
openair1/PHY/LTE_TRANSPORT/prach_common.c
+6
-0
openair1/PHY/LTE_TRANSPORT/uci_tools.c
openair1/PHY/LTE_TRANSPORT/uci_tools.c
+13
-6
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+42
-7
openair1/PHY/TOOLS/signal_energy.c
openair1/PHY/TOOLS/signal_energy.c
+147
-86
openair1/SCHED/fapi_l1.c
openair1/SCHED/fapi_l1.c
+14
-0
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+9
-0
openair1/SCHED/ru_procedures.c
openair1/SCHED/ru_procedures.c
+37
-1
openair2/ENB_APP/flexran_agent_common.c
openair2/ENB_APP/flexran_agent_common.c
+5
-0
openair2/LAYER2/MAC/eNB_scheduler.c
openair2/LAYER2/MAC/eNB_scheduler.c
+178
-131
openair2/LAYER2/MAC/eNB_scheduler_RA.c
openair2/LAYER2/MAC/eNB_scheduler_RA.c
+32
-32
openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
+495
-665
openair2/LAYER2/MAC/eNB_scheduler_fairRR.h
openair2/LAYER2/MAC/eNB_scheduler_fairRR.h
+9
-0
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+17
-8
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+1
-1
openair2/LAYER2/MAC/mac.h
openair2/LAYER2/MAC/mac.h
+11
-9
openair2/LAYER2/MAC/mac_extern.h
openair2/LAYER2/MAC/mac_extern.h
+1
-1
openair2/LAYER2/MAC/mac_proto.h
openair2/LAYER2/MAC/mac_proto.h
+2
-0
openair2/LAYER2/MAC/rar_tools.c
openair2/LAYER2/MAC/rar_tools.c
+21
-4
openair2/LAYER2/RLC/rlc_rrc.c
openair2/LAYER2/RLC/rlc_rrc.c
+1
-0
openair2/PHY_INTERFACE/IF_Module.c
openair2/PHY_INTERFACE/IF_Module.c
+5
-2
openair2/RRC/LTE/MESSAGES/asn1_msg.c
openair2/RRC/LTE/MESSAGES/asn1_msg.c
+36
-7
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+484
-412
openair2/UTIL/OCG/OCG_call_emu.c
openair2/UTIL/OCG/OCG_call_emu.c
+5
-0
openair2/UTIL/OCG/OCG_save_XML.c
openair2/UTIL/OCG/OCG_save_XML.c
+5
-0
openair2/UTIL/OPT/probe.c
openair2/UTIL/OPT/probe.c
+5
-0
openair2/UTIL/OTG/otg_kpi.c
openair2/UTIL/OTG/otg_kpi.c
+10
-0
openair2/X2AP/x2ap_eNB_generate_messages.c
openair2/X2AP/x2ap_eNB_generate_messages.c
+6
-6
openair2/X2AP/x2ap_eNB_handler.c
openair2/X2AP/x2ap_eNB_handler.c
+3
-3
openair3/NAS/COMMON/UTIL/memory.c
openair3/NAS/COMMON/UTIL/memory.c
+5
-0
openair3/S1AP/s1ap_eNB_handlers.c
openair3/S1AP/s1ap_eNB_handlers.c
+1
-2
No files found.
cmake_targets/build_oai
View file @
72c11e64
...
@@ -599,7 +599,7 @@ function main() {
...
@@ -599,7 +599,7 @@ function main() {
echo
"set ( PHY_RM
$PHY_RM
)"
>>
$cmake_file
echo
"set ( PHY_RM
$PHY_RM
)"
>>
$cmake_file
echo
"set ( UDP_1MS
$UDP_1MS
)"
>>
$cmake_file
echo
"set ( UDP_1MS
$UDP_1MS
)"
>>
$cmake_file
echo
"set ( PHYSIM
$PHYSIM
)"
>>
$cmake_file
echo
"set ( PHYSIM
$PHYSIM
)"
>>
$cmake_file
echo
"set ( PRE_SCD_THREAD
$UE_EXPANSION
)"
>>
$cmake_file
echo
"set ( PRE_SCD_THREAD
True)"
>>
$cmake_file
echo
"set ( UESIM_EXPANSION
$UESIM_EXPANSION
)"
>>
$cmake_file
echo
"set ( UESIM_EXPANSION
$UESIM_EXPANSION
)"
>>
$cmake_file
echo
"set ( ENABLE_VCD_FIFO
$VCD_TIMING
)"
>>
$cmake_file
echo
"set ( ENABLE_VCD_FIFO
$VCD_TIMING
)"
>>
$cmake_file
echo
"set ( RF_BOARD
\"
${
HW
}
\"
)"
>>
$cmake_file
echo
"set ( RF_BOARD
\"
${
HW
}
\"
)"
>>
$cmake_file
...
...
common/utils/LOG/log.c
View file @
72c11e64
...
@@ -98,7 +98,11 @@ int write_file_matlab(const char *fname,
...
@@ -98,7 +98,11 @@ int write_file_matlab(const char *fname,
return
-
1
;
return
-
1
;
//printf("Writing %d elements of type %d to %s\n",length,format,fname);
//printf("Writing %d elements of type %d to %s\n",length,format,fname);
if
(
-
1
==
(
access
(
fname
,
F_OK
))){
creat
(
fname
,
0644
);
}
else
{
chmod
(
fname
,
0644
);
}
if
(
format
==
10
||
format
==
11
||
format
==
12
||
format
==
13
||
format
==
14
)
{
if
(
format
==
10
||
format
==
11
||
format
==
12
||
format
==
13
||
format
==
14
)
{
fp
=
fopen
(
fname
,
"a+"
);
fp
=
fopen
(
fname
,
"a+"
);
}
else
if
(
format
!=
10
&&
format
!=
11
&&
format
!=
12
&&
format
!=
13
&&
format
!=
14
)
{
}
else
if
(
format
!=
10
&&
format
!=
11
&&
format
!=
12
&&
format
!=
13
&&
format
!=
14
)
{
...
@@ -622,6 +626,11 @@ void set_glog_filelog(int enable)
...
@@ -622,6 +626,11 @@ void set_glog_filelog(int enable)
static
FILE
*
fptr
;
static
FILE
*
fptr
;
if
(
enable
)
{
if
(
enable
)
{
if
(
-
1
==
(
access
(
g_log
->
filelog_name
,
F_OK
))){
creat
(
g_log
->
filelog_name
,
0644
);
}
else
{
chmod
(
g_log
->
filelog_name
,
0644
);
}
fptr
=
fopen
(
g_log
->
filelog_name
,
"w"
);
fptr
=
fopen
(
g_log
->
filelog_name
,
"w"
);
for
(
int
c
=
0
;
c
<
MAX_LOG_COMPONENTS
;
c
++
)
{
for
(
int
c
=
0
;
c
<
MAX_LOG_COMPONENTS
;
c
++
)
{
...
@@ -645,6 +654,11 @@ void set_glog_filelog(int enable)
...
@@ -645,6 +654,11 @@ void set_glog_filelog(int enable)
void
set_component_filelog
(
int
comp
)
void
set_component_filelog
(
int
comp
)
{
{
if
(
g_log
->
log_component
[
comp
].
stream
==
NULL
||
g_log
->
log_component
[
comp
].
stream
==
stdout
)
{
if
(
g_log
->
log_component
[
comp
].
stream
==
NULL
||
g_log
->
log_component
[
comp
].
stream
==
stdout
)
{
if
(
-
1
==
(
access
(
g_log
->
log_component
[
comp
].
filelog_name
,
F_OK
))){
creat
(
g_log
->
log_component
[
comp
].
filelog_name
,
0644
);
}
else
{
chmod
(
g_log
->
log_component
[
comp
].
filelog_name
,
0644
);
}
g_log
->
log_component
[
comp
].
stream
=
fopen
(
g_log
->
log_component
[
comp
].
filelog_name
,
"w"
);
g_log
->
log_component
[
comp
].
stream
=
fopen
(
g_log
->
log_component
[
comp
].
filelog_name
,
"w"
);
}
}
...
@@ -755,7 +769,7 @@ void flush_mem_to_file(void)
...
@@ -755,7 +769,7 @@ void flush_mem_to_file(void)
printf
(
"log over write!!!
\n
"
);
printf
(
"log over write!!!
\n
"
);
}
}
snprintf
(
f_name
,
1024
,
"%s_%d.log"
,
log_mem_filename
,
log_mem_file_cnt
);
snprintf
(
f_name
,
1024
,
"%s_%d.log"
,
log_mem_filename
,
log_mem_file_cnt
);
fp
=
open
(
f_name
,
O_WRONLY
|
O_CREAT
,
06
66
);
fp
=
open
(
f_name
,
O_WRONLY
|
O_CREAT
,
06
44
);
if
(
fp
==-
1
){
if
(
fp
==-
1
){
fprintf
(
stderr
,
"{LOG} %s %d Couldn't file open in %s
\n
"
,
__FILE__
,
__LINE__
,
f_name
);
fprintf
(
stderr
,
"{LOG} %s %d Couldn't file open in %s
\n
"
,
__FILE__
,
__LINE__
,
f_name
);
}
else
{
}
else
{
...
@@ -964,7 +978,7 @@ void close_log_mem(void){
...
@@ -964,7 +978,7 @@ void close_log_mem(void){
}
}
if
(
log_mem_multi
==
1
){
if
(
log_mem_multi
==
1
){
snprintf
(
f_name
,
1024
,
"%s_%d.log"
,
log_mem_filename
,
log_mem_file_cnt
);
snprintf
(
f_name
,
1024
,
"%s_%d.log"
,
log_mem_filename
,
log_mem_file_cnt
);
fp
=
open
(
f_name
,
O_WRONLY
|
O_CREAT
,
06
66
);
fp
=
open
(
f_name
,
O_WRONLY
|
O_CREAT
,
06
44
);
int
ret
=
write
(
fp
,
log_mem_d
[
0
].
buf_p
,
log_mem_d
[
0
].
buf_index
);
int
ret
=
write
(
fp
,
log_mem_d
[
0
].
buf_p
,
log_mem_d
[
0
].
buf_index
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"{LOG} %s %d Couldn't write in %s
\n
"
,
__FILE__
,
__LINE__
,
f_name
);
fprintf
(
stderr
,
"{LOG} %s %d Couldn't write in %s
\n
"
,
__FILE__
,
__LINE__
,
f_name
);
...
@@ -974,7 +988,7 @@ void close_log_mem(void){
...
@@ -974,7 +988,7 @@ void close_log_mem(void){
free
(
log_mem_d
[
0
].
buf_p
);
free
(
log_mem_d
[
0
].
buf_p
);
snprintf
(
f_name
,
1024
,
"%s_%d.log"
,
log_mem_filename
,
log_mem_file_cnt
);
snprintf
(
f_name
,
1024
,
"%s_%d.log"
,
log_mem_filename
,
log_mem_file_cnt
);
fp
=
open
(
f_name
,
O_WRONLY
|
O_CREAT
,
06
66
);
fp
=
open
(
f_name
,
O_WRONLY
|
O_CREAT
,
06
44
);
ret
=
write
(
fp
,
log_mem_d
[
1
].
buf_p
,
log_mem_d
[
1
].
buf_index
);
ret
=
write
(
fp
,
log_mem_d
[
1
].
buf_p
,
log_mem_d
[
1
].
buf_index
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"{LOG} %s %d Couldn't write in %s
\n
"
,
__FILE__
,
__LINE__
,
f_name
);
fprintf
(
stderr
,
"{LOG} %s %d Couldn't write in %s
\n
"
,
__FILE__
,
__LINE__
,
f_name
);
...
@@ -983,7 +997,7 @@ void close_log_mem(void){
...
@@ -983,7 +997,7 @@ void close_log_mem(void){
close
(
fp
);
close
(
fp
);
free
(
log_mem_d
[
1
].
buf_p
);
free
(
log_mem_d
[
1
].
buf_p
);
}
else
{
}
else
{
fp
=
open
(
log_mem_filename
,
O_WRONLY
|
O_CREAT
,
06
66
);
fp
=
open
(
log_mem_filename
,
O_WRONLY
|
O_CREAT
,
06
44
);
int
ret
=
write
(
fp
,
log_mem_d
[
0
].
buf_p
,
log_mem_d
[
0
].
buf_index
);
int
ret
=
write
(
fp
,
log_mem_d
[
0
].
buf_p
,
log_mem_d
[
0
].
buf_index
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"{LOG} %s %d Couldn't write in %s
\n
"
,
__FILE__
,
__LINE__
,
log_mem_filename
);
fprintf
(
stderr
,
"{LOG} %s %d Couldn't write in %s
\n
"
,
__FILE__
,
__LINE__
,
log_mem_filename
);
...
...
common/utils/LOG/vcd_signal_dumper.c
View file @
72c11e64
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <error.h>
#include <error.h>
#include <time.h>
#include <time.h>
#include <unistd.h>
#include <unistd.h>
#include <sys/stat.h>
#include "assertions.h"
#include "assertions.h"
...
@@ -719,6 +720,11 @@ void vcd_signal_dumper_init(char *filename)
...
@@ -719,6 +720,11 @@ void vcd_signal_dumper_init(char *filename)
if
(
ouput_vcd
)
{
if
(
ouput_vcd
)
{
// char filename[] = "/tmp/openair_vcd_dump.vcd";
// char filename[] = "/tmp/openair_vcd_dump.vcd";
if
(
-
1
==
(
access
(
filename
,
F_OK
))){
creat
(
filename
,
0644
);
}
else
{
chmod
(
filename
,
0644
);
}
if
((
vcd_fd
=
fopen
(
filename
,
"w+"
))
==
NULL
)
{
if
((
vcd_fd
=
fopen
(
filename
,
"w+"
))
==
NULL
)
{
perror
(
"vcd_signal_dumper_init: cannot open file"
);
perror
(
"vcd_signal_dumper_init: cannot open file"
);
return
;
return
;
...
...
common/utils/T/genids.c
View file @
72c11e64
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
char
**
unique_ids
;
char
**
unique_ids
;
int
unique_ids_size
;
int
unique_ids_size
;
...
@@ -175,6 +178,11 @@ int main(int n, char **v) {
...
@@ -175,6 +178,11 @@ int main(int n, char **v) {
exit
(
1
);
exit
(
1
);
}
}
if
(
-
1
==
(
access
(
out_name
,
F_OK
))){
creat
(
out_name
,
0644
);
}
else
{
chmod
(
out_name
,
0644
);
}
out
=
fopen
(
out_name
,
"w"
);
out
=
fopen
(
out_name
,
"w"
);
if
(
out
==
NULL
)
{
if
(
out
==
NULL
)
{
...
...
common/utils/threadPool/measurement_display.c
View file @
72c11e64
...
@@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
...
@@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
exit
(
1
);
exit
(
1
);
}
}
mkfifo
(
argv
[
1
],
06
66
);
mkfifo
(
argv
[
1
],
06
44
);
int
fd
=
open
(
argv
[
1
],
O_RDONLY
);
int
fd
=
open
(
argv
[
1
],
O_RDONLY
);
if
(
fd
==
-
1
)
{
if
(
fd
==
-
1
)
{
...
...
common/utils/threadPool/thread-pool.c
View file @
72c11e64
...
@@ -100,7 +100,7 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
...
@@ -100,7 +100,7 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
pool
->
measurePerf
=
measr
!=
NULL
;
pool
->
measurePerf
=
measr
!=
NULL
;
if
(
measr
)
{
if
(
measr
)
{
mkfifo
(
measr
,
06
66
);
mkfifo
(
measr
,
06
44
);
AssertFatal
(
-
1
!=
(
pool
->
dummyTraceFd
=
AssertFatal
(
-
1
!=
(
pool
->
dummyTraceFd
=
open
(
measr
,
O_RDONLY
|
O_NONBLOCK
)),
""
);
open
(
measr
,
O_RDONLY
|
O_NONBLOCK
)),
""
);
AssertFatal
(
-
1
!=
(
pool
->
traceFd
=
AssertFatal
(
-
1
!=
(
pool
->
traceFd
=
...
...
nfapi/oai_integration/nfapi_vnf.c
View file @
72c11e64
...
@@ -359,12 +359,19 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
...
@@ -359,12 +359,19 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
exit_fun
(
"error locking mutex_rxtx"
);
exit_fun
(
"error locking mutex_rxtx"
);
return
(
-
1
);
return
(
-
1
);
}
}
static
int
busy_log_cnt
=
0
;
if
(
L1_proc
->
instance_cnt
<
0
){
if
(
L1_proc
->
instance_cnt
<
0
){
++
L1_proc
->
instance_cnt
;
++
L1_proc
->
instance_cnt
;
if
(
busy_log_cnt
!=
0
){
LOG_E
(
MAC
,
"RCC singal to rxtx frame %d subframe %d busy end %d (frame %d subframe %d)
\n
"
,
L1_proc
->
frame_rx
,
L1_proc
->
subframe_rx
,
busy_log_cnt
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
}
busy_log_cnt
=
0
;
}
else
{
}
else
{
LOG_E
(
MAC
,
"RCC singal to rxtx frame %d subframe %d busy %d (frame %d subframe %d)
\n
"
,
L1_proc
->
frame_rx
,
L1_proc
->
subframe_rx
,
L1_proc
->
instance_cnt
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
if
(
busy_log_cnt
==
0
){
LOG_E
(
MAC
,
"RCC singal to rxtx frame %d subframe %d busy %d (frame %d subframe %d)
\n
"
,
L1_proc
->
frame_rx
,
L1_proc
->
subframe_rx
,
L1_proc
->
instance_cnt
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
}
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
busy_log_cnt
++
;
return
(
0
);
return
(
0
);
}
}
...
...
openair1/PHY/LTE_TRANSPORT/prach_common.c
View file @
72c11e64
...
@@ -328,6 +328,12 @@ uint16_t prach_root_sequence_map4[138] = { 1,138,2,137,3,136,4,135,5,134,6,133,
...
@@ -328,6 +328,12 @@ uint16_t prach_root_sequence_map4[138] = { 1,138,2,137,3,136,4,135,5,134,6,133,
void
dump_prach_config
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
subframe
)
{
void
dump_prach_config
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
subframe
)
{
FILE
*
fd
;
FILE
*
fd
;
if
(
-
1
==
(
access
(
"prach_config.txt"
,
F_OK
))){
creat
(
"prach_config.txt"
,
0644
);
}
else
{
chmod
(
"prach_config.txt"
,
0644
);
}
fd
=
fopen
(
"prach_config.txt"
,
"w"
);
fd
=
fopen
(
"prach_config.txt"
,
"w"
);
fprintf
(
fd
,
"prach_config: subframe = %d
\n
"
,
subframe
);
fprintf
(
fd
,
"prach_config: subframe = %d
\n
"
,
subframe
);
fprintf
(
fd
,
"prach_config: N_RB_UL = %d
\n
"
,
frame_parms
->
N_RB_UL
);
fprintf
(
fd
,
"prach_config: N_RB_UL = %d
\n
"
,
frame_parms
->
N_RB_UL
);
...
...
openair1/PHY/LTE_TRANSPORT/uci_tools.c
View file @
72c11e64
...
@@ -53,12 +53,19 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
...
@@ -53,12 +53,19 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
else
if
((
eNB
->
uci_vars
[
i
].
active
==
0
)
&&
(
first_free_index
==-
1
))
first_free_index
=
i
;
else
if
((
eNB
->
uci_vars
[
i
].
active
==
0
)
&&
(
first_free_index
==-
1
))
first_free_index
=
i
;
}
}
if
(
type
==
SEARCH_EXIST
)
return
(
-
1
);
if
(
type
==
SEARCH_EXIST
){
LOG_E
(
PHY
,
"find_uci find_type is SEARCH_EXIST , return -1
\n
"
);
if
(
first_free_index
==-
1
)
return
(
-
1
);
LOG_E
(
MAC
,
"UCI table is full
\n
"
);
}
else
{
return
(
first_free_index
);
if
(
first_free_index
<
0
){
LOG_E
(
PHY
,
"find_uci first_free_index = %d,rnti = %d,frame = %d,subframe = %d, last i = %d
\n
"
,
first_free_index
,
rnti
,
frame
,
subframe
,
i
);
for
(
i
=
0
;
i
<
NUMBER_OF_UCI_VARS_MAX
;
i
++
)
{
LOG_T
(
PHY
,
"eNB->uci_vars[%d]
\t
active = %d
\t
rnti = %x
\t
frame = %d
\t
subframe = %d
\t
type %d
\n
"
,
i
,
eNB
->
uci_vars
[
i
].
active
,
eNB
->
uci_vars
[
i
].
rnti
,
eNB
->
uci_vars
[
i
].
frame
,
eNB
->
uci_vars
[
i
].
subframe
,
eNB
->
uci_vars
[
i
].
type
);
}
}
return
(
first_free_index
);
}
}
}
...
...
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
View file @
72c11e64
...
@@ -45,7 +45,6 @@
...
@@ -45,7 +45,6 @@
//extern int **ulchmag_eren;
//extern int **ulchmag_eren;
//eren
//eren
static
short
jitter
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
1
,
0
,
0
,
1
,
0
,
1
,
1
,
0
};
static
short
jitterc
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
0
,
1
,
1
,
0
,
1
,
0
,
0
,
1
};
static
short
jitterc
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
0
,
1
,
1
,
0
,
1
,
0
,
0
,
1
};
void
lte_idft
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint32_t
*
z
,
uint16_t
Msc_PUSCH
)
{
void
lte_idft
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint32_t
*
z
,
uint16_t
Msc_PUSCH
)
{
...
@@ -758,6 +757,9 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
...
@@ -758,6 +757,9 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
__m128i
*
ul_ch128
,
*
ul_ch_mag128
,
*
ul_ch_mag128b
,
*
rxdataF128
,
*
rxdataF_comp128
;
__m128i
*
ul_ch128
,
*
ul_ch_mag128
,
*
ul_ch_mag128b
,
*
rxdataF128
,
*
rxdataF_comp128
;
uint8_t
aarx
;
//,symbol_mod;
uint8_t
aarx
;
//,symbol_mod;
__m128i
mmtmpU0
,
mmtmpU1
,
mmtmpU2
,
mmtmpU3
;
__m128i
mmtmpU0
,
mmtmpU1
,
mmtmpU2
,
mmtmpU3
;
static
short
ref_min
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
};
#elif defined(__arm__)
#elif defined(__arm__)
int16x4_t
*
ul_ch128
,
*
rxdataF128
;
int16x4_t
*
ul_ch128
,
*
rxdataF128
;
int16x8_t
*
ul_ch_mag128
,
*
ul_ch_mag128b
,
*
rxdataF_comp128
;
int16x8_t
*
ul_ch_mag128
,
*
ul_ch_mag128b
,
*
rxdataF_comp128
;
...
@@ -765,6 +767,9 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
...
@@ -765,6 +767,9 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
int32x4_t
mmtmpU0
,
mmtmpU1
,
mmtmpU0b
,
mmtmpU1b
;
int32x4_t
mmtmpU0
,
mmtmpU1
,
mmtmpU0b
,
mmtmpU1b
;
int16_t
conj
[
4
]
__attribute__
((
aligned
(
16
)))
=
{
1
,
-
1
,
1
,
-
1
};
int16_t
conj
[
4
]
__attribute__
((
aligned
(
16
)))
=
{
1
,
-
1
,
1
,
-
1
};
int32x4_t
output_shift128
=
vmovq_n_s32
(
-
(
int32_t
)
output_shift
);
int32x4_t
output_shift128
=
vmovq_n_s32
(
-
(
int32_t
)
output_shift
);
static
short
ref_min
[
8
]
__attribute__
((
aligned
(
16
)))
=
{
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
,
SHRT_MIN
};
#endif
#endif
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
...
@@ -872,9 +877,10 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
...
@@ -872,9 +877,10 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
// print_shorts("ch:",ul_ch128[2]);
// print_shorts("ch:",ul_ch128[2]);
// print_shorts("pack:",rxdataF_comp128[2]);
// print_shorts("pack:",rxdataF_comp128[2]);
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
rxdataF_comp128
[
0
]
=
_mm_add_epi16
(
rxdataF_comp128
[
0
],(
*
(
__m128i
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
0
]
=
_mm_subs_epi16
(
rxdataF_comp128
[
0
],
_mm_cmpeq_epi16
(
rxdataF_comp128
[
0
],(
*
(
__m128i
*
)
&
ref_min
[
0
])));
rxdataF_comp128
[
1
]
=
_mm_add_epi16
(
rxdataF_comp128
[
1
],(
*
(
__m128i
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
1
]
=
_mm_subs_epi16
(
rxdataF_comp128
[
1
],
_mm_cmpeq_epi16
(
rxdataF_comp128
[
1
],(
*
(
__m128i
*
)
&
ref_min
[
0
])));
rxdataF_comp128
[
2
]
=
_mm_add_epi16
(
rxdataF_comp128
[
2
],(
*
(
__m128i
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
2
]
=
_mm_subs_epi16
(
rxdataF_comp128
[
2
],
_mm_cmpeq_epi16
(
rxdataF_comp128
[
2
],(
*
(
__m128i
*
)
&
ref_min
[
0
])));
ul_ch128
+=
3
;
ul_ch128
+=
3
;
ul_ch_mag128
+=
3
;
ul_ch_mag128
+=
3
;
ul_ch_mag128b
+=
3
;
ul_ch_mag128b
+=
3
;
...
@@ -921,9 +927,10 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
...
@@ -921,9 +927,10 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU1
=
vqshlq_s32
(
mmtmpU1
,
-
output_shift128
);
mmtmpU1
=
vqshlq_s32
(
mmtmpU1
,
-
output_shift128
);
rxdataF_comp128
[
2
]
=
vcombine_s16
(
vmovn_s32
(
mmtmpU0
),
vmovn_s32
(
mmtmpU1
));
rxdataF_comp128
[
2
]
=
vcombine_s16
(
vmovn_s32
(
mmtmpU0
),
vmovn_s32
(
mmtmpU1
));
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
rxdataF_comp128
[
0
]
=
vqaddq_s16
(
rxdataF_comp128
[
0
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
0
]
=
vqsubq_s16
(
rxdataF_comp128
[
0
],
vceqq_s16
(
rxdataF_comp128
[
0
],(
*
(
int16x8_t
*
)
&
ref_min
[
0
])));
rxdataF_comp128
[
1
]
=
vqaddq_s16
(
rxdataF_comp128
[
1
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
1
]
=
vqsubq_s16
(
rxdataF_comp128
[
1
],
vceqq_s16
(
rxdataF_comp128
[
1
],(
*
(
int16x8_t
*
)
&
ref_min
[
0
])));
rxdataF_comp128
[
2
]
=
vqaddq_s16
(
rxdataF_comp128
[
2
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
2
]
=
vqsubq_s16
(
rxdataF_comp128
[
2
],
vceqq_s16
(
rxdataF_comp128
[
1
],(
*
(
int16x8_t
*
)
&
ref_min
[
0
])));
ul_ch128
+=
6
;
ul_ch128
+=
6
;
ul_ch_mag128
+=
3
;
ul_ch_mag128
+=
3
;
ul_ch_mag128b
+=
3
;
ul_ch_mag128b
+=
3
;
...
@@ -1045,6 +1052,10 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
...
@@ -1045,6 +1052,10 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
return
;
return
;
}
}
short
*
rxF_ext
;
int
re
;
double
ave_power
=
0
;
int
shift
=
0
;
for
(
l
=
0
;
l
<
(
frame_parms
->
symbols_per_tti
-
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
srs_active
);
l
++
)
{
for
(
l
=
0
;
l
<
(
frame_parms
->
symbols_per_tti
-
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
srs_active
);
l
++
)
{
if
(
LOG_DEBUGFLAG
(
DEBUG_ULSCH
))
{
if
(
LOG_DEBUGFLAG
(
DEBUG_ULSCH
))
{
...
@@ -1062,6 +1073,28 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
...
@@ -1062,6 +1073,28 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
l
%
(
frame_parms
->
symbols_per_tti
/
2
),
l
%
(
frame_parms
->
symbols_per_tti
/
2
),
l
/
(
frame_parms
->
symbols_per_tti
/
2
),
l
/
(
frame_parms
->
symbols_per_tti
/
2
),
frame_parms
);
frame_parms
);
for
(
re
=
0
;
re
<
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
;
re
++
){
rxF_ext
=
(
short
*
)
&
pusch_vars
->
rxdataF_ext
[
0
][(
l
*
frame_parms
->
N_RB_UL
*
12
)
+
re
];
ave_power
+=
rxF_ext
[
0
]
*
rxF_ext
[
0
]
+
rxF_ext
[
1
]
*
rxF_ext
[
1
];
}
}
ave_power
/=
(
double
)(
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
*
(
frame_parms
->
symbols_per_tti
-
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
srs_active
));
LOG_D
(
PHY
,
"rxF_ext ave %lf
\n
"
,
sqrt
(
ave_power
));
if
(
ave_power
>
1
.
0
){
shift
=
3
-
(
int
)
log2
(
sqrt
((
double
)
ave_power
));
}
if
(
shift
>
0
){
short
*
temp_iq
;
for
(
i
=
0
;
i
<
frame_parms
->
symbols_per_tti
*
frame_parms
->
ofdm_symbol_size
;
i
++
){
temp_iq
=
(
short
*
)
&
pusch_vars
->
rxdataF_ext
[
0
][
i
];
temp_iq
[
0
]
<<=
shift
;
temp_iq
[
1
]
<<=
shift
;
}
}
else
{
shift
=
0
;
}
for
(
l
=
0
;
l
<
(
frame_parms
->
symbols_per_tti
-
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
srs_active
);
l
++
)
{
if
(
lte_ul_channel_estimation
(
&
eNB
->
frame_parms
,
proc
,
if
(
lte_ul_channel_estimation
(
&
eNB
->
frame_parms
,
proc
,
eNB
->
ulsch
[
UE_id
],
eNB
->
ulsch
[
UE_id
],
...
@@ -1107,6 +1140,8 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
...
@@ -1107,6 +1140,8 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
pusch_vars
->
ulsch_interference_power
[
i
]
=
pusch_vars
->
ulsch_interference_power
[
i
]
/
correction_factor
;
pusch_vars
->
ulsch_interference_power
[
i
]
=
pusch_vars
->
ulsch_interference_power
[
i
]
/
correction_factor
;
pusch_vars
->
ulsch_power
[
i
]
=
pusch_vars
->
ulsch_power
[
i
]
/
correction_factor
;
pusch_vars
->
ulsch_power
[
i
]
=
pusch_vars
->
ulsch_power
[
i
]
/
correction_factor
;
pusch_vars
->
ulsch_power
[
i
]
/=
pow
(
4
,
shift
);
pusch_vars
->
ulsch_interference_power
[
i
]
/=
pow
(
4
,
shift
);
if
(
pusch_vars
->
ulsch_power
[
i
]
>
0x20000000
){
if
(
pusch_vars
->
ulsch_power
[
i
]
>
0x20000000
){
pusch_vars
->
ulsch_power
[
i
]
=
0x20000000
;
pusch_vars
->
ulsch_power
[
i
]
=
0x20000000
;
pusch_vars
->
ulsch_interference_power
[
i
]
=
1
;
pusch_vars
->
ulsch_interference_power
[
i
]
=
1
;
...
...
openair1/PHY/TOOLS/signal_energy.c
View file @
72c11e64
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#define shift 4
#define shift 4
//#define shift_DC 0
//#define shift_DC 0
#define SHRT_MIN -32768
#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(__i386__)
#ifdef LOCALIZATION
#ifdef LOCALIZATION
...
@@ -67,52 +68,86 @@ int32_t subcarrier_energy(int32_t *input,uint32_t length, int32_t *subcarrier_en
...
@@ -67,52 +68,86 @@ int32_t subcarrier_energy(int32_t *input,uint32_t length, int32_t *subcarrier_en
}
}
#endif
#endif
//int32_t signal_energy(int32_t *input,uint32_t length)
//{
//
// int32_t i;
// int32_t temp,temp2;
// register __m64 mm0,mm1,mm2,mm3;
// __m64 *in = (__m64 *)input;
//
//
// mm0 = _mm_setzero_si64();//pxor(mm0,mm0);
// mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
//
// for (i=0; i<length>>1; i++) {
//
// mm1 = in[i];
// mm2 = mm1;
// mm1 = _m_pmaddwd(mm1,mm1);
// mm1 = _m_psradi(mm1,shift);// shift any 32 bits blocs of the word by the value shift
// mm0 = _m_paddd(mm0,mm1);// add the two 64 bits words 4 bytes by 4 bytes
// // mm2 = _m_psrawi(mm2,shift_DC);
// mm3 = _m_paddw(mm3,mm2);// add the two 64 bits words 2 bytes by 2 bytes
// }
//
// mm1 = mm0;
// mm0 = _m_psrlqi(mm0,32);
// mm0 = _m_paddd(mm0,mm1);
// temp = _m_to_int(mm0);
// temp/=length;
// temp<<=shift; // this is the average of x^2
//
// // now remove the DC component
//
//
// mm2 = _m_psrlqi(mm3,32);
// mm2 = _m_paddw(mm2,mm3);
// mm2 = _m_pmaddwd(mm2,mm2);
// temp2 = _m_to_int(mm2);
// temp2/=(length*length);
// // temp2<<=(2*shift_DC);
// temp -= temp2;
//
// _mm_empty();
// _m_empty();
//
// return((temp>0)?temp:1);
//-----------------------------------------------------------------
// Average Power calculation with DC removing
//-----------------------------------------------------------------
int32_t
signal_energy
(
int32_t
*
input
,
uint32_t
length
)
int32_t
signal_energy
(
int32_t
*
input
,
uint32_t
length
)
{
{
uint32_t
i
;
int32_t
i
;
int32_t
temp
;
int32_t
temp
,
temp2
;
__m128i
in
,
in_clp
,
i16_min
,
coe1
;
register
__m64
mm0
,
mm1
,
mm2
,
mm3
;
__m128
num0
,
num1
,
num2
,
num3
,
recp1
;
__m64
*
in
=
(
__m64
*
)
input
;
//init
num0
=
_mm_setzero_ps
();
mm0
=
_mm_setzero_si64
();
//pxor(mm0,mm0
);
num1
=
_mm_setzero_ps
(
);
mm3
=
_mm_setzero_si64
();
//pxor(mm3,mm3
);
i16_min
=
_mm_set1_epi16
(
SHRT_MIN
);
coe1
=
_mm_set1_epi16
(
1
);
for
(
i
=
0
;
i
<
length
>>
1
;
i
++
)
{
recp1
=
_mm_rcp_ps
(
_mm_cvtepi32_ps
(
_mm_set1_epi32
(
length
)));
mm1
=
in
[
i
];
//Acc
mm2
=
mm1
;
for
(
i
=
0
;
i
<
(
length
>>
2
);
i
++
)
{
mm1
=
_m_pmaddwd
(
mm1
,
mm1
);
in
=
_mm_loadu_si128
((
__m128i
*
)
input
);
mm1
=
_m_psradi
(
mm1
,
shift
);
// shift any 32 bits blocs of the word by the value shift
in_clp
=
_mm_subs_epi16
(
in
,
_mm_cmpeq_epi16
(
in
,
i16_min
));
//if in=SHRT_MIN in+1, else in
mm0
=
_m_paddd
(
mm0
,
mm1
);
// add the two 64 bits words 4 bytes by 4 bytes
num0
=
_mm_add_ps
(
num0
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
in_clp
,
in_clp
)));
// mm2 = _m_psrawi(mm2,shift_DC);
num1
=
_mm_add_ps
(
num1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
in
,
coe1
)));
//DC
mm3
=
_m_paddw
(
mm3
,
mm2
);
// add the two 64 bits words 2 bytes by 2 bytes
input
+=
4
;
}
}
//Ave
num2
=
_mm_dp_ps
(
num0
,
recp1
,
0xFF
);
//AC power
num3
=
_mm_dp_ps
(
num1
,
recp1
,
0xFF
);
//DC
num3
=
_mm_mul_ps
(
num3
,
num3
);
//DC power
//remove DC
temp
=
_mm_cvtsi128_si32
(
_mm_cvttps_epi32
(
_mm_sub_ps
(
num2
,
num3
)));
mm1
=
mm0
;
return
temp
;
mm0
=
_m_psrlqi
(
mm0
,
32
);
mm0
=
_m_paddd
(
mm0
,
mm1
);
temp
=
_m_to_int
(
mm0
);
temp
/=
length
;
temp
<<=
shift
;
// this is the average of x^2
// now remove the DC component
mm2
=
_m_psrlqi
(
mm3
,
32
);
mm2
=
_m_paddw
(
mm2
,
mm3
);
mm2
=
_m_pmaddwd
(
mm2
,
mm2
);
temp2
=
_m_to_int
(
mm2
);
temp2
/=
(
length
*
length
);
// temp2<<=(2*shift_DC);
temp
-=
temp2
;
_mm_empty
();
_m_empty
();
return
((
temp
>
0
)
?
temp
:
1
);
}
}
int32_t
signal_energy_amp_shift
(
int32_t
*
input
,
uint32_t
length
)
int32_t
signal_energy_amp_shift
(
int32_t
*
input
,
uint32_t
length
)
...
@@ -164,60 +199,86 @@ int32_t signal_energy_amp_shift(int32_t *input,uint32_t length)
...
@@ -164,60 +199,86 @@ int32_t signal_energy_amp_shift(int32_t *input,uint32_t length)
int32_t
signal_energy_nodc
(
int32_t
*
input
,
uint32_t
length
)
int32_t
signal_energy_nodc
(
int32_t
*
input
,
uint32_t
length
)
{
{
int32_t
i
;
// int32_t i;
int32_t
temp
;
// int32_t temp;
register
__m64
mm0
,
mm1
;
//,mm2,mm3;
// register __m64 mm0,mm1;//,mm2,mm3;
__m64
*
in
=
(
__m64
*
)
input
;
// __m64 *in = (__m64 *)input;
//
//#ifdef MAIN
// int16_t *printb;
//#endif
//
// mm0 = _mm_setzero_si64();//_pxor(mm0,mm0);
// // mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
//
// for (i=0; i<length>>1; i++) {
//
// mm1 = in[i];
// mm1 = _m_pmaddwd(mm1,mm1);// SIMD complex multiplication
// mm1 = _m_psradi(mm1,shift);
// mm0 = _m_paddd(mm0,mm1);
// // temp2 = mm0;
// // printf("%d %d\n",((int *)&in[i])[0],((int *)&in[i])[1]);
//
//
// // printb = (int16_t *)&mm2;
// // printf("mm2 %d : %d %d %d %d\n",i,printb[0],printb[1],printb[2],printb[3]);
//
//
// }
//
// /*
// #ifdef MAIN
// printb = (int16_t *)&mm3;
// printf("%d %d %d %d\n",printb[0],printb[1],printb[2],printb[3]);
// #endif
// */
// mm1 = mm0;
//
// mm0 = _m_psrlqi(mm0,32);
//
// mm0 = _m_paddd(mm0,mm1);
//
// temp = _m_to_int(mm0);
//
// temp/=length;
// temp<<=shift; // this is the average of x^2
//
//#ifdef MAIN
// printf("E x^2 = %d\n",temp);
//#endif
// _mm_empty();
// _m_empty();
//
//
//
// return((temp>0)?temp:1);
#ifdef MAIN
int16_t
*
printb
;
#endif
mm0
=
_mm_setzero_si64
();
//_pxor(mm0,mm0);
// mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
for
(
i
=
0
;
i
<
length
>>
1
;
i
++
)
{
mm1
=
in
[
i
];
mm1
=
_m_pmaddwd
(
mm1
,
mm1
);
// SIMD complex multiplication
mm1
=
_m_psradi
(
mm1
,
shift
);
mm0
=
_m_paddd
(
mm0
,
mm1
);
// temp2 = mm0;
// printf("%d %d\n",((int *)&in[i])[0],((int *)&in[i])[1]);
// printb = (int16_t *)&mm2
;
int32_t
i
;
// printf("mm2 %d : %d %d %d %d\n",i,printb[0],printb[1],printb[2],printb[3])
;
int32_t
temp
;
__m128i
in
;
__m128
mm0
;
//init
mm0
=
_mm_setzero_ps
();
//Acc
for
(
i
=
0
;
i
<
(
length
>>
2
);
i
++
)
{
in
=
_mm_loadu_si128
((
__m128i
*
)
input
);
mm0
=
_mm_add_ps
(
mm0
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
in
,
in
)));
input
+=
4
;
}
}
//Ave
temp
=
(
int
)((((
float
*
)
&
mm0
)[
0
]
+
((
float
*
)
&
mm0
)[
1
]
+
((
float
*
)
&
mm0
)[
2
]
+
((
float
*
)
&
mm0
)[
3
])
/
(
float
)
length
);
/*
return
temp
;
#ifdef MAIN
printb = (int16_t *)&mm3;
printf("%d %d %d %d\n",printb[0],printb[1],printb[2],printb[3]);
#endif
*/
mm1
=
mm0
;
mm0
=
_m_psrlqi
(
mm0
,
32
);
mm0
=
_m_paddd
(
mm0
,
mm1
);
temp
=
_m_to_int
(
mm0
);
temp
/=
length
;
temp
<<=
shift
;
// this is the average of x^2
#ifdef MAIN
printf
(
"E x^2 = %d
\n
"
,
temp
);
#endif
_mm_empty
();
_m_empty
();
return
((
temp
>
0
)
?
temp
:
1
);
}
}
#elif defined(__arm__)
#elif defined(__arm__)
...
...
openair1/SCHED/fapi_l1.c
View file @
72c11e64
...
@@ -1101,11 +1101,25 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
...
@@ -1101,11 +1101,25 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
if
(
NFAPI_MODE
!=
NFAPI_MONOLITHIC
)
{
if
(
NFAPI_MODE
!=
NFAPI_MONOLITHIC
)
{
if
(
number_ul_pdu
>
0
)
{
if
(
number_ul_pdu
>
0
)
{
uint8_t
ulsch_pdu_num
=
0
;
for
(
i
=
0
;
i
<
number_ul_pdu
;
i
++
)
{
if
((
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_PDU_TYPE
)
||
(
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE
)
||
(
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE
)
||
(
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE
)){
ulsch_pdu_num
++
;
}
}
if
(
ulsch_pdu_num
<=
RC
.
rrc
[
Mod_id
]
->
configuration
.
radioresourceconfig
[
CC_id
].
ue_multiple_max
){
//LOG_D(PHY, "UL_CONFIG to send to PNF\n");
//LOG_D(PHY, "UL_CONFIG to send to PNF\n");
UL_req
->
sfn_sf
=
frame
<<
4
|
subframe
;
UL_req
->
sfn_sf
=
frame
<<
4
|
subframe
;
oai_nfapi_ul_config_req
(
UL_req
);
oai_nfapi_ul_config_req
(
UL_req
);
UL_req
->
ul_config_request_body
.
number_of_pdus
=
0
;
UL_req
->
ul_config_request_body
.
number_of_pdus
=
0
;
number_ul_pdu
=
0
;
number_ul_pdu
=
0
;
}
else
{
LOG_E
(
MAC
,
"NFAPI: frame %d subframe %d ul_req num %d ul pdu %d
\n
"
,
frame
,
subframe
,
number_ul_pdu
,
ulsch_pdu_num
);
}
}
}
}
else
{
}
else
{
for
(
i
=
0
;
i
<
number_ul_pdu
;
i
++
)
{
for
(
i
=
0
;
i
<
number_ul_pdu
;
i
++
)
{
...
...
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
72c11e64
...
@@ -310,6 +310,7 @@ bool dlsch_procedures(PHY_VARS_eNB *eNB,
...
@@ -310,6 +310,7 @@ bool dlsch_procedures(PHY_VARS_eNB *eNB,
if
(
dlsch_harq
->
pdu
==
NULL
)
{
if
(
dlsch_harq
->
pdu
==
NULL
)
{
LOG_E
(
PHY
,
"dlsch_harq->pdu == NULL SFN/SF:%04d%d dlsch[rnti:%x] dlsch_harq[pdu:%p pdsch_start:%d Qm:%d Nl:%d round:%d nb_rb:%d rb_alloc[0]:%d]
\n
"
,
frame
,
subframe
,
dlsch
->
rnti
,
dlsch_harq
->
pdu
,
LOG_E
(
PHY
,
"dlsch_harq->pdu == NULL SFN/SF:%04d%d dlsch[rnti:%x] dlsch_harq[pdu:%p pdsch_start:%d Qm:%d Nl:%d round:%d nb_rb:%d rb_alloc[0]:%d]
\n
"
,
frame
,
subframe
,
dlsch
->
rnti
,
dlsch_harq
->
pdu
,
dlsch_harq
->
pdsch_start
,
dlsch_harq
->
Qm
,
dlsch_harq
->
Nl
,
dlsch_harq
->
round
,
dlsch_harq
->
nb_rb
,
dlsch_harq
->
rb_alloc
[
0
]);
dlsch_harq
->
pdsch_start
,
dlsch_harq
->
Qm
,
dlsch_harq
->
Nl
,
dlsch_harq
->
round
,
dlsch_harq
->
nb_rb
,
dlsch_harq
->
rb_alloc
[
0
]);
dlsch
->
active
[
subframe
]
=
0
;
return
false
;
return
false
;
}
}
...
@@ -883,6 +884,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
...
@@ -883,6 +884,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
#endif
#endif
if
(
SR_payload
==
1
)
{
// this implements Table 7.3.1 from 36.213
if
(
SR_payload
==
1
)
{
// this implements Table 7.3.1 from 36.213
if
(
uci
->
pucch_fmt
==
pucch_format1b
){
if
(
pucch_b0b1
[
0
][
0
]
==
4
)
{
// there isn't a likely transmission
if
(
pucch_b0b1
[
0
][
0
]
==
4
)
{
// there isn't a likely transmission
harq_ack
[
0
]
=
4
;
// DTX
harq_ack
[
0
]
=
4
;
// DTX
}
else
if
(
pucch_b0b1
[
0
][
0
]
==
1
&&
pucch_b0b1
[
0
][
1
]
==
1
)
{
// 1/4/7 ACKs
}
else
if
(
pucch_b0b1
[
0
][
0
]
==
1
&&
pucch_b0b1
[
0
][
1
]
==
1
)
{
// 1/4/7 ACKs
...
@@ -897,6 +899,13 @@ uci_procedures(PHY_VARS_eNB *eNB,
...
@@ -897,6 +899,13 @@ uci_procedures(PHY_VARS_eNB *eNB,
uci
->
stat
=
metric
[
0
];
uci
->
stat
=
metric
[
0
];
fill_uci_harq_indication
(
i
,
eNB
,
uci
,
frame
,
subframe
,
harq_ack
,
2
,
0xffff
);
// special_bundling mode
fill_uci_harq_indication
(
i
,
eNB
,
uci
,
frame
,
subframe
,
harq_ack
,
2
,
0xffff
);
// special_bundling mode
}
else
{
harq_ack
[
0
]
=
pucch_b0b1
[
0
][
0
];
harq_ack
[
1
]
=
pucch_b0b1
[
0
][
1
];
uci
->
stat
=
metric
[
0
];
LOG_D
(
PHY
,
"bundling with sr: (%d,%d), metric %d
\n
"
,
harq_ack
[
0
],
harq_ack
[
1
],
uci
->
stat
);
fill_uci_harq_indication
(
i
,
eNB
,
uci
,
frame
,
subframe
,
harq_ack
,
0
,
0xffff
);
// special_bundling mode
}
}
else
if
((
uci
->
tdd_bundling
==
0
)
&&
(
uci
->
num_pucch_resources
==
2
))
{
// multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2
}
else
if
((
uci
->
tdd_bundling
==
0
)
&&
(
uci
->
num_pucch_resources
==
2
))
{
// multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2
if
(
pucch_b0b1
[
0
][
0
]
==
4
||
if
(
pucch_b0b1
[
0
][
0
]
==
4
||
pucch_b0b1
[
1
][
0
]
==
4
)
{
// there isn't a likely transmission
pucch_b0b1
[
1
][
0
]
==
4
)
{
// there isn't a likely transmission
...
...
openair1/SCHED/ru_procedures.c
View file @
72c11e64
...
@@ -595,6 +595,7 @@ void init_fep_thread(RU_t *ru,
...
@@ -595,6 +595,7 @@ void init_fep_thread(RU_t *ru,
pthread_cond_init
(
&
proc
->
cond_fep
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_fep
,
NULL
);
threadCreate
(
&
proc
->
pthread_fep
,
fep_thread
,
(
void
*
)
ru
,
"fep"
,
-
1
,
OAI_PRIORITY_RT
);
threadCreate
(
&
proc
->
pthread_fep
,
fep_thread
,
(
void
*
)
ru
,
"fep"
,
-
1
,
OAI_PRIORITY_RT
);
}
}
...
@@ -765,9 +766,34 @@ void fep_full(RU_t *ru,
...
@@ -765,9 +766,34 @@ void fep_full(RU_t *ru,
int
l
;
int
l
;
LTE_DL_FRAME_PARMS
*
fp
=
ru
->
frame_parms
;
LTE_DL_FRAME_PARMS
*
fp
=
ru
->
frame_parms
;
double
recv_pow
=
0
;
int
i
,
idx
;
int
shift
=
0
;
short
*
temp_iq
;
if
((
fp
->
frame_type
==
TDD
)
&&
if
((
fp
->
frame_type
==
TDD
)
&&
(
subframe_select
(
fp
,
subframe
)
!=
SF_UL
))
return
;
(
subframe_select
(
fp
,
subframe
)
!=
SF_UL
))
return
;
for
(
i
=
0
;
i
<
fp
->
samples_per_tti
;
i
++
){
idx
=
i
+
fp
->
samples_per_tti
*
subframe
-
ru
->
N_TA_offset
;
if
(
idx
<
0
)
idx
+=
fp
->
samples_per_tti
*
10
;
temp_iq
=
(
short
*
)
&
ru
->
common
.
rxdata
[
0
][
idx
];
recv_pow
+=
(
double
)
temp_iq
[
0
]
*
(
double
)
temp_iq
[
0
]
+
(
double
)
temp_iq
[
1
]
*
(
double
)
temp_iq
[
1
];
}
recv_pow
/=
(
double
)
fp
->
samples_per_tti
;
if
(
recv_pow
>
1
.
0
){
shift
=
3
-
(
int
)
log2
(
sqrt
((
double
)
recv_pow
));
}
if
(
shift
>
0
){
LOG_D
(
PHY
,
"ave pow %lf shift %d
\n
"
,
sqrt
((
double
)
recv_pow
),
shift
);
for
(
i
=
0
;
i
<
fp
->
samples_per_tti
;
i
++
){
idx
=
i
+
fp
->
samples_per_tti
*
subframe
-
ru
->
N_TA_offset
;
if
(
idx
<
0
)
idx
+=
fp
->
samples_per_tti
*
10
;
temp_iq
=
(
short
*
)
&
ru
->
common
.
rxdata
[
0
][
idx
];
temp_iq
[
0
]
<<=
shift
;
temp_iq
[
1
]
<<=
shift
;
}
}
start_meas
(
&
ru
->
ofdm_demod_stats
);
start_meas
(
&
ru
->
ofdm_demod_stats
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
ru
->
idx
,
1
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
ru
->
idx
,
1
);
...
@@ -786,6 +812,16 @@ void fep_full(RU_t *ru,
...
@@ -786,6 +812,16 @@ void fep_full(RU_t *ru,
}
}
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
ru
->
idx
,
0
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
ru
->
idx
,
0
);
stop_meas
(
&
ru
->
ofdm_demod_stats
);
stop_meas
(
&
ru
->
ofdm_demod_stats
);
if
(
shift
>
0
){
short
*
temp_iq
;
for
(
i
=
0
;
i
<
fp
->
ofdm_symbol_size
*
14
;
i
++
){
temp_iq
=
(
short
*
)
&
ru
->
common
.
rxdataF
[
0
][
i
];
temp_iq
[
0
]
>>=
shift
;
temp_iq
[
1
]
>>=
shift
;
}
}
}
}
...
...
openair2/ENB_APP/flexran_agent_common.c
View file @
72c11e64
...
@@ -450,6 +450,11 @@ int flexran_agent_control_delegation(mid_t mod_id, const void *params, Protocol_
...
@@ -450,6 +450,11 @@ int flexran_agent_control_delegation(mid_t mod_id, const void *params, Protocol_
strcpy
(
target
,
RC
.
flexran
[
mod_id
]
->
cache_name
);
strcpy
(
target
,
RC
.
flexran
[
mod_id
]
->
cache_name
);
strcat
(
target
,
lib_name
);
strcat
(
target
,
lib_name
);
FILE
*
f
;
FILE
*
f
;
if
(
-
1
==
(
access
(
target
,
F_OK
))){
creat
(
target
,
0644
);
}
else
{
chmod
(
target
,
0644
);
}
f
=
fopen
(
target
,
"wb"
);
f
=
fopen
(
target
,
"wb"
);
if
(
f
)
{
if
(
f
)
{
...
...
openair2/LAYER2/MAC/eNB_scheduler.c
View file @
72c11e64
This diff is collapsed.
Click to expand it.
openair2/LAYER2/MAC/eNB_scheduler_RA.c
View file @
72c11e64
...
@@ -194,7 +194,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
...
@@ -194,7 +194,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
ul_tx_mode
=
0
;
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
ul_tx_mode
=
0
;
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
current_tx_nb
=
0
;
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
current_tx_nb
=
0
;
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
n_srs
=
1
;
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
n_srs
=
1
;
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
size
=
get_TBS_UL
(
10
,
ra
->
msg3_nb_rb
);
ul_config_pdu
->
ulsch_pdu
.
ulsch_pdu_rel8
.
size
=
get_TBS_UL
(
ra
->
msg3_mcs
,
ra
->
msg3_nb_rb
);
ul_req_body
->
number_of_pdus
++
;
ul_req_body
->
number_of_pdus
++
;
ul_req_body
->
tl
.
tag
=
NFAPI_UL_CONFIG_REQUEST_BODY_TAG
;
ul_req_body
->
tl
.
tag
=
NFAPI_UL_CONFIG_REQUEST_BODY_TAG
;
ul_req
->
sfn_sf
=
ra
->
Msg3_frame
<<
4
|
ra
->
Msg3_subframe
;
ul_req
->
sfn_sf
=
ra
->
Msg3_frame
<<
4
|
ra
->
Msg3_subframe
;
...
@@ -581,6 +581,11 @@ void generate_Msg2(module_id_t module_idP,
...
@@ -581,6 +581,11 @@ void generate_Msg2(module_id_t module_idP,
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_prb_per_subband
=
1
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_prb_per_subband
=
1
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_vector
=
1
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_vector
=
1
;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
// Rel13 fields
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
ue_type
=
0
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
pdsch_payload_type
=
2
;
// not BR
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
initial_transmission_sf_io
=
0xFFFF
;
// absolute SF = 0;
dl_req_body
->
number_pdu
++
;
dl_req_body
->
number_pdu
++
;
mac
->
DL_req
[
CC_idP
].
sfn_sf
=
frameP
<<
4
|
subframeP
;
mac
->
DL_req
[
CC_idP
].
sfn_sf
=
frameP
<<
4
|
subframeP
;
// Program UL processing for Msg3
// Program UL processing for Msg3
...
@@ -638,6 +643,7 @@ generate_Msg4(module_id_t module_idP,
...
@@ -638,6 +643,7 @@ generate_Msg4(module_id_t module_idP,
uint16_t
msg4_header
=
0
;
uint16_t
msg4_header
=
0
;
int
UE_id
=
-
1
;
int
UE_id
=
-
1
;
int
first_rb
=
0
;
int
first_rb
=
0
;
int
nb_rb
=
0
;
int
N_RB_DL
=
0
;
int
N_RB_DL
=
0
;
int
N_RBG
;
int
N_RBG
;
uint8_t
lcid
=
0
;
uint8_t
lcid
=
0
;
...
@@ -1036,10 +1042,11 @@ generate_Msg4(module_id_t module_idP,
...
@@ -1036,10 +1042,11 @@ generate_Msg4(module_id_t module_idP,
module_idP
,
CC_idP
,
frameP
,
subframeP
,
ra
->
rnti
);
module_idP
,
CC_idP
,
frameP
,
subframeP
,
ra
->
rnti
);
/// Choose first 4 RBs for Msg4, should really check that these are free!
/// Choose first 4 RBs for Msg4, should really check that these are free!
first_rb
=
0
;
first_rb
=
0
;
vrb_map
[
first_rb
]
=
1
;
nb_rb
=
4
;
vrb_map
[
first_rb
+
1
]
=
1
;
if
(
cc
[
CC_idP
].
mib
->
message
.
dl_Bandwidth
==
3
)
nb_rb
=
6
;
vrb_map
[
first_rb
+
2
]
=
1
;
for
(
int
i
=
0
;
i
<
nb_rb
;
i
++
){
vrb_map
[
first_rb
+
3
]
=
1
;
vrb_map
[
first_rb
+
i
]
=
1
;
}
if
((
cc
[
CC_idP
].
mib
->
message
.
dl_Bandwidth
==
2
)
||
(
cc
[
CC_idP
].
mib
->
message
.
dl_Bandwidth
==
3
))
if
((
cc
[
CC_idP
].
mib
->
message
.
dl_Bandwidth
==
2
)
||
(
cc
[
CC_idP
].
mib
->
message
.
dl_Bandwidth
==
3
))
{
{
rbg_map
[
0
]
=
1
;
rbg_map
[
0
]
=
1
;
...
@@ -1062,32 +1069,24 @@ generate_Msg4(module_id_t module_idP,
...
@@ -1062,32 +1069,24 @@ generate_Msg4(module_id_t module_idP,
// Compute MCS/TBS for 4 PRB (coded on 4 vrb)
// Compute MCS/TBS for 4 PRB (coded on 4 vrb)
msg4_header
=
1
+
6
+
1
;
// CR header, CR CE, SDU header
msg4_header
=
1
+
6
+
1
;
// CR header, CR CE, SDU header
if
((
rrc_sdu_length
+
msg4_header
)
<=
28
)
{
ra
->
msg4_mcs
=
3
;
ra
->
msg4_mcs
=
3
;
while
(
1
){
ra
->
msg4_TBsize
=
28
;
if
(
get_TBS_DL
(
ra
->
msg4_mcs
,
nb_rb
)
>
(
rrc_sdu_length
+
msg4_header
)){
}
else
if
((
rrc_sdu_length
+
msg4_header
)
<=
32
)
{
ra
->
msg4_TBsize
=
get_TBS_DL
(
ra
->
msg4_mcs
,
nb_rb
);
ra
->
msg4_mcs
=
4
;
break
;
ra
->
msg4_TBsize
=
32
;
}
}
else
if
((
rrc_sdu_length
+
msg4_header
)
<=
41
)
{
ra
->
msg4_mcs
++
;
ra
->
msg4_mcs
=
5
;
ra
->
msg4_TBsize
=
41
;
}
else
if
((
rrc_sdu_length
+
msg4_header
)
<=
49
)
{
ra
->
msg4_mcs
=
6
;
ra
->
msg4_TBsize
=
49
;
}
else
if
((
rrc_sdu_length
+
msg4_header
)
<=
59
)
{
ra
->
msg4_mcs
=
7
;
ra
->
msg4_TBsize
=
59
;
}
else
if
((
rrc_sdu_length
+
msg4_header
)
<=
67
)
{
ra
->
msg4_mcs
=
8
;
ra
->
msg4_TBsize
=
67
;
}
}
LOG_I
(
MAC
,
"Frame %d, subframe %d: MSG4 rnti %d, rrc_sdu_length %d, mcs %d, TBsize %d
\n
"
,
frameP
,
subframeP
,
ra
->
rnti
,
rrc_sdu_length
,
ra
->
msg4_mcs
,
ra
->
msg4_TBsize
);
fill_nfapi_dl_dci_1
(
dl_config_pdu
,
4
,
// aggregation_level
fill_nfapi_dl_dci_1
(
dl_config_pdu
,
4
,
// aggregation_level
ra
->
rnti
,
// rnti
ra
->
rnti
,
// rnti
1
,
// rnti_type, CRNTI
1
,
// rnti_type, CRNTI
ra
->
harq_pid
,
// harq_process
ra
->
harq_pid
,
// harq_process
1
,
// tpc, none
1
,
// tpc, none
allocate_prbs_sub
(
4
,
N_RB_DL
,
N_RBG
,
rbg_map
),
// resource_block_coding
allocate_prbs_sub
(
nb_rb
,
N_RB_DL
,
N_RBG
,
rbg_map
),
// resource_block_coding
ra
->
msg4_mcs
,
// mcs
ra
->
msg4_mcs
,
// mcs
1
-
UE_info
->
UE_template
[
CC_idP
][
UE_id
].
oldNDI
[
ra
->
harq_pid
][
TB1
],
1
-
UE_info
->
UE_template
[
CC_idP
][
UE_id
].
oldNDI
[
ra
->
harq_pid
][
TB1
],
0
,
// rv
0
,
// rv
...
@@ -1165,8 +1164,7 @@ generate_Msg4(module_id_t module_idP,
...
@@ -1165,8 +1164,7 @@ generate_Msg4(module_id_t module_idP,
ra
->
rnti
,
ra
->
rnti
,
0
,
// resource_allocation_type : format 1A/1B/1D
0
,
// resource_allocation_type : format 1A/1B/1D
0
,
// virtual_resource_block_assignment_flag : localized
0
,
// virtual_resource_block_assignment_flag : localized
//allocate_prbs_sub(4, N_RB_DL, N_RBG, rbg_map), // resource_block_coding
allocate_prbs_sub
(
nb_rb
,
N_RB_DL
,
N_RBG
,
rbg_map
),
// resource_block_coding
getRIV
(
N_RB_DL
,
first_rb
,
4
),
// resource_block_coding
2
,
// modulation: QPSK
2
,
// modulation: QPSK
0
,
// redundancy version
0
,
// redundancy version
1
,
// transport_blocks
1
,
// transport_blocks
...
@@ -1252,6 +1250,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
...
@@ -1252,6 +1250,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
uint8_t
rbg_map
[
25
];
uint8_t
rbg_map
[
25
];
uint8_t
rbg
;
uint8_t
rbg
;
int
first_rb
;
int
first_rb
;
int
nb_rb
;
int
N_RB_DL
;
int
N_RB_DL
;
int
N_RBG
;
int
N_RBG
;
nfapi_dl_config_request_pdu_t
*
dl_config_pdu
;
nfapi_dl_config_request_pdu_t
*
dl_config_pdu
;
...
@@ -1296,10 +1295,11 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
...
@@ -1296,10 +1295,11 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
// we have to schedule a retransmission
// we have to schedule a retransmission
dl_req
->
sfn_sf
=
frameP
<<
4
|
subframeP
;
dl_req
->
sfn_sf
=
frameP
<<
4
|
subframeP
;
first_rb
=
0
;
first_rb
=
0
;
vrb_map
[
first_rb
]
=
1
;
nb_rb
=
4
;
vrb_map
[
first_rb
+
1
]
=
1
;
if
(
cc
[
CC_idP
].
mib
->
message
.
dl_Bandwidth
==
3
)
nb_rb
=
6
;
vrb_map
[
first_rb
+
2
]
=
1
;
for
(
int
i
=
0
;
i
<
nb_rb
;
i
++
){
vrb_map
[
first_rb
+
3
]
=
1
;
vrb_map
[
first_rb
+
i
]
=
1
;
}
rbg_map
[
0
]
=
1
;
rbg_map
[
0
]
=
1
;
rbg_map
[
1
]
=
1
;
rbg_map
[
1
]
=
1
;
for
(
rbg
=
2
;
rbg
<
N_RBG
;
rbg
++
)
for
(
rbg
=
2
;
rbg
<
N_RBG
;
rbg
++
)
...
@@ -1311,7 +1311,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
...
@@ -1311,7 +1311,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
1
,
// rnti_type, CRNTI
1
,
// rnti_type, CRNTI
ra
->
harq_pid
,
// harq_process
ra
->
harq_pid
,
// harq_process
1
,
// tpc, none
1
,
// tpc, none
allocate_prbs_sub
(
4
,
N_RB_DL
,
N_RBG
,
rbg_map
),
// resource_block_coding
allocate_prbs_sub
(
nb_rb
,
N_RB_DL
,
N_RBG
,
rbg_map
),
// resource_block_coding
ra
->
msg4_mcs
,
// mcs
ra
->
msg4_mcs
,
// mcs
UE_info
->
UE_template
[
CC_idP
][
UE_id
].
oldNDI
[
ra
->
harq_pid
][
TB1
],
UE_info
->
UE_template
[
CC_idP
][
UE_id
].
oldNDI
[
ra
->
harq_pid
][
TB1
],
round
&
3
,
// rv
round
&
3
,
// rv
...
@@ -1336,7 +1336,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
...
@@ -1336,7 +1336,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
/* retransmission, no pdu_index */
/* retransmission, no pdu_index */
,
ra
->
rnti
,
0
,
// resource_allocation_type : format 1A/1B/1D
,
ra
->
rnti
,
0
,
// resource_allocation_type : format 1A/1B/1D
0
,
// virtual_resource_block_assignment_flag : localized
0
,
// virtual_resource_block_assignment_flag : localized
allocate_prbs_sub
(
4
,
N_RB_DL
,
N_RBG
,
rbg_map
),
// resource_block_coding : RIV, 4 PRB
allocate_prbs_sub
(
nb_rb
,
N_RB_DL
,
N_RBG
,
rbg_map
),
// resource_block_coding : RIV, 4 PRB
2
,
// modulation: QPSK
2
,
// modulation: QPSK
round
&
3
,
// redundancy version
round
&
3
,
// redundancy version
1
,
// transport_blocks
1
,
// transport_blocks
...
...
openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
View file @
72c11e64
This diff is collapsed.
Click to expand it.
openair2/LAYER2/MAC/eNB_scheduler_fairRR.h
View file @
72c11e64
...
@@ -146,6 +146,15 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
...
@@ -146,6 +146,15 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
unsigned
char
sched_subframeP
,
unsigned
char
sched_subframeP
,
ULSCH_UE_SELECT
ulsch_ue_select
[
MAX_NUM_CCs
]);
ULSCH_UE_SELECT
ulsch_ue_select
[
MAX_NUM_CCs
]);
void
select_dl_ue_candidate
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
subframeP
);
void
select_ul_ue_candidate
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
subframeP
);
/* extern */
/* extern */
extern
DLSCH_UE_SELECT
dlsch_ue_select
[
MAX_NUM_CCs
];
extern
DLSCH_UE_SELECT
dlsch_ue_select
[
MAX_NUM_CCs
];
...
...
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
View file @
72c11e64
...
@@ -1284,7 +1284,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
...
@@ -1284,7 +1284,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
return
1
;
return
1
;
}
}
break
;
break
;
case
1
:
case
1
:
switch
(
subframeP
)
{
switch
(
subframeP
)
{
case
2
:
case
2
:
...
@@ -1295,7 +1294,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
...
@@ -1295,7 +1294,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
return
1
;
return
1
;
}
}
break
;
break
;
case
2
:
case
2
:
switch
(
subframeP
)
{
switch
(
subframeP
)
{
case
2
:
case
2
:
...
@@ -1303,7 +1301,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
...
@@ -1303,7 +1301,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
return
4
;
return
4
;
}
}
break
;
break
;
case
3
:
case
3
:
switch
(
subframeP
)
{
switch
(
subframeP
)
{
case
2
:
case
2
:
...
@@ -1313,7 +1310,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
...
@@ -1313,7 +1310,6 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
return
2
;
return
2
;
}
}
break
;
break
;
case
4
:
case
4
:
switch
(
subframeP
)
{
switch
(
subframeP
)
{
case
2
:
case
2
:
...
@@ -1321,14 +1317,12 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
...
@@ -1321,14 +1317,12 @@ int getM_mac(COMMON_channels_t *cc,sub_frame_t subframeP){
return
4
;
return
4
;
}
}
break
;
break
;
case
5
:
case
5
:
switch
(
subframeP
)
{
switch
(
subframeP
)
{
case
2
:
case
2
:
return
9
;
return
9
;
}
}
break
;
break
;
case
6
:
case
6
:
switch
(
subframeP
)
{
switch
(
subframeP
)
{
case
2
:
case
2
:
...
@@ -2082,6 +2076,19 @@ fill_nfapi_dlsch_config(nfapi_dl_config_request_pdu_t *dl_config_pdu,
...
@@ -2082,6 +2076,19 @@ fill_nfapi_dlsch_config(nfapi_dl_config_request_pdu_t *dl_config_pdu,
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
transmission_mode
=
transmission_mode
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
transmission_mode
=
transmission_mode
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_prb_per_subband
=
num_bf_prb_per_subband
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_prb_per_subband
=
num_bf_prb_per_subband
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_vector
=
num_bf_vector
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
num_bf_vector
=
num_bf_vector
;
// Rel10 fields
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel10
.
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel10
.
pdsch_start
=
3
;
#endif
// Rel13 fields
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG
;
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
ue_type
=
0
;
// regular UE
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
pdsch_payload_type
=
2
;
// not BR
dl_config_pdu
->
dlsch_pdu
.
dlsch_pdu_rel13
.
initial_transmission_sf_io
=
0xFFFF
;
// absolute SF
#endif
return
;
return
;
}
}
...
@@ -2679,6 +2686,8 @@ add_new_ue(module_id_t mod_idP,
...
@@ -2679,6 +2686,8 @@ add_new_ue(module_id_t mod_idP,
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_rx_error_num_old
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_rx_error_num_old
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_bler
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_bler
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
mcs_offset
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
mcs_offset
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
ret_cnt
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
first_cnt
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
volte_configured
=
FALSE
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
volte_configured
=
FALSE
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
ul_periodic_timer_exp_flag
=
FALSE
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
ul_periodic_timer_exp_flag
=
FALSE
;
...
@@ -4597,10 +4606,10 @@ extract_harq(module_id_t mod_idP,
...
@@ -4597,10 +4606,10 @@ extract_harq(module_id_t mod_idP,
int
spatial_bundling
=
0
;
int
spatial_bundling
=
0
;
int
tmode
[
5
];
int
tmode
[
5
];
int
i
,
j
,
m
;
int
i
,
j
,
m
;
uint8_t
*
pdu
;
uint8_t
*
pdu
=
NULL
;
sub_frame_t
subframe_tx
;
sub_frame_t
subframe_tx
;
int
frame_tx
;
int
frame_tx
;
uint8_t
harq_pid
;
uint8_t
harq_pid
=
0
;
uint8_t
select_tb
;
uint8_t
select_tb
;
uint8_t
oppose_tb
;
uint8_t
oppose_tb
;
uint8_t
swap_flg
;
uint8_t
swap_flg
;
...
...
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
View file @
72c11e64
...
@@ -179,7 +179,7 @@ rx_sdu(const module_id_t enb_mod_idP,
...
@@ -179,7 +179,7 @@ rx_sdu(const module_id_t enb_mod_idP,
UE_scheduling_control
->
pusch_snr
[
CC_idP
]
=
tmp_snr
;
UE_scheduling_control
->
pusch_snr
[
CC_idP
]
=
tmp_snr
;
if
(
tmp_snr
>
0
&&
tmp_snr
<
63
)
{
if
(
tmp_snr
>
0
&&
tmp_snr
<
63
)
{
double
snr_filter_tpc
=
0
.
7
;
double
snr_filter_tpc
=
0
.
9
;
int
snr_thres_tpc
=
30
;
int
snr_thres_tpc
=
30
;
int
diff
=
UE_scheduling_control
->
pusch_snr_avg
[
CC_idP
]
-
UE_scheduling_control
->
pusch_snr
[
CC_idP
];
int
diff
=
UE_scheduling_control
->
pusch_snr_avg
[
CC_idP
]
-
UE_scheduling_control
->
pusch_snr
[
CC_idP
];
if
(
abs
(
diff
)
<
snr_thres_tpc
)
{
if
(
abs
(
diff
)
<
snr_thres_tpc
)
{
...
...
openair2/LAYER2/MAC/mac.h
View file @
72c11e64
...
@@ -972,6 +972,8 @@ typedef struct {
...
@@ -972,6 +972,8 @@ typedef struct {
/// Current DL harq round per harq_pid on each CC
/// Current DL harq round per harq_pid on each CC
uint8_t
round
[
NFAPI_CC_MAX
][
MAX_HARQ_PID
][
MAX_NUM_TB
];
uint8_t
round
[
NFAPI_CC_MAX
][
MAX_HARQ_PID
][
MAX_NUM_TB
];
uint32_t
ret_cnt
[
NFAPI_CC_MAX
];
uint32_t
first_cnt
[
NFAPI_CC_MAX
];
/// Current Active TBs per harq_pid on each CC
/// Current Active TBs per harq_pid on each CC
uint8_t
tbcnt
[
NFAPI_CC_MAX
][
MAX_HARQ_PID
];
uint8_t
tbcnt
[
NFAPI_CC_MAX
][
MAX_HARQ_PID
];
/// Current UL harq round per harq_pid on each CC
/// Current UL harq round per harq_pid on each CC
...
@@ -999,16 +1001,16 @@ typedef struct {
...
@@ -999,16 +1001,16 @@ typedef struct {
int32_t
phr_received
;
int32_t
phr_received
;
uint8_t
periodic_ri_received
[
NFAPI_CC_MAX
];
uint8_t
periodic_ri_received
[
NFAPI_CC_MAX
];
uint8_t
aperiodic_ri_received
[
NFAPI_CC_MAX
];
uint8_t
aperiodic_ri_received
[
NFAPI_CC_MAX
];
uint
8
_t
pucch1_cqi_update
[
NFAPI_CC_MAX
];
uint
16
_t
pucch1_cqi_update
[
NFAPI_CC_MAX
];
uint
8
_t
pucch1_snr
[
NFAPI_CC_MAX
];
uint
16
_t
pucch1_snr
[
NFAPI_CC_MAX
];
uint
8
_t
pucch2_cqi_update
[
NFAPI_CC_MAX
];
uint
16
_t
pucch2_cqi_update
[
NFAPI_CC_MAX
];
uint
8
_t
pucch2_snr
[
NFAPI_CC_MAX
];
uint
16
_t
pucch2_snr
[
NFAPI_CC_MAX
];
uint
8
_t
pucch3_cqi_update
[
NFAPI_CC_MAX
];
uint
16
_t
pucch3_cqi_update
[
NFAPI_CC_MAX
];
uint
8
_t
pucch3_snr
[
NFAPI_CC_MAX
];
uint
16
_t
pucch3_snr
[
NFAPI_CC_MAX
];
double
pusch_cqi_f
[
NFAPI_CC_MAX
];
double
pusch_cqi_f
[
NFAPI_CC_MAX
];
uint
8
_t
pusch_cqi
[
NFAPI_CC_MAX
];
uint
16
_t
pusch_cqi
[
NFAPI_CC_MAX
];
uint
8
_t
pusch_snr
[
NFAPI_CC_MAX
];
uint
16
_t
pusch_snr
[
NFAPI_CC_MAX
];
uint
8
_t
pusch_snr_avg
[
NFAPI_CC_MAX
];
uint
16
_t
pusch_snr_avg
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_num
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_num
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_num_old
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_num_old
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_error_num
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_error_num
[
NFAPI_CC_MAX
];
...
...
openair2/LAYER2/MAC/mac_extern.h
View file @
72c11e64
...
@@ -68,7 +68,7 @@ extern uint8_t rb_table[34];
...
@@ -68,7 +68,7 @@ extern uint8_t rb_table[34];
#if defined(PRE_SCD_THREAD)
#if defined(PRE_SCD_THREAD)
extern
uint
32
_t
dl_buffer_total
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
];
extern
uint
64
_t
dl_buffer_total
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
];
extern
boolean_t
pre_scd_activeUE
[
NUMBER_OF_UE_MAX
];
extern
boolean_t
pre_scd_activeUE
[
NUMBER_OF_UE_MAX
];
extern
eNB_UE_STATS
pre_scd_eNB_UE_stats
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
];
extern
eNB_UE_STATS
pre_scd_eNB_UE_stats
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
];
#endif
#endif
...
...
openair2/LAYER2/MAC/mac_proto.h
View file @
72c11e64
...
@@ -236,6 +236,8 @@ void dlsch_scheduler_pre_processor(module_id_t module_idP,
...
@@ -236,6 +236,8 @@ void dlsch_scheduler_pre_processor(module_id_t module_idP,
*/
*/
void
eNB_dlsch_ulsch_scheduler
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
subframeP
);
//, int calibration_flag);
void
eNB_dlsch_ulsch_scheduler
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
subframeP
);
//, int calibration_flag);
void
update_ue_timers
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
subframeP
);
/* \brief Function to indicate a received preamble on PRACH. It initiates the RA procedure.
/* \brief Function to indicate a received preamble on PRACH. It initiates the RA procedure.
@param Mod_id Instance ID of eNB
@param Mod_id Instance ID of eNB
@param preamble_index index of the received RA request
@param preamble_index index of the received RA request
...
...
openair2/LAYER2/MAC/rar_tools.c
View file @
72c11e64
...
@@ -66,9 +66,13 @@ fill_rar(const module_id_t module_idP,
...
@@ -66,9 +66,13 @@ fill_rar(const module_id_t module_idP,
rar
[
4
]
=
(
uint8_t
)
(
ra
->
rnti
>>
8
);
rar
[
4
]
=
(
uint8_t
)
(
ra
->
rnti
>>
8
);
rar
[
5
]
=
(
uint8_t
)
(
ra
->
rnti
&
0xff
);
rar
[
5
]
=
(
uint8_t
)
(
ra
->
rnti
&
0xff
);
//ra->timing_offset = 0;
//ra->timing_offset = 0;
#ifndef PHY_RM
ra
->
timing_offset
/=
16
;
//T_A = N_TA/16, where N_TA should be on a 30.72Msps
ra
->
timing_offset
/=
16
;
//T_A = N_TA/16, where N_TA should be on a 30.72Msps
rar
[
0
]
=
(
uint8_t
)
(
ra
->
timing_offset
>>
(
2
+
4
));
// 7 MSBs of timing advance + divide by 4
#endif
rar
[
1
]
=
(
uint8_t
)
(
ra
->
timing_offset
<<
(
4
-
2
))
&
0xf0
;
// 4 LSBs of timing advance + divide by 4
//rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4
//rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4
rar
[
0
]
=
(
uint8_t
)
(
ra
->
timing_offset
>>
4
);
// 7 MSBs of timing advance
rar
[
1
]
=
(
uint8_t
)
(
ra
->
timing_offset
<<
4
)
&
0xf0
;
// 4 LSBs of timing advance
COMMON_channels_t
*
cc
=
&
RC
.
mac
[
module_idP
]
->
common_channels
[
CC_id
];
COMMON_channels_t
*
cc
=
&
RC
.
mac
[
module_idP
]
->
common_channels
[
CC_id
];
if
(
N_RB_UL
==
25
)
{
if
(
N_RB_UL
==
25
)
{
...
@@ -81,7 +85,12 @@ fill_rar(const module_id_t module_idP,
...
@@ -81,7 +85,12 @@ fill_rar(const module_id_t module_idP,
}
}
}
}
ra
->
msg3_nb_rb
=
1
;
if
(
cc
->
tdd_Config
){
if
(
cc
->
tdd_Config
->
subframeAssignment
==
2
){
ra
->
msg3_first_rb
+=
1
;
}
}
ra
->
msg3_nb_rb
=
3
;
uint16_t
rballoc
=
mac_computeRIV
(
N_RB_UL
,
ra
->
msg3_first_rb
,
ra
->
msg3_nb_rb
);
// first PRB only for UL Grant
uint16_t
rballoc
=
mac_computeRIV
(
N_RB_UL
,
ra
->
msg3_first_rb
,
ra
->
msg3_nb_rb
);
// first PRB only for UL Grant
rar
[
1
]
|=
(
rballoc
>>
7
)
&
7
;
// Hopping = 0 (bit 3), 3 MSBs of rballoc
rar
[
1
]
|=
(
rballoc
>>
7
)
&
7
;
// Hopping = 0 (bit 3), 3 MSBs of rballoc
rar
[
2
]
=
((
uint8_t
)
(
rballoc
&
0xff
))
<<
1
;
// 7 LSBs of rballoc
rar
[
2
]
=
((
uint8_t
)
(
rballoc
&
0xff
))
<<
1
;
// 7 LSBs of rballoc
...
@@ -94,9 +103,17 @@ fill_rar(const module_id_t module_idP,
...
@@ -94,9 +103,17 @@ fill_rar(const module_id_t module_idP,
rar
[
3
]
=
rar
[
3
]
=
(((
ra
->
msg3_mcs
&
0x7
)
<<
5
))
|
((
ra
->
msg3_TPC
&
7
)
<<
2
)
|
(((
ra
->
msg3_mcs
&
0x7
)
<<
5
))
|
((
ra
->
msg3_TPC
&
7
)
<<
2
)
|
((
ra
->
msg3_ULdelay
&
1
)
<<
1
)
|
(
ra
->
msg3_cqireq
&
1
);
((
ra
->
msg3_ULdelay
&
1
)
<<
1
)
|
(
ra
->
msg3_cqireq
&
1
);
trace_pdu
(
DIRECTION_DOWNLINK
,
dlsch_buffer
,
input_buffer_length
,
module_idP
,
WS_RA_RNTI
,
1
,
if
(
opt_enabled
)
{
trace_pdu
(
DIRECTION_DOWNLINK
,
dlsch_buffer
,
input_buffer_length
,
module_idP
,
WS_RA_RNTI
,
1
,
RC
.
mac
[
module_idP
]
->
frame
,
RC
.
mac
[
module_idP
]
->
subframe
,
RC
.
mac
[
module_idP
]
->
frame
,
RC
.
mac
[
module_idP
]
->
subframe
,
0
,
0
);
0
,
0
);
LOG_D
(
OPT
,
"[eNB %d][RAPROC] CC_id %d RAR Frame %d trace pdu for rnti %x and rapid %d size %d
\n
"
,
module_idP
,
CC_id
,
frameP
,
ra
->
rnti
,
rarh
->
RAPID
,
input_buffer_length
);
}
return
(
ra
->
rnti
);
return
(
ra
->
rnti
);
}
}
...
...
openair2/LAYER2/RLC/rlc_rrc.c
View file @
72c11e64
...
@@ -558,6 +558,7 @@ rlc_op_status_t rrc_rlc_remove_rlc (
...
@@ -558,6 +558,7 @@ rlc_op_status_t rrc_rlc_remove_rlc (
rb_idP
,
lcid
,
rb_idP
,
lcid
,
(
srb_flagP
)
?
"SRB"
:
"DRB"
);
(
srb_flagP
)
?
"SRB"
:
"DRB"
);
}
}
free
(
rlc_union_p
);
return
RLC_OP_STATUS_OK
;
return
RLC_OP_STATUS_OK
;
}
}
...
...
openair2/PHY_INTERFACE/IF_Module.c
View file @
72c11e64
...
@@ -769,8 +769,8 @@ void UL_indication(UL_IND_t *UL_info, L1_rxtx_proc_t *proc) {
...
@@ -769,8 +769,8 @@ void UL_indication(UL_IND_t *UL_info, L1_rxtx_proc_t *proc) {
sched_info
->
HI_DCI0_req
=
&
mac
->
HI_DCI0_req
[
CC_id
][
sched_info
->
subframe
];
sched_info
->
HI_DCI0_req
=
&
mac
->
HI_DCI0_req
[
CC_id
][
sched_info
->
subframe
];
if
(
is_UL_sf
(
&
mac
->
common_channels
[
CC_id
],
sched_info
->
subframe
)
<
0
)
{
if
(
is_UL_sf
(
&
mac
->
common_channels
[
CC_id
],
sched_info
->
subframe
)
<
0
)
{
return
;
//
return;
}
}
else
{
if
((
mac
->
common_channels
[
CC_id
].
tdd_Config
==
NULL
)
||
if
((
mac
->
common_channels
[
CC_id
].
tdd_Config
==
NULL
)
||
(
is_UL_sf
(
&
mac
->
common_channels
[
CC_id
],
sched_info
->
subframe
)
>
0
))
(
is_UL_sf
(
&
mac
->
common_channels
[
CC_id
],
sched_info
->
subframe
)
>
0
))
sched_info
->
UL_req
=
&
mac
->
UL_req
[
CC_id
];
sched_info
->
UL_req
=
&
mac
->
UL_req
[
CC_id
];
...
@@ -795,6 +795,9 @@ void UL_indication(UL_IND_t *UL_info, L1_rxtx_proc_t *proc) {
...
@@ -795,6 +795,9 @@ void UL_indication(UL_IND_t *UL_info, L1_rxtx_proc_t *proc) {
}
}
ifi
->
schedule_response
(
sched_info
,
proc
);
ifi
->
schedule_response
(
sched_info
,
proc
);
}
}
}
update_ue_timers
(
module_id
,(
UL_info
->
frame
+
((
UL_info
->
subframe
>
(
9
-
sf_ahead
-
1
))
?
1
:
0
))
%
1024
,(
UL_info
->
subframe
+
sf_ahead
+
1
)
%
10
);
LOG_D
(
PHY
,
"Schedule_response: SFN_SF:%d%d dl_pdus:%d
\n
"
,
sched_info
->
frame
,
sched_info
->
subframe
,
sched_info
->
DL_req
->
dl_config_request_body
.
number_pdu
);
LOG_D
(
PHY
,
"Schedule_response: SFN_SF:%d%d dl_pdus:%d
\n
"
,
sched_info
->
frame
,
sched_info
->
subframe
,
sched_info
->
DL_req
->
dl_config_request_body
.
number_pdu
);
}
}
...
...
openair2/RRC/LTE/MESSAGES/asn1_msg.c
View file @
72c11e64
...
@@ -2520,7 +2520,6 @@ do_RRCConnectionSetup(
...
@@ -2520,7 +2520,6 @@ do_RRCConnectionSetup(
else
else
physicalConfigDedicated2
->
soundingRS_UL_ConfigDedicated
=
NULL
;
physicalConfigDedicated2
->
soundingRS_UL_ConfigDedicated
=
NULL
;
physicalConfigDedicated2
->
antennaInfo
=
CALLOC
(
1
,
sizeof
(
*
physicalConfigDedicated2
->
antennaInfo
));
physicalConfigDedicated2
->
schedulingRequestConfig
=
CALLOC
(
1
,
sizeof
(
*
physicalConfigDedicated2
->
schedulingRequestConfig
));
physicalConfigDedicated2
->
schedulingRequestConfig
=
CALLOC
(
1
,
sizeof
(
*
physicalConfigDedicated2
->
schedulingRequestConfig
));
// PDSCH
// PDSCH
...
@@ -2721,15 +2720,15 @@ do_RRCConnectionSetup(
...
@@ -2721,15 +2720,15 @@ do_RRCConnectionSetup(
case
2
:
case
2
:
switch
(
frame_parms
->
N_RB_UL
)
{
switch
(
frame_parms
->
N_RB_UL
)
{
case
25
:
case
25
:
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
=
sr_base
-
ue_context_pP
->
local_uid
/
2
;
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
=
sr_base
-
ue_context_pP
->
local_uid
/
4
;
break
;
break
;
case
50
:
case
50
:
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
=
sr_base
-
ue_context_pP
->
local_uid
/
2
;
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
=
sr_base
-
ue_context_pP
->
local_uid
/
4
;
break
;
break
;
case
100
:
case
100
:
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
=
sr_base
-
ue_context_pP
->
local_uid
/
2
;
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
=
sr_base
-
ue_context_pP
->
local_uid
/
4
;
break
;
break
;
}
}
...
@@ -2740,6 +2739,11 @@ do_RRCConnectionSetup(
...
@@ -2740,6 +2739,11 @@ do_RRCConnectionSetup(
break
;
break
;
}
}
}
}
if
(
!
((
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
>=
0
)
&&
(
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
<
carrier
->
sib2
->
radioResourceConfigCommon
.
pucch_ConfigCommon
.
n1PUCCH_AN
)))
{
LOG_E
(
RRC
,
"illegal sr_PUCCH_ResourceIndex %ld n1PUCCH_AN %ld ue_context_pP->local_uid %d
\n
"
,
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_PUCCH_ResourceIndex
,
carrier
->
sib2
->
radioResourceConfigCommon
.
pucch_ConfigCommon
.
n1PUCCH_AN
,
ue_context_pP
->
local_uid
);
return
-
1
;
}
if
(
carrier
->
sib1
->
tdd_Config
==
NULL
)
{
// FDD
if
(
carrier
->
sib1
->
tdd_Config
==
NULL
)
{
// FDD
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_ConfigIndex
=
5
+
(
ue_context_pP
->
local_uid
%
10
);
// Isr = 5 (every 10 subframes, offset=2+UE_id mod3)
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_ConfigIndex
=
5
+
(
ue_context_pP
->
local_uid
%
10
);
// Isr = 5 (every 10 subframes, offset=2+UE_id mod3)
...
@@ -2751,8 +2755,8 @@ do_RRCConnectionSetup(
...
@@ -2751,8 +2755,8 @@ do_RRCConnectionSetup(
break
;
break
;
case
2
:
case
2
:
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_ConfigIndex
=
7
+
physicalConfigDedicated2
->
schedulingRequestConfig
->
choice
.
setup
.
sr_ConfigIndex
=
1
7
+
(
ue_context_pP
->
local_uid
&
1
)
*
5
;
// Isr = 5 (every 10 subframes, offset=2 for UE0, 7 for UE1, 2 for UE2, 7 for UE3 , 2 for UE4 etc
..)
(
ue_context_pP
->
local_uid
&
3
)
*
5
;
// Isr = 15 (every 20 subframes, offset=2 for UE0, UE2, UE4.. offset=7 for UE1, UE3, UE5
..)
break
;
break
;
case
3
:
case
3
:
...
@@ -2821,13 +2825,19 @@ do_RRCConnectionSetup(
...
@@ -2821,13 +2825,19 @@ do_RRCConnectionSetup(
RRC_BUF_SIZE
);
RRC_BUF_SIZE
);
if
(
enc_rval
.
encoded
==
-
1
)
{
if
(
enc_rval
.
encoded
==
-
1
)
{
LOG_
I
(
RRC
,
"[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
LOG_
E
(
RRC
,
"[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
-
1
;
return
-
1
;
}
}
LOG_D
(
RRC
,
"RRCConnectionSetup Encoded %zd bits (%zd bytes)
\n
"
,
LOG_D
(
RRC
,
"RRCConnectionSetup Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
free
(
mac_MainConfig
->
phr_Config
);
free
(
maxHARQ_Tx
);
free
(
periodicBSR_Timer
);
free
(
mac_MainConfig
->
ul_SCH_Config
);
free
(
rrcConnectionSetup
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionSetup_r8
.
radioResourceConfigDedicated
.
mac_MainConfig
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
...
@@ -3696,6 +3706,25 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
...
@@ -3696,6 +3706,25 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
// for (i=0;i<30;i++)
// for (i=0;i<30;i++)
// msg("%x.",buffer[i]);
// msg("%x.",buffer[i]);
// msg("\n");
// msg("\n");
if
(
securityConfigHO
!=
NULL
)
{
free
(
rrcConnectionReconfiguration
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionReconfiguration_r8
.
securityConfigHO
);
}
if
(
mobilityInfo
!=
NULL
)
{
free
(
rrcConnectionReconfiguration
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionReconfiguration_r8
.
mobilityControlInfo
);
}
if
(
MeasId_list
!=
NULL
)
{
if
(
speedStatePars
!=
NULL
)
{
free
(
rrcConnectionReconfiguration
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionReconfiguration_r8
.
measConfig
->
speedStatePars
);
}
if
(
quantityConfig
!=
NULL
)
{
free
(
rrcConnectionReconfiguration
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionReconfiguration_r8
.
measConfig
->
quantityConfig
);
}
free
(
rrcConnectionReconfiguration
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionReconfiguration_r8
.
measConfig
);
}
if
(
mac_MainConfig
!=
NULL
)
{
free
(
rrcConnectionReconfiguration
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionReconfiguration_r8
.
radioResourceConfigDedicated
->
mac_MainConfig
);
}
free
(
rrcConnectionReconfiguration
->
criticalExtensions
.
choice
.
c1
.
choice
.
rrcConnectionReconfiguration_r8
.
radioResourceConfigDedicated
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
...
...
openair2/RRC/LTE/rrc_eNB.c
View file @
72c11e64
This diff is collapsed.
Click to expand it.
openair2/UTIL/OCG/OCG_call_emu.c
View file @
72c11e64
...
@@ -50,6 +50,11 @@ int call_emu(char dst_dir[DIR_LENGTH_MAX])
...
@@ -50,6 +50,11 @@ int call_emu(char dst_dir[DIR_LENGTH_MAX])
char
dst_file
[
DIR_LENGTH_MAX
]
=
""
;
char
dst_file
[
DIR_LENGTH_MAX
]
=
""
;
strcat
(
dst_file
,
dst_dir
);
strcat
(
dst_file
,
dst_dir
);
strcat
(
dst_file
,
"emulation_result.txt"
);
strcat
(
dst_file
,
"emulation_result.txt"
);
if
(
-
1
==
(
dst_file
,
F_OK
)){
creat
(
dst_file
,
0644
);
}
else
{
chmod
(
dst_file
,
0644
);
}
file
=
fopen
(
dst_file
,
"w"
);
file
=
fopen
(
dst_file
,
"w"
);
//system("../../../openair1/SIMULATION/LTE_PHY_L2/physim --help");
//system("../../../openair1/SIMULATION/LTE_PHY_L2/physim --help");
...
...
openair2/UTIL/OCG/OCG_save_XML.c
View file @
72c11e64
...
@@ -54,6 +54,11 @@ int save_XML(int copy_or_move, char *src_file, char *output_dir, char *filename)
...
@@ -54,6 +54,11 @@ int save_XML(int copy_or_move, char *src_file, char *output_dir, char *filename)
XML_saving_dir
[
sizeof
(
XML_saving_dir
)
-
1
]
=
0
;
// terminate string
XML_saving_dir
[
sizeof
(
XML_saving_dir
)
-
1
]
=
0
;
// terminate string
strncat
(
dst_file
,
filename
,
sizeof
(
dst_file
)
-
strlen
(
dst_file
)
-
1
);
strncat
(
dst_file
,
filename
,
sizeof
(
dst_file
)
-
strlen
(
dst_file
)
-
1
);
fs
=
fopen
(
src_file
,
"r"
);
fs
=
fopen
(
src_file
,
"r"
);
if
(
-
1
==
(
dst_file
,
F_OK
)){
creat
(
dst_file
,
0644
);
}
else
{
chmod
(
dst_file
,
0644
);
}
ft
=
fopen
(
dst_file
,
"w"
);
ft
=
fopen
(
dst_file
,
"w"
);
if
((
ft
!=
NULL
)
&&
(
fs
!=
NULL
))
{
if
((
ft
!=
NULL
)
&&
(
fs
!=
NULL
))
{
...
...
openair2/UTIL/OPT/probe.c
View file @
72c11e64
...
@@ -498,6 +498,11 @@ int init_opt(void)
...
@@ -498,6 +498,11 @@ int init_opt(void)
break
;
break
;
case
OPT_PCAP
:
case
OPT_PCAP
:
if
(
-
1
==
(
access
(
in_path
,
F_OK
))){
creat
(
in_path
,
0644
);
}
else
{
chmod
(
in_path
,
0644
);
}
file_fd
=
fopen
(
in_path
,
"w"
);
file_fd
=
fopen
(
in_path
,
"w"
);
if
(
file_fd
==
NULL
)
{
if
(
file_fd
==
NULL
)
{
...
...
openair2/UTIL/OTG/otg_kpi.c
View file @
72c11e64
...
@@ -240,9 +240,19 @@ void kpi_gen() {
...
@@ -240,9 +240,19 @@ void kpi_gen() {
char
traffic
[
30
];
char
traffic
[
30
];
#ifdef STANDALONE
#ifdef STANDALONE
FILE
*
file
;
FILE
*
file
;
if
(
-
1
==
(
"log_OTG.txt"
,
F_OK
)){
creat
(
"log_OTG.txt"
,
0644
);
}
else
{
chmod
(
"log_OTG.txt"
,
0644
);
}
file
=
fopen
(
"log_OTG.txt"
,
"w"
);
file
=
fopen
(
"log_OTG.txt"
,
"w"
);
#else // Maybe to do modifo log function in order to clear file before a new write !!!!
#else // Maybe to do modifo log function in order to clear file before a new write !!!!
FILE
*
fc
;
FILE
*
fc
;
if
(
-
1
==
(
"/tmp/otg.log"
,
F_OK
)){
creat
(
"/tmp/otg.log"
,
0644
);
}
else
{
chmod
(
"/tmp/otg.log"
,
0644
);
}
fc
=
fopen
(
"/tmp/otg.log"
,
"w"
);;
fc
=
fopen
(
"/tmp/otg.log"
,
"w"
);;
if
(
fc
!=
0
)
if
(
fc
!=
0
)
...
...
openair2/X2AP/x2ap_eNB_generate_messages.c
View file @
72c11e64
...
@@ -839,8 +839,8 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p,
...
@@ -839,8 +839,8 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p,
ie
=
(
X2AP_HandoverRequestAcknowledge_IEs_t
*
)
calloc
(
1
,
sizeof
(
X2AP_HandoverRequestAcknowledge_IEs_t
));
ie
=
(
X2AP_HandoverRequestAcknowledge_IEs_t
*
)
calloc
(
1
,
sizeof
(
X2AP_HandoverRequestAcknowledge_IEs_t
));
ie
->
id
=
X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID
;
ie
->
id
=
X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID
;
ie
->
criticality
=
X2AP_Criticality_ignore
;
ie
->
criticality
=
X2AP_Criticality_ignore
;
ie
->
value
.
present
=
X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID
_1
;
ie
->
value
.
present
=
X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID
;
ie
->
value
.
choice
.
UE_X2AP_ID
_1
=
id_target
;
ie
->
value
.
choice
.
UE_X2AP_ID
=
id_target
;
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
/* mandatory */
/* mandatory */
...
@@ -962,8 +962,8 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2
...
@@ -962,8 +962,8 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2
ie
=
(
X2AP_UEContextRelease_IEs_t
*
)
calloc
(
1
,
sizeof
(
X2AP_UEContextRelease_IEs_t
));
ie
=
(
X2AP_UEContextRelease_IEs_t
*
)
calloc
(
1
,
sizeof
(
X2AP_UEContextRelease_IEs_t
));
ie
->
id
=
X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID
;
ie
->
id
=
X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID
;
ie
->
criticality
=
X2AP_Criticality_reject
;
ie
->
criticality
=
X2AP_Criticality_reject
;
ie
->
value
.
present
=
X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID
_1
;
ie
->
value
.
present
=
X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID
;
ie
->
value
.
choice
.
UE_X2AP_ID
_1
=
id_target
;
ie
->
value
.
choice
.
UE_X2AP_ID
=
id_target
;
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
if
(
x2ap_eNB_encode_pdu
(
&
pdu
,
&
buffer
,
&
len
)
<
0
)
{
if
(
x2ap_eNB_encode_pdu
(
&
pdu
,
&
buffer
,
&
len
)
<
0
)
{
...
@@ -1029,8 +1029,8 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_
...
@@ -1029,8 +1029,8 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_
ie
=
(
X2AP_HandoverCancel_IEs_t
*
)
calloc
(
1
,
sizeof
(
X2AP_HandoverCancel_IEs_t
));
ie
=
(
X2AP_HandoverCancel_IEs_t
*
)
calloc
(
1
,
sizeof
(
X2AP_HandoverCancel_IEs_t
));
ie
->
id
=
X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID
;
ie
->
id
=
X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID
;
ie
->
criticality
=
X2AP_Criticality_ignore
;
ie
->
criticality
=
X2AP_Criticality_ignore
;
ie
->
value
.
present
=
X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID
_1
;
ie
->
value
.
present
=
X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID
;
ie
->
value
.
choice
.
UE_X2AP_ID
_1
=
id_target
;
ie
->
value
.
choice
.
UE_X2AP_ID
=
id_target
;
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
}
}
...
...
openair2/X2AP/x2ap_eNB_handler.c
View file @
72c11e64
...
@@ -926,7 +926,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
...
@@ -926,7 +926,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
return
-
1
;
return
-
1
;
}
}
id_target
=
ie
->
value
.
choice
.
UE_X2AP_ID
_1
;
id_target
=
ie
->
value
.
choice
.
UE_X2AP_ID
;
ue_id
=
id_source
;
ue_id
=
id_source
;
...
@@ -1081,7 +1081,7 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
...
@@ -1081,7 +1081,7 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
return
-
1
;
return
-
1
;
}
}
id_target
=
ie
->
value
.
choice
.
UE_X2AP_ID
_1
;
id_target
=
ie
->
value
.
choice
.
UE_X2AP_ID
;
ue_id
=
id_source
;
ue_id
=
id_source
;
if
(
ue_id
!=
x2ap_find_id_from_id_source
(
&
instance_p
->
id_manager
,
id_source
))
{
if
(
ue_id
!=
x2ap_find_id_from_id_source
(
&
instance_p
->
id_manager
,
id_source
))
{
...
@@ -1169,7 +1169,7 @@ int x2ap_eNB_handle_handover_cancel (instance_t instance,
...
@@ -1169,7 +1169,7 @@ int x2ap_eNB_handle_handover_cancel (instance_t instance,
X2AP_INFO
(
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
X2AP_INFO
(
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
id_target
=
-
1
;
id_target
=
-
1
;
}
else
}
else
id_target
=
ie
->
value
.
choice
.
UE_X2AP_ID
_1
;
id_target
=
ie
->
value
.
choice
.
UE_X2AP_ID
;
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_HandoverCancel_IEs_t
,
ie
,
x2HandoverCancel
,
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_HandoverCancel_IEs_t
,
ie
,
x2HandoverCancel
,
X2AP_ProtocolIE_ID_id_Cause
,
true
);
X2AP_ProtocolIE_ID_id_Cause
,
true
);
...
...
openair3/NAS/COMMON/UTIL/memory.c
View file @
72c11e64
...
@@ -189,6 +189,11 @@ int memory_write(const char* datafile, const void* data, size_t size)
...
@@ -189,6 +189,11 @@ int memory_write(const char* datafile, const void* data, size_t size)
int
rc
=
RETURNerror
;
int
rc
=
RETURNerror
;
/* Open the data file for writing operation */
/* Open the data file for writing operation */
if
(
-
1
==
(
access
(
datafile
,
F_OK
))){
creat
(
datafile
,
0644
);
}
else
{
chmod
(
datafile
,
0644
);
}
FILE
*
fp
=
fopen
(
datafile
,
"wb"
);
FILE
*
fp
=
fopen
(
datafile
,
"wb"
);
if
(
fp
!=
NULL
)
{
if
(
fp
!=
NULL
)
{
...
...
openair3/S1AP/s1ap_eNB_handlers.c
View file @
72c11e64
...
@@ -279,6 +279,7 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
...
@@ -279,6 +279,7 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
S1AP_ERROR
(
"pdu == NULL
\n
"
);
S1AP_ERROR
(
"pdu == NULL
\n
"
);
return
-
1
;
return
-
1
;
}
}
container
=
&
pdu
->
choice
.
unsuccessfulOutcome
.
value
.
choice
.
S1SetupFailure
;
container
=
&
pdu
->
choice
.
unsuccessfulOutcome
.
value
.
choice
.
S1SetupFailure
;
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
...
@@ -288,8 +289,6 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
...
@@ -288,8 +289,6 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
}
}
if
((
mme_desc_p
=
s1ap_eNB_get_MME
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
if
((
mme_desc_p
=
s1ap_eNB_get_MME
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
// S1AP_ERROR("[SCTP %d] Received S1 setup response for non existing "
// "MME context\n", assoc_id);
S1AP_ERROR
(
"[SCTP %d] Received S1 setup failure for non existing "
S1AP_ERROR
(
"[SCTP %d] Received S1 setup failure for non existing "
"MME context
\n
"
,
assoc_id
);
"MME context
\n
"
,
assoc_id
);
return
-
1
;
return
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment