This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/3962 Remove BTS-specific attributes Remove *bts_model_* functions as they are only useful to BSC. Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/bss.h D include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M src/libcommon/gsm_data.c 6 files changed, 2 insertions(+), 323 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/3962/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 03896b5..80a6d0e 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -10,7 +10,6 @@ bsc_msg_filter.h \ bsc_rll.h \ bss.h \ - bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ common.h \ common_bsc.h \ diff --git a/include/osmocom/msc/bss.h b/include/osmocom/msc/bss.h index 0904334..4e1db7a 100644 --- a/include/osmocom/msc/bss.h +++ b/include/osmocom/msc/bss.h @@ -10,11 +10,4 @@ extern int bsc_network_configure(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_nokia_site_init(void); -extern int bts_model_sysmobts_init(void); #endif diff --git a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h deleted file mode 100644 index bc7860b..0000000 --- a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h +++ /dev/null @@ -1,32 +0,0 @@ -/* OML attribute table generator for ipaccess nanobts */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH <info at sysmocom.de> - * All Rights Reserved - * - * Author: Philipp Maier - * - * 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/>. - */ - -#pragma once - -#include <stdint.h> -#include <osmocom/core/msgb.h> - -struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, - struct gsm_bts_trx *trx); diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index c2533a5..4d493cb 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -559,8 +559,6 @@ extern void talloc_ctx_init(void *ctx_root); -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); - enum gsm_bts_type parse_btstype(const char *arg); const char *btstype2str(enum gsm_bts_type type); struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, @@ -568,68 +566,6 @@ extern void *tall_bsc_ctx; extern int ipacc_rtp_direct; - -/* this actaully refers to the IPA transport, not the BTS model */ -static inline int is_ipaccess_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_sysmobts_v2(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_siemens_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_nokia_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_e1_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} enum gsm_auth_policy gsm_auth_policy_parse(const char *arg); const char *gsm_auth_policy_name(enum gsm_auth_policy policy); @@ -639,13 +575,9 @@ enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid); const char *bts_gprs_mode_name(enum bts_gprs_mode mode); -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode); int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); -int gsm_bts_model_register(struct gsm_bts_model *model); struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan); void bsc_subscr_con_free(struct gsm_subscriber_connection *conn); @@ -653,15 +585,11 @@ struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, - enum gsm_bts_type type, - uint8_t bsic); - void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); + struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); int gsm_bts_set_system_infos(struct gsm_bts *bts); @@ -675,12 +603,6 @@ /* control interface handling */ int bsc_base_ctrl_cmds_install(void); int msc_ctrl_cmds_install(struct gsm_network *net); - -/* dependency handling */ -void bts_depend_mark(struct gsm_bts *bts, int dep); -void bts_depend_clear(struct gsm_bts *bts, int dep); -int bts_depend_check(struct gsm_bts *bts); -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); bool classmark_is_r99(struct gsm_classmark *cm); diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 194cacd..63f4d33 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -523,30 +523,6 @@ struct vty; -struct gsm_bts_model { - struct llist_head list; - - enum gsm_bts_type type; - enum gsm_bts_type_variant variant; - const char *name; - - bool started; - int (*start)(struct gsm_network *net); - int (*oml_rcvmsg)(struct msgb *msg); - - void (*e1line_bind_ops)(struct e1inp_line *line); - - void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); - void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); - void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); - - struct tlv_definition nm_att_tlvdef; - - /* features of a given BTS model set via gsm_bts_model_register() locally */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; -}; - /* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility with BTS compiled against earlier version of this header */ enum gsm_bts_features { @@ -690,7 +666,7 @@ /* type of BTS */ enum gsm_bts_type type; enum gsm_bts_type_variant variant; - struct gsm_bts_model *model; + enum gsm_band band; char version[MAX_VERSION_LENGTH]; char sub_model[MAX_VERSION_LENGTH]; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index b8840c3..4ab8a20 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -49,28 +49,6 @@ ts->e1_link.e1_ts_ss = e1_ts_ss; } -static struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - llist_for_each_entry(model, &bts_models, list) { - if (model->type == type) - return model; - } - - return NULL; -} - -int gsm_bts_model_register(struct gsm_bts_model *model) -{ - if (bts_model_find(model->type)) - return -EEXIST; - - tlv_def_patch(&model->nm_att_tlvdef, &abis_nm_att_tlvdef); - llist_add_tail(&model->list, &bts_models); - return 0; -} - const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, @@ -177,107 +155,6 @@ return get_value_string(bts_gprs_mode_names, mode); } -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) -{ - if (mode != BTS_GPRS_NONE && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) { - return 0; - } - if (mode == BTS_GPRS_EGPRS && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) { - return 0; - } - - return 1; -} - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&model->features, feat, 1); -} - -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&model->features, feat); -} - -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - model = bts_model_find(type); - if (!model) - return -EINVAL; - - bts->type = type; - bts->model = model; - - if (model->start && !model->started) { - int ret = model->start(bts->network); - if (ret < 0) - return ret; - - model->started = true; - } - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - /* Set the default OML Stream ID to 0xff */ - bts->oml_tei = 0xff; - bts->c0->nominal_power = 23; - break; - case GSM_BTS_TYPE_RBS2000: - INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups); - INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_UNKNOWN: - case GSM_BTS_TYPE_NOKIA_SITE: - /* Set default BTS reset timer */ - bts->nokia.bts_reset_timer_cnf = 15; - case _NUM_GSM_BTS_TYPE: - break; - } - - return 0; -} - -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, - uint8_t bsic) -{ - struct gsm_bts_model *model = bts_model_find(type); - struct gsm_bts *bts; - - if (!model && type != GSM_BTS_TYPE_UNKNOWN) - return NULL; - - bts = gsm_bts_alloc(net, net->num_bts); - if (!bts) - return NULL; - - net->num_bts++; - - bts->network = net; - bts->type = type; - bts->model = model; - bts->bsic = bsic; - bts->dtxu = GSM48_DTX_SHALL_NOT_BE_USED; - bts->dtxd = false; - bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ - bts->neigh_list_manual_mode = 0; - - llist_add_tail(&bts->list, &net->bts_list); - - INIT_LLIST_HEAD(&bts->abis_queue); - - INIT_LLIST_HEAD(&bts->loc_list); - - return bts; -} - void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) { raid->mcc = bts->network->country_code; @@ -322,62 +199,6 @@ /* Assume there are only 256 possible bts */ osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); -static void depends_calc_index_bit(int bts_nr, int *idx, int *bit) -{ - *idx = bts_nr / (8 * 4); - *bit = bts_nr % (8 * 4); -} - -void bts_depend_mark(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] |= 1 << bit; -} - -void bts_depend_clear(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] &= ~(1 << bit); -} - -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) -{ - int idx, bit; - depends_calc_index_bit(other->nr, &idx, &bit); - - /* Check if there is a depends bit */ - return (base->depends_on[idx] & (1 << bit)) > 0; -} - -static int bts_is_online(struct gsm_bts *bts) -{ - /* TODO: support E1 BTS too */ - if (!is_ipaccess_bts(bts)) - return 1; - - if (!bts->oml_link) - return 0; - - return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - -int bts_depend_check(struct gsm_bts *bts) -{ - struct gsm_bts *other_bts; - - llist_for_each_entry(other_bts, &bts->network->bts_list, list) { - if (!bts_depend_is_depedency(bts, other_bts)) - continue; - if (bts_is_online(other_bts)) - continue; - return 0; - } - return 1; -} bool classmark_is_r99(struct gsm_classmark *cm) { -- To view, visit https://gerrit.osmocom.org/3962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de>