Change in osmo-trx[master]: vty: Simplify filler burst settings and improve help and readability.

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

pespin gerrit-no-reply at lists.osmocom.org
Mon Oct 21 08:41:07 UTC 2019


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/15793 )

Change subject: vty: Simplify filler burst settings and improve help and readability.
......................................................................

vty: Simplify filler burst settings and improve help and readability.

In the command line options time, filler table/filer burts settings
were a bit difficult to undertand because the number of one-letter
settings was limited. Now, with VTY configuration, there is no reason
to keep it so difficult.

Also, after the previous commit it was no longer posible to enable
random 8-PSK filler bursts. With this patch you can configure all
supported filler bursts in a simple and logical way.

Change-Id: I752eb2c1162d084e8769181f2fcd6c0877663448
---
M CommonLibs/trx_vty.c
M CommonLibs/trx_vty.h
M Transceiver52M/osmo-trx.cpp
3 files changed, 81 insertions(+), 75 deletions(-)

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



diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c
index 2c7ecc2..02d6572 100644
--- a/CommonLibs/trx_vty.c
+++ b/CommonLibs/trx_vty.c
@@ -48,15 +48,25 @@
 	{ 0,		NULL }
 };
 
-static const struct value_string filler_names[] = {
-	{ FILLER_DUMMY,		"Dummy bursts" },
-	{ FILLER_ZERO,		"Disabled" },
-	{ FILLER_NORM_RAND,	"Normal bursts with random payload" },
-	{ FILLER_EDGE_RAND,	"EDGE bursts with random payload" },
-	{ FILLER_ACCESS_RAND,	"Access bursts with random payload" },
+const struct value_string filler_names[] = {
+	{ FILLER_DUMMY,		"Dummy bursts (C0 only)" },
+	{ FILLER_ZERO,		"Empty bursts" },
+	{ FILLER_NORM_RAND,	"GMSK Normal Bursts with random payload" },
+	{ FILLER_EDGE_RAND,	"8-PSK Normal Bursts with random payload" },
+	{ FILLER_ACCESS_RAND,	"Access Bursts with random payload" },
 	{ 0,			NULL }
 };
 
+static const struct value_string filler_types[] = {
+	{ FILLER_DUMMY,		"dummy" },
+	{ FILLER_ZERO,		"zero" },
+	{ FILLER_NORM_RAND,	"random-nb-gmsk" },
+	{ FILLER_EDGE_RAND,	"random-nb-8psk" },
+	{ FILLER_ACCESS_RAND,	"random-ab" },
+	{ 0,			NULL }
+};
+
+
 struct trx_ctx *trx_from_vty(struct vty *v)
 {
         /* It can't hurt to force callers to continue to pass the vty instance
@@ -172,53 +182,6 @@
 	return CMD_SUCCESS;
 }
 
-DEFUN(cfg_test_rtsc, cfg_test_rtsc_cmd,
-	"test rtsc <0-7>",
-	"Set the Random Normal Burst test mode with TSC\n"
-	"TSC\n")
-{
-	struct trx_ctx *trx = trx_from_vty(vty);
-
-	if (trx->cfg.rach_delay_set) {
-		vty_out(vty, "rach-delay and rtsc options are mutual-exclusive%s",
-			VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	trx->cfg.rtsc_set = true;
-	trx->cfg.rtsc = atoi(argv[0]);
-	if (!trx->cfg.egprs) /* Don't override egprs which sets different filler */
-		trx->cfg.filler = FILLER_NORM_RAND;
-
-	return CMD_SUCCESS;
-}
-
-DEFUN(cfg_test_rach_delay, cfg_test_rach_delay_cmd,
-	"test rach-delay <0-68>",
-	"Set the Random Access Burst test mode with delay\n"
-	"RACH delay\n")
-{
-	struct trx_ctx *trx = trx_from_vty(vty);
-
-	if (trx->cfg.rtsc_set) {
-		vty_out(vty, "rach-delay and rtsc options are mutual-exclusive%s",
-			VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	if (trx->cfg.egprs) {
-		vty_out(vty, "rach-delay and egprs options are mutual-exclusive%s",
-			VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	trx->cfg.rach_delay_set = true;
-	trx->cfg.rach_delay = atoi(argv[0]);
-	trx->cfg.filler = FILLER_ACCESS_RAND;
-
-	return CMD_SUCCESS;
-}
-
 DEFUN(cfg_clock_ref, cfg_clock_ref_cmd,
 	"clock-ref (internal|external|gpsdo)",
 	"Set the Reference Clock\n"
@@ -351,14 +314,57 @@
 	return CMD_SUCCESS;
 }
 
-DEFUN(cfg_filler, cfg_filler_cmd,
-	"filler dummy",
-	"Enable C0 filler table\n"
-	"Dummy method\n")
+DEFUN(cfg_filler, cfg_filler_type_cmd,
+	"filler type (zero|dummy|random-nb-gmsk|random-nb-8psk|random-ab)",
+	"Filler burst settings\n"
+	"Filler burst type (default=zero)\n"
+	"Send an empty burst when there is nothing to send (default)\n"
+	"Send a dummy burst when there is nothing to send on C0 (TRX0) and empty burst on other channels."
+	" Use for OpenBTS compatibility only, don't use with OsmoBTS as it breaks encryption.\n"
+	"Send a GMSK modulated Normal Burst with random bits when there is nothing to send."
+	" Use for spectrum mask testing. Configure 'filler tsc' to set training sequence.\n"
+	"Send an 8-PSK modulated Normal Burst with random bits when there is nothing to send."
+	" Use for spectrum mask testing. Configure 'filler tsc' to set training sequence.\n"
+	"Send an Access Burst with random bits when there is nothing to send. Use for Rx/Tx alignment."
+	" Configure 'filler access-burst-delay' to introduce artificial delay.\n"
+)
+{
+	struct trx_ctx *trx = trx_from_vty(vty);
+	// trx->cfg.filler is unsigned, so we need an interim int var to detect errors
+	int type = get_string_value(filler_types, argv[0]);
+
+	if (type < 0) {
+		trx->cfg.filler = FILLER_ZERO;
+		return CMD_WARNING;
+	}
+	trx->cfg.filler = type;
+
+	return CMD_SUCCESS;
+}
+
+DEFUN(cfg_test_rtsc, cfg_filler_tsc_cmd,
+	"filler tsc <0-7>",
+	"Filler burst settings\n"
+	"Set the TSC for GMSK/8-PSK Normal Burst random fillers. Used only with 'random-nb-gmsk' and"
+	" 'random-nb-8psk' filler types. (default=0)\n"
+	"TSC\n")
 {
 	struct trx_ctx *trx = trx_from_vty(vty);
 
-	trx->cfg.filler = FILLER_DUMMY;
+	trx->cfg.rtsc = atoi(argv[0]);
+
+	return CMD_SUCCESS;
+}
+
+DEFUN(cfg_test_rach_delay, cfg_filler_rach_delay_cmd,
+	"filler access-burst-delay <0-68>",
+	"Filler burst settings\n"
+	"Set the delay for Access Burst random fillers. Used only with 'random-ab' filler type. (default=0)\n"
+	"RACH delay in symbols\n")
+{
+	struct trx_ctx *trx = trx_from_vty(vty);
+
+	trx->cfg.rach_delay = atoi(argv[0]);
 
 	return CMD_SUCCESS;
 }
@@ -546,10 +552,6 @@
 		vty_out(vty, " tx-sps %u%s", trx->cfg.tx_sps, VTY_NEWLINE);
 	if (trx->cfg.rx_sps != DEFAULT_RX_SPS)
 		vty_out(vty, " rx-sps %u%s", trx->cfg.rx_sps, VTY_NEWLINE);
-	if (trx->cfg.rtsc_set)
-		vty_out(vty, " test rtsc %u%s", trx->cfg.rtsc, VTY_NEWLINE);
-	if (trx->cfg.rach_delay_set)
-		vty_out(vty, " test rach-delay %u%s", trx->cfg.rach_delay, VTY_NEWLINE);
 	if (trx->cfg.clock_ref != REF_INTERNAL)
 		vty_out(vty, " clock-ref %s%s", get_value_string(clock_ref_names, trx->cfg.clock_ref), VTY_NEWLINE);
 	vty_out(vty, " multi-arfcn %s%s", trx->cfg.multi_arfcn ? "enable" : "disable", VTY_NEWLINE);
@@ -562,6 +564,12 @@
 	vty_out(vty, " ext-rach %s%s", trx->cfg.ext_rach ? "enable" : "disable", VTY_NEWLINE);
 	if (trx->cfg.sched_rr != 0)
 		vty_out(vty, " rt-prio %u%s", trx->cfg.sched_rr, VTY_NEWLINE);
+	if (trx->cfg.filler != FILLER_ZERO)
+		vty_out(vty, " filler type %s%s", get_value_string(filler_types, trx->cfg.filler), VTY_NEWLINE);
+	if (trx->cfg.rtsc > 0)
+		vty_out(vty, " filler tsc %u%s", trx->cfg.rtsc, VTY_NEWLINE);
+	if (trx->cfg.rach_delay > 0)
+		vty_out(vty, " filler access-burst-delay %u%s", trx->cfg.rach_delay, VTY_NEWLINE);
 	if (trx->cfg.stack_size != 0)
 		vty_out(vty, " stack-size %u%s", trx->cfg.stack_size, VTY_NEWLINE);
 	trx_rate_ctr_threshold_write_config(vty, " ");
@@ -589,11 +597,9 @@
 	vty_out(vty, " Device args: %s%s", trx->cfg.dev_args, VTY_NEWLINE);
 	vty_out(vty, " Tx Samples-per-Symbol: %u%s", trx->cfg.tx_sps, VTY_NEWLINE);
 	vty_out(vty, " Rx Samples-per-Symbol: %u%s", trx->cfg.rx_sps, VTY_NEWLINE);
-	vty_out(vty, " Test Mode: TSC: %u (%s)%s", trx->cfg.rtsc,
-		trx->cfg.rtsc_set ? "Enabled" : "Disabled", VTY_NEWLINE);
-	vty_out(vty, " Test Mode: RACH Delay: %u (%s)%s", trx->cfg.rach_delay,
-		trx->cfg.rach_delay_set ? "Enabled" : "Disabled", VTY_NEWLINE);
-	vty_out(vty, " C0 Filler Table: %s%s", get_value_string(filler_names, trx->cfg.filler), VTY_NEWLINE);
+	vty_out(vty, " Filler Burst Type: %s%s", get_value_string(filler_names, trx->cfg.filler), VTY_NEWLINE);
+	vty_out(vty, " Filler Burst TSC: %u%s", trx->cfg.rtsc, VTY_NEWLINE);
+	vty_out(vty, " Filler Burst RACH Delay: %u%s", trx->cfg.rach_delay, VTY_NEWLINE);
 	vty_out(vty, " Clock Reference: %s%s", get_value_string(clock_ref_names, trx->cfg.clock_ref), VTY_NEWLINE);
 	vty_out(vty, " Multi-Carrier: %s%s", trx->cfg.multi_arfcn ? "Enabled" : "Disabled", VTY_NEWLINE);
 	vty_out(vty, " Tuning offset: %f%s", trx->cfg.offset, VTY_NEWLINE);
@@ -662,6 +668,7 @@
 static const char trx_copyright[] =
 	"Copyright (C) 2007-2014 Free Software Foundation, Inc.\r\n"
 	"Copyright (C) 2013 Thomas Tsou <tom at tsou.cc>\r\n"
+	"Copyright (C) 2013-2019 Fairwaves, Inc.\r\n"
 	"Copyright (C) 2015 Ettus Research LLC\r\n"
 	"Copyright (C) 2017-2018 by sysmocom s.f.m.c. GmbH <info at sysmocom.de>\r\n"
 	"License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n"
@@ -704,8 +711,6 @@
 	install_element(TRX_NODE, &cfg_dev_args_cmd);
 	install_element(TRX_NODE, &cfg_tx_sps_cmd);
 	install_element(TRX_NODE, &cfg_rx_sps_cmd);
-	install_element(TRX_NODE, &cfg_test_rtsc_cmd);
-	install_element(TRX_NODE, &cfg_test_rach_delay_cmd);
 	install_element(TRX_NODE, &cfg_clock_ref_cmd);
 	install_element(TRX_NODE, &cfg_multi_arfcn_cmd);
 	install_element(TRX_NODE, &cfg_offset_cmd);
@@ -714,7 +719,9 @@
 	install_element(TRX_NODE, &cfg_egprs_cmd);
 	install_element(TRX_NODE, &cfg_ext_rach_cmd);
 	install_element(TRX_NODE, &cfg_rt_prio_cmd);
-	install_element(TRX_NODE, &cfg_filler_cmd);
+	install_element(TRX_NODE, &cfg_filler_type_cmd);
+	install_element(TRX_NODE, &cfg_filler_tsc_cmd);
+	install_element(TRX_NODE, &cfg_filler_rach_delay_cmd);
 	install_element(TRX_NODE, &cfg_ctr_error_threshold_cmd);
 	install_element(TRX_NODE, &cfg_no_ctr_error_threshold_cmd);
 	install_element(TRX_NODE, &cfg_stack_size_cmd);
diff --git a/CommonLibs/trx_vty.h b/CommonLibs/trx_vty.h
index d939051..d20dd96 100644
--- a/CommonLibs/trx_vty.h
+++ b/CommonLibs/trx_vty.h
@@ -5,6 +5,7 @@
 #include "config_defs.h"
 
 extern struct vty_app_info g_vty_info;
+extern const struct value_string filler_names[];
 
 /* Maximum number of physical RF channels */
 #define TRX_CHAN_MAX 8
@@ -51,9 +52,7 @@
 		unsigned int tx_sps;
 		unsigned int rx_sps;
 		unsigned int rtsc;
-		bool rtsc_set;
 		unsigned int rach_delay;
-		bool rach_delay_set;
 		enum ReferenceType clock_ref;
 		enum FillerType filler;
 		bool multi_arfcn;
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 6b83988..2346488 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -334,14 +334,12 @@
 			break;
 		case 'r':
 			print_deprecated(option);
-			trx->cfg.rtsc_set = true;
 			trx->cfg.rtsc = atoi(optarg);
 			if (!trx->cfg.egprs) /* Don't override egprs which sets different filler */
 				trx->cfg.filler = FILLER_NORM_RAND;
 			break;
 		case 'A':
 			print_deprecated(option);
-			trx->cfg.rach_delay_set = true;
 			trx->cfg.rach_delay = atoi(optarg);
 			trx->cfg.filler = FILLER_ACCESS_RAND;
 			break;
@@ -459,7 +457,9 @@
 	ost << "   EDGE support............ " << trx->cfg.egprs << std::endl;
 	ost << "   Extended RACH support... " << trx->cfg.ext_rach << std::endl;
 	ost << "   Reference............... " << trx->cfg.clock_ref << std::endl;
-	ost << "   C0 Filler Table......... " << trx->cfg.filler << std::endl;
+	ost << "   Filler Burst Type....... " << get_value_string(filler_names, trx->cfg.filler) << std::endl;
+	ost << "   Filler Burst TSC........ " << trx->cfg.rtsc << std::endl;
+	ost << "   Filler Burst RACH Delay. " << trx->cfg.rach_delay << std::endl;
 	ost << "   Multi-Carrier........... " << trx->cfg.multi_arfcn << std::endl;
 	ost << "   Tuning offset........... " << trx->cfg.offset << std::endl;
 	ost << "   RSSI to dBm offset...... " << trx->cfg.rssi_offset << std::endl;

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I752eb2c1162d084e8769181f2fcd6c0877663448
Gerrit-Change-Number: 15793
Gerrit-PatchSet: 4
Gerrit-Owner: ipse <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: ipse <Alexander.Chemeris at gmail.com>
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/20191021/17426a3f/attachment.htm>


More information about the gerrit-log mailing list