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
promise
OpenXG-RAN
Commits
aa8e695d
Commit
aa8e695d
authored
Oct 10, 2020
by
Xue Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compiling error
parent
457423fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
94 deletions
+149
-94
common/utils/ocp_itti/intertask_interface.h
common/utils/ocp_itti/intertask_interface.h
+1
-1
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+10
-9
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+40
-1
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+94
-81
openair2/RRC/NR_UE/rrc_defs.h
openair2/RRC/NR_UE/rrc_defs.h
+4
-2
No files found.
common/utils/ocp_itti/intertask_interface.h
View file @
aa8e695d
...
...
@@ -260,7 +260,7 @@ typedef struct IttiMsgText_s {
#include <openair3/GTPV1-U/gtpv1u_gNB_task.h>
void
*
rrc_enb_process_itti_msg
(
void
*
);
#include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/
S1AP/s1ap_e
NB.h>
#include <openair3/
NGAP/ngap_g
NB.h>
/*
static const char *const messages_definition_xml = {
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
aa8e695d
...
...
@@ -41,6 +41,7 @@
#include <per_encoder.h>
#include "asn1_msg.h"
#include "../nr_rrc_proto.h"
#include "RRC/NR/nr_rrc_extern.h"
#include "NR_DL-CCCH-Message.h"
#include "NR_UL-CCCH-Message.h"
...
...
@@ -951,11 +952,11 @@ uint16_t do_RRCReconfiguration(
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
rrc_TransactionIdentifier
=
Transaction_id
;
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
criticalExtensions
.
present
=
NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration
;
uint8_t
xid
=
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
);
//
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
/******************** Radio Bearer Config ********************/
/* Configure SRB2 */
SRB2_configList
=
ue_context_pP
->
ue_context
.
SRB_configList2
[
x
id
];
SRB2_configList
=
ue_context_pP
->
ue_context
.
SRB_configList2
[
Transaction_
id
];
if
(
SRB2_configList
)
{
free
(
SRB2_configList
);
...
...
@@ -1017,13 +1018,13 @@ uint16_t do_RRCReconfiguration(
ie
->
radioBearerConfig
->
drb_ToReleaseList
=
NULL
;
/******************** Secondary Cell Group ********************/
rrc_gNB_carrier_data_t
*
carrier
=
&
(
gnb_rrc_inst
->
carrier
);
fill_default_secondaryCellGroup
(
carrier
->
servingcellconfigcommon
,
ue_context_pP
->
ue_context
.
secondaryCellGroup
,
1
,
1
,
carrier
->
pdsch_AntennaPorts
,
carrier
->
initial_csi_index
[
gnb_rrc_inst
->
Nb_ue
]);
//
rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier);
//
fill_default_secondaryCellGroup( carrier->servingcellconfigcommon,
//
ue_context_pP->ue_context.secondaryCellGroup,
//
1,
//
1,
//
carrier->pdsch_AntennaPorts,
//
carrier->initial_csi_index[gnb_rrc_inst->Nb_ue]);
/******************** Meas Config ********************/
// measConfig
...
...
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
aa8e695d
...
...
@@ -67,4 +67,43 @@ int8_t mac_rrc_nr_data_req_ue(const module_id_t Mod_idP,
// todo
return
0
;
}
\ No newline at end of file
}
uint8_t
rrc_data_req_ue
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
const
confirm_t
confirmP
,
const
sdu_size_t
sdu_sizeP
,
uint8_t
*
const
buffer_pP
,
const
pdcp_transmission_mode_t
modeP
)
{
MessageDef
*
message_p
;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
ctxt_pP
->
enb_flag
?
TASK_RRC_ENB
:
TASK_RRC_UE
,
ctxt_pP
->
enb_flag
?
TASK_PDCP_ENB
:
TASK_PDCP_UE
,
sdu_sizeP
);
memcpy
(
message_buffer
,
buffer_pP
,
sdu_sizeP
);
message_p
=
itti_alloc_new_message
(
ctxt_pP
->
enb_flag
?
TASK_RRC_ENB
:
TASK_RRC_UE
,
RRC_DCCH_DATA_REQ
);
RRC_DCCH_DATA_REQ
(
message_p
).
frame
=
ctxt_pP
->
frame
;
RRC_DCCH_DATA_REQ
(
message_p
).
enb_flag
=
ctxt_pP
->
enb_flag
;
RRC_DCCH_DATA_REQ
(
message_p
).
rb_id
=
rb_idP
;
RRC_DCCH_DATA_REQ
(
message_p
).
muip
=
muiP
;
RRC_DCCH_DATA_REQ
(
message_p
).
confirmp
=
confirmP
;
RRC_DCCH_DATA_REQ
(
message_p
).
sdu_size
=
sdu_sizeP
;
RRC_DCCH_DATA_REQ
(
message_p
).
sdu_p
=
message_buffer
;
RRC_DCCH_DATA_REQ
(
message_p
).
mode
=
modeP
;
RRC_DCCH_DATA_REQ
(
message_p
).
module_id
=
ctxt_pP
->
module_id
;
RRC_DCCH_DATA_REQ
(
message_p
).
rnti
=
ctxt_pP
->
rnti
;
RRC_DCCH_DATA_REQ
(
message_p
).
eNB_index
=
ctxt_pP
->
eNB_index
;
itti_send_msg_to_task
(
TASK_PDCP_UE
,
ctxt_pP
->
instance
,
message_p
);
return
TRUE
;
// TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
openair2/RRC/NR_UE/rrc_UE.c
View file @
aa8e695d
...
...
@@ -39,6 +39,7 @@
#include "NR_BWP-Downlink.h" //asn_DEF_NR_BWP_Downlink
#include "NR_RRCReconfiguration.h"
#include "NR_MeasConfig.h"
#include "NR_UL-DCCH-Message.h"
#include "rrc_list.h"
#include "rrc_defs.h"
...
...
@@ -48,6 +49,9 @@
#include "executables/softmodem-common.h"
#include "pdcp.h"
#include "UTIL/OSA/osa_defs.h"
mui_t
nr_rrc_mui
=
0
;
extern
boolean_t
nr_rrc_pdcp_config_asn1_req
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
...
...
@@ -549,7 +553,7 @@ nr_rrc_ue_process_securityModeCommand(
LOG_I
(
RRC
,
"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), Processing securityModeCommand (eNB %d)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
ctxt_pP
->
subframe
,
gNB_index
);
switch
(
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
->
securityConfigSMC
.
securityAlgorithmConfig
.
cipheringAlgorithm
)
{
switch
(
securityModeCommand
->
criticalExtensions
.
choice
.
securityModeCommand
->
securityConfigSMC
.
securityAlgorithmConfig
.
cipheringAlgorithm
)
{
case
NR_CipheringAlgorithm_nea0
:
LOG_I
(
RRC
,
"[UE %d] Security algorithm is set to nea0
\n
"
,
ctxt_pP
->
module_id
);
...
...
@@ -573,7 +577,7 @@ nr_rrc_ue_process_securityModeCommand(
break
;
}
switch
(
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
.
securityConfigSMC
.
securityAlgorithmConfig
.
integrityProtAlgorithm
)
{
switch
(
*
securityModeCommand
->
criticalExtensions
.
choice
.
securityModeCommand
->
securityConfigSMC
.
securityAlgorithmConfig
.
integrityProtAlgorithm
)
{
case
NR_IntegrityProtAlgorithm_nia1
:
LOG_I
(
RRC
,
"[UE %d] Integrity protection algorithm is set to nia1
\n
"
,
ctxt_pP
->
module_id
);
securityMode
|=
1
<<
5
;
...
...
@@ -592,19 +596,20 @@ nr_rrc_ue_process_securityModeCommand(
LOG_D
(
RRC
,
"[UE %d] security mode is %x
\n
"
,
ctxt_pP
->
module_id
,
securityMode
);
NR_UE_rrc_inst
->
cipheringAlgorithm
=
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
.
securityConfigSMC
.
securityAlgorithmConfig
.
cipheringAlgorithm
;
securityModeCommand
->
criticalExtensions
.
choice
.
securityModeCommand
->
securityConfigSMC
.
securityAlgorithmConfig
.
cipheringAlgorithm
;
NR_UE_rrc_inst
->
integrityProtAlgorithm
=
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
.
securityConfigSMC
.
securityAlgorithmConfig
.
integrityProtAlgorithm
;
memset
((
void
*
)
&
ul_dcch_msg
,
0
,
sizeof
(
LTE
_UL_DCCH_Message_t
));
*
securityModeCommand
->
criticalExtensions
.
choice
.
securityModeCommand
->
securityConfigSMC
.
securityAlgorithmConfig
.
integrityProtAlgorithm
;
memset
((
void
*
)
&
ul_dcch_msg
,
0
,
sizeof
(
NR
_UL_DCCH_Message_t
));
//memset((void *)&SecurityModeCommand,0,sizeof(SecurityModeCommand_t));
ul_dcch_msg
.
message
.
present
=
LTE_UL_DCCH_MessageType_PR_c1
;
ul_dcch_msg
.
message
.
present
=
NR_UL_DCCH_MessageType_PR_c1
;
ul_dcch_msg
.
message
.
choice
.
c1
=
calloc
(
1
,
sizeof
(
*
ul_dcch_msg
.
message
.
choice
.
c1
));
if
(
securityMode
>=
NO_SECURITY_MODE
)
{
LOG_I
(
RRC
,
"rrc_ue_process_securityModeCommand, security mode complete case
\n
"
);
ul_dcch_msg
.
message
.
choice
.
c1
.
present
=
LTE
_UL_DCCH_MessageType__c1_PR_securityModeComplete
;
ul_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR
_UL_DCCH_MessageType__c1_PR_securityModeComplete
;
}
else
{
LOG_I
(
RRC
,
"rrc_ue_process_securityModeCommand, security mode failure case
\n
"
);
ul_dcch_msg
.
message
.
choice
.
c1
.
present
=
LTE
_UL_DCCH_MessageType__c1_PR_securityModeFailure
;
ul_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR
_UL_DCCH_MessageType__c1_PR_securityModeFailure
;
}
uint8_t
*
kRRCenc
=
NULL
;
...
...
@@ -653,11 +658,11 @@ memset((void *)&ul_dcch_msg,0,sizeof(LTE_UL_DCCH_Message_t));
LOG_I
(
RRC
,
"Could not get PDCP instance where key=0x%ld
\n
"
,
key
);
}
if
(
securityModeCommand
->
criticalExtensions
.
present
==
NR_SecurityModeCom
plete__criticalExtensions_PR_securityModeComplete
)
{
if
(
securityModeCommand
->
criticalExtensions
.
present
==
NR_SecurityModeCom
mand__criticalExtensions_PR_securityModeCommand
)
{
ul_dcch_msg
.
message
.
choice
->
c1
->
choice
.
securityModeComplete
.
rrc_TransactionIdentifier
=
securityModeCommand
->
rrc_TransactionIdentifier
;
ul_dcch_msg
.
message
.
choice
->
c1
->
choice
.
securityModeComplete
.
criticalExtensions
.
present
=
NR_SecurityModeComplete__criticalExtensions_PR_securityModeComplete
;
ul_dcch_msg
.
message
.
choice
->
c1
->
choice
.
securityModeComplete
.
criticalExtensions
.
choice
.
securityModeComplete
->
nonCriticalExtension
=
NULL
;
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
securityModeComplete
->
rrc_TransactionIdentifier
=
securityModeCommand
->
rrc_TransactionIdentifier
;
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
securityModeComplete
->
criticalExtensions
.
present
=
NR_SecurityModeComplete__criticalExtensions_PR_securityModeComplete
;
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
securityModeComplete
->
criticalExtensions
.
choice
.
securityModeComplete
->
nonCriticalExtension
=
NULL
;
LOG_I
(
RRC
,
"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), encoding securityModeComplete (eNB %d), rrc_TransactionIdentifier: %ld
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
ctxt_pP
->
subframe
,
gNB_index
,
securityModeCommand
->
rrc_TransactionIdentifier
);
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_UL_DCCH_Message
,
...
...
@@ -682,7 +687,7 @@ memset((void *)&ul_dcch_msg,0,sizeof(LTE_UL_DCCH_Message_t));
rrc_data_req
(
ctxt_pP
,
DCCH
,
rrc_mui
++
,
nr_
rrc_mui
++
,
SDU_CONFIRM_NO
,
(
enc_rval
.
encoded
+
7
)
/
8
,
buffer
,
...
...
@@ -695,7 +700,7 @@ memset((void *)&ul_dcch_msg,0,sizeof(LTE_UL_DCCH_Message_t));
void
rrc_ue_generate_RRCSetupRequest
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
)
{
uint8_t
i
=
0
,
rv
[
6
];
if
(
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
==
0
)
{
if
(
NR_
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
==
0
)
{
// Get RRCConnectionRequest, fill random for now
// Generate random byte stream for contention resolution
for
(
i
=
0
;
i
<
6
;
i
++
)
{
...
...
@@ -709,16 +714,16 @@ void rrc_ue_generate_RRCSetupRequest( const protocol_ctxt_t *const ctxt_pP, cons
}
LOG_T
(
RRC
,
"
\n
"
);
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
=
NR_
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
=
do_RRCSetupRequest
(
ctxt_pP
->
module_id
,
(
uint8_t
*
)
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
,
(
uint8_t
*
)
NR_
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
,
rv
);
LOG_I
(
RRC
,
"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCSetupRequest (bytes %d, eNB %d)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
,
gNB_index
);
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
NR_
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
,
gNB_index
);
for
(
i
=
0
;
i
<
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
;
i
++
)
{
LOG_T
(
RRC
,
"%x."
,
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
[
i
]);
for
(
i
=
0
;
i
<
NR_
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
;
i
++
)
{
LOG_T
(
RRC
,
"%x."
,
NR_
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
[
i
]);
}
LOG_T
(
RRC
,
"
\n
"
);
...
...
@@ -791,10 +796,10 @@ nr_rrc_ue_establish_drb(
(
void
)
oip_ifup
;
(
void
)
ip_addr_offset3
;
(
void
)
ip_addr_offset4
;
LOG_I
(
NR_RRC
,
"[UE %d] Frame %d: processing RRCReconfiguration: reconfiguring DRB %ld
/LCID %d
\n
"
,
ue_mod_idP
,
frameP
,
DRB_config
->
drb_Identity
,
(
int
)
*
DRB_config
->
logicalChannelIdentity
);
LOG_I
(
NR_RRC
,
"[UE %d] Frame %d: processing RRCReconfiguration: reconfiguring DRB %ld
\n
"
,
ue_mod_idP
,
frameP
,
DRB_config
->
drb_Identity
);
if
(
!
AMF_MODE_ENABLED
)
{
//
if(!AMF_MODE_ENABLED) {
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
,
...
...
@@ -818,7 +823,7 @@ nr_rrc_ue_establish_drb(
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
);
}
...
...
@@ -958,31 +963,30 @@ nr_rrc_ue_process_radioBearerConfig(
{
long
SRB_id
,
DRB_id
;
int
i
,
cnt
;
long
ind
;
if
(
radioBearerConfig
->
securityConfig
!=
NULL
)
{
if
(
*
radioBearerConfig
->
securityConfig
->
keyToUse
==
NR_SecurityConfig__keyToUse_master
)
{
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
cipheringAlgorithm
=
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
cipheringAlgorithm
;
&
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrityProtAlgorithm
=
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
integrityProtAlgorithm
;
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrityProtAlgorithm
=
*
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
integrityProtAlgorithm
;
}
}
if
(
radioBearerConfig
->
srb_ToAddModList
!=
NULL
)
{
uint8_t
*
kRRCenc
=
NULL
;
uint8_t
*
kRRCint
=
NULL
;
derive_key_rrc_enc
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciphering
_a
lgorithm
,
derive_key_rrc_enc
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciphering
A
lgorithm
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
kgnb
,
&
kRRCenc
);
derive_key_rrc_int
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
_a
lgorithm
,
derive_key_rrc_int
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
ProtA
lgorithm
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
kgnb
,
&
kRRCint
);
// Refresh SRBs
nr_rrc_pdcp_config_asn1_req
(
ctxt_pP
,
radioBearerConfig
->
srb_ToAddModList
,
NULL
,
NULL
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciph
gering_a
lgorithm
|
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
_a
lgorithm
<<
4
),
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciph
eringA
lgorithm
|
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
ProtA
lgorithm
<<
4
),
kRRCenc
,
kRRCint
,
NULL
,
...
...
@@ -1044,18 +1048,18 @@ nr_rrc_ue_process_radioBearerConfig(
}
for
(
cnt
=
0
;
cnt
<
radioBearerConfig
->
drb_ToAddModList
->
list
.
count
;
cnt
++
)
{
ind
=
radioBearerConfig
->
drb_ToRelease
List
->
list
.
array
[
cnt
]
->
drb_Identity
;
if
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
in
d
-
1
])
{
memcpy
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
in
d
-
1
],
DRB_id
=
radioBearerConfig
->
drb_ToAddMod
List
->
list
.
array
[
cnt
]
->
drb_Identity
;
if
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
DRB_i
d
-
1
])
{
memcpy
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
DRB_i
d
-
1
],
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
],
sizeof
(
NR_DRB_ToAddMod_t
));
}
else
{
LOG_D
(
NR_RRC
,
"Adding DRB %ld %p
\n
"
,
in
d
-
1
,
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
]);
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
in
d
-
1
]
=
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
];
LOG_D
(
NR_RRC
,
"Adding DRB %ld %p
\n
"
,
DRB_i
d
-
1
,
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
]);
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
DRB_i
d
-
1
]
=
radioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
cnt
];
}
}
uint8_t
*
kUPenc
=
NULL
;
derive_key_up_enc
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciphering
_a
lgorithm
,
derive_key_up_enc
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciphering
A
lgorithm
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
kgnb
,
&
kUPenc
);
MSC_LOG_TX_MESSAGE
(
MSC_RRC_UE
,
...
...
@@ -1065,16 +1069,16 @@ nr_rrc_ue_process_radioBearerConfig(
MSC_AS_TIME_FMT
" CONFIG_REQ UE %x DRB (security %X)"
,
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ctxt_pP
->
rnti
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciphering
_a
lgorithm
|
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
_a
lgorithm
<<
4
));
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciphering
A
lgorithm
|
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
ProtA
lgorithm
<<
4
));
// Refresh DRBs
nr_rrc_pdcp_config_asn1_req
(
ctxt_pP
,
NULL
,
radioBearerConfig
->
drb_ToAddModList
,
NULL
,
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciph
gering_a
lgorithm
|
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
_a
lgorithm
<<
4
),
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
ciph
eringA
lgorithm
|
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
integrity
ProtA
lgorithm
<<
4
),
NULL
,
NULL
,
kUPenc
,
...
...
@@ -1084,7 +1088,7 @@ nr_rrc_ue_process_radioBearerConfig(
// Refresh DRBs
nr_rrc_rlc_config_asn1_req
(
ctxt_pP
,
NULL
,
NULradioBearerConfig
->
drb_ToAddModListL
,
radioBearerConfig
->
drb_ToAddModList
,
NULL
,
NULL
,
NULL
...
...
@@ -1093,8 +1097,8 @@ nr_rrc_ue_process_radioBearerConfig(
if
(
radioBearerConfig
->
drb_ToReleaseList
!=
NULL
)
{
for
(
i
=
0
;
i
<
radioBearerConfig
->
drb_ToReleaseList
->
list
.
count
;
i
++
)
{
in
d
=
*
radioBearerConfig
->
drb_ToReleaseList
->
list
.
array
[
i
];
free
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
in
d
-
1
]);
DRB_i
d
=
*
radioBearerConfig
->
drb_ToReleaseList
->
list
.
array
[
i
];
free
(
NR_UE_rrc_inst
[
ctxt_pP
->
module_id
].
DRB_config
[
gNB_index
][
DRB_i
d
-
1
]);
}
}
...
...
@@ -1116,9 +1120,9 @@ rrc_ue_process_rrcReconfiguration(
NR_RRCReconfiguration_IEs_t
*
ie
=
NULL
;
if
(
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
criticalExtensions
.
present
if
(
rrcReconfiguration
->
criticalExtensions
.
present
==
NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration
)
{
ie
=
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
;
ie
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
;
if
(
ie
->
measConfig
!=
NULL
)
{
LOG_I
(
NR_RRC
,
"Measurement Configuration is present
\n
"
);
nr_rrc_ue_process_measConfig
(
ctxt_pP
,
gNB_index
,
ie
->
measConfig
);
...
...
@@ -1151,10 +1155,35 @@ rrc_ue_process_rrcReconfiguration(
}
}
//-----------------------------------------------------------------------------
void
nr_rrc_ue_generate_RRCReconfigurationComplete
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
,
const
uint8_t
Transaction_id
)
{
uint8_t
buffer
[
32
],
size
;
size
=
do_NR_RRCReconfigurationComplete
(
ctxt_pP
,
buffer
,
Transaction_id
);
LOG_I
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Logical Channel UL-DCCH (SRB1), Generating RRCReconfigurationComplete (bytes %d, gNB_index %d)
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
,
gNB_index
);
LOG_D
(
RLC
,
"[FRAME %05d][RRC_UE][INST %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCReconfigurationComplete to gNB %d MUI %d) --->][PDCP][INST %02d][RB %02d]
\n
"
,
ctxt_pP
->
frame
,
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
size
,
gNB_index
,
nr_rrc_mui
,
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
DCCH
);
rrc_data_req_ue
(
ctxt_pP
,
DCCH
,
nr_rrc_mui
++
,
SDU_CONFIRM_NO
,
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
}
// from NR SRB1
//-----------------------------------------------------------------------------
int
rrc_ue_decode_dcch
(
nr_
rrc_ue_decode_dcch
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
srb_id_t
Srb_id
,
const
uint8_t
*
const
Buffer
,
...
...
@@ -1191,8 +1220,8 @@ rrc_ue_decode_dcch(
xer_fprint
(
stdout
,
&
asn_DEF_NR_DL_DCCH_Message
,(
void
*
)
dl_dcch_msg
);
}
if
(
u
l_dcch_msg
->
message
.
present
==
NR_DL_DCCH_MessageType_PR_c1
)
{
switch
(
u
l_dcch_msg
->
message
.
choice
.
c1
->
present
)
{
if
(
d
l_dcch_msg
->
message
.
present
==
NR_DL_DCCH_MessageType_PR_c1
)
{
switch
(
d
l_dcch_msg
->
message
.
choice
.
c1
->
present
)
{
case
NR_DL_DCCH_MessageType__c1_PR_NOTHING
:
LOG_I
(
NR_RRC
,
"Received PR_NOTHING on DL-DCCH-Message
\n
"
);
break
;
...
...
@@ -1204,49 +1233,33 @@ rrc_ue_decode_dcch(
nr_rrc_ue_generate_RRCReconfigurationComplete
(
ctxt_pP
,
gNB_indexP
,
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
rrc_TransactionIdentifier
);
break
;
break
;
case
NR_DL_DCCH_MessageType__c1_PR_rrcResume
:
case
NR_DL_DCCH_MessageType__c1_PR_rrcRelease
:
case
NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment
:
case
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer
:
case
NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry
:
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
:
case
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransferMRDC_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r16
:
case
NR_DL_DCCH_MessageType__c1_PR_spare3
:
case
NR_DL_DCCH_MessageType__c1_PR_spare2
:
case
NR_DL_DCCH_MessageType__c1_PR_spare1
:
break
;
case
NR_DL_DCCH_MessageType__c1_PR_securityModeCommand
:
break
;
case
NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry
:
break
;
}
}
return
0
;
}
//-----------------------------------------------------------------------------
void
nr_rrc_ue_generate_RRCReconfigurationComplete
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
,
const
uint8_t
Transaction_id
)
{
uint8_t
buffer
[
32
],
size
;
size
=
do_NR_RRCReconfigurationComplete
(
ctxt_pP
,
buffer
,
Transaction_id
);
LOG_I
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Logical Channel UL-DCCH (SRB1), Generating RRCReconfigurationComplete (bytes %d, gNB_index %d)
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
,
gNB_index
);
LOG_D
(
RLC
,
"[FRAME %05d][RRC_UE][INST %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCReconfigurationComplete to gNB %d MUI %d) --->][PDCP][INST %02d][RB %02d]
\n
"
,
ctxt_pP
->
frame
,
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
size
,
gNB_index
,
rrc_mui
,
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
DCCH
);
rrc_data_req_ue
(
ctxt_pP
,
DCCH
,
rrc_mui
++
,
SDU_CONFIRM_NO
,
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
}
/*--------------------------------------------------*/
static
void
rrc_ue_generate_RRCSetupComplete
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gN
b
_index
,
const
uint8_t
gN
B
_index
,
const
uint8_t
Transaction_id
,
uint8_t
sel_plmn_id
){
uint8_t
buffer
[
100
];
...
...
@@ -1267,12 +1280,12 @@ static void rrc_ue_generate_RRCSetupComplete(
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
size
,
gNB_index
);
LOG_D
(
RLC
,
"[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to gNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]
\n
"
,
ctxt_pP
->
frame
,
ctxt_pP
->
module_id
+
NB_RN_INST
,
size
,
gNB_index
,
rrc_mui
,
ctxt_pP
->
module_id
+
NB_eNB_INST
,
DCCH
);
ctxt_pP_local
.
rnti
=
ctxt_pP
->
rnti
;
ctxt_pP
->
frame
,
ctxt_pP
->
module_id
+
NB_RN_INST
,
size
,
gNB_index
,
nr_
rrc_mui
,
ctxt_pP
->
module_id
+
NB_eNB_INST
,
DCCH
);
//
ctxt_pP_local.rnti = ctxt_pP->rnti;
rrc_data_req_ue
(
ctxt_pP
,
DCCH
,
rrc_mui
++
,
nr_
rrc_mui
++
,
SDU_CONFIRM_NO
,
size
,
buffer
,
...
...
openair2/RRC/NR_UE/rrc_defs.h
View file @
aa8e695d
...
...
@@ -53,6 +53,7 @@
#include "NR_MIB.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_DL-DCCH-Message.h"
#include "../NR/nr_rrc_defs.h"
#define NB_NR_UE_INST 1
#define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
...
...
@@ -86,8 +87,9 @@ typedef struct NR_UE_RRC_INST_s {
NR_DRB_ToAddMod_t
*
DRB_config
[
NB_CNX_UE
][
8
];
rb_id_t
*
defaultDRB
;
// remember the ID of the default DRB
NR_SRB_INFO_TABLE_ENTRY
Srb1
;
NR_SRB_INFO_TABLE_ENTRY
Srb2
;
NR_SRB_INFO
Srb0
[
NB_SIG_CNX_UE
];
NR_SRB_INFO_TABLE_ENTRY
Srb1
[
NB_CNX_UE
];
NR_SRB_INFO_TABLE_ENTRY
Srb2
[
NB_CNX_UE
];
NR_UE_RRC_INFO
Info
[
NB_SIG_CNX_UE
];
...
...
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