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
e9421938
Commit
e9421938
authored
Sep 03, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Plain Diff
add partial coding ue context resp
parents
14775c9d
7fab0147
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
221 additions
and
128 deletions
+221
-128
openair2/COMMON/f1ap_messages_types.h
openair2/COMMON/f1ap_messages_types.h
+14
-4
openair2/F1AP/f1ap_cu_ue_context_management.c
openair2/F1AP/f1ap_cu_ue_context_management.c
+89
-3
openair2/F1AP/f1ap_du_ue_context_management.c
openair2/F1AP/f1ap_du_ue_context_management.c
+106
-115
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+4
-2
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+8
-4
No files found.
openair2/COMMON/f1ap_messages_types.h
View file @
e9421938
...
...
@@ -317,22 +317,28 @@ typedef struct f1ap_ul_rrc_message_s {
typedef
struct
f1ap_up_tnl_s
{
in_addr_t
tl_address
;
// currently only IPv4 supported
teid_t
outgoingTeid
;
teid_t
incomingTeid
;
teid_t
teid
;
}
f1ap_up_tnl_t
;
typedef
struct
f1ap_drb_to_be_setup_s
{
long
drb_id
;
f1ap_up_tnl_t
tnl
[
2
];
uint8_t
tnl_length
;
f1ap_up_tnl_t
up_ul_tnl
[
2
];
uint8_t
up_ul_tnl_length
;
f1ap_up_tnl_t
up_dl_tnl
[
2
];
uint8_t
up_dl_tnl_length
;
rlc_mode_t
rlc_mode
;
}
f1ap_drb_to_be_setup_t
;
typedef
struct
f1ap_srb_to_be_setup_s
{
long
srb_id
;
rlc_mode_t
rlc_mode
;
uint8_t
lcid
;
}
f1ap_srb_to_be_setup_t
;
typedef
struct
f1ap_rb_failed_to_be_setup_s
{
long
rb_id
;
}
f1ap_rb_failed_to_be_setup_t
;
typedef
struct
f1ap_ue_context_setup_req_s
{
uint32_t
gNB_CU_ue_id
;
// BK: need to replace by use from rnti
uint32_t
gNB_DU_ue_id
;
...
...
@@ -367,6 +373,10 @@ typedef struct f1ap_ue_context_setup_resp_s {
uint8_t
drbs_setup_length
;
// BK: need to replace by s1ap_initial_context_setup_req
f1ap_srb_to_be_setup_t
*
srbs_setup
;
uint8_t
srbs_setup_length
;
uint8_t
srbs_failed_to_be_setup_length
;
f1ap_rb_failed_to_be_setup_t
*
srbs_failed_to_be_setup
;
uint8_t
drbs_failed_to_be_setup_length
;
f1ap_rb_failed_to_be_setup_t
*
drbs_failed_to_be_setup
;
}
f1ap_ue_context_setup_resp_t
;
typedef
enum
F1ap_Cause_e
{
...
...
openair2/F1AP/f1ap_cu_ue_context_management.c
View file @
e9421938
...
...
@@ -509,7 +509,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
}
// if some_decide_qos
/* 12.1.3 uLUPTNLInformation_ToBeSetup_List */
for
(
int
j
=
0
;
j
<
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
tnl_length
;
j
++
)
{
for
(
int
j
=
0
;
j
<
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
up_ul_
tnl_length
;
j
++
)
{
/* 12.3.1 ULTunnels_ToBeSetup_Item */
asn1cSequenceAdd
(
drbs_toBeSetup_item
->
uLUPTNLInformation_ToBeSetup_List
.
list
,
F1AP_ULUPTNLInformation_ToBeSetup_Item_t
,
uLUPTNLInformation_ToBeSetup_Item
);
...
...
@@ -517,10 +517,10 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
asn1cCalloc
(
uLUPTNLInformation_ToBeSetup_Item
->
uLUPTNLInformation
.
choice
.
gTPTunnel
,
F1AP_GTPTunnel_t
,
gTPTunnel
);
/* 12.3.1.1.1 transportLayerAddress */
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
tnl
[
j
].
tl_address
,
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
up_ul_
tnl
[
j
].
tl_address
,
&
gTPTunnel
->
transportLayerAddress
);
/* 12.3.1.1.2 gTP_TEID */
INT32_TO_OCTET_STRING
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
tnl
[
j
].
outgoingT
eid
,
INT32_TO_OCTET_STRING
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
up_ul_tnl
[
j
].
t
eid
,
&
gTPTunnel
->
gTP_TEID
);
}
...
...
@@ -626,31 +626,117 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
uint32_t
assoc_id
,
uint32_t
stream
,
F1AP_F1AP_PDU_t
*
pdu
)
{
MessageDef
*
msg_p
;
F1AP_UEContextSetupResponse_t
*
container
;
F1AP_UEContextSetupResponseIEs_t
*
ie
;
DevAssert
(
pdu
);
msg_p
=
itti_alloc_new_message
(
TASK_DU_F1
,
0
,
F1AP_UE_CONTEXT_SETUP_RESP
);
f1ap_ue_context_setup_resp_t
*
f1ap_ue_context_setup_resp
=
&
F1AP_UE_CONTEXT_SETUP_RESP
(
msg_p
);
container
=
&
pdu
->
choice
.
successfulOutcome
->
value
.
choice
.
UEContextSetupResponse
;
int
i
;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID
,
true
);
f1ap_ue_context_setup_resp
->
gNB_CU_ue_id
=
ie
->
value
.
choice
.
GNB_CU_UE_F1AP_ID
;
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID
,
true
);
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
=
ie
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
/* DUtoCURRCInformation */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation
,
true
);
if
(
ie
==
NULL
){
LOG_E
(
F1AP
,
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
memcpy
(
f1ap_ue_context_setup_resp
->
du_to_cu_rrc_information
,
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
buf
,
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
size
);
f1ap_ue_context_setup_resp
->
du_to_cu_rrc_information_length
=
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
size
;
/* DRBs_Setup_List */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DRBs_Setup_List
,
true
);
if
(
ie
!=
NULL
){
f1ap_ue_context_setup_resp
->
drbs_setup_length
=
ie
->
value
.
choice
.
DRBs_Setup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
drbs_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
drbs_setup_length
,
sizeof
(
f1ap_drb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
drbs_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->drbs_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
drbs_setup_length
;
++
i
)
{
f1ap_drb_to_be_setup_t
*
drb_p
=
&
f1ap_ue_context_setup_resp
->
drbs_setup
[
i
];
F1AP_DRBs_Setup_Item_t
*
drbs_setup_item_p
;
drbs_setup_item_p
=
&
((
F1AP_DRBs_Setup_ItemIEs_t
*
)
ie
->
value
.
choice
.
DRBs_Setup_List
.
list
.
array
[
i
])
->
value
.
choice
.
DRBs_Setup_Item
;
drb_p
->
drb_id
=
drbs_setup_item_p
->
dRBID
;
/* TODO in the following, assume only one UP UL TNL is present.
* this matches/assumes OAI CU/DU implementation, can be up to 2! */
drb_p
->
up_dl_tnl_length
=
1
;
AssertFatal
(
drbs_setup_item_p
->
dLUPTNLInformation_ToBeSetup_List
.
list
.
count
>
0
,
"no DL UP TNL Information in DRBs to be Setup list
\n
"
);
F1AP_DLUPTNLInformation_ToBeSetup_Item_t
*
dl_up_tnl_info_p
=
(
F1AP_DLUPTNLInformation_ToBeSetup_Item_t
*
)
drbs_setup_item_p
->
dLUPTNLInformation_ToBeSetup_List
.
list
.
array
[
0
];
F1AP_GTPTunnel_t
*
dl_up_tnl0
=
dl_up_tnl_info_p
->
dLUPTNLInformation
.
choice
.
gTPTunnel
;
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4
(
&
dl_up_tnl0
->
transportLayerAddress
,
drb_p
->
up_dl_tnl
[
0
].
tl_address
);
OCTET_STRING_TO_INT32
(
&
dl_up_tnl0
->
gTP_TEID
,
drb_p
->
up_dl_tnl
[
0
].
teid
);
}
}
/* SRBs_FailedToBeSetup_List */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List
,
true
);
if
(
ie
!=
NULL
){
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup_length
=
ie
->
value
.
choice
.
SRBs_FailedToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup_length
,
sizeof
(
f1ap_rb_failed_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->srbs_failed_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup_length
;
++
i
)
{
f1ap_rb_failed_to_be_setup_t
*
srb_p
=
&
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup
[
i
];
srb_p
->
rb_id
=
((
F1AP_SRBs_FailedToBeSetup_Item_t
*
)
ie
->
value
.
choice
.
SRBs_FailedToBeSetup_List
.
list
.
array
[
i
])
->
sRBID
;
}
}
/* DRBs_FailedToBeSetup_List */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List
,
true
);
if
(
ie
!=
NULL
){
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup_length
=
ie
->
value
.
choice
.
DRBs_FailedToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup_length
,
sizeof
(
f1ap_rb_failed_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->drbs_failed_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup_length
;
++
i
)
{
f1ap_rb_failed_to_be_setup_t
*
drb_p
=
&
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup
[
i
];
drb_p
->
rb_id
=
((
F1AP_DRBs_FailedToBeSetup_Item_t
*
)
ie
->
value
.
choice
.
DRBs_FailedToBeSetup_List
.
list
.
array
[
i
])
->
dRBID
;
}
}
/* SCell_FailedtoSetup_List */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List
,
true
);
if
(
ie
!=
NULL
){
LOG_E
(
F1AP
,
"Not supporting handling of SCell_FailedtoSetup_List
\n
"
);
}
/* SRBs_Setup_List */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SRBs_Setup_List
,
true
);
if
(
ie
!=
NULL
){
f1ap_ue_context_setup_resp
->
srbs_setup_length
=
ie
->
value
.
choice
.
SRBs_Setup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
srbs_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
srbs_setup_length
,
sizeof
(
f1ap_srb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
drbs_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->drbs_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
srbs_setup_length
;
++
i
)
{
f1ap_srb_to_be_setup_t
*
srb_p
=
&
f1ap_ue_context_setup_resp
->
srbs_setup
[
i
];
F1AP_SRBs_Setup_Item_t
*
srbs_setup_item_p
;
srbs_setup_item_p
=
&
((
F1AP_SRBs_Setup_ItemIEs_t
*
)
ie
->
value
.
choice
.
SRBs_Setup_List
.
list
.
array
[
i
])
->
value
.
choice
.
SRBs_Setup_Item
;
srb_p
->
srb_id
=
srbs_setup_item_p
->
sRBID
;
srb_p
->
lcid
=
srbs_setup_item_p
->
lCID
;
}
}
itti_send_msg_to_task
(
TASK_RRC_GNB
,
instance
,
msg_p
);
return
0
;
}
...
...
openair2/F1AP/f1ap_du_ue_context_management.c
View file @
e9421938
...
...
@@ -43,19 +43,19 @@
#include <openair3/ocp-gtpu/gtp_itf.h>
boolean_t
DURecvCb
(
protocol_ctxt_t
*
ctxt_pP
,
const
srb_flag_t
srb_flagP
,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
const
confirm_t
confirmP
,
const
sdu_size_t
sdu_buffer_sizeP
,
unsigned
char
*
const
sdu_buffer_pP
,
const
pdcp_transmission_mode_t
modeP
,
const
uint32_t
*
sourceL2Id
,
const
uint32_t
*
destinationL2Id
)
{
const
srb_flag_t
srb_flagP
,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
const
confirm_t
confirmP
,
const
sdu_size_t
sdu_buffer_sizeP
,
unsigned
char
*
const
sdu_buffer_pP
,
const
pdcp_transmission_mode_t
modeP
,
const
uint32_t
*
sourceL2Id
,
const
uint32_t
*
destinationL2Id
)
{
return
true
;
}
int
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
instance_t
instance
,
f1ap_ue_context_setup_req_t
*
req
);
int
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
instance_t
instance
,
f1ap_ue_context_setup_req_t
*
req
);
int
DU_handle_UE_CONTEXT_SETUP_REQUEST
(
instance_t
instance
,
uint32_t
assoc_id
,
uint32_t
stream
,
...
...
@@ -80,7 +80,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
if
(
ieDU_UE
)
{
f1ap_ue_context_setup_req
->
gNB_DU_ue_id
=
ieDU_UE
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
ieDU_UE
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
f1ap_ue_context_setup_req
->
rnti
=
f1ap_get_rnti_by_du_id
(
false
,
instance
,
f1ap_ue_context_setup_req
->
gNB_DU_ue_id
);
}
else
{
...
...
@@ -88,12 +88,12 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req
->
rnti
=
f1ap_get_rnti_by_cu_id
(
false
,
instance
,
f1ap_ue_context_setup_req
->
gNB_CU_ue_id
);
}
if
(
f1ap_ue_context_setup_req
->
rnti
<
0
)
LOG_E
(
F1AP
,
"Could not retrieve UE rnti based on the CU/DU UE id
\n
"
);
else
LOG_I
(
F1AP
,
"Retrieved rnti is: %d
\n
"
,
f1ap_ue_context_setup_req
->
rnti
);
/* SpCell_ID */
F1AP_UEContextSetupRequestIEs_t
*
ieNet
;
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupRequestIEs_t
,
ieNet
,
container
,
...
...
@@ -129,62 +129,70 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
F1AP_UEContextSetupRequestIEs_t
*
ieDrb
;
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupRequestIEs_t
,
ieDrb
,
container
,
F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List
,
true
);
f1ap_ue_context_setup_req
->
drbs_to_be_setup_length
=
ieDrb
->
value
.
choice
.
DRBs_ToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_req
->
drbs_to_be_setup
=
calloc
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup_length
,
sizeof
(
f1ap_drb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_req->drbs_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_req
->
drbs_to_be_setup_length
;
++
i
)
{
f1ap_drb_to_be_setup_t
*
drb_p
=
&
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
];
F1AP_DRBs_ToBeSetup_Item_t
*
drbs_tobesetup_item_p
=
&
((
F1AP_DRBs_ToBeSetup_ItemIEs_t
*
)
ieDrb
->
value
.
choice
.
DRBs_ToBeSetup_List
.
list
.
array
[
i
])
->
value
.
choice
.
DRBs_ToBeSetup_Item
;
drb_p
->
drb_id
=
drbs_tobesetup_item_p
->
dRBID
;
/* TODO in the following, assume only one UP UL TNL is present.
* this matches/assumes OAI CU implementation, can be up to 2! */
drb_p
->
tnl_length
=
1
;
AssertFatal
(
drbs_tobesetup_item_p
->
uLUPTNLInformation_ToBeSetup_List
.
list
.
count
>
0
,
"no UL UP TNL Information in DRBs to be Setup list
\n
"
);
F1AP_ULUPTNLInformation_ToBeSetup_Item_t
*
ul_up_tnl_info_p
=
(
F1AP_ULUPTNLInformation_ToBeSetup_Item_t
*
)
drbs_tobesetup_item_p
->
uLUPTNLInformation_ToBeSetup_List
.
list
.
array
[
0
];
F1AP_GTPTunnel_t
*
ul_up_tnl0
=
ul_up_tnl_info_p
->
uLUPTNLInformation
.
choice
.
gTPTunnel
;
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4
(
&
ul_up_tnl0
->
transportLayerAddress
,
drb_p
->
tnl
[
0
].
tl_address
);
OCTET_STRING_TO_INT32
(
&
ul_up_tnl0
->
gTP_TEID
,
drb_p
->
tnl
[
0
].
outgoingTeid
);
switch
(
drbs_tobesetup_item_p
->
rLCMode
)
{
case
F1AP_RLCMode_rlc_am
:
drb_p
->
rlc_mode
=
RLC_MODE_AM
;
break
;
default:
drb_p
->
rlc_mode
=
RLC_MODE_TM
;
break
;
if
(
ieDrb
!=
NULL
)
{
f1ap_ue_context_setup_req
->
drbs_to_be_setup_length
=
ieDrb
->
value
.
choice
.
DRBs_ToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_req
->
drbs_to_be_setup
=
calloc
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup_length
,
sizeof
(
f1ap_drb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_req->drbs_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_req
->
drbs_to_be_setup_length
;
++
i
)
{
f1ap_drb_to_be_setup_t
*
drb_p
=
&
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
];
F1AP_DRBs_ToBeSetup_Item_t
*
drbs_tobesetup_item_p
=
&
((
F1AP_DRBs_ToBeSetup_ItemIEs_t
*
)
ieDrb
->
value
.
choice
.
DRBs_ToBeSetup_List
.
list
.
array
[
i
])
->
value
.
choice
.
DRBs_ToBeSetup_Item
;
drb_p
->
drb_id
=
drbs_tobesetup_item_p
->
dRBID
;
/* TODO in the following, assume only one UP UL TNL is present.
* this matches/assumes OAI CU implementation, can be up to 2! */
drb_p
->
up_ul_tnl_length
=
1
;
AssertFatal
(
drbs_tobesetup_item_p
->
uLUPTNLInformation_ToBeSetup_List
.
list
.
count
>
0
,
"no UL UP TNL Information in DRBs to be Setup list
\n
"
);
F1AP_ULUPTNLInformation_ToBeSetup_Item_t
*
ul_up_tnl_info_p
=
(
F1AP_ULUPTNLInformation_ToBeSetup_Item_t
*
)
drbs_tobesetup_item_p
->
uLUPTNLInformation_ToBeSetup_List
.
list
.
array
[
0
];
F1AP_GTPTunnel_t
*
ul_up_tnl0
=
ul_up_tnl_info_p
->
uLUPTNLInformation
.
choice
.
gTPTunnel
;
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4
(
&
ul_up_tnl0
->
transportLayerAddress
,
drb_p
->
up_ul_tnl
[
0
].
tl_address
);
OCTET_STRING_TO_INT32
(
&
ul_up_tnl0
->
gTP_TEID
,
drb_p
->
up_ul_tnl
[
0
].
teid
);
switch
(
drbs_tobesetup_item_p
->
rLCMode
)
{
case
F1AP_RLCMode_rlc_am
:
drb_p
->
rlc_mode
=
RLC_MODE_AM
;
break
;
default:
drb_p
->
rlc_mode
=
RLC_MODE_TM
;
break
;
}
transport_layer_addr_t
addr
;
memcpy
(
addr
.
buffer
,
&
drb_p
->
up_ul_tnl
[
0
].
tl_address
,
sizeof
(
drb_p
->
up_ul_tnl
[
0
].
tl_address
));
addr
.
length
=
sizeof
(
drb_p
->
up_ul_tnl
[
0
].
tl_address
)
*
8
;
drb_p
->
up_dl_tnl
[
0
].
teid
=
newGtpuCreateTunnel
(
INSTANCE_DEFAULT
,
f1ap_ue_context_setup_req
->
rnti
,
drb_p
->
drb_id
,
drb_p
->
drb_id
,
drb_p
->
up_ul_tnl
[
0
].
teid
,
addr
,
2152
,
DURecvCb
);
}
transport_layer_addr_t
addr
;
memcpy
(
addr
.
buffer
,
&
drb_p
->
tnl
[
0
].
tl_address
,
sizeof
(
drb_p
->
tnl
[
0
].
tl_address
));
addr
.
length
=
sizeof
(
drb_p
->
tnl
[
0
].
tl_address
)
*
8
;
drb_p
->
tnl
[
0
].
incomingTeid
=
newGtpuCreateTunnel
(
INSTANCE_DEFAULT
,
f1ap_ue_context_setup_req
->
rnti
,
drb_p
->
drb_id
,
drb_p
->
drb_id
,
drb_p
->
tnl
[
0
].
outgoingTeid
,
addr
,
2152
,
DURecvCb
);
}
F1AP_UEContextSetupRequestIEs_t
*
ieSrb
;
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupRequestIEs_t
,
ieSrb
,
container
,
F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_List
,
true
);
f1ap_ue_context_setup_req
->
srbs_to_be_setup_length
=
ieSrb
->
value
.
choice
.
SRBs_ToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_req
->
srbs_to_be_setup
=
calloc
(
f1ap_ue_context_setup_req
->
srbs_to_be_setup_length
,
sizeof
(
f1ap_srb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_req
->
srbs_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_req->srbs_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_req
->
srbs_to_be_setup_length
;
++
i
)
{
f1ap_srb_to_be_setup_t
*
srb_p
=
&
f1ap_ue_context_setup_req
->
srbs_to_be_setup
[
i
];
F1AP_SRBs_ToBeSetup_Item_t
*
srbs_tobesetup_item_p
;
srbs_tobesetup_item_p
=
&
((
F1AP_SRBs_ToBeSetup_ItemIEs_t
*
)
ieSrb
->
value
.
choice
.
SRBs_ToBeSetup_List
.
list
.
array
[
i
])
->
value
.
choice
.
SRBs_ToBeSetup_Item
;
srb_p
->
srb_id
=
srbs_tobesetup_item_p
->
sRBID
;
F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_List
,
true
);
if
(
ieSrb
!=
NULL
)
{
f1ap_ue_context_setup_req
->
srbs_to_be_setup_length
=
ieSrb
->
value
.
choice
.
SRBs_ToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_req
->
srbs_to_be_setup
=
calloc
(
f1ap_ue_context_setup_req
->
srbs_to_be_setup_length
,
sizeof
(
f1ap_srb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_req
->
srbs_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_req->srbs_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_req
->
srbs_to_be_setup_length
;
++
i
)
{
f1ap_srb_to_be_setup_t
*
srb_p
=
&
f1ap_ue_context_setup_req
->
srbs_to_be_setup
[
i
];
F1AP_SRBs_ToBeSetup_Item_t
*
srbs_tobesetup_item_p
;
srbs_tobesetup_item_p
=
&
((
F1AP_SRBs_ToBeSetup_ItemIEs_t
*
)
ieSrb
->
value
.
choice
.
SRBs_ToBeSetup_List
.
list
.
array
[
i
])
->
value
.
choice
.
SRBs_ToBeSetup_Item
;
srb_p
->
srb_id
=
srbs_tobesetup_item_p
->
sRBID
;
}
}
}
...
...
@@ -198,9 +206,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
if
(
ieRRC
->
value
.
choice
.
RRCContainer
.
size
)
{
f1ap_ue_context_setup_req
->
rrc_container
=
malloc
(
ieRRC
->
value
.
choice
.
RRCContainer
.
size
);
memcpy
(
f1ap_ue_context_setup_req
->
rrc_container
,
ieRRC
->
value
.
choice
.
RRCContainer
.
buf
,
ieRRC
->
value
.
choice
.
RRCContainer
.
size
);
ieRRC
->
value
.
choice
.
RRCContainer
.
buf
,
ieRRC
->
value
.
choice
.
RRCContainer
.
size
);
// AssertFatal(0, "check configuration, send to appropriate handler\n");
protocol_ctxt_t
ctxt
;
// decode RRC Container and act on the message type
...
...
@@ -208,27 +214,24 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
//rnti_t rnti = f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id);
ctxt
.
module_id
=
instance
;
ctxt
.
instance
=
instance
;
ctxt
.
enb_flag
=
1
;
ctxt
.
enb_flag
=
1
;
mem_block_t
*
pdcp_pdu_p
=
get_free_mem_block
(
ieRRC
->
value
.
choice
.
RRCContainer
.
size
,
__func__
);
memcpy
(
&
pdcp_pdu_p
->
data
[
0
],
ieRRC
->
value
.
choice
.
RRCContainer
.
buf
,
ieRRC
->
value
.
choice
.
RRCContainer
.
size
);
/* for rfsim */
du_rlc_data_req
(
&
ctxt
,
1
,
0x00
,
1
,
1
,
0
,
ieRRC
->
value
.
choice
.
RRCContainer
.
size
,
pdcp_pdu_p
);
}
else
{
LOG_E
(
F1AP
,
" RRCContainer in UEContextSetupRequestIEs size id 0
\n
"
);
}
}
else
{
LOG_W
(
F1AP
,
"can't find RRCContainer in UEContextSetupRequestIEs by id %ld
\n
"
,
F1AP_ProtocolIE_ID_id_RRCContainer
);
}
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
instance
,
f1ap_ue_context_setup_req
);
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
instance
,
f1ap_ue_context_setup_req
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
instance
,
msg_p
);
return
0
;
}
int
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
instance_t
instance
,
f1ap_ue_context_setup_req_t
*
req
)
{
int
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
instance_t
instance
,
f1ap_ue_context_setup_req_t
*
req
)
{
F1AP_F1AP_PDU_t
pdu
=
{
0
};
F1AP_UEContextSetupResponse_t
*
out
;
uint8_t
*
buffer
=
NULL
;
...
...
@@ -255,35 +258,36 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
ie2
->
criticality
=
F1AP_Criticality_reject
;
ie2
->
value
.
present
=
F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID
;
ie2
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
=
req
->
gNB_DU_ue_id
;
/* mandatory */
/* c3. DUtoCURRCInformation */
if
(
0
)
{
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupResponseIEs_t
,
ie3
);
ie3
->
id
=
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation
;
ie3
->
criticality
=
F1AP_Criticality_reject
;
ie3
->
value
.
present
=
F1AP_UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation
;
{
/* cellGroupConfig */
OCTET_STRING_fromBuf
(
&
ie3
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
,
"asdsa"
,
strlen
(
"asdsa"
));
/* OPTIONAL */
/* measGapConfig */
if
(
0
)
{
asn1cCalloc
(
ie3
->
value
.
choice
.
DUtoCURRCInformation
.
measGapConfig
,
F1AP_MeasGapConfig_t
,
tmp
);
OCTET_STRING_fromBuf
(
tmp
,
"asdsa"
,
strlen
(
"asdsa"
));
}
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupResponseIEs_t
,
ie3
);
ie3
->
id
=
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation
;
ie3
->
criticality
=
F1AP_Criticality_reject
;
ie3
->
value
.
present
=
F1AP_UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation
;
{
/* cellGroupConfig */
OCTET_STRING_fromBuf
(
&
ie3
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
,
"asdsa"
,
strlen
(
"asdsa"
));
/* OPTIONAL */
/* measGapConfig */
if
(
0
)
{
asn1cCalloc
(
ie3
->
value
.
choice
.
DUtoCURRCInformation
.
measGapConfig
,
F1AP_MeasGapConfig_t
,
tmp
);
OCTET_STRING_fromBuf
(
tmp
,
"asdsa"
,
strlen
(
"asdsa"
));
}
/* OPTIONAL */
/* requestedP_MaxFR1 */
if
(
0
)
{
asn1cCalloc
(
ie3
->
value
.
choice
.
DUtoCURRCInformation
.
requestedP_MaxFR1
,
OCTET_STRING_t
,
tmp
);
OCTET_STRING_fromBuf
(
tmp
,
"asdsa"
,
strlen
(
"asdsa"
));
/* OPTIONAL */
/* requestedP_MaxFR1 */
if
(
0
)
{
asn1cCalloc
(
ie3
->
value
.
choice
.
DUtoCURRCInformation
.
requestedP_MaxFR1
,
OCTET_STRING_t
,
tmp
);
OCTET_STRING_fromBuf
(
tmp
,
"asdsa"
,
strlen
(
"asdsa"
));
}
}
}
}
/* optional */
/* c4. C_RNTI */
...
...
@@ -343,7 +347,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
//drbs_setup_item.lCID = (F1AP_LCID_t *)calloc(1, sizeof(F1AP_LCID_t));
//drbs_setup_item.lCID = 1L;
for
(
int
j
=
0
;
j
<
req
->
drbs_to_be_setup
[
i
].
tnl_length
;
j
++
)
{
for
(
int
j
=
0
;
j
<
req
->
drbs_to_be_setup
[
i
].
up_dl_
tnl_length
;
j
++
)
{
/* ADD */
asn1cSequenceAdd
(
drbs_setup_item
->
dLUPTNLInformation_ToBeSetup_List
.
list
,
F1AP_DLUPTNLInformation_ToBeSetup_Item_t
,
dLUPTNLInformation_ToBeSetup_Item
);
...
...
@@ -352,13 +356,13 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
asn1cCalloc
(
dLUPTNLInformation_ToBeSetup_Item
->
dLUPTNLInformation
.
choice
.
gTPTunnel
,
F1AP_GTPTunnel_t
,
gTPTunnel
);
/* transportLayerAddress */
struct
sockaddr_in
addr
=
{
0
};
struct
sockaddr_in
addr
=
{
0
};
inet_pton
(
AF_INET
,
getCxt
(
false
,
instance
)
->
setupReq
.
DU_f1_ip_address
.
ipv4_address
,
&
addr
.
sin_addr
.
s_addr
);
&
addr
.
sin_addr
.
s_addr
);
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING
(
addr
.
sin_addr
.
s_addr
,
&
gTPTunnel
->
transportLayerAddress
);
&
gTPTunnel
->
transportLayerAddress
);
/* gTP_TEID */
INT32_TO_OCTET_STRING
(
req
->
drbs_to_be_setup
[
i
].
tnl
[
j
].
incomingT
eid
,
&
gTPTunnel
->
gTP_TEID
);
INT32_TO_OCTET_STRING
(
req
->
drbs_to_be_setup
[
i
].
up_dl_tnl
[
j
].
t
eid
,
&
gTPTunnel
->
gTP_TEID
);
}
// for j
}
// for i
...
...
@@ -541,12 +545,9 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
getCxt
(
false
,
instance
)
->
default_sctp_stream_id
);
return
0
;
}
int
DU_send_UE_CONTEXT_SETUP_FAILURE
(
instance_t
instance
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
}
int
DU_send_UE_CONTEXT_RELEASE_REQUEST
(
instance_t
instance
,
f1ap_ue_context_release_req_t
*
req
)
{
F1AP_F1AP_PDU_t
pdu
;
...
...
@@ -621,8 +622,6 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
getCxt
(
false
,
instance
)
->
default_sctp_stream_id
);
return
0
;
}
int
DU_handle_UE_CONTEXT_RELEASE_COMMAND
(
instance_t
instance
,
uint32_t
assoc_id
,
uint32_t
stream
,
...
...
@@ -763,8 +762,6 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
DU_send_UE_CONTEXT_RELEASE_COMPLETE
(
instance
,
&
cplt
);
return
0
;
}
int
DU_send_UE_CONTEXT_RELEASE_COMPLETE
(
instance_t
instance
,
f1ap_ue_context_release_cplt_t
*
cplt
)
{
F1AP_F1AP_PDU_t
pdu
=
{
0
};
...
...
@@ -855,15 +852,12 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
f1ap_remove_ue
(
false
,
instance
,
cplt
->
rnti
);
return
0
;
}
int
DU_handle_UE_CONTEXT_MODIFICATION_REQUEST
(
instance_t
instance
,
uint32_t
assoc_id
,
uint32_t
stream
,
F1AP_F1AP_PDU_t
*
pdu
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
}
//void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) {
int
DU_send_UE_CONTEXT_MODIFICATION_RESPONSE
(
instance_t
instance
)
{
F1AP_F1AP_PDU_t
pdu
=
{
0
};
...
...
@@ -1145,15 +1139,12 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
//f1ap_itti_send_sctp_data_req(false, instance, buffer, len, 0);
return
0
;
}
int
DU_send_UE_CONTEXT_MODIFICATION_FAILURE
(
instance_t
instance
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
}
int
DU_send_UE_CONTEXT_MODIFICATION_REQUIRED
(
instance_t
instance
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
}
int
DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM
(
instance_t
instance
,
uint32_t
assoc_id
,
uint32_t
stream
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
e9421938
...
...
@@ -284,8 +284,10 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
}
return
max_ri
;
}
else
else
{
AssertFatal
(
1
==
0
,
"Other configurations not yet implemented
\n
"
);
return
0
;
}
}
void
compute_li_bitlen
(
struct
NR_CSI_ReportConfig
*
csi_reportconfig
,
...
...
@@ -1352,7 +1354,7 @@ int nr_acknack_scheduling(int mod_id,
* for initialCyclicShift 0 (we assume it always has that one), so other
* initialCyclicShifts can overlap with ICS 0!*/
if
(
pucch_Config
==
NULL
)
return
;
return
-
1
;
const
NR_PUCCH_Resource_t
*
resource
=
pucch_Config
->
resourceToAddModList
->
list
.
array
[
pucch
->
resource_indicator
];
DevAssert
(
resource
->
format
.
present
==
NR_PUCCH_Resource__format_PR_format0
);
if
(
resource
->
format
.
choice
.
format0
->
initialCyclicShift
==
0
)
{
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
e9421938
...
...
@@ -1365,7 +1365,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
/* Here the callback function used as input is not the right one. Need to create a new one probably for F1-U, not sure
* if the kind of input parameters to the callback function are convenient though for gtp-u over F1-U.*/
ue_context_pP
->
ue_context
.
incoming_teid
[
i
]
=
newGtpuCreateTunnel
(
0
,
create_tunnel_req
.
rnti
,
ue_context_pP
->
ue_context
.
incoming_teid
[
i
]
=
newGtpuCreateTunnel
(
INSTANCE_DEFAULT
,
create_tunnel_req
.
rnti
,
create_tunnel_req
.
incoming_rb_id
[
i
],
create_tunnel_req
.
incoming_rb_id
[
i
],
create_tunnel_req
.
outgoing_teid
[
i
],
...
...
@@ -1374,9 +1374,9 @@ rrc_gNB_process_RRCReconfigurationComplete(
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
drb_id
=
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
rlc_mode
=
RLC_MODE_AM
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
tnl
[
0
].
incomingT
eid
=
ue_context_pP
->
ue_context
.
incoming_teid
[
i
];
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
tnl
[
0
].
tl_address
=
inet_addr
(
rrc
->
eth_params_s
.
my_addr
);
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
tnl_length
=
1
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
up_ul_tnl
[
0
].
t
eid
=
ue_context_pP
->
ue_context
.
incoming_teid
[
i
];
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
up_ul_
tnl
[
0
].
tl_address
=
inet_addr
(
rrc
->
eth_params_s
.
my_addr
);
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
drbs_to_be_setup
[
i
].
up_ul_
tnl_length
=
1
;
}
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
gNB_CU_ue_id
=
0
;
F1AP_UE_CONTEXT_SETUP_REQ
(
message_p
).
gNB_DU_ue_id
=
0
;
...
...
@@ -3671,6 +3671,10 @@ void *rrc_gnb_task(void *args_p) {
rrc_DU_process_ue_context_setup_request
(
msg_p
,
msg_name_p
,
instance
);
break
;
case
F1AP_UE_CONTEXT_SETUP_RESP
:
LOG_W
(
NR_RRC
,
"Handling of F1 UE context setup response context at the RRC layer of the CU is pending
\n
"
);
break
;
/* Messages from X2AP */
case
X2AP_ENDC_SGNB_ADDITION_REQ
:
LOG_I
(
NR_RRC
,
"Received ENDC sgNB addition request from X2AP
\n
"
);
...
...
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