From 0d2881ad5831956816776210769bf28b4e3b8239 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 14 May 2011 11:32:48 +0200 Subject: 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 --- openbsc/include/openbsc/bss.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 openbsc/include/openbsc/bss.h (limited to 'openbsc/include/openbsc/bss.h') diff --git a/openbsc/include/openbsc/bss.h b/openbsc/include/openbsc/bss.h new file mode 100644 index 000000000..05495ddcb --- /dev/null +++ b/openbsc/include/openbsc/bss.h @@ -0,0 +1,17 @@ +#ifndef _BSS_H_ +#define _BSS_H_ + +struct gsm_network; +struct msgb; + +/* start and stop network */ +extern int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), const char *cfg_file); +extern int bsc_shutdown_net(struct gsm_network *net); + +/* register all supported BTS */ +extern int bts_init(void); +extern int bts_model_bs11_init(void); +extern int bts_model_rbs2k_init(void); +extern int bts_model_nanobts_init(void); +extern int bts_model_hslfemto_init(void); +#endif -- cgit v1.2.3