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
常顺宇
OpenXG-RAN
Commits
2411743f
Commit
2411743f
authored
Mar 05, 2021
by
Thomas Schlichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gNB: move get_band() to its only user in nr_init.c
parent
62612fee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
44 deletions
+42
-44
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+36
-4
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
+2
-38
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
+4
-2
No files found.
openair1/PHY/INIT/nr_init.c
View file @
2411743f
...
...
@@ -45,10 +45,42 @@
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
/*
extern uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn);
extern openair0_config_t openair0_cfg[MAX_CARDS];
*/
static
uint16_t
get_band
(
uint64_t
downlink_frequency
,
int32_t
delta_duplex
)
{
const
uint64_t
dl_freq_khz
=
downlink_frequency
/
1000
;
const
int32_t
delta_duplex_khz
=
delta_duplex
/
1000
;
uint64_t
center_freq_diff_khz
=
999999999999999999
;
// 2^64
uint16_t
current_band
=
0
;
for
(
int
ind
=
0
;
ind
<
nr_bandtable_size
;
ind
++
)
{
LOG_D
(
PHY
,
"Scanning band %d, dl_min %"
PRIu64
", ul_min %"
PRIu64
"
\n
"
,
nr_bandtable
[
ind
].
band
,
nr_bandtable
[
ind
].
dl_min
,
nr_bandtable
[
ind
].
ul_min
);
if
(
dl_freq_khz
<
nr_bandtable
[
ind
].
dl_min
||
dl_freq_khz
>
nr_bandtable
[
ind
].
dl_max
)
continue
;
int32_t
current_offset_khz
=
nr_bandtable
[
ind
].
ul_min
-
nr_bandtable
[
ind
].
dl_min
;
if
(
current_offset_khz
!=
delta_duplex_khz
)
continue
;
uint64_t
center_frequency_khz
=
(
nr_bandtable
[
ind
].
dl_max
+
nr_bandtable
[
ind
].
dl_min
)
/
2
;
if
(
abs
(
dl_freq_khz
-
center_frequency_khz
)
<
center_freq_diff_khz
){
current_band
=
nr_bandtable
[
ind
].
band
;
center_freq_diff_khz
=
abs
(
dl_freq_khz
-
center_frequency_khz
);
}
}
LOG_I
(
PHY
,
"DL frequency %"
PRIu64
": band %d, UL frequency %"
PRIu64
"
\n
"
,
downlink_frequency
,
current_band
,
downlink_frequency
+
delta_duplex
);
AssertFatal
(
current_band
!=
0
,
"Can't find EUTRA band for frequency %"
PRIu64
" and duplex_spacing %u
\n
"
,
downlink_frequency
,
delta_duplex
);
return
current_band
;
}
int
l1_north_init_gNB
()
{
...
...
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
View file @
2411743f
...
...
@@ -1649,6 +1649,8 @@ nr_bandentry_t nr_bandtable[] = {
{
261
,
27500040
,
28350000
,
27500040
,
28350000
,
2
,
2070833
,
120
}
};
#define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t))
const
size_t
nr_bandtable_size
=
NR_BANDTABLE_SIZE
;
// TS 38.211 Table 6.4.1.1.3-3: PUSCH DMRS positions l' within a slot for single-symbol DMRS and intra-slot frequency hopping disabled.
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
...
...
@@ -1690,44 +1692,6 @@ int32_t table_6_4_1_1_3_4_pusch_dmrs_positions_l [12][8] = {
{
1
,
1025
,
-
1
,
-
1
,
1
,
513
,
-
1
,
-
1
},
//14 // (DMRS l' position)
};
#define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t))
uint16_t
get_band
(
uint64_t
downlink_frequency
,
int32_t
delta_duplex
)
{
const
uint64_t
dl_freq_khz
=
downlink_frequency
/
1000
;
const
int32_t
delta_duplex_khz
=
delta_duplex
/
1000
;
uint64_t
center_freq_diff_khz
=
999999999999999999
;
// 2^64
uint16_t
current_band
=
0
;
for
(
int
ind
=
0
;
ind
<
NR_BANDTABLE_SIZE
;
ind
++
)
{
LOG_D
(
PHY
,
"Scanning band %d, dl_min %"
PRIu64
", ul_min %"
PRIu64
"
\n
"
,
nr_bandtable
[
ind
].
band
,
nr_bandtable
[
ind
].
dl_min
,
nr_bandtable
[
ind
].
ul_min
);
if
(
dl_freq_khz
<
nr_bandtable
[
ind
].
dl_min
||
dl_freq_khz
>
nr_bandtable
[
ind
].
dl_max
)
continue
;
int32_t
current_offset_khz
=
nr_bandtable
[
ind
].
ul_min
-
nr_bandtable
[
ind
].
dl_min
;
if
(
current_offset_khz
!=
delta_duplex_khz
)
continue
;
uint64_t
center_frequency_khz
=
(
nr_bandtable
[
ind
].
dl_max
+
nr_bandtable
[
ind
].
dl_min
)
/
2
;
if
(
abs
(
dl_freq_khz
-
center_frequency_khz
)
<
center_freq_diff_khz
){
current_band
=
nr_bandtable
[
ind
].
band
;
center_freq_diff_khz
=
abs
(
dl_freq_khz
-
center_frequency_khz
);
}
}
LOG_I
(
PHY
,
"DL frequency %"
PRIu64
": band %d, UL frequency %"
PRIu64
"
\n
"
,
downlink_frequency
,
current_band
,
downlink_frequency
+
delta_duplex
);
AssertFatal
(
current_band
!=
0
,
"Can't find EUTRA band for frequency %"
PRIu64
" and duplex_spacing %u
\n
"
,
downlink_frequency
,
delta_duplex
);
return
current_band
;
}
// Returns the corresponding row index of the NR table
int
get_nr_table_idx
(
int
nr_bandP
,
uint8_t
scs_index
)
{
...
...
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
View file @
2411743f
...
...
@@ -36,10 +36,12 @@
#include "NR_CellGroupConfig.h"
#include "nr_mac.h"
#include "openair1/PHY/impl_defs_nr.h"
#include "openair1/PHY/defs_nr_common.h"
uint16_t
config_bandwidth
(
int
mu
,
int
nb_rb
,
int
nr_band
);
extern
const
size_t
nr_bandtable_size
;
extern
nr_bandentry_t
nr_bandtable
[];
uint16_t
get_band
(
uint64_t
downlink_frequency
,
int32_t
delta_duplex
);
uint16_t
config_bandwidth
(
int
mu
,
int
nb_rb
,
int
nr_band
);
lte_frame_type_t
get_frame_type
(
uint16_t
nr_bandP
,
uint8_t
scs_index
);
...
...
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