use new gsm48_number_of_paging_subchannels from libosmocore
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index c246213..d186008 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -45,8 +45,6 @@
 #define RSL_ALLOC_SIZE		1024
 #define RSL_ALLOC_HEADROOM	128
 
-#define MAX(a, b) (a) >= (b) ? (a) : (b)
-
 static int rsl_send_imm_assignment(struct gsm_lchan *lchan);
 
 static void send_lchan_signal(int sig_no, struct gsm_lchan *lchan,
@@ -1896,18 +1894,6 @@
 	return rc;
 }
 
-/* From Table 10.5.33 of GSM 04.08 */
-int rsl_number_of_paging_subchannels(struct gsm_bts *bts)
-{
-	if (bts->si_common.chan_desc.ccch_conf == RSL_BCCH_CCCH_CONF_1_C) {
-		return MAX(1, (3 - bts->si_common.chan_desc.bs_ag_blks_res))
-			* (bts->si_common.chan_desc.bs_pa_mfrms + 2);
-	} else {
-		return (9 - bts->si_common.chan_desc.bs_ag_blks_res)
-			* (bts->si_common.chan_desc.bs_pa_mfrms + 2);
-	}
-}
-
 int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number,
 		       uint8_t cb_command, const uint8_t *data, int len)
 {
diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c
index 2dcd3b4..04f14c6 100644
--- a/openbsc/src/libbsc/paging.c
+++ b/openbsc/src/libbsc/paging.c
@@ -38,8 +38,10 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#include <openbsc/paging.h>
 #include <osmocom/core/talloc.h>
+#include <osmocom/gsm/gsm48.h>
+
+#include <openbsc/paging.h>
 #include <openbsc/debug.h>
 #include <openbsc/signal.h>
 #include <openbsc/abis_rsl.h>
@@ -61,7 +63,7 @@
 	ccch_conf = bts->si_common.chan_desc.ccch_conf;
 	bs_cc_chans = rsl_ccch_conf_to_bs_cc_chans(ccch_conf);
 	/* code word + 2, as 2 channels equals 0x0 */
-	blocks = rsl_number_of_paging_subchannels(bts);
+	blocks = gsm48_number_of_paging_subchannels(&bts->si_common.chan_desc);
 	group = get_paging_group(str_to_imsi(subscr->imsi),
 					bs_cc_chans, blocks);
 	return group;