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
alex037yang
OpenXG-RAN
Commits
e5b643d0
Commit
e5b643d0
authored
Sep 22, 2016
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates for UE with USRP
parent
7af3d98f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
17 deletions
+40
-17
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+18
-10
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+22
-7
No files found.
targets/RT/USER/lte-softmodem.c
View file @
e5b643d0
...
...
@@ -424,10 +424,16 @@ void exit_fun(const char* s)
oai_exit
=
1
;
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
if
(
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rfdevice
.
trx_end_func
)
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rfdevice
.
trx_end_func
(
&
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rfdevice
);
if
(
PHY_vars_eNB_g
[
0
][
CC_id
]
->
ifdevice
.
trx_end_func
)
PHY_vars_eNB_g
[
0
][
CC_id
]
->
ifdevice
.
trx_end_func
(
&
PHY_vars_eNB_g
[
0
][
CC_id
]
->
ifdevice
);
if
(
UE_flag
==
0
)
{
if
(
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rfdevice
.
trx_end_func
)
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rfdevice
.
trx_end_func
(
&
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rfdevice
);
if
(
PHY_vars_eNB_g
[
0
][
CC_id
]
->
ifdevice
.
trx_end_func
)
PHY_vars_eNB_g
[
0
][
CC_id
]
->
ifdevice
.
trx_end_func
(
&
PHY_vars_eNB_g
[
0
][
CC_id
]
->
ifdevice
);
}
else
{
if
(
PHY_vars_UE_g
[
0
][
CC_id
]
->
rfdevice
.
trx_end_func
)
PHY_vars_UE_g
[
0
][
CC_id
]
->
rfdevice
.
trx_end_func
(
&
PHY_vars_UE_g
[
0
][
CC_id
]
->
rfdevice
);
}
}
#if defined(ENABLE_ITTI)
...
...
@@ -1789,14 +1795,16 @@ int main( int argc, char **argv )
// start the main thread
if
(
UE_flag
==
1
)
init_UE
(
1
);
else
init_eNB
(
node_function
,
node_timing
,
1
,
eth_params
,
single_thread_flag
);
else
{
init_eNB
(
node_function
,
node_timing
,
1
,
eth_params
,
single_thread_flag
);
// Sleep to allow all threads to setup
number_of_cards
=
1
;
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rf_map
.
card
=
0
;
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rf_map
.
chain
=
CC_id
+
chain_offset
;
number_of_cards
=
1
;
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rf_map
.
card
=
0
;
PHY_vars_eNB_g
[
0
][
CC_id
]
->
rf_map
.
chain
=
CC_id
+
chain_offset
;
}
}
// connect the TX/RX buffers
...
...
targets/RT/USER/lte-ue.c
View file @
e5b643d0
...
...
@@ -188,7 +188,7 @@ void init_UE(int nb_inst) {
ret
=
openair0_device_load
(
&
(
UE
->
rfdevice
),
&
openair0_cfg
[
0
]);
UE
->
rfdevice
.
host_type
=
BBU_HOST
;
UE
->
rfdevice
.
type
=
NONE_DEV
;
//
UE->rfdevice.type = NONE_DEV;
error_code
=
pthread_create
(
&
UE
->
proc
.
pthread_ue
,
&
UE
->
proc
.
attr_ue
,
UE_thread
,
NULL
);
if
(
error_code
!=
0
)
{
...
...
@@ -369,10 +369,7 @@ static void *UE_thread_synch(void *arg)
}
if
(
UE
->
rfdevice
.
trx_start_func
(
&
UE
->
rfdevice
)
!=
0
)
{
LOG_E
(
HW
,
"Could not start the device
\n
"
);
oai_exit
=
1
;
}
pthread_mutex_lock
(
&
sync_mutex
);
printf
(
"Locked sync_mutex, waiting (UE_sync_thread)
\n
"
);
...
...
@@ -382,6 +379,11 @@ static void *UE_thread_synch(void *arg)
pthread_mutex_unlock
(
&
sync_mutex
);
printf
(
"Started device, unlocked sync_mutex (UE_sync_thread)
\n
"
);
if
(
UE
->
rfdevice
.
trx_start_func
(
&
UE
->
rfdevice
)
!=
0
)
{
LOG_E
(
HW
,
"Could not start the device
\n
"
);
oai_exit
=
1
;
}
while
(
oai_exit
==
0
)
{
if
(
pthread_mutex_lock
(
&
UE
->
proc
.
mutex_synch
)
!=
0
)
{
...
...
@@ -941,7 +943,14 @@ void *UE_thread(void *arg) {
rxp
,
UE
->
frame_parms
.
samples_per_tti
*
10
,
UE
->
frame_parms
.
nb_antennas_rx
);
if
(
rxs
!=
UE
->
frame_parms
.
samples_per_tti
*
10
)
{
exit_fun
(
"problem in rx"
);
return
&
UE_thread_retval
;
}
}
instance_cnt_synch
=
++
UE
->
proc
.
instance_cnt_synch
;
if
(
instance_cnt_synch
==
0
)
{
if
(
pthread_cond_signal
(
&
UE
->
proc
.
cond_synch
)
!=
0
)
{
...
...
@@ -968,6 +977,12 @@ void *UE_thread(void *arg) {
rxp
,
UE
->
frame_parms
.
samples_per_tti
,
UE
->
frame_parms
.
nb_antennas_rx
);
if
(
rxs
!=
UE
->
frame_parms
.
samples_per_tti
){
exit_fun
(
"problem in rx"
);
return
&
UE_thread_retval
;
}
}
}
}
...
...
@@ -1065,12 +1080,12 @@ void *UE_thread(void *arg) {
proc
->
frame_tx
=
proc
->
frame_rx
+
((
proc
->
subframe_rx
>
5
)
?
1
:
0
);
proc
->
timestamp_tx
=
timestamp
+
(
4
*
UE
->
frame_parms
.
samples_per_tti
)
-
UE
->
frame_parms
.
ofdm_symbol_size
-
UE
->
frame_parms
.
nb_prefix_samples0
;
/*
if (sf != (timestamp/UE->frame_parms.samples_per_tti)%10) {
LOG_E(PHY,"steady-state UE_thread error : frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d, rx subframe %d\n",proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx,(timestamp/UE->frame_parms.samples_per_tti)%10);
exit(-1);
}
*/
if
(
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error unlocking mutex for UE RX
\n
"
);
exit_fun
(
"nothing to add"
);
...
...
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