Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
4766f3a6
Commit
4766f3a6
authored
Oct 19, 2020
by
Xue Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix RRCReconfiguration/RRCReconfigurationComplete
parent
4421bc56
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
35 deletions
+86
-35
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+22
-0
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+34
-31
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+30
-4
No files found.
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
4766f3a6
...
...
@@ -65,6 +65,9 @@
#include "NR_SecurityConfig.h"
#include "NR_RRCReconfiguration-v1530-IEs.h"
#include "NR_UL-DCCH-Message.h"
#include "NR_SDAP-Config.h"
#include "NR_RRCReconfigurationComplete.h"
#include "NR_RRCReconfigurationComplete-IEs.h"
#if defined(NR_Rel16)
#include "NR_SCS-SpecificCarrier.h"
#include "NR_TDD-UL-DL-ConfigCommon.h"
...
...
@@ -952,6 +955,7 @@ uint16_t do_RRCReconfiguration(
NR_DRB_ToAddModList_t
*
DRB_configList
=
NULL
;
NR_DRB_ToAddModList_t
*
DRB_configList2
=
NULL
;
NR_DRB_ToAddMod_t
*
DRB_config
=
NULL
;
NR_SDAP_Config_t
*
sdap_config
=
NULL
;
NR_SecurityConfig_t
*
security_config
=
NULL
;
NR_DedicatedNAS_Message_t
*
dedicatedNAS_Message
=
NULL
;
...
...
@@ -1003,6 +1007,9 @@ uint16_t do_RRCReconfiguration(
DRB_config
->
cnAssociation
=
CALLOC
(
1
,
sizeof
(
*
DRB_config
->
cnAssociation
));
DRB_config
->
cnAssociation
->
present
=
NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config
;
// TODO sdap_Config
sdap_config
=
CALLOC
(
1
,
sizeof
(
NR_SDAP_Config_t
));
memset
(
sdap_config
,
0
,
sizeof
(
NR_SDAP_Config_t
));
DRB_config
->
cnAssociation
->
choice
.
sdap_Config
=
sdap_config
;
// TODO pdcp_Config
DRB_config
->
reestablishPDCP
=
NULL
;
DRB_config
->
recoverPDCP
=
NULL
;
...
...
@@ -1068,6 +1075,10 @@ uint16_t do_RRCReconfiguration(
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
=
ie
;
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint
(
stdout
,
&
asn_DEF_NR_DL_DCCH_Message
,
(
void
*
)
&
dl_dcch_msg
);
// }
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_DL_DCCH_Message
,
NULL
,
(
void
*
)
&
dl_dcch_msg
,
...
...
@@ -1093,6 +1104,15 @@ uint16_t do_RRCReconfiguration(
return
(
-
1
);
}
#ifdef ITTI_SIM
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_DCCH_DATA_IND
);
GNB_RRC_DCCH_DATA_IND
(
message_p
).
rbid
=
DCCH
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
(
uint8_t
*
)
buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
(
enc_rval
.
encoded
+
7
)
/
8
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#endif
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
...
...
@@ -1162,8 +1182,10 @@ do_NR_RRCReconfigurationComplete(
ul_dcch_msg
.
message
.
present
=
NR_UL_DCCH_MessageType_PR_c1
;
ul_dcch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_UL_DCCH_MessageType__c1
));
ul_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR_UL_DCCH_MessageType__c1_PR_rrcReconfigurationComplete
;
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfigurationComplete
=
CALLOC
(
1
,
sizeof
(
NR_RRCReconfigurationComplete_t
));
rrcReconfigurationComplete
=
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfigurationComplete
;
rrcReconfigurationComplete
->
rrc_TransactionIdentifier
=
Transaction_id
;
rrcReconfigurationComplete
->
criticalExtensions
.
choice
.
rrcReconfigurationComplete
=
CALLOC
(
1
,
sizeof
(
NR_RRCReconfigurationComplete_IEs_t
));
rrcReconfigurationComplete
->
criticalExtensions
.
present
=
NR_RRCReconfigurationComplete__criticalExtensions_PR_rrcReconfigurationComplete
;
rrcReconfigurationComplete
->
criticalExtensions
.
choice
.
rrcReconfigurationComplete
->
nonCriticalExtension
=
NULL
;
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
4766f3a6
...
...
@@ -535,6 +535,14 @@ rrc_gNB_generate_defaultRRCReconfiguration(
ue_context_pP
->
ue_context
.
rnti
,
rrc_gNB_mui
,
size
);
#ifdef ITTI_SIM
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_DCCH_DATA_IND
);
GNB_RRC_DCCH_DATA_IND
(
message_p
).
rbid
=
DCCH
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
(
uint8_t
*
)
buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
size
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#else
rrc_data_req
(
ctxt_pP
,
DCCH
,
rrc_gNB_mui
++
,
...
...
@@ -542,7 +550,7 @@ rrc_gNB_generate_defaultRRCReconfiguration(
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
#endif
// rrc_pdcp_config_asn1_req
// rrc_rlc_config_asn1_req
}
...
...
@@ -571,12 +579,12 @@ rrc_gNB_process_RRCReconfigurationComplete(
rnti_t
rnti
=
ue_context_pP
->
ue_id_rnti
;
module_id_t
module_id
=
ctxt_pP
->
module_id
;
int
UE_id_mac
=
find_UE_id
(
module_id
,
rnti
);
//
int UE_id_mac = find_UE_id(module_id, rnti);
if
(
UE_id_mac
==
-
1
)
{
LOG_E
(
RRC
,
"Can't find UE_id(MAC) of UE rnti %x
\n
"
,
rnti
);
return
;
}
//
if (UE_id_mac == -1) {
//
LOG_E(RRC, "Can't find UE_id(MAC) of UE rnti %x\n", rnti);
//
return;
//
}
/* Derive the keys from kgnb */
if
(
DRB_configList
!=
NULL
)
{
...
...
@@ -597,24 +605,24 @@ rrc_gNB_process_RRCReconfigurationComplete(
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ue_context_pP
->
ue_context
.
rnti
);
nr_rrc_pdcp_config_asn1_req
(
ctxt_pP
,
SRB_configList
,
// NULL,
DRB_configList
,
DRB_Release_configList2
,
0xff
,
// already configured during the securitymodecommand
kRRCenc
,
kRRCint
,
kUPenc
,
NULL
,
NULL
,
NULL
);
/* Refresh SRBs/DRBs */
nr_rrc_rlc_config_asn1_req
(
ctxt_pP
,
SRB_configList
,
// NULL,
DRB_configList
,
DRB_Release_configList2
,
NULL
,
NULL
);
//
nr_rrc_pdcp_config_asn1_req(ctxt_pP,
//
SRB_configList, // NULL,
//
DRB_configList,
//
DRB_Release_configList2,
//
0xff, // already configured during the securitymodecommand
//
kRRCenc,
//
kRRCint,
//
kUPenc,
//
NULL,
//
NULL,
//
NULL);
/
/ /
* Refresh SRBs/DRBs */
//
nr_rrc_rlc_config_asn1_req(ctxt_pP,
//
SRB_configList, // NULL,
//
DRB_configList,
//
DRB_Release_configList2,
//
NULL,
//
NULL);
/* Loop through DRBs and establish if necessary */
if
(
DRB_configList
!=
NULL
)
{
...
...
@@ -1092,6 +1100,8 @@ rrc_gNB_decode_dcch(
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
ul_dcch_msg
);
// }
rrc_gNB_generate_defaultRRCReconfiguration
(
ctxt_pP
,
ue_context_p
);
break
;
case
NR_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation
:
...
...
@@ -1281,13 +1291,6 @@ void *rrc_gnb_task(void *args_p) {
NR_RRC_DCCH_DATA_IND
(
msg_p
).
dcch_index
,
NR_RRC_DCCH_DATA_IND
(
msg_p
).
sdu_p
,
NR_RRC_DCCH_DATA_IND
(
msg_p
).
sdu_size
);
// Message buffer has been processed, free it now.
result
=
itti_free
(
ITTI_MSG_ORIGIN_ID
(
msg_p
),
NR_RRC_DCCH_DATA_IND
(
msg_p
).
sdu_p
);
if
(
result
!=
EXIT_SUCCESS
)
{
LOG_I
(
NR_RRC
,
"Failed to free memory (%d)!
\n
"
,
result
);
break
;
}
break
;
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
4766f3a6
...
...
@@ -1663,11 +1663,30 @@ memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t));
(
enc_rval
.
encoded
+
7
)
/
8
);
memcpy
(
message_buffer
,
buffer
,
(
enc_rval
.
encoded
+
7
)
/
8
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_UE_SIM
,
UE_RRC_
C
CCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_UE_SIM
,
UE_RRC_
D
CCH_DATA_IND
);
GNB_RRC_DCCH_DATA_IND
(
message_p
).
rbid
=
DCCH
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
(
enc_rval
.
encoded
+
7
)
/
8
;
itti_send_msg_to_task
(
TASK_RRC_GNB_SIM
,
ctxt_pP
->
instance
,
message_p
);
asn_dec_rval_t
dec_rval
;
NR_UL_DCCH_Message_t
*
ul_dcch_msg
=
NULL
;
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
**
)
&
ul_dcch_msg
,
buffer
,
(
enc_rval
.
encoded
+
7
)
/
8
,
0
,
0
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
LOG_E
(
NR_RRC
,
" Failed to decode UL-DCCH (%zu bytes)
\n
"
,
dec_rval
.
consumed
);
return
-
1
;
}
else
{
LOG_I
(
NR_RRC
,
"decode securityModeComplete success
\n
"
);
}
#else
rrc_data_req
(
ctxt_pP
,
...
...
@@ -2159,6 +2178,14 @@ void nr_rrc_ue_generate_RRCReconfigurationComplete( const protocol_ctxt_t *const
nr_rrc_mui
,
UE_MODULE_ID_TO_INSTANCE
(
ctxt_pP
->
module_id
),
DCCH
);
#ifdef ITTI_SIM
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_RRC_UE_SIM
,
UE_RRC_DCCH_DATA_IND
);
UE_RRC_DCCH_DATA_IND
(
message_p
).
rbid
=
DCCH
;
UE_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
(
uint8_t
*
)
buffer
;
UE_RRC_DCCH_DATA_IND
(
message_p
).
size
=
size
;
itti_send_msg_to_task
(
TASK_RRC_GNB_SIM
,
ctxt_pP
->
instance
,
message_p
);
#else
rrc_data_req_ue
(
ctxt_pP
,
DCCH
,
...
...
@@ -2167,6 +2194,8 @@ void nr_rrc_ue_generate_RRCReconfigurationComplete( const protocol_ctxt_t *const
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
#endif
}
// from NR SRB1
...
...
@@ -2340,9 +2369,6 @@ void *rrc_nrue_task( void *args_p ) {
NR_RRC_DCCH_DATA_IND
(
msg_p
).
dcch_index
,
NR_RRC_DCCH_DATA_IND
(
msg_p
).
sdu_p
,
NR_RRC_DCCH_DATA_IND
(
msg_p
).
gNB_index
);
// Message buffer has been processed, free it now.
result
=
itti_free
(
ITTI_MSG_ORIGIN_ID
(
msg_p
),
NR_RRC_DCCH_DATA_IND
(
msg_p
).
sdu_p
);
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
break
;
default:
...
...
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