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
Michael Black
OpenXG-RAN
Commits
adb02aa2
Commit
adb02aa2
authored
Feb 09, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/bugfix-release-usrp' into integration_2022_wk06
parents
3c73b3aa
344f8b75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
18 deletions
+31
-18
radio/USRP/USERSPACE/LIB/usrp_lib.cpp
radio/USRP/USERSPACE/LIB/usrp_lib.cpp
+31
-18
No files found.
radio/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
adb02aa2
...
@@ -320,21 +320,31 @@ static int trx_usrp_start(openair0_device *device) {
...
@@ -320,21 +320,31 @@ static int trx_usrp_start(openair0_device *device) {
return
0
;
return
0
;
}
}
static
void
trx_usrp_send_end_of_burst
(
usrp_state_t
*
s
)
{
static
void
trx_usrp_send_end_of_burst
(
usrp_state_t
*
s
)
{
// if last packet sent was end of burst no need to do anything. otherwise send end of burst packet
// if last packet sent was end of burst no need to do anything. otherwise send end of burst packet
if
(
s
->
tx_md
.
end_of_burst
)
if
(
s
->
tx_md
.
end_of_burst
)
return
;
return
;
s
->
tx_md
.
end_of_burst
=
true
;
s
->
tx_md
.
end_of_burst
=
true
;
s
->
tx_md
.
start_of_burst
=
false
;
s
->
tx_md
.
start_of_burst
=
false
;
s
->
tx_md
.
has_time_spec
=
false
;
s
->
tx_md
.
has_time_spec
=
false
;
s
->
tx_stream
->
send
(
""
,
0
,
s
->
tx_md
);
}
int32_t
dummy
=
0
;
static
void
trx_usrp_finish_rx
(
usrp_state_t
*
s
)
std
::
vector
<
const
void
*>
buffs
;
{
for
(
size_t
ch
=
0
;
ch
<
s
->
tx_stream
->
get_num_channels
();
ch
++
)
/* finish rx by sending STREAM_MODE_STOP_CONTINUOUS */
buffs
.
push_back
(
&
dummy
);
// same buffer for each channel
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_STOP_CONTINUOUS
);
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
s
->
tx_stream
->
send
(
buffs
,
0
,
s
->
tx_md
);
/* collect all remaining samples (not sure if needed) */
size_t
samples
;
uint8_t
buf
[
1024
];
std
::
vector
<
void
*>
buff_ptrs
;
for
(
size_t
i
=
0
;
i
<
s
->
usrp
->
get_rx_num_channels
();
i
++
)
buff_ptrs
.
push_back
(
buf
);
do
{
samples
=
s
->
rx_stream
->
recv
(
buff_ptrs
,
sizeof
(
buf
)
/
4
,
s
->
rx_md
);
}
while
(
samples
>
0
);
}
}
static
void
trx_usrp_write_reset
(
openair0_thread_t
*
wt
);
static
void
trx_usrp_write_reset
(
openair0_thread_t
*
wt
);
...
@@ -355,10 +365,13 @@ static void trx_usrp_end(openair0_device *device) {
...
@@ -355,10 +365,13 @@ static void trx_usrp_end(openair0_device *device) {
if
(
usrp_tx_thread
!=
0
)
if
(
usrp_tx_thread
!=
0
)
trx_usrp_write_reset
(
&
device
->
write_thread
);
trx_usrp_write_reset
(
&
device
->
write_thread
);
/* finish tx and rx */
trx_usrp_send_end_of_burst
(
s
);
trx_usrp_send_end_of_burst
(
s
);
s
->
tx_stream
->~
tx_streamer
();
trx_usrp_finish_rx
(
s
);
s
->
rx_stream
->~
rx_streamer
();
/* set tx_stream, rx_stream, and usrp to NULL to clear/free them */
s
->
usrp
->~
multi_usrp
();
s
->
tx_stream
=
NULL
;
s
->
rx_stream
=
NULL
;
s
->
usrp
=
NULL
;
free
(
s
);
free
(
s
);
device
->
priv
=
NULL
;
device
->
priv
=
NULL
;
device
->
trx_start_func
=
NULL
;
device
->
trx_start_func
=
NULL
;
...
@@ -1400,8 +1413,14 @@ extern "C" {
...
@@ -1400,8 +1413,14 @@ extern "C" {
// create tx & rx streamer
// create tx & rx streamer
uhd
::
stream_args_t
stream_args_rx
(
"sc16"
,
"sc16"
);
uhd
::
stream_args_t
stream_args_rx
(
"sc16"
,
"sc16"
);
for
(
int
i
=
0
;
i
<
openair0_cfg
[
0
].
rx_num_channels
;
i
++
)
{
LOG_I
(
HW
,
"setting rx channel %d
\n
"
,
i
+
choffset
);
stream_args_rx
.
channels
.
push_back
(
i
+
choffset
);
}
s
->
rx_stream
=
s
->
usrp
->
get_rx_stream
(
stream_args_rx
);
int
samples
=
openair0_cfg
[
0
].
sample_rate
;
int
samples
=
openair0_cfg
[
0
].
sample_rate
;
int
max
=
s
->
usrp
->
get_rx_stream
(
stream_args_rx
)
->
get_max_num_samps
();
int
max
=
s
->
rx_stream
->
get_max_num_samps
();
samples
/=
10000
;
samples
/=
10000
;
LOG_I
(
HW
,
"RF board max packet size %u, size for 100µs jitter %d
\n
"
,
max
,
samples
);
LOG_I
(
HW
,
"RF board max packet size %u, size for 100µs jitter %d
\n
"
,
max
,
samples
);
...
@@ -1410,14 +1429,8 @@ extern "C" {
...
@@ -1410,14 +1429,8 @@ extern "C" {
}
}
LOG_I
(
HW
,
"rx_max_num_samps %zu
\n
"
,
LOG_I
(
HW
,
"rx_max_num_samps %zu
\n
"
,
s
->
usrp
->
get_rx_stream
(
stream_args_rx
)
->
get_max_num_samps
());
s
->
rx_stream
->
get_max_num_samps
());
for
(
int
i
=
0
;
i
<
openair0_cfg
[
0
].
rx_num_channels
;
i
++
)
{
LOG_I
(
HW
,
"setting rx channel %d
\n
"
,
i
+
choffset
);
stream_args_rx
.
channels
.
push_back
(
i
+
choffset
);
}
s
->
rx_stream
=
s
->
usrp
->
get_rx_stream
(
stream_args_rx
);
uhd
::
stream_args_t
stream_args_tx
(
"sc16"
,
"sc16"
);
uhd
::
stream_args_t
stream_args_tx
(
"sc16"
,
"sc16"
);
for
(
int
i
=
0
;
i
<
openair0_cfg
[
0
].
tx_num_channels
;
i
++
)
for
(
int
i
=
0
;
i
<
openair0_cfg
[
0
].
tx_num_channels
;
i
++
)
...
...
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