Change in osmo-bsc[master]: bsc: Add define for ts_as_pchan_for_each_lchan with ts->pchan_on_init

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Dec 5 16:06:47 UTC 2018


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/11980 )

Change subject: bsc: Add define for ts_as_pchan_for_each_lchan with ts->pchan_on_init
......................................................................

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
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/timeslot_fsm.c
2 files changed, 14 insertions(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 2f60e4d..0b472a4 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -478,6 +478,19 @@
  */
 #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,
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index 8351ff7..a39549b 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -550,7 +550,7 @@
 	ts->pdch_act_allowed = true;
 
 	/* For static TS, check validity. For dyn TS, figure out which PCHAN this should become. */
-	ts_as_pchan_for_each_lchan(lchan, ts, ts->pchan_on_init) {
+	ts_for_each_potential_lchan(lchan, ts) {
 		if (lchan_state_is(lchan, LCHAN_ST_UNUSED))
 			continue;
 

-- 
To view, visit https://gerrit.osmocom.org/11980
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1d4bdbfca6b9719f54ee609b6bfadf7f3a4bb43
Gerrit-Change-Number: 11980
Gerrit-PatchSet: 5
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Assignee: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181205/dd2469f1/attachment.htm>


More information about the gerrit-log mailing list