diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-09-07 02:55:29 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-09-07 12:18:24 +0000 |
commit | 3d62aa724ea50feeb63bbcc8d5171663ca2b88e6 (patch) | |
tree | 2463745f8e27792804291cc8f85c1a3359d01fbd /src/host/trxcon/l1ctl.c | |
parent | 05d88069d49e580a6998924e450e8de62ae02da6 (diff) |
trxcon/l1ctl.c: refactor Timing Advance handling
Change-Id: I0e4f18173347e3a7cb875f95d796e8ea20bfc4bf
Diffstat (limited to 'src/host/trxcon/l1ctl.c')
-rw-r--r-- | src/host/trxcon/l1ctl.c | 10 |
1 files changed, 6 insertions, 4 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) |