aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bts_ericsson_rbs2000.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-05-14 11:32:48 +0200
committerHarald Welte <laforge@gnumonks.org>2011-05-22 21:03:35 +0200
commit0d2881ad5831956816776210769bf28b4e3b8239 (patch)
treef6a247409a1528af4cc970274bd9c1e5fc02b42d /openbsc/src/libbsc/bts_ericsson_rbs2000.c
parentc68f754b3b39142fadce1cc7a85624551b68e5d3 (diff)
bsc: on-demand setup of nanoBTS and HSL femto sockets
The daemons set up nanoBTS and HSL femto sockets by default, ie. the three sockets to support these two drivers are open even if we have no BTS of that kind. This patch enables on-demand socket creation, ie. we only enable them if we have one BTS at least that requires it. I added two new attributes to the gsm_bts object, they are: * the start() function includes the code that we need to run to start the BTS. This new function contains the socket creation in the particular case of nanoBTS and HSL femto. * the started boolean, which is used to know if we have already started the BTS, ie. we have already invoked start(). Note that, I have splitted the bts_model_*_init() function into two functions, the _init() functions that register the BTS driver and the _start() functions that start BTS driver on-demand. While I was at it, I added several changes/cleanups to this patch: * Group all bts_model_*_init() calls into one function bts_init(), which is called in the initialization path of osmo-nitb and osmo-bsc. * Add openbsc/bss.h that contains the declaration of bsc_bootstrap_network, bsc_shutdown_net and bts_init. * Add missing e1inp_init() in osmo-bsc. * Fix missing declaration of hsl_setup in openbsc/e1_input.h
Diffstat (limited to 'openbsc/src/libbsc/bts_ericsson_rbs2000.c')
-rw-r--r--openbsc/src/libbsc/bts_ericsson_rbs2000.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c
index c2ae0e7ae..9c98a9fef 100644
--- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c
+++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c
@@ -242,14 +242,17 @@ static void config_write_bts(struct vty *vty, struct gsm_bts *bts)
abis_om2k_config_write_bts(vty, bts);
}
+static int bts_model_rbs2k_start(struct gsm_network *net);
+
static struct gsm_bts_model model_rbs2k = {
.type = GSM_BTS_TYPE_RBS2000,
.name = "rbs2000",
+ .start = bts_model_rbs2k_start,
.oml_rcvmsg = &abis_om2k_rcvmsg,
.config_write_bts = &config_write_bts,
};
-int bts_model_rbs2k_init(void)
+static int bts_model_rbs2k_start(struct gsm_network *net)
{
model_rbs2k.features.data = &model_rbs2k._features_data[0];
model_rbs2k.features.data_len = sizeof(model_rbs2k._features_data);
@@ -261,5 +264,10 @@ int bts_model_rbs2k_init(void)
osmo_signal_register_handler(SS_GLOBAL, gbl_sig_cb, NULL);
osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL);
+ return 0;
+}
+
+int bts_model_rbs2k_init(void)
+{
return gsm_bts_model_register(&model_rbs2k);
}