<p>Neels Hofmeyr has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10598">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix ip.access dyn TS for osmo-bts-trx<br><br>For enabling PDCH on a dynamic timeslot, PDTCH and PTCCH SAPIs shall be<br>enabled. While osmo-bts-sysmo uses the lchan->type to determine which SAPIs to<br>enable (see lchan_activate() in osmo-bts-sysmo/oml.c:<br>sapis_for_lchan[lchan->type]), the osmo-bts-trx code instead relies on the<br>chan_nr indicating RSL_CHAN_OSMO_PDCH = 0xc0 (see trx_sched_set_lchan() in<br>common/scheduler.c and the PDTCH,PTCCH entries in trx_chan_desc[]).<br><br>The 0xc0 cbits are a non-standard invention specifically used for only Osmocom<br>style dyn TS, so the chan_nr for IPA style dyn TS will and should never include<br>this cbits pattern. Hence gsm_lchan2chan_nr() correctly always returns the<br>TCH/F equivalent chan_nr for IPA dyn TS.<br><br>Because trx_chan_desc[] relies on the 0xc0 in the chan_nr to activate the PDTCH<br>and PTCCH SAPIs, internally patch the 0xc0 cbits over the chan_nr in<br>osmo-bts-trx/l1_if.c for channel de-/activation, iff lchan->type == PDTCH.<br><br>This is technically a convoluted mix-up of the cbits usage. Nevertheless, it is<br>the simplest way to make IPA dyn TS behave the same as Osmocom dyn TS in<br>scheduler.c.<br><br>Apparently, IPA style dyn TS have never worked for osmo-bts-trx before?<br><br>Related: OS#3493<br>Change-Id: I0eed8a135f2ab7e7c0d15ad5c76430b7fe54df3d<br>---<br>M src/osmo-bts-trx/l1_if.c<br>1 file changed, 14 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/10598/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c</span><br><span>index a8fb401..23fc196 100644</span><br><span>--- a/src/osmo-bts-trx/l1_if.c</span><br><span>+++ b/src/osmo-bts-trx/l1_if.c</span><br><span>@@ -562,6 +562,20 @@</span><br><span>                                               " chan_nr 0x%02x\n", chan_nr);</span><br><span>                                     break;</span><br><span>                               }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                           /* trx_chan_desc[] in scheduler.c uses the RSL_CHAN_OSMO_PDCH cbits</span><br><span style="color: hsl(120, 100%, 40%);">+                            * (0xc0) to indicate the need for PDTCH and PTCCH SAPI activation.</span><br><span style="color: hsl(120, 100%, 40%);">+                            * However, 0xc0 is a cbits pattern exclusively used for Osmocom style</span><br><span style="color: hsl(120, 100%, 40%);">+                                 * dyn TS (a non-standard RSL Chan Activ mod); hence, for IPA style dyn</span><br><span style="color: hsl(120, 100%, 40%);">+                                * TS, the chan_nr will never reflect 0xc0 and we would omit the</span><br><span style="color: hsl(120, 100%, 40%);">+                               * PDTCH,PTTCH SAPIs. To properly de-/activate the PDTCH SAPIs in</span><br><span style="color: hsl(120, 100%, 40%);">+                              * scheduler.c, make sure the 0xc0 cbits are set for de-/activating PDTCH</span><br><span style="color: hsl(120, 100%, 40%);">+                              * lchans, i.e. both Osmocom and IPA style dyn TS. (For Osmocom style dyn</span><br><span style="color: hsl(120, 100%, 40%);">+                              * TS, the chan_nr typically already reflects 0xc0, while it doesn't for</span><br><span style="color: hsl(120, 100%, 40%);">+                           * IPA style.) */</span><br><span style="color: hsl(120, 100%, 40%);">+                             if (lchan->type == GSM_LCHAN_PDTCH)</span><br><span style="color: hsl(120, 100%, 40%);">+                                        chan_nr = RSL_CHAN_OSMO_PDCH | (chan_nr & ~RSL_CHAN_NR_MASK);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                          /* activate dedicated channel */</span><br><span>                             trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 1);</span><br><span>                                /* activate associated channel */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10598">change 10598</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10598"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0eed8a135f2ab7e7c0d15ad5c76430b7fe54df3d </div>
<div style="display:none"> Gerrit-Change-Number: 10598 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>