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
spbro
OpenXG-RAN
Commits
b101e682
Commit
b101e682
authored
May 16, 2024
by
Bartosz Podrygajlo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix several potential segfaults in UE PUCCH tx power determination.
parent
9fd1b9ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+22
-8
No files found.
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
b101e682
...
...
@@ -58,6 +58,9 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#define DEFAULT_P0_NOMINAL_PUCCH_0_DBM 0
#define DEFAULT_DELTA_F_PUCCH_0_DB 0
// #define DEBUG_MIB
// #define ENABLE_MAC_PAYLOAD_DEBUG 1
// #define DEBUG_RAR
...
...
@@ -1602,6 +1605,7 @@ int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
return
0
;
}
// PUCCH Power control according to 38.213 section 7.2.1
int16_t
get_pucch_tx_power_ue
(
NR_UE_MAC_INST_t
*
mac
,
int
scs
,
NR_PUCCH_Config_t
*
pucch_Config
,
...
...
@@ -1615,10 +1619,16 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
int
O_uci
)
{
NR_UE_UL_BWP_t
*
current_UL_BWP
=
mac
->
current_UL_BWP
;
AssertFatal
(
current_UL_BWP
&&
current_UL_BWP
->
pucch_ConfigCommon
,
"Missing configuration: need UL_BWP and pucch_ConfigCommon to calculate PUCCH tx power
\n
"
);
int
PUCCH_POWER_DEFAULT
=
0
;
int16_t
P_O_NOMINAL_PUCCH
=
*
current_UL_BWP
->
pucch_ConfigCommon
->
p0_nominal
;
// p0_nominal is optional
int16_t
P_O_NOMINAL_PUCCH
=
DEFAULT_P0_NOMINAL_PUCCH_0_DBM
;
if
(
current_UL_BWP
->
pucch_ConfigCommon
->
p0_nominal
!=
NULL
)
{
P_O_NOMINAL_PUCCH
=
*
current_UL_BWP
->
pucch_ConfigCommon
->
p0_nominal
;
}
struct
NR_PUCCH_PowerControl
*
power_config
=
pucch_Config
->
pucch_PowerControl
;
struct
NR_PUCCH_PowerControl
*
power_config
=
pucch_Config
?
pucch_Config
->
pucch_PowerControl
:
NULL
;
if
(
!
power_config
)
return
(
PUCCH_POWER_DEFAULT
);
...
...
@@ -1643,7 +1653,8 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
int
P_O_PUCCH
=
P_O_NOMINAL_PUCCH
+
P_O_UE_PUCCH
;
int16_t
delta_F_PUCCH
;
int16_t
delta_F_PUCCH
=
DEFAULT_DELTA_F_PUCCH_0_DB
;
long
*
delta_F_PUCCH_config
=
NULL
;
int
DELTA_TF
;
uint16_t
N_ref_PUCCH
;
int
N_sc_ctrl_RB
=
0
;
...
...
@@ -1653,27 +1664,27 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
case
0
:
N_ref_PUCCH
=
2
;
DELTA_TF
=
10
*
log10
(
N_ref_PUCCH
/
N_symb_PUCCH
);
delta_F_PUCCH
=
*
power_config
->
deltaF_PUCCH_f0
;
delta_F_PUCCH
_config
=
power_config
->
deltaF_PUCCH_f0
;
break
;
case
1
:
N_ref_PUCCH
=
14
;
DELTA_TF
=
10
*
log10
(
N_ref_PUCCH
/
N_symb_PUCCH
);
delta_F_PUCCH
=
*
power_config
->
deltaF_PUCCH_f1
;
delta_F_PUCCH
_config
=
power_config
->
deltaF_PUCCH_f1
;
break
;
case
2
:
N_sc_ctrl_RB
=
10
;
DELTA_TF
=
get_deltatf
(
nb_of_prbs
,
N_symb_PUCCH
,
freq_hop_flag
,
add_dmrs_flag
,
N_sc_ctrl_RB
,
O_uci
);
delta_F_PUCCH
=
*
power_config
->
deltaF_PUCCH_f2
;
delta_F_PUCCH
_config
=
power_config
->
deltaF_PUCCH_f2
;
break
;
case
3
:
N_sc_ctrl_RB
=
14
;
DELTA_TF
=
get_deltatf
(
nb_of_prbs
,
N_symb_PUCCH
,
freq_hop_flag
,
add_dmrs_flag
,
N_sc_ctrl_RB
,
O_uci
);
delta_F_PUCCH
=
*
power_config
->
deltaF_PUCCH_f3
;
delta_F_PUCCH
_config
=
power_config
->
deltaF_PUCCH_f3
;
break
;
case
4
:
N_sc_ctrl_RB
=
14
/
(
nb_pucch_format_4_in_subframes
[
subframe_number
]);
DELTA_TF
=
get_deltatf
(
nb_of_prbs
,
N_symb_PUCCH
,
freq_hop_flag
,
add_dmrs_flag
,
N_sc_ctrl_RB
,
O_uci
);
delta_F_PUCCH
=
*
power_config
->
deltaF_PUCCH_f4
;
delta_F_PUCCH
_config
=
power_config
->
deltaF_PUCCH_f4
;
break
;
default:
{
...
...
@@ -1681,6 +1692,9 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
return
(
0
);
}
}
if
(
delta_F_PUCCH_config
!=
NULL
)
{
delta_F_PUCCH
=
*
delta_F_PUCCH_config
;
}
if
(
power_config
->
twoPUCCH_PC_AdjustmentStates
&&
*
power_config
->
twoPUCCH_PC_AdjustmentStates
>
1
)
{
LOG_E
(
MAC
,
"PUCCH power control adjustment states with 2 states not yet implemented
\n
"
);
...
...
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