diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/Makefile.am | 2 | ||||
-rw-r--r-- | src/common/bts.c | 2 | ||||
-rw-r--r-- | src/common/handover.c | 45 | ||||
-rw-r--r-- | src/common/oml.c | 11 | ||||
-rw-r--r-- | src/common/rsl.c | 10 |
5 files changed, 67 insertions, 3 deletions
diff --git a/src/common/Makefile.am b/src/common/Makefile.am index b2f6f8e7..716fad94 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -5,4 +5,4 @@ LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) noinst_LIBRARIES = libbts.a libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ rsl.c vty.c paging.c measurement.c amr.c lchan.c \ - load_indication.c pcu_sock.c + load_indication.c pcu_sock.c handover.c
\ No newline at end of file diff --git a/src/common/bts.c b/src/common/bts.c index 856968ef..1d66775f 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -105,6 +105,8 @@ int bts_init(struct gsm_bts *bts) load_timer_start(bts); btsb->rtp_jitter_buf_ms = 100; btsb->max_ta = 63; + btsb->ny1 = 4; + btsb->t3105_ms = 300; /* default RADIO_LINK_TIMEOUT */ btsb->radio_link_timeout = 32; diff --git a/src/common/handover.c b/src/common/handover.c new file mode 100644 index 00000000..c40219db --- /dev/null +++ b/src/common/handover.c @@ -0,0 +1,45 @@ +/* Paging message encoding + queue management */ + +/* (C) 2012-2013 by Harald Welte <laforge@gnumonks.org> + * Andreas Eversberg <jolly@eversberg.eu> + * (C) 2014 by Holger Hans Peter Freyther + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <stdlib.h> +#include <stdint.h> +#include <errno.h> + +#include <osmocom/gsm/protocol/gsm_04_08.h> +#include <osmocom/gsm/rsl.h> + +#include <osmo-bts/bts.h> +#include <osmo-bts/bts_model.h> +#include <osmo-bts/rsl.h> +#include <osmo-bts/logging.h> +#include <osmo-bts/handover.h> + +/* release handover state */ +void handover_reset(struct gsm_lchan *lchan) +{ + /* Stop T3105 */ + osmo_timer_del(&lchan->ho.t3105); + + /* Handover process is done */ + lchan->ho.active = HANDOVER_NONE; +} diff --git a/src/common/oml.c b/src/common/oml.c index 143cc0d8..5fa2d852 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -509,8 +509,15 @@ static int oml_rx_set_bts_attr(struct gsm_bts *bts, struct msgb *msg) } /* 9.4.10 BTS Air Timer */ - if (TLVP_PRESENT(&tp, NM_ATT_BTS_AIR_TIMER)) - btsb->t3105_ms = *TLVP_VAL(&tp, NM_ATT_BTS_AIR_TIMER) * 10; + if (TLVP_PRESENT(&tp, NM_ATT_BTS_AIR_TIMER)) { + uint8_t t3105 = *TLVP_VAL(&tp, NM_ATT_BTS_AIR_TIMER); + if (t3105 == 0) { + LOGP(DOML, LOGL_NOTICE, + "T3105 must have a value != 0.\n"); + return oml_fom_ack_nack(msg, NM_NACK_PARAM_RANGE); + } + btsb->t3105_ms = t3105 * 10; + } /* 9.4.37 NY1 */ if (TLVP_PRESENT(&tp, NM_ATT_NY1)) diff --git a/src/common/rsl.c b/src/common/rsl.c index c97dd8a3..6b683bd5 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -45,6 +45,7 @@ #include <osmo-bts/bts_model.h> #include <osmo-bts/measurement.h> #include <osmo-bts/pcu_if.h> +#include <osmo-bts/handover.h> //#define FAKE_CIPH_MODE_COMPL @@ -736,6 +737,12 @@ static int rsl_rx_chan_activ(struct msgb *msg) memset(&lchan->encr, 0, sizeof(lchan->encr)); /* 9.3.9 Handover Reference */ + if ((type == RSL_ACT_INTER_ASYNC || + type == RSL_ACT_INTER_SYNC) && + TLVP_PRESENT(&tp, RSL_IE_HANDO_REF)) { + lchan->ho.active = HANDOVER_ENABLED; + lchan->ho.ref = *TLVP_VAL(&tp, RSL_IE_HANDO_REF); + } /* 9.3.4 BS Power */ if (TLVP_PRESENT(&tp, RSL_IE_BS_POWER)) @@ -832,6 +839,9 @@ static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan) msgb_queue_flush(&lchan->dl_tch_queue); } + /* release handover state */ + handover_reset(lchan); + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; rc = bts_model_rsl_chan_rel(lchan); |