fixeria submitted this change.
l1sap: use gsm0502_fn2ccch_block() from libosmogsm
Keep the l1sap specific wrapper because we still want to assert().
Change-Id: I7097ba87f42689d2336014da9173cadbdaa9fdab
Depends: libosmocore.git I8cbd31226754e95887358ed83a928e2f567f4cf3
---
M TODO-RELEASE
M src/common/l1sap.c
2 files changed, 14 insertions(+), 27 deletions(-)
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 47947da..3ab39bb 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -12,3 +12,4 @@
libosmocoding >1.8.0 gsm0503_tch_hr_encode() extended to accept
TS 101 318 format;
gsm0503_tch_hr_decode2() new function
+libosmogsm >1.8.0 gsm0502_fn2ccch_block() new function
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 9d824e3..528a735 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -58,36 +58,10 @@
#include <osmo-bts/pcuif_proto.h>
#include <osmo-bts/cbch.h>
-
-#define CB_FCCH -1
-#define CB_SCH -2
-#define CB_BCCH -3
-#define CB_IDLE -4
-
-/* according to TS 05.02 Clause 7 Table 3 of 9 an Figure 8a */
-static const int ccch_block_table[51] = {
- CB_FCCH, CB_SCH,/* 0..1 */
- CB_BCCH, CB_BCCH, CB_BCCH, CB_BCCH, /* 2..5: BCCH */
- 0, 0, 0, 0, /* 6..9: B0 */
- CB_FCCH, CB_SCH,/* 10..11 */
- 1, 1, 1, 1, /* 12..15: B1 */
- 2, 2, 2, 2, /* 16..19: B2 */
- CB_FCCH, CB_SCH,/* 20..21 */
- 3, 3, 3, 3, /* 22..25: B3 */
- 4, 4, 4, 4, /* 26..29: B4 */
- CB_FCCH, CB_SCH,/* 30..31 */
- 5, 5, 5, 5, /* 32..35: B5 */
- 6, 6, 6, 6, /* 36..39: B6 */
- CB_FCCH, CB_SCH,/* 40..41 */
- 7, 7, 7, 7, /* 42..45: B7 */
- 8, 8, 8, 8, /* 46..49: B8 */
- -4 /* 50: Idle */
-};
-
/* determine the CCCH block number based on the frame number */
unsigned int l1sap_fn2ccch_block(uint32_t fn)
{
- int rc = ccch_block_table[fn%51];
+ int rc = gsm0502_fn2ccch_block(fn);
/* if FN is negative, we were called for something that's not CCCH! */
OSMO_ASSERT(rc >= 0);
return rc;
To view, visit change 33403. To unsubscribe, or for help writing mail filters, visit settings.