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
565fb883
Commit
565fb883
authored
Nov 04, 2021
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified set_tdd_config_nr_ue function
- reviewed redundant code - removed unnecessary return
parent
9d9bc0e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
52 deletions
+30
-52
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+27
-49
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+3
-3
No files found.
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
565fb883
...
...
@@ -38,15 +38,27 @@
#include "common/utils/nr/nr_common.h"
#include "executables/softmodem-common.h"
int
set_tdd_config_nr_ue
(
fapi_nr_config_request_t
*
cfg
,
void
set_tdd_config_nr_ue
(
fapi_nr_config_request_t
*
cfg
,
int
mu
,
int
nrofDownlinkSlots
,
int
nrofDownlinkSymbols
,
int
nrofUplinkSlots
,
int
nrofUplinkSymbols
)
{
NR_TDD_UL_DL_ConfigCommon_t
*
tdd_config
)
{
int
nrofDownlinkSlots
=
tdd_config
->
pattern1
.
nrofDownlinkSlots
;
int
nrofDownlinkSymbols
=
tdd_config
->
pattern1
.
nrofDownlinkSymbols
;
int
nrofUplinkSlots
=
tdd_config
->
pattern1
.
nrofUplinkSlots
;
int
nrofUplinkSymbols
=
tdd_config
->
pattern1
.
nrofUplinkSymbols
;
int
slot_number
=
0
;
int
nb_periods_per_frame
;
int
nb_slots_to_set
=
TDD_CONFIG_NB_FRAMES
*
(
1
<<
mu
)
*
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
if
(
tdd_config
->
pattern1
.
ext1
==
NULL
)
{
cfg
->
tdd_table
.
tdd_period
=
tdd_config
->
pattern1
.
dl_UL_TransmissionPeriodicity
;
}
else
{
AssertFatal
(
tdd_config
->
pattern1
.
ext1
->
dl_UL_TransmissionPeriodicity_v1530
!=
NULL
,
"tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null
\n
"
);
cfg
->
tdd_table
.
tdd_period
=
*
tdd_config
->
pattern1
.
ext1
->
dl_UL_TransmissionPeriodicity_v1530
;
}
LOG_I
(
NR_MAC
,
"Setting TDD configuration period to %d
\n
"
,
cfg
->
tdd_table
.
tdd_period
);
switch
(
cfg
->
tdd_table
.
tdd_period
)
{
case
0
:
nb_periods_per_frame
=
20
;
// 10ms/0p5ms
...
...
@@ -140,7 +152,8 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
}
}
return
(
0
);
LOG_I
(
NR_MAC
,
"TDD has been properly configurated
\n
"
);
}
...
...
@@ -228,28 +241,10 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
}
// TDD Table Configuration
if
(
cfg
->
cell_config
.
frame_duplex_type
==
TDD
){
if
(
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
ext1
==
NULL
)
{
cfg
->
tdd_table
.
tdd_period
=
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
dl_UL_TransmissionPeriodicity
;
}
else
{
AssertFatal
(
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
ext1
->
dl_UL_TransmissionPeriodicity_v1530
!=
NULL
,
"scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null
\n
"
);
cfg
->
tdd_table
.
tdd_period
=
*
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
ext1
->
dl_UL_TransmissionPeriodicity_v1530
;
}
LOG_I
(
MAC
,
"Setting TDD configuration period to %d
\n
"
,
cfg
->
tdd_table
.
tdd_period
);
int
return_tdd
=
set_tdd_config_nr_ue
(
cfg
,
if
(
cfg
->
cell_config
.
frame_duplex_type
==
TDD
){
set_tdd_config_nr_ue
(
cfg
,
scc
->
uplinkConfigCommon
->
frequencyInfoUL
.
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofDownlinkSlots
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofDownlinkSymbols
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSlots
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSymbols
);
if
(
return_tdd
!=
0
)
{
LOG_E
(
NR_PHY
,
"TDD configuration cannot be done
\n
"
);
}
else
{
LOG_I
(
NR_PHY
,
"TDD has been properly configurated
\n
"
);
}
scc
->
tdd_UL_DL_ConfigurationCommon
);
}
// PRACH configuration
...
...
@@ -412,27 +407,10 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
}
// TDD Table Configuration
if
(
cfg
->
cell_config
.
frame_duplex_type
==
TDD
){
if
(
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
ext1
==
NULL
)
{
cfg
->
tdd_table
.
tdd_period
=
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
dl_UL_TransmissionPeriodicity
;
}
else
{
AssertFatal
(
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
ext1
->
dl_UL_TransmissionPeriodicity_v1530
!=
NULL
,
"scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null
\n
"
);
cfg
->
tdd_table
.
tdd_period
=
*
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
ext1
->
dl_UL_TransmissionPeriodicity_v1530
;
}
LOG_I
(
MAC
,
"Setting TDD configuration period to %d
\n
"
,
cfg
->
tdd_table
.
tdd_period
);
int
return_tdd
=
set_tdd_config_nr_ue
(
cfg
,
if
(
cfg
->
cell_config
.
frame_duplex_type
==
TDD
){
set_tdd_config_nr_ue
(
cfg
,
scc
->
uplinkConfigCommon
->
frequencyInfoUL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofDownlinkSlots
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofDownlinkSymbols
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSlots
,
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSymbols
);
if
(
return_tdd
!=
0
)
{
LOG_E
(
NR_PHY
,
"TDD configuration can not be done
\n
"
);
}
else
{
LOG_I
(
NR_PHY
,
"TDD has been properly configurated
\n
"
);
}
scc
->
tdd_UL_DL_ConfigurationCommon
);
}
// PRACH configuration
...
...
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
565fb883
...
...
@@ -213,9 +213,9 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
uint8_t
*
ulsch_buffer
,
uint16_t
buflen
);
int
set_tdd_config_nr_ue
(
fapi_nr_config_request_t
*
cfg
,
int
mu
,
int
nrofDownlinkSlots
,
int
nrofDownlinkSymbols
,
int
nrofUplinkSlots
,
int
nrofUplinkSymbols
);
void
set_tdd_config_nr_ue
(
fapi_nr_config_request_t
*
cfg
,
int
mu
,
NR_TDD_UL_DL_ConfigCommon_t
*
tdd_config
);
void
set_harq_status
(
NR_UE_MAC_INST_t
*
mac
,
uint8_t
pucch_id
,
...
...
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