Harald Welte | f383aa1 | 2012-07-02 19:51:55 +0200 | [diff] [blame] | 1 | /* sysmocom sysmoBTS specific code */ |
| 2 | |
| 3 | /* (C) 2010-2012 by Harald Welte <laforge@gnumonks.org> |
| 4 | * |
| 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU Affero General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU Affero General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Affero General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <arpa/inet.h> |
| 23 | |
| 24 | #include <osmocom/gsm/tlv.h> |
| 25 | |
| 26 | #include <openbsc/gsm_data.h> |
| 27 | #include <openbsc/signal.h> |
| 28 | #include <openbsc/abis_nm.h> |
| 29 | #include <osmocom/abis/e1_input.h> |
| 30 | #include <osmocom/gsm/tlv.h> |
| 31 | #include <osmocom/core/msgb.h> |
| 32 | #include <osmocom/core/talloc.h> |
| 33 | #include <openbsc/gsm_data.h> |
| 34 | #include <openbsc/abis_nm.h> |
| 35 | #include <openbsc/abis_rsl.h> |
| 36 | #include <openbsc/debug.h> |
| 37 | #include <osmocom/abis/subchan_demux.h> |
| 38 | #include <osmocom/abis/ipaccess.h> |
| 39 | #include <osmocom/core/logging.h> |
| 40 | |
| 41 | extern int bts_ipa_nm_sig_cb(unsigned int subsys, unsigned int signal, |
| 42 | void *handler_data, void *signal_data); |
| 43 | |
| 44 | extern struct gsm_bts_model bts_model_nanobts; |
| 45 | |
| 46 | static struct gsm_bts_model model_sysmobts; |
| 47 | |
| 48 | static int bts_model_sysmobts_start(struct gsm_network *net) |
| 49 | { |
| 50 | model_sysmobts.features.data = &model_sysmobts._features_data[0]; |
| 51 | model_sysmobts.features.data_len = |
| 52 | sizeof(model_sysmobts._features_data); |
| 53 | |
| 54 | gsm_btsmodel_set_feature(&model_sysmobts, BTS_FEAT_GPRS); |
| 55 | gsm_btsmodel_set_feature(&model_sysmobts, BTS_FEAT_EGPRS); |
| 56 | |
| 57 | osmo_signal_register_handler(SS_NM, bts_ipa_nm_sig_cb, NULL); |
| 58 | |
| 59 | return 0; |
| 60 | } |
| 61 | |
| 62 | int bts_model_sysmobts_init(void) |
| 63 | { |
| 64 | memcpy(&model_sysmobts, &bts_model_nanobts, sizeof(model_sysmobts)); |
| 65 | |
| 66 | model_sysmobts.name = "sysmobts"; |
| 67 | model_sysmobts.start = bts_model_sysmobts_start; |
| 68 | model_sysmobts.type = GSM_BTS_TYPE_OSMO_SYSMO; |
| 69 | |
| 70 | return gsm_bts_model_register(&model_sysmobts); |
| 71 | } |