[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>
This commit is contained in:
Mike Haben 2009-10-02 12:19:34 +01:00 committed by Holger Hans Peter Freyther
parent a03f97775b
commit e2d8227499
6 changed files with 19 additions and 22 deletions

View File

@ -242,8 +242,7 @@ struct gsm_bts_trx {
enum gsm_bts_type {
GSM_BTS_TYPE_UNKNOWN,
GSM_BTS_TYPE_BS11,
GSM_BTS_TYPE_NANOBTS_900,
GSM_BTS_TYPE_NANOBTS_1800,
GSM_BTS_TYPE_NANOBTS,
};
/**
@ -445,8 +444,7 @@ extern void *tall_bsc_ctx;
static inline int is_ipaccess_bts(struct gsm_bts *bts)
{
switch (bts->type) {
case GSM_BTS_TYPE_NANOBTS_900:
case GSM_BTS_TYPE_NANOBTS_1800:
case GSM_BTS_TYPE_NANOBTS:
return 1;
default:
break;

View File

@ -1025,8 +1025,7 @@ static int abis_nm_rcvmsg_manuf(struct msgb *mb)
int bts_type = mb->trx->bts->type;
switch (bts_type) {
case GSM_BTS_TYPE_NANOBTS_900:
case GSM_BTS_TYPE_NANOBTS_1800:
case GSM_BTS_TYPE_NANOBTS:
rc = abis_nm_rx_ipacc(mb);
break;
default:

View File

@ -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;
}

View File

@ -1954,8 +1954,7 @@ static int tch_map(struct gsm_lchan *lchan, struct gsm_lchan *remote_lchan)
}
switch (bts->type) {
case GSM_BTS_TYPE_NANOBTS_900:
case GSM_BTS_TYPE_NANOBTS_1800:
case GSM_BTS_TYPE_NANOBTS:
if (!ipacc_rtp_direct) {
/* connect the TCH's to our RTP proxy */
rc = ipacc_connect_proxy_bind(lchan);

View File

@ -232,8 +232,7 @@ char *gsm_ts_name(struct gsm_bts_trx_ts *ts)
static const char *bts_types[] = {
[GSM_BTS_TYPE_UNKNOWN] = "unknown",
[GSM_BTS_TYPE_BS11] = "bs11",
[GSM_BTS_TYPE_NANOBTS_900] = "nanobts900",
[GSM_BTS_TYPE_NANOBTS_1800] = "nanobts1800",
[GSM_BTS_TYPE_NANOBTS] = "nanobts",
};
enum gsm_bts_type parse_btstype(const char *arg)

View File

@ -348,7 +348,7 @@ int main(int argc, char **argv)
if (!gsmnet)
exit(1);
bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_NANOBTS_900, HARDCODED_TSC,
bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_NANOBTS, HARDCODED_TSC,
HARDCODED_BSIC);
register_signal_handler(SS_NM, nm_sig_cb, NULL);