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
zzha zzha
OpenXG-RAN
Commits
18892963
Commit
18892963
authored
1 year ago
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup and fixes
parent
3d824e39
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
423 additions
and
499 deletions
+423
-499
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+2
-3
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+2
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+35
-25
openair2/LAYER2/nr_pdcp/nr_pdcp_e1_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_e1_api.c
+1
-2
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+19
-11
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h
+4
-7
openair2/LAYER2/nr_rlc/asn1_utils.c
openair2/LAYER2/nr_rlc/asn1_utils.c
+1
-1
openair2/LAYER2/nr_rlc/nr_rlc_entity.c
openair2/LAYER2/nr_rlc/nr_rlc_entity.c
+1
-3
openair2/LAYER2/nr_rlc/nr_rlc_entity.h
openair2/LAYER2/nr_rlc/nr_rlc_entity.h
+1
-3
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+35
-69
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h
+2
-6
openair2/RRC/NR/nr_rrc_common.h
openair2/RRC/NR/nr_rrc_common.h
+8
-8
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+4
-3
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+304
-349
openair2/RRC/NR_UE/rrc_defs.h
openair2/RRC/NR_UE/rrc_defs.h
+4
-8
No files found.
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
18892963
...
@@ -516,7 +516,7 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
...
@@ -516,7 +516,7 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
struct
NR_CellGroupConfig__rlc_BearerToReleaseList
*
rlc_torelease_list
)
struct
NR_CellGroupConfig__rlc_BearerToReleaseList
*
rlc_torelease_list
)
{
{
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
if
(
rlc_toadd_list
)
{
if
(
rlc_toadd_list
)
{
for
(
int
i
=
0
;
i
<
rlc_toadd_list
->
list
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
rlc_toadd_list
->
list
.
count
;
i
++
)
{
NR_RLC_BearerConfig_t
*
rlc_bearer
=
rlc_toadd_list
->
list
.
array
[
i
];
NR_RLC_BearerConfig_t
*
rlc_bearer
=
rlc_toadd_list
->
list
.
array
[
i
];
int
id
=
rlc_bearer
->
logicalChannelIdentity
-
1
;
int
id
=
rlc_bearer
->
logicalChannelIdentity
-
1
;
...
@@ -525,7 +525,7 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
...
@@ -525,7 +525,7 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
}
}
if
(
rlc_torelease_list
)
{
if
(
rlc_torelease_list
)
{
for
(
int
i
=
0
;
i
<
rlc_torelease_list
->
list
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
rlc_torelease_list
->
list
.
count
;
i
++
)
{
if
(
rlc_torelease_list
->
list
.
array
[
i
])
{
if
(
rlc_torelease_list
->
list
.
array
[
i
])
{
int
id
=
*
rlc_torelease_list
->
list
.
array
[
i
]
-
1
;
int
id
=
*
rlc_torelease_list
->
list
.
array
[
i
]
-
1
;
mac
->
active_RLC_bearer
[
id
]
=
false
;
mac
->
active_RLC_bearer
[
id
]
=
false
;
}
}
...
@@ -533,7 +533,6 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
...
@@ -533,7 +533,6 @@ void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
}
}
}
}
void
configure_current_BWP
(
NR_UE_MAC_INST_t
*
mac
,
void
configure_current_BWP
(
NR_UE_MAC_INST_t
*
mac
,
NR_ServingCellConfigCommonSIB_t
*
scc
,
NR_ServingCellConfigCommonSIB_t
*
scc
,
NR_CellGroupConfig_t
*
cell_group_config
)
NR_CellGroupConfig_t
*
cell_group_config
)
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
View file @
18892963
...
@@ -51,7 +51,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
...
@@ -51,7 +51,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
//LOG_I(MAC, "[MAIN] init UE MAC functions \n");
//LOG_I(MAC, "[MAIN] init UE MAC functions \n");
//init mac here
//init mac here
nr_ue_mac_inst
=
(
NR_UE_MAC_INST_t
*
)
calloc
(
sizeof
(
NR_UE_MAC_INST_t
),
NB_NR_UE_MAC_INST
);
nr_ue_mac_inst
=
(
NR_UE_MAC_INST_t
*
)
calloc
(
NB_NR_UE_MAC_INST
,
sizeof
(
NR_UE_MAC_INST_t
)
);
for
(
int
j
=
0
;
j
<
NB_NR_UE_MAC_INST
;
j
++
)
for
(
int
j
=
0
;
j
<
NB_NR_UE_MAC_INST
;
j
++
)
nr_ue_init_mac
(
j
);
nr_ue_init_mac
(
j
);
...
@@ -80,6 +80,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
...
@@ -80,6 +80,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
nr_rlc_add_drb
(
nr_ue_mac_inst
->
crnti
,
rbconfig
->
drb_ToAddModList
->
list
.
array
[
0
]
->
drb_Identity
,
rlc_rbconfig
);
nr_rlc_add_drb
(
nr_ue_mac_inst
->
crnti
,
rbconfig
->
drb_ToAddModList
->
list
.
array
[
0
]
->
drb_Identity
,
rlc_rbconfig
);
struct
NR_CellGroupConfig__rlc_BearerToAddModList
rlc_toadd_list
;
struct
NR_CellGroupConfig__rlc_BearerToAddModList
rlc_toadd_list
;
rlc_toadd_list
.
list
.
count
=
1
;
rlc_toadd_list
.
list
.
count
=
1
;
rlc_toadd_list
.
list
.
array
=
calloc
(
1
,
sizeof
(
NR_RLC_BearerConfig_t
));
rlc_toadd_list
.
list
.
array
[
0
]
=
rlc_rbconfig
;
rlc_toadd_list
.
list
.
array
[
0
]
=
rlc_rbconfig
;
nr_rrc_mac_config_req_ue_logicalChannelBearer
(
0
,
&
rlc_toadd_list
,
NULL
);
nr_rrc_mac_config_req_ue_logicalChannelBearer
(
0
,
&
rlc_toadd_list
,
NULL
);
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
18892963
...
@@ -1211,10 +1211,13 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
...
@@ -1211,10 +1211,13 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
*/
*/
{
{
bsr_regular_triggered
=
true
;
bsr_regular_triggered
=
true
;
LOG_D
(
NR_MAC
,
"[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d slot %d
\n
"
,
LOG_D
(
NR_MAC
,
module_idP
,
lcid
,
"[UE %d] PDCCH Tick : MAC BSR Triggered LCID%d LCGID%d data become available at frame %d slot %d
\n
"
,
module_idP
,
lcid
,
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
],
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
],
frameP
,
slotP
);
frameP
,
slotP
);
break
;
break
;
}
}
}
}
...
@@ -2687,13 +2690,13 @@ Update the following in mac_ce_p:
...
@@ -2687,13 +2690,13 @@ Update the following in mac_ce_p:
bsr_t
bsr_t
*/
*/
void
nr_ue_get_sdu_mac_ce_post
(
module_id_t
module_idP
,
void
nr_ue_get_sdu_mac_ce_post
(
module_id_t
module_idP
,
int
CC_id
,
int
CC_id
,
frame_t
frameP
,
frame_t
frameP
,
sub_frame_t
subframe
,
sub_frame_t
subframe
,
uint8_t
gNB_index
,
uint8_t
gNB_index
,
uint8_t
*
ulsch_buffer
,
uint8_t
*
ulsch_buffer
,
uint16_t
buflen
,
uint16_t
buflen
,
NR_UE_MAC_CE_INFO
*
mac_ce_p
)
NR_UE_MAC_CE_INFO
*
mac_ce_p
)
{
{
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_idP
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_idP
);
...
@@ -2896,7 +2899,9 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
...
@@ -2896,7 +2899,9 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
continue
;
continue
;
buflen_remain
=
buflen
-
(
mac_ce_p
->
total_mac_pdu_header_len
+
mac_ce_p
->
sdu_length_total
+
sh_size
);
buflen_remain
=
buflen
-
(
mac_ce_p
->
total_mac_pdu_header_len
+
mac_ce_p
->
sdu_length_total
+
sh_size
);
LOG_D
(
NR_MAC
,
"[UE %d] [%d.%d] UL-DXCH -> ULSCH, RLC with LCID 0x%02x (TBS %d bytes, sdu_length_total %d bytes, MAC header len %d bytes, buflen_remain %d bytes)
\n
"
,
LOG_D
(
NR_MAC
,
"[UE %d] [%d.%d] UL-DXCH -> ULSCH, RLC with LCID 0x%02x (TBS %d bytes, sdu_length_total %d bytes, MAC header len %d "
"bytes, buflen_remain %d bytes)
\n
"
,
module_idP
,
module_idP
,
frameP
,
frameP
,
subframe
,
subframe
,
...
@@ -2907,7 +2912,6 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
...
@@ -2907,7 +2912,6 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
buflen_remain
);
buflen_remain
);
while
(
buflen_remain
>
0
)
{
while
(
buflen_remain
>
0
)
{
// Pointer used to build the MAC sub-PDU headers in the ULSCH buffer for each SDU
// Pointer used to build the MAC sub-PDU headers in the ULSCH buffer for each SDU
NR_MAC_SUBHEADER_LONG
*
header
=
(
NR_MAC_SUBHEADER_LONG
*
)
pdu
;
NR_MAC_SUBHEADER_LONG
*
header
=
(
NR_MAC_SUBHEADER_LONG
*
)
pdu
;
...
@@ -2925,21 +2929,23 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
...
@@ -2925,21 +2929,23 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
0
,
0
,
0
);
0
);
AssertFatal
(
buflen_remain
>=
sdu_length
,
"LCID = 0x%02x RLC has segmented %d bytes but MAC has max %d remaining bytes
\n
"
,
AssertFatal
(
buflen_remain
>=
sdu_length
,
"LCID = 0x%02x RLC has segmented %d bytes but MAC has max %d remaining bytes
\n
"
,
lcid
,
lcid
,
sdu_length
,
sdu_length
,
buflen_remain
);
buflen_remain
);
if
(
sdu_length
>
0
)
{
if
(
sdu_length
>
0
)
{
LOG_D
(
NR_MAC
,
LOG_D
(
NR_MAC
,
"[UE %d] [%d.%d] UL-DXCH -> ULSCH, Generating UL MAC sub-PDU for SDU %d, length %d bytes, RB with LCID 0x%02x (buflen (TBS) %d bytes)
\n
"
,
"[UE %d] [%d.%d] UL-DXCH -> ULSCH, Generating UL MAC sub-PDU for SDU %d, length %d bytes, RB with LCID 0x%02x "
module_idP
,
"(buflen (TBS) %d bytes)
\n
"
,
frameP
,
module_idP
,
subframe
,
frameP
,
num_sdus
+
1
,
subframe
,
sdu_length
,
num_sdus
+
1
,
lcid
,
sdu_length
,
buflen
);
lcid
,
buflen
);
header
->
R
=
0
;
header
->
R
=
0
;
header
->
F
=
1
;
header
->
F
=
1
;
...
@@ -2969,9 +2975,13 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
...
@@ -2969,9 +2975,13 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
//Update Buffer remain and BSR bytes after transmission
//Update Buffer remain and BSR bytes after transmission
mac
->
scheduling_info
.
LCID_buffer_remain
[
lcid
-
1
]
-=
sdu_length
;
mac
->
scheduling_info
.
LCID_buffer_remain
[
lcid
-
1
]
-=
sdu_length
;
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]
-=
sdu_length
;
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]
-=
sdu_length
;
LOG_D
(
NR_MAC
,
"[UE %d] Update BSR [%d.%d] BSR_bytes for LCG%d=%d
\n
"
,
LOG_D
(
NR_MAC
,
module_idP
,
frameP
,
subframe
,
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
],
"[UE %d] Update BSR [%d.%d] BSR_bytes for LCG%d=%d
\n
"
,
module_idP
,
frameP
,
subframe
,
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
],
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]);
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]);
if
(
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]
<
0
)
if
(
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]
<
0
)
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]
=
0
;
mac
->
scheduling_info
.
BSR_bytes
[
mac
->
scheduling_info
.
LCGID
[
lcid
-
1
]]
=
0
;
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_pdcp/nr_pdcp_e1_api.c
View file @
18892963
...
@@ -32,8 +32,7 @@ void e1_add_drb(int is_gnb,
...
@@ -32,8 +32,7 @@ void e1_add_drb(int is_gnb,
unsigned
char
*
ciphering_key
,
unsigned
char
*
ciphering_key
,
unsigned
char
*
integrity_key
)
unsigned
char
*
integrity_key
)
{
{
add_drb
(
is_gnb
,
ue_id
,
s
,
ciphering_algorithm
,
integrity_algorithm
,
add_drb
(
is_gnb
,
ue_id
,
s
,
ciphering_algorithm
,
integrity_algorithm
,
ciphering_key
,
integrity_key
);
ciphering_key
,
integrity_key
);
LOG_I
(
PDCP
,
"%s:%s:%d: added DRB for UE ID %ld
\n
"
,
__FILE__
,
__FUNCTION__
,
__LINE__
,
ue_id
);
LOG_I
(
PDCP
,
"%s:%s:%d: added DRB for UE ID %ld
\n
"
,
__FILE__
,
__FUNCTION__
,
__LINE__
,
ue_id
);
}
}
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
18892963
...
@@ -770,14 +770,19 @@ void add_srb(int is_gnb,
...
@@ -770,14 +770,19 @@ void add_srb(int is_gnb,
int
srb_id
=
s
->
srb_Identity
;
int
srb_id
=
s
->
srb_Identity
;
int
t_Reordering
=
-
1
;
// infinity as per default SRB configuration in 9.2.1 of 38.331
int
t_Reordering
=
-
1
;
// infinity as per default SRB configuration in 9.2.1 of 38.331
if
(
s
->
pdcp_Config
!=
NULL
&&
if
(
s
->
pdcp_Config
!=
NULL
&&
s
->
pdcp_Config
->
t_Reordering
!=
NULL
)
s
->
pdcp_Config
->
t_Reordering
!=
NULL
)
t_Reordering
=
decode_t_reordering
(
*
s
->
pdcp_Config
->
t_Reordering
);
t_Reordering
=
decode_t_reordering
(
*
s
->
pdcp_Config
->
t_Reordering
);
nr_pdcp_manager_lock
(
nr_pdcp_ue_manager
);
nr_pdcp_manager_lock
(
nr_pdcp_ue_manager
);
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
rntiMaybeUEid
);
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
rntiMaybeUEid
);
if
(
ue
->
srb
[
srb_id
-
1
]
!=
NULL
)
{
if
(
ue
->
srb
[
srb_id
-
1
]
!=
NULL
)
{
LOG_E
(
PDCP
,
"%s:%d:%s: warning SRB %d already exist for UE ID/RNTI %ld, do nothing
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
srb_id
,
rntiMaybeUEid
);
LOG_E
(
PDCP
,
"%s:%d:%s: warning SRB %d already exist for UE ID/RNTI %ld, do nothing
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
srb_id
,
rntiMaybeUEid
);
}
else
{
}
else
{
pdcp_srb
=
new_nr_pdcp_entity
(
NR_PDCP_SRB
,
is_gnb
,
srb_id
,
pdcp_srb
=
new_nr_pdcp_entity
(
NR_PDCP_SRB
,
is_gnb
,
srb_id
,
0
,
false
,
false
,
// sdap parameters
0
,
false
,
false
,
// sdap parameters
...
@@ -794,7 +799,8 @@ void add_srb(int is_gnb,
...
@@ -794,7 +799,8 @@ void add_srb(int is_gnb,
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
}
}
void
add_drb
(
int
is_gnb
,
ue_id_t
rntiMaybeUEid
,
void
add_drb
(
int
is_gnb
,
ue_id_t
rntiMaybeUEid
,
struct
NR_DRB_ToAddMod
*
s
,
struct
NR_DRB_ToAddMod
*
s
,
int
ciphering_algorithm
,
int
ciphering_algorithm
,
int
integrity_algorithm
,
int
integrity_algorithm
,
...
@@ -912,7 +918,13 @@ void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
...
@@ -912,7 +918,13 @@ void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
{
{
if
(
drb2add_list
!=
NULL
)
{
if
(
drb2add_list
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
drb2add_list
->
list
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
drb2add_list
->
list
.
count
;
i
++
)
{
add_drb
(
enb_flag
,
rntiMaybeUEid
,
drb2add_list
->
list
.
array
[
i
],
security_modeP
&
0x0f
,
(
security_modeP
>>
4
)
&
0x0f
,
kUPenc
,
kUPint
);
add_drb
(
enb_flag
,
rntiMaybeUEid
,
drb2add_list
->
list
.
array
[
i
],
security_modeP
&
0x0f
,
(
security_modeP
>>
4
)
&
0x0f
,
kUPenc
,
kUPint
);
}
}
}
else
}
else
LOG_W
(
PDCP
,
"nr_pdcp_add_drbs() with void list
\n
"
);
LOG_W
(
PDCP
,
"nr_pdcp_add_drbs() with void list
\n
"
);
...
@@ -1045,9 +1057,7 @@ bool nr_pdcp_data_req_srb(ue_id_t ue_id,
...
@@ -1045,9 +1057,7 @@ bool nr_pdcp_data_req_srb(ue_id_t ue_id,
return
1
;
return
1
;
}
}
void
nr_pdcp_reconfigure_srb
(
ue_id_t
ue_id
,
void
nr_pdcp_reconfigure_srb
(
ue_id_t
ue_id
,
int
srb_id
,
long
t_Reordering
)
int
srb_id
,
long
t_Reordering
)
{
{
nr_pdcp_manager_lock
(
nr_pdcp_ue_manager
);
nr_pdcp_manager_lock
(
nr_pdcp_ue_manager
);
nr_pdcp_ue_t
*
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
ue_id
);
nr_pdcp_ue_t
*
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
ue_id
);
...
@@ -1057,9 +1067,7 @@ void nr_pdcp_reconfigure_srb(ue_id_t ue_id,
...
@@ -1057,9 +1067,7 @@ void nr_pdcp_reconfigure_srb(ue_id_t ue_id,
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
}
}
void
nr_pdcp_reconfigure_drb
(
ue_id_t
ue_id
,
void
nr_pdcp_reconfigure_drb
(
ue_id_t
ue_id
,
int
drb_id
,
long
t_Reordering
)
int
drb_id
,
long
t_Reordering
)
{
{
// The enabling/disabling of ciphering or integrity protection
// The enabling/disabling of ciphering or integrity protection
// can be changed only by releasing and adding the DRB
// can be changed only by releasing and adding the DRB
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h
View file @
18892963
...
@@ -53,7 +53,8 @@ void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
...
@@ -53,7 +53,8 @@ void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
uint8_t
*
const
kUPenc
,
uint8_t
*
const
kUPenc
,
uint8_t
*
const
kUPint
);
uint8_t
*
const
kUPint
);
void
add_drb
(
int
is_gnb
,
ue_id_t
rntiMaybeUEid
,
void
add_drb
(
int
is_gnb
,
ue_id_t
rntiMaybeUEid
,
struct
NR_DRB_ToAddMod
*
s
,
struct
NR_DRB_ToAddMod
*
s
,
int
ciphering_algorithm
,
int
ciphering_algorithm
,
int
integrity_algorithm
,
int
integrity_algorithm
,
...
@@ -65,12 +66,8 @@ void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
...
@@ -65,12 +66,8 @@ void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
bool
nr_pdcp_remove_UE
(
ue_id_t
ue_id
);
bool
nr_pdcp_remove_UE
(
ue_id_t
ue_id
);
void
nr_pdcp_reestablishment
(
ue_id_t
ue_id
);
void
nr_pdcp_reestablishment
(
ue_id_t
ue_id
);
void
nr_pdcp_reconfigure_srb
(
ue_id_t
ue_id
,
void
nr_pdcp_reconfigure_srb
(
ue_id_t
ue_id
,
int
srb_id
,
long
t_Reordering
);
int
srb_id
,
void
nr_pdcp_reconfigure_drb
(
ue_id_t
ue_id
,
int
drb_id
,
long
t_Reordering
);
long
t_Reordering
);
void
nr_pdcp_reconfigure_drb
(
ue_id_t
ue_id
,
int
drb_id
,
long
t_Reordering
);
void
add_srb
(
int
is_gnb
,
void
add_srb
(
int
is_gnb
,
ue_id_t
rntiMaybeUEid
,
ue_id_t
rntiMaybeUEid
,
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_rlc/asn1_utils.c
View file @
18892963
...
@@ -67,7 +67,7 @@ int decode_poll_pdu(int v)
...
@@ -67,7 +67,7 @@ int decode_poll_pdu(int v)
{
{
static
const
int
tab
[
24
]
=
{
static
const
int
tab
[
24
]
=
{
4
,
8
,
16
,
32
,
64
,
128
,
256
,
512
,
1024
,
2048
,
4096
,
6144
,
4
,
8
,
16
,
32
,
64
,
128
,
256
,
512
,
1024
,
2048
,
4096
,
6144
,
8192
,
12288
,
16384
,
20480
,
24576
,
28672
,
32768
,
40960
,
49152
,
57344
,
65536
,
-
1
/* -1 means infinity */
8192
,
12288
,
16384
,
20480
,
24576
,
28672
,
32768
,
40960
,
49152
,
57344
,
65536
,
-
1
/* -1 means infinity */
};
};
if
(
v
<
0
||
v
>
23
)
{
if
(
v
<
0
||
v
>
23
)
{
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_rlc/nr_rlc_entity.c
View file @
18892963
...
@@ -244,9 +244,7 @@ nr_rlc_entity_t *new_nr_rlc_entity_tm(
...
@@ -244,9 +244,7 @@ nr_rlc_entity_t *new_nr_rlc_entity_tm(
return
(
nr_rlc_entity_t
*
)
ret
;
return
(
nr_rlc_entity_t
*
)
ret
;
}
}
void
nr_rlc_entity_um_reconfigure
(
nr_rlc_entity_t
*
_entity
,
void
nr_rlc_entity_um_reconfigure
(
nr_rlc_entity_t
*
_entity
,
int
t_reassembly
,
int
*
sn_field_length
)
int
t_reassembly
,
int
*
sn_field_length
)
{
{
nr_rlc_entity_um_t
*
entity
=
(
nr_rlc_entity_um_t
*
)
_entity
;
nr_rlc_entity_um_t
*
entity
=
(
nr_rlc_entity_um_t
*
)
_entity
;
entity
->
t_reassembly
=
t_reassembly
;
entity
->
t_reassembly
=
t_reassembly
;
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_rlc/nr_rlc_entity.h
View file @
18892963
...
@@ -176,9 +176,7 @@ nr_rlc_entity_t *new_nr_rlc_entity_tm(
...
@@ -176,9 +176,7 @@ nr_rlc_entity_t *new_nr_rlc_entity_tm(
char
*
buf
,
int
size
),
char
*
buf
,
int
size
),
void
*
deliver_sdu_data
);
void
*
deliver_sdu_data
);
void
nr_rlc_entity_um_reconfigure
(
nr_rlc_entity_t
*
_entity
,
void
nr_rlc_entity_um_reconfigure
(
nr_rlc_entity_t
*
_entity
,
int
t_reassembly
,
int
*
sn_field_length
);
int
t_reassembly
,
int
*
sn_field_length
);
void
nr_rlc_entity_am_reconfigure
(
nr_rlc_entity_t
*
_entity
,
void
nr_rlc_entity_am_reconfigure
(
nr_rlc_entity_t
*
_entity
,
int
t_poll_retransmit
,
int
t_poll_retransmit
,
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
18892963
...
@@ -71,38 +71,22 @@ static nr_rlc_entity_t *get_rlc_entity_from_lcid(nr_rlc_ue_t *ue, logical_chan_i
...
@@ -71,38 +71,22 @@ static nr_rlc_entity_t *get_rlc_entity_from_lcid(nr_rlc_ue_t *ue, logical_chan_i
}
}
}
}
void
nr_release_rlc_entity
(
int
rnti
,
void
nr_release_rlc_entity
(
int
rnti
,
logical_chan_id_t
channel_id
)
logical_chan_id_t
channel_id
)
{
{
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_ue_t
*
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
nr_rlc_ue_t
*
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
if
(
channel_id
==
0
)
{
if
(
channel_id
==
0
)
{
if
(
ue
->
srb0
!=
NULL
)
{
if
(
ue
->
srb0
!=
NULL
)
{
free
(
ue
->
srb0
->
deliver_sdu_data
);
free
(
ue
->
srb0
->
deliver_sdu_data
);
ue
->
srb0
->
delete
(
ue
->
srb0
);
ue
->
srb0
->
delete
(
ue
->
srb0
);
}
}
else
LOG_E
(
RLC
,
"Trying to release a non-established enity with LCID %d
\n
"
,
channel_id
);
}
else
{
nr_rlc_entity_t
*
rb
=
get_rlc_entity_from_lcid
(
ue
,
channel_id
);
if
(
rb
)
rb
->
delete
(
rb
);
else
else
LOG_E
(
RLC
,
"Trying to release a non-established enity with LCID %d
\n
"
,
LOG_E
(
RLC
,
"Trying to release a non-established enity with LCID %d
\n
"
,
channel_id
);
channel_id
);
}
else
{
nr_rlc_rb_t
*
rb
=
&
ue
->
lcid2rb
[
channel_id
-
1
];
if
(
rb
->
type
==
NR_RLC_SRB
)
{
if
(
ue
->
srb
[
rb
->
choice
.
srb_id
-
1
]
!=
NULL
)
ue
->
srb
[
rb
->
choice
.
srb_id
-
1
]
->
delete
(
ue
->
srb
[
rb
->
choice
.
srb_id
-
1
]);
else
LOG_E
(
RLC
,
"Trying to release a non-established enity with LCID %d
\n
"
,
channel_id
);
}
else
{
AssertFatal
(
rb
->
type
==
NR_RLC_DRB
,
"Invalid RB type
\n
"
);
if
(
ue
->
drb
[
rb
->
choice
.
drb_id
-
1
]
!=
NULL
)
ue
->
drb
[
rb
->
choice
.
drb_id
-
1
]
->
delete
(
ue
->
drb
[
rb
->
choice
.
drb_id
-
1
]);
else
LOG_E
(
RLC
,
"Trying to release a non-established enity with LCID %d
\n
"
,
channel_id
);
}
}
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
}
...
@@ -623,7 +607,7 @@ void nr_rlc_reestablish_entity(int rnti, int lc_id)
...
@@ -623,7 +607,7 @@ void nr_rlc_reestablish_entity(int rnti, int lc_id)
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_ue_t
*
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
nr_rlc_ue_t
*
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
if
(
ue
==
NULL
)
if
(
ue
==
NULL
)
LOG_E
(
RLC
,
"RLC instance for the given UE was not found
\n
"
);
LOG_E
(
RLC
,
"RLC instance for the given UE was not found
\n
"
);
nr_rlc_entity_t
*
rb
=
get_rlc_entity_from_lcid
(
ue
,
lc_id
);
nr_rlc_entity_t
*
rb
=
get_rlc_entity_from_lcid
(
ue
,
lc_id
);
...
@@ -632,16 +616,12 @@ void nr_rlc_reestablish_entity(int rnti, int lc_id)
...
@@ -632,16 +616,12 @@ void nr_rlc_reestablish_entity(int rnti, int lc_id)
LOG_D
(
RLC
,
"RB found! (channel ID %d)
\n
"
,
lc_id
);
LOG_D
(
RLC
,
"RB found! (channel ID %d)
\n
"
,
lc_id
);
rb
->
reestablishment
(
rb
);
rb
->
reestablishment
(
rb
);
}
else
{
}
else
{
LOG_E
(
RLC
,
"no RLC entity found (channel ID %d) for reestablishment
\n
"
,
LOG_E
(
RLC
,
"no RLC entity found (channel ID %d) for reestablishment
\n
"
,
lc_id
);
lc_id
);
}
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
}
void
nr_rlc_reconfigure_entity
(
int
rnti
,
void
nr_rlc_reconfigure_entity
(
int
rnti
,
int
lc_id
,
struct
NR_RLC_Config
*
rlc_Config
,
struct
NR_LogicalChannelConfig
*
lc_Config
)
int
lc_id
,
struct
NR_RLC_Config
*
rlc_Config
,
struct
NR_LogicalChannelConfig
*
lc_Config
)
{
{
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_ue_t
*
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
nr_rlc_ue_t
*
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
...
@@ -651,16 +631,14 @@ void nr_rlc_reconfigure_entity(int rnti,
...
@@ -651,16 +631,14 @@ void nr_rlc_reconfigure_entity(int rnti,
nr_rlc_entity_t
*
rb
=
get_rlc_entity_from_lcid
(
ue
,
lc_id
);
nr_rlc_entity_t
*
rb
=
get_rlc_entity_from_lcid
(
ue
,
lc_id
);
if
(
lc_Config
)
{
if
(
lc_Config
)
{
if
(
lc_Config
->
ul_SpecificParameters
&&
if
(
lc_Config
->
ul_SpecificParameters
&&
lc_Config
->
ul_SpecificParameters
->
logicalChannelGroup
)
lc_Config
->
ul_SpecificParameters
->
logicalChannelGroup
)
AssertFatal
(
*
lc_Config
->
ul_SpecificParameters
->
logicalChannelGroup
<
2
,
AssertFatal
(
*
lc_Config
->
ul_SpecificParameters
->
logicalChannelGroup
==
0
,
"LCG %ld not supported as per limitation when creating RBs
\n
"
,
"LCG %ld not supported
\n
"
,
*
lc_Config
->
ul_SpecificParameters
->
logicalChannelGroup
);
*
lc_Config
->
ul_SpecificParameters
->
logicalChannelGroup
);
}
}
if
(
rlc_Config
)
{
if
(
rlc_Config
)
{
if
(
rb
->
stats
.
mode
==
NR_RLC_AM
)
{
if
(
rb
->
stats
.
mode
==
NR_RLC_AM
)
{
AssertFatal
(
rlc_Config
->
present
==
NR_RLC_Config_PR_am
,
AssertFatal
(
rlc_Config
->
present
==
NR_RLC_Config_PR_am
,
"Invalid RLC Config type
\n
"
);
"Invalid RLC Config type
\n
"
);
struct
NR_RLC_Config__am
*
am
=
rlc_Config
->
choice
.
am
;
struct
NR_RLC_Config__am
*
am
=
rlc_Config
->
choice
.
am
;
int
t_reassembly
=
decode_t_reassembly
(
am
->
dl_AM_RLC
.
t_Reassembly
);
int
t_reassembly
=
decode_t_reassembly
(
am
->
dl_AM_RLC
.
t_Reassembly
);
int
t_status_prohibit
=
decode_t_status_prohibit
(
am
->
dl_AM_RLC
.
t_StatusProhibit
);
int
t_status_prohibit
=
decode_t_status_prohibit
(
am
->
dl_AM_RLC
.
t_StatusProhibit
);
...
@@ -668,20 +646,18 @@ void nr_rlc_reconfigure_entity(int rnti,
...
@@ -668,20 +646,18 @@ void nr_rlc_reconfigure_entity(int rnti,
int
poll_pdu
=
decode_poll_pdu
(
am
->
ul_AM_RLC
.
pollPDU
);
int
poll_pdu
=
decode_poll_pdu
(
am
->
ul_AM_RLC
.
pollPDU
);
int
poll_byte
=
decode_poll_byte
(
am
->
ul_AM_RLC
.
pollByte
);
int
poll_byte
=
decode_poll_byte
(
am
->
ul_AM_RLC
.
pollByte
);
int
max_retx_threshold
=
decode_max_retx_threshold
(
am
->
ul_AM_RLC
.
maxRetxThreshold
);
int
max_retx_threshold
=
decode_max_retx_threshold
(
am
->
ul_AM_RLC
.
maxRetxThreshold
);
int
_sn_field_length
;
int
*
sn_field_length
=
NULL
;
int
*
sn_field_length
=
NULL
;
if
(
am
->
dl_AM_RLC
.
sn_FieldLength
)
{
if
(
am
->
dl_AM_RLC
.
sn_FieldLength
)
{
AssertFatal
(
am
->
ul_AM_RLC
.
sn_FieldLength
!=
NULL
,
AssertFatal
(
am
->
ul_AM_RLC
.
sn_FieldLength
!=
NULL
,
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
if
(
am
->
ul_AM_RLC
.
sn_FieldLength
)
{
if
(
am
->
ul_AM_RLC
.
sn_FieldLength
)
{
AssertFatal
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
==
*
am
->
ul_AM_RLC
.
sn_FieldLength
,
AssertFatal
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
==
*
am
->
ul_AM_RLC
.
sn_FieldLength
,
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
sn_field_length
=
calloc
(
1
,
sizeof
(
*
sn_field_length
)
);
_sn_field_length
=
decode_sn_field_length_am
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
);
*
sn_field_length
=
decode_sn_field_length_am
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
)
;
sn_field_length
=
&
_sn_field_length
;
}
}
}
}
else
else
AssertFatal
(
am
->
ul_AM_RLC
.
sn_FieldLength
==
NULL
,
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
AssertFatal
(
am
->
ul_AM_RLC
.
sn_FieldLength
==
NULL
,
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
nr_rlc_entity_am_reconfigure
(
rb
,
nr_rlc_entity_am_reconfigure
(
rb
,
t_poll_retransmit
,
t_poll_retransmit
,
t_reassembly
,
t_reassembly
,
...
@@ -690,29 +666,23 @@ void nr_rlc_reconfigure_entity(int rnti,
...
@@ -690,29 +666,23 @@ void nr_rlc_reconfigure_entity(int rnti,
poll_byte
,
poll_byte
,
max_retx_threshold
,
max_retx_threshold
,
sn_field_length
);
sn_field_length
);
}
}
else
{
// UM
else
{
// UM
AssertFatal
(
rlc_Config
->
present
==
NR_RLC_Config_PR_um_Bi_Directional
,
"Invalid RLC Config type
\n
"
);
AssertFatal
(
rlc_Config
->
present
==
NR_RLC_Config_PR_um_Bi_Directional
,
"Invalid RLC Config type
\n
"
);
struct
NR_RLC_Config__um_Bi_Directional
*
um
=
rlc_Config
->
choice
.
um_Bi_Directional
;
struct
NR_RLC_Config__um_Bi_Directional
*
um
=
rlc_Config
->
choice
.
um_Bi_Directional
;
int
t_reassembly
=
decode_t_reassembly
(
um
->
dl_UM_RLC
.
t_Reassembly
);
int
t_reassembly
=
decode_t_reassembly
(
um
->
dl_UM_RLC
.
t_Reassembly
);
int
_sn_field_length
;
int
*
sn_field_length
=
NULL
;
int
*
sn_field_length
=
NULL
;
if
(
um
->
dl_UM_RLC
.
sn_FieldLength
)
{
if
(
um
->
dl_UM_RLC
.
sn_FieldLength
)
{
AssertFatal
(
um
->
ul_UM_RLC
.
sn_FieldLength
!=
NULL
,
AssertFatal
(
um
->
ul_UM_RLC
.
sn_FieldLength
!=
NULL
,
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
if
(
um
->
ul_UM_RLC
.
sn_FieldLength
)
{
if
(
um
->
ul_UM_RLC
.
sn_FieldLength
)
{
AssertFatal
(
*
um
->
dl_UM_RLC
.
sn_FieldLength
==
*
um
->
ul_UM_RLC
.
sn_FieldLength
,
AssertFatal
(
*
um
->
dl_UM_RLC
.
sn_FieldLength
==
*
um
->
ul_UM_RLC
.
sn_FieldLength
,
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
sn_field_length
=
calloc
(
1
,
sizeof
(
*
sn_field_length
)
);
_sn_field_length
=
decode_sn_field_length_um
(
*
um
->
dl_UM_RLC
.
sn_FieldLength
);
*
sn_field_length
=
decode_sn_field_length_um
(
*
um
->
dl_UM_RLC
.
sn_FieldLength
)
;
sn_field_length
=
&
_sn_field_length
;
}
}
}
}
else
else
AssertFatal
(
um
->
ul_UM_RLC
.
sn_FieldLength
==
NULL
,
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
AssertFatal
(
um
->
ul_UM_RLC
.
sn_FieldLength
==
NULL
,
nr_rlc_entity_um_reconfigure
(
rb
,
t_reassembly
,
sn_field_length
);
"Cannot handle different sn_FieldLength for DL and UL
\n
"
);
nr_rlc_entity_um_reconfigure
(
rb
,
t_reassembly
,
sn_field_length
);
}
}
}
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
...
@@ -736,9 +706,7 @@ void nr_rlc_add_srb(int rnti, int srb_id, const NR_RLC_BearerConfig_t *rlc_Beare
...
@@ -736,9 +706,7 @@ void nr_rlc_add_srb(int rnti, int srb_id, const NR_RLC_BearerConfig_t *rlc_Beare
AssertFatal
(
srb_id
>
0
&&
srb_id
<
4
,
AssertFatal
(
srb_id
>
0
&&
srb_id
<
4
,
"Invalid srb id %d
\n
"
,
srb_id
);
"Invalid srb id %d
\n
"
,
srb_id
);
if
(
l
&&
if
(
l
&&
l
->
ul_SpecificParameters
&&
l
->
ul_SpecificParameters
->
logicalChannelGroup
)
l
->
ul_SpecificParameters
&&
l
->
ul_SpecificParameters
->
logicalChannelGroup
)
logical_channel_group
=
*
l
->
ul_SpecificParameters
->
logicalChannelGroup
;
logical_channel_group
=
*
l
->
ul_SpecificParameters
->
logicalChannelGroup
;
else
else
logical_channel_group
=
0
;
// default value as in 9.2.1 of 38.331
logical_channel_group
=
0
;
// default value as in 9.2.1 of 38.331
...
@@ -749,14 +717,13 @@ void nr_rlc_add_srb(int rnti, int srb_id, const NR_RLC_BearerConfig_t *rlc_Beare
...
@@ -749,14 +717,13 @@ void nr_rlc_add_srb(int rnti, int srb_id, const NR_RLC_BearerConfig_t *rlc_Beare
exit
(
1
);
exit
(
1
);
}
}
if
(
r
&&
if
(
r
&&
r
->
present
==
NR_RLC_Config_PR_am
)
{
r
->
present
==
NR_RLC_Config_PR_am
)
{
struct
NR_RLC_Config__am
*
am
;
struct
NR_RLC_Config__am
*
am
;
am
=
r
->
choice
.
am
;
am
=
r
->
choice
.
am
;
t_reassembly
=
decode_t_reassembly
(
am
->
dl_AM_RLC
.
t_Reassembly
);
t_reassembly
=
decode_t_reassembly
(
am
->
dl_AM_RLC
.
t_Reassembly
);
t_status_prohibit
=
decode_t_status_prohibit
(
am
->
dl_AM_RLC
.
t_StatusProhibit
);
t_status_prohibit
=
decode_t_status_prohibit
(
am
->
dl_AM_RLC
.
t_StatusProhibit
);
t_poll_retransmit
=
decode_t_poll_retransmit
(
am
->
ul_AM_RLC
.
t_PollRetransmit
);
t_poll_retransmit
=
decode_t_poll_retransmit
(
am
->
ul_AM_RLC
.
t_PollRetransmit
);
poll_pdu
=
decode_poll_pdu
(
am
->
ul_AM_RLC
.
pollPDU
);
poll_pdu
=
decode_poll_pdu
(
am
->
ul_AM_RLC
.
pollPDU
);
poll_byte
=
decode_poll_byte
(
am
->
ul_AM_RLC
.
pollByte
);
poll_byte
=
decode_poll_byte
(
am
->
ul_AM_RLC
.
pollByte
);
max_retx_threshold
=
decode_max_retx_threshold
(
am
->
ul_AM_RLC
.
maxRetxThreshold
);
max_retx_threshold
=
decode_max_retx_threshold
(
am
->
ul_AM_RLC
.
maxRetxThreshold
);
if
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
!=
*
am
->
ul_AM_RLC
.
sn_FieldLength
)
{
if
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
!=
*
am
->
ul_AM_RLC
.
sn_FieldLength
)
{
...
@@ -764,8 +731,7 @@ void nr_rlc_add_srb(int rnti, int srb_id, const NR_RLC_BearerConfig_t *rlc_Beare
...
@@ -764,8 +731,7 @@ void nr_rlc_add_srb(int rnti, int srb_id, const NR_RLC_BearerConfig_t *rlc_Beare
exit
(
1
);
exit
(
1
);
}
}
sn_field_length
=
decode_sn_field_length_am
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
);
sn_field_length
=
decode_sn_field_length_am
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
);
}
}
else
{
else
{
// default values as in 9.2.1 of 38.331
// default values as in 9.2.1 of 38.331
t_reassembly
=
35
;
t_reassembly
=
35
;
t_status_prohibit
=
0
;
t_status_prohibit
=
0
;
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h
View file @
18892963
...
@@ -51,13 +51,9 @@ bool nr_rlc_update_rnti(int from_rnti, int to_rnti);
...
@@ -51,13 +51,9 @@ bool nr_rlc_update_rnti(int from_rnti, int to_rnti);
/* test function for CI to trigger reestablishments */
/* test function for CI to trigger reestablishments */
void
nr_rlc_test_trigger_reestablishment
(
int
rnti
);
void
nr_rlc_test_trigger_reestablishment
(
int
rnti
);
void
nr_release_rlc_entity
(
int
rnti
,
void
nr_release_rlc_entity
(
int
rnti
,
logical_chan_id_t
channel_id
);
logical_chan_id_t
channel_id
);
void
nr_rlc_reconfigure_entity
(
int
rnti
,
void
nr_rlc_reconfigure_entity
(
int
rnti
,
int
lc_id
,
struct
NR_RLC_Config
*
rlc_Config
,
struct
NR_LogicalChannelConfig
*
lc_Config
);
int
lc_id
,
struct
NR_RLC_Config
*
rlc_Config
,
struct
NR_LogicalChannelConfig
*
lc_Config
);
int
nr_rlc_get_available_tx_space
(
int
nr_rlc_get_available_tx_space
(
const
rnti_t
rntiP
,
const
rnti_t
rntiP
,
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/nr_rrc_common.h
View file @
18892963
...
@@ -46,17 +46,17 @@ typedef enum UE_STATE_NR_e {
...
@@ -46,17 +46,17 @@ typedef enum UE_STATE_NR_e {
}
NR_UE_STATE_t
;
}
NR_UE_STATE_t
;
typedef
struct
{
typedef
struct
{
unsigned
short
transport_block_size
;
/*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned
short
transport_block_size
;
/*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned
short
max_transport_blocks
;
/*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
unsigned
short
max_transport_blocks
;
/*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
unsigned
long
Guaranteed_bit_rate
;
/*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
unsigned
long
Guaranteed_bit_rate
;
/*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
unsigned
long
Max_bit_rate
;
/*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
unsigned
long
Max_bit_rate
;
/*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
uint8_t
Delay_class
;
/*!< \brief Delay class offered by MAC layer scheduling*/
uint8_t
Delay_class
;
/*!< \brief Delay class offered by MAC layer scheduling*/
uint8_t
Target_bler
;
/*!< \brief Target Average Transport Block Error rate*/
uint8_t
Target_bler
;
/*!< \brief Target Average Transport Block Error rate*/
uint8_t
Lchan_t
;
/*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
uint8_t
Lchan_t
;
/*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
}
__attribute__
((
__packed__
))
NR_LCHAN_DESC
;
}
__attribute__
((
__packed__
))
NR_LCHAN_DESC
;
typedef
struct
RB_INFO_NR_s
{
typedef
struct
RB_INFO_NR_s
{
uint16_t
Rb_id
;
//=Lchan_id
uint16_t
Rb_id
;
//=Lchan_id
NR_LCHAN_DESC
Lchan_desc
[
2
];
NR_LCHAN_DESC
Lchan_desc
[
2
];
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
}
NR_RB_INFO
;
}
NR_RB_INFO
;
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
18892963
...
@@ -133,11 +133,12 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
...
@@ -133,11 +133,12 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
switch
(
Srb_id
)
{
switch
(
Srb_id
)
{
case
CCCH
:
case
CCCH
:
LOG_D
(
NR_RRC
,
"nr_mac_rrc_data_req_ue: Payload size = %i
\n
"
,
LOG_D
(
NR_RRC
,
"nr_mac_rrc_data_req_ue: Payload size = %i
\n
"
,
NR_UE_rrc_inst
[
Mod_idP
].
Srb
[
gNB_id
][
0
].
srb_buffers
.
Tx_buffer
.
payload_size
);
NR_UE_rrc_inst
[
Mod_idP
].
Srb
[
gNB_id
][
0
].
srb_buffers
.
Tx_buffer
.
payload_size
);
NR_UE_RRC_SRB_INFO_t
*
Srb0
=
&
NR_UE_rrc_inst
[
Mod_idP
].
Srb
[
gNB_id
][
0
];
NR_UE_RRC_SRB_INFO_t
*
Srb0
=
&
NR_UE_rrc_inst
[
Mod_idP
].
Srb
[
gNB_id
][
0
];
memcpy
(
buffer_pP
,
(
uint8_t
*
)
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
,
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
);
memcpy
(
buffer_pP
,
(
uint8_t
*
)
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
,
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
);
for
(
int
i
=
0
;
i
<
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
;
i
++
)
{
LOG_D
(
NR_RRC
,
"(%i): %i
\n
"
,
i
,
buffer_pP
[
i
]);
LOG_D
(
NR_RRC
,
"(%i): %i
\n
"
,
i
,
buffer_pP
[
i
]);
}
}
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/rrc_UE.c
View file @
18892963
...
@@ -114,8 +114,7 @@ nr_rrc_ue_generate_rrcReestablishmentComplete(
...
@@ -114,8 +114,7 @@ nr_rrc_ue_generate_rrcReestablishmentComplete(
mui_t
nr_rrc_mui
=
0
;
mui_t
nr_rrc_mui
=
0
;
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
int8_t
nr_rrc_ue_decode_secondary_cellgroup_config
(
const
module_id_t
module_id
,
int8_t
nr_rrc_ue_decode_secondary_cellgroup_config
(
const
module_id_t
module_id
,
NR_CellGroupConfig_t
*
cell_group_config
)
NR_CellGroupConfig_t
*
cell_group_config
)
{
{
if
(
NR_UE_rrc_inst
[
module_id
].
scell_group_config
==
NULL
)
if
(
NR_UE_rrc_inst
[
module_id
].
scell_group_config
==
NULL
)
NR_UE_rrc_inst
[
module_id
].
scell_group_config
=
cell_group_config
;
NR_UE_rrc_inst
[
module_id
].
scell_group_config
=
cell_group_config
;
...
@@ -148,11 +147,14 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
...
@@ -148,11 +147,14 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
NR_CellGroupConfig_t
*
cellGroupConfig
=
NULL
;
NR_CellGroupConfig_t
*
cellGroupConfig
=
NULL
;
int
size
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
secondaryCellGroup
->
size
;
int
size
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
secondaryCellGroup
->
size
;
uint8_t
*
buffer
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
secondaryCellGroup
->
buf
;
uint8_t
*
buffer
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
secondaryCellGroup
->
buf
;
asn_dec_rval_t
dec_rval
=
uper_decode
(
NULL
,
asn_dec_rval_t
dec_rval
=
&
asn_DEF_NR_CellGroupConfig
,
//might be added prefix later
uper_decode
(
NULL
,
(
void
**
)
&
cellGroupConfig
,
&
asn_DEF_NR_CellGroupConfig
,
// might be added prefix later
(
uint8_t
*
)
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
secondaryCellGroup
->
buf
,
(
void
**
)
&
cellGroupConfig
,
size
,
0
,
0
);
(
uint8_t
*
)
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
secondaryCellGroup
->
buf
,
size
,
0
,
0
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
LOG_E
(
NR_RRC
,
"NR_CellGroupConfig decode error
\n
"
);
LOG_E
(
NR_RRC
,
"NR_CellGroupConfig decode error
\n
"
);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
for
(
int
i
=
0
;
i
<
size
;
i
++
)
...
@@ -163,10 +165,10 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
...
@@ -163,10 +165,10 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
return
-
1
;
return
-
1
;
}
}
if
(
get_softmodem_params
()
->
sa
||
get_softmodem_params
()
->
nsa
)
if
(
get_softmodem_params
()
->
sa
||
get_softmodem_params
()
->
nsa
)
nr_rrc_manage_rlc_bearers
(
cellGroupConfig
,
&
NR_UE_rrc_inst
[
module_id
],
0
,
module_id
,
NR_UE_rrc_inst
[
module_id
].
rnti
);
nr_rrc_manage_rlc_bearers
(
cellGroupConfig
,
&
NR_UE_rrc_inst
[
module_id
],
0
,
module_id
,
NR_UE_rrc_inst
[
module_id
].
rnti
);
if
(
get_softmodem_params
()
->
sa
||
get_softmodem_params
()
->
nsa
)
{
if
(
get_softmodem_params
()
->
sa
||
get_softmodem_params
()
->
nsa
)
{
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
{
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_CellGroupConfig
,
(
const
void
*
)
cellGroupConfig
);
xer_fprint
(
stdout
,
&
asn_DEF_NR_CellGroupConfig
,
(
const
void
*
)
cellGroupConfig
);
}
}
...
@@ -186,8 +188,7 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
...
@@ -186,8 +188,7 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
if
(
get_softmodem_params
()
->
nsa
)
{
if
(
get_softmodem_params
()
->
nsa
)
{
nr_rrc_mac_config_req_scg
(
0
,
0
,
cellGroupConfig
);
nr_rrc_mac_config_req_scg
(
0
,
0
,
cellGroupConfig
);
}
}
}
}
else
else
nr_rrc_ue_decode_secondary_cellgroup_config
(
module_id
,
cellGroupConfig
);
nr_rrc_ue_decode_secondary_cellgroup_config
(
module_id
,
cellGroupConfig
);
}
}
if
(
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
measConfig
!=
NULL
){
if
(
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
measConfig
!=
NULL
){
...
@@ -215,15 +216,12 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
...
@@ -215,15 +216,12 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
return
0
;
return
0
;
}
}
int8_t
nr_rrc_ue_process_meas_config
(
NR_MeasConfig_t
*
meas_config
){
int8_t
nr_rrc_ue_process_meas_config
(
NR_MeasConfig_t
*
meas_config
){
return
0
;
return
0
;
}
}
void
process_nsa_message
(
NR_UE_RRC_INST_t
*
rrc
,
nsa_message_t
nsa_message_type
,
void
*
message
,
int
msg_len
)
void
process_nsa_message
(
NR_UE_RRC_INST_t
*
rrc
,
nsa_message_t
nsa_message_type
,
void
*
message
,
int
msg_len
)
{
{
module_id_t
module_id
=
0
;
// TODO
module_id_t
module_id
=
0
;
// TODO
switch
(
nsa_message_type
)
{
switch
(
nsa_message_type
)
{
...
@@ -284,7 +282,6 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
...
@@ -284,7 +282,6 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
AssertFatal
(
1
==
0
,
"Unknown message %d
\n
"
,
nsa_message_type
);
AssertFatal
(
1
==
0
,
"Unknown message %d
\n
"
,
nsa_message_type
);
break
;
break
;
}
}
}
}
NR_UE_RRC_INST_t
*
openair_rrc_top_init_ue_nr
(
char
*
uecap_file
,
char
*
reconfig_file
,
char
*
rbconfig_file
)
NR_UE_RRC_INST_t
*
openair_rrc_top_init_ue_nr
(
char
*
uecap_file
,
char
*
reconfig_file
,
char
*
rbconfig_file
)
...
@@ -338,9 +335,8 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi
...
@@ -338,9 +335,8 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi
strerror
(
errno
));
strerror
(
errno
));
msg_len
=
fread
(
buffer
,
1
,
1024
,
fd
);
msg_len
=
fread
(
buffer
,
1
,
1024
,
fd
);
fclose
(
fd
);
fclose
(
fd
);
process_nsa_message
(
NR_UE_rrc_inst
,
nr_RadioBearerConfigX_r15
,
buffer
,
msg_len
);
process_nsa_message
(
NR_UE_rrc_inst
,
nr_RadioBearerConfigX_r15
,
buffer
,
msg_len
);
}
}
else
if
(
get_softmodem_params
()
->
nsa
)
{
else
if
(
get_softmodem_params
()
->
nsa
)
{
LOG_D
(
NR_RRC
,
"In NSA mode
\n
"
);
LOG_D
(
NR_RRC
,
"In NSA mode
\n
"
);
}
}
...
@@ -759,7 +755,7 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
...
@@ -759,7 +755,7 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
module_id_t
module_id
,
module_id_t
module_id
,
int
rnti
)
int
rnti
)
{
{
if
(
cellGroupConfig
->
rlc_BearerToReleaseList
!=
NULL
)
{
if
(
cellGroupConfig
->
rlc_BearerToReleaseList
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
cellGroupConfig
->
rlc_BearerToReleaseList
->
list
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
cellGroupConfig
->
rlc_BearerToReleaseList
->
list
.
count
;
i
++
)
{
NR_LogicalChannelIdentity_t
*
lcid
=
cellGroupConfig
->
rlc_BearerToReleaseList
->
list
.
array
[
i
];
NR_LogicalChannelIdentity_t
*
lcid
=
cellGroupConfig
->
rlc_BearerToReleaseList
->
list
.
array
[
i
];
AssertFatal
(
lcid
,
"LogicalChannelIdentity shouldn't be null here
\n
"
);
AssertFatal
(
lcid
,
"LogicalChannelIdentity shouldn't be null here
\n
"
);
...
@@ -767,20 +763,15 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
...
@@ -767,20 +763,15 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
}
}
}
}
if
(
cellGroupConfig
->
rlc_BearerToAddModList
!=
NULL
)
{
if
(
cellGroupConfig
->
rlc_BearerToAddModList
!=
NULL
)
{
//TODO (perform the RLC bearer addition/modification as specified in 5.3.5.5.4)
for
(
int
i
=
0
;
i
<
cellGroupConfig
->
rlc_BearerToAddModList
->
list
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
cellGroupConfig
->
rlc_BearerToAddModList
->
list
.
count
;
i
++
)
{
NR_RLC_BearerConfig_t
*
rlc_bearer
=
cellGroupConfig
->
rlc_BearerToAddModList
->
list
.
array
[
i
];
NR_RLC_BearerConfig_t
*
rlc_bearer
=
cellGroupConfig
->
rlc_BearerToAddModList
->
list
.
array
[
i
];
NR_LogicalChannelIdentity_t
lcid
=
rlc_bearer
->
logicalChannelIdentity
;
NR_LogicalChannelIdentity_t
lcid
=
rlc_bearer
->
logicalChannelIdentity
;
if
(
rrc
->
active_RLC_entity
[
gNB_index
][
lcid
])
{
if
(
rrc
->
active_RLC_entity
[
gNB_index
][
lcid
])
{
if
(
rlc_bearer
->
reestablishRLC
)
if
(
rlc_bearer
->
reestablishRLC
)
nr_rlc_reestablish_entity
(
rnti
,
lcid
);
nr_rlc_reestablish_entity
(
rnti
,
lcid
);
nr_rlc_reconfigure_entity
(
rnti
,
nr_rlc_reconfigure_entity
(
rnti
,
lcid
,
rlc_bearer
->
rlc_Config
,
rlc_bearer
->
mac_LogicalChannelConfig
);
lcid
,
}
else
{
rlc_bearer
->
rlc_Config
,
rlc_bearer
->
mac_LogicalChannelConfig
);
}
else
{
rrc
->
active_RLC_entity
[
gNB_index
][
lcid
]
=
true
;
rrc
->
active_RLC_entity
[
gNB_index
][
lcid
]
=
true
;
AssertFatal
(
rlc_bearer
->
servedRadioBearer
,
"servedRadioBearer mandatory in case of setup
\n
"
);
AssertFatal
(
rlc_bearer
->
servedRadioBearer
,
"servedRadioBearer mandatory in case of setup
\n
"
);
AssertFatal
(
rlc_bearer
->
servedRadioBearer
->
present
!=
NR_RLC_BearerConfig__servedRadioBearer_PR_NOTHING
,
AssertFatal
(
rlc_bearer
->
servedRadioBearer
->
present
!=
NR_RLC_BearerConfig__servedRadioBearer_PR_NOTHING
,
...
@@ -788,8 +779,7 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
...
@@ -788,8 +779,7 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
if
(
rlc_bearer
->
servedRadioBearer
->
present
==
NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity
)
{
if
(
rlc_bearer
->
servedRadioBearer
->
present
==
NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity
)
{
NR_SRB_Identity_t
srb_id
=
rlc_bearer
->
servedRadioBearer
->
choice
.
srb_Identity
;
NR_SRB_Identity_t
srb_id
=
rlc_bearer
->
servedRadioBearer
->
choice
.
srb_Identity
;
nr_rlc_add_srb
(
rnti
,
srb_id
,
rlc_bearer
);
nr_rlc_add_srb
(
rnti
,
srb_id
,
rlc_bearer
);
}
}
else
{
// DRB
else
{
// DRB
NR_DRB_Identity_t
drb_id
=
rlc_bearer
->
servedRadioBearer
->
choice
.
drb_Identity
;
NR_DRB_Identity_t
drb_id
=
rlc_bearer
->
servedRadioBearer
->
choice
.
drb_Identity
;
nr_rlc_add_drb
(
rnti
,
drb_id
,
rlc_bearer
);
nr_rlc_add_drb
(
rnti
,
drb_id
,
rlc_bearer
);
}
}
...
@@ -955,11 +945,16 @@ static void rrc_ue_generate_RRCSetupComplete(const protocol_ctxt_t *const ctxt_p
...
@@ -955,11 +945,16 @@ static void rrc_ue_generate_RRCSetupComplete(const protocol_ctxt_t *const ctxt_p
size
=
do_RRCSetupComplete
(
ctxt_pP
->
module_id
,
buffer
,
sizeof
(
buffer
),
size
=
do_RRCSetupComplete
(
ctxt_pP
->
module_id
,
buffer
,
sizeof
(
buffer
),
Transaction_id
,
sel_plmn_id
,
nas_msg_length
,
nas_msg
);
Transaction_id
,
sel_plmn_id
,
nas_msg_length
,
nas_msg
);
LOG_I
(
NR_RRC
,
"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCSetupComplete (bytes%d, gNB %d)
\n
"
,
LOG_I
(
NR_RRC
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
size
,
gNB_index
);
"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCSetupComplete (bytes%d, gNB %d)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
size
,
gNB_index
);
int
srb_id
=
1
;
// RRC setup complete on SRB1
int
srb_id
=
1
;
// RRC setup complete on SRB1
LOG_D
(
NR_RRC
,
LOG_D
(
NR_RRC
,
"[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCSetupComplete to gNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]
\n
"
,
"[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCSetupComplete to gNB %d MUI %d) --->][PDCP][MOD %02d][RB "
"%02d]
\n
"
,
ctxt_pP
->
frame
,
ctxt_pP
->
frame
,
ctxt_pP
->
module_id
,
ctxt_pP
->
module_id
,
size
,
size
,
...
@@ -968,35 +963,41 @@ static void rrc_ue_generate_RRCSetupComplete(const protocol_ctxt_t *const ctxt_p
...
@@ -968,35 +963,41 @@ static void rrc_ue_generate_RRCSetupComplete(const protocol_ctxt_t *const ctxt_p
ctxt_pP
->
module_id
+
NB_eNB_INST
,
ctxt_pP
->
module_id
+
NB_eNB_INST
,
srb_id
);
srb_id
);
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
size
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
size
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
}
}
int8_t
nr_rrc_ue_decode_ccch
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
NR_UE_RRC_SRB_INFO_t
*
Srb_info
,
const
uint8_t
gNB_index
)
int8_t
nr_rrc_ue_decode_ccch
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
NR_UE_RRC_SRB_INFO_t
*
Srb_info
,
const
uint8_t
gNB_index
)
{
{
NR_UE_RRC_INST_t
*
rrc
=
&
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
];
NR_UE_RRC_INST_t
*
rrc
=
&
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
];
NR_DL_CCCH_Message_t
*
dl_ccch_msg
=
NULL
;
NR_DL_CCCH_Message_t
*
dl_ccch_msg
=
NULL
;
asn_dec_rval_t
dec_rval
;
asn_dec_rval_t
dec_rval
;
int
rval
=
0
;
int
rval
=
0
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH
,
VCD_FUNCTION_IN
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH
,
VCD_FUNCTION_IN
);
LOG_D
(
RRC
,
"[NR UE%d] Decoding DL-CCCH message (%d bytes), State %d
\n
"
,
LOG_D
(
RRC
,
"[NR UE%d] Decoding DL-CCCH message (%d bytes), State %d
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
module_id
,
Srb_info
->
srb_buffers
.
Rx_buffer
.
payload_size
,
Srb_info
->
srb_buffers
.
Rx_buffer
.
payload_size
,
rrc
->
nrRrcState
);
rrc
->
nrRrcState
);
dec_rval
=
uper_decode
(
NULL
,
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_DL_CCCH_Message
,
&
asn_DEF_NR_DL_CCCH_Message
,
(
void
**
)
&
dl_ccch_msg
,
(
void
**
)
&
dl_ccch_msg
,
(
uint8_t
*
)
Srb_info
->
srb_buffers
.
Rx_buffer
.
Payload
,
(
uint8_t
*
)
Srb_info
->
srb_buffers
.
Rx_buffer
.
Payload
,
Srb_info
->
srb_buffers
.
Rx_buffer
.
payload_size
,
0
,
0
);
Srb_info
->
srb_buffers
.
Rx_buffer
.
payload_size
,
0
,
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
0
);
xer_fprint
(
stdout
,
&
asn_DEF_NR_DL_CCCH_Message
,(
void
*
)
dl_ccch_msg
);
// }
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint
(
stdout
,
&
asn_DEF_NR_DL_CCCH_Message
,
(
void
*
)
dl_ccch_msg
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
// }
LOG_E
(
RRC
,
"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
dec_rval
.
consumed
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH
,
VCD_FUNCTION_OUT
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
return
-
1
;
LOG_E
(
RRC
,
"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
dec_rval
.
consumed
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH
,
VCD_FUNCTION_OUT
);
return
-
1
;
}
}
if
(
dl_ccch_msg
->
message
.
present
==
NR_DL_CCCH_MessageType_PR_c1
)
{
if
(
dl_ccch_msg
->
message
.
present
==
NR_DL_CCCH_MessageType_PR_c1
)
{
...
@@ -1279,7 +1280,13 @@ void nr_rrc_ue_process_securityModeCommand(const protocol_ctxt_t *const ctxt_pP,
...
@@ -1279,7 +1280,13 @@ void nr_rrc_ue_process_securityModeCommand(const protocol_ctxt_t *const ctxt_pP,
// for the UE to declare AS security to be activated
// for the UE to declare AS security to be activated
ue_rrc
->
as_security_activated
=
true
;
ue_rrc
->
as_security_activated
=
true
;
int
srb_id
=
1
;
// SecurityModeComplete in SRB1
int
srb_id
=
1
;
// SecurityModeComplete in SRB1
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
(
enc_rval
.
encoded
+
7
)
/
8
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
(
enc_rval
.
encoded
+
7
)
/
8
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
}
else
}
else
LOG_W
(
NR_RRC
,
"securityModeCommand->criticalExtensions.present (%d) != NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand
\n
"
,
LOG_W
(
NR_RRC
,
"securityModeCommand->criticalExtensions.present (%d) != NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand
\n
"
,
securityModeCommand
->
criticalExtensions
.
present
);
securityModeCommand
->
criticalExtensions
.
present
);
...
@@ -1289,74 +1296,35 @@ void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB
...
@@ -1289,74 +1296,35 @@ void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB
{
{
uint8_t
rv
[
6
];
uint8_t
rv
[
6
];
NR_UE_RRC_SRB_INFO_t
*
Srb0
=
&
NR_UE_rrc_inst
[
module_id
].
Srb
[
gNB_index
][
0
];
NR_UE_RRC_SRB_INFO_t
*
Srb0
=
&
NR_UE_rrc_inst
[
module_id
].
Srb
[
gNB_index
][
0
];
if
(
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
==
0
)
{
if
(
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
==
0
)
{
// Get RRCConnectionRequest, fill random for now
// Get RRCConnectionRequest, fill random for now
// Generate random byte stream for contention resolution
// Generate random byte stream for contention resolution
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
#ifdef SMBV
#ifdef SMBV
// if SMBV is configured the contention resolution needs to be fix for the connection procedure to succeed
// if SMBV is configured the contention resolution needs to be fix for the connection procedure to succeed
rv
[
i
]
=
i
;
rv
[
i
]
=
i
;
#else
#else
rv
[
i
]
=
taus
()
&
0xff
;
rv
[
i
]
=
taus
()
&
0xff
;
#endif
#endif
LOG_T
(
NR_RRC
,
"%x."
,
rv
[
i
]);
LOG_T
(
NR_RRC
,
"%x."
,
rv
[
i
]);
}
}
LOG_T
(
NR_RRC
,
"
\n
"
);
LOG_T
(
NR_RRC
,
"
\n
"
);
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
=
do_RRCSetupRequest
(
module_id
,
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
=
do_RRCSetupRequest
(
module_id
,
(
uint8_t
*
)
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
,
(
uint8_t
*
)
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
,
sizeof
(
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
),
sizeof
(
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
),
rv
);
rv
);
LOG_I
(
NR_RRC
,
"[UE %d] : Logical Channel UL-CCCH (SRB0), Generating RRCSetupRequest (bytes %d, gNB %d)
\n
"
,
LOG_I
(
NR_RRC
,
module_id
,
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
,
gNB_index
);
"[UE %d] : Logical Channel UL-CCCH (SRB0), Generating RRCSetupRequest (bytes %d, gNB %d)
\n
"
,
module_id
,
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
,
gNB_index
);
for
(
int
i
=
0
;
i
<
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
;
i
++
)
for
(
int
i
=
0
;
i
<
Srb0
->
srb_buffers
.
Tx_buffer
.
payload_size
;
i
++
)
LOG_T
(
NR_RRC
,
"%x."
,
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
[
i
]);
LOG_T
(
NR_RRC
,
"%x."
,
Srb0
->
srb_buffers
.
Tx_buffer
.
Payload
[
i
]);
LOG_T
(
NR_RRC
,
"
\n
"
);
LOG_T
(
NR_RRC
,
"
\n
"
);
}
}
int32_t
nr_rrc_ue_establish_drb
(
module_id_t
ue_mod_idP
,
frame_t
frameP
,
uint8_t
gNB_index
,
NR_DRB_ToAddMod_t
*
DRB_config
)
{
// add descriptor from RRC PDU
int
oip_ifup
=
0
,
ip_addr_offset3
=
0
,
ip_addr_offset4
=
0
;
/* avoid gcc warnings */
(
void
)
oip_ifup
;
(
void
)
ip_addr_offset3
;
(
void
)
ip_addr_offset4
;
LOG_I
(
NR_RRC
,
"[UE %d] Frame %d: processing RRCReconfiguration: reconfiguring DRB %ld
\n
"
,
ue_mod_idP
,
frameP
,
DRB_config
->
drb_Identity
);
if
(
!
get_softmodem_params
()
->
sa
)
{
ip_addr_offset3
=
0
;
ip_addr_offset4
=
1
;
LOG_I
(
OIP
,
"[UE %d] trying to bring up the OAI interface %d, IP X.Y.%d.%d
\n
"
,
ue_mod_idP
,
ip_addr_offset3
+
ue_mod_idP
,
ip_addr_offset3
+
ue_mod_idP
+
1
,
ip_addr_offset4
+
ue_mod_idP
+
1
);
oip_ifup
=
nas_config
(
ip_addr_offset3
+
ue_mod_idP
+
1
,
// interface_id
UE_NAS_USE_TUN
?
1
:
(
ip_addr_offset3
+
ue_mod_idP
+
1
),
// third_octet
ip_addr_offset4
+
ue_mod_idP
+
1
,
// fourth_octet
"oip"
);
// interface suffix (when using kernel module)
if
(
oip_ifup
==
0
&&
(
!
UE_NAS_USE_TUN
))
{
// interface is up --> send a config the DRB
LOG_I
(
OIP
,
"[UE %d] Config the ue net interface %d to send/receive pkt on DRB %ld to/from the protocol stack
\n
"
,
ue_mod_idP
,
ip_addr_offset3
+
ue_mod_idP
,
(
long
int
)((
gNB_index
*
NR_maxDRB
)
+
DRB_config
->
drb_Identity
));
rb_conf_ipv4
(
0
,
//add
ue_mod_idP
,
//cx align with the UE index
ip_addr_offset3
+
ue_mod_idP
,
//inst num_enb+ue_index
(
gNB_index
*
NR_maxDRB
)
+
DRB_config
->
drb_Identity
,
//rb
0
,
//dscp
ipv4_address
(
ip_addr_offset3
+
ue_mod_idP
+
1
,
ip_addr_offset4
+
ue_mod_idP
+
1
),
//saddr
ipv4_address
(
ip_addr_offset3
+
ue_mod_idP
+
1
,
gNB_index
+
1
));
//daddr
LOG_D
(
NR_RRC
,
"[UE %d] State = Attached (gNB %d)
\n
"
,
ue_mod_idP
,
gNB_index
);
}
}
}
return
(
0
);
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
@@ -1483,103 +1451,94 @@ int32_t nr_rrc_ue_establish_drb(module_id_t ue_mod_idP,
...
@@ -1483,103 +1451,94 @@ int32_t nr_rrc_ue_establish_drb(module_id_t ue_mod_idP,
}
}
}
}
void
nr_rrc_ue_process_RadioBearerConfig
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
,
NR_RadioBearerConfig_t
*
const
radioBearerConfig
)
{
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
xer_fprint
(
stdout
,
&
asn_DEF_NR_RadioBearerConfig
,
(
const
void
*
)
radioBearerConfig
);
NR_UE_RRC_INST_t
*
ue_rrc
=
&
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
];
AssertFatal
(
radioBearerConfig
->
srb3_ToRelease
==
NULL
,
"Release of SRB3 not yet implemented
\n
"
);
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
if
(
ue_rrc
->
as_security_activated
)
{
if
(
radioBearerConfig
->
securityConfig
!=
NULL
)
{
// When the field is not included, continue to use the currently configured keyToUse
if
(
radioBearerConfig
->
securityConfig
->
keyToUse
)
{
AssertFatal
(
*
radioBearerConfig
->
securityConfig
->
keyToUse
==
NR_SecurityConfig__keyToUse_master
,
"Secondary key usage seems not to be implemented
\n
"
);
ue_rrc
->
keyToUse
=
*
radioBearerConfig
->
securityConfig
->
keyToUse
;
}
// When the field is not included, continue to use the currently configured security algorithm
if
(
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
)
{
ue_rrc
->
cipheringAlgorithm
=
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
cipheringAlgorithm
;
ue_rrc
->
integrityProtAlgorithm
=
*
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
integrityProtAlgorithm
;
}
}
nr_derive_key
(
RRC_ENC_ALG
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
cipheringAlgorithm
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
kgnb
,
kRRCenc
);
nr_derive_key
(
RRC_INT_ALG
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrityProtAlgorithm
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
kgnb
,
kRRCint
);
}
void
nr_rrc_ue_process_RadioBearerConfig
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
if
(
radioBearerConfig
->
srb_ToAddModList
!=
NULL
)
{
const
uint8_t
gNB_index
,
for
(
int
cnt
=
0
;
cnt
<
radioBearerConfig
->
srb_ToAddModList
->
list
.
count
;
cnt
++
)
{
NR_RadioBearerConfig_t
*
const
radioBearerConfig
)
struct
NR_SRB_ToAddMod
*
srb
=
radioBearerConfig
->
srb_ToAddModList
->
list
.
array
[
cnt
];
{
NR_UE_RRC_SRB_INFO_t
*
Srb_info
=
&
ue_rrc
->
Srb
[
gNB_index
][
srb
->
srb_Identity
];
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
if
(
Srb_info
->
status
==
RB_NOT_PRESENT
)
xer_fprint
(
stdout
,
&
asn_DEF_NR_RadioBearerConfig
,
(
const
void
*
)
radioBearerConfig
);
add_srb
(
ctxt_pP
->
enb_flag
,
ctxt_pP
->
rntiMaybeUEid
,
NR_UE_RRC_INST_t
*
ue_rrc
=
&
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
];
radioBearerConfig
->
srb_ToAddModList
->
list
.
array
[
cnt
],
AssertFatal
(
radioBearerConfig
->
srb3_ToRelease
==
NULL
,
"Release of SRB3 not yet implemented
\n
"
);
ue_rrc
->
cipheringAlgorithm
,
ue_rrc
->
integrityProtAlgorithm
,
uint8_t
kRRCenc
[
16
]
=
{
0
};
kRRCenc
,
uint8_t
kRRCint
[
16
]
=
{
0
};
kRRCint
);
if
(
ue_rrc
->
as_security_activated
)
{
else
{
if
(
radioBearerConfig
->
securityConfig
!=
NULL
)
{
AssertFatal
(
srb
->
discardOnPDCP
==
NULL
,
"discardOnPDCP not yet implemented
\n
"
);
// When the field is not included, continue to use the currently configured keyToUse
AssertFatal
(
srb
->
reestablishPDCP
==
NULL
,
"reestablishPDCP not yet implemented
\n
"
);
if
(
radioBearerConfig
->
securityConfig
->
keyToUse
)
{
if
(
srb
->
pdcp_Config
&&
srb
->
pdcp_Config
->
t_Reordering
)
AssertFatal
(
*
radioBearerConfig
->
securityConfig
->
keyToUse
==
NR_SecurityConfig__keyToUse_master
,
nr_pdcp_reconfigure_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb
->
srb_Identity
,
*
srb
->
pdcp_Config
->
t_Reordering
);
"Secondary key usage seems not to be implemented
\n
"
);
}
ue_rrc
->
keyToUse
=
*
radioBearerConfig
->
securityConfig
->
keyToUse
;
Srb_info
->
status
=
RB_ESTABLISHED
;
}
}
// When the field is not included, continue to use the currently configured security algorithm
}
if
(
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
)
{
ue_rrc
->
cipheringAlgorithm
=
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
cipheringAlgorithm
;
ue_rrc
->
integrityProtAlgorithm
=
*
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
integrityProtAlgorithm
;
}
}
nr_derive_key
(
RRC_ENC_ALG
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
cipheringAlgorithm
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
kgnb
,
kRRCenc
);
nr_derive_key
(
RRC_INT_ALG
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrityProtAlgorithm
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
kgnb
,
kRRCint
);
}
if
(
radioBearerConfig
->
srb_ToAddModList
!=
NULL
)
{
for
(
int
cnt
=
0
;
cnt
<
radioBearerConfig
->
srb_ToAddModList
->
list
.
count
;
cnt
++
)
{
struct
NR_SRB_ToAddMod
*
srb
=
radioBearerConfig
->
srb_ToAddModList
->
list
.
array
[
cnt
];
NR_UE_RRC_SRB_INFO_t
*
Srb_info
=
&
ue_rrc
->
Srb
[
gNB_index
][
srb
->
srb_Identity
];
if
(
Srb_info
->
status
==
RB_NOT_PRESENT
)
add_srb
(
ctxt_pP
->
enb_flag
,
ctxt_pP
->
rntiMaybeUEid
,
radioBearerConfig
->
srb_ToAddModList
->
list
.
array
[
cnt
],
ue_rrc
->
cipheringAlgorithm
,
ue_rrc
->
integrityProtAlgorithm
,
kRRCenc
,
kRRCint
);
else
{
AssertFatal
(
srb
->
discardOnPDCP
,
"discardOnPDCP not yet implemented
\n
"
);
AssertFatal
(
srb
->
reestablishPDCP
,
"reestablishPDCP not yet implemented
\n
"
);
if
(
srb
->
pdcp_Config
&&
srb
->
pdcp_Config
->
t_Reordering
)
nr_pdcp_reconfigure_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb
->
srb_Identity
,
*
srb
->
pdcp_Config
->
t_Reordering
);
}
Srb_info
->
status
=
RB_ESTABLISHED
;
}
}
if
(
radioBearerConfig
->
drb_ToReleaseList
!=
NULL
)
{
// TODO not implemented yet
}
// Establish DRBs if present
AssertFatal
(
radioBearerConfig
->
drb_ToReleaseList
==
NULL
,
"RB entity release not implemented yet
\n
"
);
if
(
radioBearerConfig
->
drb_ToAddModList
!=
NULL
)
{
for
(
int
cnt
=
0
;
cnt
<
radioBearerConfig
->
drb_ToAddModList
->
list
.
count
;
cnt
++
)
{
// Establish DRBs if present
struct
NR_DRB_ToAddMod
*
drb
=
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
];
if
(
radioBearerConfig
->
drb_ToAddModList
!=
NULL
)
{
int
DRB_id
=
drb
->
drb_Identity
;
for
(
int
cnt
=
0
;
cnt
<
radioBearerConfig
->
drb_ToAddModList
->
list
.
count
;
cnt
++
)
{
if
(
ue_rrc
->
active_DRBs
[
gNB_index
][
DRB_id
])
{
struct
NR_DRB_ToAddMod
*
drb
=
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
];
AssertFatal
(
drb
->
reestablishPDCP
,
"reestablishPDCP not yet implemented
\n
"
);
int
DRB_id
=
drb
->
drb_Identity
;
AssertFatal
(
drb
->
recoverPDCP
,
"recoverPDCP not yet implemented
\n
"
);
if
(
ue_rrc
->
active_DRBs
[
gNB_index
][
DRB_id
])
{
if
(
drb
->
pdcp_Config
&&
drb
->
pdcp_Config
->
t_Reordering
)
AssertFatal
(
drb
->
reestablishPDCP
==
NULL
,
"reestablishPDCP not yet implemented
\n
"
);
nr_pdcp_reconfigure_drb
(
ctxt_pP
->
rntiMaybeUEid
,
AssertFatal
(
drb
->
recoverPDCP
==
NULL
,
"recoverPDCP not yet implemented
\n
"
);
DRB_id
,
if
(
drb
->
pdcp_Config
&&
drb
->
pdcp_Config
->
t_Reordering
)
*
drb
->
pdcp_Config
->
t_Reordering
);
nr_pdcp_reconfigure_drb
(
ctxt_pP
->
rntiMaybeUEid
,
DRB_id
,
*
drb
->
pdcp_Config
->
t_Reordering
);
if
(
drb
->
cnAssociation
)
if
(
drb
->
cnAssociation
)
AssertFatal
(
drb
->
cnAssociation
->
choice
.
sdap_Config
,
"SDAP reconfiguration not yet implemented
\n
"
);
AssertFatal
(
drb
->
cnAssociation
->
choice
.
sdap_Config
==
NULL
,
"SDAP reconfiguration not yet implemented
\n
"
);
}
}
else
{
else
{
ue_rrc
->
active_DRBs
[
gNB_index
][
DRB_id
]
=
true
;
ue_rrc
->
active_DRBs
[
gNB_index
][
DRB_id
]
=
true
;
add_drb
(
ctxt_pP
->
enb_flag
,
add_drb
(
ctxt_pP
->
enb_flag
,
ctxt_pP
->
rntiMaybeUEid
,
ctxt_pP
->
rntiMaybeUEid
,
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
],
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
],
ue_rrc
->
cipheringAlgorithm
,
ue_rrc
->
cipheringAlgorithm
,
ue_rrc
->
integrityProtAlgorithm
,
ue_rrc
->
integrityProtAlgorithm
,
kRRCenc
,
kRRCenc
,
kRRCint
);
kRRCint
);
}
}
}
}
}
// drb_ToAddModList //
}
// drb_ToAddModList //
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
nrRrcState
=
RRC_STATE_CONNECTED_NR
;
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
nrRrcState
=
RRC_STATE_CONNECTED_NR
;
LOG_I
(
NR_RRC
,
"[UE %d] State = NR_RRC_CONNECTED (gNB %d)
\n
"
,
ctxt_pP
->
module_id
,
gNB_index
);
LOG_I
(
NR_RRC
,
"[UE %d] State = NR_RRC_CONNECTED (gNB %d)
\n
"
,
ctxt_pP
->
module_id
,
gNB_index
);
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
static
void
rrc_ue_process_rrcReconfiguration
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
static
void
rrc_ue_process_rrcReconfiguration
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
...
@@ -1634,155 +1593,146 @@ void nr_rrc_ue_process_RadioBearerConfig(const protocol_ctxt_t *const ctxt_pP,
...
@@ -1634,155 +1593,146 @@ void nr_rrc_ue_process_RadioBearerConfig(const protocol_ctxt_t *const ctxt_pP,
}
}
}
}
void
nr_rrc_ue_generate_RRCReconfigurationComplete
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
void
nr_rrc_ue_generate_RRCReconfigurationComplete
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
,
const
uint8_t
gNB_index
,
const
int
srb_id
,
const
int
srb_id
,
const
uint8_t
Transaction_id
)
const
uint8_t
Transaction_id
)
{
{
uint8_t
buffer
[
32
],
size
;
uint8_t
buffer
[
32
],
size
;
size
=
do_NR_RRCReconfigurationComplete
(
ctxt_pP
,
buffer
,
sizeof
(
buffer
),
Transaction_id
);
size
=
do_NR_RRCReconfigurationComplete
(
ctxt_pP
,
buffer
,
sizeof
(
buffer
),
Transaction_id
);
LOG_I
(
NR_RRC
,
LOG_I
(
NR_RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Logical Channel UL-DCCH (SRB1), Generating RRCReconfigurationComplete (bytes %d, gNB_index %d)
\n
"
,
PROTOCOL_RRC_CTXT_UE_FMT
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
,
gNB_index
);
" Logical Channel UL-DCCH (SRB1), Generating RRCReconfigurationComplete (bytes %d, gNB_index %d)
\n
"
,
AssertFatal
(
srb_id
==
1
||
srb_id
==
3
,
"Invalid SRB ID %d
\n
"
,
srb_id
);
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
LOG_D
(
RLC
,
size
,
"[FRAME %05d][RRC_UE][INST %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCReconfigurationComplete to gNB %d MUI %d) --->][PDCP][INST %02d][RB %02d]
\n
"
,
gNB_index
);
ctxt_pP
->
frame
,
AssertFatal
(
srb_id
==
1
||
srb_id
==
3
,
"Invalid SRB ID %d
\n
"
,
srb_id
);
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
LOG_D
(
RLC
,
size
,
"[FRAME %05d][RRC_UE][INST %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCReconfigurationComplete to gNB %d MUI %d) "
gNB_index
,
"--->][PDCP][INST %02d][RB %02d]
\n
"
,
nr_rrc_mui
,
ctxt_pP
->
frame
,
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
srb_id
);
size
,
gNB_index
,
nr_rrc_mui
,
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
srb_id
);
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
size
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
size
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
}
}
int
nr_rrc_ue_decode_dcch
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
int
nr_rrc_ue_decode_dcch
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
srb_id_t
Srb_id
,
const
srb_id_t
Srb_id
,
const
uint8_t
*
const
Buffer
,
const
uint8_t
*
const
Buffer
,
size_t
Buffer_size
,
size_t
Buffer_size
,
const
uint8_t
gNB_indexP
)
const
uint8_t
gNB_indexP
)
{
{
asn_dec_rval_t
dec_rval
;
asn_dec_rval_t
dec_rval
;
NR_DL_DCCH_Message_t
*
dl_dcch_msg
=
NULL
;
NR_DL_DCCH_Message_t
*
dl_dcch_msg
=
NULL
;
MessageDef
*
msg_p
;
MessageDef
*
msg_p
;
if
(
Srb_id
!=
1
&&
Srb_id
!=
2
)
{
if
(
Srb_id
!=
1
&&
Srb_id
!=
2
)
{
LOG_E
(
NR_RRC
,
"[UE %d] Frame %d: Received message on DL-DCCH (SRB%ld), should not have ...
\n
"
,
LOG_E
(
NR_RRC
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
Srb_id
);
"[UE %d] Frame %d: Received message on DL-DCCH (SRB%ld), should not have ...
\n
"
,
}
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
Srb_id
);
}
LOG_D
(
NR_RRC
,
"Decoding DL-DCCH Message
\n
"
);
LOG_D
(
NR_RRC
,
"Decoding DL-DCCH Message
\n
"
);
dec_rval
=
uper_decode
(
NULL
,
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_DL_DCCH_Message
,
(
void
**
)
&
dl_dcch_msg
,
Buffer
,
Buffer_size
,
0
,
0
);
&
asn_DEF_NR_DL_DCCH_Message
,
(
void
**
)
&
dl_dcch_msg
,
Buffer
,
Buffer_size
,
0
,
0
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
LOG_E
(
NR_RRC
,
"Failed to decode DL-DCCH (%zu bytes)
\n
"
,
dec_rval
.
consumed
);
LOG_E
(
NR_RRC
,
"Failed to decode DL-DCCH (%zu bytes)
\n
"
,
dec_rval
.
consumed
);
ASN_STRUCT_FREE
(
asn_DEF_NR_DL_DCCH_Message
,
dl_dcch_msg
);
ASN_STRUCT_FREE
(
asn_DEF_NR_DL_DCCH_Message
,
dl_dcch_msg
);
return
-
1
;
return
-
1
;
}
}
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
{
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_DL_DCCH_Message
,
(
void
*
)
dl_dcch_msg
);
xer_fprint
(
stdout
,
&
asn_DEF_NR_DL_DCCH_Message
,
(
void
*
)
dl_dcch_msg
);
}
}
if
(
dl_dcch_msg
->
message
.
present
==
NR_DL_DCCH_MessageType_PR_c1
)
{
if
(
dl_dcch_msg
->
message
.
present
==
NR_DL_DCCH_MessageType_PR_c1
)
{
switch
(
dl_dcch_msg
->
message
.
choice
.
c1
->
present
)
{
switch
(
dl_dcch_msg
->
message
.
choice
.
c1
->
present
)
{
case
NR_DL_DCCH_MessageType__c1_PR_NOTHING
:
case
NR_DL_DCCH_MessageType__c1_PR_NOTHING
:
LOG_I
(
NR_RRC
,
"Received PR_NOTHING on DL-DCCH-Message
\n
"
);
LOG_I
(
NR_RRC
,
"Received PR_NOTHING on DL-DCCH-Message
\n
"
);
break
;
break
;
case
NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration
:
case
NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration
:
{
{
rrc_ue_process_rrcReconfiguration
(
ctxt_pP
,
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
,
gNB_indexP
);
rrc_ue_process_rrcReconfiguration
(
ctxt_pP
,
nr_rrc_ue_generate_RRCReconfigurationComplete
(
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
,
ctxt_pP
,
gNB_indexP
);
gNB_indexP
,
nr_rrc_ue_generate_RRCReconfigurationComplete
(
ctxt_pP
,
Srb_id
,
gNB_indexP
,
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
rrc_TransactionIdentifier
);
Srb_id
,
break
;
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
rrc_TransactionIdentifier
);
}
break
;
}
case
NR_DL_DCCH_MessageType__c1_PR_rrcResume
:
case
NR_DL_DCCH_MessageType__c1_PR_rrcResume
:
case
NR_DL_DCCH_MessageType__c1_PR_rrcRelease
:
case
NR_DL_DCCH_MessageType__c1_PR_rrcRelease
:
LOG_I
(
NR_RRC
,
"[UE %d] Received RRC Release (gNB %d)
\n
"
,
LOG_I
(
NR_RRC
,
"[UE %d] Received RRC Release (gNB %d)
\n
"
,
ctxt_pP
->
module_id
,
gNB_indexP
);
ctxt_pP
->
module_id
,
gNB_indexP
);
msg_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
0
,
NAS_CONN_RELEASE_IND
);
msg_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
0
,
NAS_CONN_RELEASE_IND
);
if
((
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcRelease
->
criticalExtensions
.
present
==
if
((
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcRelease
->
criticalExtensions
.
present
NR_RRCRelease__criticalExtensions_PR_rrcRelease
)
&&
==
NR_RRCRelease__criticalExtensions_PR_rrcRelease
)
(
dl_dcch_msg
->
message
.
choice
.
c1
->
present
==
NR_DL_DCCH_MessageType__c1_PR_rrcRelease
))
{
&&
(
dl_dcch_msg
->
message
.
choice
.
c1
->
present
==
NR_DL_DCCH_MessageType__c1_PR_rrcRelease
))
{
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcRelease
->
criticalExtensions
.
choice
.
rrcRelease
->
deprioritisationReq
->
deprioritisationTimer
=
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcRelease
->
criticalExtensions
.
choice
.
rrcRelease
->
deprioritisationReq
NR_RRCRelease_IEs__deprioritisationReq__deprioritisationTimer_min5
;
->
deprioritisationTimer
=
NR_RRCRelease_IEs__deprioritisationReq__deprioritisationTimer_min5
;
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcRelease
->
criticalExtensions
.
choice
.
rrcRelease
->
deprioritisationReq
->
deprioritisationType
=
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcRelease
->
criticalExtensions
.
choice
.
rrcRelease
->
deprioritisationReq
NR_RRCRelease_IEs__deprioritisationReq__deprioritisationType_frequency
;
->
deprioritisationType
=
NR_RRCRelease_IEs__deprioritisationReq__deprioritisationType_frequency
;
}
}
itti_send_msg_to_task
(
TASK_NAS_NRUE
,
ctxt_pP
->
instance
,
msg_p
);
itti_send_msg_to_task
(
TASK_NAS_NRUE
,
ctxt_pP
->
instance
,
msg_p
);
break
;
break
;
case
NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry
:
case
NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry
:
LOG_I
(
NR_RRC
,
"[UE %d] Received Capability Enquiry (gNB %d)
\n
"
,
ctxt_pP
->
module_id
,
gNB_indexP
);
LOG_I
(
NR_RRC
,
"[UE %d] Received Capability Enquiry (gNB %d)
\n
"
,
ctxt_pP
->
module_id
,
gNB_indexP
);
nr_rrc_ue_process_ueCapabilityEnquiry
(
ctxt_pP
,
nr_rrc_ue_process_ueCapabilityEnquiry
(
ctxt_pP
,
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityEnquiry
,
gNB_indexP
);
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityEnquiry
,
break
;
gNB_indexP
);
case
NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment
:
break
;
LOG_I
(
NR_RRC
,
case
NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment
:
"[UE%d] Frame %d : Logical Channel DL-DCCH (SRB1), Received RRCReestablishment
\n
"
,
LOG_I
(
NR_RRC
,
ctxt_pP
->
module_id
,
"[UE%d] Frame %d : Logical Channel DL-DCCH (SRB1), Received RRCReestablishment
\n
"
,
ctxt_pP
->
frame
);
ctxt_pP
->
module_id
,
nr_rrc_ue_generate_rrcReestablishmentComplete
(
ctxt_pP
,
ctxt_pP
->
frame
);
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReestablishment
,
nr_rrc_ue_generate_rrcReestablishmentComplete
(
ctxt_pP
,
gNB_indexP
);
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReestablishment
,
break
;
gNB_indexP
);
case
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer
:
{
break
;
NR_DLInformationTransfer_t
*
dlInformationTransfer
=
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
;
case
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer
:
{
if
(
dlInformationTransfer
->
criticalExtensions
.
present
NR_DLInformationTransfer_t
*
dlInformationTransfer
=
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
;
==
NR_DLInformationTransfer__criticalExtensions_PR_dlInformationTransfer
)
{
/* This message hold a dedicated info NAS payload, forward it to NAS */
if
(
dlInformationTransfer
->
criticalExtensions
.
present
==
NR_DedicatedNAS_Message_t
*
dedicatedNAS_Message
=
NR_DLInformationTransfer__criticalExtensions_PR_dlInformationTransfer
)
{
dlInformationTransfer
->
criticalExtensions
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
;
/* This message hold a dedicated info NAS payload, forward it to NAS */
NR_DedicatedNAS_Message_t
*
dedicatedNAS_Message
=
MessageDef
*
msg_p
;
dlInformationTransfer
->
criticalExtensions
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
;
msg_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
0
,
NAS_DOWNLINK_DATA_IND
);
NAS_DOWNLINK_DATA_IND
(
msg_p
).
UEid
=
ctxt_pP
->
module_id
;
// TODO set the UEid to something else ?
MessageDef
*
msg_p
;
NAS_DOWNLINK_DATA_IND
(
msg_p
).
nasMsg
.
length
=
dedicatedNAS_Message
->
size
;
msg_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
0
,
NAS_DOWNLINK_DATA_IND
);
NAS_DOWNLINK_DATA_IND
(
msg_p
).
nasMsg
.
data
=
dedicatedNAS_Message
->
buf
;
NAS_DOWNLINK_DATA_IND
(
msg_p
).
UEid
=
ctxt_pP
->
module_id
;
// TODO set the UEid to something else ?
itti_send_msg_to_task
(
TASK_NAS_NRUE
,
ctxt_pP
->
instance
,
msg_p
);
NAS_DOWNLINK_DATA_IND
(
msg_p
).
nasMsg
.
length
=
dedicatedNAS_Message
->
size
;
}
NAS_DOWNLINK_DATA_IND
(
msg_p
).
nasMsg
.
data
=
dedicatedNAS_Message
->
buf
;
}
break
;
itti_send_msg_to_task
(
TASK_NAS_NRUE
,
ctxt_pP
->
instance
,
msg_p
);
case
NR_DL_DCCH_MessageType__c1_PR_mobilityFromNRCommand
:
}
case
NR_DL_DCCH_MessageType__c1_PR_dlDedicatedMessageSegment_r16
:
}
case
NR_DL_DCCH_MessageType__c1_PR_ueInformationRequest_r16
:
break
;
case
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransferMRDC_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_mobilityFromNRCommand
:
case
NR_DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_dlDedicatedMessageSegment_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_spare3
:
case
NR_DL_DCCH_MessageType__c1_PR_ueInformationRequest_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_spare2
:
case
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransferMRDC_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_spare1
:
case
NR_DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_counterCheck
:
case
NR_DL_DCCH_MessageType__c1_PR_spare3
:
break
;
case
NR_DL_DCCH_MessageType__c1_PR_spare2
:
case
NR_DL_DCCH_MessageType__c1_PR_securityModeCommand
:
case
NR_DL_DCCH_MessageType__c1_PR_spare1
:
LOG_I
(
NR_RRC
,
"[UE %d] Received securityModeCommand (gNB %d)
\n
"
,
ctxt_pP
->
module_id
,
gNB_indexP
);
case
NR_DL_DCCH_MessageType__c1_PR_counterCheck
:
nr_rrc_ue_process_securityModeCommand
(
ctxt_pP
,
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
securityModeCommand
,
gNB_indexP
);
break
;
break
;
case
NR_DL_DCCH_MessageType__c1_PR_securityModeCommand
:
}
LOG_I
(
NR_RRC
,
"[UE %d] Received securityModeCommand (gNB %d)
\n
"
,
}
ctxt_pP
->
module_id
,
gNB_indexP
);
return
0
;
nr_rrc_ue_process_securityModeCommand
(
ctxt_pP
,
}
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
securityModeCommand
,
gNB_indexP
);
break
;
}
}
return
0
;
}
void
nr_rrc_handle_ra_indication
(
unsigned
int
mod_id
,
bool
ra_succeeded
)
void
nr_rrc_handle_ra_indication
(
unsigned
int
mod_id
,
bool
ra_succeeded
)
{
{
...
@@ -1877,15 +1827,12 @@ void *rrc_nrue_task(void *args_p)
...
@@ -1877,15 +1827,12 @@ void *rrc_nrue_task(void *args_p)
ITTI_MSG_NAME
(
msg_p
),
ITTI_MSG_NAME
(
msg_p
),
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
frame
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
frame
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
gnb_index
);
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
gnb_index
);
NR_UE_RRC_SRB_INFO_t
*
srb0
=
&
NR_UE_rrc_inst
[
ue_mod_id
].
Srb
[
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
gnb_index
][
0
];
NR_UE_RRC_SRB_INFO_t
*
srb0
=
&
NR_UE_rrc_inst
[
ue_mod_id
].
Srb
[
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
gnb_index
][
0
];
memcpy
(
srb0
->
srb_buffers
.
Rx_buffer
.
Payload
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
sdu
,
memcpy
(
srb0
->
srb_buffers
.
Rx_buffer
.
Payload
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
sdu
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
sdu_size
);
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
sdu_size
);
srb0
->
srb_buffers
.
Rx_buffer
.
payload_size
=
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
sdu_size
;
srb0
->
srb_buffers
.
Rx_buffer
.
payload_size
=
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
sdu_size
;
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
GNB_FLAG_NO
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
rnti
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
frame
,
0
);
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
GNB_FLAG_NO
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
rnti
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
frame
,
0
);
// PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0, NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
// PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0, NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
nr_rrc_ue_decode_ccch
(
&
ctxt
,
nr_rrc_ue_decode_ccch
(
&
ctxt
,
srb0
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
gnb_index
);
srb0
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
gnb_index
);
break
;
break
;
/* PDCP messages */
/* PDCP messages */
...
@@ -2058,7 +2005,7 @@ void nr_rrc_ue_process_ueCapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
...
@@ -2058,7 +2005,7 @@ void nr_rrc_ue_process_ueCapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
NR_UECapabilityEnquiry_IEs_t
*
ueCapabilityEnquiry_ie
=
UECapabilityEnquiry
->
criticalExtensions
.
choice
.
ueCapabilityEnquiry
;
NR_UECapabilityEnquiry_IEs_t
*
ueCapabilityEnquiry_ie
=
UECapabilityEnquiry
->
criticalExtensions
.
choice
.
ueCapabilityEnquiry
;
if
(
get_softmodem_params
()
->
nsa
==
1
)
{
if
(
get_softmodem_params
()
->
nsa
==
1
)
{
OCTET_STRING_t
*
requestedFreqBandsNR
=
ueCapabilityEnquiry_ie
->
ue_CapabilityEnquiryExt
;
OCTET_STRING_t
*
requestedFreqBandsNR
=
ueCapabilityEnquiry_ie
->
ue_CapabilityEnquiryExt
;
nsa_sendmsg_to_lte_ue
(
requestedFreqBandsNR
->
buf
,
requestedFreqBandsNR
->
size
,
UE_CAPABILITY_INFO
);
nsa_sendmsg_to_lte_ue
(
requestedFreqBandsNR
->
buf
,
requestedFreqBandsNR
->
size
,
UE_CAPABILITY_INFO
);
}
}
// ue_CapabilityRAT_Container.ueCapabilityRAT_Container.buf = UE_rrc_inst[ue_mod_idP].UECapability;
// ue_CapabilityRAT_Container.ueCapabilityRAT_Container.buf = UE_rrc_inst[ue_mod_idP].UECapability;
...
@@ -2069,8 +2016,10 @@ void nr_rrc_ue_process_ueCapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
...
@@ -2069,8 +2016,10 @@ void nr_rrc_ue_process_ueCapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
NR_UECapabilityInformation_t
*
ueCapabilityInformation
=
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
;
NR_UECapabilityInformation_t
*
ueCapabilityInformation
=
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
;
ueCapabilityInformation
->
criticalExtensions
.
present
=
NR_UECapabilityInformation__criticalExtensions_PR_ueCapabilityInformation
;
ueCapabilityInformation
->
criticalExtensions
.
present
=
NR_UECapabilityInformation__criticalExtensions_PR_ueCapabilityInformation
;
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
=
CALLOC
(
1
,
sizeof
(
struct
NR_UECapabilityInformation_IEs
));
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
=
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
=
CALLOC
(
1
,
sizeof
(
struct
NR_UE_CapabilityRAT_ContainerList
));
CALLOC
(
1
,
sizeof
(
struct
NR_UECapabilityInformation_IEs
));
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
=
CALLOC
(
1
,
sizeof
(
struct
NR_UE_CapabilityRAT_ContainerList
));
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
count
=
0
;
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
count
=
0
;
for
(
int
i
=
0
;
i
<
ueCapabilityEnquiry_ie
->
ue_CapabilityRAT_RequestList
.
list
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
ueCapabilityEnquiry_ie
->
ue_CapabilityRAT_RequestList
.
list
.
count
;
i
++
)
{
...
@@ -2085,8 +2034,14 @@ void nr_rrc_ue_process_ueCapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
...
@@ -2085,8 +2034,14 @@ void nr_rrc_ue_process_ueCapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
&
ul_dcch_msg
);
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
&
ul_dcch_msg
);
}
}
LOG_I
(
NR_RRC
,
"UECapabilityInformation Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
LOG_I
(
NR_RRC
,
"UECapabilityInformation Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
int
srb_id
=
1
;
//UECapabilityInformation on SRB1
int
srb_id
=
1
;
// UECapabilityInformation on SRB1
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
(
enc_rval
.
encoded
+
7
)
/
8
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
nr_pdcp_data_req_srb
(
ctxt_pP
->
rntiMaybeUEid
,
srb_id
,
nr_rrc_mui
++
,
(
enc_rval
.
encoded
+
7
)
/
8
,
buffer
,
deliver_pdu_srb_rlc
,
NULL
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/rrc_defs.h
View file @
18892963
...
@@ -178,11 +178,7 @@ typedef enum {
...
@@ -178,11 +178,7 @@ typedef enum {
IN_SYNC
=
1
IN_SYNC
=
1
}
nr_sync_msg_t
;
}
nr_sync_msg_t
;
typedef
enum
{
typedef
enum
{
RB_NOT_PRESENT
=
0
,
RB_ESTABLISHED
,
RB_SUSPENDED
}
NR_RB_status_t
;
RB_NOT_PRESENT
=
0
,
RB_ESTABLISHED
,
RB_SUSPENDED
}
NR_RB_status_t
;
typedef
struct
NR_UE_RRC_SRB_INFO_s
{
typedef
struct
NR_UE_RRC_SRB_INFO_s
{
NR_RB_status_t
status
;
NR_RB_status_t
status
;
...
@@ -207,8 +203,8 @@ typedef struct NR_UE_RRC_INST_s {
...
@@ -207,8 +203,8 @@ typedef struct NR_UE_RRC_INST_s {
rnti_t
rnti
;
rnti_t
rnti
;
NR_UE_RRC_SRB_INFO_t
Srb
[
NB_CNX_UE
][
NR_NUM_SRB
];
NR_UE_RRC_SRB_INFO_t
Srb
[
NB_CNX_UE
][
NR_NUM_SRB
];
bool
active_DRBs
[
NB_CNX_UE
][
MAX_DRBS_PER_UE
];
bool
active_DRBs
[
NB_CNX_UE
][
MAX_DRBS_PER_UE
];
bool
active_RLC_entity
[
NB_CNX_UE
][
NR_MAX_NUM_LCID
];
bool
active_RLC_entity
[
NB_CNX_UE
][
NR_MAX_NUM_LCID
];
OAI_NR_UECapability_t
*
UECap
;
OAI_NR_UECapability_t
*
UECap
;
uint8_t
*
UECapability
;
uint8_t
*
UECapability
;
...
@@ -220,7 +216,7 @@ typedef struct NR_UE_RRC_INST_s {
...
@@ -220,7 +216,7 @@ typedef struct NR_UE_RRC_INST_s {
plmn_t
plmnID
;
plmn_t
plmnID
;
NR_UE_RRC_SI_INFO
SInfo
[
NB_CNX_UE
];
NR_UE_RRC_SI_INFO
SInfo
[
NB_CNX_UE
];
NR_MIB_t
*
mib
;
NR_MIB_t
*
mib
;
...
...
This diff is collapsed.
Click to expand it.
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