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
d0b9146c
Commit
d0b9146c
authored
Mar 03, 2021
by
luis_pereira87
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Msg4 transmitted from MAC to RRC through ITTI (TASK_RRC_NRUE created)
parent
d1c56742
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
118 additions
and
26 deletions
+118
-26
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+23
-0
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+9
-6
openair1/SIMULATION/NR_PHY/prachsim.c
openair1/SIMULATION/NR_PHY/prachsim.c
+13
-1
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+12
-2
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+21
-16
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+31
-0
openair2/RRC/NR_UE/rrc_proto.h
openair2/RRC/NR_UE/rrc_proto.h
+9
-1
No files found.
executables/nr-uesoftmodem.c
View file @
d0b9146c
...
...
@@ -180,6 +180,23 @@ void print_difftimes(void) {
LOG_I
(
HW
,
"difftimes min = %lu ns ; max = %lu ns
\n
"
,
min_diff_time
.
tv_nsec
,
max_diff_time
.
tv_nsec
);
}
int
create_tasks_nrue
(
uint32_t
ue_nb
)
{
LOG_D
(
NR_RRC
,
"%s(ue_nb:%d)
\n
"
,
__FUNCTION__
,
ue_nb
);
itti_wait_ready
(
1
);
if
(
ue_nb
>
0
)
{
LOG_I
(
NR_RRC
,
"create TASK_RRC_NRUE
\n
"
);
if
(
itti_create_task
(
TASK_RRC_NRUE
,
rrc_nrue_task
,
NULL
)
<
0
)
{
LOG_E
(
NR_RRC
,
"Create task for RRC UE failed
\n
"
);
return
-
1
;
}
}
itti_wait_ready
(
0
);
return
0
;
}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
int
CC_id
;
...
...
@@ -561,6 +578,12 @@ int main( int argc, char **argv ) {
// wait for end of program
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
if
(
create_tasks_nrue
(
1
)
<
0
)
{
printf
(
"cannot create ITTI tasks
\n
"
);
exit
(
-
1
);
// need a softer mode
}
// Sleep a while before checking all parameters have been used
// Some are used directly in external threads, asynchronously
sleep
(
20
);
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
d0b9146c
...
...
@@ -87,12 +87,15 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4];
// dummy functions
int
dummy_nr_ue_ul_indication
(
nr_uplink_indication_t
*
ul_info
)
{
return
(
0
);
}
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
int8_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
frame_t
frame
,
const
sub_frame_t
sub_frame
,
const
rnti_t
rnti
,
const
channel_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;
}
...
...
openair1/SIMULATION/NR_PHY/prachsim.c
View file @
d0b9146c
...
...
@@ -47,6 +47,7 @@
#include "OCG_vars.h"
#include <openair2/LAYER2/MAC/mac_vars.h>
#include <openair2/RRC/LTE/rrc_vars.h>
#include <openair2/RRC/NR_UE/rrc_defs.h>
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
...
...
@@ -130,7 +131,18 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
return
0
;
}
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
int8_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;}
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
frame_t
frame
,
const
sub_frame_t
sub_frame
,
const
rnti_t
rnti
,
const
channel_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;
}
void
nr_rrc_ue_generate_RRCSetupRequest
(
module_id_t
module_id
,
const
uint8_t
gNB_index
)
{
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
d0b9146c
...
...
@@ -82,9 +82,19 @@ double cpuf;
//uint8_t nfapi_mode = 0;
uint64_t
downlink_frequency
[
MAX_NUM_CCs
][
4
];
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
frame_t
frame
,
const
sub_frame_t
sub_frame
,
const
rnti_t
rnti
,
const
channel_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;
}
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
int8_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
)
{
return
0
;
}
int
generate_dlsch_header
(
unsigned
char
*
mac_header
,
unsigned
char
num_sdus
,
unsigned
short
*
sdu_lengths
,
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
d0b9146c
...
...
@@ -105,7 +105,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
nr_mac_rrc_data_ind_ue
(
module_id
,
cc_id
,
gNB_index
,
NR_BCCH_BCH
,
(
uint8_t
*
)
pduP
,
3
);
// fixed 3 bytes MIB PDU
nr_mac_rrc_data_ind_ue
(
module_id
,
cc_id
,
gNB_index
,
0
,
0
,
0
,
NR_BCCH_BCH
,
(
uint8_t
*
)
pduP
,
3
);
// fixed 3 bytes MIB PDU
AssertFatal
(
mac
->
mib
!=
NULL
,
"nr_ue_decode_mib() mac->mib == NULL
\n
"
);
//if(mac->mib != NULL){
...
...
@@ -161,7 +161,7 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
uint8_t
*
pduP
,
uint32_t
pdu_len
)
{
LOG_D
(
NR_MAC
,
"Decoding NR-BCCH-DL-SCH-Message (SIB1 or SI)
\n
"
);
nr_mac_rrc_data_ind_ue
(
module_id
,
cc_id
,
gNB_index
,
NR_BCCH_DL_SCH
,
(
uint8_t
*
)
pduP
,
pdu_len
);
nr_mac_rrc_data_ind_ue
(
module_id
,
cc_id
,
gNB_index
,
0
,
0
,
0
,
NR_BCCH_DL_SCH
,
(
uint8_t
*
)
pduP
,
pdu_len
);
return
0
;
}
...
...
@@ -1824,23 +1824,28 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
// MAC CE
case
DL_SCH_LCID_CCCH
:
// MSG4 RRC Connection Setup 38.331
// variable length
mac_ce_len
|=
(
uint16_t
)((
NR_MAC_SUBHEADER_SHORT
*
)
pduP
)
->
L
;
// MSG4 RRC Connection Setup 38.331
// variable length
if
(((
NR_MAC_SUBHEADER_SHORT
*
)
pduP
)
->
F
){
mac_sdu_len
=
((
uint16_t
)(((
NR_MAC_SUBHEADER_LONG
*
)
pduP
)
->
L1
&
0x7f
)
<<
8
)
|
((
uint16_t
)((
NR_MAC_SUBHEADER_LONG
*
)
pduP
)
->
L2
&
0xff
);
mac_subheader_len
=
3
;
}
else
{
mac_sdu_len
=
((
NR_MAC_SUBHEADER_LONG
*
)
pduP
)
->
L1
;
mac_subheader_len
=
2
;
if
(((
NR_MAC_SUBHEADER_SHORT
*
)
pduP
)
->
F
){
mac_ce_len
|=
(
uint16_t
)(((
NR_MAC_SUBHEADER_LONG
*
)
pduP
)
->
L2
)
<<
8
;
mac_subheader_len
=
3
;
}
}
LOG_D
(
NR_MAC
,
"DL_SCH_LCID_CCCH with payload len %d: bits
\n
"
,
mac_ce
_len
);
LOG_D
(
NR_MAC
,
"DL_SCH_LCID_CCCH with payload len %d: bits
\n
"
,
mac_sdu
_len
);
// TODO: Forward RRCSetup to RRC
LOG_D
(
NR_MAC
,
"RRCSetup received at nr_ue_process_mac_pdu with payload len %d:
\n
bits, rx bytes:
\n
"
,
mac_ce_len
);
for
(
int
i
=
0
;
i
<
mac_ce_len
/
8
;
i
++
)
{
LOG_D
(
NR_MAC
,
"%d: 0x%x
\n
"
,
i
,
pduP
[
i
+
2
]);
}
break
;
LOG_D
(
NR_MAC
,
"RRCSetup received at nr_ue_process_mac_pdu with payload len %d:
\n
bits, rx bytes:
\n
"
,
mac_sdu_len
);
for
(
int
i
=
0
;
i
<
mac_sdu_len
/
8
;
i
++
)
{
LOG_D
(
NR_MAC
,
"%d: 0x%x
\n
"
,
i
,
pduP
[
i
+
2
]);
}
nr_mac_rrc_data_ind_ue
(
module_idP
,
CC_id
,
gNB_index
,
frameP
,
0
,
mac
->
crnti
,
CCCH
,
pduP
+
mac_subheader_len
,
mac_sdu_len
);
break
;
case
DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH
:
...
...
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
d0b9146c
...
...
@@ -42,17 +42,48 @@ nr_mac_rrc_data_ind_ue(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
frame_t
frame
,
const
sub_frame_t
sub_frame
,
const
rnti_t
rnti
,
const
channel_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
){
sdu_size_t
sdu_size
=
0
;
protocol_ctxt_t
ctxt
;
switch
(
channel
){
case
NR_BCCH_BCH
:
AssertFatal
(
nr_rrc_ue_decode_NR_BCCH_BCH_Message
(
module_id
,
gNB_index
,
(
uint8_t
*
)
pduP
,
pdu_len
)
==
0
,
"UE decode BCCH-BCH error!
\n
"
);
break
;
case
NR_BCCH_DL_SCH
:
AssertFatal
(
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message
(
module_id
,
gNB_index
,
(
uint8_t
*
)
pduP
,
pdu_len
,
0
,
0
)
==
0
,
"UE decode BCCH-DL-SCH error!
\n
"
);
break
;
case
CCCH
:
if
(
pdu_len
>
0
)
{
LOG_T
(
NR_RRC
,
"[UE %d] Received SDU for CCCH on SRB %ld from gNB %d
\n
"
,
module_id
,
channel
&
RAB_OFFSET
,
gNB_index
);
MessageDef
*
message_p
;
int
msg_sdu_size
=
CCCH_SDU_SIZE
;
if
(
pdu_len
>
msg_sdu_size
)
{
LOG_E
(
NR_RRC
,
"SDU larger than CCCH SDU buffer size (%d, %d)"
,
sdu_size
,
msg_sdu_size
);
sdu_size
=
msg_sdu_size
;
}
else
{
sdu_size
=
pdu_len
;
}
message_p
=
itti_alloc_new_message
(
TASK_MAC_UE
,
0
,
NR_RRC_MAC_CCCH_DATA_IND
);
memset
(
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
0
,
CCCH_SDU_SIZE
);
memcpy
(
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
pduP
,
sdu_size
);
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
frame
=
frame
;
//frameP
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
sub_frame
=
sub_frame
;
//sub_frameP
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu_size
=
sdu_size
;
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
gnb_index
=
gNB_index
;
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
rnti
=
rnti
;
//rntiP
itti_send_msg_to_task
(
TASK_RRC_NRUE
,
GNB_MODULE_ID_TO_INSTANCE
(
module_id
),
message_p
);
}
default:
break
;
}
...
...
openair2/RRC/NR_UE/rrc_proto.h
View file @
d0b9146c
...
...
@@ -109,7 +109,15 @@ int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const ui
\param channel indicator for channel of the pdu
\param pduP pointer to pdu
\param pdu_len data length of pdu*/
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
channel_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
);
int8_t
nr_mac_rrc_data_ind_ue
(
const
module_id_t
module_id
,
const
int
CC_id
,
const
uint8_t
gNB_index
,
const
frame_t
frame
,
const
sub_frame_t
sub_frame
,
const
rnti_t
rnti
,
const
channel_t
channel
,
const
uint8_t
*
pduP
,
const
sdu_size_t
pdu_len
);
/**\brief
\param module_id module id
...
...
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