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
lizhongxiao
OpenXG-RAN
Commits
3de71d11
Commit
3de71d11
authored
Feb 05, 2024
by
Jaroslava Fiedlerova
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/pdu-session-initial-setup' into integration_2024_w05
parents
9af66c9e
4a7d7975
Changes
28
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
854 additions
and
943 deletions
+854
-943
ci-scripts/ran.py
ci-scripts/ran.py
+2
-2
common/utils/oai_asn1.h
common/utils/oai_asn1.h
+4
-4
common/utils/telnetsrv/telnetsrv_bearer.c
common/utils/telnetsrv/telnetsrv_bearer.c
+6
-4
common/utils/telnetsrv/telnetsrv_ci.c
common/utils/telnetsrv/telnetsrv_ci.c
+2
-2
executables/nr-ru.c
executables/nr-ru.c
+0
-4
openair2/E1AP/e1ap.c
openair2/E1AP/e1ap.c
+2
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+4
-4
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+5
-3
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
+1
-4
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
+7
-1
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
+7
-1
openair2/LAYER2/NR_MAC_gNB/main.c
openair2/LAYER2/NR_MAC_gNB/main.c
+19
-14
openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c
openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c
+4
-2
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+2
-1
openair2/RRC/NR/mac_rrc_dl_f1ap.c
openair2/RRC/NR/mac_rrc_dl_f1ap.c
+14
-2
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+9
-14
openair2/RRC/NR/nr_rrc_proto.h
openair2/RRC/NR/nr_rrc_proto.h
+4
-1
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+444
-638
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+172
-140
openair2/RRC/NR/rrc_gNB_UE_context.c
openair2/RRC/NR/rrc_gNB_UE_context.c
+1
-0
openair2/RRC/NR/rrc_gNB_cuup.c
openair2/RRC/NR/rrc_gNB_cuup.c
+7
-5
openair2/RRC/NR/rrc_gNB_radio_bearers.c
openair2/RRC/NR/rrc_gNB_radio_bearers.c
+81
-68
openair2/RRC/NR/rrc_gNB_radio_bearers.h
openair2/RRC/NR/rrc_gNB_radio_bearers.h
+22
-9
openair2/SDAP/nr_sdap/nr_sdap_entity.c
openair2/SDAP/nr_sdap/nr_sdap_entity.c
+1
-1
openair3/NGAP/ngap_gNB_handlers.c
openair3/NGAP/ngap_gNB_handlers.c
+11
-1
openair3/NGAP/ngap_gNB_nas_procedures.c
openair3/NGAP/ngap_gNB_nas_procedures.c
+18
-11
radio/rfsimulator/simulator.c
radio/rfsimulator/simulator.c
+4
-4
No files found.
ci-scripts/ran.py
View file @
3de71d11
...
...
@@ -992,7 +992,7 @@ class RANManagement():
NSA_RAPROC_PUSCH_check
=
1
# Collect information on UE DLSCH and ULSCH statistics
keys
=
{
'dlsch_rounds'
,
'
dlsch_total_bytes'
,
'ulsch_rounds'
,
'ulsch_total_bytes_scheduled
'
}
keys
=
{
'dlsch_rounds'
,
'
ulsch_rounds
'
}
for
k
in
keys
:
result
=
re
.
search
(
k
,
line
)
if
result
is
None
:
...
...
@@ -1161,7 +1161,7 @@ class RANManagement():
dlcheckers
=
[]
if
'd_retx_th'
not
in
checkers
else
checkers
[
'd_retx_th'
]
retx_status
[
ue
][
'dl'
]
=
self
.
_analyzeUeRetx
(
dlulstat
[
'dlsch_rounds'
],
dlcheckers
,
r'^.*dlsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+dlsch_errors\s+(\d+)'
)
ulcheckers
=
[]
if
'u_retx_th'
not
in
checkers
else
checkers
[
'u_retx_th'
]
retx_status
[
ue
][
'ul'
]
=
self
.
_analyzeUeRetx
(
dlulstat
[
'ulsch_rounds'
],
ulcheckers
,
r'^.*ulsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+
.*,\s+
ulsch_errors\s+(\d+)'
)
retx_status
[
ue
][
'ul'
]
=
self
.
_analyzeUeRetx
(
dlulstat
[
'ulsch_rounds'
],
ulcheckers
,
r'^.*ulsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+ulsch_errors\s+(\d+)'
)
#real time statistics
...
...
common/utils/oai_asn1.h
View file @
3de71d11
...
...
@@ -32,7 +32,7 @@
*\param[in] pointer to the BIT_STRING_t object.
*\return the extracted value.
*/
static
inline
uint8_t
BIT_STRING_to_uint8
(
BIT_STRING_t
*
asn
)
{
static
inline
uint8_t
BIT_STRING_to_uint8
(
const
BIT_STRING_t
*
asn
)
{
DevCheck
((
asn
->
size
==
1
),
asn
->
size
,
0
,
0
);
return
asn
->
buf
[
0
]
>>
asn
->
bits_unused
;
...
...
@@ -43,7 +43,7 @@ static inline uint8_t BIT_STRING_to_uint8(BIT_STRING_t *asn) {
*\param[in] pointer to the BIT_STRING_t object.
*\return the extracted value.
*/
static
inline
uint16_t
BIT_STRING_to_uint16
(
BIT_STRING_t
*
asn
)
{
static
inline
uint16_t
BIT_STRING_to_uint16
(
const
BIT_STRING_t
*
asn
)
{
uint16_t
result
=
0
;
int
index
=
0
;
...
...
@@ -69,7 +69,7 @@ static inline uint16_t BIT_STRING_to_uint16(BIT_STRING_t *asn) {
*\param[in] pointer to the BIT_STRING_t object.
*\return the extracted value.
*/
static
inline
uint32_t
BIT_STRING_to_uint32
(
BIT_STRING_t
*
asn
)
{
static
inline
uint32_t
BIT_STRING_to_uint32
(
const
BIT_STRING_t
*
asn
)
{
uint32_t
result
=
0
;
size_t
index
;
...
...
@@ -91,7 +91,7 @@ static inline uint32_t BIT_STRING_to_uint32(BIT_STRING_t *asn) {
*\param[in] pointer to the BIT_STRING_t object.
*\return the extracted value.
*/
static
inline
uint64_t
BIT_STRING_to_uint64
(
BIT_STRING_t
*
asn
)
{
static
inline
uint64_t
BIT_STRING_to_uint64
(
const
BIT_STRING_t
*
asn
)
{
uint64_t
result
=
0
;
size_t
index
;
int
shift
;
...
...
common/utils/telnetsrv/telnetsrv_bearer.c
View file @
3de71d11
...
...
@@ -56,7 +56,7 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
return
0
;
}
void
rrc_gNB_trigger_new_bearer
(
int
rnti
);
//
void rrc_gNB_trigger_new_bearer(int rnti);
int
add_bearer
(
char
*
buf
,
int
debug
,
telnet_printfunc_t
prnt
)
{
int
rnti
=
-
1
;
...
...
@@ -75,12 +75,13 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
if
(
!
rrcue
)
ERROR_MSG_RET
(
"could not find UE with RNTI %04x
\n
"
,
rnti
);
rrc_gNB_trigger_new_bearer
(
rnti
);
AssertFatal
(
false
,
"not implemented
\n
"
);
//rrc_gNB_trigger_new_bearer(rnti);
prnt
(
"called rrc_gNB_trigger_new_bearer(%04x)
\n
"
,
rnti
);
return
0
;
}
void
rrc_gNB_trigger_release_bearer
(
int
rnti
);
//
void rrc_gNB_trigger_release_bearer(int rnti);
int
release_bearer
(
char
*
buf
,
int
debug
,
telnet_printfunc_t
prnt
)
{
int
rnti
=
-
1
;
...
...
@@ -99,7 +100,8 @@ int release_bearer(char *buf, int debug, telnet_printfunc_t prnt)
if
(
!
rrcue
)
ERROR_MSG_RET
(
"could not find UE with RNTI %04x
\n
"
,
rnti
);
rrc_gNB_trigger_release_bearer
(
rnti
);
AssertFatal
(
false
,
"not implemented
\n
"
);
//rrc_gNB_trigger_release_bearer(rnti);
prnt
(
"called rrc_gNB_trigger_release_bearer(%04x)
\n
"
,
rnti
);
return
0
;
}
...
...
common/utils/telnetsrv/telnetsrv_ci.c
View file @
3de71d11
...
...
@@ -92,10 +92,10 @@ int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt)
ERROR_MSG_RET
(
"could not find UE with RNTI %04x in RRC
\n
"
);
}
prnt
(
"UE RNTI %04x reestab %d reconf
_after_reestab
%d
\n
"
,
prnt
(
"UE RNTI %04x reestab %d reconf
ig
%d
\n
"
,
ue
->
ue_context
.
rnti
,
ue
->
ue_context
.
ue_reestablishment_counter
,
ue
->
ue_context
.
ue_reconfiguration_
after_reestablishment_
counter
);
ue
->
ue_context
.
ue_reconfiguration_counter
);
return
0
;
}
...
...
executables/nr-ru.c
View file @
3de71d11
...
...
@@ -1812,10 +1812,6 @@ void init_NR_RU(configmodule_interface_t *cfg, char *rf_config_file)
LOG_E
(
PHY
,
"%s() DJP - ru->gNB_list ru->num_gNB are not initialized - so do it manually
\n
"
,
__FUNCTION__
);
ru
->
gNB_list
[
0
]
=
RC
.
gNB
[
0
];
ru
->
num_gNB
=
1
;
//
//
}
else
{
LOG_E
(
PHY
,
"DJP - delete code above this %s:%d
\n
"
,
__FILE__
,
__LINE__
);
}
}
...
...
openair2/E1AP/e1ap.c
View file @
3de71d11
...
...
@@ -665,7 +665,7 @@ static int fill_BEARER_CONTEXT_SETUP_REQUEST(e1ap_bearer_setup_req_t *const bear
asn1cSequenceAdd
(
ieC6_1
->
dRB_To_Setup_List_NG_RAN
.
list
,
E1AP_DRB_To_Setup_Item_NG_RAN_t
,
ieC6_1_1
);
ieC6_1_1
->
dRB_ID
=
j
->
id
;
ieC6_1_1
->
sDAP_Configuration
.
defaultDRB
=
j
->
defaultDRB
;
ieC6_1_1
->
sDAP_Configuration
.
defaultDRB
=
j
->
defaultDRB
?
E1AP_DefaultDRB_true
:
E1AP_DefaultDRB_false
;
ieC6_1_1
->
sDAP_Configuration
.
sDAP_Header_UL
=
j
->
sDAP_Header_UL
;
ieC6_1_1
->
sDAP_Configuration
.
sDAP_Header_DL
=
j
->
sDAP_Header_DL
;
...
...
@@ -971,7 +971,7 @@ void extract_BEARER_CONTEXT_SETUP_REQUEST(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
drb
->
id
=
drb2Setup
->
dRB_ID
;
drb
->
defaultDRB
=
drb2Setup
->
sDAP_Configuration
.
defaultDRB
;
drb
->
defaultDRB
=
drb2Setup
->
sDAP_Configuration
.
defaultDRB
==
E1AP_DefaultDRB_true
;
drb
->
sDAP_Header_UL
=
drb2Setup
->
sDAP_Configuration
.
sDAP_Header_UL
;
drb
->
sDAP_Header_DL
=
drb2Setup
->
sDAP_Configuration
.
sDAP_Header_DL
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
3de71d11
...
...
@@ -1698,7 +1698,7 @@ static void nr_generate_Msg4(module_id_t module_idP,
// Need to wait until data for Msg4 is ready
if
(
srb_status
.
bytes_in_buffer
==
0
)
return
;
LOG_
I
(
NR_MAC
,
"(%4d.%2d) SRB%d has %d bytes
\n
"
,
frameP
,
slotP
,
lcid
,
srb_status
.
bytes_in_buffer
);
LOG_
D
(
NR_MAC
,
"(%4d.%2d) SRB%d has %d bytes
\n
"
,
frameP
,
slotP
,
lcid
,
srb_status
.
bytes_in_buffer
);
mac_sdu_length
=
srb_status
.
bytes_in_buffer
;
}
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
3de71d11
...
...
@@ -2851,11 +2851,11 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
static
void
nr_mac_apply_cellgroup
(
gNB_MAC_INST
*
mac
,
NR_UE_info_t
*
UE
,
frame_t
frame
,
sub_frame_t
slot
)
{
LOG_
I
(
NR_MAC
,
"%4d.%2d RNTI %04x: RRC processing timer expired
\n
"
,
frame
,
slot
,
UE
->
rnti
);
LOG_
D
(
NR_MAC
,
"%4d.%2d RNTI %04x: RRC processing timer expired
\n
"
,
frame
,
slot
,
UE
->
rnti
);
/* check if there is a new CellGroupConfig to be applied */
if
(
UE
->
apply_cellgroup
&&
UE
->
reconfigCellGroup
!=
NULL
)
{
LOG_
I
(
NR_MAC
,
"%4d.%2d RNTI %04x: Apply CellGroupConfig after RRC processing timer expiry
\n
"
,
frame
,
slot
,
UE
->
rnti
);
LOG_
D
(
NR_MAC
,
"%4d.%2d RNTI %04x: Apply CellGroupConfig after RRC processing timer expiry
\n
"
,
frame
,
slot
,
UE
->
rnti
);
ASN_STRUCT_FREE
(
asn_DEF_NR_CellGroupConfig
,
UE
->
CellGroup
);
UE
->
CellGroup
=
UE
->
reconfigCellGroup
;
UE
->
reconfigCellGroup
=
NULL
;
...
...
@@ -2911,7 +2911,7 @@ int nr_mac_enable_ue_rrc_processing_timer(gNB_MAC_INST *mac, NR_UE_info_t *UE, b
// frames, after RRC processing timer.
UE
->
UE_sched_ctrl
.
ta_frame
=
(
mac
->
frame
-
1
+
1024
)
%
1024
;
LOG_
I
(
NR_MAC
,
"%4d.%2d UE %04x: Activate RRC processing timer (%d ms)
\n
"
,
mac
->
frame
,
mac
->
slot
,
UE
->
rnti
,
delay
);
LOG_
D
(
NR_MAC
,
"%4d.%2d UE %04x: Activate RRC processing timer (%d ms)
\n
"
,
mac
->
frame
,
mac
->
slot
,
UE
->
rnti
,
delay
);
return
0
;
}
...
...
@@ -3092,7 +3092,7 @@ void nr_mac_check_ul_failure(const gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ct
/* to trigger only once: trigger when ul_failure_timer == 1, but timer will
* stop at 0 and we wait for a UE release command from upper layers */
if
(
sched_ctrl
->
ul_failure_timer
==
1
)
{
LOG_W
(
MAC
,
"
request release after UL failure timer expiry
\n
"
);
LOG_W
(
MAC
,
"
UE %04x: request release after UL failure timer expiry
\n
"
,
rnti
);
f1_ue_data_t
ue_data
=
du_get_f1_ue_data
(
rnti
);
f1ap_ue_context_release_req_t
request
=
{
.
gNB_CU_ue_id
=
ue_data
.
secondary_ue
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
3de71d11
...
...
@@ -676,7 +676,9 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
}
if
(
!
get_softmodem_params
()
->
phy_test
&&
UE
->
UE_sched_ctrl
.
pusch_consecutive_dtx_cnt
>=
pusch_failure_thres
)
{
LOG_W
(
NR_MAC
,
"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling
\n
"
,
LOG_W
(
NR_MAC
,
"UE %04x: Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling
\n
"
,
UE
->
rnti
,
UE
->
UE_sched_ctrl
.
pusch_consecutive_dtx_cnt
);
nr_mac_trigger_ul_failure
(
&
UE
->
UE_sched_ctrl
,
UE
->
current_UL_BWP
.
scs
);
}
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
View file @
3de71d11
...
...
@@ -260,7 +260,7 @@ static void set_QoSConfig(const f1ap_ue_context_modif_req_t *req, NR_UE_sched_ct
f1ap_drb_to_be_setup_t
*
drb_p
=
&
req
->
drbs_to_be_setup
[
i
];
uint8_t
nb_qos_flows
=
drb_p
->
drb_info
.
flows_to_be_setup_length
;
long
drb_id
=
drb_p
->
drb_id
;
LOG_I
(
NR_MAC
,
"
In %s: number of QOS flows mapped to DRB_id %d: %ld
\n
"
,
__func__
,
drb_count
,
drb_id
);
LOG_I
(
NR_MAC
,
"
number of QOS flows mapped to DRB_id %ld: %d
\n
"
,
drb_id
,
nb_qos_flows
);
for
(
int
q
=
0
;
q
<
nb_qos_flows
;
q
++
)
{
f1ap_flows_mapped_to_drb_t
*
qos_flow
=
&
drb_p
->
drb_info
.
flows_mapped_to_drb
[
q
];
...
...
@@ -338,9 +338,6 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req)
UE
->
capability
=
ue_cap
;
if
(
ue_cap
!=
NULL
)
{
// store the new UE capabilities, and update the cellGroupConfig
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_NR_Capability
,
UE
->
capability
);
UE
->
capability
=
ue_cap
;
LOG_I
(
NR_MAC
,
"UE %04x: received capabilities, updating CellGroupConfig
\n
"
,
UE
->
rnti
);
NR_ServingCellConfigCommon_t
*
scc
=
mac
->
common_channels
[
0
].
ServingCellConfigCommon
;
update_cellGroupConfig
(
new_CellGroup
,
UE
->
uid
,
UE
->
capability
,
&
mac
->
radio_config
,
scc
);
}
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
View file @
3de71d11
...
...
@@ -69,7 +69,6 @@ static void f1_setup_request_direct(const f1ap_setup_req_t *req)
static
void
ue_context_setup_response_direct
(
const
f1ap_ue_context_setup_t
*
req
,
const
f1ap_ue_context_setup_t
*
resp
)
{
DevAssert
(
req
->
drbs_to_be_setup_length
==
resp
->
drbs_to_be_setup_length
);
AssertFatal
(
req
->
drbs_to_be_setup_length
==
0
,
"not implemented
\n
"
);
(
void
)
req
;
/* we don't need the request -- it is to set up GTP in F1 case */
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_MAC_GNB
,
0
,
F1AP_UE_CONTEXT_SETUP_RESP
);
...
...
@@ -85,6 +84,13 @@ static void ue_context_setup_response_direct(const f1ap_ue_context_setup_t *req,
for
(
int
i
=
0
;
i
<
f1ap_msg
->
srbs_to_be_setup_length
;
++
i
)
f1ap_msg
->
srbs_to_be_setup
[
i
]
=
resp
->
srbs_to_be_setup
[
i
];
}
if
(
resp
->
drbs_to_be_setup_length
>
0
)
{
DevAssert
(
resp
->
drbs_to_be_setup
!=
NULL
);
f1ap_msg
->
drbs_to_be_setup_length
=
resp
->
drbs_to_be_setup_length
;
f1ap_msg
->
drbs_to_be_setup
=
calloc
(
f1ap_msg
->
drbs_to_be_setup_length
,
sizeof
(
*
f1ap_msg
->
drbs_to_be_setup
));
for
(
int
i
=
0
;
i
<
f1ap_msg
->
drbs_to_be_setup_length
;
++
i
)
f1ap_msg
->
drbs_to_be_setup
[
i
]
=
resp
->
drbs_to_be_setup
[
i
];
}
f1ap_msg
->
du_to_cu_rrc_information
=
malloc
(
sizeof
(
*
resp
->
du_to_cu_rrc_information
));
AssertFatal
(
f1ap_msg
->
du_to_cu_rrc_information
!=
NULL
,
"out of memory
\n
"
);
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c
View file @
3de71d11
...
...
@@ -103,7 +103,6 @@ static void f1_setup_request_f1ap(const f1ap_setup_req_t *req)
static
void
ue_context_setup_response_f1ap
(
const
f1ap_ue_context_setup_t
*
req
,
const
f1ap_ue_context_setup_t
*
resp
)
{
DevAssert
(
req
->
drbs_to_be_setup_length
==
resp
->
drbs_to_be_setup_length
);
AssertFatal
(
req
->
drbs_to_be_setup_length
==
0
,
"not implmented
\n
"
);
DevAssert
(
req
->
srbs_to_be_setup_length
==
resp
->
srbs_to_be_setup_length
);
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_MAC_GNB
,
0
,
F1AP_UE_CONTEXT_SETUP_RESP
);
...
...
@@ -118,6 +117,13 @@ static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, c
for
(
int
i
=
0
;
i
<
f1ap_msg
->
srbs_to_be_setup_length
;
++
i
)
f1ap_msg
->
srbs_to_be_setup
[
i
]
=
resp
->
srbs_to_be_setup
[
i
];
}
if
(
resp
->
drbs_to_be_setup_length
>
0
)
{
DevAssert
(
resp
->
drbs_to_be_setup
!=
NULL
);
f1ap_msg
->
drbs_to_be_setup_length
=
resp
->
drbs_to_be_setup_length
;
f1ap_msg
->
drbs_to_be_setup
=
calloc
(
f1ap_msg
->
drbs_to_be_setup_length
,
sizeof
(
*
f1ap_msg
->
drbs_to_be_setup
));
for
(
int
i
=
0
;
i
<
f1ap_msg
->
drbs_to_be_setup_length
;
++
i
)
f1ap_msg
->
drbs_to_be_setup
[
i
]
=
resp
->
drbs_to_be_setup
[
i
];
}
f1ap_msg
->
du_to_cu_rrc_information
=
malloc
(
sizeof
(
*
resp
->
du_to_cu_rrc_information
));
AssertFatal
(
f1ap_msg
->
du_to_cu_rrc_information
!=
NULL
,
"out of memory
\n
"
);
...
...
openair2/LAYER2/NR_MAC_gNB/main.c
View file @
3de71d11
...
...
@@ -85,7 +85,6 @@ void clear_mac_stats(gNB_MAC_INST *gNB) {
size_t
dump_mac_stats
(
gNB_MAC_INST
*
gNB
,
char
*
output
,
size_t
strlen
,
bool
reset_rsrp
)
{
int
num
=
1
;
const
char
*
begin
=
output
;
const
char
*
end
=
output
+
strlen
;
...
...
@@ -99,11 +98,19 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
NR_mac_stats_t
*
stats
=
&
UE
->
mac_stats
;
const
int
avg_rsrp
=
stats
->
num_rsrp_meas
>
0
?
stats
->
cumul_rsrp
/
stats
->
num_rsrp_meas
:
0
;
output
+=
snprintf
(
output
,
end
-
output
,
"UE RNTI %04x CU-UE-ID "
,
UE
->
rnti
);
if
(
du_exists_f1_ue_data
(
UE
->
rnti
))
{
f1_ue_data_t
ued
=
du_get_f1_ue_data
(
UE
->
rnti
);
output
+=
snprintf
(
output
,
end
-
output
,
"%d"
,
ued
.
secondary_ue
);
}
else
{
output
+=
snprintf
(
output
,
end
-
output
,
"(none)"
);
}
bool
in_sync
=
!
sched_ctrl
->
ul_failure
;
output
+=
snprintf
(
output
,
end
-
output
,
"UE RNTI %04x (%d) PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)
\n
"
,
UE
->
rnti
,
num
++
,
" %s PH %d dB PCMAX %d dBm, average RSRP %d (%d meas)
\n
"
,
in_sync
?
"in-sync"
:
"out-of-sync"
,
sched_ctrl
->
ph
,
sched_ctrl
->
pcmax
,
avg_rsrp
,
...
...
@@ -132,19 +139,16 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
output
+=
snprintf
(
output
,
end
-
output
,
", dlsch_errors %"
PRIu64
", pucch0_DTX %d, BLER %.5f MCS %d
\n
"
,
", dlsch_errors %"
PRIu64
", pucch0_DTX %d, BLER %.5f MCS
(%d)
%d
\n
"
,
stats
->
dl
.
errors
,
stats
->
pucch0_DTX
,
sched_ctrl
->
dl_bler_stats
.
bler
,
UE
->
current_DL_BWP
.
mcsTableIdx
,
sched_ctrl
->
dl_bler_stats
.
mcs
);
if
(
reset_rsrp
)
{
stats
->
num_rsrp_meas
=
0
;
stats
->
cumul_rsrp
=
0
;
}
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: dlsch_total_bytes %"
PRIu64
"
\n
"
,
UE
->
rnti
,
stats
->
dl
.
total_bytes
);
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: ulsch_rounds "
,
UE
->
rnti
);
...
...
@@ -154,16 +158,17 @@ size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset
output
+=
snprintf
(
output
,
end
-
output
,
", ulsch_DTX %d, ulsch_errors %"
PRIu64
", BLER %.5f MCS %d
\n
"
,
stats
->
ulsch_DTX
,
", ulsch_errors %"
PRIu64
", ulsch_DTX %d, BLER %.5f MCS (%d) %d
\n
"
,
stats
->
ul
.
errors
,
stats
->
ulsch_DTX
,
sched_ctrl
->
ul_bler_stats
.
bler
,
UE
->
current_UL_BWP
.
mcs_table
,
sched_ctrl
->
ul_bler_stats
.
mcs
);
output
+=
snprintf
(
output
,
end
-
output
,
"UE %04x: ulsch_total_bytes_scheduled %"
PRIu64
", ulsch_total_bytes_received %"
PRIu64
"
\n
"
,
UE
->
rnti
,
stats
->
ulsch_total_bytes_scheduled
,
stats
->
ul
.
total_bytes
);
"UE %04x: MAC: TX %14"
PRIu64
" RX %14"
PRIu64
" bytes
\n
"
,
UE
->
rnti
,
stats
->
dl
.
total_bytes
,
stats
->
ul
.
total_bytes
);
for
(
int
i
=
0
;
i
<
sched_ctrl
->
dl_lc_num
;
i
++
)
{
int
lc_id
=
sched_ctrl
->
dl_lc_ids
[
i
];
...
...
openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c
View file @
3de71d11
...
...
@@ -184,8 +184,8 @@ void e1_bearer_context_setup(const e1ap_bearer_setup_req_t *req)
sdap_data_req
,
&
resp_n3
);
AssertFatal
(
ret
>=
0
,
"Unable to create GTP Tunnel for NG-U
\n
"
);
AssertFatal
(
resp_n3
.
num_tunnels
==
req
->
numPDUSessions
,
"could not create all tunnels
\n
"
);
resp_pdu
->
teId
=
resp_n3
.
gnb_NGu_teid
[
i
];
AssertFatal
(
resp_n3
.
num_tunnels
==
req
_pdu
->
numDRB2Setup
,
"could not create all tunnels
\n
"
);
resp_pdu
->
teId
=
resp_n3
.
gnb_NGu_teid
[
0
];
memcpy
(
&
resp_pdu
->
tlAddress
,
&
resp_n3
.
gnb_addr
.
buffer
,
4
);
// create PDCP bearers. This will also create SDAP bearers
...
...
@@ -240,6 +240,7 @@ void e1_bearer_context_modif(const e1ap_bearer_setup_req_t *req)
instance_t
f1inst
=
get_f1_gtp_instance
();
for
(
int
i
=
0
;
i
<
req
->
numPDUSessionsMod
;
i
++
)
{
DevAssert
(
req
->
pduSessionMod
[
i
].
sessionId
>
0
);
LOG_I
(
E1AP
,
"UE %d: updating PDU session ID %ld (%ld bearers)
\n
"
,
req
->
gNB_cu_up_ue_id
,
...
...
@@ -278,6 +279,7 @@ void e1_bearer_release_cmd(const e1ap_bearer_release_cmd_t *cmd)
if
(
f1inst
>=
0
)
// is there F1-U?
newGtpuDeleteAllTunnels
(
f1inst
,
cmd
->
gNB_cu_up_ue_id
);
nr_pdcp_remove_UE
(
cmd
->
gNB_cu_up_ue_id
);
nr_sdap_delete_ue_entities
(
cmd
->
gNB_cu_up_ue_id
);
if
(
need_ue_id_mgmt
)
{
cu_remove_f1_ue_data
(
cmd
->
gNB_cu_up_ue_id
);
}
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
3de71d11
...
...
@@ -925,7 +925,7 @@ void add_drb(int is_gnb,
has_integrity
?
integrity_key
:
NULL
);
nr_pdcp_ue_add_drb_pdcp_entity
(
ue
,
drb_id
,
pdcp_drb
);
LOG_
D
(
PDCP
,
"added drb %d to UE ID %ld
\n
"
,
drb_id
,
UEid
);
LOG_
I
(
PDCP
,
"added drb %d to UE ID %ld
\n
"
,
drb_id
,
UEid
);
new_nr_sdap_entity
(
is_gnb
,
has_sdap_rx
,
has_sdap_tx
,
UEid
,
pdusession_id
,
is_sdap_DefaultDRB
,
drb_id
,
mappedQFIs2Add
,
mappedQFIs2AddCount
);
}
...
...
@@ -1193,6 +1193,7 @@ void nr_pdcp_release_drb(ue_id_t ue_id, int drb_id)
drb
->
release_entity
(
drb
);
drb
->
delete_entity
(
drb
);
ue
->
drb
[
drb_id
-
1
]
=
NULL
;
LOG_I
(
PDCP
,
"release DRB %d of UE %ld
\n
"
,
drb_id
,
ue_id
);
}
else
LOG_E
(
PDCP
,
"Attempting to release DRB%d but it is not configured
\n
"
,
drb_id
);
...
...
openair2/RRC/NR/mac_rrc_dl_f1ap.c
View file @
3de71d11
...
...
@@ -51,8 +51,20 @@ static void ue_context_setup_request_f1ap(sctp_assoc_t assoc_id, const f1ap_ue_c
f1ap_ue_context_setup_t
*
f1ap_msg
=
&
F1AP_UE_CONTEXT_SETUP_REQ
(
msg
);
*
f1ap_msg
=
*
req
;
AssertFatal
(
req
->
cu_to_du_rrc_information
==
NULL
,
"cu_to_du_rrc_information not supported yet
\n
"
);
AssertFatal
(
req
->
drbs_to_be_setup
==
NULL
,
"drbs_to_be_setup not supported yet
\n
"
);
AssertFatal
(
req
->
srbs_to_be_setup
==
NULL
,
"drbs_to_be_setup not supported yet
\n
"
);
if
(
req
->
drbs_to_be_setup_length
>
0
)
{
int
n
=
req
->
drbs_to_be_setup_length
;
f1ap_msg
->
drbs_to_be_setup_length
=
n
;
f1ap_msg
->
drbs_to_be_setup
=
calloc
(
n
,
sizeof
(
*
f1ap_msg
->
drbs_to_be_setup
));
AssertFatal
(
f1ap_msg
->
drbs_to_be_setup
!=
NULL
,
"out of memory
\n
"
);
memcpy
(
f1ap_msg
->
drbs_to_be_setup
,
req
->
drbs_to_be_setup
,
n
*
sizeof
(
*
f1ap_msg
->
drbs_to_be_setup
));
}
if
(
req
->
srbs_to_be_setup_length
>
0
)
{
int
n
=
req
->
srbs_to_be_setup_length
;
f1ap_msg
->
srbs_to_be_setup_length
=
n
;
f1ap_msg
->
srbs_to_be_setup
=
calloc
(
n
,
sizeof
(
*
f1ap_msg
->
srbs_to_be_setup
));
AssertFatal
(
f1ap_msg
->
srbs_to_be_setup
!=
NULL
,
"out of memory
\n
"
);
memcpy
(
f1ap_msg
->
srbs_to_be_setup
,
req
->
srbs_to_be_setup
,
n
*
sizeof
(
*
f1ap_msg
->
srbs_to_be_setup
));
}
if
(
req
->
rrc_container_length
>
0
)
{
f1ap_msg
->
rrc_container
=
calloc
(
req
->
rrc_container_length
,
sizeof
(
*
f1ap_msg
->
rrc_container
));
AssertFatal
(
f1ap_msg
->
rrc_container
!=
NULL
,
"out of memory
\n
"
);
...
...
openair2/RRC/NR/nr_rrc_defs.h
View file @
3de71d11
...
...
@@ -224,6 +224,7 @@ typedef struct drb_s {
}
drb_t
;
typedef
enum
{
RRC_ACTION_NONE
,
/* no transaction ongoing */
RRC_SETUP
,
RRC_SETUP_FOR_REESTABLISHMENT
,
RRC_REESTABLISH
,
...
...
@@ -232,12 +233,12 @@ typedef enum {
RRC_DEDICATED_RECONF
,
RRC_PDUSESSION_ESTABLISH
,
RRC_PDUSESSION_MODIFY
,
RRC_PDUSESSION_RELEASE
RRC_PDUSESSION_RELEASE
,
RRC_UECAPABILITY_ENQUIRY
,
}
rrc_action_t
;
typedef
struct
gNB_RRC_UE_s
{
drb_t
established_drbs
[
MAX_DRBS_PER_UE
];
uint8_t
DRB_active
[
MAX_DRBS_PER_UE
];
NR_DRB_ToReleaseList_t
*
DRB_ReleaseList
;
NR_SRB_INFO_TABLE_ENTRY
Srb
[
maxSRBs
];
// 3gpp max is 3 SRBs, number 1..3, we waste the entry 0 for code simplicity
...
...
@@ -245,6 +246,8 @@ typedef struct gNB_RRC_UE_s {
NR_HANDOVER_INFO
*
handover_info
;
NR_MeasResults_t
*
measResults
;
bool
as_security_active
;
byte_array_t
ue_cap_buffer
;
NR_UE_NR_Capability_t
*
UE_Capability_nr
;
int
UE_Capability_size
;
...
...
@@ -275,12 +278,8 @@ typedef struct gNB_RRC_UE_s {
/* Information from UE RRC Setup Request */
NR_UE_S_TMSI
Initialue_identity_5g_s_TMSI
;
uint64_t
ng_5G_S_TMSI_Part1
;
uint16_t
ng_5G_S_TMSI_Part2
;
NR_EstablishmentCause_t
establishment_cause
;
/* Information from UE RRCReestablishmentRequest */
NR_ReestablishmentCause_t
reestablishment_cause
;
uint32_t
rrc_ue_id
;
uint64_t
amf_ue_ngap_id
;
nr_rrc_guami_t
ue_guami
;
...
...
@@ -303,19 +302,15 @@ typedef struct gNB_RRC_UE_s {
uint8_t
e_rab_release_command_flag
;
uint32_t
ue_rrc_inactivity_timer
;
uint32_t
ue_reestablishment_counter
;
uint32_t
ue_reconfiguration_after_reestablishment_counter
;
NR_CellGroupId_t
cellGroupId
;
uint32_t
ue_reconfiguration_counter
;
struct
NR_SpCellConfig
*
spCellConfig
;
struct
NR_CellGroupConfig__sCellToAddModList
*
sCellconfig
;
struct
NR_CellGroupConfig__sCellToReleaseList
*
sCellconfigRelease
;
struct
NR_CellGroupConfig__rlc_BearerToAddModList
*
rlc_BearerBonfig
;
struct
NR_CellGroupConfig__rlc_BearerToReleaseList
*
rlc_BearerRelease
;
struct
NR_MAC_CellGroupConfig
*
mac_CellGroupConfig
;
struct
NR_PhysicalCellGroupConfig
*
physicalCellGroupConfig
;
/* Nas Pdu */
ngap_pdu_t
nas_pdu
;
/* hack, see rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ() for more info */
int
max_delays_pdu_session
;
}
gNB_RRC_UE_t
;
typedef
struct
rrc_gNB_ue_context_s
{
...
...
openair2/RRC/NR/nr_rrc_proto.h
View file @
3de71d11
...
...
@@ -81,7 +81,9 @@ int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2
void
rrc_gNB_generate_SecurityModeCommand
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
rrc_gNB_ue_context_t
*
const
ue_context_pP
,
int
n_drbs
,
const
f1ap_drb_to_be_setup_t
*
drbs
);
unsigned
int
rrc_gNB_get_next_transaction_identifier
(
module_id_t
gnb_mod_idP
);
...
...
@@ -125,6 +127,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
void
rrc_gNB_generate_dedicatedRRCReconfiguration
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
ue_context_pP
);
bool
ue_associated_to_cuup
(
const
gNB_RRC_INST
*
rrc
,
const
gNB_RRC_UE_t
*
ue
);
sctp_assoc_t
get_existing_cuup_for_ue
(
const
gNB_RRC_INST
*
rrc
,
const
gNB_RRC_UE_t
*
ue
);
sctp_assoc_t
get_new_cuup_for_ue
(
const
gNB_RRC_INST
*
rrc
,
const
gNB_RRC_UE_t
*
ue
,
int
sst
,
int
sd
);
int
rrc_gNB_process_e1_setup_req
(
sctp_assoc_t
assoc_id
,
e1ap_setup_req_t
*
req
);
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
3de71d11
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
3de71d11
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/rrc_gNB_UE_context.c
View file @
3de71d11
...
...
@@ -188,6 +188,7 @@ rrc_gNB_ue_context_t *rrc_gNB_create_ue_context(sctp_assoc_t assoc_id,
"UE F1 Context for ID %d already exists, logic bug
\n
"
,
ue
->
rrc_ue_id
);
cu_add_f1_ue_data
(
ue
->
rrc_ue_id
,
&
ue_data
);
ue
->
max_delays_pdu_session
=
20
;
/* see rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ() */
RB_INSERT
(
rrc_nr_ue_tree_s
,
&
rrc_instance_pP
->
rrc_ue_head
,
ue_context_p
);
LOG_I
(
NR_RRC
,
...
...
openair2/RRC/NR/rrc_gNB_cuup.c
View file @
3de71d11
...
...
@@ -75,14 +75,16 @@ static const nr_rrc_cuup_container_t *select_cuup_round_robin(size_t n_t, const
return
NULL
;
}
bool
ue_associated_to_cuup
(
const
gNB_RRC_INST
*
rrc
,
const
gNB_RRC_UE_t
*
ue
)
{
f1_ue_data_t
ue_data
=
cu_get_f1_ue_data
(
ue
->
rrc_ue_id
);
return
ue_data
.
e1_assoc_id
!=
0
;
}
sctp_assoc_t
get_existing_cuup_for_ue
(
const
gNB_RRC_INST
*
rrc
,
const
gNB_RRC_UE_t
*
ue
)
{
f1_ue_data_t
ue_data
=
cu_get_f1_ue_data
(
ue
->
rrc_ue_id
);
if
(
ue_data
.
e1_assoc_id
==
0
)
{
LOG_W
(
RRC
,
"UE %d should be associated to CU-UP, but is not
\n
"
,
ue
->
rrc_ue_id
);
/* we could possibly check the SST/SD from the PDU session */
return
get_new_cuup_for_ue
(
rrc
,
ue
,
0
,
0
);
}
AssertFatal
(
ue_data
.
e1_assoc_id
!=
0
,
"UE %d should be associated to CU-UP, but is not
\n
"
,
ue
->
rrc_ue_id
);
LOG_D
(
RRC
,
"UE %d using CU-UP assoc_id %d
\n
"
,
ue
->
rrc_ue_id
,
ue_data
.
e1_assoc_id
);
return
ue_data
.
e1_assoc_id
;
}
...
...
openair2/RRC/NR/rrc_gNB_radio_bearers.c
View file @
3de71d11
...
...
@@ -37,29 +37,46 @@ rrc_pdu_session_param_t *find_pduSession(gNB_RRC_UE_t *ue, int id, bool create)
return
ue
->
pduSession
+
j
;
}
void
generateDRB
(
gNB_RRC_UE_t
*
ue
,
rrc_pdu_session_param_t
*
find_pduSession_from_drbId
(
gNB_RRC_UE_t
*
ue
,
int
drb_id
)
{
const
drb_t
*
drb
=
&
ue
->
established_drbs
[
drb_id
-
1
];
if
(
drb
->
status
==
DRB_INACTIVE
)
{
LOG_E
(
NR_RRC
,
"UE %d: DRB %d inactive
\n
"
,
ue
->
rrc_ue_id
,
drb_id
);
return
NULL
;
}
int
id
=
drb
->
cnAssociation
.
sdap_config
.
pdusession_id
;
return
find_pduSession
(
ue
,
id
,
false
);
}
drb_t
*
get_drb
(
gNB_RRC_UE_t
*
ue
,
uint8_t
drb_id
)
{
DevAssert
(
drb_id
>
0
&&
drb_id
<
32
);
DevAssert
(
ue
!=
NULL
);
return
&
ue
->
established_drbs
[
drb_id
-
1
];
}
drb_t
*
generateDRB
(
gNB_RRC_UE_t
*
ue
,
uint8_t
drb_id
,
rrc_pdu_session_param_t
*
pduSession
,
const
rrc_pdu_session_param_t
*
pduSession
,
bool
enable_sdap
,
int
do_drb_integrity
,
int
do_drb_ciphering
)
{
int
i
;
int
qos_flow_index
;
DevAssert
(
ue
!=
NULL
);
LOG_I
(
NR_RRC
,
"UE %d: configure DRB ID %d for PDU session ID %d
\n
"
,
ue
->
rrc_ue_id
,
drb_id
,
pduSession
->
param
.
pdusession_id
);
drb_t
*
est_drb
=
&
ue
->
established_drbs
[
drb_id
-
1
];
if
(
est_drb
->
status
==
DRB_INACTIVE
)
{
/* DRB Management */
DevAssert
(
est_drb
->
status
==
DRB_INACTIVE
);
est_drb
->
status
=
DRB_ACTIVE
;
est_drb
->
drb_id
=
drb_id
;
est_drb
->
reestablishPDCP
=
-
1
;
est_drb
->
recoverPDCP
=
-
1
;
for
(
i
=
0
;
i
<
MAX_DRBS_PER_UE
;
i
++
)
{
if
((
est_drb
->
cnAssociation
.
sdap_config
.
pdusession_id
==
0
||
est_drb
->
cnAssociation
.
sdap_config
.
pdusession_id
==
pduSession
->
param
.
pdusession_id
)
&&
est_drb
->
defaultDRBid
==
0
)
{
est_drb
->
cnAssociation
.
sdap_config
.
defaultDRB
=
true
;
est_drb
->
defaultDRBid
=
drb_id
;
}
}
/* SDAP Configuration */
est_drb
->
cnAssociation
.
present
=
NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config
;
est_drb
->
cnAssociation
.
sdap_config
.
pdusession_id
=
pduSession
->
param
.
pdusession_id
;
...
...
@@ -70,7 +87,7 @@ void generateDRB(gNB_RRC_UE_t *ue,
est_drb
->
cnAssociation
.
sdap_config
.
sdap_HeaderDL
=
NR_SDAP_Config__sdap_HeaderDL_absent
;
est_drb
->
cnAssociation
.
sdap_config
.
sdap_HeaderUL
=
NR_SDAP_Config__sdap_HeaderUL_absent
;
}
for
(
qos_flow_index
=
0
;
qos_flow_index
<
pduSession
->
param
.
nb_qos
;
qos_flow_index
++
)
{
for
(
int
qos_flow_index
=
0
;
qos_flow_index
<
pduSession
->
param
.
nb_qos
;
qos_flow_index
++
)
{
est_drb
->
cnAssociation
.
sdap_config
.
mappedQoS_FlowsToAdd
[
qos_flow_index
]
=
pduSession
->
param
.
qos
[
qos_flow_index
].
qfi
;
if
(
pduSession
->
param
.
qos
[
qos_flow_index
].
fiveQI
>
5
)
est_drb
->
status
=
DRB_ACTIVE_NONGBR
;
...
...
@@ -92,7 +109,10 @@ void generateDRB(gNB_RRC_UE_t *ue,
est_drb
->
pdcp_config
.
ext1
.
cipheringDisabled
=
1
;
else
est_drb
->
pdcp_config
.
ext1
.
cipheringDisabled
=
NR_PDCP_Config__ext1__cipheringDisabled_true
;
}
drb_t
*
rrc_drb
=
get_drb
(
ue
,
drb_id
);
DevAssert
(
rrc_drb
==
est_drb
);
/* to double check that we create the same which we would retrieve */
return
rrc_drb
;
}
NR_DRB_ToAddMod_t
*
generateDRB_ASN1
(
const
drb_t
*
drb_asn1
)
...
...
@@ -143,27 +163,20 @@ NR_DRB_ToAddMod_t *generateDRB_ASN1(const drb_t *drb_asn1)
return
DRB_config
;
}
uint8_t
next_available_drb
(
gNB_RRC_UE_t
*
ue
,
rrc_pdu_session_param_t
*
pdusession
,
bool
is_gbr
)
uint8_t
get_next_available_drb_id
(
gNB_RRC_UE_t
*
ue
)
{
uint8_t
drb_id
;
if
(
0
/*!is_gbr*/
)
{
/* Find if Non-GBR DRB exists in the same PDU Session */
for
(
drb_id
=
0
;
drb_id
<
MAX_DRBS_PER_UE
;
drb_id
++
)
if
(
pdusession
->
param
.
used_drbs
[
drb_id
]
==
DRB_ACTIVE_NONGBR
)
return
drb_id
+
1
;
}
/* GBR Flow or a Non-GBR DRB does not exist in the same PDU Session, find an available DRB */
for
(
drb_id
=
0
;
drb_id
<
MAX_DRBS_PER_UE
;
drb_id
++
)
if
(
ue
->
DRB_active
[
drb_id
]
==
DRB_INACTIVE
)
for
(
uint8_t
drb_id
=
0
;
drb_id
<
MAX_DRBS_PER_UE
;
drb_id
++
)
if
(
ue
->
established_drbs
[
drb_id
].
status
==
DRB_INACTIVE
)
return
drb_id
+
1
;
/* From this point, we need to handle the case that all DRBs are already used by the UE. */
LOG_E
(
RRC
,
"Error - All the DRBs are used - Handle this
\n
"
);
return
DRB_INACTIVE
;
}
bool
drb_is_active
(
gNB_RRC_UE_t
*
ue
,
uint8_t
drb_id
)
{
DevAssert
(
drb_id
>
0
);
if
(
ue
->
DRB_active
[
drb_id
-
1
]
==
DRB_ACTIVE
)
return
true
;
return
false
;
bool
drb_is_active
(
gNB_RRC_UE_t
*
ue
,
uint8_t
drb_id
)
{
drb_t
*
drb
=
get_drb
(
ue
,
drb_id
);
if
(
drb
==
NULL
)
return
DRB_INACTIVE
;
return
drb
->
status
!=
DRB_INACTIVE
;
}
openair2/RRC/NR/rrc_gNB_radio_bearers.h
View file @
3de71d11
...
...
@@ -39,23 +39,36 @@
/// @param drb_t drb_asn1
/// @return Returns the ASN1 DRB-ToAddMod structs.
NR_DRB_ToAddMod_t
*
generateDRB_ASN1
(
const
drb_t
*
drb_asn1
);
/// @brief Creates and stores a DRB in the gNB_RRC_UE_t struct, it doesn't create the actual entity,
/// to create the actual entity use the generateDRB_ASN1.
/// @brief retrieve the data structure representing DRB with ID drb_id of UE ue
drb_t
*
get_drb
(
gNB_RRC_UE_t
*
ue
,
uint8_t
drb_id
);
/// @brief Creates and stores a DRB in the gNB_RRC_UE_t struct
/// @param ue The gNB_RRC_UE_t struct that holds information for the UEs
/// @param drb_id The Data Radio Bearer Identity to be created for the established DRB.
/// @param pduSession The PDU Session that the DRB is created for.
/// @param enable_sdap If true the SDAP header will be added to the packet, else it will not add or search for SDAP header.
/// @param do_drb_integrity
/// @param do_drb_ciphering
void
generateDRB
(
gNB_RRC_UE_t
*
ue
,
/// @return returns a pointer to the generated DRB structure
drb_t
*
generateDRB
(
gNB_RRC_UE_t
*
ue
,
uint8_t
drb_id
,
rrc_pdu_session_param_t
*
pduSession
,
const
rrc_pdu_session_param_t
*
pduSession
,
bool
enable_sdap
,
int
do_drb_integrity
,
int
do_drb_ciphering
);
uint8_t
next_available_drb
(
gNB_RRC_UE_t
*
ue
,
rrc_pdu_session_param_t
*
pdusession
,
bool
is_gbr
);
/// @brief return the next available (inactive) DRB ID of UE ue
uint8_t
get_next_available_drb_id
(
gNB_RRC_UE_t
*
ue
);
/// @brief check if DRB with ID drb_id of UE ue is active
bool
drb_is_active
(
gNB_RRC_UE_t
*
ue
,
uint8_t
drb_id
);
/// @brief retrieve PDU session of UE ue with ID id, optionally creating it if
/// create is true
rrc_pdu_session_param_t
*
find_pduSession
(
gNB_RRC_UE_t
*
ue
,
int
id
,
bool
create
);
/// @brief get PDU session of UE ue through the DRB drb_id
rrc_pdu_session_param_t
*
find_pduSession_from_drbId
(
gNB_RRC_UE_t
*
ue
,
int
drb_id
);
#endif
openair2/SDAP/nr_sdap/nr_sdap_entity.c
View file @
3de71d11
...
...
@@ -556,7 +556,7 @@ bool nr_sdap_delete_ue_entities(ue_id_t ue_id)
entityPrev
->
next_entity
=
entityPtr
->
next_entity
;
free
(
entityPtr
);
entityPtr
=
entityPrev
->
next_entity
;
LOG_
D
(
SDAP
,
"Successfully deleted Entity.
\n
"
);
LOG_
I
(
SDAP
,
"Successfully deleted SDAP entity for UE %ld
\n
"
,
ue_id
);
ret
=
true
;
}
}
...
...
openair3/NGAP/ngap_gNB_handlers.c
View file @
3de71d11
...
...
@@ -732,7 +732,7 @@ static int ngap_gNB_handle_initial_context_request(sctp_assoc_t assoc_id, uint32
asn_INTEGER2ulong
(
&
(
ie
->
value
.
choice
.
UEAggregateMaximumBitRate
.
uEAggregateMaximumBitRateDL
),
&
(
msg
->
ue_ambr
.
br_dl
));
}
else
{
NGAP_
ERROR
(
"could not fou
nd NGAP_ProtocolIE_ID_id_UEAggregateMaximumBitRate
\n
"
);
NGAP_
WARN
(
"could not fi
nd NGAP_ProtocolIE_ID_id_UEAggregateMaximumBitRate
\n
"
);
}
...
...
@@ -755,6 +755,16 @@ static int ngap_gNB_handle_initial_context_request(sctp_assoc_t assoc_id, uint32
NGAP_PDUSessionResourceSetupItemCxtReq_t
*
item_p
=
ie
->
value
.
choice
.
PDUSessionResourceSetupListCxtReq
.
list
.
array
[
i
];
msg
->
pdusession_param
[
i
].
pdusession_id
=
item_p
->
pDUSessionID
;
OCTET_STRING_TO_INT8
(
&
item_p
->
s_NSSAI
.
sST
,
msg
->
pdusession_param
[
i
].
nssai
.
sst
);
if
(
item_p
->
s_NSSAI
.
sD
!=
NULL
)
{
uint8_t
*
sd_p
=
(
uint8_t
*
)
&
msg
->
pdusession_param
[
i
].
nssai
.
sd
;
sd_p
[
0
]
=
item_p
->
s_NSSAI
.
sD
->
buf
[
0
];
sd_p
[
1
]
=
item_p
->
s_NSSAI
.
sD
->
buf
[
1
];
sd_p
[
2
]
=
item_p
->
s_NSSAI
.
sD
->
buf
[
2
];
}
else
{
msg
->
pdusession_param
[
i
].
nssai
.
sd
=
0xffffff
;
}
if
(
item_p
->
nAS_PDU
)
{
allocCopy
(
&
msg
->
pdusession_param
[
i
].
nas_pdu
,
*
item_p
->
nAS_PDU
);
}
...
...
openair3/NGAP/ngap_gNB_nas_procedures.c
View file @
3de71d11
...
...
@@ -246,7 +246,7 @@ int ngap_gNB_handle_nas_first_req(instance_t instance, ngap_nas_first_req_t *UEf
ie
->
criticality
=
NGAP_Criticality_reject
;
ie
->
value
.
present
=
NGAP_InitialUEMessage_IEs__value_PR_FiveG_S_TMSI
;
AMF_SETID_TO_BIT_STRING
(
UEfirstReq
->
ue_identity
.
s_tmsi
.
amf_set_id
,
&
ie
->
value
.
choice
.
FiveG_S_TMSI
.
aMFSetID
);
AMF_
SETID
_TO_BIT_STRING
(
UEfirstReq
->
ue_identity
.
s_tmsi
.
amf_pointer
,
&
ie
->
value
.
choice
.
FiveG_S_TMSI
.
aMFPointer
);
AMF_
POINTER
_TO_BIT_STRING
(
UEfirstReq
->
ue_identity
.
s_tmsi
.
amf_pointer
,
&
ie
->
value
.
choice
.
FiveG_S_TMSI
.
aMFPointer
);
M_TMSI_TO_OCTET_STRING
(
UEfirstReq
->
ue_identity
.
s_tmsi
.
m_tmsi
,
&
ie
->
value
.
choice
.
FiveG_S_TMSI
.
fiveG_TMSI
);
}
...
...
@@ -631,7 +631,14 @@ int ngap_gNB_initial_ctxt_resp(instance_t instance, ngap_initial_context_setup_r
GTP_TEID_TO_ASN1
(
initial_ctxt_resp_p
->
pdusessions
[
i
].
gtp_teid
,
&
tmp
->
gTP_TEID
);
allocAddrCopy
(
&
tmp
->
transportLayerAddress
,
initial_ctxt_resp_p
->
pdusessions
[
i
].
gNB_addr
);
NGAP_DEBUG
(
"initial_ctxt_resp_p: pdusession ID %ld
\n
"
,
item
->
pDUSessionID
);
NGAP_DEBUG
(
"initial_ctxt_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld, TEID %u
\n
"
,
item
->
pDUSessionID
,
tmp
->
transportLayerAddress
.
buf
[
0
],
tmp
->
transportLayerAddress
.
buf
[
1
],
tmp
->
transportLayerAddress
.
buf
[
2
],
tmp
->
transportLayerAddress
.
buf
[
3
],
tmp
->
transportLayerAddress
.
size
,
initial_ctxt_resp_p
->
pdusessions
[
i
].
gtp_teid
);
/* associatedQosFlowList. number of 1? */
for
(
int
j
=
0
;
j
<
initial_ctxt_resp_p
->
pdusessions
[
i
].
nb_of_qos_flow
;
j
++
)
{
...
...
@@ -692,11 +699,11 @@ int ngap_gNB_initial_ctxt_resp(instance_t instance, ngap_initial_context_setup_r
case
NGAP_CAUSE_NOTHING
:
default:
LOG_E
(
NR_RRC
,
"Unknown PDU session failure cause %d
\n
"
,
initial_ctxt_resp_p
->
pdusessions_failed
[
i
].
cause
);
AssertFatal
(
false
,
"Unknown PDU session failure cause %d
\n
"
,
initial_ctxt_resp_p
->
pdusessions_failed
[
i
].
cause
);
break
;
}
NGAP_
DEBUG
(
"initial context setup response: failed pdusession ID %ld
\n
"
,
item
->
pDUSessionID
);
NGAP_
INFO
(
"initial context setup response: failed pdusession ID %ld
\n
"
,
item
->
pDUSessionID
);
asn_encode_to_new_buffer_result_t
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer
,
&
pdusessionUnTransfer
);
AssertFatal
(
res
.
buffer
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
res
.
result
.
failed_type
->
name
,
res
.
result
.
encoded
);
item
->
pDUSessionResourceSetupUnsuccessfulTransfer
.
buf
=
res
.
buffer
;
...
...
@@ -885,13 +892,14 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ngap_pdusession_setup_re
asn1cCalloc
(
pdusessionTransfer
.
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
,
tmp
);
GTP_TEID_TO_ASN1
(
pdusession
->
gtp_teid
,
&
tmp
->
gTP_TEID
);
allocAddrCopy
(
&
tmp
->
transportLayerAddress
,
pdusession
->
gNB_addr
);
NGAP_DEBUG
(
"pdusession_setup_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld
\n
"
,
NGAP_DEBUG
(
"pdusession_setup_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld
, TEID %u
\n
"
,
item
->
pDUSessionID
,
tmp
->
transportLayerAddress
.
buf
[
0
],
tmp
->
transportLayerAddress
.
buf
[
1
],
tmp
->
transportLayerAddress
.
buf
[
2
],
tmp
->
transportLayerAddress
.
buf
[
3
],
tmp
->
transportLayerAddress
.
size
);
tmp
->
transportLayerAddress
.
size
,
pdusession
->
gtp_teid
);
/* associatedQosFlowList. number of 1? */
for
(
int
j
=
0
;
j
<
pdusession_setup_resp_p
->
pdusessions
[
i
].
nb_of_qos_flow
;
j
++
)
{
asn1cSequenceAdd
(
pdusessionTransfer
.
dLQosFlowPerTNLInformation
.
associatedQosFlowList
.
list
,
NGAP_AssociatedQosFlowItem_t
,
ass_qos_item_p
);
...
...
@@ -923,7 +931,6 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ngap_pdusession_setup_re
ie
->
value
.
present
=
NGAP_PDUSessionResourceSetupResponseIEs__value_PR_PDUSessionResourceFailedToSetupListSURes
;
for
(
int
i
=
0
;
i
<
pdusession_setup_resp_p
->
nb_of_pdusessions_failed
;
i
++
)
{
LOG_W
(
NGAP
,
"add a failed session
\n
"
);
pdusession_failed_t
*
pdusession_failed
=
pdusession_setup_resp_p
->
pdusessions_failed
+
i
;
asn1cSequenceAdd
(
ie
->
value
.
choice
.
PDUSessionResourceFailedToSetupListSURes
.
list
,
NGAP_PDUSessionResourceFailedToSetupItemSURes_t
,
item
);
NGAP_PDUSessionResourceSetupUnsuccessfulTransfer_t
pdusessionUnTransfer_p
=
{
0
};
...
...
@@ -960,10 +967,10 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ngap_pdusession_setup_re
case
NGAP_CAUSE_NOTHING
:
default:
LOG_E
(
NR_RRC
,
"Unknown PDU session failure cause %d
\n
"
,
pdusession_failed
->
cause
);
AssertFatal
(
false
,
"Unknown PDU session failure cause %d
\n
"
,
pdusession_failed
->
cause
);
break
;
}
NGAP_
DEBUG
(
"pdusession setup response: failed pdusession ID %ld
\n
"
,
item
->
pDUSessionID
);
NGAP_
INFO
(
"pdusession setup response: failed pdusession ID %ld
\n
"
,
item
->
pDUSessionID
);
asn_encode_to_new_buffer_result_t
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_NGAP_PDUSessionResourceSetupUnsuccessfulTransfer
,
&
pdusessionUnTransfer_p
);
item
->
pDUSessionResourceSetupUnsuccessfulTransfer
.
buf
=
res
.
buffer
;
...
...
@@ -1124,7 +1131,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ngap_pdusession_modify_
case
NGAP_CAUSE_NOTHING
:
default:
LOG_E
(
NR_RRC
,
"Unknown PDU session failure cause %d
\n
"
,
pdusession_modify_resp_p
->
pdusessions_failed
[
i
].
cause
);
AssertFatal
(
false
,
"Unknown PDU session failure cause %d
\n
"
,
pdusession_modify_resp_p
->
pdusessions_failed
[
i
].
cause
);
break
;
}
...
...
@@ -1136,7 +1143,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ngap_pdusession_modify_
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_NGAP_PDUSessionResourceModifyUnsuccessfulTransfer
,
pdusessionTransfer_p
);
NGAP_
DEBUG
(
"pdusession_modify_resp: failed pdusession ID %ld
\n
"
,
item
->
pDUSessionID
);
NGAP_
INFO
(
"pdusession_modify_resp: failed pdusession ID %ld
\n
"
,
item
->
pDUSessionID
);
}
}
...
...
radio/rfsimulator/simulator.c
View file @
3de71d11
...
...
@@ -735,10 +735,10 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp
}
if
(
t
->
lastWroteTS
!=
0
&&
fabs
((
double
)
t
->
lastWroteTS
-
timestamp
)
>
(
double
)
CirSize
)
LOG_
E
(
HW
,
"Discontinuous TX gap too large Tx:%lu, %lu
\n
"
,
t
->
lastWroteTS
,
timestamp
);
LOG_
W
(
HW
,
"Discontinuous TX gap too large Tx:%lu, %lu
\n
"
,
t
->
lastWroteTS
,
timestamp
);
if
(
t
->
lastWroteTS
>
timestamp
+
nsamps
)
LOG_
E
(
HW
,
"Not supported to send Tx out of order (same in USRP)
%lu, %lu
\n
"
,
t
->
lastWroteTS
,
timestamp
);
LOG_
W
(
HW
,
"Not supported to send Tx out of order
%lu, %lu
\n
"
,
t
->
lastWroteTS
,
timestamp
);
t
->
lastWroteTS
=
timestamp
+
nsamps
;
...
...
@@ -872,14 +872,14 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi
}
else
if
(
b
->
lastReceivedTS
==
b
->
th
.
timestamp
)
{
// normal case
}
else
{
LOG_
E
(
HW
,
"Received data in past: current is %lu, new reception: %lu!
\n
"
,
b
->
lastReceivedTS
,
b
->
th
.
timestamp
);
LOG_
W
(
HW
,
"Received data in past: current is %lu, new reception: %lu!
\n
"
,
b
->
lastReceivedTS
,
b
->
th
.
timestamp
);
b
->
trashingPacket
=
true
;
}
pthread_mutex_lock
(
&
Sockmutex
);
if
(
t
->
lastWroteTS
!=
0
&&
(
fabs
((
double
)
t
->
lastWroteTS
-
b
->
lastReceivedTS
)
>
(
double
)
CirSize
))
LOG_
E
(
HW
,
"UEsock(%d) Tx/Rx shift too large Tx:%lu, Rx:%lu
\n
"
,
fd
,
t
->
lastWroteTS
,
b
->
lastReceivedTS
);
LOG_
W
(
HW
,
"UEsock(%d) Tx/Rx shift too large Tx:%lu, Rx:%lu
\n
"
,
fd
,
t
->
lastWroteTS
,
b
->
lastReceivedTS
);
pthread_mutex_unlock
(
&
Sockmutex
);
b
->
transferPtr
=
(
char
*
)
&
b
->
circularBuf
[(
b
->
lastReceivedTS
*
b
->
th
.
nbAnt
)
%
CirSize
];
...
...
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