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
Michael Black
OpenXG-RAN
Commits
479784a0
Commit
479784a0
authored
Nov 04, 2021
by
Melissa Elkadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calling proper nr_ue_get_rach function
Also, reverted a DCI filtering change to exist again.
parent
e0991d3c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
88 deletions
+72
-88
executables/nr-ue.c
executables/nr-ue.c
+15
-7
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
+52
-81
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+5
-0
No files found.
executables/nr-ue.c
View file @
479784a0
...
...
@@ -357,7 +357,15 @@ static void check_nr_prach(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_inf
AssertFatal
(
ul_config
->
number_pdus
<
sizeof
(
ul_config
->
ul_config_list
)
/
sizeof
(
ul_config
->
ul_config_list
[
0
]),
"Number of PDUS in ul_config = %d > ul_config_list num elements"
,
ul_config
->
number_pdus
);
fapi_nr_ul_config_prach_pdu
*
prach_pdu
=
&
ul_config
->
ul_config_list
[
ul_config
->
number_pdus
].
prach_config_pdu
;
uint8_t
nr_prach
=
nr_ue_get_rach_nsa
(
prach_resources
,
uint8_t
nr_prach
=
get_softmodem_params
()
->
nsa
?
nr_ue_get_rach_nsa
(
prach_resources
,
prach_pdu
,
ul_info
->
module_id
,
ul_info
->
cc_id
,
ul_info
->
frame_tx
,
ul_info
->
gNB_index
,
ul_info
->
slot_tx
)
:
nr_ue_get_rach
(
prach_resources
,
prach_pdu
,
ul_info
->
module_id
,
ul_info
->
cc_id
,
...
...
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
View file @
479784a0
...
...
@@ -667,6 +667,10 @@ uint8_t nr_ue_get_rach_nsa(NR_PRACH_RESOURCES_t *prach_resources,
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
mod_id
);
RA_config_t
*
ra
=
&
mac
->
ra
;
uint8_t
mac_sdus
[
MAX_NR_ULSCH_PAYLOAD_BYTES
];
uint8_t
*
payload
;
uint16_t
size_sdu
=
0
;
unsigned
short
post_padding
;
NR_RACH_ConfigCommon_t
*
setup
;
if
(
mac
->
scc
)
setup
=
mac
->
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
rach_ConfigCommon
->
choice
.
setup
;
else
setup
=
mac
->
scc_SIB
->
uplinkConfigCommon
->
initialUplinkBWP
.
rach_ConfigCommon
->
choice
.
setup
;
...
...
@@ -674,118 +678,85 @@ uint8_t nr_ue_get_rach_nsa(NR_PRACH_RESOURCES_t *prach_resources,
NR_RACH_ConfigGeneric_t
*
rach_ConfigGeneric
=
&
setup
->
rach_ConfigGeneric
;
NR_RACH_ConfigDedicated_t
*
rach_ConfigDedicated
=
ra
->
rach_ConfigDedicated
;
uint16_t
sdu_lengths
[
NB_RB_MAX
]
=
{
0
};
int
offset
=
0
;
int
TBS_bytes
=
848
;
int
header_length_total
=
0
;
int
mac_ce_len
;
// Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side
if
(
!
prach_resources
->
init_msg1
)
{
if
((
mac
->
common_configuration_complete
>
0
||
get_softmodem_params
()
->
do_ra
==
1
)
&&
((
MAX_FRAME_NUMBER
+
frame
-
prach_resources
->
sync_frame
)
%
MAX_FRAME_NUMBER
)
>
150
)
{
if
((
mac
->
common_configuration_complete
>
0
||
get_softmodem_params
()
->
do_ra
||
get_softmodem_params
()
->
nsa
)
&&
((
MAX_FRAME_NUMBER
+
frame
-
prach_resources
->
sync_frame
)
%
MAX_FRAME_NUMBER
)
>
150
)
{
prach_resources
->
init_msg1
=
1
;
}
else
{
LOG_D
(
NR_MAC
,
"PRACH Condition not met: frame %d, prach_resources->sync_frame %d
\n
"
,
frame
,
prach_resources
->
sync_frame
);
LOG_D
(
NR_MAC
,
"PRACH Condition not met: frame %d, prach_resources->sync_frame %d
\n
"
,
frame
,
prach_resources
->
sync_frame
);
return
0
;
}
}
LOG_D
(
NR_MAC
,
"In %s: [UE %d][%d.%d]: init_msg1 %d, ra_state %d, RA_active %d
\n
"
,
__FUNCTION__
,
mod_id
,
frame
,
nr_slot_tx
,
prach_resources
->
init_msg1
,
ra
->
ra_state
,
ra
->
RA_active
);
LOG_D
(
NR_MAC
,
"frame %d prach_resources->init_msg1 %d, ra->ra_state %d, ra->RA_active %d
\n
"
,
frame
,
prach_resources
->
init_msg1
,
ra
->
ra_state
,
ra
->
RA_active
);
if
(
prach_resources
->
init_msg1
&&
ra
->
ra_state
!=
RA_SUCCEEDED
)
{
if
(
ra
->
RA_active
==
0
)
{
/* RA not active - checking if RRC is ready to initiate the RA procedure */
LOG_D
(
NR_MAC
,
"In %s: RA not active. Checking for data to transmit from upper layers...
\n
"
,
__FUNCTION__
);
const
uint8_t
lcid
=
UL_SCH_LCID_CCCH
;
const
uint8_t
sh_size
=
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
const
uint8_t
TBS_max
=
8
+
sizeof
(
NR_MAC_SUBHEADER_SHORT
)
+
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
// Note: unclear the reason behind the selection of such TBS_max
int8_t
size_sdu
=
0
;
uint8_t
mac_ce
[
16
]
=
{
0
};
uint8_t
*
pdu
=
get_softmodem_params
()
->
sa
?
mac
->
CCCH_pdu
.
payload
:
mac_ce
;
uint8_t
*
payload
=
pdu
;
// Concerning the C-RNTI MAC CE, it has to be included if the UL transmission (Msg3) is not being made for the CCCH logical channel.
// Therefore it has been assumed that this event only occurs only when RA is done and it is not SA mode.
if
(
get_softmodem_params
()
->
sa
)
{
LOG_D
(
NR_MAC
,
"RA not active. Checking for data to transmit from upper layers...
\n
"
);
NR_MAC_SUBHEADER_FIXED
*
header
=
(
NR_MAC_SUBHEADER_FIXED
*
)
pdu
;
pdu
+=
sh_size
;
int
TBS_max
=
848
;
//8 + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
payload
=
(
uint8_t
*
)
mac
->
CCCH_pdu
.
payload
;
mac_ce_len
=
0
;
post_padding
=
1
;
// initialisation by RRC
nr_rrc_ue_generate_RRCSetupRequest
(
mod_id
,
gNB_id
);
// TODO: To be removed after RA procedures fully implemented
if
(
get_softmodem_params
()
->
do_ra
)
{
nr_rrc_ue_generate_RRCSetupRequest
(
mod_id
,
gNB_id
);
size_sdu
=
(
uint16_t
)
nr_mac_rrc_data_req_ue
(
mod_id
,
CC_id
,
gNB_id
,
frame
,
CCCH
,
mac_sdus
);
// CCCH PDU
size_sdu
=
nr_mac_rrc_data_req_ue
(
mod_id
,
CC_id
,
gNB_id
,
frame
,
CCCH
,
pdu
);
LOG_D
(
NR_MAC
,
"In %s: [UE %d][%d.%d]: Requested RRCConnectionRequest, got %d bytes for LCID 0x%02x
\n
"
,
__FUNCTION__
,
mod_id
,
frame
,
nr_slot_tx
,
size_sdu
,
lcid
);
sdu_lengths
[
0
]
=
size_sdu
;
LOG_D
(
NR_MAC
,
"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes
\n
"
,
mod_id
,
frame
,
size_sdu
);
}
else
{
// fill ulsch_buffer with random data
for
(
int
i
=
0
;
i
<
TBS_bytes
;
i
++
){
mac_sdus
[
i
]
=
(
unsigned
char
)
(
lrand48
()
&
0xff
);
}
//Sending SDUs with size 1
//Initialize elements of sdu_lengths
sdu_lengths
[
0
]
=
TBS_bytes
-
3
-
post_padding
-
mac_ce_len
;
header_length_total
+=
2
+
(
sdu_lengths
[
0
]
>=
128
);
size_sdu
+=
sdu_lengths
[
0
];
}
if
(
size_sdu
>
0
)
{
// UE Contention Resolution Identity
// Store the first 48 bits belonging to the uplink CCCH SDU within Msg3 to determine whether or not the
// Random Access Procedure has been successful after reception of Msg4
memcpy
(
ra
->
cont_res_id
,
pdu
,
sizeof
(
uint8_t
)
*
6
);
pdu
+=
size_sdu
;
ra
->
Msg3_size
=
size_sdu
+
sh_size
;
// Build header
header
->
R
=
0
;
header
->
LCID
=
lcid
;
}
else
{
pdu
-=
sh_size
;
}
memcpy
(
ra
->
cont_res_id
,
mac_sdus
,
sizeof
(
uint8_t
)
*
6
);
}
else
{
LOG_D
(
NR_MAC
,
"[UE %d][%d.%d]: starting initialisation Random Access Procedure...
\n
"
,
mod_id
,
frame
,
nr_slot_tx
);
size_sdu
=
nr_write_ce_ulsch_pdu
(
pdu
,
mac
,
0
,
&
(
mac
->
crnti
),
NULL
,
NULL
,
NULL
);
pdu
+=
size_sdu
;
ra
->
Msg3_size
=
size_sdu
;
}
if
(
size_sdu
>
0
&&
ra
->
generate_nr_prach
==
GENERATE_PREAMBLE
)
{
ra
->
Msg3_size
=
size_sdu
+
sizeof
(
NR_MAC_SUBHEADER_SHORT
)
+
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
LOG_D
(
NR_MAC
,
"In %s: [UE %d][%d.%d]: starting initialisation Random Access Procedure...
\n
"
,
__FUNCTION__
,
mod_id
,
frame
,
nr_slot_tx
);
AssertFatal
(
TBS_max
>
ra
->
Msg3_size
,
"In %s: allocated resources are not enough for Msg3!
\n
"
,
__FUNCTION__
);
// Init RA procedure
init_RA
(
mod_id
,
prach_resources
,
setup
,
rach_ConfigGeneric
,
rach_ConfigDedicated
);
// prach_resources->Msg3 = payload;
nr_get_RA_window
(
mac
);
// Fill in preamble and PRACH resources
if
(
ra
->
generate_nr_prach
==
GENERATE_PREAMBLE
)
{
nr_get_prach_resources
(
mod_id
,
CC_id
,
gNB_id
,
prach_resources
,
prach_pdu
,
rach_ConfigDedicated
);
// Padding: fill remainder with 0
if
(
TBS_max
-
ra
->
Msg3_size
>
0
)
{
LOG_D
(
NR_MAC
,
"In %s: remaining %d bytes, filling with padding
\n
"
,
__FUNCTION__
,
TBS_max
-
ra
->
Msg3_size
);
((
NR_MAC_SUBHEADER_FIXED
*
)
pdu
)
->
R
=
0
;
((
NR_MAC_SUBHEADER_FIXED
*
)
pdu
)
->
LCID
=
UL_SCH_LCID_PADDING
;
pdu
+=
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
for
(
int
j
=
0
;
j
<
TBS_max
-
ra
->
Msg3_size
-
sizeof
(
NR_MAC_SUBHEADER_FIXED
);
j
++
)
{
pdu
[
j
]
=
0
;
}
}
//
Dumping ULSCH payload
LOG_D
(
NR_MAC
,
"In %s: dumping UL Msg3 MAC PDU with length %d:
\n
"
,
__FUNCTION__
,
TBS_max
);
for
(
int
k
=
0
;
k
<
TBS_max
;
k
++
)
{
LOG_D
(
NR_MAC
,
"(%i): %i
\n
"
,
k
,
payload
[
k
])
;
//
Padding: fill remainder with 0
if
(
post_padding
>
0
){
for
(
int
j
=
0
;
j
<
(
TBS_max
-
offset
);
j
++
)
payload
[
offset
+
j
]
=
0
;
}
// Msg3 was initialized with TBS_max bytes because the RA_Msg3_size will only be known after
// receiving Msg2 (which contains the Msg3 resource reserve).
// Msg3 will be transmitted with RA_Msg3_size bytes, removing unnecessary 0s.
mac
->
ulsch_pdu
.
Pdu_size
=
TBS_max
;
memcpy
(
mac
->
ulsch_pdu
.
payload
,
payload
,
TBS_max
);
}
else
{
return
0
;
}
}
else
if
(
ra
->
RA_window_cnt
!=
-
1
)
{
// RACH is active
...
...
@@ -814,7 +785,7 @@ uint8_t nr_ue_get_rach_nsa(NR_PRACH_RESOURCES_t *prach_resources,
}
else
if
(
ra
->
RA_window_cnt
>
0
)
{
LOG_
D
(
MAC
,
"[UE %d][%d.%d]: RAR not received yet (RA window count %d)
\n
"
,
mod_id
,
frame
,
nr_slot_tx
,
ra
->
RA_window_cnt
);
LOG_
I
(
MAC
,
"[UE %d][%d.%d]: RAR not received yet (RA window count %d)
\n
"
,
mod_id
,
frame
,
nr_slot_tx
,
ra
->
RA_window_cnt
);
// Fill in preamble and PRACH resources
ra
->
RA_window_cnt
--
;
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
479784a0
...
...
@@ -3802,6 +3802,11 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
LOG_D
(
NR_MAC
,
"In %s:[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)
\n
"
,
__FUNCTION__
,
frame
,
slot
,
mod_id
,
preamble_index
);
if
(
get_softmodem_params
()
->
nsa
&&
mac
->
crnti
==
ra
->
t_crnti
)
{
LOG_D
(
MAC
,
"Discarding the received RAR.
\n
"
);
return
-
1
;
}
while
(
1
)
{
n_subheaders
++
;
if
(
rarh
->
T
==
1
)
{
...
...
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