diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2016-07-29 17:54:57 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2016-08-10 18:06:20 +0200 |
commit | 67a056c122ed588e74835771a3cfda0f2055c284 (patch) | |
tree | 3d3ddbd54bc43dfda1a40148b0c0a7b98a84614e /src/osmo-bts-trx/l1_if.c | |
parent | ef8e2ef6817a78e1598586dfc7275982ec21fd5a (diff) |
dyn TS: complete for TRX
Apply similar fixes as for TCH/F_PDCH also for TCH/F_TCH/H_PDCH:
Detect dyn TS in PDCH mode in ts_is_pdch().
In trx_set_ts(), enhance the "if (TCH_F_PDCH)" to a switch statement including
both dynamic channel types. Adjust the comment to include both kinds.
Change-Id: I6669739cd08780cd9ffb9451cdae9f6b9704c4fe
Diffstat (limited to 'src/osmo-bts-trx/l1_if.c')
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 4d6dc3fc..b89a3594 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -398,9 +398,10 @@ static uint8_t trx_set_ts_as_pchan(struct gsm_bts_trx_ts *ts, if (!(l1h->config.slotmask & (1 << tn))) return NM_NACK_RES_NOTAVAIL; - /* set physical channel. For dynamic TCH/F_PDCH, the caller should have + /* set physical channel. For dynamic timeslots, the caller should have * decided on a more specific PCHAN type already. */ OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH); rc = trx_sched_set_pchan(&l1h->l1s, tn, pchan); if (rc) return NM_NACK_RES_NOTAVAIL; @@ -426,15 +427,25 @@ static uint8_t trx_set_ts_as_pchan(struct gsm_bts_trx_ts *ts, static uint8_t trx_set_ts(struct gsm_bts_trx_ts *ts) { - enum gsm_phys_chan_config pchan = ts->pchan; - - /* For dynamic TCH/F_PDCH, pick the pchan type that should currently be - * active according to TS flags. This should only be called during - * init, PDCH transitions will call trx_set_ts_as_pchan() directly. */ - OSMO_ASSERT((ts->flags & TS_F_PDCH_PENDING_MASK) == 0); - if (pchan == GSM_PCHAN_TCH_F_PDCH) + enum gsm_phys_chan_config pchan; + + /* For dynamic timeslots, pick the pchan type that should currently be + * active. This should only be called during init, PDCH transitions + * will call trx_set_ts_as_pchan() directly. */ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_PDCH: + OSMO_ASSERT((ts->flags & TS_F_PDCH_PENDING_MASK) == 0); pchan = (ts->flags & TS_F_PDCH_ACTIVE)? GSM_PCHAN_PDCH : GSM_PCHAN_TCH_F; + break; + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + OSMO_ASSERT(ts->dyn.pchan_is == ts->dyn.pchan_want); + pchan = ts->dyn.pchan_is; + break; + default: + pchan = ts->pchan; + break; + } return trx_set_ts_as_pchan(ts, pchan); } |