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
df867e53
Commit
df867e53
authored
Feb 04, 2024
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formatting
parent
07c5cf3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
172 additions
and
193 deletions
+172
-193
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+172
-193
No files found.
openair2/RRC/NR_UE/rrc_UE.c
View file @
df867e53
...
@@ -237,15 +237,13 @@ static void nr_rrc_ue_process_rrcReconfiguration(NR_UE_RRC_INST_t *rrc,
...
@@ -237,15 +237,13 @@ static void nr_rrc_ue_process_rrcReconfiguration(NR_UE_RRC_INST_t *rrc,
void
process_nsa_message
(
NR_UE_RRC_INST_t
*
rrc
,
nsa_message_t
nsa_message_type
,
void
*
message
,
int
msg_len
)
void
process_nsa_message
(
NR_UE_RRC_INST_t
*
rrc
,
nsa_message_t
nsa_message_type
,
void
*
message
,
int
msg_len
)
{
{
switch
(
nsa_message_type
)
{
switch
(
nsa_message_type
)
{
case
nr_SecondaryCellGroupConfig_r15
:
case
nr_SecondaryCellGroupConfig_r15
:
{
{
NR_RRCReconfiguration_t
*
RRCReconfiguration
=
NULL
;
NR_RRCReconfiguration_t
*
RRCReconfiguration
=
NULL
;
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
&
asn_DEF_NR_RRCReconfiguration
,
&
asn_DEF_NR_RRCReconfiguration
,
(
void
**
)
&
RRCReconfiguration
,
(
void
**
)
&
RRCReconfiguration
,
(
uint8_t
*
)
message
,
(
uint8_t
*
)
message
,
msg_len
);
msg_len
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
LOG_E
(
NR_RRC
,
"NR_RRCReconfiguration decode error
\n
"
);
LOG_E
(
NR_RRC
,
"NR_RRCReconfiguration decode error
\n
"
);
// free the memory
// free the memory
...
@@ -257,15 +255,13 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
...
@@ -257,15 +255,13 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
}
}
break
;
break
;
case
nr_RadioBearerConfigX_r15
:
case
nr_RadioBearerConfigX_r15
:
{
{
NR_RadioBearerConfig_t
*
RadioBearerConfig
=
NULL
;
NR_RadioBearerConfig_t
*
RadioBearerConfig
=
NULL
;
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
&
asn_DEF_NR_RadioBearerConfig
,
&
asn_DEF_NR_RadioBearerConfig
,
(
void
**
)
&
RadioBearerConfig
,
(
void
**
)
&
RadioBearerConfig
,
(
uint8_t
*
)
message
,
(
uint8_t
*
)
message
,
msg_len
);
msg_len
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
LOG_E
(
NR_RRC
,
"NR_RadioBearerConfig decode error
\n
"
);
LOG_E
(
NR_RRC
,
"NR_RadioBearerConfig decode error
\n
"
);
// free the memory
// free the memory
...
@@ -1578,7 +1574,6 @@ static void nr_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc, NR_UECa
...
@@ -1578,7 +1574,6 @@ static void nr_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc, NR_UECa
}
}
static
void
nr_rrc_ue_generate_rrcReestablishmentComplete
(
NR_RRCReestablishment_t
*
rrcReestablishment
)
static
void
nr_rrc_ue_generate_rrcReestablishmentComplete
(
NR_RRCReestablishment_t
*
rrcReestablishment
)
//-----------------------------------------------------------------------------
{
{
uint8_t
buffer
[
RRC_BUFFER_SIZE
]
=
{
0
};
uint8_t
buffer
[
RRC_BUFFER_SIZE
]
=
{
0
};
int
size
=
do_RRCReestablishmentComplete
(
buffer
,
RRC_BUFFER_SIZE
,
int
size
=
do_RRCReestablishmentComplete
(
buffer
,
RRC_BUFFER_SIZE
,
...
@@ -1590,18 +1585,14 @@ void *recv_msgs_from_lte_ue(void *args_p)
...
@@ -1590,18 +1585,14 @@ void *recv_msgs_from_lte_ue(void *args_p)
{
{
itti_mark_task_ready
(
TASK_RRC_NSA_NRUE
);
itti_mark_task_ready
(
TASK_RRC_NSA_NRUE
);
int
from_lte_ue_fd
=
get_from_lte_ue_fd
();
int
from_lte_ue_fd
=
get_from_lte_ue_fd
();
for
(;;)
for
(;;)
{
{
nsa_msg_t
msg
;
nsa_msg_t
msg
;
int
recvLen
=
recvfrom
(
from_lte_ue_fd
,
&
msg
,
sizeof
(
msg
),
int
recvLen
=
recvfrom
(
from_lte_ue_fd
,
&
msg
,
sizeof
(
msg
),
MSG_WAITALL
|
MSG_TRUNC
,
NULL
,
NULL
);
MSG_WAITALL
|
MSG_TRUNC
,
NULL
,
NULL
);
if
(
recvLen
==
-
1
)
{
if
(
recvLen
==
-
1
)
{
LOG_E
(
NR_RRC
,
"%s: recvfrom: %s
\n
"
,
__func__
,
strerror
(
errno
));
LOG_E
(
NR_RRC
,
"%s: recvfrom: %s
\n
"
,
__func__
,
strerror
(
errno
));
continue
;
continue
;
}
}
if
(
recvLen
>
sizeof
(
msg
))
if
(
recvLen
>
sizeof
(
msg
))
{
{
LOG_E
(
NR_RRC
,
"%s: Received truncated message %d
\n
"
,
__func__
,
recvLen
);
LOG_E
(
NR_RRC
,
"%s: Received truncated message %d
\n
"
,
__func__
,
recvLen
);
continue
;
continue
;
}
}
...
@@ -1644,8 +1635,7 @@ static void nsa_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc)
...
@@ -1644,8 +1635,7 @@ static void nsa_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc)
static
void
process_lte_nsa_msg
(
NR_UE_RRC_INST_t
*
rrc
,
nsa_msg_t
*
msg
,
int
msg_len
)
static
void
process_lte_nsa_msg
(
NR_UE_RRC_INST_t
*
rrc
,
nsa_msg_t
*
msg
,
int
msg_len
)
{
{
if
(
msg_len
<
sizeof
(
msg
->
msg_type
))
if
(
msg_len
<
sizeof
(
msg
->
msg_type
))
{
{
LOG_E
(
RRC
,
"Msg_len = %d
\n
"
,
msg_len
);
LOG_E
(
RRC
,
"Msg_len = %d
\n
"
,
msg_len
);
return
;
return
;
}
}
...
@@ -1653,10 +1643,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1653,10 +1643,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
Rrc_Msg_Type_t
msg_type
=
msg
->
msg_type
;
Rrc_Msg_Type_t
msg_type
=
msg
->
msg_type
;
uint8_t
*
const
msg_buffer
=
msg
->
msg_buffer
;
uint8_t
*
const
msg_buffer
=
msg
->
msg_buffer
;
msg_len
-=
sizeof
(
msg
->
msg_type
);
msg_len
-=
sizeof
(
msg
->
msg_type
);
switch
(
msg_type
)
switch
(
msg_type
)
{
{
case
UE_CAPABILITY_ENQUIRY
:
{
case
UE_CAPABILITY_ENQUIRY
:
{
LOG_D
(
NR_RRC
,
"We are processing a %d message
\n
"
,
msg_type
);
LOG_D
(
NR_RRC
,
"We are processing a %d message
\n
"
,
msg_type
);
NR_FreqBandList_t
*
nr_freq_band_list
=
NULL
;
NR_FreqBandList_t
*
nr_freq_band_list
=
NULL
;
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
...
@@ -1664,14 +1652,12 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1664,14 +1652,12 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
(
void
**
)
&
nr_freq_band_list
,
(
void
**
)
&
nr_freq_band_list
,
msg_buffer
,
msg_buffer
,
msg_len
);
msg_len
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
{
SEQUENCE_free
(
&
asn_DEF_NR_FreqBandList
,
nr_freq_band_list
,
ASFM_FREE_EVERYTHING
);
SEQUENCE_free
(
&
asn_DEF_NR_FreqBandList
,
nr_freq_band_list
,
ASFM_FREE_EVERYTHING
);
LOG_E
(
RRC
,
"Failed to decode UECapabilityInfo (%zu bits)
\n
"
,
dec_rval
.
consumed
);
LOG_E
(
RRC
,
"Failed to decode UECapabilityInfo (%zu bits)
\n
"
,
dec_rval
.
consumed
);
break
;
break
;
}
}
for
(
int
i
=
0
;
i
<
nr_freq_band_list
->
list
.
count
;
i
++
)
for
(
int
i
=
0
;
i
<
nr_freq_band_list
->
list
.
count
;
i
++
)
{
{
LOG_D
(
NR_RRC
,
"Received NR band information: %ld.
\n
"
,
LOG_D
(
NR_RRC
,
"Received NR band information: %ld.
\n
"
,
nr_freq_band_list
->
list
.
array
[
i
]
->
choice
.
bandInformationNR
->
bandNR
);
nr_freq_band_list
->
list
.
array
[
i
]
->
choice
.
bandInformationNR
->
bandNR
);
}
}
...
@@ -1682,8 +1668,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1682,8 +1668,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
break
;
break
;
}
}
case
NRUE_CAPABILITY_ENQUIRY
:
case
NRUE_CAPABILITY_ENQUIRY
:
{
{
LOG_I
(
NR_RRC
,
"We are processing a %d message
\n
"
,
msg_type
);
LOG_I
(
NR_RRC
,
"We are processing a %d message
\n
"
,
msg_type
);
NR_FreqBandList_t
*
nr_freq_band_list
=
NULL
;
NR_FreqBandList_t
*
nr_freq_band_list
=
NULL
;
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
...
@@ -1691,8 +1676,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1691,8 +1676,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
(
void
**
)
&
nr_freq_band_list
,
(
void
**
)
&
nr_freq_band_list
,
msg_buffer
,
msg_buffer
,
msg_len
);
msg_len
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
{
SEQUENCE_free
(
&
asn_DEF_NR_FreqBandList
,
nr_freq_band_list
,
ASFM_FREE_EVERYTHING
);
SEQUENCE_free
(
&
asn_DEF_NR_FreqBandList
,
nr_freq_band_list
,
ASFM_FREE_EVERYTHING
);
LOG_E
(
NR_RRC
,
"Failed to decode UECapabilityInfo (%zu bits)
\n
"
,
dec_rval
.
consumed
);
LOG_E
(
NR_RRC
,
"Failed to decode UECapabilityInfo (%zu bits)
\n
"
,
dec_rval
.
consumed
);
break
;
break
;
...
@@ -1702,8 +1686,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1702,8 +1686,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
break
;
break
;
}
}
case
RRC_MEASUREMENT_PROCEDURE
:
case
RRC_MEASUREMENT_PROCEDURE
:
{
{
LOG_I
(
NR_RRC
,
"We are processing a %d message
\n
"
,
msg_type
);
LOG_I
(
NR_RRC
,
"We are processing a %d message
\n
"
,
msg_type
);
LTE_MeasObjectToAddMod_t
*
nr_meas_obj
=
NULL
;
LTE_MeasObjectToAddMod_t
*
nr_meas_obj
=
NULL
;
...
@@ -1712,8 +1695,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1712,8 +1695,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
(
void
**
)
&
nr_meas_obj
,
(
void
**
)
&
nr_meas_obj
,
msg_buffer
,
msg_buffer
,
msg_len
);
msg_len
);
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
))
{
{
SEQUENCE_free
(
&
asn_DEF_NR_MeasObjectToAddMod
,
nr_meas_obj
,
ASFM_FREE_EVERYTHING
);
SEQUENCE_free
(
&
asn_DEF_NR_MeasObjectToAddMod
,
nr_meas_obj
,
ASFM_FREE_EVERYTHING
);
LOG_E
(
RRC
,
"Failed to decode measurement object (%zu bits) %d
\n
"
,
dec_rval
.
consumed
,
dec_rval
.
code
);
LOG_E
(
RRC
,
"Failed to decode measurement object (%zu bits) %d
\n
"
,
dec_rval
.
consumed
,
dec_rval
.
code
);
break
;
break
;
...
@@ -1724,8 +1706,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1724,8 +1706,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
start_oai_nrue_threads
();
start_oai_nrue_threads
();
break
;
break
;
}
}
case
RRC_CONFIG_COMPLETE_REQ
:
{
case
RRC_CONFIG_COMPLETE_REQ
:
{
struct
msg
{
struct
msg
{
uint32_t
RadioBearer_size
;
uint32_t
RadioBearer_size
;
uint32_t
SecondaryCellGroup_size
;
uint32_t
SecondaryCellGroup_size
;
...
@@ -1742,7 +1724,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1742,7 +1724,8 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
"nr_RadioBearerConfig1_r15 size %u nr_SecondaryCellGroupConfig_r15 size %u sizeof(hdr) %zu, msg_len = %d
\n
"
,
"nr_RadioBearerConfig1_r15 size %u nr_SecondaryCellGroupConfig_r15 size %u sizeof(hdr) %zu, msg_len = %d
\n
"
,
nr_RadioBearer_size
,
nr_RadioBearer_size
,
nr_SecondaryCellGroup_size
,
nr_SecondaryCellGroup_size
,
sizeof
(
hdr
),
msg_len
);
sizeof
(
hdr
),
msg_len
);
NR_RRC_TransactionIdentifier_t
t_id
=
hdr
.
trans_id
;
NR_RRC_TransactionIdentifier_t
t_id
=
hdr
.
trans_id
;
LOG_I
(
NR_RRC
,
"nr_RadioBearerConfig1_r15 size %d nr_SecondaryCellGroupConfig_r15 size %d t_id %ld
\n
"
,
LOG_I
(
NR_RRC
,
"nr_RadioBearerConfig1_r15 size %d nr_SecondaryCellGroupConfig_r15 size %d t_id %ld
\n
"
,
nr_RadioBearer_size
,
nr_RadioBearer_size
,
...
@@ -1751,8 +1734,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1751,8 +1734,7 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
uint8_t
*
nr_RadioBearer_buffer
=
msg_buffer
+
offsetof
(
struct
msg
,
buffer
);
uint8_t
*
nr_RadioBearer_buffer
=
msg_buffer
+
offsetof
(
struct
msg
,
buffer
);
uint8_t
*
nr_SecondaryCellGroup_buffer
=
nr_RadioBearer_buffer
+
nr_RadioBearer_size
;
uint8_t
*
nr_SecondaryCellGroup_buffer
=
nr_RadioBearer_buffer
+
nr_RadioBearer_size
;
process_nsa_message
(
NR_UE_rrc_inst
,
nr_SecondaryCellGroupConfig_r15
,
nr_SecondaryCellGroup_buffer
,
process_nsa_message
(
NR_UE_rrc_inst
,
nr_SecondaryCellGroupConfig_r15
,
nr_SecondaryCellGroup_buffer
,
nr_SecondaryCellGroup_size
);
nr_SecondaryCellGroup_size
);
process_nsa_message
(
NR_UE_rrc_inst
,
nr_RadioBearerConfigX_r15
,
nr_RadioBearer_buffer
,
nr_RadioBearer_size
);
process_nsa_message
(
NR_UE_rrc_inst
,
nr_RadioBearerConfigX_r15
,
nr_RadioBearer_buffer
,
nr_RadioBearer_size
);
LOG_I
(
NR_RRC
,
"Calling do_NR_RRCReconfigurationComplete. t_id %ld
\n
"
,
t_id
);
LOG_I
(
NR_RRC
,
"Calling do_NR_RRCReconfigurationComplete. t_id %ld
\n
"
,
t_id
);
uint8_t
buffer
[
RRC_BUF_SIZE
];
uint8_t
buffer
[
RRC_BUF_SIZE
];
...
@@ -1761,16 +1743,13 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
...
@@ -1761,16 +1743,13 @@ static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_l
break
;
break
;
}
}
case
OAI_TUN_IFACE_NSA
:
case
OAI_TUN_IFACE_NSA
:
{
{
LOG_I
(
NR_RRC
,
"We got an OAI_TUN_IFACE_NSA!!
\n
"
);
LOG_I
(
NR_RRC
,
"We got an OAI_TUN_IFACE_NSA!!
\n
"
);
char
cmd_line
[
RRC_BUF_SIZE
];
char
cmd_line
[
RRC_BUF_SIZE
];
memcpy
(
cmd_line
,
msg_buffer
,
sizeof
(
cmd_line
));
memcpy
(
cmd_line
,
msg_buffer
,
sizeof
(
cmd_line
));
LOG_D
(
NR_RRC
,
"Command line: %s
\n
"
,
cmd_line
);
LOG_D
(
NR_RRC
,
"Command line: %s
\n
"
,
cmd_line
);
if
(
background_system
(
cmd_line
)
!=
0
)
if
(
background_system
(
cmd_line
)
!=
0
)
{
LOG_E
(
NR_RRC
,
"ESM-PROC - failed command '%s'"
,
cmd_line
);
LOG_E
(
NR_RRC
,
"ESM-PROC - failed command '%s'"
,
cmd_line
);
}
break
;
break
;
}
}
...
...
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