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
4dacea92
Commit
4dacea92
authored
Feb 11, 2021
by
kn.raju
Committed by
Robert Schmidt
Feb 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New UE: check for free RA and copy preamble list
parent
eaadda1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+23
-7
No files found.
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
4dacea92
...
...
@@ -400,21 +400,37 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
const
int
UE_id
=
add_new_nr_ue
(
Mod_idP
,
rnti
,
secondaryCellGroup
);
LOG_I
(
PHY
,
"Added new UE_id %d/%x with initial secondaryCellGroup
\n
"
,
UE_id
,
rnti
);
}
else
if
(
add_ue
==
1
&&
!
get_softmodem_params
()
->
phy_test
)
{
/* TODO: should check for free RA process */
const
int
CC_id
=
0
;
NR_RA_t
*
ra
=
&
RC
.
nrmac
[
Mod_idP
]
->
common_channels
[
CC_id
].
ra
[
0
];
ra
->
state
=
RA_IDLE
;
NR_COMMON_channels_t
*
cc
=
&
RC
.
nrmac
[
Mod_idP
]
->
common_channels
[
CC_id
];
uint8_t
ra_index
=
0
;
/* checking for free RA process */
for
(;
ra_index
<
NR_NB_RA_PROC_MAX
;
ra_index
++
)
{
if
((
cc
->
ra
[
ra_index
].
state
==
RA_IDLE
)
&&
(
!
cc
->
ra
[
ra_index
].
cfra
))
break
;
}
if
(
ra_index
==
NR_NB_RA_PROC_MAX
)
{
LOG_E
(
MAC
,
"%s() %s:%d RA processes are not available for CFRA RNTI :%x
\n
"
,
__FUNCTION__
,
__FILE__
,
__LINE__
,
rnti
);
return
-
1
;
}
NR_RA_t
*
ra
=
&
cc
->
ra
[
ra_index
];
ra
->
secondaryCellGroup
=
secondaryCellGroup
;
if
(
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
!=
NULL
)
{
if
(
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
->
choice
.
uplink
->
cfra
!=
NULL
)
{
ra
->
cfra
=
true
;
ra
->
rnti
=
rnti
;
struct
NR_CFRA
cfra
=
*
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
->
choice
.
uplink
->
cfra
;
uint8_t
num_preamble
=
cfra
.
resources
.
choice
.
ssb
->
ssb_ResourceList
.
list
.
count
;
struct
NR_CFRA
*
cfra
=
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
->
choice
.
uplink
->
cfra
;
uint8_t
num_preamble
=
cfra
->
resources
.
choice
.
ssb
->
ssb_ResourceList
.
list
.
count
;
ra
->
preambles
.
num_preambles
=
num_preamble
;
ra
->
preambles
.
preamble_list
=
(
uint8_t
*
)
malloc
(
num_preamble
*
sizeof
(
uint8_t
));
for
(
int
i
=
0
;
i
<
num_preamble
;
i
++
)
ra
->
preambles
.
preamble_list
[
i
]
=
cfra
.
resources
.
choice
.
ssb
->
ssb_ResourceList
.
list
.
array
[
i
]
->
ra_PreambleIndex
;
for
(
int
i
=
0
;
i
<
cc
->
num_active_ssb
;
i
++
)
{
for
(
int
j
=
0
;
j
<
num_preamble
;
j
++
)
{
if
(
cc
->
ssb_index
[
i
]
==
cfra
->
resources
.
choice
.
ssb
->
ssb_ResourceList
.
list
.
array
[
i
]
->
ssb
)
{
// one dedicated preamble for each beam
ra
->
preambles
.
preamble_list
[
i
]
=
cfra
->
resources
.
choice
.
ssb
->
ssb_ResourceList
.
list
.
array
[
i
]
->
ra_PreambleIndex
;
break
;
}
}
}
}
}
LOG_I
(
PHY
,
"Added new RA process for UE RNTI %04x with initial secondaryCellGroup
\n
"
,
rnti
);
...
...
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