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

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Sep 11 03:27:55 UTC 2018


Harald Welte has submitted this change and it was merged. ( 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(-)

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



diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 230ef0a..1e88f8b 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -663,7 +663,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;
@@ -671,13 +670,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 19d8c75..b8bbace 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -388,10 +388,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: merged
Gerrit-Change-Id: I0e4f18173347e3a7cb875f95d796e8ea20bfc4bf
Gerrit-Change-Number: 10819
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180911/2f6c9ea1/attachment.htm>


More information about the gerrit-log mailing list