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

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Sep 30 12:59:19 UTC 2016


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/905

to look at the new patch set (#5).

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/l1_oml.c
M src/osmo-bts-octphy/octphy_vty.c
3 files changed, 29 insertions(+), 1 deletion(-)


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

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/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 7735261..b3d800a 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1349,7 +1349,13 @@
 	oc->Config.usBcchArfcn = trx->bts->c0->arfcn;
 	oc->RfConfig.ulRxGainDb = plink->u.octphy.rx_gain_db;
 	/* FIXME: compute this based on nominal transmit power, etc. */
-	oc->RfConfig.ulTxAttndB = plink->u.octphy.tx_atten_db;
+	if (plink->u.octphy.tx_atten_flag == 1) {
+		oc->RfConfig.ulTxAttndB = plink->u.octphy.tx_atten_db;
+	} else {
+		/* Take the Tx Attn received in set radio attribures
+		 * x4 is for the value in db */
+		oc->RfConfig.ulTxAttndB = (trx->max_power_red) << 2;
+	}
 
 	LOGP(DL1C, LOGL_INFO, "Tx TRX-OPEN.req(trx=%u, rf_port=%u, arfcn=%u, "
 		"tsc=%u, rx_gain=%u, tx_atten=%u)\n",
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: newpatchset
Gerrit-Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list