aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-04-22 22:07:31 +0000
committerHolger Freyther <zecke@selfish.org>2009-04-22 22:07:31 +0000
commitdda22c18b5daaab7fa26f1eeff7dcc849a99c0cc (patch)
tree769c234df39a46794de47ada8aca8c6b52b2ad19
parent0a173bfe28ba4f6176a4ea571dc911cdd7faef44 (diff)
[bsc_hack] Allow to select the cardnr defaulting to number 0
Patch from Andreas Eversberg to allow to select the ISDN card number. The default remains the same.
-rw-r--r--include/openbsc/e1_input.h2
-rw-r--r--src/bsc_hack.c10
-rw-r--r--src/e1_config.c4
3 files changed, 11 insertions, 5 deletions
diff --git a/include/openbsc/e1_input.h b/include/openbsc/e1_input.h
index 61c3e7a6d..b717c6106 100644
--- a/include/openbsc/e1_input.h
+++ b/include/openbsc/e1_input.h
@@ -145,7 +145,7 @@ void e1_set_pcap_fd(int fd);
struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr);
/* e1_config.c */
-int e1_config(struct gsm_bts *bts);
+int e1_config(struct gsm_bts *bts, int cardnr);
int ia_config(struct gsm_bts *bts);
int ipaccess_setup(struct e1inp_line *line);
diff --git a/src/bsc_hack.c b/src/bsc_hack.c
index 8b2514431..38fa5c45f 100644
--- a/src/bsc_hack.c
+++ b/src/bsc_hack.c
@@ -55,6 +55,7 @@ static int MCC = 1;
static int MNC = 1;
static int LAC = 1;
static int ARFCN = HARDCODED_ARFCN;
+static int cardnr = 0;
static enum gsm_bts_type BTS_TYPE = GSM_BTS_TYPE_BS11;
static const char *database_name = "hlr.sqlite3";
@@ -926,7 +927,7 @@ static int bootstrap_network(void)
/* E1 mISDN input setup */
if (BTS_TYPE == GSM_BTS_TYPE_BS11)
- return e1_config(bts);
+ return e1_config(bts, cardnr);
else
return ia_config(bts);
}
@@ -963,6 +964,7 @@ static void print_help()
printf(" -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.\n");
printf(" -p --pcap file The filename of the pcap file\n");
printf(" -t --bts-type type The BTS type (bs11, nanobts900, nanobts1800)\n");
+ printf(" -C --cardnr number For bs11 select E1 card number other than 0\n");
printf(" -h --help this text\n");
}
@@ -983,10 +985,11 @@ static void handle_options(int argc, char** argv)
{"pcap", 1, 0, 'p'},
{"arfcn", 1, 0, 'f'},
{"bts-type", 1, 0, 't'},
+ {"cardnr", 1, 0, 'C'},
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, "hc:n:d:sar:p:f:t:L:",
+ c = getopt_long(argc, argv, "hc:n:d:sar:p:f:t:C:L:",
long_options, &option_index);
if (c == -1)
break;
@@ -1029,6 +1032,9 @@ static void handle_options(int argc, char** argv)
case 't':
BTS_TYPE = parse_btstype(optarg);
break;
+ case 'C':
+ cardnr = atoi(optarg);
+ break;
default:
/* ignore */
break;
diff --git a/src/e1_config.c b/src/e1_config.c
index 0aef19d57..080ca4f92 100644
--- a/src/e1_config.c
+++ b/src/e1_config.c
@@ -15,7 +15,7 @@
#define TEI_RSL 1
/* do some compiled-in configuration for our BTS/E1 setup */
-int e1_config(struct gsm_bts *bts)
+int e1_config(struct gsm_bts *bts, int cardnr)
{
struct e1inp_line *line;
struct e1inp_ts *sign_ts;
@@ -68,7 +68,7 @@ int e1_config(struct gsm_bts *bts)
bts->trx[1].rsl_link = rsl_link;
#endif
- return mi_setup(0, line);
+ return mi_setup(cardnr, line);
}
/* do some compiled-in configuration for our BTS/E1 setup */