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
canghaiwuhen
OpenXG-RAN
Commits
d58d29f0
Commit
d58d29f0
authored
Jan 19, 2018
by
Xu Bo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix TBS calculation error and add rf_tx thread for send TX data to device
parent
17ab8472
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
7 deletions
+63
-7
openair1/PHY/defs.h
openair1/PHY/defs.h
+6
-0
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/pre_processor.c
+1
-1
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+56
-6
No files found.
openair1/PHY/defs.h
100644 → 100755
View file @
d58d29f0
...
...
@@ -435,6 +435,12 @@ typedef struct RU_proc_t_s {
int
subframe_phy_tx
;
/// timestamp to send to "slave rru"
openair0_timestamp
timestamp_phy_tx
;
/// pthread structure for RF TX thread
pthread_t
pthread_rf_tx
;
pthread_mutex_t
mutex_rf_tx
;
pthread_cond_t
cond_rf_tx
;
/// \internal This variable is protected by \ref mutex_rf_tx.
int
instance_cnt_rf_tx
;
#endif
#if defined(UE_EXPANSION) || defined(UE_EXPANSION_SIM2)
pthread_t
pthread_pre_scd
;
...
...
openair2/LAYER2/MAC/pre_processor.c
View file @
d58d29f0
...
...
@@ -552,7 +552,7 @@ inline uint16_t search_rbs_required(uint16_t mcs, uint16_t TBS,uint16_t NB_RB, u
uint16_t
nb_rb
,
i_TBS
,
tmp_TBS
;
i_TBS
=
get_I_TBS
(
mcs
);
for
(
nb_rb
=
step_size
;
nb_rb
<
NB_RB
;
nb_rb
+=
step_size
){
tmp_TBS
=
TBStable
[
i_TBS
][
nb_rb
-
1
];
tmp_TBS
=
TBStable
[
i_TBS
][
nb_rb
-
1
]
>>
3
;
if
(
TBS
<
tmp_TBS
)
return
(
nb_rb
);
}
return
NB_RB
;
...
...
targets/RT/USER/lte-ru.c
100644 → 100755
View file @
d58d29f0
...
...
@@ -1784,10 +1784,52 @@ static void* eNB_thread_phy_tx( void* param ) {
ru
->
proc
.
subframe_tx
=
proc
->
subframe_phy_tx
;
ru
->
proc
.
timestamp_tx
=
proc
->
timestamp_phy_tx
;
phy_tx_txdataF_end
=
1
;
if
(
pthread_mutex_lock
(
&
ru
->
proc
.
mutex_rf_tx
)
!=
0
){
LOG_E
(
PHY
,
"[RU] ERROR pthread_mutex_lock for rf tx thread (IC %d)
\n
"
,
ru
->
proc
.
instance_cnt_rf_tx
);
exit_fun
(
"error locking mutex_rf_tx"
);
}
if
(
ru
->
proc
.
instance_cnt_rf_tx
==-
1
)
{
++
ru
->
proc
.
instance_cnt_rf_tx
;
// the thread can now be woken up
AssertFatal
(
pthread_cond_signal
(
&
ru
->
proc
.
cond_rf_tx
)
==
0
,
"ERROR pthread_cond_signal for rf_tx thread
\n
"
);
}
else
LOG_W
(
PHY
,
"rf tx thread busy, skipping
\n
"
);
pthread_mutex_unlock
(
&
ru
->
proc
.
mutex_rf_tx
);
}
if
(
release_thread
(
&
proc
->
mutex_phy_tx
,
&
proc
->
instance_cnt_phy_tx
,
"eNB_thread_phy_tx"
)
<
0
)
break
;
phy_tx_end
=
1
;
}
LOG_I
(
PHY
,
"Exiting eNB thread PHY TX
\n
"
);
eNB_thread_phy_tx_status
=
0
;
return
&
eNB_thread_phy_tx_status
;
}
static
void
*
rf_tx
(
void
*
param
)
{
static
int
rf_tx_status
;
RU_t
*
ru
=
(
RU_t
*
)
param
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
// set default return value
rf_tx_status
=
0
;
thread_top_init
(
"rf_tx"
,
1
,
500000L
,
1000000L
,
20000000L
);
while
(
!
oai_exit
)
{
if
(
oai_exit
)
break
;
if
(
wait_on_condition
(
&
proc
->
mutex_rf_tx
,
&
proc
->
cond_rf_tx
,
&
proc
->
instance_cnt_rf_tx
,
"rf_tx_thread"
)
<
0
)
break
;
LOG_D
(
PHY
,
"Running eNB rf tx procedures
\n
"
);
if
(
ru
->
num_eNB
==
1
){
// do TX front-end processing if needed (precoding and/or IDFTs)
if
(
ru
->
feptx_prec
)
ru
->
feptx_prec
(
ru
);
// do OFDM if needed
if
((
ru
->
fh_north_asynch_in
==
NULL
)
&&
(
ru
->
feptx_ofdm
))
ru
->
feptx_ofdm
(
ru
);
// do outgoing fronthaul (south) if needed
...
...
@@ -1795,14 +1837,13 @@ static void* eNB_thread_phy_tx( void* param ) {
if
(
ru
->
fh_north_out
)
ru
->
fh_north_out
(
ru
);
}
if
(
release_thread
(
&
proc
->
mutex_phy_tx
,
&
proc
->
instance_cnt_phy_tx
,
"eNB_thread_phy_tx"
)
<
0
)
break
;
phy_tx_end
=
1
;
if
(
release_thread
(
&
proc
->
mutex_rf_tx
,
&
proc
->
instance_cnt_rf_tx
,
"rf_tx"
)
<
0
)
break
;
}
LOG_I
(
PHY
,
"Exiting
eNB thread PHY
TX
\n
"
);
LOG_I
(
PHY
,
"Exiting
rf
TX
\n
"
);
eNB_thread_phy
_tx_status
=
0
;
return
&
eNB_thread_phy
_tx_status
;
rf
_tx_status
=
0
;
return
&
rf
_tx_status
;
}
#endif
...
...
@@ -1881,6 +1922,9 @@ void init_RU_proc(RU_t *ru) {
proc
->
instance_cnt_phy_tx
=
-
1
;
pthread_mutex_init
(
&
proc
->
mutex_phy_tx
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_phy_tx
,
NULL
);
proc
->
instance_cnt_rf_tx
=
-
1
;
pthread_mutex_init
(
&
proc
->
mutex_rf_tx
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_rf_tx
,
NULL
);
#endif
#ifndef DEADLINE_SCHEDULER
...
...
@@ -1905,6 +1949,7 @@ void init_RU_proc(RU_t *ru) {
#ifdef UE_EXPANSION
pthread_create
(
&
proc
->
pthread_phy_tx
,
NULL
,
eNB_thread_phy_tx
,
(
void
*
)
ru
);
pthread_setname_np
(
proc
->
pthread_phy_tx
,
"phy_tx_thread"
);
pthread_create
(
&
proc
->
pthread_rf_tx
,
NULL
,
rf_tx
,
(
void
*
)
ru
);
#endif
if
(
ru
->
function
==
NGFI_RRU_IF4p5
)
{
...
...
@@ -2342,6 +2387,11 @@ void stop_ru(RU_t *ru) {
pthread_join
(
ru
->
proc
.
pthread_phy_tx
,
(
void
**
)
&
status
);
pthread_mutex_destroy
(
&
ru
->
proc
.
mutex_phy_tx
);
pthread_cond_destroy
(
&
ru
->
proc
.
cond_phy_tx
);
ru
->
proc
.
instance_cnt_rf_tx
=
0
;
pthread_cond_signal
(
&
ru
->
proc
.
cond_rf_tx
);
pthread_join
(
ru
->
proc
.
pthread_rf_tx
,
(
void
**
)
&
status
);
pthread_mutex_destroy
(
&
ru
->
proc
.
mutex_rf_tx
);
pthread_cond_destroy
(
&
ru
->
proc
.
cond_rf_tx
);
}
#endif
}
...
...
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