summaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-07-21 22:12:23 +0200
committerHarald Welte <laforge@gnumonks.org>2009-07-21 22:13:36 +0200
commitf8d536def97a65f5a0f1dec7f38ee15030acae53 (patch)
tree1076da364bcea2d792469a68a371ed9ea681de62 /openbsc/src
parent814c4b79843fe9ead98672a1ad7ac989e7aab9b6 (diff)
allow user to set BSIC and TSC from command line
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/bsc_hack.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index c100ee4ba..1bfb7068b 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -56,6 +56,8 @@ static struct gsm_network *gsmnet;
static int MCC = 1;
static int MNC = 1;
static int LAC = 1;
+static int TSC = HARDCODED_TSC;
+static int BSIC = HARDCODED_BSIC;
static int ARFCN = HARDCODED_ARFCN;
static int cardnr = 0;
static int release_l2 = 0;
@@ -893,13 +895,18 @@ static void patch_tables(struct gsm_bts *bts)
/* patch BSIC */
bs11_attr_bts[1] = bts->bsic;
nanobts_attr_bts[sizeof(nanobts_attr_bts)-1] = bts->bsic;
+
+ /* patch TSC */
+ si4[15] &= ~0xe0;
+ si4[15] |= (bts->tsc & 7) << 5;
}
static void bootstrap_rsl(struct gsm_bts_trx *trx)
{
fprintf(stdout, "bootstrapping RSL for BTS/TRX (%u/%u) "
- "using MCC=%u MNC=%u\n", trx->nr, trx->bts->nr, MCC, MNC);
+ "using MCC=%u MNC=%u BSIC=%u TSC=%u\n",
+ trx->nr, trx->bts->nr, MCC, MNC, BSIC, TSC);
set_system_infos(trx);
}
@@ -1019,7 +1026,7 @@ static int bootstrap_network(void)
/* E1 mISDN input setup */
if (BTS_TYPE == GSM_BTS_TYPE_BS11) {
- struct gsm_bts *bts = gsm_bts_alloc(gsmnet, BTS_TYPE, HARDCODED_TSC, HARDCODED_BSIC);
+ struct gsm_bts *bts = gsm_bts_alloc(gsmnet, BTS_TYPE, TSC, BSIC);
bootstrap_bts(bts);
gsmnet->num_bts = 1;
@@ -1034,7 +1041,7 @@ static int bootstrap_network(void)
}
llist_for_each_entry(bts_id, &nanobts_ids, entry) {
- bts = gsm_bts_alloc(gsmnet, BTS_TYPE, HARDCODED_TSC, HARDCODED_BSIC);
+ bts = gsm_bts_alloc(gsmnet, BTS_TYPE, TSC, BSIC);
bootstrap_bts(bts);
bts->ip_access.site_id = bts_id->site_id;
bts->ip_access.bts_id = 0;
@@ -1104,10 +1111,12 @@ static void handle_options(int argc, char** argv)
{"timestamp", 0, 0, 'T'},
{"band", 0, 0, 'b'},
{"bts-id", 1, 0, 'i'},
+ {"tsc", 1, 0, 'S'},
+ {"bsic", 1, 0, 'B'},
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, "hc:n:d:sar:p:f:t:C:RL:l:Tb:i:",
+ c = getopt_long(argc, argv, "hc:n:d:sar:p:f:t:C:RL:l:Tb:i:S:B:",
long_options, &option_index);
if (c == -1)
break;
@@ -1172,6 +1181,12 @@ static void handle_options(int argc, char** argv)
bts_id->site_id = atoi(optarg);
llist_add(&bts_id->entry, &nanobts_ids);
break;
+ case 'S':
+ TSC = atoi(optarg);
+ break;
+ case 'B':
+ BSIC = atoi(optarg);
+ break;
}
default:
/* ignore */