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 14 08:44:46 UTC 2021


neels has submitted this change. ( 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)
Depends: I4dac826aab00bc1780a5258b6b55d34ce7d50c60 (libosmocore)
Change-Id: Ie46fd730797b64fb185d705c3507e36f5f23ef4b
---
M TODO-RELEASE
M src/osmo-bsc/bsc_ctrl_commands.c
2 files changed, 33 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  neels: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/TODO-RELEASE b/TODO-RELEASE
index 8585c7b..90ec16b 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -14,3 +14,4 @@
 libosmovty	>1.5.1		needs vty_read_config_filep()
 libosmosgsm     >1.5.1          needs GSM_PCHAN_OSMO_DYN
 libosmocore     >1.5.1          RSL_IPAC_EIE_OSMO*, struct osmo_preproc_*
+libosmocore	>1.5.1		needs osmo_str_to_int()
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: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210914/5a3fc279/attachment.htm>


More information about the gerrit-log mailing list