Change in osmo-bsc[master]: add CTRL bts.N.trx.M.rf_locked (RW)

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/.

neels gerrit-no-reply at lists.osmocom.org
Tue Sep 7 12:58:58 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/25395 )


Change subject: add CTRL bts.N.trx.M.rf_locked (RW)
......................................................................

add CTRL bts.N.trx.M.rf_locked (RW)

Add per-TRX command to lock/unlock single TRX.
(Besides the global root-node rf_locked command setting the global RF
policy.)

Corresponds to VTY command: 'bts N' / 'trx N' / 'rf_locked (0|1)'.

Related: SYS#5542
Related: I2bb5096732f75a7341c7e83951e63c5a2038b469 (osmo-ttcn3-hacks)
Change-Id: Ie46fd730797b64fb185d705c3507e36f5f23ef4b
---
M src/osmo-bsc/bsc_ctrl_commands.c
1 file changed, 32 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/25395/1

diff --git a/src/osmo-bsc/bsc_ctrl_commands.c b/src/osmo-bsc/bsc_ctrl_commands.c
index 3b8125a..c7547b0 100644
--- a/src/osmo-bsc/bsc_ctrl_commands.c
+++ b/src/osmo-bsc/bsc_ctrl_commands.c
@@ -536,6 +536,37 @@
 }
 CTRL_CMD_DEFINE(net_rf_lock, "rf_locked");
 
+static int get_trx_rf_locked(struct ctrl_cmd *cmd, void *data)
+{
+	struct gsm_bts_trx *trx = cmd->node;
+	/* Return rf_locked = 1 only if it is explicitly locked. If it is in shutdown or null state, do not "trick" the
+	 * caller into thinking that sending "rf_locked 0" is necessary to bring the TRX up. */
+	cmd->reply = (trx->mo.nm_state.administrative == NM_STATE_LOCKED) ? "1" : "0";
+	return CTRL_CMD_REPLY;
+}
+
+static int set_trx_rf_locked(struct ctrl_cmd *cmd, void *data)
+{
+	struct gsm_bts_trx *trx = cmd->node;
+	int locked;
+	if (osmo_str_to_int(&locked, cmd->value, 10, 0, 1)) {
+		cmd->reply = "Invalid value";
+		return CTRL_CMD_ERROR;
+	}
+
+	gsm_trx_lock_rf(trx, locked, "ctrl");
+
+	/* Let's not assume the nm FSM has already switched its state, just return the intended rf_locked value. */
+	cmd->reply = locked ? "1" : "0";
+	return CTRL_CMD_REPLY;
+}
+
+static int verify_trx_rf_locked(struct ctrl_cmd *cmd, const char *value, void *data)
+{
+	return osmo_str_to_int(NULL, value, 10, 0, 1);
+}
+CTRL_CMD_DEFINE(trx_rf_locked, "rf_locked");
+
 static int get_net_bts_num(struct ctrl_cmd *cmd, void *data)
 {
 	struct gsm_network *net = cmd->node;
@@ -661,6 +692,7 @@
 
 	rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power);
 	rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_arfcn);
+	rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_rf_locked);
 
 	return rc;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25395
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie46fd730797b64fb185d705c3507e36f5f23ef4b
Gerrit-Change-Number: 25395
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210907/af97a723/attachment.htm>


More information about the gerrit-log mailing list