[PATCH] osmo-bts[master]: octphy: set tx attenuation via VTY

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

dexter gerrit-no-reply at lists.osmocom.org
Thu Sep 22 14:28:49 UTC 2016


Review at  https://gerrit.osmocom.org/905

octphy: set tx attenuation via VTY

add code to configure the transmision power via VTY

Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
---
M include/osmo-bts/phy_link.h
M src/osmo-bts-octphy/octphy_vty.c
2 files changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/05/905/1

diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index ea0fb33..7c09b2d 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -62,6 +62,7 @@
 			/* configuration */
 			uint32_t rf_port_index;
 			uint32_t rx_gain_db;
+			uint32_t tx_atten_flag;
 			uint32_t tx_atten_db;
 
 			struct octphy_hdl *hdl;
diff --git a/src/osmo-bts-octphy/octphy_vty.c b/src/osmo-bts-octphy/octphy_vty.c
index 3ea576c..53099c8 100644
--- a/src/osmo-bts-octphy/octphy_vty.c
+++ b/src/osmo-bts-octphy/octphy_vty.c
@@ -135,6 +135,24 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_phy_tx_atten_flag, cfg_phy_tx_atten_flag_cmd,
+	"octphy tx-attenuation-flag <0-1>",
+	OCT_STR "1 - Use config file to set Tx Attenuation\n"
+	"Use config file to set Tx Attenuation\n")
+{
+	struct phy_link *plink = vty->index;
+
+	if (plink->state != PHY_LINK_SHUTDOWN) {
+		vty_out(vty, "Can only reconfigure a PHY link that is down%s",
+			VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	plink->u.octphy.tx_atten_flag = atoi(argv[0]);
+
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_phy_tx_atten_db, cfg_phy_tx_atten_db_cmd,
 	"octphy tx-attenuation <0-359>",
 	OCT_STR "Configure the Tx Attenuation in quarter-dB\n"
@@ -202,6 +220,8 @@
 		VTY_NEWLINE);
 	vty_out(vty, "  rx-gain %u%s", plink->u.octphy.rx_gain_db,
 		VTY_NEWLINE);
+	vty_out(vty, "  tx-attenuation-flag %u%s", plink->u.octphy.tx_atten_flag,
+		VTY_NEWLINE);
 	vty_out(vty, "  tx-attenuation %u%s", plink->u.octphy.tx_atten_db,
 		VTY_NEWLINE);
 	vty_out(vty, "  rf-port-index %u%s", plink->u.octphy.rf_port_index,
@@ -250,6 +270,7 @@
 	install_element(PHY_NODE, &cfg_phy_netdev_cmd);
 	install_element(PHY_NODE, &cfg_phy_rf_port_idx_cmd);
 	install_element(PHY_NODE, &cfg_phy_rx_gain_db_cmd);
+	install_element(PHY_NODE, &cfg_phy_tx_atten_flag_cmd);
 	install_element(PHY_NODE, &cfg_phy_tx_atten_db_cmd);
 
 	install_element_ve(&show_rf_port_stats_cmd);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list