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
Tue Sep 14 10:03:26 UTC 2021


pespin has submitted this change. ( 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/osmo-bts.vty
M tests/ta_control/ta_control_test.c
6 files changed, 36 insertions(+), 2 deletions(-)

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



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 0869426..9fe68d6 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 fd49d60..025699c 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>
 
 /* 3GPP TS 45.010 sec 5.6.3 Delay assessment error:
@@ -48,7 +49,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..f99881a 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,19 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_ta_ctrl_interval, cfg_ta_ctrl_interval_cmd,
+	"ta-control interval <0-31>",
+	"Timing Advance Control Parameters\n"
+	"Set TA control loop 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 +2502,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/osmo-bts.vty b/tests/osmo-bts.vty
index 4873030..fb74747 100644
--- a/tests/osmo-bts.vty
+++ b/tests/osmo-bts.vty
@@ -284,6 +284,7 @@
   power-ramp step-size <1-100000> (dB|mdB)
   power-ramp step-interval <1-100>
   ms-power-control (dsp|osmo)
+  ta-control interval <0-31>
   phy <0-255> instance <0-255>
 ...
 OsmoBTS(trx)# ?
@@ -291,5 +292,6 @@
   user-gain         Inform BTS about additional, user-provided gain or attenuation at TRX output
   power-ramp        Power-Ramp settings
   ms-power-control  Mobile Station Power Level Control
+  ta-control        Timing Advance Control Parameters
   phy               Configure PHY Link+Instance for this TRX
 ...
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: 5
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
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/20210914/15d686a3/attachment.htm>


More information about the gerrit-log mailing list