<p>Pau Espin Pedrol <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/11980">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bsc: Add define for ts_as_pchan_for_each_lchan with ts->pchan_on_init<br><br>It will be used further in follow-up patches. It also provides a place<br>to document its (intricate) logic around it and its possible uses.<br><br>Change-Id: Ia1d4bdbfca6b9719f54ee609b6bfadf7f3a4bb43<br>---<br>M include/osmocom/bsc/gsm_data.h<br>M src/osmo-bsc/timeslot_fsm.c<br>2 files changed, 14 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h</span><br><span>index 2f60e4d..0b472a4 100644</span><br><span>--- a/include/osmocom/bsc/gsm_data.h</span><br><span>+++ b/include/osmocom/bsc/gsm_data.h</span><br><span>@@ -478,6 +478,19 @@</span><br><span>  */</span><br><span> #define ts_for_each_lchan(lchan, ts) ts_as_pchan_for_each_lchan(lchan, ts, (ts)->pchan_is)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Iterate over all possible lchans available that have an FSM allocated based</span><br><span style="color: hsl(120, 100%, 40%);">+ * on PCHAN \ref ts (dynamic) configuration.</span><br><span style="color: hsl(120, 100%, 40%);">+ * Iterate all lchan instances set up by this \ref ts type, including those</span><br><span style="color: hsl(120, 100%, 40%);">+ * lchans currently disabled or in process of being enabled (e.g. due to dynamic</span><br><span style="color: hsl(120, 100%, 40%);">+ * timeslot in switchover). Compare ts_for_each_lchan(), which iterates only the</span><br><span style="color: hsl(120, 100%, 40%);">+ * enabled lchans.</span><br><span style="color: hsl(120, 100%, 40%);">+ * For example, it is useful in case dynamic timeslot \ref ts is in process of</span><br><span style="color: hsl(120, 100%, 40%);">+ * switching from configuration PDCH (no lchans) to TCH_F (1 lchan), where</span><br><span style="color: hsl(120, 100%, 40%);">+ * pchan_is is still set to PDCH but \ref ts may contain already an \ref lchan</span><br><span style="color: hsl(120, 100%, 40%);">+ * of type TCH_F which initiated the request to switch the \ts configuration.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+#define ts_for_each_potential_lchan(lchan, ts) ts_as_pchan_for_each_lchan(lchan, ts, (ts)->pchan_on_init)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> enum lchan_activate_mode {</span><br><span>     FOR_NONE,</span><br><span>    FOR_MS_CHANNEL_REQUEST,</span><br><span>diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c</span><br><span>index 8351ff7..a39549b 100644</span><br><span>--- a/src/osmo-bsc/timeslot_fsm.c</span><br><span>+++ b/src/osmo-bsc/timeslot_fsm.c</span><br><span>@@ -550,7 +550,7 @@</span><br><span>       ts->pdch_act_allowed = true;</span><br><span> </span><br><span>  /* For static TS, check validity. For dyn TS, figure out which PCHAN this should become. */</span><br><span style="color: hsl(0, 100%, 40%);">-     ts_as_pchan_for_each_lchan(lchan, ts, ts->pchan_on_init) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ts_for_each_potential_lchan(lchan, ts) {</span><br><span>             if (lchan_state_is(lchan, LCHAN_ST_UNUSED))</span><br><span>                  continue;</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11980">change 11980</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/11980"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia1d4bdbfca6b9719f54ee609b6bfadf7f3a4bb43 </div>
<div style="display:none"> Gerrit-Change-Number: 11980 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Assignee: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>