diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-07-02 19:51:55 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-07-02 20:13:08 +0200 |
commit | f383aa11a5f87ca54b693196e6d4f6df6a41b57c (patch) | |
tree | 7a04eeb59d97b0506c6e6b7e242afac9b29a59d0 /openbsc/src/libbsc/bts_sysmobts.c | |
parent | 0c1bd61bb3ef6dc7b3be3023f2c292b70e84626c (diff) |
BSC: introduce new "sysmobts" BTS model
so far, osmo-bts/sysmobts used to be entered as "sysmobts" type in the
configuration file. However, there are some differences in the
protocol/behaviour and we should reflect that by a new BTS plugin (with
lots of code reuse from the nanobts driver).
Diffstat (limited to 'openbsc/src/libbsc/bts_sysmobts.c')
-rw-r--r-- | openbsc/src/libbsc/bts_sysmobts.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bts_sysmobts.c b/openbsc/src/libbsc/bts_sysmobts.c new file mode 100644 index 000000000..9479206d2 --- /dev/null +++ b/openbsc/src/libbsc/bts_sysmobts.c @@ -0,0 +1,71 @@ +/* sysmocom sysmoBTS specific code */ + +/* (C) 2010-2012 by Harald Welte <laforge@gnumonks.org> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <arpa/inet.h> + +#include <osmocom/gsm/tlv.h> + +#include <openbsc/gsm_data.h> +#include <openbsc/signal.h> +#include <openbsc/abis_nm.h> +#include <osmocom/abis/e1_input.h> +#include <osmocom/gsm/tlv.h> +#include <osmocom/core/msgb.h> +#include <osmocom/core/talloc.h> +#include <openbsc/gsm_data.h> +#include <openbsc/abis_nm.h> +#include <openbsc/abis_rsl.h> +#include <openbsc/debug.h> +#include <osmocom/abis/subchan_demux.h> +#include <osmocom/abis/ipaccess.h> +#include <osmocom/core/logging.h> + +extern int bts_ipa_nm_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data); + +extern struct gsm_bts_model bts_model_nanobts; + +static struct gsm_bts_model model_sysmobts; + +static int bts_model_sysmobts_start(struct gsm_network *net) +{ + model_sysmobts.features.data = &model_sysmobts._features_data[0]; + model_sysmobts.features.data_len = + sizeof(model_sysmobts._features_data); + + gsm_btsmodel_set_feature(&model_sysmobts, BTS_FEAT_GPRS); + gsm_btsmodel_set_feature(&model_sysmobts, BTS_FEAT_EGPRS); + + osmo_signal_register_handler(SS_NM, bts_ipa_nm_sig_cb, NULL); + + return 0; +} + +int bts_model_sysmobts_init(void) +{ + memcpy(&model_sysmobts, &bts_model_nanobts, sizeof(model_sysmobts)); + + model_sysmobts.name = "sysmobts"; + model_sysmobts.start = bts_model_sysmobts_start; + model_sysmobts.type = GSM_BTS_TYPE_OSMO_SYSMO; + + return gsm_bts_model_register(&model_sysmobts); +} |