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
wangjie
OpenXG-RAN
Commits
ec29831e
Commit
ec29831e
authored
Dec 18, 2020
by
Xue Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify F1AP_DL_RRC_MESSAGE in RRC
add DU_handle_DL_NR_RRC_MESSAGE_TRANSFER
parent
7b859b72
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
729 additions
and
203 deletions
+729
-203
openair2/F1AP/f1ap_du_rrc_message_transfer.c
openair2/F1AP/f1ap_du_rrc_message_transfer.c
+408
-1
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+263
-171
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+58
-31
No files found.
openair2/F1AP/f1ap_du_rrc_message_transfer.c
View file @
ec29831e
...
@@ -976,7 +976,7 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
...
@@ -976,7 +976,7 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
NR_UL_DCCH_Message_t
*
ul_dcch_msg
=
NULL
;
NR_UL_DCCH_Message_t
*
ul_dcch_msg
=
NULL
;
asn_dec_rval_t
dec_rval
;
asn_dec_rval_t
dec_rval
;
dec_rval
=
uper_decode
(
NULL
,
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_
LTE
_UL_DCCH_Message
,
&
asn_DEF_
NR
_UL_DCCH_Message
,
(
void
**
)
&
ul_dcch_msg
,
(
void
**
)
&
ul_dcch_msg
,
&
ie
->
value
.
choice
.
RRCContainer
.
buf
[
1
],
// buf[0] includes the pdcp header
&
ie
->
value
.
choice
.
RRCContainer
.
buf
[
1
],
// buf[0] includes the pdcp header
msg
->
rrc_container_length
,
0
,
0
);
msg
->
rrc_container_length
,
0
,
0
);
...
@@ -1086,3 +1086,410 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
...
@@ -1086,3 +1086,410 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
return
0
;
return
0
;
}
}
/* DL NR RRC Message Transfer */
int
DU_handle_DL_NR_RRC_MESSAGE_TRANSFER
(
instance_t
instance
,
uint32_t
assoc_id
,
uint32_t
stream
,
F1AP_F1AP_PDU_t
*
pdu
)
{
LOG_D
(
F1AP
,
"DU_handle_DL_NR_RRC_MESSAGE_TRANSFER
\n
"
);
F1AP_DLRRCMessageTransfer_t
*
container
;
F1AP_DLRRCMessageTransferIEs_t
*
ie
;
uint64_t
cu_ue_f1ap_id
;
uint64_t
du_ue_f1ap_id
;
uint64_t
srb_id
;
int
executeDuplication
;
sdu_size_t
rrc_dl_sdu_len
;
//uint64_t subscriberProfileIDforRFP;
//uint64_t rAT_FrequencySelectionPriority;
DevAssert
(
pdu
!=
NULL
);
if
(
stream
!=
0
)
{
LOG_E
(
F1AP
,
"[SCTP %d] Received F1 on stream != 0 (%d)
\n
"
,
assoc_id
,
stream
);
return
-
1
;
}
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
DLRRCMessageTransfer
;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID
,
true
);
cu_ue_f1ap_id
=
ie
->
value
.
choice
.
GNB_CU_UE_F1AP_ID
;
LOG_D
(
F1AP
,
"cu_ue_f1ap_id %lu
\n
"
,
cu_ue_f1ap_id
);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID
,
true
);
du_ue_f1ap_id
=
ie
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
LOG_D
(
F1AP
,
"du_ue_f1ap_id %lu associated with UE RNTI %x
\n
"
,
du_ue_f1ap_id
,
f1ap_get_rnti_by_du_id
(
&
f1ap_du_inst
[
instance
],
du_ue_f1ap_id
));
// this should be the one transmitted via initial ul rrc message transfer
if
(
f1ap_du_add_cu_ue_id
(
&
f1ap_du_inst
[
instance
],
du_ue_f1ap_id
,
cu_ue_f1ap_id
)
<
0
)
{
LOG_E
(
F1AP
,
"Failed to find the F1AP UID
\n
"
);
//return -1;
}
/* optional */
/* oldgNB_DU_UE_F1AP_ID */
if
(
0
)
{
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID
,
true
);
}
/* mandatory */
/* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SRBID
,
true
);
srb_id
=
ie
->
value
.
choice
.
SRBID
;
LOG_D
(
F1AP
,
"srb_id %lu
\n
"
,
srb_id
);
/* optional */
/* ExecuteDuplication */
if
(
0
)
{
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_ExecuteDuplication
,
true
);
executeDuplication
=
ie
->
value
.
choice
.
ExecuteDuplication
;
LOG_D
(
F1AP
,
"ExecuteDuplication %d
\n
"
,
executeDuplication
);
}
// issue in here
/* mandatory */
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_RRCContainer
,
true
);
// BK: need check
// create an ITTI message and copy SDU
// message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND);
// memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
rrc_dl_sdu_len
=
ie
->
value
.
choice
.
RRCContainer
.
size
;
// memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
// ccch_sdu_len);
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
//for (int i = 0;i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
//printf("\n");
/* optional */
/* RAT_FrequencyPriorityInformation */
if
(
0
)
{
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation
,
true
);
switch
(
ie
->
value
.
choice
.
RAT_FrequencyPriorityInformation
.
present
)
{
case
F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP
:
//subscriberProfileIDforRFP = ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP;
break
;
case
F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority
:
//rAT_FrequencySelectionPriority = ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority;
break
;
default:
LOG_W
(
F1AP
,
"unhandled IE RAT_FrequencyPriorityInformation.present
\n
"
);
break
;
}
}
// decode RRC Container and act on the message type
AssertFatal
(
srb_id
<
3
,
"illegal srb_id
\n
"
);
protocol_ctxt_t
ctxt
;
ctxt
.
rnti
=
f1ap_get_rnti_by_du_id
(
&
f1ap_du_inst
[
instance
],
du_ue_f1ap_id
);
ctxt
.
module_id
=
instance
;
ctxt
.
instance
=
instance
;
ctxt
.
enb_flag
=
1
;
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
ctxt
.
module_id
],
ctxt
.
rnti
);
if
(
srb_id
==
0
)
{
NR_DL_CCCH_Message_t
*
dl_ccch_msg
=
NULL
;
asn_dec_rval_t
dec_rval
;
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_DL_CCCH_Message
,
(
void
**
)
&
dl_ccch_msg
,
ie
->
value
.
choice
.
RRCContainer
.
buf
,
rrc_dl_sdu_len
,
0
,
0
);
AssertFatal
(
dec_rval
.
code
==
RC_OK
,
"could not decode F1AP message
\n
"
);
switch
(
dl_ccch_msg
->
message
.
choice
.
c1
->
present
)
{
case
NR_DL_CCCH_MessageType__c1_PR_NOTHING
:
LOG_I
(
F1AP
,
"Received PR_NOTHING on DL-CCCH-Message
\n
"
);
break
;
case
NR_DL_CCCH_MessageType__c1_PR_rrcReject
:
LOG_I
(
F1AP
,
"Logical Channel DL-CCCH (SRB0), Received RRCReject
\n
"
);
break
;
case
NR_DL_CCCH_MessageType__c1_PR_rrcSetup
:
{
LOG_I
(
F1AP
,
"Logical Channel DL-CCCH (SRB0), Received RRCSetup DU_ID %lx/RNTI %x
\n
"
,
du_ue_f1ap_id
,
f1ap_get_rnti_by_du_id
(
&
f1ap_du_inst
[
instance
],
du_ue_f1ap_id
));
// Get configuration
NR_RRCSetup_t
*
rrcSetup
=
dl_ccch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetup
;
AssertFatal
(
rrcSetup
!=
NULL
,
"rrcSetup is null
\n
"
);
NR_RRCSetup_IEs_t
*
rrcSetup_ies
=
rrcSetup
->
criticalExtensions
.
choice
.
rrcSetup
;
// get SRB logical channel information
NR_SRB_ToAddModList_t
*
SRB_configList
;
NR_SRB_ToAddMod_t
*
SRB1_config
;
NR_CellGroupConfig_t
*
cellGroupConfig
=
NULL
;
NR_LogicalChannelConfig_t
*
logicalChannelConfig
=
NULL
;
AssertFatal
(
rrcSetup_ies
->
masterCellGroup
.
buf
!=
NULL
,
"masterCellGroup is null
\n
"
);
cellGroupConfig
=
rrcSetup_ies
->
masterCellGroup
.
buf
;
// SRB_configList = rrcSetup_ies->radioBearerConfig.srb_ToAddModList;
// AssertFatal(SRB_configList!=NULL,"SRB_configList is null\n");
for
(
int
cnt
=
0
;
cnt
<
cellGroupConfig
->
rlc_BearerToAddModList
->
list
.
count
;
cnt
++
)
{
if
(
cellGroupConfig
->
rlc_BearerToAddModList
->
list
.
array
[
cnt
])
{
logicalChannelConfig
=
cellGroupConfig
->
rlc_BearerToAddModList
->
list
.
array
[
cnt
];
}
}
// for
// rrc_rlc_config_asn1_req
// This should be somewhere in the f1ap_cudu_ue_inst_t
/*int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[0], du_ue_f1ap_id);
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[macrlc_instance],rnti);
*/
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_p
->
ue_context
;
AssertFatal
(
ue_p
->
Srb0
.
Active
==
1
,
"SRB0 is not active
\n
"
);
memcpy
((
void
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
(
void
*
)
ie
->
value
.
choice
.
RRCContainer
.
buf
,
rrc_dl_sdu_len
);
// ie->value.choice.RRCContainer.size
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
=
rrc_dl_sdu_len
;
NR_MAC_CellGroupConfig_t
*
mac_CellGroupConfig
=
NULL
;
if
(
cellGroupConfig
->
mac_CellGroupConfig
)
mac_CellGroupConfig
=
cellGroupConfig
->
mac_CellGroupConfig
;
// rrc_mac_config_req_gNB
break
;
}
// case
case
NR_DL_CCCH_MessageType__c1_PR_spare2
:
LOG_I
(
F1AP
,
"Logical Channel DL-CCCH (SRB0), Received spare2
\n
"
);
break
;
case
NR_DL_CCCH_MessageType__c1_PR_spare1
:
LOG_I
(
F1AP
,
"Logical Channel DL-CCCH (SRB0), Received spare1
\n
"
);
break
;
default:
AssertFatal
(
1
==
0
,
"Unknown message
\n
"
);
break
;
}
// switch case
return
(
0
);
}
else
if
(
srb_id
==
1
)
{
NR_DL_DCCH_Message_t
*
dl_dcch_msg
=
NULL
;
asn_dec_rval_t
dec_rval
;
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_DL_DCCH_Message
,
(
void
**
)
&
dl_dcch_msg
,
&
ie
->
value
.
choice
.
RRCContainer
.
buf
[
1
],
// buf[0] includes the pdcp header
rrc_dl_sdu_len
,
0
,
0
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
LOG_E
(
F1AP
,
" Failed to decode DL-DCCH (%zu bytes)
\n
"
,
dec_rval
.
consumed
);
else
LOG_D
(
F1AP
,
"Received message: present %d and c1 present %d
\n
"
,
dl_dcch_msg
->
message
.
present
,
dl_dcch_msg
->
message
.
choice
.
c1
->
present
);
if
(
dl_dcch_msg
->
message
.
present
==
NR_DL_DCCH_MessageType_PR_c1
)
{
switch
(
dl_dcch_msg
->
message
.
choice
.
c1
->
present
)
{
case
NR_DL_DCCH_MessageType__c1_PR_NOTHING
:
LOG_I
(
F1AP
,
"Received PR_NOTHING on DL-DCCH-Message
\n
"
);
return
0
;
case
NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration
:
// handle RRCReconfiguration
LOG_I
(
F1AP
,
"Logical Channel DL-DCCH (SRB1), Received RRCReconfiguration DU_ID %lx/RNTI %x
\n
"
,
du_ue_f1ap_id
,
f1ap_get_rnti_by_du_id
(
&
f1ap_du_inst
[
instance
],
du_ue_f1ap_id
));
NR_RRCReconfiguration_t
*
rrcReconfiguration
=
&
dl_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
;
if
(
rrcReconfiguration
->
criticalExtensions
.
present
==
NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration
)
{
NR_RRCReconfiguration_IEs_t
*
rrcReconfiguration_ies
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
;
if
(
rrcReconfiguration_ies
->
measConfig
!=
NULL
)
{
LOG_I
(
F1AP
,
"Measurement Configuration is present
\n
"
);
}
if
(
rrcReconfiguration_ies
->
radioBearerConfig
)
{
LOG_I
(
F1AP
,
"Radio Resource Configuration is present
\n
"
);
uint8_t
DRB2LCHAN
[
8
];
long
drb_id
;
int
i
;
NR_DRB_ToAddModList_t
*
DRB_configList
=
rrcReconfiguration_ies
->
radioBearerConfig
->
drb_ToAddModList
;
NR_SRB_ToAddModList_t
*
SRB_configList
=
rrcReconfiguration_ies
->
radioBearerConfig
->
srb_ToAddModList
;
NR_DRB_ToReleaseList_t
*
DRB_ReleaseList
=
rrcReconfiguration_ies
->
radioBearerConfig
->
drb_ToReleaseList
;
for
(
i
=
0
;
i
<
8
;
i
++
){
DRB2LCHAN
[
i
]
=
0
;
}
// rrc_rlc_config_asn1_req
if
(
SRB_configList
!=
NULL
)
{
for
(
i
=
0
;
(
i
<
SRB_configList
->
list
.
count
)
&&
(
i
<
3
);
i
++
)
{
if
(
SRB_configList
->
list
.
array
[
i
]
->
srb_Identity
==
1
){
ue_context_p
->
ue_context
.
Srb1
.
Active
=
1
;
}
else
if
(
SRB_configList
->
list
.
array
[
i
]
->
srb_Identity
==
2
)
{
ue_context_p
->
ue_context
.
Srb2
.
Active
=
1
;
ue_context_p
->
ue_context
.
Srb2
.
Srb_info
.
Srb_id
=
2
;
LOG_I
(
F1AP
,
"[DU %d] SRB2 is now active
\n
"
,
ctxt
.
module_id
);
}
else
{
LOG_W
(
F1AP
,
"[DU %d] invalide SRB identity %ld
\n
"
,
ctxt
.
module_id
,
SRB_configList
->
list
.
array
[
i
]
->
srb_Identity
);
}
}
}
if
(
DRB_configList
!=
NULL
)
{
for
(
i
=
0
;
i
<
DRB_configList
->
list
.
count
;
i
++
)
{
// num max DRB (11-3-8)
if
(
DRB_configList
->
list
.
array
[
i
])
{
drb_id
=
(
int
)
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
;
LOG_I
(
F1AP
,
"[DU %d] Logical Channel UL-DCCH, Received RRCConnectionReconfiguration for UE rnti %x, reconfiguring DRB %d
\n
"
,
ctxt
.
module_id
,
ctxt
.
rnti
,
(
int
)
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
);
// (int)*DRB_configList->list.array[i]->logicalChannelIdentity);
if
(
ue_context_p
->
ue_context
.
DRB_active
[
drb_id
]
==
0
)
{
ue_context_p
->
ue_context
.
DRB_active
[
drb_id
]
=
1
;
// logicalChannelIdentity
// rrc_mac_config_req_eNB
}
}
else
{
// remove LCHAN from MAC/PHY
AssertFatal
(
1
==
0
,
"Can't handle this yet in DU
\n
"
);
}
}
}
}
}
break
;
case
NR_DL_DCCH_MessageType__c1_PR_rrcResume
:
LOG_I
(
F1AP
,
"Received rrcResume
\n
"
);
break
;
case
NR_DL_DCCH_MessageType__c1_PR_rrcRelease
:
LOG_I
(
F1AP
,
"Received rrcRelease
\n
"
);
break
;
case
NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment
:
LOG_I
(
F1AP
,
"Received rrcReestablishment
\n
"
);
break
;
case
NR_DL_DCCH_MessageType__c1_PR_securityModeCommand
:
LOG_I
(
F1AP
,
"Received securityModeCommand
\n
"
);
break
;
case
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer
:
LOG_I
(
F1AP
,
"Received dlInformationTransfer
\n
"
);
break
;
case
NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry
:
LOG_I
(
F1AP
,
"Received ueCapabilityEnquiry
\n
"
);
break
;
case
NR_DL_DCCH_MessageType__c1_PR_counterCheck
:
LOG_I
(
F1AP
,
"Received counterCheck
\n
"
);
break
;
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
;
}
}
}
else
if
(
srb_id
==
2
)
{
// TODO
}
LOG_I
(
F1AP
,
"Received DL RRC Transfer on srb_id %ld
\n
"
,
srb_id
);
rlc_op_status_t
rlc_status
;
boolean_t
ret
=
TRUE
;
mem_block_t
*
pdcp_pdu_p
=
NULL
;
pdcp_pdu_p
=
get_free_mem_block
(
rrc_dl_sdu_len
,
__func__
);
//LOG_I(F1AP, "PRRCContainer size %lu:", ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
//printf (", PDCP PDU size %d:", rrc_dl_sdu_len);
//for (int i=0;i<rrc_dl_sdu_len;i++) printf("%2x ",pdcp_pdu_p->data[i]);
//printf("\n");
#if(0)
if
(
pdcp_pdu_p
!=
NULL
)
{
memset
(
pdcp_pdu_p
->
data
,
0
,
rrc_dl_sdu_len
);
memcpy
(
&
pdcp_pdu_p
->
data
[
0
],
ie
->
value
.
choice
.
RRCContainer
.
buf
,
rrc_dl_sdu_len
);
rlc_status
=
rlc_data_req
(
&
ctxt
,
1
,
MBMS_FLAG_NO
,
srb_id
,
0
,
0
,
rrc_dl_sdu_len
,
pdcp_pdu_p
,
NULL
,
NULL
);
switch
(
rlc_status
)
{
case
RLC_OP_STATUS_OK
:
//LOG_I(F1AP, "Data sending request over RLC succeeded!\n");
ret
=
TRUE
;
break
;
case
RLC_OP_STATUS_BAD_PARAMETER
:
LOG_W
(
F1AP
,
"Data sending request over RLC failed with 'Bad Parameter' reason!
\n
"
);
ret
=
FALSE
;
break
;
case
RLC_OP_STATUS_INTERNAL_ERROR
:
LOG_W
(
F1AP
,
"Data sending request over RLC failed with 'Internal Error' reason!
\n
"
);
ret
=
FALSE
;
break
;
case
RLC_OP_STATUS_OUT_OF_RESSOURCES
:
LOG_W
(
F1AP
,
"Data sending request over RLC failed with 'Out of Resources' reason!
\n
"
);
ret
=
FALSE
;
break
;
default:
LOG_W
(
F1AP
,
"RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)
\n
"
,
rlc_status
);
ret
=
FALSE
;
break
;
}
// switch case
return
ret
;
}
// if pdcp_pdu_p
#endif
return
0
;
}
openair2/RRC/NR/rrc_gNB.c
View file @
ec29831e
...
@@ -405,16 +405,21 @@ rrc_gNB_generate_RRCSetup(
...
@@ -405,16 +405,21 @@ rrc_gNB_generate_RRCSetup(
case
ngran_gNB
:
case
ngran_gNB
:
// rrc_mac_config_req_gNB
// rrc_mac_config_req_gNB
break
;
#ifdef ITTI_SIM
MessageDef
*
message_p
;
default
:
uint8_t
*
message_buffer
;
LOG_W
(
NR_RRC
,
"Unknown node type %d
\n
"
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
);
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
LOG_D
(
NR_RRC
,
memcpy
(
message_buffer
,
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_CCCH_DATA_IND
);
GNB_RRC_CCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
size
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#endif
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" RRC_gNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_gNB
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" RRC_gNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_gNB
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
MSC_LOG_TX_MESSAGE
(
MSC_LOG_TX_MESSAGE
(
MSC_RRC_GNB
,
MSC_RRC_GNB
,
MSC_RRC_UE
,
MSC_RRC_UE
,
ue_p
->
Srb0
.
Tx_buffer
.
Header
,
// LG WARNING
ue_p
->
Srb0
.
Tx_buffer
.
Header
,
// LG WARNING
...
@@ -423,42 +428,22 @@ rrc_gNB_generate_RRCSetup(
...
@@ -423,42 +428,22 @@ rrc_gNB_generate_RRCSetup(
MSC_AS_TIME_ARGS
(
ctxt_pP
),
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ue_context_pP
->
ue_context
.
rnti
,
ue_context_pP
->
ue_context
.
rnti
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
LOG_I
(
NR_RRC
,
LOG_I
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
// activate release timer, if RRCSetupComplete not received after 100 frames, remove UE
// activate release timer, if RRCSetupComplete not received after 100 frames, remove UE
ue_context_pP
->
ue_context
.
ue_release_timer
=
1
;
ue_context_pP
->
ue_context
.
ue_release_timer
=
1
;
// remove UE after 10 frames after RRCConnectionRelease is triggered
// remove UE after 10 frames after RRCConnectionRelease is triggered
ue_context_pP
->
ue_context
.
ue_release_timer_thres
=
1000
;
ue_context_pP
->
ue_context
.
ue_release_timer_thres
=
1000
;
/* init timers */
/* init timers */
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
}
break
;
#ifdef ITTI_SIM
default
:
MessageDef
*
message_p
;
LOG_W
(
NR_RRC
,
"Unknown node type %d
\n
"
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
);
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
}
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
memcpy
(
message_buffer
,
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_CCCH_DATA_IND
);
GNB_RRC_CCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
size
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#else
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_p
->
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
CCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
#endif
}
}
void
void
...
@@ -471,6 +456,8 @@ rrc_gNB_generate_RRCReject(
...
@@ -471,6 +456,8 @@ rrc_gNB_generate_RRCReject(
{
{
LOG_I
(
NR_RRC
,
"rrc_gNB_generate_RRCReject
\n
"
);
LOG_I
(
NR_RRC
,
"rrc_gNB_generate_RRCReject
\n
"
);
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_pP
->
ue_context
;
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_pP
->
ue_context
;
MessageDef
*
message_p
;
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
=
do_RRCReject
(
ctxt_pP
->
module_id
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
=
do_RRCReject
(
ctxt_pP
->
module_id
,
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
);
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
);
LOG_DUMPMSG
(
NR_RRC
,
DEBUG_RRC
,
LOG_DUMPMSG
(
NR_RRC
,
DEBUG_RRC
,
...
@@ -490,17 +477,45 @@ rrc_gNB_generate_RRCReject(
...
@@ -490,17 +477,45 @@ rrc_gNB_generate_RRCReject(
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
switch
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
)
{
case
ngran_gNB_CU
:
// create an ITTI message
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_p
->
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
CCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
break
;
case
ngran_gNB_DU
:
// nothing to do for DU
AssertFatal
(
1
==
0
,
"nothing to do for DU
\n
"
);
break
;
case
ngran_gNB
:
#ifdef ITTI_SIM
#ifdef ITTI_SIM
MessageDef
*
message_p
;
uint8_t
*
message_buffer
;
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
memcpy
(
message_buffer
,
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
memcpy
(
message_buffer
,
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_CCCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_CCCH_DATA_IND
);
GNB_RRC_CCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
size
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
size
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#endif
#endif
// rrc_mac_config_req_gNB
break
;
default
:
LOG_W
(
NR_RRC
,
"Unknown node type %d
\n
"
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
);
}
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
@@ -553,7 +568,51 @@ rrc_gNB_generate_defaultRRCReconfiguration(
...
@@ -553,7 +568,51 @@ rrc_gNB_generate_defaultRRCReconfiguration(
ctxt_pP
->
frame
,
ctxt_pP
->
frame
,
size
,
size
,
ue_context_pP
->
ue_context
.
rnti
);
ue_context_pP
->
ue_context
.
rnti
);
LOG_D
(
NR_RRC
,
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]
\n
"
,
switch
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
)
{
case
ngran_gNB_CU
:
// create an ITTI message
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
LOG_I
(
NR_RRC
,
"send RRCReconfiguration to F1AP by F1AP_DL_RRC_MESSAGE
\n
"
);
nr_rrc_data_req
(
ctxt_pP
,
DCCH
,
rrc_gNB_mui
++
,
SDU_CONFIRM_NO
,
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
// rrc_pdcp_config_asn1_req
break
;
case
ngran_gNB_DU
:
// nothing to do for DU
AssertFatal
(
1
==
0
,
"nothing to do for DU
\n
"
);
break
;
case
ngran_gNB
:
#ifdef ITTI_SIM
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
size
);
memcpy
(
message_buffer
,
buffer
,
size
);
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
=
message_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
LOG_D
(
NR_RRC
,
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]
\n
"
,
ctxt_pP
->
frame
,
ctxt_pP
->
frame
,
ctxt_pP
->
module_id
,
ctxt_pP
->
module_id
,
size
,
size
,
...
@@ -561,7 +620,7 @@ rrc_gNB_generate_defaultRRCReconfiguration(
...
@@ -561,7 +620,7 @@ rrc_gNB_generate_defaultRRCReconfiguration(
rrc_gNB_mui
,
rrc_gNB_mui
,
ctxt_pP
->
module_id
,
ctxt_pP
->
module_id
,
DCCH
);
DCCH
);
MSC_LOG_TX_MESSAGE
(
MSC_RRC_GNB
,
MSC_LOG_TX_MESSAGE
(
MSC_RRC_GNB
,
MSC_RRC_UE
,
MSC_RRC_UE
,
buffer
,
buffer
,
size
,
size
,
...
@@ -570,40 +629,23 @@ rrc_gNB_generate_defaultRRCReconfiguration(
...
@@ -570,40 +629,23 @@ rrc_gNB_generate_defaultRRCReconfiguration(
ue_context_pP
->
ue_context
.
rnti
,
ue_context_pP
->
ue_context
.
rnti
,
rrc_gNB_mui
,
rrc_gNB_mui
,
size
);
size
);
#ifdef ITTI_SIM
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
size
);
memcpy
(
message_buffer
,
buffer
,
size
);
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
=
message_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
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
#if(0)
#if(0)
nr_rrc_data_req
(
ctxt_pP
,
nr_rrc_data_req
(
ctxt_pP
,
DCCH
,
DCCH
,
rrc_gNB_mui
++
,
rrc_gNB_mui
++
,
SDU_CONFIRM_NO
,
SDU_CONFIRM_NO
,
size
,
size
,
buffer
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
PDCP_TRANSMISSION_MODE_CONTROL
);
// rrc_pdcp_config_asn1_req
#endif
#endif
#endif
#endif
// rrc_pdcp_config_asn1_req
// rrc_rlc_config_asn1_req
// rrc_rlc_config_asn1_req
break
;
default
:
LOG_W
(
NR_RRC
,
"Unknown node type %d
\n
"
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
);
}
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
@@ -1598,58 +1640,82 @@ rrc_gNB_generate_SecurityModeCommand(
...
@@ -1598,58 +1640,82 @@ rrc_gNB_generate_SecurityModeCommand(
PROTOCOL_NR_RRC_CTXT_UE_FMT
" Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
);
size
);
LOG_D
(
NR_RRC
,
switch
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
)
{
case
ngran_gNB_CU
:
// create an ITTI message
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
LOG_I
(
NR_RRC
,
"calling rrc_data_req :securityModeCommand
\n
"
);
nr_rrc_data_req
(
ctxt_pP
,
DCCH
,
rrc_gNB_mui
++
,
SDU_CONFIRM_NO
,
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
break
;
case
ngran_gNB_DU
:
// nothing to do for DU
AssertFatal
(
1
==
0
,
"nothing to do for DU
\n
"
);
break
;
case
ngran_gNB
:
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" --- PDCP_DATA_REQ/%d Bytes (securityModeCommand to UE MUI %d) --->[PDCP][RB %02d]
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" --- PDCP_DATA_REQ/%d Bytes (securityModeCommand to UE MUI %d) --->[PDCP][RB %02d]
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
,
size
,
rrc_gNB_mui
,
rrc_gNB_mui
,
DCCH
);
DCCH
);
MSC_LOG_TX_MESSAGE
(
MSC_LOG_TX_MESSAGE
(
MSC_RRC_GNB
,
MSC_RRC_GNB
,
MSC_RRC_UE
,
MSC_RRC_UE
,
buffer
,
buffer
,
size
,
size
,
MSC_AS_TIME_FMT
" securityModeCommand UE %x MUI %d size %u"
,
MSC_AS_TIME_FMT
" securityModeCommand UE %x MUI %d size %u"
,
MSC_AS_TIME_ARGS
(
ctxt_pP
),
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ue_context_pP
->
ue_context
.
rnti
,
ue_context_pP
->
ue_context
.
rnti
,
rrc_gNB_mui
,
rrc_gNB_mui
,
size
);
size
);
LOG_I
(
NR_RRC
,
"calling rrc_data_req :securityModeCommand
\n
"
);
#ifdef ITTI_SIM
#ifdef ITTI_SIM
uint8_t
*
message_buffer
;
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
size
);
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
size
);
memcpy
(
message_buffer
,
buffer
,
size
);
memcpy
(
message_buffer
,
buffer
,
size
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_DCCH_DATA_IND
);
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
).
rbid
=
DCCH
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
size
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
size
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#else
#else
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
#if(0)
#if(0)
nr_rrc_data_req
(
ctxt_pP
,
LOG_I
(
NR_RRC
,
"calling rrc_data_req :securityModeCommand
\n
"
);
DCCH
,
nr_rrc_data_req
(
ctxt_pP
,
rrc_gNB_mui
++
,
DCCH
,
SDU_CONFIRM_NO
,
rrc_gNB_mui
++
,
size
,
SDU_CONFIRM_NO
,
buffer
,
size
,
PDCP_TRANSMISSION_MODE_CONTROL
);
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
#endif
#endif
#endif
#endif
break
;
default
:
LOG_W
(
NR_RRC
,
"Unknown node type %d
\n
"
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
);
}
}
}
void
void
...
@@ -1669,60 +1735,86 @@ rrc_gNB_generate_UECapabilityEnquiry(
...
@@ -1669,60 +1735,86 @@ rrc_gNB_generate_UECapabilityEnquiry(
ctxt_pP
,
ctxt_pP
,
buffer
,
buffer
,
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
));
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
));
LOG_I
(
RRC
,
LOG_I
(
NR_
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d)
\n
"
,
PROTOCOL_
NR_
RRC_CTXT_UE_FMT
" Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d)
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_
NR_
RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
);
size
);
LOG_D
(
RRC
,
switch
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
)
{
PROTOCOL_RRC_CTXT_UE_FMT
" --- PDCP_DATA_REQ/%d Bytes (NR UECapabilityEnquiry MUI %d) --->[PDCP][RB %02d]
\n
"
,
case
ngran_gNB_CU
:
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
// create an ITTI message
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
nr_rrc_data_req
(
ctxt_pP
,
DCCH
,
rrc_gNB_mui
++
,
SDU_CONFIRM_NO
,
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
break
;
case
ngran_gNB_DU
:
// nothing to do for DU
AssertFatal
(
1
==
0
,
"nothing to do for DU
\n
"
);
break
;
case
ngran_gNB
:
// rrc_mac_config_req_gNB
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" --- PDCP_DATA_REQ/%d Bytes (NR UECapabilityEnquiry MUI %d) --->[PDCP][RB %02d]
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
size
,
size
,
rrc_gNB_mui
,
rrc_gNB_mui
,
DCCH
);
DCCH
);
MSC_LOG_TX_MESSAGE
(
MSC_LOG_TX_MESSAGE
(
MSC_RRC_GNB
,
MSC_RRC_GNB
,
MSC_RRC_UE
,
MSC_RRC_UE
,
buffer
,
buffer
,
size
,
size
,
MSC_AS_TIME_FMT
" rrcNRUECapabilityEnquiry UE %x MUI %d size %u"
,
MSC_AS_TIME_FMT
" rrcNRUECapabilityEnquiry UE %x MUI %d size %u"
,
MSC_AS_TIME_ARGS
(
ctxt_pP
),
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ue_context_pP
->
ue_context
.
rnti
,
ue_context_pP
->
ue_context
.
rnti
,
rrc_gNB_mui
,
rrc_gNB_mui
,
size
);
size
);
#ifdef ITTI_SIM
#ifdef ITTI_SIM
uint8_t
*
message_buffer
;
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
size
);
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
size
);
memcpy
(
message_buffer
,
buffer
,
size
);
memcpy
(
message_buffer
,
buffer
,
size
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_DCCH_DATA_IND
);
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
).
rbid
=
DCCH
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
size
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
size
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#else
#else
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
size
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_pP
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
#if(0)
#if(0)
nr_rrc_data_req
(
nr_rrc_data_req
(
ctxt_pP
,
ctxt_pP
,
DCCH
,
DCCH
,
rrc_gNB_mui
++
,
rrc_gNB_mui
++
,
SDU_CONFIRM_NO
,
SDU_CONFIRM_NO
,
size
,
size
,
buffer
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
PDCP_TRANSMISSION_MODE_CONTROL
);
#endif
#endif
#endif
#endif
break
;
default
:
LOG_W
(
NR_RRC
,
"Unknown node type %d
\n
"
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
);
}
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
ec29831e
...
@@ -808,42 +808,69 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS(
...
@@ -808,42 +808,69 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS(
/*
/*
* switch UL or DL NAS message without RRC piggybacked to SRB2 if active.
* switch UL or DL NAS message without RRC piggybacked to SRB2 if active.
*/
*/
switch
(
RC
.
nrrrc
[
ctxt
.
module_id
]
->
node_type
)
{
case
ngran_gNB_CU
:
// create an ITTI message
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
length
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_p
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt
.
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
/* Transfer data to PDCP */
nr_rrc_data_req
(
&
ctxt
,
ue_context_p
->
ue_context
.
Srb2
.
Srb_info
.
Srb_id
,
(
*
rrc_gNB_mui
)
++
,
SDU_CONFIRM_NO
,
length
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
break
;
case
ngran_gNB_DU
:
// nothing to do for DU
AssertFatal
(
1
==
0
,
"nothing to do for DU
\n
"
);
break
;
case
ngran_gNB
:
// rrc_mac_config_req_gNB
#ifdef ITTI_SIM
#ifdef ITTI_SIM
uint8_t
*
message_buffer
;
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
length
);
message_buffer
=
itti_malloc
(
TASK_RRC_GNB_SIM
,
TASK_RRC_UE_SIM
,
length
);
memcpy
(
message_buffer
,
buffer
,
length
);
memcpy
(
message_buffer
,
buffer
,
length
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB_SIM
,
GNB_RRC_DCCH_DATA_IND
);
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
).
rbid
=
DCCH
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
sdu
=
message_buffer
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
length
;
GNB_RRC_DCCH_DATA_IND
(
message_p
).
size
=
length
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
instance
,
message_p
);
LOG_I
(
NR_RRC
,
"Send DL NAS message
\n
"
);
LOG_I
(
NR_RRC
,
"Send DL NAS message
\n
"
);
#else
#else
// F1AP_DL_RRC_MESSAGE
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
F1AP_DL_RRC_MESSAGE
);
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container
=
buffer
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
rrc_container_length
=
length
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
gNB_DU_ue_id
=
0
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
old_gNB_DU_ue_id
=
0xFFFFFFFF
;
// unknown
F1AP_DL_RRC_MESSAGE
(
message_p
).
rnti
=
ue_context_p
->
ue_context
.
rnti
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
srb_id
=
DCCH
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
execute_duplication
=
1
;
F1AP_DL_RRC_MESSAGE
(
message_p
).
RAT_frequency_priority_information
.
en_dc
=
0
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt
.
module_id
,
message_p
);
LOG_D
(
NR_RRC
,
"Send F1AP_DL_RRC_MESSAGE with ITTI
\n
"
);
#if(0)
#if(0)
/* Transfer data to PDCP */
/* Transfer data to PDCP */
nr_rrc_data_req
(
nr_rrc_data_req
(
&
ctxt
,
&
ctxt
,
ue_context_p
->
ue_context
.
Srb2
.
Srb_info
.
Srb_id
,
ue_context_p
->
ue_context
.
Srb2
.
Srb_info
.
Srb_id
,
(
*
rrc_gNB_mui
)
++
,
(
*
rrc_gNB_mui
)
++
,
SDU_CONFIRM_NO
,
SDU_CONFIRM_NO
,
length
,
length
,
buffer
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
PDCP_TRANSMISSION_MODE_CONTROL
);
#endif
#endif
#endif
#endif
break
;
default
:
LOG_W
(
NR_RRC
,
"Unknown node type %d
\n
"
,
RC
.
nrrrc
[
ctxt
.
module_id
]
->
node_type
);
}
return
(
0
);
return
(
0
);
}
}
}
}
...
...
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