diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2011-05-14 11:32:48 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-05-22 21:03:35 +0200 |
commit | 0d2881ad5831956816776210769bf28b4e3b8239 (patch) | |
tree | f6a247409a1528af4cc970274bd9c1e5fc02b42d /openbsc/include | |
parent | c68f754b3b39142fadce1cc7a85624551b68e5d3 (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/include')
-rw-r--r-- | openbsc/include/openbsc/Makefile.am | 3 | ||||
-rw-r--r-- | openbsc/include/openbsc/bss.h | 17 | ||||
-rw-r--r-- | openbsc/include/openbsc/e1_input.h | 1 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 3 |
4 files changed, 23 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 325d66d93..f87eca1c6 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -11,7 +11,8 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \ gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.h \ gprs_ns_frgre.h auth.h osmo_msc.h bsc_msc.h bsc_nat.h \ osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h \ - osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h + osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \ + bss.h openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h openbscdir = $(includedir)/openbsc 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 diff --git a/openbsc/include/openbsc/e1_input.h b/openbsc/include/openbsc/e1_input.h index 0eae5d9a2..0d79c7d1e 100644 --- a/openbsc/include/openbsc/e1_input.h +++ b/openbsc/include/openbsc/e1_input.h @@ -175,6 +175,7 @@ int e1_reconfig_bts(struct gsm_bts *bts); int ia_config_connect(struct gsm_bts *bts, struct sockaddr_in *sin); int ipaccess_setup(struct gsm_network *gsmnet); +int hsl_setup(struct gsm_network *gsmnet); extern struct llist_head e1inp_driver_list; extern struct llist_head e1inp_line_list; diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index bc276d1f7..c3cf104d8 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -1,6 +1,7 @@ #ifndef _GSM_DATA_H #define _GSM_DATA_H +#include <stdbool.h> struct osmo_msc_data; struct osmo_bsc_sccp_con; @@ -434,6 +435,8 @@ struct gsm_bts_model { enum gsm_bts_type type; const char *name; + bool started; + int (*start)(struct gsm_network *net); int (*oml_rcvmsg)(struct msgb *msg); void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); |