Change in osmo-bsc[master]: bsc: ts_as_pchan_for_each_lchan: reorder and improve documentation

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
Thu Nov 29 15:39:02 UTC 2018


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

Change subject: bsc: ts_as_pchan_for_each_lchan: reorder and improve documentation
......................................................................

bsc: ts_as_pchan_for_each_lchan: reorder and improve documentation

It is moved prior to its user in the header file.

Change-Id: I59f52401ba37b351ba3848e8e9ffb3b24c259496
---
M include/osmocom/bsc/gsm_data.h
1 file changed, 12 insertions(+), 9 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 15158cd..4a8b7be 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -455,6 +455,18 @@
 	     bsc_subscr_name(lchan && lchan->conn ? lchan->conn->bsub : NULL), \
 	     ## args)
 
+/* Iterate lchans that have an FSM allocated based based on explicit pchan kind
+ * (GSM_PCHAN_* constant).
+ * Remark: PDCH related lchans are not handled in BSC but in PCU, so trying to
+ * 	  iterate through GSM_PCHAN_PDCH is considered a void loop.
+ */
+#define ts_as_pchan_for_each_lchan(lchan, ts, as_pchan) \
+	for (lchan = (ts)->lchan; \
+	     ((lchan - (ts)->lchan) < ARRAY_SIZE((ts)->lchan)) \
+	     && lchan->fi \
+	     && lchan->nr < pchan_subslots(as_pchan); \
+	     lchan++)
+
 /* usage:
  * struct gsm_lchan *lchan;
  * struct gsm_bts_trx_ts *ts = get_some_timeslot();
@@ -464,15 +476,6 @@
  * Iterate only those lchans that have an FSM allocated. */
 #define ts_for_each_lchan(lchan, ts) ts_as_pchan_for_each_lchan(lchan, ts, (ts)->pchan_is)
 
-/* Same as ts_for_each_lchan() but with an explicit pchan kind (GSM_PCHAN_* constant).
- * Iterate only those lchans that have an FSM allocated. */
-#define ts_as_pchan_for_each_lchan(lchan, ts, as_pchan) \
-	for (lchan = (ts)->lchan; \
-	     ((lchan - (ts)->lchan) < ARRAY_SIZE((ts)->lchan)) \
-	     && lchan->fi \
-	     && lchan->nr < pchan_subslots(as_pchan); \
-	     lchan++)
-
 enum lchan_activate_mode {
 	FOR_NONE,
 	FOR_MS_CHANNEL_REQUEST,

-- 
To view, visit https://gerrit.osmocom.org/11978
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: I59f52401ba37b351ba3848e8e9ffb3b24c259496
Gerrit-Change-Number: 11978
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181129/4f7c1e14/attachment.htm>


More information about the gerrit-log mailing list