aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-11-28 16:39:29 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-12-05 16:06:47 +0000
commit0ba20df9eee495f5f78f6ff727501b6b39e63d39 (patch)
tree2e0744cf903e52369bebbfbf012d050695caa4c4 /include
parentab9a259cd2e5f0d188ebfecdb2a271e8c0dba94b (diff)
bsc: Add define for ts_as_pchan_for_each_lchan with ts->pchan_on_init
It will be used further in follow-up patches. It also provides a place to document its (intricate) logic around it and its possible uses. Change-Id: Ia1d4bdbfca6b9719f54ee609b6bfadf7f3a4bb43
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/gsm_data.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 2f60e4dfe..0b472a47b 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -478,6 +478,19 @@ struct gsm_encr {
*/
#define ts_for_each_lchan(lchan, ts) ts_as_pchan_for_each_lchan(lchan, ts, (ts)->pchan_is)
+/* Iterate over all possible lchans available that have an FSM allocated based
+ * on PCHAN \ref ts (dynamic) configuration.
+ * Iterate all lchan instances set up by this \ref ts type, including those
+ * lchans currently disabled or in process of being enabled (e.g. due to dynamic
+ * timeslot in switchover). Compare ts_for_each_lchan(), which iterates only the
+ * enabled lchans.
+ * For example, it is useful in case dynamic timeslot \ref ts is in process of
+ * switching from configuration PDCH (no lchans) to TCH_F (1 lchan), where
+ * pchan_is is still set to PDCH but \ref ts may contain already an \ref lchan
+ * of type TCH_F which initiated the request to switch the \ts configuration.
+ */
+#define ts_for_each_potential_lchan(lchan, ts) ts_as_pchan_for_each_lchan(lchan, ts, (ts)->pchan_on_init)
+
enum lchan_activate_mode {
FOR_NONE,
FOR_MS_CHANNEL_REQUEST,