<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11980">View Change</a></p><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 (intrincate) 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, 16 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/80/11980/1</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..68b2289 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,21 @@</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%);">+ * List of \ref lchan iterated through this loop is different than \ref</span><br><span style="color: hsl(120, 100%, 40%);">+ * ts_for_each_lchan only if \ref ts is configured as a dynamic timeslot. In</span><br><span style="color: hsl(120, 100%, 40%);">+ * this case, instead of using the currently set mode (among all</span><br><span style="color: hsl(120, 100%, 40%);">+ * possible in the dynamic group) the number of \ref lchan iterated is that of</span><br><span style="color: hsl(120, 100%, 40%);">+ * the channel mode in the dynamic mode group which supports the maximum amount</span><br><span style="color: hsl(120, 100%, 40%);">+ * of \ref lchan.</span><br><span style="color: hsl(120, 100%, 40%);">+ * This is useful in case dynamic timeslot \ref ts is in process of switching from</span><br><span style="color: hsl(120, 100%, 40%);">+ * configuration PDCH (no lchans) to TCH_F (1 lchan), where pchan_is is still</span><br><span style="color: hsl(120, 100%, 40%);">+ * set to PDCH but \ref ts may contain already an \ref lchan of type TCH_F which</span><br><span style="color: hsl(120, 100%, 40%);">+ * 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_lchan_slot(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..994d438 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_lchan_slot(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: newchange </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: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>