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
canghaiwuhen
OpenXG-RAN
Commits
87b02489
Commit
87b02489
authored
Oct 06, 2020
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using crnti as tcrnti
parent
8d6e0a43
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
50 deletions
+47
-50
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+10
-9
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+36
-40
No files found.
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
87b02489
...
...
@@ -367,10 +367,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
NR_RA_t
*
ra
=
&
RC
.
nrmac
[
Mod_idP
]
->
common_channels
[
CC_id
].
ra
[
0
];
ra
->
state
=
RA_IDLE
;
ra
->
secondaryCellGroup
=
secondaryCellGroup
;
ra
->
crnti
=
rnti
;
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
;
ra
->
preambles
.
num_preambles
=
num_preamble
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
87b02489
...
...
@@ -308,16 +308,17 @@ void nr_initiate_ra_proc(module_id_t module_idP,
LOG_D
(
MAC
,
"%s() Msg2[%04d%d] SFN/SF:%04d%d
\n
"
,
__FUNCTION__
,
ra
->
Msg2_frame
,
ra
->
Msg2_slot
,
frameP
,
slotP
);
do
{
ra
->
rnti
=
(
taus
()
%
65518
)
+
1
;
loop
++
;
}
while
(
loop
!=
100
&&
!
(
find_nr_UE_id
(
module_idP
,
ra
->
rnti
)
==
-
1
&&
ra
->
rnti
>=
1
&&
ra
->
rnti
<=
65519
));
if
(
loop
==
100
)
{
LOG_E
(
MAC
,
"%s:%d:%s: [RAPROC] initialisation random access aborted
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
abort
();
if
(
!
ra
->
cfra
)
{
do
{
ra
->
rnti
=
(
taus
()
%
65518
)
+
1
;
loop
++
;
}
while
(
loop
!=
100
&&
!
(
find_nr_UE_id
(
module_idP
,
ra
->
rnti
)
==
-
1
&&
ra
->
rnti
>=
1
&&
ra
->
rnti
<=
65519
));
if
(
loop
==
100
)
{
LOG_E
(
MAC
,
"%s:%d:%s: [RAPROC] initialisation random access aborted
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
abort
();
}
}
ra
->
RA_rnti
=
ra_rnti
;
ra
->
preamble_index
=
preamble_index
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
87b02489
...
...
@@ -322,9 +322,44 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
UE_info
=
&
gNB_mac
->
UE_info
;
int
target_snrx10
=
gNB_mac
->
pusch_target_snrx10
;
NR_RA_t
*
ra
=
&
gNB_mac
->
common_channels
[
CC_idP
].
ra
[
0
];
// random access pusch with TC-RNTI
if
(
ra
->
state
==
WAIT_Msg3
)
{
if
(
sduP
!=
NULL
)
{
// if the CRC passed
if
(
ra
->
rnti
!=
current_rnti
)
{
LOG_E
(
MAC
,
"expected TC-RNTI %04x to match current RNTI %04x
\n
"
,
ra
->
rnti
,
current_rnti
);
return
;
}
free
(
ra
->
preambles
.
preamble_list
);
ra
->
state
=
RA_IDLE
;
LOG_I
(
MAC
,
"reset RA state information for RA-RNTI %04x
\n
"
,
ra
->
rnti
);
const
int
UE_id
=
add_new_nr_ue
(
gnb_mod_idP
,
ra
->
rnti
);
UE_info
->
secondaryCellGroup
[
UE_id
]
=
ra
->
secondaryCellGroup
;
struct
NR_ServingCellConfig__downlinkBWP_ToAddModList
*
bwpList
=
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
;
AssertFatal
(
bwpList
->
list
.
count
==
1
,
"downlinkBWP_ToAddModList has %d BWP!
\n
"
,
bwpList
->
list
.
count
);
const
int
bwp_id
=
1
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
active_bwp
=
bwpList
->
list
.
array
[
bwp_id
-
1
];
LOG_I
(
MAC
,
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, "
"adding UE MAC Context UE_id %d/RNTI %04x
\n
"
,
gnb_mod_idP
,
current_rnti
,
UE_id
,
ra
->
rnti
);
}
return
;
}
if
(
UE_id
!=
-
1
)
{
UE_scheduling_control
=
&
(
UE_info
->
UE_sched_ctrl
[
UE_id
]);
UE_info
->
mac_stats
[
UE_id
].
ulsch_total_bytes_rx
+=
sdu_lenP
;
LOG_D
(
MAC
,
"[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d
\n
"
,
gnb_mod_idP
,
...
...
@@ -366,44 +401,5 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
}
}
else
if
(
sduP
!=
NULL
)
{
// if the CRC passed
// random access pusch with TC-RNTI
NR_RA_t
*
ra
=
&
gNB_mac
->
common_channels
[
CC_idP
].
ra
[
0
];
if
(
ra
->
state
!=
WAIT_Msg3
)
{
LOG_E
(
MAC
,
"expected RA state WAIT_Msg3/%d (but is %d) for RA-RNTI %04x
\n
"
,
WAIT_Msg3
,
ra
->
state
,
ra
->
rnti
);
return
;
}
if
(
ra
->
rnti
!=
current_rnti
)
{
LOG_E
(
MAC
,
"expected RA-RNTI %04x (C-RNTI %04x) to match current RNTI %04x
\n
"
,
ra
->
rnti
,
ra
->
crnti
,
current_rnti
);
return
;
}
free
(
ra
->
preambles
.
preamble_list
);
ra
->
state
=
RA_IDLE
;
LOG_I
(
MAC
,
"reset RA state information for RA-RNTI %04x
\n
"
,
ra
->
rnti
);
const
int
UE_id
=
add_new_nr_ue
(
gnb_mod_idP
,
ra
->
crnti
);
UE_info
->
secondaryCellGroup
[
UE_id
]
=
ra
->
secondaryCellGroup
;
struct
NR_ServingCellConfig__downlinkBWP_ToAddModList
*
bwpList
=
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
;
AssertFatal
(
bwpList
->
list
.
count
==
1
,
"downlinkBWP_ToAddModList has %d BWP!
\n
"
,
bwpList
->
list
.
count
);
const
int
bwp_id
=
1
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
active_bwp
=
bwpList
->
list
.
array
[
bwp_id
-
1
];
LOG_W
(
MAC
,
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, "
"adding UE MAC Context UE_id %d/RNTI %04x
\n
"
,
gnb_mod_idP
,
current_rnti
,
UE_id
,
ra
->
crnti
);
}
}
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