From 75f105bbb5011a04e599cbc8f053afb723582364 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 8 Jul 2013 18:41:05 +0200 Subject: Fix: Retrieve ARFCN (from OML) for TRX other than C0 --- src/common/oml.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/common/oml.c') diff --git a/src/common/oml.c b/src/common/oml.c index 5f9c0a2b..6d778a53 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -590,6 +590,25 @@ static int oml_rx_set_radio_attr(struct gsm_bts_trx *trx, struct msgb *msg) trx->arfcn_num = length; } else trx->arfcn_num = 0; +#else + if (trx != trx->bts->c0 && TLVP_PRESENT(&tp, NM_ATT_ARFCN_LIST)) { + const uint8_t *value = TLVP_VAL(&tp, NM_ATT_ARFCN_LIST); + uint16_t _value; + uint16_t length = TLVP_LEN(&tp, NM_ATT_ARFCN_LIST); + uint16_t arfcn; + if (length != 2) { + LOGP(DOML, LOGL_ERROR, "Expecting only one ARFCN, " + "because hopping not supported\n"); + /* FIXME: send NACK */ + return -ENOTSUP; + } + memcpy(&_value, value, 2); + arfcn = ntohs(_value); + value += 2; + if (arfcn > 1024) + return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL); + trx->arfcn = arfcn; + } #endif /* call into BTS driver to apply new attributes to hardware */ return bts_model_apply_oml(trx->bts, msg, tp_merged, NM_OC_RADIO_CARRIER, trx); -- cgit v1.2.3