Change in osmo-bts[master]: Support configuring TA loop SACCH block rate

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
Thu Sep 9 17:31:56 UTC 2021


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


Change subject: Support configuring TA loop SACCH block rate
......................................................................

Support configuring TA loop SACCH block rate

Similar to what is already provided for power control loops. However,
there's no existing way to communicate TA control parameters from the
BSC to the BTS, so implement them locally in BTS vty.

Related: SYS#5371
Change-Id: I9fa71f836bb9a79b0ef2567bfcfdf38ff217840b
---
M include/osmo-bts/bts_trx.h
M include/osmo-bts/gsm_data.h
M src/common/ta_control.c
M src/common/vty.c
M tests/ta_control/ta_control_test.c
5 files changed, 33 insertions(+), 2 deletions(-)



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

diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h
index f033573..e1959c8 100644
--- a/include/osmo-bts/bts_trx.h
+++ b/include/osmo-bts/bts_trx.h
@@ -30,6 +30,7 @@
         uint8_t max_power_backoff_8psk; /* in actual dB OC-2G only */
         uint8_t c0_idle_power_red;      /* in actual dB OC-2G only */
 
+	uint8_t ta_ctrl_interval; /* 1 step is 2 SACCH periods */
 
 	struct trx_power_params power_params;
 	struct gsm_power_ctrl_params *bs_dpc_params; /* BS Dynamic Power Control */
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index e23497f..d21ec04 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -255,6 +255,8 @@
 };
 
 struct lchan_ta_ctrl_state {
+	/* Number of SACCH blocks to skip */
+	int skip_block_num;
 	/* Currently requested TA */
 	uint8_t current;
 };
diff --git a/src/common/ta_control.c b/src/common/ta_control.c
index fb33ff2..8dba25e 100644
--- a/src/common/ta_control.c
+++ b/src/common/ta_control.c
@@ -23,6 +23,7 @@
 /* Related specs: 3GPP TS 45.010 sections 5.5, 5.6 */
 
 #include <osmo-bts/gsm_data.h>
+#include <osmo-bts/bts_trx.h>
 #include <osmo-bts/logging.h>
 
 /* 90% of one bit duration in 1/256 symbols: 256*0.9 */
@@ -47,7 +48,16 @@
 	int16_t new_ta;
 	/* Shall we skip current block based on configured interval? */
 
-	/*TODO: implement P_CON_INTERVAL for TA loop */
+	/* TA control interval: how many blocks do we skip? */
+	if (lchan->ta_ctrl.skip_block_num-- > 0)
+		return;
+
+	/* Reset the number of SACCH blocks to be skipped:
+	 *   ctrl_interval=0 => 0 blocks to skip,
+	 *   ctrl_interval=1 => 1 blocks to skip,
+	 *   ctrl_interval=2 => 3 blocks to skip,
+	 *     so basically ctrl_interval * 2 - 1. */
+	lchan->ta_ctrl.skip_block_num = lchan->ts->trx->ta_ctrl_interval * 2 - 1;
 
 	int16_t delta_ta = toa256/256;
 	if (toa256 >= 0) {
diff --git a/src/common/vty.c b/src/common/vty.c
index 62e2d70..9e9c151 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -370,6 +370,8 @@
 		vty_out(vty, "  ms-power-control %s%s",
 			trx->ms_pwr_ctl_soft ? "osmo" : "dsp",
 			VTY_NEWLINE);
+		vty_out(vty, "  ta-control interval %u%s",
+			trx->ta_ctrl_interval, VTY_NEWLINE);
 		vty_out(vty, "  phy %u instance %u%s", pinst->phy_link->num,
 			pinst->num, VTY_NEWLINE);
 
@@ -1009,6 +1011,18 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_ta_ctrl_interval, cfg_ta_ctrl_interval_cmd,
+	"ta-control interval <0-31>",
+	"Set TA control interval\n"
+	"As in P_CON_INTERVAL, in units of 2 SACCH periods (0.96 seconds) (default=0, every SACCH block)\n")
+{
+	struct gsm_bts_trx *trx = vty->index;
+
+	trx->ta_ctrl_interval = atoi(argv[0]);
+
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_trx_phy, cfg_trx_phy_cmd,
 	"phy <0-255> instance <0-255>",
 	"Configure PHY Link+Instance for this TRX\n"
@@ -2487,6 +2501,7 @@
 	install_element(TRX_NODE, &cfg_trx_pr_step_size_cmd);
 	install_element(TRX_NODE, &cfg_trx_pr_step_interval_cmd);
 	install_element(TRX_NODE, &cfg_trx_ms_power_control_cmd);
+	install_element(TRX_NODE, &cfg_ta_ctrl_interval_cmd);
 	install_element(TRX_NODE, &cfg_trx_phy_cmd);
 
 	install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd);
diff --git a/tests/ta_control/ta_control_test.c b/tests/ta_control/ta_control_test.c
index 200fd31..253491a 100644
--- a/tests/ta_control/ta_control_test.c
+++ b/tests/ta_control/ta_control_test.c
@@ -26,10 +26,13 @@
 #include <osmo-bts/logging.h>
 #include <osmo-bts/gsm_data.h>
 #include <osmo-bts/ta_control.h>
+#include <osmo-bts/bts_trx.h>
 
 void lchan_ms_ta_ctrl_test(int16_t toa256_start, unsigned int steps)
 {
-	struct gsm_lchan lchan = { };
+	struct gsm_bts_trx trx = { };
+	struct gsm_bts_trx_ts ts = { .trx = &trx };
+	struct gsm_lchan lchan = { .ts = &ts };
 	unsigned int i;
 	uint8_t rqd_ta_after;
 	uint8_t rqd_ta_before;

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I9fa71f836bb9a79b0ef2567bfcfdf38ff217840b
Gerrit-Change-Number: 25436
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210909/d0287778/attachment.htm>


More information about the gerrit-log mailing list