aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-06-10 10:20:16 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-06-10 10:27:09 +0200
commite91f57879d4f6f919c56c28316e6ac7e75b91e13 (patch)
tree062f14f4f0fa1649d1dc264909ef98af039bb005 /openbsc
parent5c85ef92954a77f10710f6f9fcb6d49b147fc476 (diff)
[bsc_hack] Sanity check for the GSM1800 nanoBTS
The GSM1800 requires us to use channels between 512-885. When failing to provide such a channel the OML layer will fail and no RSL connection will be opened. Add a sanity check before creating the gsm_network and fail when the channels are not within the allowed range. Assume no one is operating a BS11 in the 1800 spectrum.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/bsc_hack.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index 7aa8b9ae..687be33c 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -960,6 +960,26 @@ static int bootstrap_network(void)
{
struct gsm_bts *bts;
+ switch(BTS_TYPE) {
+ case GSM_BTS_TYPE_NANOBTS_1800:
+ if (ARFCN < 512 || ARFCN > 885) {
+ fprintf(stderr, "GSM1800 channel must be between 512-885.\n");
+ return -EINVAL;
+ }
+ break;
+ case GSM_BTS_TYPE_BS11:
+ case GSM_BTS_TYPE_NANOBTS_900:
+ /* Assume we have a P-GSM900 here */
+ if (ARFCN < 1 || ARFCN > 124) {
+ fprintf(stderr, "GSM900 channel must be between 1-124.\n");
+ return -EINVAL;
+ }
+ break;
+ case GSM_BTS_TYPE_UNKNOWN:
+ fprintf(stderr, "Unknown BTS. Please use the --bts-type switch\n");
+ return -EINVAL;
+ }
+
/* initialize our data structures */
gsmnet = gsm_network_init(2, BTS_TYPE, MCC, MNC);
if (!gsmnet)