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
spbro
OpenXG-RAN
Commits
f83598ad
Commit
f83598ad
authored
May 24, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor new-RNTI functionality in separate function
parent
4b77a50e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
24 deletions
+30
-24
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+3
-24
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+25
-0
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+2
-0
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
f83598ad
...
...
@@ -40,7 +40,6 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/nr/nr_common.h"
#include "UTIL/OPT/opt.h"
#include "SIMULATION/TOOLS/sim.h" // for taus
/* rlc */
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
...
...
@@ -460,16 +459,6 @@ static NR_RA_t *find_free_nr_RA(NR_RA_t *ra_base, int ra_count, uint16_t preambl
return
NULL
;
}
static
const
NR_RA_t
*
find_nr_RA_rnti
(
const
NR_RA_t
*
ra_base
,
int
ra_count
,
rnti_t
rnti
)
{
for
(
int
i
=
0
;
i
<
ra_count
;
++
i
)
{
const
NR_RA_t
*
ra
=
&
ra_base
[
i
];
if
(
ra
->
ra_state
!=
nrRA_gNB_IDLE
&&
ra
->
rnti
==
rnti
)
return
ra
;
}
return
NULL
;
}
void
nr_initiate_ra_proc
(
module_id_t
module_idP
,
int
CC_id
,
frame_t
frameP
,
...
...
@@ -495,23 +484,13 @@ void nr_initiate_ra_proc(module_id_t module_idP,
}
if
(
ra
->
rnti
==
0
)
{
// This condition allows for the usage of a preconfigured rnti for the CFRA
int
loop
=
0
;
bool
exist_connected_ue
,
exist_in_pending_ra_ue
;
rnti_t
trial
=
0
;
do
{
// 3GPP TS 38.321 version 15.13.0 Section 7.1 Table 7.1-1: RNTI values
while
(
trial
<
1
||
trial
>
0xffef
)
trial
=
(
taus
()
%
0xffef
)
+
1
;
exist_connected_ue
=
find_nr_UE
(
&
nr_mac
->
UE_info
,
trial
)
!=
NULL
;
exist_in_pending_ra_ue
=
find_nr_RA_rnti
(
cc
->
ra
,
sizeofArray
(
cc
->
ra
),
ra
->
rnti
)
!=
NULL
;
loop
++
;
}
while
(
loop
<
100
&&
(
exist_connected_ue
||
exist_in_pending_ra_ue
)
);
if
(
loop
==
100
)
{
bool
rnti_found
=
nr_mac_get_new_rnti
(
&
nr_mac
->
UE_info
,
cc
->
ra
,
sizeofArray
(
cc
->
ra
),
&
ra
->
rnti
);
if
(
!
rnti_found
)
{
LOG_E
(
NR_MAC
,
"initialisation random access: no more available RNTIs for new UE
\n
"
);
nr_clear_ra_proc
(
ra
);
NR_SCHED_UNLOCK
(
&
nr_mac
->
sched_lock
);
return
;
}
ra
->
rnti
=
trial
;
}
ra
->
ra_state
=
nrRA_Msg2
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
f83598ad
...
...
@@ -53,6 +53,8 @@
#include "uper_encoder.h"
#include "uper_decoder.h"
#include "SIMULATION/TOOLS/sim.h" // for taus
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_gNB_SCHEDULER 1
...
...
@@ -3302,3 +3304,26 @@ bool nr_mac_remove_lcid(NR_UE_sched_ctrl_t *sched_ctrl, long lcid)
seq_arr_erase
(
&
sched_ctrl
->
lc_config
,
elm
.
it
);
return
true
;
}
static
const
NR_RA_t
*
find_nr_RA_rnti
(
const
NR_RA_t
*
ra_base
,
int
ra_count
,
rnti_t
rnti
)
{
for
(
int
i
=
0
;
i
<
ra_count
;
++
i
)
{
const
NR_RA_t
*
ra
=
&
ra_base
[
i
];
if
(
ra
->
ra_state
!=
nrRA_gNB_IDLE
&&
ra
->
rnti
==
rnti
)
return
ra
;
}
return
NULL
;
}
bool
nr_mac_get_new_rnti
(
NR_UEs_t
*
UEs
,
const
NR_RA_t
*
ra_base
,
int
ra_count
,
rnti_t
*
rnti
)
{
int
loop
=
0
;
bool
exist_connected_ue
,
exist_in_pending_ra_ue
;
do
{
*
rnti
=
(
taus
()
%
0xffef
)
+
1
;
exist_connected_ue
=
find_nr_UE
(
UEs
,
*
rnti
)
!=
NULL
;
exist_in_pending_ra_ue
=
find_nr_RA_rnti
(
ra_base
,
ra_count
,
*
rnti
)
!=
NULL
;
loop
++
;
}
while
(
loop
<
100
&&
(
exist_connected_ue
||
exist_in_pending_ra_ue
));
return
loop
<
100
;
// nothing found: loop count 100
}
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
f83598ad
...
...
@@ -451,4 +451,6 @@ void process_addmod_bearers_cellGroupConfig(NR_UE_sched_ctrl_t *sched_ctrl,
bool
nr_mac_add_lcid
(
NR_UE_sched_ctrl_t
*
sched_ctrl
,
const
nr_lc_config_t
*
c
);
bool
nr_mac_remove_lcid
(
NR_UE_sched_ctrl_t
*
sched_ctrl
,
long
lcid
);
bool
nr_mac_get_new_rnti
(
NR_UEs_t
*
UEs
,
const
NR_RA_t
*
ra_base
,
int
ra_count
,
rnti_t
*
rnti
);
#endif
/*__LAYER2_NR_MAC_PROTO_H__*/
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