Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openairinterface-6g
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
OpenXG
openairinterface-6g
Commits
d682b6c5
Commit
d682b6c5
authored
Sep 19, 2025
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function to read max DL ToA
Protect with mutex to allow reading from another thread.
parent
b95b4c09
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+1
-0
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+18
-0
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+3
-0
No files found.
openair1/PHY/INIT/nr_init_ue.c
View file @
d682b6c5
...
...
@@ -159,6 +159,7 @@ void init_nr_prs_ue_vars(PHY_VARS_NR_UE *ue)
AssertFatal
((
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_meas
[
j
]
!=
NULL
),
"%s: PRS measurements malloc failed for gNB_id %d, rx_ant %d
\n
"
,
__FUNCTION__
,
idx
,
j
);
prs_meas_t
*
m
=
prs_vars
[
idx
]
->
prs_resource
[
k
].
prs_meas
[
j
];
m
->
next_dl_toa
=
m
->
dl_toa
;
pthread_mutex_init
(
&
m
->
dl_toa_mtx
,
NULL
);
}
}
}
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
View file @
d682b6c5
...
...
@@ -73,10 +73,28 @@ void peak_estimator(c16_t *buffer, int32_t buf_len, int32_t *peak_idx, int32_t *
void
set_prs_dl_toa
(
prs_meas_t
*
prs_meas
,
float
dl_toa
)
{
int
rc
=
pthread_mutex_lock
(
&
prs_meas
->
dl_toa_mtx
);
AssertFatal
(
rc
==
0
,
"pthread_mutex_lock() failed: errno %d, %s
\n
"
,
errno
,
strerror
(
errno
));
*
prs_meas
->
next_dl_toa
++
=
dl_toa
;
if
(
prs_meas
->
next_dl_toa
>=
prs_meas
->
dl_toa
+
sizeofArray
(
prs_meas
->
dl_toa
))
prs_meas
->
next_dl_toa
=
prs_meas
->
dl_toa
;
LOG_D
(
NR_PHY
,
"next_dl_toa %p
\n
"
,
prs_meas
->
next_dl_toa
);
rc
=
pthread_mutex_unlock
(
&
prs_meas
->
dl_toa_mtx
);
AssertFatal
(
rc
==
0
,
"pthread_mutex_unlock() failed: errno %d, %s
\n
"
,
errno
,
strerror
(
errno
));
}
float
get_prs_max_dl_toa
(
prs_meas_t
*
prs_meas
)
{
float
max
=
0
.
0
f
;
int
rc
=
pthread_mutex_lock
(
&
prs_meas
->
dl_toa_mtx
);
AssertFatal
(
rc
==
0
,
"pthread_mutex_lock() failed: errno %d, %s
\n
"
,
errno
,
strerror
(
errno
));
for
(
int
i
=
0
;
i
<
sizeofArray
(
prs_meas
->
dl_toa
);
++
i
)
{
max
=
cmax
(
max
,
prs_meas
->
dl_toa
[
i
]);
LOG_I
(
NR_PHY
,
"i %d dl_toa %.3f max %.3f
\n
"
,
i
,
prs_meas
->
dl_toa
[
i
],
max
);
}
rc
=
pthread_mutex_unlock
(
&
prs_meas
->
dl_toa_mtx
);
AssertFatal
(
rc
==
0
,
"pthread_mutex_unlock() failed: errno %d, %s
\n
"
,
errno
,
strerror
(
errno
));
return
max
;
}
int
nr_prs_channel_estimation
(
uint8_t
gNB_id
,
...
...
openair1/PHY/defs_nr_common.h
View file @
d682b6c5
...
...
@@ -38,6 +38,8 @@
#include "impl_defs_nr.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include <pthread.h>
#define MAX_NUM_SUBCARRIER_SPACING 5
#define NR_MAX_OFDM_SYMBOL_SIZE 8192
...
...
@@ -312,6 +314,7 @@ typedef struct {
int32_t
sfn
;
int8_t
slot
;
int8_t
rxAnt_idx
;
pthread_mutex_t
dl_toa_mtx
;
// protect reading of max from write
// circular buffer to be able to read maximum of last estimations
float
dl_toa
[
128
];
// set through set_prs_dl_toa()
float
*
next_dl_toa
;
...
...
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