summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/l1ctl.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-08-04 13:05:09 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commit2e062039b662b02675d1795e14564021cde89c6e (patch)
treeb859986782febc424bd11cd317c3f2733e9bafa1 /src/host/trxcon/l1ctl.c
parentf28f0d343f6579778b45874de694c74b88e13b6f (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
Diffstat (limited to 'src/host/trxcon/l1ctl.c')
-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 ee03ad60..ec774d71 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)