aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_hack.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-06-10 23:21:25 +0800
committerHarald Welte <laforge@gnumonks.org>2009-06-10 23:21:25 +0800
commitec44e1ff4139f60483dfcaa8329e39b41bfb8c4a (patch)
tree1336fce24e2c2550993ba4ef20ab76cfe8ca196f /openbsc/src/bsc_hack.c
parent0c3893078ed3f38f76b0236627bb38a8bd906af6 (diff)
parent20152a35e35e790ae281cd2445b746e338eb669c (diff)
Merge commit 'origin/master'
Diffstat (limited to 'openbsc/src/bsc_hack.c')
-rw-r--r--openbsc/src/bsc_hack.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index 7aa8b9aef..388840793 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -454,6 +454,18 @@ static int sw_activ_rep(struct msgb *mb)
return 0;
}
+/* Callback function for NACK on the OML NM */
+static int oml_msg_nack(int mt)
+{
+ if (mt == NM_MT_SET_BTS_ATTR_NACK) {
+ fprintf(stderr, "Failed to set BTS attributes. That is fatal. "
+ "Was the bts type and frequency properly specified?\n");
+ exit(-1);
+ }
+
+ return 0;
+}
+
/* Callback function to be called every time we receive a signal from NM */
static int nm_sig_cb(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
@@ -461,6 +473,8 @@ static int nm_sig_cb(unsigned int subsys, unsigned int signal,
switch (signal) {
case S_NM_SW_ACTIV_REP:
return sw_activ_rep(signal_data);
+ case S_NM_NACK:
+ return oml_msg_nack((int)signal_data);
default:
break;
}
@@ -960,6 +974,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)