[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.
This commit is contained in:
parent
0a173bfe28
commit
dda22c18b5
|
@ -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);
|
struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr);
|
||||||
|
|
||||||
/* e1_config.c */
|
/* 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 ia_config(struct gsm_bts *bts);
|
||||||
int ipaccess_setup(struct e1inp_line *line);
|
int ipaccess_setup(struct e1inp_line *line);
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ static int MCC = 1;
|
||||||
static int MNC = 1;
|
static int MNC = 1;
|
||||||
static int LAC = 1;
|
static int LAC = 1;
|
||||||
static int ARFCN = HARDCODED_ARFCN;
|
static int ARFCN = HARDCODED_ARFCN;
|
||||||
|
static int cardnr = 0;
|
||||||
static enum gsm_bts_type BTS_TYPE = GSM_BTS_TYPE_BS11;
|
static enum gsm_bts_type BTS_TYPE = GSM_BTS_TYPE_BS11;
|
||||||
static const char *database_name = "hlr.sqlite3";
|
static const char *database_name = "hlr.sqlite3";
|
||||||
|
|
||||||
|
@ -926,7 +927,7 @@ static int bootstrap_network(void)
|
||||||
|
|
||||||
/* E1 mISDN input setup */
|
/* E1 mISDN input setup */
|
||||||
if (BTS_TYPE == GSM_BTS_TYPE_BS11)
|
if (BTS_TYPE == GSM_BTS_TYPE_BS11)
|
||||||
return e1_config(bts);
|
return e1_config(bts, cardnr);
|
||||||
else
|
else
|
||||||
return ia_config(bts);
|
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(" -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.\n");
|
||||||
printf(" -p --pcap file The filename of the pcap file\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(" -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");
|
printf(" -h --help this text\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -983,10 +985,11 @@ static void handle_options(int argc, char** argv)
|
||||||
{"pcap", 1, 0, 'p'},
|
{"pcap", 1, 0, 'p'},
|
||||||
{"arfcn", 1, 0, 'f'},
|
{"arfcn", 1, 0, 'f'},
|
||||||
{"bts-type", 1, 0, 't'},
|
{"bts-type", 1, 0, 't'},
|
||||||
|
{"cardnr", 1, 0, 'C'},
|
||||||
{0, 0, 0, 0}
|
{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);
|
long_options, &option_index);
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
|
@ -1029,6 +1032,9 @@ static void handle_options(int argc, char** argv)
|
||||||
case 't':
|
case 't':
|
||||||
BTS_TYPE = parse_btstype(optarg);
|
BTS_TYPE = parse_btstype(optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
cardnr = atoi(optarg);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* ignore */
|
/* ignore */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#define TEI_RSL 1
|
#define TEI_RSL 1
|
||||||
|
|
||||||
/* do some compiled-in configuration for our BTS/E1 setup */
|
/* 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_line *line;
|
||||||
struct e1inp_ts *sign_ts;
|
struct e1inp_ts *sign_ts;
|
||||||
|
@ -68,7 +68,7 @@ int e1_config(struct gsm_bts *bts)
|
||||||
bts->trx[1].rsl_link = rsl_link;
|
bts->trx[1].rsl_link = rsl_link;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return mi_setup(0, line);
|
return mi_setup(cardnr, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do some compiled-in configuration for our BTS/E1 setup */
|
/* do some compiled-in configuration for our BTS/E1 setup */
|
||||||
|
|
Loading…
Reference in New Issue