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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
50c87a05
Commit
50c87a05
authored
Oct 22, 2021
by
hardy
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/bugfix-multi-rach' into integration_2021_wk42_b
parents
c834ea58
218de934
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
+14
-10
No files found.
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
View file @
50c87a05
...
...
@@ -30,9 +30,6 @@
* \warning
*/
/* Tools */
#include "SIMULATION/TOOLS/sim.h" // for taus
/* RRC */
#include "NR_RACH-ConfigCommon.h"
#include "RRC/NR_UE/rrc_proto.h"
...
...
@@ -402,6 +399,10 @@ void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t
int
PLThreshold
=
0
;
long
deltaPreamble_Msg3
=
0
;
uint8_t
noGroupB
=
0
;
// Random seed generation
long
long
tmp
=
rdtsc_oai
();
unsigned
short
int
*
seed
=
(
unsigned
short
int
*
)
&
tmp
;
RA_config_t
*
ra
=
&
mac
->
ra
;
NR_RACH_ConfigCommon_t
*
setup
;
if
(
mac
->
scc
)
setup
=
mac
->
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
rach_ConfigCommon
->
choice
.
setup
;
...
...
@@ -500,28 +501,28 @@ void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t
if
(
ra
->
ra_PreambleIndex
<
0
||
ra
->
ra_PreambleIndex
>
63
)
{
if
(
noGroupB
)
{
// use Group A preamble
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
(
taus
()
)
%
ra
->
cb_preambles_per_ssb
);
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
nrand48
(
seed
)
%
ra
->
cb_preambles_per_ssb
);
ra
->
RA_usedGroupA
=
1
;
}
else
if
((
ra
->
Msg3_size
<
messageSizeGroupA
)
&&
(
dl_pathloss
>
PLThreshold
))
{
// Group B is configured and RA preamble Group A is used
// - todo add condition on CCCH_sdu_size for initiation by CCCH
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
(
taus
()
)
%
sizeOfRA_PreamblesGroupA
);
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
nrand48
(
seed
)
%
sizeOfRA_PreamblesGroupA
);
ra
->
RA_usedGroupA
=
1
;
}
else
{
// Group B preamble is configured and used
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
// the remaining belong to RA Preambles Group B
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
sizeOfRA_PreamblesGroupA
+
(
(
taus
()
)
%
(
ra
->
cb_preambles_per_ssb
-
sizeOfRA_PreamblesGroupA
));
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
sizeOfRA_PreamblesGroupA
+
(
nrand48
(
seed
)
%
(
ra
->
cb_preambles_per_ssb
-
sizeOfRA_PreamblesGroupA
));
ra
->
RA_usedGroupA
=
0
;
}
}
}
else
{
// Msg3 is being retransmitted
if
(
ra
->
RA_usedGroupA
&&
noGroupB
)
{
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
(
taus
()
)
%
ra
->
cb_preambles_per_ssb
);
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
nrand48
(
seed
)
%
ra
->
cb_preambles_per_ssb
);
}
else
if
(
ra
->
RA_usedGroupA
&&
!
noGroupB
){
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
(
taus
()
)
%
sizeOfRA_PreamblesGroupA
);
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
(
nrand48
(
seed
)
%
sizeOfRA_PreamblesGroupA
);
}
else
{
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
sizeOfRA_PreamblesGroupA
+
(
(
taus
()
)
%
(
ra
->
cb_preambles_per_ssb
-
sizeOfRA_PreamblesGroupA
));
ra
->
ra_PreambleIndex
=
ra
->
starting_preamble_nb
+
sizeOfRA_PreamblesGroupA
+
(
nrand48
(
seed
)
%
(
ra
->
cb_preambles_per_ssb
-
sizeOfRA_PreamblesGroupA
));
}
}
prach_resources
->
ra_PreambleIndex
=
ra
->
ra_PreambleIndex
;
...
...
@@ -960,6 +961,9 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
mod_id
);
RA_config_t
*
ra
=
&
mac
->
ra
;
// Random seed generation
long
long
tmp
=
rdtsc_oai
();
unsigned
short
int
*
seed
=
(
unsigned
short
int
*
)
&
tmp
;
ra
->
first_Msg3
=
1
;
ra
->
ra_PreambleIndex
=
-
1
;
...
...
@@ -973,7 +977,7 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
LOG_D
(
MAC
,
"In %s: [UE %d][%d.%d] Maximum number of RACH attempts (%d) reached, selecting backoff time...
\n
"
,
__FUNCTION__
,
mod_id
,
frame
,
slot
,
ra
->
preambleTransMax
);
ra
->
RA_backoff_cnt
=
rand
(
)
%
(
prach_resources
->
RA_PREAMBLE_BACKOFF
+
1
);
ra
->
RA_backoff_cnt
=
nrand48
(
seed
)
%
(
prach_resources
->
RA_PREAMBLE_BACKOFF
+
1
);
prach_resources
->
RA_PREAMBLE_TRANSMISSION_COUNTER
=
1
;
prach_resources
->
RA_PREAMBLE_POWER_RAMPING_STEP
+=
2
;
// 2 dB increment
prach_resources
->
ra_PREAMBLE_RECEIVED_TARGET_POWER
=
nr_get_Po_NOMINAL_PUSCH
(
prach_resources
,
mod_id
,
CC_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