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
33d0ac49
Commit
33d0ac49
authored
Oct 24, 2018
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify MAC FlexRAN agent interface
parent
608a1459
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
44 deletions
+39
-44
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
+20
-14
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h
+4
-2
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
.../ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
+8
-8
openair2/ENB_APP/flexran_agent.c
openair2/ENB_APP/flexran_agent.c
+4
-12
openair2/ENB_APP/flexran_agent_common_internal.c
openair2/ENB_APP/flexran_agent_common_internal.c
+1
-1
openair2/ENB_APP/flexran_agent_extern.h
openair2/ENB_APP/flexran_agent_extern.h
+1
-4
openair2/ENB_APP/flexran_agent_handler.c
openair2/ENB_APP/flexran_agent_handler.c
+0
-1
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+1
-2
No files found.
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
View file @
33d0ac49
...
@@ -40,9 +40,6 @@
...
@@ -40,9 +40,6 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
/*Flags showing if a mac agent has already been registered*/
unsigned
int
mac_agent_registered
[
NUM_MAX_ENB
];
/*Array containing the Agent-MAC interfaces*/
/*Array containing the Agent-MAC interfaces*/
AGENT_MAC_xface
*
agent_mac_xface
[
NUM_MAX_ENB
];
AGENT_MAC_xface
*
agent_mac_xface
[
NUM_MAX_ENB
];
...
@@ -1336,11 +1333,17 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
...
@@ -1336,11 +1333,17 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
int
flexran_agent_register_mac_xface
(
mid_t
mod_id
,
AGENT_MAC_xface
*
xface
)
{
int
flexran_agent_register_mac_xface
(
mid_t
mod_id
)
if
(
mac_agent_registered
[
mod_id
])
{
{
if
(
agent_mac_xface
[
mod_id
])
{
LOG_E
(
MAC
,
"MAC agent for eNB %d is already registered
\n
"
,
mod_id
);
LOG_E
(
MAC
,
"MAC agent for eNB %d is already registered
\n
"
,
mod_id
);
return
-
1
;
return
-
1
;
}
}
AGENT_MAC_xface
*
xface
=
malloc
(
sizeof
(
AGENT_MAC_xface
));
if
(
!
xface
)
{
LOG_E
(
FLEXRAN_AGENT
,
"could not allocate memory for MAC agent xface %d
\n
"
,
mod_id
);
return
-
1
;
}
//xface->agent_ctxt = &shared_ctxt[mod_id];
//xface->agent_ctxt = &shared_ctxt[mod_id];
xface
->
flexran_agent_send_sr_info
=
flexran_agent_send_sr_info
;
xface
->
flexran_agent_send_sr_info
=
flexran_agent_send_sr_info
;
...
@@ -1350,14 +1353,18 @@ int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
...
@@ -1350,14 +1353,18 @@ int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
xface
->
dl_scheduler_loaded_lib
=
NULL
;
xface
->
dl_scheduler_loaded_lib
=
NULL
;
xface
->
ul_scheduler_loaded_lib
=
NULL
;
xface
->
ul_scheduler_loaded_lib
=
NULL
;
mac_agent_registered
[
mod_id
]
=
1
;
agent_mac_xface
[
mod_id
]
=
xface
;
agent_mac_xface
[
mod_id
]
=
xface
;
return
0
;
return
0
;
}
}
int
flexran_agent_unregister_mac_xface
(
mid_t
mod_id
,
AGENT_MAC_xface
*
xface
)
{
int
flexran_agent_unregister_mac_xface
(
mid_t
mod_id
)
{
if
(
!
agent_mac_xface
[
mod_id
])
{
LOG_E
(
FLEXRAN_AGENT
,
"MAC agent CM for eNB %d is not registered
\n
"
,
mod_id
);
return
-
1
;
}
AGENT_MAC_xface
*
xface
=
agent_mac_xface
[
mod_id
];
//xface->agent_ctxt = NULL;
//xface->agent_ctxt = NULL;
xface
->
flexran_agent_send_sr_info
=
NULL
;
xface
->
flexran_agent_send_sr_info
=
NULL
;
xface
->
flexran_agent_send_sf_trigger
=
NULL
;
xface
->
flexran_agent_send_sf_trigger
=
NULL
;
...
@@ -1366,14 +1373,13 @@ int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
...
@@ -1366,14 +1373,13 @@ int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface) {
xface
->
dl_scheduler_loaded_lib
=
NULL
;
xface
->
dl_scheduler_loaded_lib
=
NULL
;
xface
->
ul_scheduler_loaded_lib
=
NULL
;
xface
->
ul_scheduler_loaded_lib
=
NULL
;
mac_agent_registered
[
mod_id
]
=
0
;
free
(
xface
)
;
agent_mac_xface
[
mod_id
]
=
NULL
;
agent_mac_xface
[
mod_id
]
=
NULL
;
return
0
;
return
0
;
}
}
AGENT_MAC_xface
*
flexran_agent_get_mac_xface
(
mid_t
mod_id
)
{
return
agent_mac_xface
[
mod_id
];
}
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h
View file @
33d0ac49
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
#include "flexran_agent_common.h"
#include "flexran_agent_common.h"
#include "flexran_agent_extern.h"
#include "flexran_agent_extern.h"
// for flexran_agent_get_mac_xface()
#include "flexran_agent_extern.h"
/* Initialization function for the agent structures etc */
/* Initialization function for the agent structures etc */
...
@@ -82,9 +84,9 @@ void flexran_agent_send_update_mac_stats(mid_t mod_id);
...
@@ -82,9 +84,9 @@ void flexran_agent_send_update_mac_stats(mid_t mod_id);
void
flexran_agent_get_pending_dl_mac_config
(
mid_t
mod_id
,
Protocol__FlexranMessage
**
msg
);
void
flexran_agent_get_pending_dl_mac_config
(
mid_t
mod_id
,
Protocol__FlexranMessage
**
msg
);
/*Register technology specific interface callbacks*/
/*Register technology specific interface callbacks*/
int
flexran_agent_register_mac_xface
(
mid_t
mod_id
,
AGENT_MAC_xface
*
xface
);
int
flexran_agent_register_mac_xface
(
mid_t
mod_id
);
/*Unregister technology specific callbacks*/
/*Unregister technology specific callbacks*/
int
flexran_agent_unregister_mac_xface
(
mid_t
mod_id
,
AGENT_MAC_xface
*
xface
);
int
flexran_agent_unregister_mac_xface
(
mid_t
mod_id
);
#endif
#endif
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
View file @
33d0ac49
...
@@ -781,9 +781,9 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
...
@@ -781,9 +781,9 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
goto
error
;
goto
error
;
}
}
// Check what key needs to be set
// Check what key needs to be set
if
(
mac_agent_registered
[
mod_id
]
)
{
if
(
flexran_agent_get_mac_xface
(
mod_id
)
)
{
LOG_D
(
ENB_APP
,
"Setting parameter %s
\n
"
,
event
.
data
.
scalar
.
value
);
LOG_D
(
ENB_APP
,
"Setting parameter %s
\n
"
,
event
.
data
.
scalar
.
value
);
param
=
dlsym
(
agent_mac_xface
[
mod_id
]
->
dl_scheduler_loaded_lib
,
param
=
dlsym
(
flexran_agent_get_mac_xface
(
mod_id
)
->
dl_scheduler_loaded_lib
,
(
char
*
)
event
.
data
.
scalar
.
value
);
(
char
*
)
event
.
data
.
scalar
.
value
);
if
(
param
==
NULL
)
{
if
(
param
==
NULL
)
{
goto
error
;
goto
error
;
...
@@ -836,9 +836,9 @@ int parse_ul_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
...
@@ -836,9 +836,9 @@ int parse_ul_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
goto
error
;
goto
error
;
}
}
// Check what key needs to be set
// Check what key needs to be set
if
(
mac_agent_registered
[
mod_id
]
)
{
if
(
flexran_agent_get_mac_xface
(
mod_id
)
)
{
LOG_D
(
ENB_APP
,
"Setting parameter %s
\n
"
,
event
.
data
.
scalar
.
value
);
LOG_D
(
ENB_APP
,
"Setting parameter %s
\n
"
,
event
.
data
.
scalar
.
value
);
param
=
dlsym
(
agent_mac_xface
[
mod_id
]
->
ul_scheduler_loaded_lib
,
param
=
dlsym
(
flexran_agent_get_mac_xface
(
mod_id
)
->
ul_scheduler_loaded_lib
,
(
char
*
)
event
.
data
.
scalar
.
value
);
(
char
*
)
event
.
data
.
scalar
.
value
);
if
(
param
==
NULL
)
{
if
(
param
==
NULL
)
{
goto
error
;
goto
error
;
...
@@ -882,11 +882,11 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name) {
...
@@ -882,11 +882,11 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name) {
LOG_I
(
FLEXRAN_AGENT
,
"Loading function: %s
\n
"
,
function_name
);
LOG_I
(
FLEXRAN_AGENT
,
"Loading function: %s
\n
"
,
function_name
);
void
*
loaded_scheduler
=
dlsym
(
lib
,
function_name
);
void
*
loaded_scheduler
=
dlsym
(
lib
,
function_name
);
if
(
loaded_scheduler
)
{
if
(
loaded_scheduler
)
{
if
(
mac_agent_registered
[
mod_id
]
)
{
if
(
flexran_agent_get_mac_xface
(
mod_id
)
)
{
if
(
agent_mac_xface
[
mod_id
]
->
dl_scheduler_loaded_lib
!=
NULL
)
{
if
(
flexran_agent_get_mac_xface
(
mod_id
)
->
dl_scheduler_loaded_lib
!=
NULL
)
{
dlclose
(
agent_mac_xface
[
mod_id
]
->
dl_scheduler_loaded_lib
);
dlclose
(
flexran_agent_get_mac_xface
(
mod_id
)
->
dl_scheduler_loaded_lib
);
}
}
agent_mac_xface
[
mod_id
]
->
dl_scheduler_loaded_lib
=
lib
;
flexran_agent_get_mac_xface
(
mod_id
)
->
dl_scheduler_loaded_lib
=
lib
;
LOG_I
(
FLEXRAN_AGENT
,
"New DL UE scheduler: %s
\n
"
,
function_name
);
LOG_I
(
FLEXRAN_AGENT
,
"New DL UE scheduler: %s
\n
"
,
function_name
);
}
}
}
else
{
}
else
{
...
...
openair2/ENB_APP/flexran_agent.c
View file @
33d0ac49
...
@@ -230,14 +230,11 @@ int flexran_agent_start(mid_t mod_id)
...
@@ -230,14 +230,11 @@ int flexran_agent_start(mid_t mod_id)
new_thread
(
receive_thread
,
flexran
);
new_thread
(
receive_thread
,
flexran
);
/*Initialize and register the mac xface. Must be modified later
/* Register and initialize the control modules */
*for more flexibility in agent management */
flexran_agent_register_mac_xface
(
mod_id
);
flexran_agent_init_mac_agent
(
mod_id
);
AGENT_MAC_xface
*
mac_agent_xface
=
(
AGENT_MAC_xface
*
)
malloc
(
sizeof
(
AGENT_MAC_xface
));
flexran_agent_register_rrc_xface
(
mod_id
);
flexran_agent_register_mac_xface
(
mod_id
,
mac_agent_xface
);
AGENT_RRC_xface
*
rrc_agent_xface
=
(
AGENT_RRC_xface
*
)
malloc
(
sizeof
(
AGENT_RRC_xface
));
flexran_agent_register_rrc_xface
(
mod_id
,
rrc_agent_xface
);
AGENT_PDCP_xface
*
pdcp_agent_xface
=
(
AGENT_PDCP_xface
*
)
malloc
(
sizeof
(
AGENT_PDCP_xface
));
AGENT_PDCP_xface
*
pdcp_agent_xface
=
(
AGENT_PDCP_xface
*
)
malloc
(
sizeof
(
AGENT_PDCP_xface
));
flexran_agent_register_pdcp_xface
(
mod_id
,
pdcp_agent_xface
);
flexran_agent_register_pdcp_xface
(
mod_id
,
pdcp_agent_xface
);
...
@@ -248,11 +245,6 @@ int flexran_agent_start(mid_t mod_id)
...
@@ -248,11 +245,6 @@ int flexran_agent_start(mid_t mod_id)
flexran_agent_init_timer
();
flexran_agent_init_timer
();
/*
* Initialize the mac agent
*/
flexran_agent_init_mac_agent
(
mod_id
);
/*
/*
* start the enb agent task for tx and interaction with the underlying network function
* start the enb agent task for tx and interaction with the underlying network function
*/
*/
...
...
openair2/ENB_APP/flexran_agent_common_internal.c
View file @
33d0ac49
...
@@ -209,7 +209,7 @@ int parse_enb_id(mid_t mod_id, yaml_parser_t *parser) {
...
@@ -209,7 +209,7 @@ int parse_enb_id(mid_t mod_id, yaml_parser_t *parser) {
}
}
// Check what key needs to be set
// Check what key needs to be set
// use eNB egistered
// use eNB egistered
if
(
mac_agent_registered
[
mod_id
]
)
{
if
(
flexran_agent_get_mac_xface
(
mod_id
)
)
{
LOG_I
(
ENB_APP
,
"Setting parameter for eNB %s
\n
"
,
event
.
data
.
scalar
.
value
);
LOG_I
(
ENB_APP
,
"Setting parameter for eNB %s
\n
"
,
event
.
data
.
scalar
.
value
);
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
tag
,
YAML_INT_TAG
)
==
0
)
{
// if int
if
(
strcmp
((
char
*
)
event
.
data
.
scalar
.
tag
,
YAML_INT_TAG
)
==
0
)
{
// if int
if
((
strtol
((
char
*
)
event
.
data
.
scalar
.
value
,
&
endptr
,
10
))
==
mod_id
)
{
// enb_id == mod_id: right enb instance to be configured
if
((
strtol
((
char
*
)
event
.
data
.
scalar
.
value
,
&
endptr
,
10
))
==
mod_id
)
{
// enb_id == mod_id: right enb instance to be configured
...
...
openair2/ENB_APP/flexran_agent_extern.h
View file @
33d0ac49
...
@@ -36,10 +36,7 @@
...
@@ -36,10 +36,7 @@
#include "flexran_agent_pdcp_defs.h"
#include "flexran_agent_pdcp_defs.h"
/* Control module interface for the communication of the MAC Control Module with the agent */
/* Control module interface for the communication of the MAC Control Module with the agent */
extern
AGENT_MAC_xface
*
agent_mac_xface
[
NUM_MAX_ENB
];
AGENT_MAC_xface
*
flexran_agent_get_mac_xface
(
mid_t
mod_id
);
/* Flag indicating whether the VSFs for the MAC control module have been registered */
extern
unsigned
int
mac_agent_registered
[
NUM_MAX_ENB
];
/* Control module interface for the communication of the RRC Control Module with the agent */
/* Control module interface for the communication of the RRC Control Module with the agent */
extern
AGENT_RRC_xface
*
agent_rrc_xface
[
NUM_MAX_ENB
];
extern
AGENT_RRC_xface
*
agent_rrc_xface
[
NUM_MAX_ENB
];
...
...
openair2/ENB_APP/flexran_agent_handler.c
View file @
33d0ac49
...
@@ -769,6 +769,5 @@ err_code_t flexran_agent_destroy_cont_stats_update(mid_t mod_id) {
...
@@ -769,6 +769,5 @@ err_code_t flexran_agent_destroy_cont_stats_update(mid_t mod_id) {
flexran_agent_destroy_flexran_message
(
stats_context
[
mod_id
].
prev_stats_reply
);
flexran_agent_destroy_flexran_message
(
stats_context
[
mod_id
].
prev_stats_reply
);
free
(
stats_context
[
mod_id
].
mutex
);
free
(
stats_context
[
mod_id
].
mutex
);
// mac_agent_registered[mod_id] = 0;
return
1
;
return
1
;
}
}
openair2/RRC/LTE/rrc_eNB.c
View file @
33d0ac49
...
@@ -7022,8 +7022,7 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
...
@@ -7022,8 +7022,7 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
ul_dcch_msg
->
message
.
choice
.
c1
.
choice
.
rrcConnectionReestablishmentComplete
.
rrc_TransactionIdentifier
,
ul_dcch_msg
->
message
.
choice
.
c1
.
choice
.
rrcConnectionReestablishmentComplete
.
rrc_TransactionIdentifier
,
&
ul_dcch_msg
->
message
.
choice
.
c1
.
choice
.
rrcConnectionReestablishmentComplete
.
criticalExtensions
.
choice
.
rrcConnectionReestablishmentComplete_r8
);
&
ul_dcch_msg
->
message
.
choice
.
c1
.
choice
.
rrcConnectionReestablishmentComplete
.
criticalExtensions
.
choice
.
rrcConnectionReestablishmentComplete_r8
);
//WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future
if
(
rrc_agent_registered
[
ctxt_pP
->
module_id
])
{
if
(
mac_agent_registered
[
ctxt_pP
->
module_id
])
{
agent_rrc_xface
[
ctxt_pP
->
eNB_index
]
->
flexran_agent_notify_ue_state_change
(
ctxt_pP
->
module_id
,
agent_rrc_xface
[
ctxt_pP
->
eNB_index
]
->
flexran_agent_notify_ue_state_change
(
ctxt_pP
->
module_id
,
ue_context_p
->
ue_id_rnti
,
ue_context_p
->
ue_id_rnti
,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED
);
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED
);
...
...
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