summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-09-07 02:55:29 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-09-07 12:18:24 +0000
commit3d62aa724ea50feeb63bbcc8d5171663ca2b88e6 (patch)
tree2463745f8e27792804291cc8f85c1a3359d01fbd
parent05d88069d49e580a6998924e450e8de62ae02da6 (diff)
trxcon/l1ctl.c: refactor Timing Advance handling
-rw-r--r--src/host/trxcon/l1ctl.c10
-rw-r--r--src/host/trxcon/trx_if.c4
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);
}