Change in osmocom-bb[master]: trxcon/l1ctl.c: refactor Timing Advance handling

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Sep 6 20:31:44 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10819


Change subject: trxcon/l1ctl.c: refactor Timing Advance handling
......................................................................

trxcon/l1ctl.c: refactor Timing Advance handling

Change-Id: I0e4f18173347e3a7cb875f95d796e8ea20bfc4bf
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/trx_if.c
2 files changed, 6 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/19/10819/1

diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 49d6a12..90c3aaf 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -653,7 +653,6 @@
 {
 	struct l1ctl_par_req *par_req;
 	struct l1ctl_info_ul *ul;
-	int rc = 0;
 
 	ul = (struct l1ctl_info_ul *) msg->l1h;
 	par_req = (struct l1ctl_par_req *) ul->payload;
@@ -661,13 +660,16 @@
 	LOGP(DL1C, LOGL_NOTICE, "Received L1CTL_PARAM_REQ "
 		"(ta=%d, tx_power=%u)\n", par_req->ta, par_req->tx_power);
 
-	rc |= trx_if_cmd_setta(l1l->trx, par_req->ta);
+	/* Instruct TRX to use new TA value */
+	if (l1l->trx->ta != par_req->ta) {
+		trx_if_cmd_setta(l1l->trx, par_req->ta);
+		l1l->trx->ta = par_req->ta;
+	}
 
-	l1l->trx->ta = par_req->ta;
 	l1l->trx->tx_power = par_req->tx_power;
 
 	msgb_free(msg);
-	return rc;
+	return 0;
 }
 
 static int l1ctl_rx_tch_mode_req(struct l1ctl_link *l1l, struct msgb *msg)
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 7e6f7b9..40f1b59 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -413,10 +413,6 @@
 
 int trx_if_cmd_setta(struct trx_instance *trx, int8_t ta)
 {
-	/* Do nothing, if requested TA value matches the current */
-	if (trx->ta == ta)
-		return 0;
-
 	return trx_ctrl_cmd(trx, 0, "SETTA", "%d", ta);
 }
 

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e4f18173347e3a7cb875f95d796e8ea20bfc4bf
Gerrit-Change-Number: 10819
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180906/fe614f11/attachment.htm>


More information about the gerrit-log mailing list