aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_init.c
diff options
context:
space:
mode:
authorMike Haben <michael.haben@btinternet.com>2009-10-02 12:19:34 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-10-05 12:12:54 +0200
commite2d82274990ddae78cabdb96087ed90ffd7a9d3a (patch)
treef0107ef917bc4df83773bf31d76507f01aa57a81 /openbsc/src/bsc_init.c
parenta03f97775b0f853195bc2c8dad9397863ebd6c10 (diff)
[ipaccess] Add nanoBTS 1900 support
Add support for 1900 nanoBTS by using unified bts_type GSM_BTS_TYPE_NANOBTS for 900, 1800 and 1900 versions. Reduce the nanoBTS enum values to one and derive the version from the user supplied band. In the future we might want to do auto band detection. The configuration file needs to be changed to refer to nanobts instead of nanobts900/nanobts1800. Signed-off-by: Mike Haben <michael.haben@btinternet.com> Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
Diffstat (limited to 'openbsc/src/bsc_init.c')
-rw-r--r--openbsc/src/bsc_init.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/openbsc/src/bsc_init.c b/openbsc/src/bsc_init.c
index c626415d3..78e98610a 100644
--- a/openbsc/src/bsc_init.c
+++ b/openbsc/src/bsc_init.c
@@ -526,8 +526,7 @@ static void nm_reconfig_trx(struct gsm_bts_trx *trx)
sizeof(trx1_attr_radio));
}
break;
- case GSM_BTS_TYPE_NANOBTS_900:
- case GSM_BTS_TYPE_NANOBTS_1800:
+ case GSM_BTS_TYPE_NANOBTS:
trx->nominal_power = 20;
default:
break;
@@ -594,8 +593,7 @@ static void bootstrap_om(struct gsm_bts *bts)
case GSM_BTS_TYPE_BS11:
bootstrap_om_bs11(bts);
break;
- case GSM_BTS_TYPE_NANOBTS_900:
- case GSM_BTS_TYPE_NANOBTS_1800:
+ case GSM_BTS_TYPE_NANOBTS:
bootstrap_om_nanobts(bts);
break;
default:
@@ -985,23 +983,27 @@ void input_event(int event, enum e1inp_sign_type type, struct gsm_bts_trx *trx)
static int bootstrap_bts(struct gsm_bts *bts)
{
- switch (bts->type) {
- case GSM_BTS_TYPE_NANOBTS_1800:
+ switch (bts->band) {
+ case GSM_BAND_1800:
if (bts->c0->arfcn < 512 || bts->c0->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 */
+ case GSM_BAND_1900:
+ if (bts->c0->arfcn < 512 || bts->c0->arfcn > 810) {
+ fprintf(stderr, "GSM1900 channel must be between 512-810.\n");
+ return -EINVAL;
+ }
+ break;
+ case GSM_BAND_900:
if (bts->c0->arfcn < 1 || bts->c0->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 specify\n");
+ default:
+ fprintf(stderr, "Unsupported frequency band.\n");
return -EINVAL;
}