From d3e8e0cf4c89e24258acbb32b42ea4ad6ec596c4 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 28 Nov 2018 16:35:10 +0100 Subject: 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 --- include/osmocom/bsc/gsm_data.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 15158cdd0..4a8b7be63 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -455,6 +455,18 @@ struct gsm_encr { 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 @@ struct gsm_encr { * 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, -- cgit v1.2.3