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
d5f431a1
Commit
d5f431a1
authored
Mar 25, 2022
by
rmagueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move nr_bwp_switch and schedule_nr_bwp_switch functions to gNB_scheduler_primitives.c
parent
94a296d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
66 deletions
+65
-66
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+0
-66
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+65
-0
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
d5f431a1
...
@@ -1001,72 +1001,6 @@ nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(module_id_t module_id, int CC_id)
...
@@ -1001,72 +1001,6 @@ nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(module_id_t module_id, int CC_id)
return
nr_fr1_dlsch_preprocessor
;
return
nr_fr1_dlsch_preprocessor
;
}
}
void
nr_bwp_switch
(
module_id_t
module_id
,
frame_t
frame
,
sub_frame_t
slot
,
int
UE_id
,
int
bwp_id
)
{
NR_UE_info_t
*
UE_info
=
&
RC
.
nrmac
[
module_id
]
->
UE_info
;
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
switch
(
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
)
{
case
BWP_SWITCH_TO_START
:
LOG_W
(
NR_MAC
,
"(%d.%d) [UE_id %d] Schedule BWP switch from bwp_id %ld to %d
\n
"
,
frame
,
slot
,
UE_id
,
UE_info
->
UE_sched_ctrl
[
UE_id
].
active_bwp
->
bwp_Id
,
bwp_id
);
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
=
BWP_SWITCH_RUNNING
;
sched_ctrl
->
bwp_switch_info
.
bwp_switch_slot
=
slot
;
nr_mac_rrc_bwp_switch_req
(
module_id
,
frame
,
slot
,
UE_info
->
rnti
[
UE_id
],
bwp_id
);
break
;
case
BWP_SWITCH_RUNNING
:
// The BWP switching takes at least 10+6 ms (3GPP TS 38.331 Section 12)
// gNB needs time to schedule and send RRCReconfiguration message
// Therefore, we wait for the same slot in next frame (10 ms) before update bwp_id in the gNB
if
(
sched_ctrl
->
bwp_switch_info
.
bwp_switch_slot
==
slot
)
{
const
NR_ServingCellConfig_t
*
servingCellConfig
=
UE_info
->
CellGroup
[
UE_id
]
?
UE_info
->
CellGroup
[
UE_id
]
->
spCellConfig
->
spCellConfigDedicated
:
NULL
;
const
struct
NR_ServingCellConfig__downlinkBWP_ToAddModList
*
bwpList
=
servingCellConfig
?
servingCellConfig
->
downlinkBWP_ToAddModList
:
NULL
;
const
int
bwp_id
=
servingCellConfig
&&
servingCellConfig
->
firstActiveDownlinkBWP_Id
?
*
servingCellConfig
->
firstActiveDownlinkBWP_Id
:
0
;
sched_ctrl
->
active_bwp
=
bwpList
&&
bwp_id
>
0
?
bwpList
->
list
.
array
[
bwp_id
-
1
]
:
NULL
;
const
struct
NR_UplinkConfig__uplinkBWP_ToAddModList
*
ubwpList
=
servingCellConfig
?
servingCellConfig
->
uplinkConfig
->
uplinkBWP_ToAddModList
:
NULL
;
const
int
ubwp_id
=
servingCellConfig
&&
servingCellConfig
->
uplinkConfig
&&
servingCellConfig
->
uplinkConfig
->
firstActiveUplinkBWP_Id
?
*
servingCellConfig
->
uplinkConfig
->
firstActiveUplinkBWP_Id
:
0
;
sched_ctrl
->
active_ubwp
=
ubwpList
&&
ubwp_id
>
0
?
ubwpList
->
list
.
array
[
ubwp_id
-
1
]
:
NULL
;
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
=
BWP_SWITCH_INACTIVE
;
}
break
;
case
BWP_SWITCH_INACTIVE
:
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid bwp switch state
\n
"
);
break
;
}
}
void
schedule_nr_bwp_switch
(
module_id_t
module_id
,
frame_t
frame
,
sub_frame_t
slot
)
{
NR_UE_info_t
*
UE_info
=
&
RC
.
nrmac
[
module_id
]
->
UE_info
;
const
NR_list_t
*
UE_list
=
&
UE_info
->
list
;
// TODO: Implementation of a algorithm to perform:
// - the BWP switch trigger: sched_ctrl->bwp_switch_info.bwp_switch_state = BWP_SWITCH_TO_START
// - the BWP selection: sched_ctrl->bwp_switch_info.next_bwp = bwp_id
for
(
int
UE_id
=
UE_list
->
head
;
UE_id
>=
0
;
UE_id
=
UE_list
->
next
[
UE_id
])
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
if
(
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
>
BWP_SWITCH_INACTIVE
)
{
nr_bwp_switch
(
module_id
,
frame
,
slot
,
UE_id
,
sched_ctrl
->
bwp_switch_info
.
next_bwp
);
}
}
}
void
nr_schedule_ue_spec
(
module_id_t
module_id
,
void
nr_schedule_ue_spec
(
module_id_t
module_id
,
frame_t
frame
,
frame_t
frame
,
sub_frame_t
slot
)
{
sub_frame_t
slot
)
{
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
d5f431a1
...
@@ -2704,6 +2704,71 @@ void nr_csirs_scheduling(int Mod_idP,
...
@@ -2704,6 +2704,71 @@ void nr_csirs_scheduling(int Mod_idP,
}
}
}
}
void
nr_bwp_switch
(
module_id_t
module_id
,
frame_t
frame
,
sub_frame_t
slot
,
int
UE_id
,
int
bwp_id
)
{
NR_UE_info_t
*
UE_info
=
&
RC
.
nrmac
[
module_id
]
->
UE_info
;
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
switch
(
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
)
{
case
BWP_SWITCH_TO_START
:
LOG_W
(
NR_MAC
,
"(%d.%d) [UE_id %d] Schedule BWP switch from bwp_id %ld to %d
\n
"
,
frame
,
slot
,
UE_id
,
UE_info
->
UE_sched_ctrl
[
UE_id
].
active_bwp
->
bwp_Id
,
bwp_id
);
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
=
BWP_SWITCH_RUNNING
;
sched_ctrl
->
bwp_switch_info
.
bwp_switch_slot
=
slot
;
nr_mac_rrc_bwp_switch_req
(
module_id
,
frame
,
slot
,
UE_info
->
rnti
[
UE_id
],
bwp_id
);
break
;
case
BWP_SWITCH_RUNNING
:
// The BWP switching takes at least 10+6 ms (3GPP TS 38.331 Section 12)
// gNB needs time to schedule and send RRCReconfiguration message
// Therefore, we wait for the same slot in next frame (10 ms) before update bwp_id in the gNB
if
(
sched_ctrl
->
bwp_switch_info
.
bwp_switch_slot
==
slot
)
{
const
NR_ServingCellConfig_t
*
servingCellConfig
=
UE_info
->
CellGroup
[
UE_id
]
?
UE_info
->
CellGroup
[
UE_id
]
->
spCellConfig
->
spCellConfigDedicated
:
NULL
;
const
struct
NR_ServingCellConfig__downlinkBWP_ToAddModList
*
bwpList
=
servingCellConfig
?
servingCellConfig
->
downlinkBWP_ToAddModList
:
NULL
;
const
int
bwp_id
=
servingCellConfig
&&
servingCellConfig
->
firstActiveDownlinkBWP_Id
?
*
servingCellConfig
->
firstActiveDownlinkBWP_Id
:
0
;
sched_ctrl
->
active_bwp
=
bwpList
&&
bwp_id
>
0
?
bwpList
->
list
.
array
[
bwp_id
-
1
]
:
NULL
;
const
struct
NR_UplinkConfig__uplinkBWP_ToAddModList
*
ubwpList
=
servingCellConfig
?
servingCellConfig
->
uplinkConfig
->
uplinkBWP_ToAddModList
:
NULL
;
const
int
ubwp_id
=
servingCellConfig
&&
servingCellConfig
->
uplinkConfig
&&
servingCellConfig
->
uplinkConfig
->
firstActiveUplinkBWP_Id
?
*
servingCellConfig
->
uplinkConfig
->
firstActiveUplinkBWP_Id
:
0
;
sched_ctrl
->
active_ubwp
=
ubwpList
&&
ubwp_id
>
0
?
ubwpList
->
list
.
array
[
ubwp_id
-
1
]
:
NULL
;
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
=
BWP_SWITCH_INACTIVE
;
}
break
;
case
BWP_SWITCH_INACTIVE
:
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid bwp switch state
\n
"
);
break
;
}
}
void
schedule_nr_bwp_switch
(
module_id_t
module_id
,
frame_t
frame
,
sub_frame_t
slot
)
{
NR_UE_info_t
*
UE_info
=
&
RC
.
nrmac
[
module_id
]
->
UE_info
;
const
NR_list_t
*
UE_list
=
&
UE_info
->
list
;
// TODO: Implementation of a algorithm to perform:
// - the BWP switch trigger: sched_ctrl->bwp_switch_info.bwp_switch_state = BWP_SWITCH_TO_START
// - the BWP selection: sched_ctrl->bwp_switch_info.next_bwp = bwp_id
for
(
int
UE_id
=
UE_list
->
head
;
UE_id
>=
0
;
UE_id
=
UE_list
->
next
[
UE_id
])
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
if
(
sched_ctrl
->
bwp_switch_info
.
bwp_switch_state
>
BWP_SWITCH_INACTIVE
)
{
nr_bwp_switch
(
module_id
,
frame
,
slot
,
UE_id
,
sched_ctrl
->
bwp_switch_info
.
next_bwp
);
}
}
}
/*void fill_nfapi_coresets_and_searchspaces(NR_CellGroupConfig_t *cg,
/*void fill_nfapi_coresets_and_searchspaces(NR_CellGroupConfig_t *cg,
nfapi_nr_coreset_t *coreset,
nfapi_nr_coreset_t *coreset,
...
...
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