aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-virtual
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-09-30 14:50:39 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-30 15:50:01 +0200
commit173555dab71d2bcd1e1984a2608e1dd7f0e77dc5 (patch)
tree7bddedb01c0b788ffda8132b42ce51a9898b8787 /src/osmo-bts-virtual
parent2c1a46a2ddd306f0f6758d5d5af67534adf74c28 (diff)
Fix computing CCCH block number from frame number
The existing implementation used a simplistic macro, which was wrong in many ways: 1) it returned a negative value for "fn % 51 < 5" conditions without raising any error message or asserting 2) it returned a wrong block number for many different input frame numbers, as it didn't account properly for the FCCH/SCH gaps between the blocks Let's replace the simplistic macro with a proper lookup table based on TS 05.02, and let's OSMO_ASSERT() if this is ever called with non-CCCH frame numbers. Change-Id: I11fd6cc558bb61c40c2019e46f56c1fe78ef39f5 Closes: OS#3024
Diffstat (limited to 'src/osmo-bts-virtual')
-rw-r--r--src/osmo-bts-virtual/scheduler_virtbts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c
index cdbb9c1f..997ccbc2 100644
--- a/src/osmo-bts-virtual/scheduler_virtbts.c
+++ b/src/osmo-bts-virtual/scheduler_virtbts.c
@@ -79,7 +79,7 @@ static void tx_to_virt_um(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
timeslot = tn;
/* in Osmocom, AGCH is only sent on ccch block 0. no idea why. this seems to cause false GSMTAP channel
* types for agch and pch. */
- if (rsl_chantype == RSL_CHAN_PCH_AGCH && L1SAP_FN2CCCHBLOCK(fn) == 0)
+ if (rsl_chantype == RSL_CHAN_PCH_AGCH && l1sap_fn2ccch_block(fn) == 0)
gsmtap_chantype = GSMTAP_CHANNEL_PCH;
else
gsmtap_chantype = chantype_rsl2gsmtap(rsl_chantype, chdesc->link_id); /* the logical channel type */