summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-08-03 20:18:05 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commit41de73575289b0272a20a7b17ad04218e1816808 (patch)
tree85c7b5cf347faa15d9bf3a3d1de3c67bae11ea72
parent41b0b3f33363327a090f66bd06a84f83a9af1baa (diff)
host/trxcon/l1ctl.c: handle L1CTL_TCH_MODE_REQ
-rw-r--r--src/host/trxcon/l1ctl.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 5303130..6a9cdb3 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -657,6 +657,40 @@ static int l1ctl_rx_param_req(struct l1ctl_link *l1l, struct msgb *msg)
return 0;
}
+static int l1ctl_rx_tch_mode_req(struct l1ctl_link *l1l, struct msgb *msg)
+{
+ struct l1ctl_tch_mode_req *req;
+ struct trx_ts *ts;
+ int len, i, j;
+
+ req = (struct l1ctl_tch_mode_req *) msg->l1h;
+
+ LOGP(DL1C, LOGL_NOTICE, "Received L1CTL_TCH_MODE_REQ "
+ "(tch_mode=%u, audio_mode=%u)\n", req->tch_mode, req->audio_mode);
+
+ /* Iterate over timeslot list */
+ for (i = 0; i < TRX_TS_COUNT; i++) {
+ /* Timeslot is not allocated */
+ ts = l1l->trx->ts_list[i];
+ if (ts == NULL)
+ continue;
+
+ /* Timeslot is not configured */
+ if (ts->mf_layout == NULL)
+ continue;
+
+ /* Iterate over all allocated lchans */
+ len = talloc_array_length(ts->lchans);
+ for (j = 0; j < len; j++)
+ ts->lchans[j].tch_mode = req->tch_mode;
+ }
+
+ /* TODO: do we need to care about audio_mode? */
+
+ msgb_free(msg);
+ return 0;
+}
+
int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg)
{
struct l1ctl_hdr *l1h;
@@ -685,6 +719,8 @@ int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg)
return l1ctl_rx_data_req(l1l, msg);
case L1CTL_PARAM_REQ:
return l1ctl_rx_param_req(l1l, msg);
+ case L1CTL_TCH_MODE_REQ:
+ return l1ctl_rx_tch_mode_req(l1l, msg);
default:
LOGP(DL1C, LOGL_ERROR, "Unknown MSG: %u\n", l1h->msg_type);
msgb_free(msg);