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
7db4732c
Commit
7db4732c
authored
Jun 04, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/N2_HO_Measurement_config' into integration_2024_w22
parents
9465ae77
c51b2a64
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1181 additions
and
82 deletions
+1181
-82
ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf
...ipts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf
+321
-0
ci-scripts/conf_files/neighbour-config.conf
ci-scripts/conf_files/neighbour-config.conf
+76
-0
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+154
-1
openair2/GNB_APP/gnb_paramdef.h
openair2/GNB_APP/gnb_paramdef.h
+86
-1
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+201
-50
openair2/RRC/NR/MESSAGES/asn1_msg.h
openair2/RRC/NR/MESSAGES/asn1_msg.h
+7
-2
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+43
-0
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+187
-28
openair2/RRC/NR/rrc_gNB_du.c
openair2/RRC/NR/rrc_gNB_du.c
+100
-0
openair2/RRC/NR/rrc_gNB_du.h
openair2/RRC/NR/rrc_gNB_du.h
+6
-0
No files found.
ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf
0 → 100644
View file @
7db4732c
This diff is collapsed.
Click to expand it.
ci-scripts/conf_files/neighbour-config.conf
0 → 100644
View file @
7db4732c
neighbour_list
= (
{
nr_cellid
=
1
;
neighbour_cell_configuration
= (
{
gNB_ID
=
0
xb00
;
nr_cellid
=
2
;
physical_cellId
=
0
x002
;
absoluteFrequencySSB
=
641280
;
subcarrierSpacing
=
1
;
#30 KHz
plmn
= {
mcc
=
216
;
mnc
=
03
;
mnc_length
=
2
};
tracking_area_code
=
2
;
},
{
gNB_ID
=
0
xa00
;
nr_cellid
=
3
;
physical_cellId
=
0
x003
;
absoluteFrequencySSB
=
641280
;
subcarrierSpacing
=
1
;
#30 KHz
plmn
= {
mcc
=
999
;
mnc
=
99
;
mnc_length
=
2
};
tracking_area_code
=
3
;
},
{
gNB_ID
=
0
xc00
;
nr_cellid
=
4
;
physical_cellId
=
0
x004
;
absoluteFrequencySSB
=
641280
;
subcarrierSpacing
=
1
;
#30 KHz
plmn
= {
mcc
=
999
;
mnc
=
99
;
mnc_length
=
2
};
tracking_area_code
=
4
;
}
)
},
{
nr_cellid
=
2
;
neighbour_cell_configuration
= (
{
gNB_ID
=
0
xe00
;
nr_cellid
=
1
;
physical_cellId
=
0
x000
;
absoluteFrequencySSB
=
641280
;
subcarrierSpacing
=
1
;
#30 KHz
plmn
= {
mcc
=
001
;
mnc
=
01
;
mnc_length
=
2
};
tracking_area_code
=
1
;
}
)
}
);
nr_measurement_configuration
= {
Periodical
= {
enable
=
1
;
includeBeamMeasurements
=
1
;
maxNrofRS_IndexesToReport
=
4
;
};
A2
= {
enable
=
1
;
threshold
=
60
;
timeToTrigger
=
1
;
};
A3
= ({
cell_id
= -
1
;
#Default
offset
=
10
;
hysteresis
=
0
;
timeToTrigger
=
1
}, {
cell_id
=
2
;
offset
=
5
;
hysteresis
=
1
;
timeToTrigger
=
2
})
};
openair2/GNB_APP/gnb_config.c
View file @
7db4732c
...
...
@@ -85,6 +85,7 @@
#include "NR_EUTRA-MBSFN-SubframeConfig.h"
#include "uper_decoder.h"
#include "uper_encoder.h"
#include "common/utils/ds/seq_arr.h"
#include "RRC/NR/MESSAGES/asn1_msg.h"
#include "RRC/NR/nr_rrc_extern.h"
...
...
@@ -1515,6 +1516,155 @@ void config_security(gNB_RRC_INST *rrc)
}
}
static
int
sort_neighbour_cell_config_by_cell_id
(
const
void
*
a
,
const
void
*
b
)
{
const
neighbour_cell_configuration_t
*
config_a
=
(
const
neighbour_cell_configuration_t
*
)
a
;
const
neighbour_cell_configuration_t
*
config_b
=
(
const
neighbour_cell_configuration_t
*
)
b
;
if
(
config_a
->
nr_cell_id
<
config_b
->
nr_cell_id
)
{
return
-
1
;
}
else
if
(
config_a
->
nr_cell_id
>
config_b
->
nr_cell_id
)
{
return
1
;
}
return
0
;
}
static
void
fill_neighbour_cell_configuration
(
uint8_t
gnb_idx
,
gNB_RRC_INST
*
rrc
)
{
char
gnbpath
[
MAX_OPTNAME_SIZE
+
8
];
sprintf
(
gnbpath
,
"%s.[%i]"
,
GNB_CONFIG_STRING_GNB_LIST
,
gnb_idx
);
paramdef_t
neighbour_list_params
[]
=
GNB_NEIGHBOUR_LIST_PARAM_LIST
;
paramlist_def_t
neighbour_list_param_list
=
{
GNB_CONFIG_STRING_NEIGHBOUR_LIST
,
NULL
,
0
};
config_getlist
(
config_get_if
(),
&
neighbour_list_param_list
,
neighbour_list_params
,
sizeofArray
(
neighbour_list_params
),
gnbpath
);
if
(
neighbour_list_param_list
.
numelt
<
1
)
return
;
rrc
->
neighbour_cell_configuration
=
malloc
(
sizeof
(
seq_arr_t
));
seq_arr_init
(
rrc
->
neighbour_cell_configuration
,
sizeof
(
neighbour_cell_configuration_t
));
for
(
int
elm
=
0
;
elm
<
neighbour_list_param_list
.
numelt
;
++
elm
)
{
neighbour_cell_configuration_t
*
cell
=
calloc
(
1
,
sizeof
(
neighbour_cell_configuration_t
));
AssertFatal
(
cell
!=
NULL
,
"out of memory
\n
"
);
cell
->
nr_cell_id
=
(
uint64_t
)
*
neighbour_list_param_list
.
paramarray
[
elm
][
0
].
u64ptr
;
char
neighbourpath
[
MAX_OPTNAME_SIZE
+
8
];
sprintf
(
neighbourpath
,
"%s.[%i].%s.[%i]"
,
GNB_CONFIG_STRING_GNB_LIST
,
gnb_idx
,
GNB_CONFIG_STRING_NEIGHBOUR_LIST
,
elm
);
paramdef_t
NeighbourCellParams
[]
=
GNBNEIGHBOURCELLPARAMS_DESC
;
paramlist_def_t
NeighbourCellParamList
=
{
GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST
,
NULL
,
0
};
config_getlist
(
config_get_if
(),
&
NeighbourCellParamList
,
NeighbourCellParams
,
sizeofArray
(
NeighbourCellParams
),
neighbourpath
);
LOG_D
(
GNB_APP
,
"HO LOG: For the Cell: %d Neighbour Cell ELM NUM: %d
\n
"
,
cell
->
nr_cell_id
,
NeighbourCellParamList
.
numelt
);
if
(
NeighbourCellParamList
.
numelt
<
1
)
continue
;
cell
->
neighbour_cells
=
malloc
(
sizeof
(
seq_arr_t
));
AssertFatal
(
cell
->
neighbour_cells
!=
NULL
,
"Memory exhausted!!!"
);
seq_arr_init
(
cell
->
neighbour_cells
,
sizeof
(
nr_neighbour_gnb_configuration_t
));
for
(
int
l
=
0
;
l
<
NeighbourCellParamList
.
numelt
;
++
l
)
{
nr_neighbour_gnb_configuration_t
*
neighbourCell
=
calloc
(
1
,
sizeof
(
nr_neighbour_gnb_configuration_t
));
AssertFatal
(
neighbourCell
!=
NULL
,
"out of memory
\n
"
);
neighbourCell
->
gNB_ID
=
*
(
NeighbourCellParamList
.
paramarray
[
l
][
GNB_CONFIG_N_CELL_GNB_ID_IDX
].
uptr
);
neighbourCell
->
nrcell_id
=
(
uint64_t
)
*
(
NeighbourCellParamList
.
paramarray
[
l
][
GNB_CONFIG_N_CELL_NR_CELLID_IDX
].
u64ptr
);
neighbourCell
->
physicalCellId
=
*
NeighbourCellParamList
.
paramarray
[
l
][
GNB_CONFIG_N_CELL_PHYSICAL_ID_IDX
].
uptr
;
neighbourCell
->
subcarrierSpacing
=
*
NeighbourCellParamList
.
paramarray
[
l
][
GNB_CONFIG_N_CELL_SCS_IDX
].
uptr
;
neighbourCell
->
absoluteFrequencySSB
=
*
NeighbourCellParamList
.
paramarray
[
l
][
GNB_CONFIG_N_CELL_ABS_FREQ_SSB_IDX
].
i64ptr
;
neighbourCell
->
tac
=
*
NeighbourCellParamList
.
paramarray
[
l
][
GNB_CONFIG_N_CELL_TAC_IDX
].
uptr
;
char
neighbour_plmn_path
[
CONFIG_MAXOPTLENGTH
];
sprintf
(
neighbour_plmn_path
,
"%s.%s.[%i].%s"
,
neighbourpath
,
GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST
,
l
,
GNB_CONFIG_STRING_NEIGHBOUR_PLMN
);
paramdef_t
NeighbourPlmn
[]
=
GNBPLMNPARAMS_DESC
;
config_get
(
config_get_if
(),
NeighbourPlmn
,
sizeofArray
(
NeighbourPlmn
),
neighbour_plmn_path
);
neighbourCell
->
plmn
.
mcc
=
*
NeighbourPlmn
[
GNB_MOBILE_COUNTRY_CODE_IDX
].
uptr
;
neighbourCell
->
plmn
.
mnc
=
*
NeighbourPlmn
[
GNB_MOBILE_NETWORK_CODE_IDX
].
uptr
;
neighbourCell
->
plmn
.
mnc_digit_length
=
*
NeighbourPlmn
[
GNB_MNC_DIGIT_LENGTH
].
uptr
;
seq_arr_push_back
(
cell
->
neighbour_cells
,
neighbourCell
,
sizeof
(
nr_neighbour_gnb_configuration_t
));
}
seq_arr_push_back
(
rrc
->
neighbour_cell_configuration
,
cell
,
sizeof
(
neighbour_cell_configuration_t
));
}
void
*
base
=
seq_arr_front
(
rrc
->
neighbour_cell_configuration
);
size_t
nmemb
=
seq_arr_size
(
rrc
->
neighbour_cell_configuration
);
size_t
element_size
=
sizeof
(
neighbour_cell_configuration_t
);
qsort
(
base
,
nmemb
,
element_size
,
sort_neighbour_cell_config_by_cell_id
);
}
static
void
fill_measurement_configuration
(
uint8_t
gnb_idx
,
gNB_RRC_INST
*
rrc
)
{
char
measurement_path
[
MAX_OPTNAME_SIZE
+
8
];
sprintf
(
measurement_path
,
"%s.[%i].%s"
,
GNB_CONFIG_STRING_GNB_LIST
,
gnb_idx
,
GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION
);
nr_measurement_configuration_t
*
measurementConfig
=
&
rrc
->
measurementConfiguration
;
// Periodical Event Configuration
char
periodic_event_path
[
MAX_OPTNAME_SIZE
+
8
];
sprintf
(
periodic_event_path
,
"%s.[%i].%s.%s"
,
GNB_CONFIG_STRING_GNB_LIST
,
gnb_idx
,
GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION
,
MEASUREMENT_EVENTS_PERIODICAL
);
paramdef_t
Periodical_EventParams
[]
=
MEASUREMENT_PERIODICAL_GLOBALPARAMS_DESC
;
config_get
(
config_get_if
(),
Periodical_EventParams
,
sizeofArray
(
Periodical_EventParams
),
periodic_event_path
);
if
(
*
Periodical_EventParams
[
MEASUREMENT_EVENTS_ENABLE_IDX
].
i64ptr
)
{
nr_per_event_t
*
periodic_event
=
(
nr_per_event_t
*
)
calloc
(
1
,
sizeof
(
nr_per_event_t
));
periodic_event
->
includeBeamMeasurements
=
*
Periodical_EventParams
[
MEASUREMENT_EVENTS_INCLUDE_BEAM_MEAS_IDX
].
i64ptr
;
periodic_event
->
maxReportCells
=
*
Periodical_EventParams
[
MEASUREMENT_EVENTS_MAX_RS_INDEX_TO_REPORT
].
i64ptr
;
measurementConfig
->
per_event
=
periodic_event
;
}
// A2 Event Configuration
char
a2_path
[
MAX_OPTNAME_SIZE
+
8
];
sprintf
(
a2_path
,
"%s.[%i].%s.%s"
,
GNB_CONFIG_STRING_GNB_LIST
,
gnb_idx
,
GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION
,
MEASUREMENT_EVENTS_A2
);
paramdef_t
A2_EventParams
[]
=
MEASUREMENT_A2_GLOBALPARAMS_DESC
;
config_get
(
config_get_if
(),
A2_EventParams
,
sizeofArray
(
A2_EventParams
),
a2_path
);
if
(
*
A2_EventParams
[
MEASUREMENT_EVENTS_ENABLE_IDX
].
i64ptr
)
{
nr_a2_event_t
*
a2_event
=
(
nr_a2_event_t
*
)
calloc
(
1
,
sizeof
(
nr_a2_event_t
));
a2_event
->
threshold_RSRP
=
*
A2_EventParams
[
MEASUREMENT_EVENTS_A2_THRESHOLD_IDX
].
i64ptr
;
a2_event
->
timeToTrigger
=
*
A2_EventParams
[
MEASUREMENT_EVENTS_TIMETOTRIGGER_IDX
].
i64ptr
;
measurementConfig
->
a2_event
=
a2_event
;
}
// A3 Event Configuration
paramlist_def_t
A3_EventList
=
{
MEASUREMENT_EVENTS_A3
,
NULL
,
0
};
paramdef_t
A3_EventParams
[]
=
MEASUREMENT_A3_GLOBALPARAMS_DESC
;
config_getlist
(
config_get_if
(),
&
A3_EventList
,
A3_EventParams
,
sizeofArray
(
A3_EventParams
),
measurement_path
);
LOG_D
(
GNB_APP
,
"HO LOG: A3 Configuration Exists: %d
\n
"
,
A3_EventList
.
numelt
);
if
(
A3_EventList
.
numelt
<
1
)
return
;
measurementConfig
->
a3_event_list
=
malloc
(
sizeof
(
seq_arr_t
));
seq_arr_init
(
measurementConfig
->
a3_event_list
,
sizeof
(
nr_a3_event_t
));
for
(
int
i
=
0
;
i
<
A3_EventList
.
numelt
;
i
++
)
{
nr_a3_event_t
*
a3_event
=
(
nr_a3_event_t
*
)
calloc
(
1
,
sizeof
(
nr_a3_event_t
));
AssertFatal
(
a3_event
!=
NULL
,
"out of memory
\n
"
);
a3_event
->
cell_id
=
*
A3_EventList
.
paramarray
[
i
][
MEASUREMENT_EVENTS_CELL_ID_IDX
].
i64ptr
;
a3_event
->
timeToTrigger
=
*
A3_EventList
.
paramarray
[
i
][
MEASUREMENT_EVENTS_TIMETOTRIGGER_IDX
].
i64ptr
;
a3_event
->
a3_offset
=
*
A3_EventList
.
paramarray
[
i
][
MEASUREMENT_EVENTS_OFFSET_IDX
].
i64ptr
;
a3_event
->
hysteresis
=
*
A3_EventList
.
paramarray
[
i
][
MEASUREMENT_EVENTS_HYSTERESIS_IDX
].
i64ptr
;
if
(
a3_event
->
cell_id
==
-
1
)
measurementConfig
->
is_default_a3_configuration_exists
=
true
;
seq_arr_push_back
(
measurementConfig
->
a3_event_list
,
a3_event
,
sizeof
(
nr_a3_event_t
));
}
}
void
RCconfig_NRRRC
(
gNB_RRC_INST
*
rrc
)
{
...
...
@@ -1604,7 +1754,10 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc)
char
gnbpath
[
MAX_OPTNAME_SIZE
+
8
];
sprintf
(
gnbpath
,
"%s.[%i]"
,
GNB_CONFIG_STRING_GNB_LIST
,
k
);
fill_neighbour_cell_configuration
(
k
,
rrc
);
fill_measurement_configuration
(
k
,
rrc
);
paramdef_t
PLMNParams
[]
=
GNBPLMNPARAMS_DESC
;
paramlist_def_t
PLMNParamList
=
{
GNB_CONFIG_STRING_PLMN_LIST
,
NULL
,
0
};
...
...
openair2/GNB_APP/gnb_paramdef.h
View file @
7db4732c
...
...
@@ -254,7 +254,92 @@ typedef enum {
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Neighbour Cell Configurations*/
#define GNB_CONFIG_STRING_NEIGHBOUR_LIST "neighbour_list"
// clang-format off
#define GNB_NEIGHBOUR_LIST_PARAM_LIST { \
/* optname helpstr paramflags XXXptr def val type numelt */
\
{GNB_CONFIG_STRING_NRCELLID, "cell nrCell Id which has neighbours", PARAMFLAG_MANDATORY, .u64ptr=NULL, .defint64val=0, TYPE_UINT64, 0}, \
{GNB_CONFIG_STRING_NEIGHBOUR_CELL_PHYSICAL_ID, "neighbour cell physical id", PARAMFLAG_MANDATORY, .uptr=NULL, .defuintval=0, TYPE_UINT, 0}, \
}
// clang-format on
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST "neighbour_cell_configuration"
#define GNB_CONFIG_STRING_NEIGHBOUR_GNB_ID "gNB_ID"
#define GNB_CONFIG_STRING_NEIGHBOUR_NR_CELLID "nr_cellid"
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_PHYSICAL_ID "physical_cellId"
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_ABS_FREQ_SSB "absoluteFrequencySSB"
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_SCS "subcarrierSpacing"
#define GNB_CONFIG_STRING_NEIGHBOUR_TRACKING_ARE_CODE "tracking_area_code"
#define GNB_CONFIG_STRING_NEIGHBOUR_PLMN "plmn"
#define GNB_CONFIG_N_CELL_GNB_ID_IDX 0
#define GNB_CONFIG_N_CELL_NR_CELLID_IDX 1
#define GNB_CONFIG_N_CELL_PHYSICAL_ID_IDX 2
#define GNB_CONFIG_N_CELL_ABS_FREQ_SSB_IDX 3
#define GNB_CONFIG_N_CELL_SCS_IDX 4
#define GNB_CONFIG_N_CELL_TAC_IDX 5
// clang-format off
#define GNBNEIGHBOURCELLPARAMS_DESC { \
/* optname helpstr paramflags XXXptr def val type numelt */
\
{GNB_CONFIG_STRING_GNB_ID, "neighbour cell's gNB ID", PARAMFLAG_MANDATORY, .uptr=NULL, .defintval=0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_NRCELLID, "neighbour cell nrCell Id", PARAMFLAG_MANDATORY, .u64ptr=NULL, .defint64val=0, TYPE_UINT64, 0}, \
{GNB_CONFIG_STRING_NEIGHBOUR_CELL_PHYSICAL_ID, "neighbour cell physical id", PARAMFLAG_MANDATORY, .uptr=NULL, .defuintval=0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_NEIGHBOUR_CELL_ABS_FREQ_SSB, "neighbour cell abs freq ssb", PARAMFLAG_MANDATORY, .i64ptr=NULL, .defint64val=0, TYPE_INT64, 0}, \
{GNB_CONFIG_STRING_NEIGHBOUR_CELL_SCS, "neighbour cell scs", PARAMFLAG_MANDATORY, .uptr=NULL, .defuintval=0, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_NEIGHBOUR_TRACKING_ARE_CODE, "neighbour cell tracking area", PARAMFLAG_MANDATORY, .uptr=NULL, .defuintval=0, TYPE_UINT, 0}, \
}
// clang-format on
/* New Measurement Configurations*/
#define GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION "nr_measurement_configuration"
#define MEASUREMENT_EVENTS_PERIODICAL "Periodical"
#define MEASUREMENT_EVENTS_A2 "A2"
#define MEASUREMENT_EVENTS_A3 "A3"
#define MEASUREMENT_EVENTS_OFFSET "offset"
#define MEASUREMENT_EVENTS_HYSTERESIS "hysteresis"
#define MEASUREMENT_EVENTS_TIME_TO_TRIGGER "time_to_trigger"
#define MEASUREMENT_EVENTS_THRESHOLD "threshold"
#define MEASUREMENT_EVENTS_PERIODICAL_BEAM_MEASUREMENT "includeBeamMeasurements"
#define MEASUREMENT_EVENTS_PERIODICAL_NR_OF_RS_INDEXES "maxNrofRS_IndexesToReport"
#define MEASUREMENT_EVENTS_CELL_ID "cell_id"
#define MEASUREMENT_EVENT_ENABLE "enable"
// clang-format off
#define MEASUREMENT_A3_GLOBALPARAMS_DESC \
{ \
{MEASUREMENT_EVENTS_CELL_ID, "neighbour cellId for A3Report", 0, .i64ptr = NULL, .defint64val = -1, TYPE_INT64, 0}, \
{MEASUREMENT_EVENTS_TIME_TO_TRIGGER, "a3 time to trigger", 0, .i64ptr = NULL, .defint64val = 1, TYPE_INT64, 0}, \
{MEASUREMENT_EVENTS_OFFSET, "a3 offset", 0, .i64ptr = NULL, .defint64val = 60, TYPE_INT64, 0}, \
{MEASUREMENT_EVENTS_HYSTERESIS, "a3 hysteresis", 0, .i64ptr = NULL, .defint64val = 0, TYPE_INT64, 0}, \
}
#define MEASUREMENT_A2_GLOBALPARAMS_DESC \
{ \
{MEASUREMENT_EVENT_ENABLE, "enable the event", 0, .i64ptr = NULL, .defint64val = 1, TYPE_INT64, 0}, \
{MEASUREMENT_EVENTS_TIME_TO_TRIGGER, "a2 time to trigger", 0, .i64ptr = NULL, .defint64val = 1, TYPE_INT64, 0}, \
{MEASUREMENT_EVENTS_THRESHOLD, "a2 threshold", 0, .i64ptr = NULL, .defint64val = 60, TYPE_INT64, 0}, \
}
#define MEASUREMENT_PERIODICAL_GLOBALPARAMS_DESC \
{ \
{MEASUREMENT_EVENT_ENABLE, "enable the event", 0, .i64ptr = NULL, .defint64val = 1, TYPE_INT64, 0}, \
{MEASUREMENT_EVENTS_PERIODICAL_BEAM_MEASUREMENT, "includeBeamMeasurements", PARAMFLAG_BOOL, .i64ptr = NULL, .defint64val = 1, TYPE_INT64, 0}, \
{MEASUREMENT_EVENTS_PERIODICAL_NR_OF_RS_INDEXES, "maxNrofRS_IndexesToReport", 0, .i64ptr = NULL, .defint64val = 4, TYPE_INT64, 0}, \
}
// clang-format on
#define MEASUREMENT_EVENTS_CELL_ID_IDX 0
#define MEASUREMENT_EVENTS_ENABLE_IDX 0
#define MEASUREMENT_EVENTS_TIMETOTRIGGER_IDX 1
#define MEASUREMENT_EVENTS_A2_THRESHOLD_IDX 2
#define MEASUREMENT_EVENTS_OFFSET_IDX 2
#define MEASUREMENT_EVENTS_HYSTERESIS_IDX 3
#define MEASUREMENT_EVENTS_INCLUDE_BEAM_MEAS_IDX 1
#define MEASUREMENT_EVENTS_MAX_RS_INDEX_TO_REPORT 2
/* PLMN ID configuration */
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
7db4732c
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/MESSAGES/asn1_msg.h
View file @
7db4732c
...
...
@@ -143,8 +143,13 @@ int do_RRCReestablishment(rrc_gNB_ue_context_t *const ue_context_pP,
int
do_RRCReestablishmentComplete
(
uint8_t
*
buffer
,
size_t
buffer_size
,
int64_t
rrc_TransactionIdentifier
);
NR_MeasConfig_t
*
get_defaultMeasConfig
(
const
NR_MeasTiming_t
*
mt
,
int
band
,
int
scs
);
void
free_defaultMeasConfig
(
NR_MeasConfig_t
*
mc
);
const
nr_a3_event_t
*
get_a3_configuration
(
int
nr_cellid
);
NR_MeasConfig_t
*
get_MeasConfig
(
const
NR_MeasTiming_t
*
mt
,
int
band
,
int
scs
,
const
nr_measurement_configuration_t
*
const
measurementConfiguration
,
const
seq_arr_t
*
const
neighbourConfiguration
);
void
free_MeasConfig
(
NR_MeasConfig_t
*
mc
);
int
do_NR_Paging
(
uint8_t
Mod_id
,
uint8_t
*
buffer
,
uint32_t
tmsi
);
#endif
/* __RRC_NR_MESSAGES_ASN1_MSG__H__ */
openair2/RRC/NR/nr_rrc_defs.h
View file @
7db4732c
...
...
@@ -37,6 +37,7 @@
#include "collection/tree.h"
#include "collection/linear_alloc.h"
#include "common/utils/ds/seq_arr.h"
#include "nr_rrc_common.h"
#include "ds/byte_array.h"
...
...
@@ -359,6 +360,46 @@ typedef struct {
int
do_drb_integrity
;
}
nr_security_configuration_t
;
typedef
struct
{
long
maxReportCells
;
bool
includeBeamMeasurements
;
}
nr_per_event_t
;
typedef
struct
{
long
threshold_RSRP
;
long
timeToTrigger
;
}
nr_a2_event_t
;
typedef
struct
{
int
cell_id
;
long
a3_offset
;
long
hysteresis
;
long
timeToTrigger
;
}
nr_a3_event_t
;
typedef
struct
{
nr_per_event_t
*
per_event
;
nr_a2_event_t
*
a2_event
;
seq_arr_t
*
a3_event_list
;
bool
is_default_a3_configuration_exists
;
}
nr_measurement_configuration_t
;
typedef
struct
{
uint32_t
gNB_ID
;
uint64_t
nrcell_id
;
int
physicalCellId
;
int
absoluteFrequencySSB
;
int
subcarrierSpacing
;
plmn_identity_t
plmn
;
uint32_t
tac
;
bool
isIntraFrequencyNeighbour
;
}
nr_neighbour_gnb_configuration_t
;
typedef
struct
neighbour_cell_configuration_s
{
int
nr_cell_id
;
seq_arr_t
*
neighbour_cells
;
}
neighbour_cell_configuration_t
;
typedef
struct
nr_mac_rrc_dl_if_s
{
f1_setup_response_func_t
f1_setup_response
;
f1_setup_failure_func_t
f1_setup_failure
;
...
...
@@ -423,6 +464,8 @@ typedef struct gNB_RRC_INST_s {
nr_mac_rrc_dl_if_t
mac_rrc
;
cucp_cuup_if_t
cucp_cuup
;
seq_arr_t
*
neighbour_cell_configuration
;
nr_measurement_configuration_t
measurementConfiguration
;
RB_HEAD
(
rrc_du_tree
,
nr_rrc_du_container_t
)
dus
;
// DUs, indexed by assoc_id
size_t
num_dus
;
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
7db4732c
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/rrc_gNB_du.c
View file @
7db4732c
...
...
@@ -27,7 +27,26 @@
#include "openair2/F1AP/f1ap_common.h"
#include "openair2/F1AP/f1ap_ids.h"
#include "executables/softmodem-common.h"
#include "common/utils/ds/seq_arr.h"
#include "common/utils/alg/foreach.h"
int
get_dl_band
(
const
struct
f1ap_served_cell_info_t
*
cell_info
)
{
return
cell_info
->
mode
==
F1AP_MODE_TDD
?
cell_info
->
tdd
.
freqinfo
.
band
:
cell_info
->
fdd
.
dl_freqinfo
.
band
;
}
int
get_ssb_scs
(
const
struct
f1ap_served_cell_info_t
*
cell_info
)
{
return
cell_info
->
mode
==
F1AP_MODE_TDD
?
cell_info
->
tdd
.
tbw
.
scs
:
cell_info
->
fdd
.
dl_tbw
.
scs
;
}
int
get_ssb_arfcn
(
const
struct
nr_rrc_du_container_t
*
du
)
{
DevAssert
(
du
!=
NULL
&&
du
->
mtc
!=
NULL
);
/* format has been verified when accepting MeasurementTimingConfiguration */
NR_MeasTimingList_t
*
mtlist
=
du
->
mtc
->
criticalExtensions
.
choice
.
c1
->
choice
.
measTimingConf
->
measTiming
;
return
mtlist
->
list
.
array
[
0
]
->
frequencyAndTiming
->
carrierFreq
;
}
static
int
du_compare
(
const
nr_rrc_du_container_t
*
a
,
const
nr_rrc_du_container_t
*
b
)
{
...
...
@@ -104,6 +123,80 @@ static NR_MeasurementTimingConfiguration_t *extract_mtc(uint8_t *buf, int buf_le
return
mtc
;
}
static
int
nr_cell_id_match
(
const
void
*
key
,
const
void
*
element
)
{
const
int
*
key_id
=
(
const
int
*
)
key
;
const
neighbour_cell_configuration_t
*
config_element
=
(
const
neighbour_cell_configuration_t
*
)
element
;
if
(
*
key_id
<
config_element
->
nr_cell_id
)
{
return
-
1
;
}
else
if
(
*
key_id
==
config_element
->
nr_cell_id
)
{
return
0
;
}
return
1
;
}
static
neighbour_cell_configuration_t
*
get_cell_neighbour_list
(
const
gNB_RRC_INST
*
rrc
,
const
f1ap_served_cell_info_t
*
cell_info
)
{
void
*
base
=
seq_arr_front
(
rrc
->
neighbour_cell_configuration
);
size_t
nmemb
=
seq_arr_size
(
rrc
->
neighbour_cell_configuration
);
size_t
size
=
sizeof
(
neighbour_cell_configuration_t
);
void
*
it
=
bsearch
((
void
*
)
&
cell_info
->
nr_cellid
,
base
,
nmemb
,
size
,
nr_cell_id_match
);
return
(
neighbour_cell_configuration_t
*
)
it
;
}
const
struct
f1ap_served_cell_info_t
*
get_cell_information_by_phycellId
(
int
phyCellId
)
{
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
0
];
nr_rrc_du_container_t
*
it
=
NULL
;
RB_FOREACH
(
it
,
rrc_du_tree
,
&
rrc
->
dus
)
{
for
(
int
cellIdx
=
0
;
cellIdx
<
it
->
setup_req
->
num_cells_available
;
cellIdx
++
)
{
const
f1ap_served_cell_info_t
*
cell_info
=
&
(
it
->
setup_req
->
cell
[
cellIdx
].
info
);
if
(
cell_info
->
nr_pci
==
phyCellId
)
{
LOG_D
(
NR_RRC
,
"HO LOG: Found cell with phyCellId %d
\n
"
,
phyCellId
);
return
cell_info
;
}
}
}
return
NULL
;
}
static
void
is_intra_frequency_neighbour
(
void
*
ssb_arfcn
,
void
*
neighbour_cell
)
{
uint32_t
*
ssb_arfcn_ptr
=
(
uint32_t
*
)
ssb_arfcn
;
nr_neighbour_gnb_configuration_t
*
neighbour_cell_ptr
=
(
nr_neighbour_gnb_configuration_t
*
)
neighbour_cell
;
if
(
*
ssb_arfcn_ptr
==
neighbour_cell_ptr
->
absoluteFrequencySSB
)
{
LOG_D
(
NR_RRC
,
"HO LOG: found intra frequency neighbour %lu!
\n
"
,
neighbour_cell_ptr
->
nrcell_id
);
neighbour_cell_ptr
->
isIntraFrequencyNeighbour
=
true
;
}
}
/**
* @brief Labels neighbour cells if they are intra frequency to prepare meas config only for intra frequency ho
* @param[in] rrc Pointer to RRC instance
* @param[in] cell_info Pointer to cell information
*/
static
void
label_intra_frequency_neighbours
(
gNB_RRC_INST
*
rrc
,
const
nr_rrc_du_container_t
*
du
,
const
f1ap_served_cell_info_t
*
cell_info
)
{
if
(
!
rrc
->
neighbour_cell_configuration
)
return
;
neighbour_cell_configuration_t
*
neighbour_cell_config
=
get_cell_neighbour_list
(
rrc
,
cell_info
);
if
(
!
neighbour_cell_config
)
return
;
LOG_D
(
NR_RRC
,
"HO LOG: Cell: %lu has neighbour cell configuration!
\n
"
,
cell_info
->
nr_cellid
);
uint32_t
ssb_arfcn
=
get_ssb_arfcn
(
du
);
seq_arr_t
*
cell_neighbour_list
=
neighbour_cell_config
->
neighbour_cells
;
for_each
(
cell_neighbour_list
,
(
void
*
)
&
ssb_arfcn
,
is_intra_frequency_neighbour
);
}
void
rrc_gNB_process_f1_setup_req
(
f1ap_setup_req_t
*
req
,
sctp_assoc_t
assoc_id
)
{
AssertFatal
(
assoc_id
!=
0
,
"illegal assoc_id == 0: should be -1 (monolithic) or >0 (split)
\n
"
);
...
...
@@ -212,6 +305,9 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
.
num_SI
=
0
,
};
if
(
du
->
mib
!=
NULL
&&
du
->
sib1
!=
NULL
)
label_intra_frequency_neighbours
(
rrc
,
du
,
cell_info
);
f1ap_setup_resp_t
resp
=
{.
transaction_id
=
req
->
transaction_id
,
.
num_cells_to_activate
=
1
,
.
cells_to_activate
[
0
]
=
cell
};
...
...
@@ -333,6 +429,10 @@ void rrc_gNB_process_f1_du_configuration_update(f1ap_gnb_du_configuration_update
LOG_I
(
RRC
,
"update system information of DU %ld
\n
"
,
du
->
setup_req
->
gNB_DU_id
);
}
}
if
(
du
->
mib
!=
NULL
&&
du
->
sib1
!=
NULL
)
{
const
f1ap_served_cell_info_t
*
cell_info
=
&
du
->
setup_req
->
cell
[
0
].
info
;
label_intra_frequency_neighbours
(
rrc
,
du
,
cell_info
);
}
}
if
(
conf_up
->
num_cells_to_delete
>
0
)
{
...
...
openair2/RRC/NR/rrc_gNB_du.h
View file @
7db4732c
...
...
@@ -32,6 +32,7 @@ struct f1ap_lost_connection_t;
struct
gNB_RRC_INST_s
;
struct
nr_rrc_du_container_t
;
struct
f1ap_gnb_du_configuration_update_s
;
struct
f1ap_served_cell_info_t
;
void
rrc_gNB_process_f1_setup_req
(
struct
f1ap_setup_req_s
*
req
,
sctp_assoc_t
assoc_id
);
void
rrc_CU_process_f1_lost_connection
(
struct
gNB_RRC_INST_s
*
rrc
,
struct
f1ap_lost_connection_t
*
lc
,
sctp_assoc_t
assoc_id
);
...
...
@@ -39,7 +40,12 @@ void rrc_gNB_process_f1_du_configuration_update(struct f1ap_gnb_du_configuration
struct
nr_rrc_du_container_t
*
get_du_for_ue
(
struct
gNB_RRC_INST_s
*
rrc
,
uint32_t
ue_id
);
struct
nr_rrc_du_container_t
*
get_du_by_assoc_id
(
struct
gNB_RRC_INST_s
*
rrc
,
sctp_assoc_t
assoc_id
);
const
struct
f1ap_served_cell_info_t
*
get_cell_information_by_phycellId
(
int
phyCellId
);
void
dump_du_info
(
const
struct
gNB_RRC_INST_s
*
rrc
,
FILE
*
f
);
int
get_dl_band
(
const
struct
f1ap_served_cell_info_t
*
cell_info
);
int
get_ssb_scs
(
const
struct
f1ap_served_cell_info_t
*
cell_info
);
int
get_ssb_arfcn
(
const
struct
nr_rrc_du_container_t
*
du
);
#endif
/* RRC_GNB_DU_H_ */
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