summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-08-04 13:05:09 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commit8daa2c5c96d76a4b52c9827d28b5c030fb57c204 (patch)
treebb9fccaa442737f738ca36a691ca0a9c1c26ba79
parent8bac0863cdf0212e7fa1fd56ca40899f694cc1bf (diff)
host/trxcon/l1ctl.c: do nothing if CCCH mode matches
When the L1CTL_CCCH_MODE_REQ is received, we don't need to reconfigure anything if the current mode matches requested. Change-Id: Ib8a511e4edd7210b1806f47e83f316be00a8cbb1
-rw-r--r--src/host/trxcon/l1ctl.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index ee03ad6..ec774d7 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -413,6 +413,7 @@ static int l1ctl_rx_echo_req(struct l1ctl_link *l1l, struct msgb *msg)
static int l1ctl_rx_ccch_mode_req(struct l1ctl_link *l1l, struct msgb *msg)
{
struct l1ctl_ccch_mode_req *req;
+ struct trx_ts *ts;
int mode, rc = 0;
req = (struct l1ctl_ccch_mode_req *) msg->l1h;
@@ -427,10 +428,21 @@ static int l1ctl_rx_ccch_mode_req(struct l1ctl_link *l1l, struct msgb *msg)
req->ccch_mode == CCCH_MODE_COMBINED ?
"combined" : "not combined");
- /* Reconfigure TS0 */
+ /* Make sure that TS0 is allocated and configured */
+ ts = l1l->trx->ts_list[0];
+ if (ts == NULL || ts->mf_layout == NULL) {
+ LOGP(DL1C, LOGL_ERROR, "TS0 is not configured");
+ rc = -EINVAL;
+ goto exit;
+ }
+
+ /* Choose corresponding channel combination */
mode = req->ccch_mode == CCCH_MODE_COMBINED ?
GSM_PCHAN_CCCH_SDCCH4 : GSM_PCHAN_CCCH;
- rc = sched_trx_configure_ts(l1l->trx, 0, mode);
+
+ /* Do nothing if the current mode matches required */
+ if (ts->mf_layout->chan_config != mode)
+ rc = sched_trx_configure_ts(l1l->trx, 0, mode);
/* Confirm reconfiguration */
if (!rc)