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/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11004 )
Change subject: get_lchan_by_chan_nr(): Fix resolution of CBCH
......................................................................
get_lchan_by_chan_nr(): Fix resolution of CBCH
The CBCH (as per GSM specs) always maps on sub-slot 2 of either
the SDCCH/4 or SDCCH/8 that it replaces. However, the way how we
express it as RSL-style channel number (0xC8) doesn't allow room
for any sub-slots. The top 5 bits are used for expressing CBCH, while
the bottom 3 bits are used for the timeslot number (TN).
So when transforming from channel number to lchan, we must handle the
CBCH case specially by using a hard-coded sub-slot number of 2.
Change-Id: I44e2f763d5d25311167f435f2ca7e030b2a3f009
Related: OS#1617
---
M src/common/l1sap.c
1 file changed, 12 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
Harald Welte: Looks good to me, approved
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 1a7a965..ac4f0be 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -58,7 +58,18 @@
struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx,
unsigned int chan_nr)
{
- return &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
+ unsigned int tn, ss;
+
+ tn = L1SAP_CHAN2TS(chan_nr);
+ OSMO_ASSERT(tn < ARRAY_SIZE(trx->ts));
+
+ if (L1SAP_IS_CHAN_CBCH(chan_nr))
+ ss = 2; /* CBCH is always on sub-slot 2 */
+ else
+ ss = l1sap_chan2ss(chan_nr);
+ OSMO_ASSERT(ss < ARRAY_SIZE(trx->ts[tn].lchan));
+
+ return &trx->ts[tn].lchan[ss];
}
static struct gsm_lchan *
--
To view, visit https://gerrit.osmocom.org/11004
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I44e2f763d5d25311167f435f2ca7e030b2a3f009
Gerrit-Change-Number: 11004
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180917/c40b77a5/attachment.htm>