aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/vty.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-05-30 00:14:03 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-06-11 00:36:21 +0700
commit578156b815530fbaf14037217197b77edca3fee0 (patch)
tree6664af7d8bae19643a56e362a42f84c824db4c99 /src/common/vty.c
parentba0e5c7d5091a1c334e23a52b5903bdcecf9798a (diff)
Do not mix public and private BTS features, use libosmocore's API
It was a very bad idea to mix "public" BTS features, that are reported to the BSC via OML, and those features, that are used locally (and exclusively) in osmo-bts. Why? At least because we already have the BTS feature manipulation API in libosmocore, that is used by osmo-bsc, but for some reason not by osmo-bts. New features added to libosmocore would clash with the existing "internal" ones like BTS_FEAT_MS_PWR_CTRL_DSP. So what this change does can be described as follows: - remove duplicate definition of the "public" features, - use libosmocore's API for the "public" features, - separate both "internal" and "public" features: - the "public" features continue to live in bitvec, - the "internal" features become flags, - s/BTS_FEAT/BTS_INTERNAL_FLAG/g. Change-Id: Icf792d02323bb73e3b8d46384c7890cb1eb4731e
Diffstat (limited to 'src/common/vty.c')
-rw-r--r--src/common/vty.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index 1d74b367..3dfd3878 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -766,7 +766,7 @@ DEFUN(cfg_trx_ms_power_control, cfg_trx_ms_power_control_cmd,
struct gsm_bts_trx *trx = vty->index;
bool soft = !strcmp(argv[0], "osmo");
- if (!soft && !gsm_bts_has_feature(trx->bts, BTS_FEAT_MS_PWR_CTRL_DSP)) {
+ if (!soft && !bts_internal_flag_get(trx->bts, BTS_INTERNAL_FLAG_MS_PWR_CTRL_DSP)) {
/* NOTE: osmo-bts-trx used to have its own (low-level) MS Power Control loop, which
* has been ripped out in favour of the common implementation. Configuration files
* may still contain 'dsp', so let's be tolerant and override 'dsp' by 'osmo'. */
@@ -827,13 +827,27 @@ static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms)
static void bts_dump_vty_features(struct vty *vty, struct gsm_bts *bts)
{
unsigned int i;
- bool no_features = true;
+ bool no_features;
+
vty_out(vty, " Features:%s", VTY_NEWLINE);
- for (i = 0; i < _NUM_BTS_FEAT; i++) {
- if (gsm_bts_has_feature(bts, i)) {
+ for (i = 0, no_features = true; i < _NUM_BTS_FEAT; i++) {
+ if (osmo_bts_has_feature(bts->features, i)) {
+ vty_out(vty, " %03u ", i);
+ vty_out(vty, "%-40s%s", osmo_bts_feature_name(i), VTY_NEWLINE);
+ no_features = false;
+ }
+ }
+
+ if (no_features)
+ vty_out(vty, " (not available)%s", VTY_NEWLINE);
+
+ vty_out(vty, " BTS model specific (internal) flags:%s", VTY_NEWLINE);
+
+ for (i = 0, no_features = true; i < sizeof(bts->flags) * 8; i++) {
+ if (bts_internal_flag_get(bts, i)) {
vty_out(vty, " %03u ", i);
- vty_out(vty, "%-40s%s", get_value_string(gsm_bts_features_descs, i), VTY_NEWLINE);
+ vty_out(vty, "%-40s%s", get_value_string(bts_impl_flag_desc, i), VTY_NEWLINE);
no_features = false;
}
}