Change in osmo-bts[master]: vty: add commands for Downlink power control

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

fixeria gerrit-no-reply at lists.osmocom.org
Tue Dec 1 17:41:33 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/21438 )


Change subject: vty: add commands for Downlink power control
......................................................................

vty: add commands for Downlink power control

Change-Id: I61efbe177aa06584cd7412640b888913de6e8f9d
Related: SYS#4918
---
M src/common/vty.c
1 file changed, 93 insertions(+), 47 deletions(-)



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

diff --git a/src/common/vty.c b/src/common/vty.c
index f32f6cd..0e78ad3 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -228,6 +228,27 @@
 	return CMD_SUCCESS;
 }
 
+static void config_write_power_ctrl_params(struct vty *vty, const char *prefix,
+					   const struct bts_power_ctrl_params *pp)
+{
+	vty_out(vty, " %s-power-target %d", prefix, pp->target);
+	if (pp->hysteresis > 0)
+		vty_out(vty, " hysteresis %d", pp->hysteresis);
+	vty_out(vty, "%s", VTY_NEWLINE);
+
+	/* Power filtering algorithm and parameters */
+	switch (pp->pf_algo) {
+	case BTS_PF_ALGO_EWMA:
+		vty_out(vty, " %s-power-filtering algo ewma beta %u%s",
+			prefix, 100 - pp->pf.ewma.alpha, VTY_NEWLINE);
+		break;
+	case BTS_PF_ALGO_NONE:
+	default:
+		vty_out(vty, " no %s-power-filtering%s", prefix, VTY_NEWLINE);
+		break;
+	}
+}
+
 static void config_write_bts_single(struct vty *vty, const struct gsm_bts *bts)
 {
 	const struct gsm_bts_trx *trx;
@@ -255,22 +276,10 @@
 		VTY_NEWLINE);
 	vty_out(vty, " paging lifetime %u%s", paging_get_lifetime(bts->paging_state),
 		VTY_NEWLINE);
-	vty_out(vty, " uplink-power-target %d", bts->ul_power_ctrl.target);
-	if (bts->ul_power_ctrl.hysteresis > 0)
-		vty_out(vty, " hysteresis %d", bts->ul_power_ctrl.hysteresis);
-	vty_out(vty, "%s", VTY_NEWLINE);
 
-	/* MS Tx power filtering algorithm and parameters */
-	switch (bts->ul_power_ctrl.pf_algo) {
-	case BTS_PF_ALGO_EWMA:
-		vty_out(vty, " uplink-power-filtering algo ewma beta %u%s",
-			100 - bts->ul_power_ctrl.pf.ewma.alpha, VTY_NEWLINE);
-		break;
-	case BTS_PF_ALGO_NONE:
-	default:
-		vty_out(vty, " no uplink-power-filtering%s", VTY_NEWLINE);
-		break;
-	}
+	/* UL/DL power control parameters */
+	config_write_power_ctrl_params(vty,   "uplink", &bts->ul_power_ctrl);
+	config_write_power_ctrl_params(vty, "downlink", &bts->dl_power_ctrl);
 
 	if (bts->agch_queue.thresh_level != GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DEFAULT
 		 || bts->agch_queue.low_level != GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT
@@ -621,68 +630,105 @@
 	return CMD_SUCCESS;
 }
 
-#define UL_POWER_TARGET_CMD \
-	"uplink-power-target <-110-0>"
-#define UL_POWER_TARGET_CMD_DESC \
-	"Set the nominal target Rx Level for uplink power control loop\n" \
-	"Target uplink Rx level in dBm\n"
+#define POWER_TARGET_CMD \
+	"(uplink-power-target|downlink-power-target) <-110-0>"
+#define POWER_TARGET_CMD_DESC \
+	"Set the nominal target Rx Level for Uplink power control loop\n" \
+	"Set the nominal target Rx Level for Downlink power control loop\n" \
+	"Target Rx level in dBm\n"
 
-DEFUN_ATTR(cfg_bts_ul_power_target, cfg_bts_ul_power_target_cmd,
-	   UL_POWER_TARGET_CMD, UL_POWER_TARGET_CMD_DESC,
+#define POWER_HYST_CMD \
+	"hysteresis <1-25>"
+#define POWER_HYST_CMD_DESC \
+	"Target Rx Level hysteresis\n" \
+	"Tolerable deviation in dBm\n"
+
+DEFUN_ATTR(cfg_bts_power_target,
+	   cfg_bts_power_target_cmd,
+	   POWER_TARGET_CMD,
+	   POWER_TARGET_CMD_DESC,
 	   CMD_ATTR_IMMEDIATE)
 {
+	struct bts_power_ctrl_params *params;
 	struct gsm_bts *bts = vty->index;
 
-	bts->ul_power_ctrl.target = atoi(argv[0]);
-	bts->ul_power_ctrl.hysteresis = 0;
+	if (argv[0][0] == 'u')
+		params = &bts->ul_power_ctrl;
+	else
+		params = &bts->dl_power_ctrl;
+
+	params->target = atoi(argv[1]);
+	params->hysteresis = 0;
 
 	return CMD_SUCCESS;
 }
 
 /* FIXME: libosmovty is unable to handle 'foo <-110-0> [bar <1-25>]' */
-DEFUN_ATTR(cfg_bts_ul_power_target_hysteresis,
-	   cfg_bts_ul_power_target_hysteresis_cmd,
-	   UL_POWER_TARGET_CMD " hysteresis <1-25>",
-	   UL_POWER_TARGET_CMD_DESC
-	   "Target Rx Level hysteresis\n"
-	   "Tolerable deviation in dBm\n",
+DEFUN_ATTR(cfg_bts_power_target_hysteresis,
+	   cfg_bts_power_target_hysteresis_cmd,
+	   POWER_TARGET_CMD " " POWER_HYST_CMD,
+	   POWER_TARGET_CMD_DESC POWER_HYST_CMD_DESC,
 	   CMD_ATTR_IMMEDIATE)
 {
+	struct bts_power_ctrl_params *params;
 	struct gsm_bts *bts = vty->index;
 
-	bts->ul_power_ctrl.target = atoi(argv[0]);
-	bts->ul_power_ctrl.hysteresis = atoi(argv[1]);
+	if (argv[0][0] == 'u')
+		params = &bts->ul_power_ctrl;
+	else
+		params = &bts->dl_power_ctrl;
+
+	params->target = atoi(argv[1]);
+	params->hysteresis = atoi(argv[2]);
 
 	return CMD_SUCCESS;
 }
 
-DEFUN_ATTR(cfg_no_bts_ul_power_filter,
-	   cfg_bts_no_ul_power_filter_cmd,
-	   "no uplink-power-filtering",
-	   NO_STR "Disable filtering for uplink power control loop\n",
+#define POWER_FILTER_CMD \
+	"(uplink-power-filtering|downlink-power-filtering)"
+#define UL_POWER_FILTER_CMD_DESC \
+	"filtering for Uplink power control loop\n"
+#define DL_POWER_FILTER_CMD_DESC \
+	"filtering for Downlink power control loop\n"
+
+DEFUN_ATTR(cfg_no_bts_power_filter,
+	   cfg_bts_no_power_filter_cmd,
+	   "no " POWER_FILTER_CMD,
+	   NO_STR "Disable " UL_POWER_FILTER_CMD_DESC
+		  "Disable " DL_POWER_FILTER_CMD_DESC,
 	   CMD_ATTR_IMMEDIATE)
 {
 	struct gsm_bts *bts = vty->index;
 
-	bts->ul_power_ctrl.pf_algo = BTS_PF_ALGO_NONE;
+	if (argv[0][0] == 'u')
+		bts->ul_power_ctrl.pf_algo = BTS_PF_ALGO_NONE;
+	else
+		bts->dl_power_ctrl.pf_algo = BTS_PF_ALGO_NONE;
 
 	return CMD_SUCCESS;
 }
 
-DEFUN_ATTR(cfg_bts_ul_power_filter_ewma,
-	   cfg_bts_ul_power_filter_ewma_cmd,
-	   "uplink-power-filtering algo ewma beta <1-99>",
-	   "Configure filtering for uplink power control loop\n"
+DEFUN_ATTR(cfg_bts_power_filter_ewma,
+	   cfg_bts_power_filter_ewma_cmd,
+	   POWER_FILTER_CMD " algo ewma beta <1-99>",
+	   "Configure " UL_POWER_FILTER_CMD_DESC
+	   "Configure " DL_POWER_FILTER_CMD_DESC
 	   "Select the filtering algorithm\n"
 	   "Exponentially Weighted Moving Average (EWMA)\n"
 	   "Smoothing factor (in %): beta = (100 - alpha)\n"
 	   "1% - lowest smoothing, 99% - highest smoothing\n",
 	   CMD_ATTR_IMMEDIATE)
 {
+	struct bts_power_ctrl_params *params;
 	struct gsm_bts *bts = vty->index;
 
-	bts->ul_power_ctrl.pf_algo = BTS_PF_ALGO_EWMA;
-	bts->ul_power_ctrl.pf.ewma.alpha = 100 - atoi(argv[0]);
+	if (argv[0][0] == 'u')
+		params = &bts->ul_power_ctrl;
+	else
+		params = &bts->dl_power_ctrl;
+
+	params->pf_algo = BTS_PF_ALGO_EWMA;
+	params->pf.ewma.alpha = 100 - atoi(argv[1]);
 
 	return CMD_SUCCESS;
 }
@@ -1879,10 +1925,10 @@
 	install_element(BTS_NODE, &cfg_bts_paging_lifetime_cmd);
 	install_element(BTS_NODE, &cfg_bts_agch_queue_mgmt_default_cmd);
 	install_element(BTS_NODE, &cfg_bts_agch_queue_mgmt_params_cmd);
-	install_element(BTS_NODE, &cfg_bts_ul_power_target_cmd);
-	install_element(BTS_NODE, &cfg_bts_ul_power_target_hysteresis_cmd);
-	install_element(BTS_NODE, &cfg_bts_no_ul_power_filter_cmd);
-	install_element(BTS_NODE, &cfg_bts_ul_power_filter_ewma_cmd);
+	install_element(BTS_NODE, &cfg_bts_power_target_cmd);
+	install_element(BTS_NODE, &cfg_bts_power_target_hysteresis_cmd);
+	install_element(BTS_NODE, &cfg_bts_no_power_filter_cmd);
+	install_element(BTS_NODE, &cfg_bts_power_filter_ewma_cmd);
 	install_element(BTS_NODE, &cfg_bts_min_qual_rach_cmd);
 	install_element(BTS_NODE, &cfg_bts_min_qual_norm_cmd);
 	install_element(BTS_NODE, &cfg_bts_max_ber_rach_cmd);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I61efbe177aa06584cd7412640b888913de6e8f9d
Gerrit-Change-Number: 21438
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201201/04edf07b/attachment.htm>


More information about the gerrit-log mailing list