Simplify PDCP FlexRAN agent interface
This commit is contained in:
@@ -28,12 +28,6 @@
|
||||
|
||||
#include "flexran_agent_pdcp.h"
|
||||
|
||||
|
||||
/*Trigger boolean for PDCP measurement*/
|
||||
bool triggered_pdcp = false;
|
||||
/*Flags showing if a pdcp agent has already been registered*/
|
||||
unsigned int pdcp_agent_registered[NUM_MAX_ENB];
|
||||
|
||||
/*Array containing the Agent-PDCP interfaces*/
|
||||
AGENT_PDCP_xface *agent_pdcp_xface[NUM_MAX_ENB];
|
||||
|
||||
@@ -144,28 +138,41 @@ int flexran_agent_pdcp_stats_reply(mid_t mod_id,
|
||||
|
||||
|
||||
|
||||
int flexran_agent_register_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface *xface) {
|
||||
if (pdcp_agent_registered[mod_id]) {
|
||||
LOG_E(PDCP, "PDCP agent for eNB %d is already registered\n", mod_id);
|
||||
int flexran_agent_register_pdcp_xface(mid_t mod_id)
|
||||
{
|
||||
if (agent_pdcp_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "PDCP agent CM for eNB %d is already registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
AGENT_PDCP_xface *xface = malloc(sizeof(AGENT_PDCP_xface));
|
||||
if (!xface) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not allocate memory for PDCP agent xface %d\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//xface->flexran_pdcp_stats_measurement = NULL;
|
||||
|
||||
pdcp_agent_registered[mod_id] = 1;
|
||||
agent_pdcp_xface[mod_id] = xface;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_unregister_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface *xface) {
|
||||
|
||||
int flexran_agent_unregister_pdcp_xface(mid_t mod_id)
|
||||
{
|
||||
if (!agent_pdcp_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "PDCP agent CM for eNB %d is not registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
//xface->agent_ctxt = NULL;
|
||||
//xface->flexran_pdcp_stats_measurement = NULL;
|
||||
|
||||
|
||||
pdcp_agent_registered[mod_id] = 0;
|
||||
free(agent_pdcp_xface[mod_id]);
|
||||
agent_pdcp_xface[mod_id] = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AGENT_PDCP_xface *flexran_agent_get_pdcp_xface(mid_t mod_id)
|
||||
{
|
||||
return agent_pdcp_xface[mod_id];
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_pdcp_defs.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
// for flexran_agent_get_pdcp_xface()
|
||||
#include "flexran_agent_extern.h"
|
||||
|
||||
/**********************************
|
||||
* FlexRAN agent - technology PDCP API
|
||||
@@ -56,9 +58,9 @@ void flexran_agent_pdcp_aggregate_stats(const mid_t mod_id,
|
||||
Protocol__FlexPdcpStats *pdcp_aggr_stats);
|
||||
|
||||
/*Register technology specific interface callbacks*/
|
||||
int flexran_agent_register_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface *xface);
|
||||
int flexran_agent_register_pdcp_xface(mid_t mod_id);
|
||||
|
||||
/*Unregister technology specific callbacks*/
|
||||
int flexran_agent_unregister_pdcp_xface(mid_t mod_id, AGENT_PDCP_xface*xface);
|
||||
int flexran_agent_unregister_pdcp_xface(mid_t mod_id);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -236,8 +236,7 @@ int flexran_agent_start(mid_t mod_id)
|
||||
|
||||
flexran_agent_register_rrc_xface(mod_id);
|
||||
|
||||
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);
|
||||
|
||||
/*
|
||||
* initilize a timer
|
||||
|
||||
@@ -42,10 +42,7 @@ AGENT_MAC_xface *flexran_agent_get_mac_xface(mid_t mod_id);
|
||||
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];
|
||||
|
||||
/* Flag indicating whether the VSFs for the RRC control module have been registered */
|
||||
extern unsigned int pdcp_agent_registered[NUM_MAX_ENB];
|
||||
AGENT_PDCP_xface *flexran_agent_get_pdcp_xface(mid_t mod_id);
|
||||
|
||||
/* Requried to know which UEs had a harq updated over some subframe */
|
||||
extern int harq_pid_updated[NUM_MAX_UE][8];
|
||||
|
||||
Reference in New Issue
Block a user