fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/31977 )


Change subject: osmo-bts-virtual: properly handle dynamic TS in vbts_set_ts()
......................................................................

osmo-bts-virtual: properly handle dynamic TS in vbts_set_ts()

Change-Id: I5db5b7dd6a8e84cf9a0d84f04a650c2ed8a4e368
---
M src/osmo-bts-virtual/bts_model.c
1 file changed, 30 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/31977/1

diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c
index 8704056..ee10c42 100644
--- a/src/osmo-bts-virtual/bts_model.c
+++ b/src/osmo-bts-virtual/bts_model.c
@@ -100,7 +100,27 @@

 static uint8_t vbts_set_ts(struct gsm_bts_trx_ts *ts)
 {
-       if (trx_sched_set_pchan(ts, ts->pchan) != 0)
+       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_OSMO_DYN:
+               OSMO_ASSERT(ts->dyn.pchan_is == ts->dyn.pchan_want);
+               pchan = ts->dyn.pchan_is;
+               break;
+       default:
+               pchan = ts->pchan;
+               break;
+       }
+
+       if (trx_sched_set_pchan(ts, pchan) != 0)
                return NM_NACK_RES_NOTAVAIL;

        return 0;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/31977
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I5db5b7dd6a8e84cf9a0d84f04a650c2ed8a4e368
Gerrit-Change-Number: 31977
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to