From 3d62aa724ea50feeb63bbcc8d5171663ca2b88e6 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 7 Sep 2018 02:55:29 +0700 Subject: trxcon/l1ctl.c: refactor Timing Advance handling Change-Id: I0e4f18173347e3a7cb875f95d796e8ea20bfc4bf --- src/host/trxcon/l1ctl.c | 10 ++++++---- src/host/trxcon/trx_if.c | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c index 230ef0a9..1e88f8b4 100644 --- a/src/host/trxcon/l1ctl.c +++ b/src/host/trxcon/l1ctl.c @@ -663,7 +663,6 @@ static int l1ctl_rx_param_req(struct l1ctl_link *l1l, struct msgb *msg) { 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 @@ static int l1ctl_rx_param_req(struct l1ctl_link *l1l, struct msgb *msg) 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 19d8c753..b8bbace5 100644 --- a/src/host/trxcon/trx_if.c +++ b/src/host/trxcon/trx_if.c @@ -388,10 +388,6 @@ static void trx_if_measure_rsp_cb(struct trx_instance *trx, char *resp) 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); } -- cgit v1.2.3