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
bd672c5f
Commit
bd672c5f
authored
Feb 26, 2020
by
WANG Tsu-Han
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming of variable
parent
d30a28c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
targets/ARCH/COMMON/common_lib.h
targets/ARCH/COMMON/common_lib.h
+5
-5
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+9
-9
No files found.
targets/ARCH/COMMON/common_lib.h
View file @
bd672c5f
...
...
@@ -48,8 +48,8 @@
#define RAU_LOCAL_RADIO_HEAD 0
#define RAU_REMOTE_RADIO_HEAD 1
#define WRITE_THREAD_PACKAGE 10
#define WRITE_THREAD_BUFFER_SIZE 8
#define
MAX_
WRITE_THREAD_PACKAGE 10
#define
MAX_
WRITE_THREAD_BUFFER_SIZE 8
#ifndef MAX_CARDS
#define MAX_CARDS 8
...
...
@@ -281,7 +281,7 @@ typedef struct {
typedef
struct
{
openair0_timestamp
timestamp
;
void
*
buff
[
WRITE_THREAD_BUFFER_SIZE
];
// buffer to be write;
void
*
buff
[
MAX_
WRITE_THREAD_BUFFER_SIZE
];
// buffer to be write;
int
nsamps
;
int
cc
;
signed
char
first_packet
;
...
...
@@ -289,11 +289,11 @@ typedef struct {
}
openair0_write_package_t
;
typedef
struct
{
openair0_write_package_t
write_package
[
WRITE_THREAD_PACKAGE
];
openair0_write_package_t
write_package
[
MAX_
WRITE_THREAD_PACKAGE
];
int
start
;
int
end
;
/// \internal This variable is protected by \ref mutex_write
int
instance_c
nt_write
;
int
cou
nt_write
;
/// pthread struct for trx write thread
pthread_t
pthread_write
;
/// pthread attributes for trx write thread
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
bd672c5f
...
...
@@ -409,7 +409,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
openair0_thread_t
*
write_thread
=
&
device
->
write_thread
;
openair0_write_package_t
*
write_package
=
write_thread
->
write_package
;
AssertFatal
(
WRITE_THREAD_BUFFER_SIZE
>=
cc
,
"Do not support more than %d cc number
\n
"
,
WRITE_THREAD_BUFFER_SIZE
);
AssertFatal
(
MAX_WRITE_THREAD_BUFFER_SIZE
>=
cc
,
"Do not support more than %d cc number
\n
"
,
MAX_
WRITE_THREAD_BUFFER_SIZE
);
boolean_t
first_packet_state
=
false
,
last_packet_state
=
false
;
...
...
@@ -442,10 +442,10 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
}
pthread_mutex_lock
(
&
write_thread
->
mutex_write
);
if
(
write_thread
->
instance_cnt_write
>=
WRITE_THREAD_PACKAGE
){
if
(
write_thread
->
count_write
>=
MAX_
WRITE_THREAD_PACKAGE
){
LOG_W
(
HW
,
"Buffer overflow, resetting write package
\n
"
);
write_thread
->
end
=
write_thread
->
start
;
write_thread
->
instance_c
nt_write
=
0
;
write_thread
->
cou
nt_write
=
0
;
}
end
=
write_thread
->
end
;
...
...
@@ -456,8 +456,8 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
write_package
[
end
].
last_packet
=
last_packet_state
;
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
write_package
[
end
].
buff
[
i
]
=
buff
[
i
];
++
write_thread
->
instance_cnt_write
;
write_thread
->
end
=
(
write_thread
->
end
+
1
)
%
WRITE_THREAD_PACKAGE
;
write_thread
->
count_write
++
;
write_thread
->
end
=
(
write_thread
->
end
+
1
)
%
MAX_
WRITE_THREAD_PACKAGE
;
pthread_cond_signal
(
&
write_thread
->
cond_write
);
pthread_mutex_unlock
(
&
write_thread
->
mutex_write
);
...
...
@@ -492,7 +492,7 @@ void *trx_usrp_write_thread(void * arg){
while
(
1
){
pthread_mutex_lock
(
&
write_thread
->
mutex_write
);
while
(
write_thread
->
instance_c
nt_write
==
0
)
{
while
(
write_thread
->
cou
nt_write
==
0
)
{
pthread_cond_wait
(
&
write_thread
->
cond_write
,
&
write_thread
->
mutex_write
);
// this unlocks mutex_rxtx while waiting and then locks it again
}
s
=
(
usrp_state_t
*
)
device
->
priv
;
...
...
@@ -503,8 +503,8 @@ void *trx_usrp_write_thread(void * arg){
cc
=
write_package
[
start
].
cc
;
first_packet
=
write_package
[
start
].
first_packet
;
last_packet
=
write_package
[
start
].
last_packet
;
write_thread
->
start
=
(
write_thread
->
start
+
1
)
%
WRITE_THREAD_PACKAGE
;
--
write_thread
->
instance_cnt_write
;
write_thread
->
start
=
(
write_thread
->
start
+
1
)
%
MAX_
WRITE_THREAD_PACKAGE
;
write_thread
->
count_write
--
;
pthread_mutex_unlock
(
&
write_thread
->
mutex_write
);
#if defined(__x86_64) || defined(__i386__)
...
...
@@ -567,7 +567,7 @@ int trx_write_init(openair0_device *device){
write_thread
->
start
=
0
;
write_thread
->
end
=
0
;
write_thread
->
instance_c
nt_write
=
0
;
write_thread
->
cou
nt_write
=
0
;
printf
(
"end of tx write thread
\n
"
);
pthread_create
(
&
write_thread
->
pthread_write
,
NULL
,
trx_usrp_write_thread
,(
void
*
)
device
);
...
...
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