diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-08-03 20:18:05 +0600 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-11-19 17:35:07 +0700 |
commit | fd9aaaf3d0b00641fd26c114d44c0f963502e7c5 (patch) | |
tree | 28abebbb8c043911e758a701f47bfa21556cd091 | |
parent | 28088c8910171dda2d737a90a8cd40f13052ecc6 (diff) |
host/trxcon/l1ctl.c: handle L1CTL_TCH_MODE_REQ
Change-Id: Ib2332e1610fa873755cdfa745153c7b7d4a72a62
-rw-r--r-- | src/host/trxcon/l1ctl.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c index 5303130c..6a9cdb3c 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); |