Commit 5e0088fa authored by Robert Schmidt's avatar Robert Schmidt

Simplify RRC FlexRAN agent interface

parent 33d0ac49
......@@ -36,9 +36,6 @@
/*Trigger boolean for RRC measurement*/
bool triggered_rrc = false;
/*Flags showing if an rrc agent has already been registered*/
unsigned int rrc_agent_registered[NUM_MAX_ENB];
/*Array containing the Agent-RRC interfaces*/
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
......@@ -643,9 +640,15 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
}
int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface) {
if (rrc_agent_registered[mod_id]) {
LOG_E(RRC, "RRC agent for eNB %d is already registered\n", mod_id);
int flexran_agent_register_rrc_xface(mid_t mod_id)
{
if (agent_rrc_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "RRC agent for eNB %d is already registered\n", mod_id);
return -1;
}
AGENT_RRC_xface *xface = malloc(sizeof(AGENT_RRC_xface));
if (!xface) {
LOG_E(FLEXRAN_AGENT, "could not allocate memory for RRC agent xface %d\n", mod_id);
return -1;
}
......@@ -654,21 +657,29 @@ int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface) {
xface->flexran_agent_notify_ue_state_change = flexran_agent_ue_state_change;
xface->flexran_trigger_rrc_measurements = flexran_trigger_rrc_measurements;
rrc_agent_registered[mod_id] = 1;
agent_rrc_xface[mod_id] = xface;
return 0;
}
int flexran_agent_unregister_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface) {
int flexran_agent_unregister_rrc_xface(mid_t mod_id)
{
if (!agent_rrc_xface[mod_id]) {
LOG_E(FLEXRAN_AGENT, "RRC agent for eNB %d is not registered\n", mod_id);
return -1;
}
//xface->agent_ctxt = NULL;
// xface->flexran_agent_send_update_rrc_stats = NULL;
xface->flexran_agent_notify_ue_state_change = NULL;
xface->flexran_trigger_rrc_measurements = NULL;
rrc_agent_registered[mod_id] = 0;
agent_rrc_xface[mod_id]->flexran_agent_notify_ue_state_change = NULL;
agent_rrc_xface[mod_id]->flexran_trigger_rrc_measurements = NULL;
free(agent_rrc_xface[mod_id]);
agent_rrc_xface[mod_id] = NULL;
return 0;
}
AGENT_RRC_xface *flexran_agent_get_rrc_xface(mid_t mod_id)
{
return agent_rrc_xface[mod_id];
}
......@@ -37,11 +37,10 @@
#include "flexran_agent_common.h"
#include "flexran_agent_rrc_defs.h"
// for flexran_agent_get_rrc_xface()
#include "flexran_agent_extern.h"
/* Initialization function for the agent structures etc */
void flexran_agent_init_rrc_agent(mid_t mod_id);
/* UE state change message constructor and destructor */
void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change);
int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg);
......@@ -62,9 +61,9 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, const report_config_t *report_co
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexranMessage *msg);
/*Register technology specific interface callbacks*/
int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface);
int flexran_agent_register_rrc_xface(mid_t mod_id);
/*Unregister technology specific callbacks*/
int flexran_agent_unregister_rrc_xface(mid_t mod_id, AGENT_RRC_xface*xface);
int flexran_agent_unregister_rrc_xface(mid_t mod_id);
#endif
......@@ -39,10 +39,7 @@
AGENT_MAC_xface *flexran_agent_get_mac_xface(mid_t mod_id);
/* Control module interface for the communication of the RRC Control Module with the agent */
extern AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
/* Flag indicating whether the VSFs for the RRC control module have been registered */
extern unsigned int rrc_agent_registered[NUM_MAX_ENB];
AGENT_RRC_xface *flexran_agent_get_rrc_xface(mid_t mod_id);
/* Control module interface for the communication of the RRC Control Module with the agent */
extern AGENT_PDCP_xface *agent_pdcp_xface[NUM_MAX_ENB];
......
......@@ -416,9 +416,9 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1;
//Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
if (rrc_agent_registered[module_idP]) {
if (flexran_agent_get_rrc_xface(module_idP)) {
LOG_W(MAC, "notify flexran Agent of UE state change\n");
agent_rrc_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP,
flexran_agent_get_rrc_xface(module_idP)->flexran_agent_notify_ue_state_change(module_idP,
rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
}
}
......
......@@ -386,10 +386,9 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
else {
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
}
if (rrc_agent_registered[Mod_instP]) {
agent_rrc_xface[Mod_instP]->flexran_agent_notify_ue_state_change(Mod_instP,
rntiP,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
if (flexran_agent_get_rrc_xface(Mod_instP)) {
flexran_agent_get_rrc_xface(Mod_instP)->flexran_agent_notify_ue_state_change(Mod_instP,
rntiP, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
}
rrc_mac_remove_ue(Mod_instP,rntiP);
}
......
......@@ -1038,8 +1038,8 @@ void release_UE_in_freeList(module_id_t mod_id)
}
}
if (rrc_agent_registered[mod_id]) {
agent_rrc_xface[mod_id]->flexran_agent_notify_ue_state_change(mod_id,
if (flexran_agent_get_rrc_xface(mod_id)) {
flexran_agent_get_rrc_xface(mod_id)->flexran_agent_notify_ue_state_change(mod_id,
rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
}
......@@ -6578,8 +6578,8 @@ rrc_eNB_decode_ccch(
} else {
// no context available
if (rrc_agent_registered[ctxt_pP->module_id]) {
agent_rrc_xface[ctxt_pP->module_id]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
if (flexran_agent_get_rrc_xface(ctxt_pP->module_id)) {
flexran_agent_get_rrc_xface(ctxt_pP->module_id)->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
ctxt_pP->rnti,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
}
......@@ -6869,8 +6869,8 @@ rrc_eNB_decode_dcch(
ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
//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]) {
agent_rrc_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
if (flexran_agent_get_rrc_xface(ctxt_pP->module_id)) {
flexran_agent_get_rrc_xface(ctxt_pP->module_id)->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
ue_context_p->ue_id_rnti,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED);
}
......@@ -7022,8 +7022,8 @@ 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.criticalExtensions.choice.rrcConnectionReestablishmentComplete_r8);
if (rrc_agent_registered[ctxt_pP->module_id]) {
agent_rrc_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
if (flexran_agent_get_rrc_xface(ctxt_pP->module_id)) {
flexran_agent_get_rrc_xface(ctxt_pP->module_id)->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
ue_context_p->ue_id_rnti,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED);
}
......@@ -7090,8 +7090,8 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
}
//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]) {
agent_rrc_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
if (flexran_agent_get_rrc_xface(ctxt_pP->module_id)) {
flexran_agent_get_rrc_xface(ctxt_pP->module_id)->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
ue_context_p->ue_id_rnti,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment