summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-04-02 19:57:55 +0200
committerHarald Welte <laforge@gnumonks.org>2018-04-02 19:57:55 +0200
commit9d90d1907b9d1013a07ef7a9c187f16bc29129fb (patch)
tree26ab4e3147b39e1c5dc3900eee9b8a8c48b982a6 /src/host/trxcon
parent96a8f288c66dee920f5705dd976f13593fc29104 (diff)
trxcon: Respect the tch_mode field of DM_EST_REQ
the initial tch_mode is not always 0 (signalling) but can very well be directly a codec mode, if the initial activation of the channel is in speech mode as opposed to signalling Change-Id: I96e4c89da1165e9c5287d863e0e65d811460c606
Diffstat (limited to 'src/host/trxcon')
-rw-r--r--src/host/trxcon/l1ctl.c6
-rw-r--r--src/host/trxcon/sched_trx.c7
-rw-r--r--src/host/trxcon/sched_trx.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 3de0cf68..a08c4605 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -543,8 +543,8 @@ static int l1ctl_rx_dm_est_req(struct l1ctl_link *l1l, struct msgb *msg)
chan_nr = ul->chan_nr;
LOGP(DL1C, LOGL_NOTICE, "Received L1CTL_DM_EST_REQ (arfcn=%u, "
- "chan_nr=0x%02x, tsc=%u)\n", (band_arfcn &~ ARFCN_FLAG_MASK),
- chan_nr, est_req->tsc);
+ "chan_nr=0x%02x, tsc=%u, tch_mode=0x%02x)\n", (band_arfcn &~ ARFCN_FLAG_MASK),
+ chan_nr, est_req->tsc, est_req->tch_mode);
if (est_req->h) {
LOGP(DL1C, LOGL_ERROR, "FHSS is not supported\n");
@@ -583,7 +583,7 @@ static int l1ctl_rx_dm_est_req(struct l1ctl_link *l1l, struct msgb *msg)
sched_trx_deactivate_all_lchans(ts);
/* Activate only requested lchans */
- rc = sched_trx_set_lchans(ts, chan_nr, 1);
+ rc = sched_trx_set_lchans(ts, chan_nr, 1, est_req->tch_mode);
if (rc) {
LOGP(DL1C, LOGL_ERROR, "Couldn't activate requested lchans\n");
rc = -EINVAL;
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 168c4efa..c263ce7f 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -372,7 +372,7 @@ struct trx_lchan_state *sched_trx_find_lchan(struct trx_ts *ts,
return NULL;
}
-int sched_trx_set_lchans(struct trx_ts *ts, uint8_t chan_nr, int active)
+int sched_trx_set_lchans(struct trx_ts *ts, uint8_t chan_nr, int active, uint8_t tch_mode)
{
const struct trx_lchan_desc *lchan_desc;
struct trx_lchan_state *lchan;
@@ -389,9 +389,10 @@ int sched_trx_set_lchans(struct trx_ts *ts, uint8_t chan_nr, int active)
lchan_desc = &trx_lchan_desc[lchan->type];
if (lchan_desc->chan_nr == (chan_nr & 0xf8)) {
- if (active)
+ if (active) {
rc |= sched_trx_activate_lchan(ts, lchan->type);
- else
+ lchan->tch_mode = tch_mode;
+ } else
rc |= sched_trx_deactivate_lchan(ts, lchan->type);
}
}
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index ce1c7f4f..17e30bff 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -266,7 +266,7 @@ enum trx_lchan_type sched_trx_chan_nr2lchan_type(uint8_t chan_nr,
uint8_t link_id);
void sched_trx_deactivate_all_lchans(struct trx_ts *ts);
-int sched_trx_set_lchans(struct trx_ts *ts, uint8_t chan_nr, int active);
+int sched_trx_set_lchans(struct trx_ts *ts, uint8_t chan_nr, int active, uint8_t tch_mode);
int sched_trx_activate_lchan(struct trx_ts *ts, enum trx_lchan_type chan);
int sched_trx_deactivate_lchan(struct trx_ts *ts, enum trx_lchan_type chan);
struct trx_lchan_state *sched_trx_find_lchan(struct trx_ts *ts,