Commit e8af3bd4 authored by Robert Schmidt's avatar Robert Schmidt

Selectively load FlexRAN CMs depending on BS capability

parent c81535a8
......@@ -230,15 +230,41 @@ int flexran_agent_start(mid_t mod_id)
new_thread(receive_thread, flexran);
/* Register and initialize the control modules */
flexran_agent_register_phy_xface(mod_id);
/* Register and initialize the control modules depending on capabilities.
* After registering, calling flexran_agent_get_*_xface() tells whether a
* control module is operational */
uint16_t caps = flexran_get_capabilities_mask(mod_id);
LOG_I(FLEXRAN_AGENT, "Agent handles BS ID %ld, capabilities=0x%x => handling%s%s%s%s%s%s%s%s\n",
flexran_get_bs_id(mod_id), caps,
FLEXRAN_CAP_LOPHY(caps) ? " LOPHY" : "",
FLEXRAN_CAP_HIPHY(caps) ? " HIPHY" : "",
FLEXRAN_CAP_LOMAC(caps) ? " LOMAC" : "",
FLEXRAN_CAP_HIMAC(caps) ? " HIMAC" : "",
FLEXRAN_CAP_RLC(caps) ? " RLC" : "",
FLEXRAN_CAP_PDCP(caps) ? " PDCP" : "",
FLEXRAN_CAP_SDAP(caps) ? " SDAP" : "",
FLEXRAN_CAP_RRC(caps) ? " RRC" : "");
if (FLEXRAN_CAP_LOPHY(caps) || FLEXRAN_CAP_HIPHY(caps)) {
flexran_agent_register_phy_xface(mod_id);
LOG_I(FLEXRAN_AGENT, "registered PHY interface/CM for eNB %d\n", mod_id);
}
flexran_agent_register_mac_xface(mod_id);
flexran_agent_init_mac_agent(mod_id);
if (FLEXRAN_CAP_LOMAC(caps) || FLEXRAN_CAP_HIMAC(caps)) {
flexran_agent_register_mac_xface(mod_id);
flexran_agent_init_mac_agent(mod_id);
LOG_I(FLEXRAN_AGENT, "registered MAC interface/CM for eNB %d\n", mod_id);
}
flexran_agent_register_rrc_xface(mod_id);
if (FLEXRAN_CAP_RRC(caps)) {
flexran_agent_register_rrc_xface(mod_id);
LOG_I(FLEXRAN_AGENT, "registered RRC interface/CM for eNB %d\n", mod_id);
}
flexran_agent_register_pdcp_xface(mod_id);
if (FLEXRAN_CAP_PDCP(caps)) {
flexran_agent_register_pdcp_xface(mod_id);
LOG_I(FLEXRAN_AGENT, "registered PDCP interface/CM for eNB %d\n", mod_id);
}
/*
* initilize a timer
......
......@@ -138,14 +138,14 @@ typedef enum {
FLEXRAN_AGENT_TIMER_STATE_MAX,
} flexran_agent_timer_state_t;
#define FLEXRAN_CAP_LOPHY 1
#define FLEXRAN_CAP_HIPHY 2
#define FLEXRAN_CAP_LOMAC 4
#define FLEXRAN_CAP_HIMAC 8
#define FLEXRAN_CAP_RLC 16
#define FLEXRAN_CAP_PDCP 32
#define FLEXRAN_CAP_SDAP 64
#define FLEXRAN_CAP_RRC 128
#define FLEXRAN_CAP_LOPHY(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__LOPHY)) > 0)
#define FLEXRAN_CAP_HIPHY(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__HIPHY)) > 0)
#define FLEXRAN_CAP_LOMAC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__LOMAC)) > 0)
#define FLEXRAN_CAP_HIMAC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__HIMAC)) > 0)
#define FLEXRAN_CAP_RLC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__RLC)) > 0)
#define FLEXRAN_CAP_PDCP(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__PDCP)) > 0)
#define FLEXRAN_CAP_SDAP(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__SDAP)) > 0)
#define FLEXRAN_CAP_RRC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__RRC)) > 0)
typedef enum {
ENB_NORMAL_OPERATION = 0x0,
......
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