[MERGED] osmo-bts[master]: TRX: Add vty command to power on/off transceiver

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Jun 16 13:39:42 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: TRX: Add vty command to power on/off transceiver
......................................................................


TRX: Add vty command to power on/off transceiver

Add vty command (under "phy X instance Y" hierarchy) to manually send
POWERON or POWEROFF command. It's useful for debugging issues related to
BTS/TRX initialization.

Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4
Related: OS#1648
---
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-trx/trx_vty.c
2 files changed, 23 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index c448006..04d8fea 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -195,9 +195,10 @@
 	va_list ap;
 	int l, pending = 0;
 
-	if (!transceiver_available && !!strcmp(cmd, "POWEROFF")) {
-		LOGP(DTRX, LOGL_ERROR, "CTRL ignored: No clock from "
-			"transceiver, please fix!\n");
+	if (!transceiver_available &&
+	    !(!strcmp(cmd, "POWEROFF") || !strcmp(cmd, "POWERON"))) {
+		LOGP(DTRX, LOGL_ERROR, "CTRL %s ignored: No clock from "
+		     "transceiver, please fix!\n", cmd);
 		return -EIO;
 	}
 
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index d2feea4..3aec8ba 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -273,6 +273,24 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_phy_power_on, cfg_phy_power_on_cmd,
+	"osmotrx power (on|off)",
+	OSMOTRX_STR
+	"Change TRX state\n"
+	"Turn it ON or OFF\n")
+{
+	struct phy_instance *pinst = vty->index;
+	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+
+	if (strcmp(argv[0], "on"))
+		vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE);
+	else {
+		vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE);
+		settsc_enabled = 1;
+	}
+
+	return CMD_SUCCESS;
+}
 
 DEFUN(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd,
 	"osmotrx fn-advance <0-30>",
@@ -499,6 +517,7 @@
 	install_element(PHY_NODE, &cfg_phy_no_tx_atten_cmd);
 
 	install_element(PHY_INST_NODE, &cfg_phyinst_slotmask_cmd);
+	install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd);
 	install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd);
 	install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd);
 

-- 
To view, visit https://gerrit.osmocom.org/278
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list