diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2018-08-22 13:28:39 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2018-08-28 19:38:55 +0000
commit1dcd63d36a0352949f0db9290cada5004aab96de (patch)
parent9f5203d2436b86efb341b17f2acb8d9f4bb48ecd (diff)
fix ip.access dyn TS for osmo-bts-trx
For enabling PDCH on a dynamic timeslot, PDTCH and PTCCH SAPIs shall be enabled. While osmo-bts-sysmo uses the lchan->type to determine which SAPIs to enable (see lchan_activate() in osmo-bts-sysmo/oml.c: sapis_for_lchan[lchan->type]), the osmo-bts-trx code instead relies on the chan_nr indicating RSL_CHAN_OSMO_PDCH = 0xc0 (see trx_sched_set_lchan() in common/scheduler.c and the PDTCH,PTCCH entries in trx_chan_desc[]). The 0xc0 cbits are a non-standard invention specifically used for only Osmocom style dyn TS, so the chan_nr for IPA style dyn TS will and should never include this cbits pattern. Hence gsm_lchan2chan_nr() correctly always returns the TCH/F equivalent chan_nr for IPA dyn TS. Because trx_chan_desc[] relies on the 0xc0 in the chan_nr to activate the PDTCH and PTCCH SAPIs, internally patch the 0xc0 cbits over the chan_nr in osmo-bts-trx/l1_if.c for channel de-/activation, iff lchan->type == PDTCH. This is technically a convoluted mix-up of the cbits usage. Nevertheless, it is the simplest way to make IPA dyn TS behave the same as Osmocom dyn TS in scheduler.c. Apparently, IPA style dyn TS have never worked for osmo-bts-trx before? Related: OS#3493 Change-Id: I0eed8a135f2ab7e7c0d15ad5c76430b7fe54df3d
1 files changed, 14 insertions, 0 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index a8fb401f..23fc1963 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -562,6 +562,20 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
" chan_nr 0x%02x\n", chan_nr);
+ /* trx_chan_desc[] in scheduler.c uses the RSL_CHAN_OSMO_PDCH cbits
+ * (0xc0) to indicate the need for PDTCH and PTCCH SAPI activation.
+ * However, 0xc0 is a cbits pattern exclusively used for Osmocom style
+ * dyn TS (a non-standard RSL Chan Activ mod); hence, for IPA style dyn
+ * TS, the chan_nr will never reflect 0xc0 and we would omit the
+ * PDTCH,PTTCH SAPIs. To properly de-/activate the PDTCH SAPIs in
+ * scheduler.c, make sure the 0xc0 cbits are set for de-/activating PDTCH
+ * lchans, i.e. both Osmocom and IPA style dyn TS. (For Osmocom style dyn
+ * TS, the chan_nr typically already reflects 0xc0, while it doesn't for
+ * IPA style.) */
+ if (lchan->type == GSM_LCHAN_PDTCH)
+ chan_nr = RSL_CHAN_OSMO_PDCH | (chan_nr & ~RSL_CHAN_NR_MASK);
/* activate dedicated channel */
trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 1);
/* activate associated channel */