Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
169f3346
Commit
169f3346
authored
Apr 18, 2017
by
shahab
Browse files
Uplink Agent Mac function
parent
7df4a781
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
cmake_targets/CMakeLists.txt
View file @
169f3346
...
...
@@ -1207,6 +1207,7 @@ if (FLEXRAN_AGENT_SB_IF)
set
(
MAC_SRC
${
MAC_SRC
}
${
MAC_DIR
}
/flexran_agent_scheduler_dlsch_ue.c
${
MAC_DIR
}
/flexran_agent_scheduler_ulsch_ue.c
${
MAC_DIR
}
/flexran_agent_scheduler_dataplane.c
${
MAC_DIR
}
/flexran_agent_scheduler_dlsch_ue_remote.c
)
...
...
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
View file @
169f3346
...
...
@@ -1177,6 +1177,7 @@ int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
xface
->
flexran_agent_send_sf_trigger
=
flexran_agent_send_sf_trigger
;
//xface->flexran_agent_send_update_mac_stats = flexran_agent_send_update_mac_stats;
xface
->
flexran_agent_schedule_ue_spec
=
flexran_schedule_ue_spec_default
;
xface
->
flexran_agent_schedule_ul_spec
=
flexran_agent_schedule_ulsch_ue_spec
;
//xface->flexran_agent_schedule_ue_spec = flexran_schedule_ue_spec_remote;
xface
->
flexran_agent_get_pending_dl_mac_config
=
flexran_agent_get_pending_dl_mac_config
;
...
...
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_defs.h
View file @
169f3346
...
...
@@ -61,6 +61,10 @@ typedef struct {
int
*
mbsfn_flag
,
Protocol__FlexranMessage
**
dl_info
);
void
(
*
flexran_agent_schedule_ul_spec
)(
mid_t
module_idP
,
uint32_t
frameP
,
unsigned
char
cooperation_flag
,
uint32_t
subframeP
,
unsigned
char
sched_subframe
);
/// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
// int (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
...
...
openair2/LAYER2/MAC/eNB_scheduler.c
View file @
169f3346
...
...
@@ -382,11 +382,26 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
if
(
mac_xface
->
frame_parms
->
frame_type
==
FDD
)
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
//,calibration_flag);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
}
else
if
((
mac_xface
->
frame_parms
->
tdd_config
==
0
)
||
//TDD
(
mac_xface
->
frame_parms
->
tdd_config
==
3
)
||
(
mac_xface
->
frame_parms
->
tdd_config
==
6
))
{
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
4
);
//,calibration_flag);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
}
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -418,14 +433,31 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
switch
(
mac_xface
->
frame_parms
->
tdd_config
)
{
case
0
:
case
1
:
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
7
);
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
7
);
//,calibration_flag);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
#endif
break
;
case
6
:
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
8
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
#endif
...
...
@@ -435,7 +467,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
}
}
else
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
1
,
5
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -465,7 +506,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// TDD, nothing
// FDD, normal UL/DLSCH
if
(
mac_xface
->
frame_parms
->
frame_type
==
FDD
)
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
2
,
6
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -498,7 +548,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
if
(
mac_xface
->
frame_parms
->
frame_type
==
TDD
)
{
switch
(
mac_xface
->
frame_parms
->
tdd_config
)
{
case
2
:
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
7
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
// no break here!
case
5
:
...
...
@@ -528,8 +586,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
}
}
else
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
3
,
7
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -563,7 +629,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
switch
(
mac_xface
->
frame_parms
->
tdd_config
)
{
case
1
:
// schedule_RA(module_idP,frameP,subframeP);
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
8
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
// no break here!
case
2
:
...
...
@@ -600,8 +674,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
}
}
else
{
if
(
mac_xface
->
frame_parms
->
frame_type
==
FDD
)
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
4
,
8
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -637,7 +719,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//schedule_RA(module_idP,frameP,subframeP,5);
if
(
mac_xface
->
frame_parms
->
frame_type
==
FDD
)
{
schedule_RA
(
module_idP
,
frameP
,
subframeP
,
1
);
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
5
,
9
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -700,7 +791,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
case
1
:
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
2
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
// schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
#ifndef FLEXRAN_AGENT_SB_IF
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -708,7 +807,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
case
6
:
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
3
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
// schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
#ifndef FLEXRAN_AGENT_SB_IF
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -767,7 +874,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
}
}
else
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
6
,
0
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -850,7 +966,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
}
}
else
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
7
,
1
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -888,7 +1013,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
case
5
:
// schedule_RA(module_idP,subframeP);
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
2
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -915,7 +1049,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
}
}
else
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
8
,
2
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -946,7 +1089,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
if
(
mac_xface
->
frame_parms
->
frame_type
==
TDD
)
{
switch
(
mac_xface
->
frame_parms
->
tdd_config
)
{
case
1
:
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
3
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
schedule_RA
(
module_idP
,
frameP
,
subframeP
,
7
);
// 7 = Msg3 subframeP, not
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -972,7 +1123,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
case
3
:
case
4
:
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
3
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -996,7 +1156,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
case
6
:
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
subframeP
,
4
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
//schedule_RA(module_idP,frameP,subframeP);
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
@@ -1049,7 +1217,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break
;
}
}
else
{
//FDD
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ulsch
(
module_idP
,
frameP
,
cooperation_flag
,
9
,
3
);
#else
if
(
mac_agent_registered
[
module_idP
]){
agent_mac_xface
[
module_idP
]
->
flexran_agent_schedule_ul_spec
(
module_idP
,
frameP
,
cooperation_flag
,
0
,
4
);
}
#endif
#ifndef FLEXRAN_AGENT_SB_IF
schedule_ue_spec
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
fill_DLSCH_dci
(
module_idP
,
frameP
,
subframeP
,
mbsfn_status
);
...
...
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
View file @
169f3346
...
...
@@ -885,7 +885,7 @@ abort();
rb_table_index
=
UE_template
->
pre_allocated_rb_table_index_ul
;
}
else
{
mcs
=
10
;
//cmin (10, openair_daq_vars.target_ue_ul_mcs);
rb_table_index
=
5
;
// for PHR
rb_table_index
=
13
;
// for PHR
}
UE_list
->
eNB_UE_stats
[
CC_id
][
UE_id
].
ulsch_mcs2
=
mcs
;
...
...
openair2/LAYER2/MAC/flexran_agent_mac_proto.h
View file @
169f3346
...
...
@@ -168,6 +168,14 @@ void _dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id,
void
flexran_schedule_ue_spec_default
(
mid_t
mod_id
,
uint32_t
frame
,
uint32_t
subframe
,
int
*
mbsfn_flag
,
Protocol__FlexranMessage
**
dl_info
);
/*
Uplink scheduler used by MAC agent
*/
void
flexran_agent_schedule_ulsch_ue_spec
(
module_id_t
module_idP
,
frame_t
frameP
,
unsigned
char
cooperation_flag
,
sub_frame_t
subframeP
,
unsigned
char
sched_subframe
);
/*
* Data plane function for applying the DL decisions of the scheduler
*/
...
...
openair2/LAYER2/MAC/flexran_agent_scheduler_ulsch_ue.c
0 → 100644
View file @
169f3346
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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