path: root/src/osmo-bts-litecell15
diff options
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-litecell15
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-litecell15')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 4093225f..99852e39 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -388,7 +388,7 @@ static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg,
} else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) {
/* The sapi depends on DSP configuration, not
* on the actual SYSTEM INFORMATION 3. */
- u8BlockNbr = L1SAP_FN2CCCHBLOCK(u32Fn);
+ u8BlockNbr = l1sap_fn2ccch_block(u32Fn);
if (u8BlockNbr >= num_agch(trx, "PH-DATA-REQ"))
sapi = GsmL1_Sapi_Pch;