Change in osmo-trx[master]: multi-ARFCN: fix maximum number of carriers limitation

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 Apr 11 07:33:40 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13472 )

Change subject: multi-ARFCN: fix maximum number of carriers limitation
......................................................................

multi-ARFCN: fix maximum number of carriers limitation

Maximum number of carriers is fixed to 3 channels on a single
physical RF channel in multi-ARFCN mode. For some reason, it
was limited to 5.

Let's fix this, and also follow this limitation in the
following VTY command handlers:

  - cfg_multi_arfcn_cmd,
  - cfg_chan_cmd.

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

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



diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c
index 3b1b979..06e20ab 100644
--- a/CommonLibs/trx_vty.c
+++ b/CommonLibs/trx_vty.c
@@ -236,12 +236,16 @@
 
 	if (strcmp("disable", argv[0]) == 0) {
 		trx->cfg.multi_arfcn = false;
-	} else if (strcmp("enable", argv[0]) == 0) {
-		trx->cfg.multi_arfcn = true;
-	} else {
+		return CMD_SUCCESS;
+	}
+
+	if (trx->cfg.num_chans > TRX_MCHAN_MAX) {
+		vty_out(vty, "Up to %i channels are supported for multi-TRX mode%s",
+			TRX_MCHAN_MAX, VTY_NEWLINE);
 		return CMD_WARNING;
 	}
 
+	trx->cfg.multi_arfcn = true;
 	return CMD_SUCCESS;
 }
 
@@ -354,7 +358,12 @@
 	if (idx >= TRX_CHAN_MAX) {
 		vty_out(vty, "Chan list full.%s", VTY_NEWLINE);
 		return CMD_WARNING;
+	} else if (trx->cfg.multi_arfcn && trx->cfg.num_chans >= TRX_MCHAN_MAX) {
+		vty_out(vty, "Up to %i channels are supported for multi-TRX mode%s",
+			TRX_MCHAN_MAX, VTY_NEWLINE);
+		return CMD_WARNING;
 	}
+
 	if (trx->cfg.num_chans < idx) { /* Unexisting or creating non-consecutive */
 		vty_out(vty, "Non-existent or non-consecutive chan %d.%s",
 				idx, VTY_NEWLINE);
diff --git a/CommonLibs/trx_vty.h b/CommonLibs/trx_vty.h
index 8d251ee..8e91113 100644
--- a/CommonLibs/trx_vty.h
+++ b/CommonLibs/trx_vty.h
@@ -6,7 +6,10 @@
 
 extern struct vty_app_info g_vty_info;
 
+/* Maximum number of physical RF channels */
 #define TRX_CHAN_MAX 8
+/* Maximum number of carriers in multi-ARFCN mode */
+#define TRX_MCHAN_MAX 3
 
 /* Samples-per-symbol for downlink path
  *     4 - Uses precision modulator (more computation, less distortion)
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index b252d0c..7489e7c 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -411,7 +411,7 @@
 
 int trx_validate_config(struct trx_ctx *trx)
 {
-	if (trx->cfg.multi_arfcn && trx->cfg.num_chans > 5) {
+	if (trx->cfg.multi_arfcn && trx->cfg.num_chans > TRX_MCHAN_MAX) {
 		LOG(ERROR) << "Unsupported number of channels";
 		return -1;
 	}

-- 
To view, visit https://gerrit.osmocom.org/13472
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817
Gerrit-Change-Number: 13472
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Tom Tsou <tom at tsou.cc>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190411/5fbd2f69/attachment.htm>


More information about the gerrit-log mailing list