aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libbsc/abis_nm.c8
-rw-r--r--src/libbsc/bsc_rf_ctrl.c8
-rw-r--r--src/libbsc/bsc_vty.c2
3 files changed, 11 insertions, 7 deletions
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index 3a48dee78..9567cfa3a 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -2791,9 +2791,13 @@ void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts)
*((uint16_t *)(buf + 5)) = htons(bts->cell_identity);
}
-void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked)
+void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason)
{
- int new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED;
+ uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED;
+
+ LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr,
+ get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative),
+ get_value_string(abis_nm_adm_state_names, new_state), reason);
trx->mo.nm_state.administrative = new_state;
if (!trx->bts || !trx->bts->oml_link)
diff --git a/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c
index 20115e112..f4a21b53a 100644
--- a/src/libbsc/bsc_rf_ctrl.c
+++ b/src/libbsc/bsc_rf_ctrl.c
@@ -123,7 +123,7 @@ enum osmo_bsc_rf_policy osmo_bsc_rf_get_policy_by_bts(struct gsm_bts *bts)
}
}
-static int lock_each_trx(struct gsm_network *net, int lock)
+static int lock_each_trx(struct gsm_network *net, bool lock)
{
struct gsm_bts *bts;
@@ -138,7 +138,7 @@ static int lock_each_trx(struct gsm_network *net, int lock)
}
llist_for_each_entry(trx, &bts->trx_list, list) {
- gsm_trx_lock_rf(trx, lock);
+ gsm_trx_lock_rf(trx, lock, "ctrl");
}
}
@@ -245,7 +245,7 @@ static void send_signal(struct osmo_bsc_rf *rf, int val)
static int switch_rf_off(struct osmo_bsc_rf *rf)
{
- lock_each_trx(rf->gsm_network, 1);
+ lock_each_trx(rf->gsm_network, true);
send_signal(rf, S_RF_OFF);
return 0;
@@ -289,7 +289,7 @@ static void rf_delay_cmd_cb(void *data)
case RF_CMD_ON:
rf->last_state_command = "RF Direct On";
osmo_timer_del(&rf->grace_timeout);
- lock_each_trx(rf->gsm_network, 0);
+ lock_each_trx(rf->gsm_network, false);
send_signal(rf, S_RF_ON);
osmo_timer_schedule(&rf->rf_check, 3, 0);
break;
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 42c16e89b..3a80f06bc 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -3575,7 +3575,7 @@ DEFUN(cfg_trx_rf_locked,
int locked = atoi(argv[0]);
struct gsm_bts_trx *trx = vty->index;
- gsm_trx_lock_rf(trx, locked);
+ gsm_trx_lock_rf(trx, locked, "vty");
return CMD_SUCCESS;
}