Add ARFCN range check for GSM 850 band

This should make OpenBSC work with a nanoBTS in GSM 850 band.
This commit is contained in:
Harald Welte
2010-05-26 17:14:42 +02:00
parent 7ae3f6c30e
commit 71b822b986

View File

@@ -981,6 +981,8 @@ static int bootstrap_bts(struct gsm_bts *bts)
{
int i, n;
/* FIXME: What about secondary TRX of a BTS? What about a BTS that has TRX
* in different bands? Why is 'band' a parameter of the BTS and not of the TRX? */
switch (bts->band) {
case GSM_BAND_1800:
if (bts->c0->arfcn < 512 || bts->c0->arfcn > 885) {
@@ -1002,6 +1004,12 @@ static int bootstrap_bts(struct gsm_bts *bts)
return -EINVAL;
}
break;
case GSM_BAND_850:
if (bts->c0->arfcn < 128 || bts->c0->arfcn > 251) {
LOGP(DNM, LOGL_ERROR, "GSM850 channel must be between 128-251.\n");
return -EINVAL;
}
break;
default:
LOGP(DNM, LOGL_ERROR, "Unsupported frequency band.\n");
return -EINVAL;