aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-oc2g
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-11-22 14:55:13 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-11-22 15:30:46 +0700
commit70eb683622f92c273c196a36daa61abd5de63f89 (patch)
tree748937310c6458941e708a7ba453090cdd3ba16f /src/osmo-bts-oc2g
parent07af4e1751f9a190118213cd394da0cdcbcf3dab (diff)
Fix deprecated gsm_arfcn2band(), use gsm_arfcn2band_rc()
Diffstat (limited to 'src/osmo-bts-oc2g')
-rw-r--r--src/osmo-bts-oc2g/oml.c10
-rw-r--r--src/osmo-bts-oc2g/utils.c6
2 files changed, 13 insertions, 3 deletions
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index 65ebc1c9..f76de921 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -398,7 +398,7 @@ static int trx_init(struct gsm_bts_trx *trx)
struct msgb *msg;
GsmL1_MphInitReq_t *mi_req;
GsmL1_DeviceParam_t *dev_par;
- int oc2g_band;
+ int rc, oc2g_band;
if (!gsm_abis_mo_check_attr(&trx->mo, trx_rqd_attr,
ARRAY_SIZE(trx_rqd_attr))) {
@@ -409,7 +409,13 @@ static int trx_init(struct gsm_bts_trx *trx)
}
/* Update TRX band */
- trx->bts->band = gsm_arfcn2band(trx->arfcn);
+ rc = gsm_arfcn2band_rc(trx->arfcn, &trx->bts->band);
+ if (rc) {
+ /* FIXME: abort initialization? */
+ LOGP(DL1C, LOGL_ERROR, "Could not pick GSM band "
+ "for ARFCN %u\n", trx->arfcn);
+ trx->bts->band = 0x00;
+ }
oc2g_band = oc2gbts_select_oc2g_band(trx, trx->arfcn);
if (oc2g_band < 0) {
diff --git a/src/osmo-bts-oc2g/utils.c b/src/osmo-bts-oc2g/utils.c
index 28944390..cb65f45a 100644
--- a/src/osmo-bts-oc2g/utils.c
+++ b/src/osmo-bts-oc2g/utils.c
@@ -82,13 +82,17 @@ int oc2gbts_select_oc2g_band(struct gsm_bts_trx *trx, uint16_t arfcn)
{
enum gsm_band band;
struct gsm_bts *bts = trx->bts;
+ int rc;
+
if (!bts->auto_band)
return band_osmo2oc2g(trx, bts->band);
/*
* We need to check what will happen now.
*/
- band = gsm_arfcn2band(arfcn);
+ rc = gsm_arfcn2band_rc(arfcn, &band);
+ if (rc) /* wrong ARFCN, give up */
+ return -1;
/* if we are already on the right band return */
if (band == bts->band)