Projects
osmocom:latest
osmo-bsc
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
osmo-bsc.spec
Changed
@@ -18,13 +18,13 @@ Name: osmo-bsc Requires: osmocom-latest -Version: 1.8.1 +Version: 1.9.0 Release: 0 Summary: OsmoBSC: Osmocom's Base Station Controller for 2G CS mobile networks License: AGPL-3.0-or-later AND GPL-2.0-or-later Group: Hardware/Mobile URL: https://osmocom.org/projects/osmobsc -Source: osmo-bsc_1.8.1.tar.xz +Source: osmo-bsc_1.9.0.tar.xz BuildRequires: automake >= 1.9 BuildRequires: libtool >= 2 BuildRequires: pkgconfig >= 0.20 @@ -32,15 +32,15 @@ BuildRequires: systemd-rpm-macros %endif BuildRequires: pkgconfig(libcrypto) >= 0.9.5 -BuildRequires: pkgconfig(libosmo-mgcp-client) >= 1.9.0 -BuildRequires: pkgconfig(libosmo-netif) >= 1.1.0 -BuildRequires: pkgconfig(libosmo-sigtran) >= 1.5.0 -BuildRequires: pkgconfig(libosmoabis) >= 1.2.0 -BuildRequires: pkgconfig(libosmocore) >= 1.6.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.6.0 -BuildRequires: pkgconfig(libosmogb) >= 1.6.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.6.0 -BuildRequires: pkgconfig(libosmovty) >= 1.6.0 +BuildRequires: pkgconfig(libosmo-mgcp-client) >= 1.10.0 +BuildRequires: pkgconfig(libosmo-netif) >= 1.2.0 +BuildRequires: pkgconfig(libosmo-sigtran) >= 1.6.0 +BuildRequires: pkgconfig(libosmoabis) >= 1.3.0 +BuildRequires: pkgconfig(libosmocore) >= 1.7.0 +BuildRequires: pkgconfig(libosmoctrl) >= 1.7.0 +BuildRequires: pkgconfig(libosmogb) >= 1.7.0 +BuildRequires: pkgconfig(libosmogsm) >= 1.7.0 +BuildRequires: pkgconfig(libosmovty) >= 1.7.0 BuildRequires: pkgconfig(talloc) %{?systemd_requires} @@ -121,12 +121,14 @@ %files %license COPYING -%doc AUTHORS README +%doc AUTHORS README.md %{_bindir}/osmo-bsc %dir %{_docdir}/%{name}/examples %dir %{_docdir}/%{name}/examples/osmo-bsc %{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc.cfg %{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg +%{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc-4trx-fh.confmerge +%{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc-4trx.cfg %{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc-minimal.cfg %dir %{_docdir}/%{name}/examples/osmo-bsc/ericsson %dir %{_docdir}/%{name}/examples/osmo-bsc/nokia
View file
osmo-bsc_1.8.1.tar.xz/README
Deleted
@@ -1,26 +0,0 @@ -About OsmoBSC -============= - -OsmoBSC originated from the OpenBSC project, which started as a minimalistic -all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached -maturity and diversity (including M3UA SIGTRAN and 3G support in the form of -IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one -approach to fully independent separate programs as in typical GSM networks. - -OsmoBSC was one of the parts split off from the old openbsc.git. Before, it -worked as a standalone osmo-bsc binary as well as a combination of libbsc and -libmsc, i.e. the old OsmoNITB. Since the standalone OsmoMSC with a true A -interface (and IuCS for 3G support) is available, OsmoBSC exists only as a -separate standalone entity. - -OsmoBSC exposes -- A over IP towards an MSC (e.g. OsmoMSC); -- Abis interfaces towards various kinds of BTS; -- The Osmocom typical telnet VTY and CTRL interfaces. - -Find OsmoBSC issue tracker and wiki online at -https://osmocom.org/projects/osmobsc -https://osmocom.org/projects/osmobsc/wiki - -OsmoBSC-NAT is a specialized solution to navigating RTP streams through a NAT. -(Todo: describe in more detail)
View file
osmo-bsc_1.8.1.tar.xz/m4/ax_check_compile_flag.m4
Deleted
@@ -1,74 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, ACTION-SUCCESS, ACTION-FAILURE, EXTRA-FLAGS, INPUT) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> -# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU 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 General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 4 - -AC_DEFUN(AX_CHECK_COMPILE_FLAG, -AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF(CACHEVAR,ax_cv_check__AC_LANG_ABBREVflags_$4_$1)dnl -AC_CACHE_CHECK(whether _AC_LANG compiler accepts $1, CACHEVAR, - ax_check_save_flags=$_AC_LANG_PREFIXFLAGS - _AC_LANG_PREFIXFLAGS="$_AC_LANG_PREFIXFLAGS $4 $1" - AC_COMPILE_IFELSE(m4_default($5,AC_LANG_PROGRAM()), - AS_VAR_SET(CACHEVAR,yes), - AS_VAR_SET(CACHEVAR,no)) - _AC_LANG_PREFIXFLAGS=$ax_check_save_flags) -AS_VAR_IF(CACHEVAR,yes, - m4_default($2, :), - m4_default($3, :)) -AS_VAR_POPDEF(CACHEVAR)dnl -)dnl AX_CHECK_COMPILE_FLAGS
View file
osmo-bsc_1.8.1.dsc -> osmo-bsc_1.9.0.dsc
Changed
@@ -2,13 +2,13 @@ Source: osmo-bsc Binary: osmo-bsc, osmo-bsc-dbg, abisip-find, osmo-bsc-ipaccess-utils, osmo-bsc-bs11-utils, osmo-bsc-meas-utils, osmo-bsc-doc Architecture: any all -Version: 1.8.1 +Version: 1.9.0 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-bsc Standards-Version: 3.9.8 -Vcs-Browser: https://git.osmocom.org/osmo-bsc/ -Vcs-Git: git://git.osmocom.org/osmo-bsc.git -Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, autoconf, automake, libtool, pkg-config, python3-minimal, libcdk5-dev, libtalloc-dev, libosmocore-dev (>= 1.6.0), libosmo-sigtran-dev (>= 1.5.0), libosmo-abis-dev (>= 1.2.0), libosmo-netif-dev (>= 1.1.0), libosmo-mgcp-client-dev (>= 1.9.0), osmo-gsm-manuals-dev (>= 1.2.0) +Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc +Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc +Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, autoconf, automake, libtool, pkg-config, python3-minimal, libcdk5-dev, libtalloc-dev, libosmocore-dev (>= 1.7.0), libosmo-sigtran-dev (>= 1.6.0), libosmo-abis-dev (>= 1.3.0), libosmo-netif-dev (>= 1.2.0), libosmo-mgcp-client-dev (>= 1.10.0), osmo-gsm-manuals-dev (>= 1.3.0) Package-List: abisip-find deb net extra arch=any osmo-bsc deb net extra arch=any @@ -18,8 +18,8 @@ osmo-bsc-ipaccess-utils deb net extra arch=any osmo-bsc-meas-utils deb net extra arch=any Checksums-Sha1: - 85a21e05821297a9c4e050854122e45ece0edc13 546832 osmo-bsc_1.8.1.tar.xz + b407bf30b4a91b442f43dec17c2b780c7ad39518 575124 osmo-bsc_1.9.0.tar.xz Checksums-Sha256: - c9edc3f782f4b99039b977764766703742e900a2b0507a6aa7824f57c83f91b6 546832 osmo-bsc_1.8.1.tar.xz + 0ece7fc0f30dfa41fc6f2c28e92dc7122d35525413e753466f16b237987e25a2 575124 osmo-bsc_1.9.0.tar.xz Files: - 35db0ff00186055e9f5e1e66d5d08283 546832 osmo-bsc_1.8.1.tar.xz + 26d1d846fd566a36723993b7bab2ba71 575124 osmo-bsc_1.9.0.tar.xz
View file
osmo-bsc_1.8.1.tar.xz/.tarball-version -> osmo-bsc_1.9.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.8.1 \ No newline at end of file +1.9.0 \ No newline at end of file
View file
osmo-bsc_1.9.0.tar.xz/README.md
Added
@@ -0,0 +1,95 @@ +osmo-bsc - Osmocom BSC Implementation +===================================== + +This repository contains a C-language implementation of a GSM Base Station +Controller (BSC). IT is part of the +Osmocom(https://osmocom.org/) Open Source Mobile Communications +project. + +OsmoBSC exposes + * A over IP towards an MSC (e.g. OsmoMSC): 3GPP AoIP or SCCPlite + * Abis interfaces towards various kinds of BTS (osmo-bts, sysmobts, nanoBTS, Siemens, Nokia, Ericsson) + * The Osmocom typical telnet VTY and CTRL interfaces. + * The Osmocom typical statsd exporter. + * Cell Broadcast Service Protocol (CBSP) towards a CBC (Cell Broadcast Centre, such as osmo-cbc). + * Lb interface towards a SMLC (Serving Mobile Location Centre, such as osmo-smlc). + + +Homepage +-------- + +You can find the OsmoBSC issue tracker and wiki online at +<https://osmocom.org/projects/osmobsc> and <https://osmocom.org/projects/osmobsc/wiki>. + + +GIT Repository +-------------- + +You can clone from the official osmo-bsc.git repository using + + git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc + +There is a web interface at <https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc> + + +Documentation +------------- + +User Manuals and VTY reference manuals are optionally built in PDF form +as part of the build process. + +Pre-rendered PDF version of the current "master" can be found at +User Manual(https://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf) +as well as the VTY Reference Manual(https://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf) + +There also is an +Abis reference Manual(https://ftp.osmocom.org/docs/latest/osmobts-abis.pdf) +describing the OsmoBTS specific A-bis dialect, as well as a CBSP Reference +Maunal(https://downloads.osmocom.org/docs/latest/osmobsc-cbsp.pdf) +describing the level of CBSP conformance. + + +Mailing List +------------ + +Discussions related to osmo-bsc are happening on the +openbsc@lists.osmocom.org mailing list, please see +<https://lists.osmocom.org/mailman/listinfo/openbsc> for subscription +options and the list archive. + +Please observe the Osmocom Mailing List +Rules(https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules) +when posting. + +Contributing +------------ + +Our coding standards are described at +<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards> + +We us a gerrit based patch submission/review process for managing +contributions. Please see +<https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for +more details + +The current patch queue for osmo-bsc can be seen at +<https://gerrit.osmocom.org/#/q/project:osmo-bsc+status:open> + + +History +------- + +OsmoBSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. + +OsmoBSC was one of the parts split off from the old openbsc.git. Before, it +worked as a standalone osmo-bsc binary as well as a combination of libbsc and +libmsc, i.e. the old OsmoNITB. Since the standalone OsmoMSC with a true A +interface (and IuCS for 3G support) is available, OsmoBSC exists only as a +separate standalone entity. + +OsmoBSC-NAT is a specialized solution to navigating RTP streams through a NAT. +(Todo: describe in more detail)
View file
osmo-bsc_1.8.1.tar.xz/README.vty-tests -> osmo-bsc_1.9.0.tar.xz/README.vty-tests
Changed
@@ -1,6 +1,6 @@ To run the configuration parsing and output (VTY) test suite, first install - git://git.osmocom.org/python/osmo-python-tests + https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests and pass the following configure options here:
View file
osmo-bsc_1.8.1.tar.xz/configure.ac -> osmo-bsc_1.9.0.tar.xz/configure.ac
Changed
@@ -46,14 +46,14 @@ AM_CONDITIONAL(BUILD_IPA_UTILS, test "x$osmo_ac_ipa_utils" = "xyes") AC_SUBST(osmo_ac_ipa_utils) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.6.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.6.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.6.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.6.0) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.2.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.1.0) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.5.0) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.7.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.7.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.7.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.7.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.3.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.2.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.6.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.10.0) dnl checks for header files AC_HEADER_STDC @@ -149,7 +149,7 @@ fi AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then - AC_MSG_ERROR(Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.) + AC_MSG_ERROR(Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.) fi fi AC_MSG_CHECKING(whether to enable VTY/CTRL tests) @@ -230,14 +230,15 @@ src/utils/Makefile tests/Makefile tests/atlocal + tests/abis/Makefile tests/acc/Makefile - tests/gsm0408/Makefile tests/bsc/Makefile tests/codec_pref/Makefile - tests/abis/Makefile - tests/subscr/Makefile - tests/nanobts_omlattr/Makefile + tests/gsm0408/Makefile tests/handover/Makefile + tests/nanobts_omlattr/Makefile + tests/paging/Makefile + tests/subscr/Makefile doc/Makefile doc/examples/Makefile doc/manuals/Makefile
View file
osmo-bsc_1.8.1.tar.xz/contrib/jenkins.sh -> osmo-bsc_1.9.0.tar.xz/contrib/jenkins.sh
Changed
@@ -27,6 +27,19 @@ verify_value_string_arrays_are_terminated.py $(find . -name "*.hc") +# Check for wrong use of osmo_bts_has_feature (OS#5538) +bts_features_wrong_use="$(grep -r -n 'osmo_bts_has_feature.*->model->features' \ + | grep -v 'jenkins.sh' \ + | grep -v 'intentional check against bts model')" || true +if -n "$bts_features_wrong_use" ; then + set +x + echo + echo "ERROR: Don't use osmo_bts_has_feature with bts->model->features. Use bts->features instead." + echo + echo "$bts_features_wrong_use" + exit 1 +fi + export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" export PATH="$inst/bin:$PATH"
View file
osmo-bsc_1.8.1.tar.xz/contrib/osmo-bsc.spec.in -> osmo-bsc_1.9.0.tar.xz/contrib/osmo-bsc.spec.in
Changed
@@ -31,15 +31,15 @@ BuildRequires: systemd-rpm-macros %endif BuildRequires: pkgconfig(libcrypto) >= 0.9.5 -BuildRequires: pkgconfig(libosmo-mgcp-client) >= 1.9.0 -BuildRequires: pkgconfig(libosmo-netif) >= 1.1.0 -BuildRequires: pkgconfig(libosmo-sigtran) >= 1.5.0 -BuildRequires: pkgconfig(libosmoabis) >= 1.2.0 -BuildRequires: pkgconfig(libosmocore) >= 1.6.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.6.0 -BuildRequires: pkgconfig(libosmogb) >= 1.6.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.6.0 -BuildRequires: pkgconfig(libosmovty) >= 1.6.0 +BuildRequires: pkgconfig(libosmo-mgcp-client) >= 1.10.0 +BuildRequires: pkgconfig(libosmo-netif) >= 1.2.0 +BuildRequires: pkgconfig(libosmo-sigtran) >= 1.6.0 +BuildRequires: pkgconfig(libosmoabis) >= 1.3.0 +BuildRequires: pkgconfig(libosmocore) >= 1.7.0 +BuildRequires: pkgconfig(libosmoctrl) >= 1.7.0 +BuildRequires: pkgconfig(libosmogb) >= 1.7.0 +BuildRequires: pkgconfig(libosmogsm) >= 1.7.0 +BuildRequires: pkgconfig(libosmovty) >= 1.7.0 BuildRequires: pkgconfig(talloc) %{?systemd_requires} @@ -116,12 +116,14 @@ %files %license COPYING -%doc AUTHORS README +%doc AUTHORS README.md %{_bindir}/osmo-bsc %dir %{_docdir}/%{name}/examples %dir %{_docdir}/%{name}/examples/osmo-bsc %{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc.cfg %{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg +%{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc-4trx-fh.confmerge +%{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc-4trx.cfg %{_docdir}/%{name}/examples/osmo-bsc/osmo-bsc-minimal.cfg %dir %{_docdir}/%{name}/examples/osmo-bsc/ericsson %dir %{_docdir}/%{name}/examples/osmo-bsc/nokia
View file
osmo-bsc_1.8.1.tar.xz/debian/changelog -> osmo-bsc_1.9.0.tar.xz/debian/changelog
Changed
@@ -1,20 +1,250 @@ -osmo-bsc (1.8.1) unstable; urgency=medium +osmo-bsc (1.9.0) unstable; urgency=medium + + Philipp Maier + * abis_nm: fix typo + * abis_nm: use struct sdp_firmware from libosmocore + * bts-examples: add example for E1 connected BTS + * abis_nm: actively block BTSs with invalid configuration + * bts: add missing return -EINVAL statements + * bts: fix sourcecode formatting (excess whitespace) + * nm_bts_fsm: fix sourcecode formatting + * bssmap_reset: make T4 user configurable Oliver Smith * bsc_subscr_conn_fsm: fix crash if !conn + * Cosmetic: osmo-bsc/osmo_bsc_bssap: fix formatting + * stats: add bsc.paging:expired + * treewide: remove FSF address + * contrib/osmo-bsc.spec.in: add new config files + * contrib/osmo-bsc.spec.in: fix 4trx example paths + * bts_model_osmobts_init: order feats alphabetically + * Cosmetic: bts_model_osmobts_init: update comment + * abis_nm: don't compare assumed/reported features + * gsm_data: add gsm_set_bts_model + * Always use reported features if available + * contrib/jenkins.sh: check osmo_bts_has_feature use + * abis_nm_ipaccess_rsl_connect: initialize ia + * bts_model_*_start: move set_feature calls to _init + * abis_nm: add bts model features to reported ones + * Check VTY config against features reported by BTS + * abis_nm: run gsm_bts_check_cfg during oml bring up + * Cosmetic: bsc_vty: tweak msc pooling strings Neels Hofmeyr * hodec2: fix segv for inter-BSC ho target + * dbg log: abis_rsl print_meas_rep(): clarify rxlev * fix chreq:* counters: typos in chreq:successful_* constants + * dbg log: also log assignment counters on BTS level * fix assignment success counters: count *before* cleanup of fsm state + * log: always include timeouts in FSM transition logging + * lchan/gscon: always clear both cross ref pointers + * lcs: fix bsc_subscr use_count leak + * fix gscon clear 1/n: store clear cause in gscon + * fix gscon clear 2/n: proper state transition to ST_CLEARING + * fix gscon clear 3/n: separate state for SCCP RLSD + * gscon clear: without SCCP conn, no need to wait for RLSD timeout + * fix two comments in chan_counts.h + * rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify + * fix inter-BSC-in handover encryption + * cosmetics around select_best_cipher() + * inter-BSC HO in: add speech IEs only on speech mode lchans + * inter-BSC HO in: add Speech Codec (Chosen) IE to HO Req Ack + * inter-BSC HO in: add Codec List (BSS Supported) IE to HO Req Ack + * tweak logl to ERROR for invalid initial BSSMAP + * silence bogus error: event not permitted: READY_TO_SWITCH_RTP + * add missing counter increment for Perform Location Request + * add counter for inter-BSC incoming Handover Request + * support "empty" SCCP N-Connect from MSC + * tweak error msg: s/inter-BSC MT/inter-BSC incoming + * inter-BSC incoming HO: store Codec List (MSC Preferred) + * fix extraneous newlines in ho_fail() invocations + * fix typo in name of BSS_MAP_MSG_ASSIGNMENT_RQST + * hodec2: show reported ho oscillation from bad rxqual + * hodec2: add penalty-time low-rxqual-ho + * assignment_fsm: always mark MGCP ci as completed + * assignment_fsm: always update RTP info + * hodec2: apply penalty_low_rxqual_as only on assignment + * emerg call: fix RR release cause for pre-emption + * emerg call: tweak log, comments + * emerg call deny: fix RR release cause + * emerg call deny: log on LOGL_ERROR + * emerg call: send BSSMAP Clear Req cause as preemption + * fix fallout from: 'stats: new trackers for lchan life duration' + * do not BSSMAP Clear on lchan rel when LCS is still ongoing + * fix rare segfault in MGCP client handling + * drop log from ts_is_usable() + * code cleanup for all_allocated timers, no functional change + * fix performance for chan_counts and all_allocated stats Pau Espin Pedrol * Disable C/I based MS Power Control Loop by default + * Drop unneeded ax_check_compile_flag.m4 + * Fix DLCI CC bits transmitted in SAPI "n" REJECT + * bts: Add explicit switch case for Cell Id SAI + * doc: bsc.adoc: Update timer info from code (gsm_network_T_defs) + * tests: nanobts_omlattr_test: Use msgb_eq_data_print() helper + * ipa oml: Fix encoding of T3105 + * bts_vty.c: Fix typo in comment + * SI13: Always send ext_info + * SI13: Make sure egprs_supported field is always updated + * SI13: Avoid enabling use_egprs_p_ch_req if egprs not supported + * system_information: Move all si13 specific val update to generate_si13() + * SI13: Get rid of si13_default + * bsc_vty: Add missing header + * bts: Simplify bts->paging initialization + * tests/bsc/Makefile.am: remove duplicate CFLAGS + * Move struct gsm_bts_paging_state to paging.h + * paging: Use define available in libosmogsm + * rsl_rx_ccch_load: Use UINT16_MAX instead of -1 + * paging: Avoid setting up credit_timer every time + * paging: Use llist_first_entry() macro + * paging: Log skip paging due to not enough free channels + * paging: Submit up to 20 paging requests in a single work iteration + * paging: Prioritize requests for new subscribers over retransmitions + * cosmetic:: Document TLVs in nanobts_attr_bts_get() + * Rename functions generating OML SetAttr messages + * bts: Use uint8_t instead of int for ccch_load_ind_thresh + * Introduce VTY command 'ccch load-indication-period <0-255>' + * bts: Make sure paging timers are deleted when struct gsm_bts is freed + * tests: acc_test: fix typo in talloc ctx name + * tests: acc_test: Get rid on unrelated logs in expect file + * paging: Estimate available_slots based on BTS config when no CCCH Load Ind received + * paging: Rework timer lifecycle logic + * paging: Check C0 RSL link instead of OML link + * paging: Decouple retransmit period from regular worker interval + * paging: Improve calculate_timer_3113() + * paging: Improve logging + * paging: Increase T3113 based on paging group load in BSC queue + * paging: Early stop work_timer when paging queue becomes empty + * paging: Recalculate work timer if waiting for retrans + * paging: Document 'ccch_load_ind_period * 2' value + * tests: Order tests alphabetically + * tests/acc: Remove unused var + * abis_rsl.c: Drop unused function + * abis_rsl: Use proper struct in rsl_paging_cmd + * bts: Properly free ctr/stat when bts object is freed + * paging: Flush pending paging requests when bts obj freed + * paging: Take into account extra delay of all paging groups in BSC queue + * tests: Introduce paging_test + * paging: Remove TODO comment + * Drop duplicate function helper + * Remove commented out code + * abis_nm: Use proper define for avail state 0xff + * ipaccess-config: Use proper define for nm availability value + * abis_nm: Merge signals S_NM_STATECHG_ADM and S_NM_STATECHG_OPER + * cosmetic: Fix open brace in same line as func definition + * constify state pointers of struct gsm_nm_state + * acc: Fix erratic ramping behavior when several BTS configured + * nm_statechg_signal_data: Convert state ptr to data + * nm_is_running(): Drop duplicate check + * bts_ipa: Send NM_EV_OML_DOWN following object tree in order + * paging: Improve logging + * paging: Fix recalculate work timer if waiting for retrans + * paging: Avoid unnecessary immediate polling in mainloop + * Revert "fix fallout from: 'stats: new trackers for lchan life duration'" + * Revert "stats: new trackers for lchan life duration" + * Update current NM object state before signalling S_NM_STATECHG + * Introduce new signal S_NM_RUNNING_CHG and implement it for rcarrier,bbtransc + * paging: start/stop credit_timer based on C0 running + * acc: Simplify start/stop by using new signal S_NM_RUNNING_CHG + * nm_*_fsm: Remove comment no longer applying + * nm_rcarrier_fsm: Trigger S_NM_RUNNING_CHG when Admin st changes in op=Enabled + * Move all SMSCB/CBC vty code to its own file + * smscb: Base cell operational life cycle on CBCH being operative + * smscb: Tx CBSP FAILURE/RESTART for specific cell when it becomes (un)operational + * cbsp: Avoid encoding CBSP message if link is down + + Vadim Yanitskiy + * ipaccess-config: improve readability of printed attribute response + * ipaccess-config: request and print NM_ATT_IPACC_NV_FLAGS + * system_information: fix unused 'mask' parameter in list_arfcn() + * tests/gsm0408: add testing coverage for generate_cell_chan_list() + * bitvec2freq_list(): determine empty set by checking the ARFCN count + * bitvec2freq_list(): fix handling of E-GSM ARFCNs + * Fix description of BTS_CTR_BTS_RSL_FAIL: s/OML/RSL/ + * fix inp_sig_cb(): dispatch TS_EV_OML_DOWN to all transceivers + * system_information: use is_ipaccess_bts() helper + * system_information: fix DCS/PCS band indicator in generate_si6() + * gsm48_send_ho_cmd(): this function is not used, remove it + * gsm48_make_ho_cmd(): cosmetic: use existing BTS pointer + * gsm48_make_ho_cmd(): make 'struct gsm_lchan' pointer const + * gsm48_make_ho_cmd(): optionally add Cipher Mode Setting IE + * gsm48_make_ho_cmd(): optionally add Synchronization Indication IE + * fixup: gsm48_make_ho_cmd(): optionally add Synchronization Indication IE + * gsm_bts_trx_set_system_infos(): cosmetic: improve readability + * System Information Type 3: allow updating T3212 at run-time + * parse_bssmap_perf_loc_req(): make 'struct tlv_p_entry' pointer const + * BSSMAP LE: fix handling of LCS Client Type IE + * BSSMAP LE: handle optional LCS {Client Type, QoS} IEs + * struct gsm_encr: store alg_id in human-readable format + * cbch_scheduler: cosmetic: s/bts_cbch_timer/bts_cbch_timer_cb/ + * fix gsm_bts_get_cbch(): CBCH can be allocated on Cn + * abis_rsl: always check return value of rsl_tlv_parse() + * doc/examples: avoid using deprecated configuration commands + * doc/examples: add a multi-trx config config example + * doc/examples: add a confmerge file with example hopping parameters + * power_ctrl_params_def_reset(): set .ctrl_interval for both UL/DL + * Move power control related definitions to power_control.h + * VTY: clarify help for the Adaptive Multi Rate settings + * bts: gsm_bts_alloc(): rework default multi-rate configuration + * bts: gsm_bts_alloc(): use reasonable multi-rate config defaults + * tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS' + * abis_rsl: fix NULL pointer dereference in abis_rsl_rx_rll() + * gsm_data: use llist_for_each_entry() in gsm_bts_by_lac() + * bssap: always check return value of tlv_parse() + * abis_nm: always check return value of tlv_parse() + * utils/meas_db: fix -Wunused-variable warnings + * utils/meas_pcap2db: fix -Wpointer-sign in pcap_cb() + * smscb: fix meaningless condition in etws_primary_to_bts()
View file
osmo-bsc_1.8.1.tar.xz/debian/control -> osmo-bsc_1.9.0.tar.xz/debian/control
Changed
@@ -12,15 +12,15 @@ python3-minimal, libcdk5-dev, libtalloc-dev, - libosmocore-dev (>= 1.6.0), - libosmo-sigtran-dev (>= 1.5.0), - libosmo-abis-dev (>= 1.2.0), - libosmo-netif-dev (>= 1.1.0), - libosmo-mgcp-client-dev (>= 1.9.0), - osmo-gsm-manuals-dev (>= 1.2.0) + libosmocore-dev (>= 1.7.0), + libosmo-sigtran-dev (>= 1.6.0), + libosmo-abis-dev (>= 1.3.0), + libosmo-netif-dev (>= 1.2.0), + libosmo-mgcp-client-dev (>= 1.10.0), + osmo-gsm-manuals-dev (>= 1.3.0) Standards-Version: 3.9.8 -Vcs-Git: git://git.osmocom.org/osmo-bsc.git -Vcs-Browser: https://git.osmocom.org/osmo-bsc/ +Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc +Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc Homepage: https://projects.osmocom.org/projects/osmo-bsc Package: osmo-bsc
View file
osmo-bsc_1.8.1.tar.xz/debian/copyright -> osmo-bsc_1.9.0.tar.xz/debian/copyright
Changed
@@ -1,6 +1,6 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: osmo-bsc -Source: git://git.osmocom.org/osmo-bsc +Source: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc Files: * Copyright: 2008-2015 Holger Hans Peter Freyther <zecke@selfish.org>
View file
osmo-bsc_1.9.0.tar.xz/doc/bts-features.txt
Added
@@ -0,0 +1,42 @@ +Notes about BTS feature check code +--- + +Feature reporting: +- For most BTS we hardcode a list of assumed features in the BTS model's + _init() function, e.g. bts_model_bs11_init(). These features get copied to + bts->features once the BTS model is set. +- nanobts and osmo-bts are special, they support reporting features during OML + bring up (features_get_reported set in struct_gsm_bts_model): + - For osmo-bts, we do not assume any features in the BTS model and just let + it report all available features. + - For nanobts, we wait for the reported features and then extend them with + the features set in the bts model. This is needed because the features enum + gets extended by us for osmo-bts, it may have features that nanobts does + not report but has implemented. +- Once features are available (either through feature reporting or copied from + the bts model), features_known is true in struct gsm_bts. + +Implementing a feature check: +- Check that features_known is true, in case the check may be done before the + BTS is connected and has reported its features (e.g. in VTY config parsing) +- Use osmo_bts_has_feature() +- Example: + if (bts->features_known && !osmo_bts_has_feature(&bts->features, BTS_FEAT_MULTI_TSC)) + +VTY and feature checks: +- Some VTY commands only make sense if a BTS supports a certain feature +- Implement the following checks: + - In the VTY command, check if the BTS has the feature. + - In gsm_bts_check_cfg() (or called funcs like trx_has_valid_pchan_config), + check if the VTY command for the feature is set and if the BTS has the + feature. +- In both cases, do not fail the checks if bts->features_known is false. + +Resulting functionality: +- For BTS that do not support feature reporting, the VTY config is checked + against the hardcoded feature set as it gets parsed. +- For BTS that do support feature reporting, the VTY config is checked when + features get reported. The BTS gets rejected if the config is invalid for the + available features. +- Once a BTS is up and running, VTY commands changing the behavior check + against the available feature sets.
View file
osmo-bsc_1.8.1.tar.xz/doc/examples/Makefile.am -> osmo-bsc_1.9.0.tar.xz/doc/examples/Makefile.am
Changed
@@ -6,7 +6,7 @@ EXTRA_DIST = $(OSMOCONF_FILES) -CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,' +CFG_FILES = find $(srcdir) -name '*.cfg*' -o -name '*.confmerge*' | sed -e 's,^$(srcdir),,' dist-hook: for f in $$($(CFG_FILES)); do \
View file
osmo-bsc_1.9.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc-4trx-fh.confmerge
Added
@@ -0,0 +1,216 @@ +! This is a confmerge file with example frequency hopping parameters. +! Use the osmo-config-merge tool to apply it to osmo-bsc-4trx.cfg. +network + bts 0 + trx 0 + timeslot 0 + ! Shall not be hopping + timeslot 1 + ! Intentionally non-hopping + timeslot 2 + ! (c) HSN=2, MAIO=0,1 + hopping enabled 1 + hopping sequence-number 2 + hopping maio 0 + hopping arfcn add 871 + hopping arfcn add 873 + timeslot 3 + ! (e) HSN=3, MAIO=3,2,1,0 + hopping enabled 1 + hopping sequence-number 3 + hopping maio 3 + hopping arfcn add 871 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 4 + ! Intentionally non-hopping + timeslot 5 + ! (f) HSN=5, MAIO=0,1,2,3 + hopping enabled 1 + hopping sequence-number 5 + hopping maio 0 + hopping arfcn add 871 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 6 + ! (g) HSN=6, MAIO=1,0 + hopping enabled 1 + hopping sequence-number 6 + hopping maio 1 + hopping arfcn add 871 + hopping arfcn add 877 + timeslot 7 + ! (i) HSN=0, MAIO=1,3 + hopping enabled 1 + hopping sequence-number 0 + hopping maio 1 + hopping arfcn add 871 + hopping arfcn add 875 + trx 1 + timeslot 0 + ! (a) HSN=0, MAIO=0,1,2 + hopping enabled 1 + hopping sequence-number 0 + hopping maio 0 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 1 + ! Intentionally non-hopping + timeslot 2 + ! (c) HSN=2, MAIO=0,1 + hopping enabled 1 + hopping sequence-number 2 + hopping maio 1 + hopping arfcn add 871 + hopping arfcn add 873 + timeslot 3 + ! (e) HSN=3, MAIO=3,2,1,0 + hopping enabled 1 + hopping sequence-number 3 + hopping maio 2 + hopping arfcn add 871 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 4 + ! Intentionally non-hopping + timeslot 5 + ! (f) HSN=5, MAIO=0,1,2,3 + hopping enabled 1 + hopping sequence-number 5 + hopping maio 1 + hopping arfcn add 871 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 6 + ! (h) HSN=6, MAIO=1,0 + hopping enabled 1 + hopping sequence-number 6 + hopping maio 1 + hopping arfcn add 873 + hopping arfcn add 875 + timeslot 7 + ! (j) HSN=0, MAIO=0,2 + hopping enabled 1 + hopping sequence-number 0 + hopping maio 0 + hopping arfcn add 873 + hopping arfcn add 877 + trx 2 + timeslot 0 + ! (a) HSN=0, MAIO=0,1,2 + hopping enabled 1 + hopping sequence-number 0 + hopping maio 1 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 1 + ! (b) HSN=1, MAIO=3,5 + hopping enabled 1 + hopping sequence-number 1 + hopping maio 3 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 2 + ! (d) HSN=2, MAIO=2,3 + hopping enabled 1 + hopping sequence-number 2 + hopping maio 2 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 3 + ! (e) HSN=3, MAIO=3,2,1,0 + hopping enabled 1 + hopping sequence-number 3 + hopping maio 1 + hopping arfcn add 871 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 4 + ! Intentionally non-hopping + timeslot 5 + ! (f) HSN=5, MAIO=0,1,2,3 + hopping enabled 1 + hopping sequence-number 5 + hopping maio 2 + hopping arfcn add 871 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 6 + ! (h) HSN=6, MAIO=1,0 + hopping enabled 1 + hopping sequence-number 6 + hopping maio 0 + hopping arfcn add 873 + hopping arfcn add 875 + timeslot 7 + ! (i) HSN=0, MAIO=1,3 + hopping enabled 1 + hopping sequence-number 0 + hopping maio 3 + hopping arfcn add 871 + hopping arfcn add 875 + trx 3 + timeslot 0 + ! (a) HSN=0, MAIO=0,1,2 + hopping enabled 1 + hopping sequence-number 0 + hopping maio 2 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 1 + ! (b) HSN=1, MAIO=3,5 + hopping enabled 1 + hopping sequence-number 1 + hopping maio 5 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 2 + ! (d) HSN=2, MAIO=2,3 + hopping enabled 1 + hopping sequence-number 2 + hopping maio 3 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 3 + ! (e) HSN=3, MAIO=3,2,1,0 + hopping enabled 1 + hopping sequence-number 3 + hopping maio 0 + hopping arfcn add 871 + hopping arfcn add 873 + hopping arfcn add 875 + hopping arfcn add 877 + timeslot 4 + ! Intentionally non-hopping + timeslot 5 + ! (f) HSN=5, MAIO=0,1,2,3 + hopping enabled 1 + hopping sequence-number 5 + hopping maio 3 + hopping arfcn add 871
View file
osmo-bsc_1.9.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc-4trx.cfg
Added
@@ -0,0 +1,161 @@ +! osmo-bsc configuration example with 4 TRX +e1_input + e1_line 0 driver ipa +network + network country code 1 + mobile network code 1 + encryption a5 0 + neci 1 + paging any use tch 0 + bts 0 + type osmo-bts + band DCS1800 + cell_identity 6969 + location_area_code 1 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-description attach 1 + channel-description bs-pa-mfrms 5 + channel-description bs-ag-blks-res 1 + early-classmark-sending forbidden + ipa unit-id 6969 0 + oml ipa stream-id 255 line 0 + codec-support fr hr amr + gprs mode none + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + ! to use full TRX power, set max_power_red 0 + max_power_red 20 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH + hopping enabled 0 + timeslot 1 + phys_chan_config SDCCH8+CBCH + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + trx 1 + rf_locked 0 + arfcn 873 + nominal power 23 + ! to use full TRX power, set max_power_red 0 + max_power_red 20 + rsl e1 tei 1 + timeslot 0 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + trx 2 + rf_locked 0 + arfcn 875 + nominal power 23 + ! to use full TRX power, set max_power_red 0 + max_power_red 20 + rsl e1 tei 2 + timeslot 0 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + trx 3 + rf_locked 0 + arfcn 877 + nominal power 23 + ! to use full TRX power, set max_power_red 0 + max_power_red 20 + rsl e1 tei 3 + timeslot 0 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 +msc 0 + allow-emergency allow + mgw remote-ip 127.0.0.1 + mgw remote-port 2427 + mgw local-port 2727 +bsc + mid-call-timeout 0
View file
osmo-bsc_1.8.1.tar.xz/doc/examples/osmo-bsc/osmo-bsc.cfg -> osmo-bsc_1.9.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc.cfg
Changed
@@ -17,7 +17,8 @@ handover1 power budget interval 6 handover1 power budget hysteresis 3 handover1 maximum distance 9999 - periodic location update 30 + ! T3212 is in units of 6min, so below we set 5 * 6 = 30min + timer net T3212 5 bts 0 type osmo-bts band DCS1800 @@ -71,7 +72,6 @@ phys_chan_config TCH/F hopping enabled 0 msc 0 - type normal allow-emergency allow amr-config 12_2k forbidden amr-config 10_2k forbidden @@ -84,6 +84,5 @@ mgw remote-ip 127.0.0.1 mgw remote-port 2427 mgw local-port 2727 - mgw endpoint-range 1 31 bsc mid-call-timeout 0
View file
osmo-bsc_1.8.1.tar.xz/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg -> osmo-bsc_1.9.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
Changed
@@ -16,7 +16,8 @@ handover1 power budget interval 6 handover1 power budget hysteresis 3 handover1 maximum distance 9999 - periodic location update 30 + ! T3212 is in units of 6min, so below we set 5 * 6 = 30min + timer net T3212 5 bts 0 type osmo-bts band DCS1800
View file
osmo-bsc_1.8.1.tar.xz/doc/manuals/Makefile.am -> osmo-bsc_1.9.0.tar.xz/doc/manuals/Makefile.am
Changed
@@ -1,10 +1,13 @@ EXTRA_DIST = aoip-mgw-options.adoc \ aoip-mgw-options-docinfo.xml \ + osmobsc-cbsp.adoc \ + osmobsc-cbsp-docinfo.xml \ osmobsc-usermanual.adoc \ osmobsc-usermanual-docinfo.xml \ osmobsc-vty-reference.xml \ osmux-reference.adoc \ osmux-reference-docinfo.xml \ + cbsp \ chapters \ message-sequences \ mgw \ @@ -13,9 +16,10 @@ vty if BUILD_MANUALS - ASCIIDOC = osmobsc-usermanual.adoc osmux-reference.adoc aoip-mgw-options.adoc + ASCIIDOC = osmobsc-usermanual.adoc osmobsc-cbsp.adoc osmux-reference.adoc aoip-mgw-options.adoc include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc osmobsc-usermanual.pdf: $(srcdir)/chapters/*.adoc $(srcdir)/chapters/*.dot + osmobsc-cbsp.pdf: $(srcdir)/cbsp/*.adoc #$(srcdir)/cbsp/*.dot $(srcdir)/abis/*.msc aoip-mgw-options.pdf: $(srcdir)/aoip-mgw-options.adoc $(srcdir)/mgw/*.msc VTY_REFERENCE = osmobsc-vty-reference.xml
View file
osmo-bsc_1.9.0.tar.xz/doc/manuals/cbsp
Added
+(directory)
View file
osmo-bsc_1.9.0.tar.xz/doc/manuals/cbsp/messages.adoc
Added
@@ -0,0 +1,73 @@ +== CBSP Messages + +=== List of Messages + +The following tables list the CBSP messages used by OsmoBSC BSC-CBC interface, +grouped by their level of compliance with 3GPP TS 48.049. + +==== Messages Compliant With TS 48.049 + +Specific additions and limitations apply, see the linked sections. + +.Messages compliant with TS 48.049 +options="header",cols="10%,20%,45%,5%,20%" +|=== +| TS 48.049 § | This document § | Message | <-/-> | Received/Sent by OsmoBSC +| 8.1.3.1 | - | WRITE-REPLACE | <- | Received +| 8.1.3.2 | - | WRITE-REPLACE COMPLETE | -> | Sent +| 8.1.3.3 | - | WRITE-REPLACE FAILURE | -> | Sent +| 8.1.3.4 | - | KILL | <- | Received +| 8.1.3.5 | - | KILL COMPLETE | -> | Sent +| 8.1.3.6 | - | KILL FAILURE | -> | Sent +| 8.1.3.10 | - | MESSAGE STATUS QUERY | <- | Received +| 8.1.3.11 | - | MESSAGE STATUS QUERY COMPLETE | -> | Sent +| 8.1.3.12 | - | MESSAGE STATUS QUERY FAILURE | -> | Sent +| 8.1.3.16 | - | RESET | <- | Received +| 8.1.3.17 | - | RESET COMPLETE | -> | Sent +| 8.1.3.18 | <<RESET_FAILURE>> | RESET FAILURE | -> | Sent +| 8.1.3.18a | <<KEEP_ALIVE>> | KEEP-ALIVE | <- | Received +| 8.1.3.18b | - | KEEP-ALIVE COMPLETE | -> | Sent +| 8.1.3.19 | <<RESTART>> | RESTART | -> | Sent +|=== + +==== Messages Not Implemented by OsmoBSC + +.3GPP TS 48.049 messages not implemented by OsmoBSC +options="header",cols="30%,45%,5%,20%" +|=== +| TS 48.049 § | Message | <-/-> | Received/Sent by OsmoBSC +| 8.1.3.7 | LOAD QUERY | <- | Received +| 8.1.3.8 | LOAD QUERY COMPLETE | -> | Sent +| 8.1.3.9 | LOAD QUERY FAILURE | -> | Sent +| 8.1.3.13 | SET-DRX | <- | Received +| 8.1.3.14 | SET-DRX COMPLETE | -> | Sent +| 8.1.3.15 | SET-DRX FAILURE | -> | Sent +| 8.1.3.20 | FAILURE | -> | Sent +| 8.1.3.21 | ERROR INDICATION | -> | Sent +|=== + + +=== Message Limitation Details + +RESET_FAILURE +==== RESET FAILURE + +Encoding of this message is implemented, but there is currently no +condition in the OsmoBSC code that would make a RESET operation fail on +an existing cell, except if the CBC were to identify +a non-existent cell in its _Cell List IE_. + +KEEP_ALIVE +==== KEEP-ALIVE + +The message is received and generates a corresponding KEEP-ALIVE +COMPLETE answer. However, the _Keep Alive Repetition Period IE_ is not +interpreted. + +RESTART +==== RESTART + +The RESTART message is sent only at the time of establishment of every +CBSP link. It is not sent when subsequent cells become available during +runtime of the CBSP link. +
View file
osmo-bsc_1.9.0.tar.xz/doc/manuals/cbsp/procedures.adoc
Added
@@ -0,0 +1,83 @@ +== CBSP Procedures + +=== List of Procedures + +The following tables list the CBSP procedures used by the OsmoBSC BSC-CBC interface, +grouped by their level of compliance with 3GPP TS 48.049. + +==== Procedures Compliant With TS 48.049 + +Specific additions and limitations apply, see the linked sections. + +.Procedures compliant with TS 48.049 +options="header",cols="10%,20%,40%,30%" +|=== +| TS 48.049 § | This document § | Procedure | Originated/Terminated by OsmoBSC +| 7.2 | <<PROC_WRITE_REPLACE>> | Write-Replace | Terminated +| 7.3 | - | Kill | Terminated +| 7.5 | - | Message Status Query | Terminated +| 7.7a | <<PROC_KEEP_ALIVE>> | Keep Alive | Terminated +| 7.8 | <<RESTART_IND>> | Restart Indication | Originated +|=== + + +PROC_WRITE_REPLACE +===== Write-Replace + +Procedures for _Write_ and _Replace_ of CBS messages as per 3GPP TS 48.049 Section 7.2.2.2 +are fully supported. + +Procedures for _Write_ and _Replace_ of ETWS messages as per 3GPP TS +48.059 Section 7.2.2.2 are fully supported. Transmission of the ETWS +Primary Notification is implemented as follows, assuming related support +is present in the related BTS and PCU software (true for OsmoBTS >= 1.2.0 +and OsmoPCU >= 0.8.0): + +* broadcast to MS in idle mode / packet idle mode by sending a + vendor-specific A-bis RSL message to each affected BTS. A + vendor-specific mechanism is needed as 3GPP TS 48.058 does not specify + any standard message for this. See the section on _Osmocom ETWS + Command_ in <<osmobts-abis-spec>> for more details. +* broadcast to MS in dedicated mode by sending the ETWS PN via every + currently active dedicated channel (SDCCH, FACCH) within the affected + BTSs. + +As an additional clarification to 3GPP TS 48.049, OsmoBSC rejects (via +WRITE-REPLACE FAILURE) any _write_ procedure for an emergency message if +there already is another emergency message active in a cell. The +_replace_ procedure must be used (by specifying the _Old Serial Number +IE_) if the only existing emergency message of a cell shall be replaced. + +PROC_KEEP_ALIVE +===== Keep-Alive + +The Keep-Alive procedure is implemented only in as far as incoming +Keep-Alive requests are responded to. + +The BSC currently does not use the _Keep Alive Repetition Period IE_. +This is permitted as 3GPP TS 48.049 states the information _may_ be used +by the BSC. + +PROC_RESTART_IND +===== Restart Indication + +Restart indications are currently only sent whenever any BSC-CBC link is +established. They are not sent once subsequent cells become available +or are re-initialized due to A-bis link failure. + +However, CBSP state for both CBS and Emergency messages is kept +persistent in the BSC and if cells reboot / restart during the duration +of a CBS / emergency message, they will resume broadcasts as expected. + + +==== Procedures Not Implemented by OsmoBSC + +.3GPP TS 48.049 procedures not implemented by OsmoBSC +options="header",cols="30%,40%,30%" +|=== +| TS 48.049 § | Procedure | Originated/Terminated by OsmoBSC +| 7.4 | Load Status Enquiry | Terminated +| 7.6 | Set DRX | Terminated +| 7.9 | Failure Indication | Originated +| 7.10 | Error Indication | Originated +|===
View file
osmo-bsc_1.8.1.tar.xz/doc/manuals/chapters/bsc.adoc -> osmo-bsc_1.9.0.tar.xz/doc/manuals/chapters/bsc.adoc
Changed
@@ -63,18 +63,18 @@ .Configurable Timers |=== |node|timer|default|description -|network|t3101|10|Timeout for 'Immediate Assignment' (sec) -|network|t3103|?|Timeout for Handover (sec) -|network|t3105|40|Repetition of 'Physical Information' (sec) -|network|t3107|?|? -|network|t3109|?|RSL SACCH deactivation timeout (sec) -|network|t3111|?|RSL timeout to wait before releasing the RF channel (sec) -|network|t3113|60|Time to try paging for a subscriber (sec) -|network|t3115|?|? -|network|t3117|?|? -|network|t3119|?|? +|network|t3101|3|Timeout for 'Immediate Assignment' (sec) +|network|t3103|5|Timeout for Handover (sec) +|network|t3105|100|Repetition of 'Physical Information' (millisec) +|network|t3107|5|? +|network|t3109|5|RSL SACCH deactivation timeout (sec) +|network|t3111|2|RSL timeout to wait before releasing the RF channel (sec) +|network|t3113|7|Time to try paging for a subscriber (sec) +|network|t3115|10|? +|network|t3117|10|? +|network|t3119|10|? |network|t3122|10|Waiting time after 'Immediate Assignment Reject' -|network|t3141|?|? +|network|t3141|10|? |=== //TODO: split between BSC and MSC timers
View file
osmo-bsc_1.8.1.tar.xz/doc/manuals/chapters/bts-examples.adoc -> osmo-bsc_1.9.0.tar.xz/doc/manuals/chapters/bts-examples.adoc
Changed
@@ -174,3 +174,120 @@ For building a multi-TRX setup, you also need to connect the TIB cables between the two nanoBTS units, as well as the coaxial/RF AUX cabling. ==== + +=== Example configuration for OsmoBSC with E1 BTS + +The following configuration sample illustrates the usage of BTSs that are +connected via an E1/T1 backhaul. + +.OsmoBSC configured for single-TRX E1 Ericsson DUG20 +==== +---- +e1_input <1> + e1_line 0 driver dahdi + e1_line 0 port 3 +network + network country code 1 + mobile network code 1 + encryption a5 0 + neci 1 + handover 0 + bts 0 + type rbs2000 + band GSM900 + om2000 version-limit oml gen 12 rev 10 <2> + cell_identity 0 + location_area_code 1 + training_sequence_code 7 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + oml e1 line 0 timeslot 1 sub-slot full <3> + oml e1 tei 62 <4> + gprs mode none + is-connection-list add 4 512 12 <5> + is-connection-list add 16 524 12 + is-connection-list add 28 536 12 + is-connection-list add 40 548 12 + trx 0 + rf_locked 0 + arfcn 123 + nominal power 42 + max_power_red 12 + rsl e1 line 0 timeslot 1 sub-slot full <6> + rsl e1 tei 0 <7> + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + e1 line 0 timeslot 1 sub-slot full <8> + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 2 sub-slot 1 <9> + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 2 sub-slot 2 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 2 sub-slot 3 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 3 sub-slot 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 3 sub-slot 1 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 3 sub-slot 2 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 3 sub-slot 3 +---- +==== + +<1> In this example we use a dahdi E1 card. This card has 4 ports. Here we use port numer 3. It should be noted that the dahdi driver also requires additional configuration, which is not covered by this manual. + +<2> In this example we use an E1 Ericsson DUG20, which uses an OML dialect, called "OM2000". + +<3> The first usable timeslot on an E1 line is TS1. In this example we will assume that TS1-TS3 are connected to the BTS stright through. TS1 will handle all signaling traffic. Here we assign this timeslot to OML. + +<4> OML always requires a TEI (Terminal Equipment Identifier) to set up. This number can be found in the manual of the BTS. + +<5> This BTS has an built in “Interface Switch” (IS) that offers flexible way to reconfigure the interconnection between the internal components of the BTS and the external E1 line. This depends on the exact BTS type and configuration. + +<6> Similar to OML we assign TS1 to RSL as well. + +<7> Like with OML, RSL also requires a TEI to be configured. Usually each TRX will have a specific TEI assigned. + +<8> CCCH+SDCCH4 will also be mapped on TS1. The traffic for those control channels will be multiplexed alongside the RSL and OML traffic. + +<9> The bandwidth of one E1 timeslot matches the bandwidth of 4 GSM air interface timeslots. The E1 timeslot is split up into four sub-slots, which are then assigned to one GSM air interface timeslot each. Since the first timeslot on the first TRX is already used for signaling we begin the sub-slot counting with sub-slot 1 for alignment reasons. + +=== E1 Line number and MGCP trunk number +The switching of the voice channels is done via OsmoMGW, which acts as a media +converter between E1 and VoIP (RTP). OsmoBSC will use the E1 line number to +address the trunk via MGCP. + +When configuring OsmoMGW, one needs to make sure that the trunk number that is +set up on OsmoMGW, matches the line number that is set up on OsmoBSC. When those +numbers mismatch the trunk cannot be addressed correctly. + +.OsmoMGW trunk configuration that matches the OsmoBSC configuration above +==== +---- + trunk 0 + rtp keep-alive once + no rtp keep-alive + line 0 +---- +==== \ No newline at end of file
View file
osmo-bsc_1.9.0.tar.xz/doc/manuals/chapters/chan_alloc.adoc
Added
@@ -0,0 +1,79 @@ +== Channel allocation + +Radio resource management is one of the main tasks of the Base Station Controller. +This involves selection, activation, and deactivation of logical channels, which +are maintained by connected Base Stations. The number of usable logical channels +is limited by total number of radio carriers and may vary depending on the physical +channel combinations assigned to their timeslots. Thus a major goal of the this +task is to manage all the available resources in an efficient way, shifting the +balance between service quality and the overall capacity. + +=== Channel allocation parameters + +OsmoBSC's channel allocator can be configured via the VTY interface. All +relevant parameters are limited by the scope of a BTS node they belong to. +There is currently no way to define global configuration for all BTS. + +All parameters with their respective default values are listed below: + +---- +network + bts 0 + channel allocator ascending + channel allocator avoid-interference 0 + channel allocator tch-signalling-policy always +---- + +==== Channel allocation modes + +Currently only the following two simple channel allocation modes are supported: + +- ascending (default): allocates channels in ascending order, +starting from timeslot 0 of the first TRX (also called C0, the BCCH carrier); +- descending: allocates channels in descending order, +starting from timeslot 7 of the last TRX. + +NOTE: Regardless of the chosen mode, logical channels (sub-slots) are always +selected in ascending order. For example, if a timeslot is configured as SDCCH/8 +and all 8 sub-slots are not in use, then the first SDCCH(0) sub-slot will be +selected in both ascending and descending modes. + +The allocation mode to be used can be configured using the following VTY command: + +---- +OsmoBSC(config-net-bts)# channel allocator ? + ascending Allocate Timeslots and Transceivers in ascending order + descending Allocate Timeslots and Transceivers in descending order +---- + +==== Interference aware channel allocation + +The channel allocator can be configured to prefer logical channels with least +interference, based on interference measurements periodically sent by the BTSs +(see <<interf_rep>>). This is an optional feature, which is disabled by default. + +---- +OsmoBSC(config-net-bts)# channel allocator avoid-interference ? + 0 Ignore interference levels (default). Always assign lchans + in a deterministic order. + 1 In channel allocation, prefer lchans with less interference. +---- + +NOTE: Interference levels are compared within the scope of a single TRX, which +is selected with respect to the configured allocation mode. This means that +the selection logic would ignore channels on the other TRXes, even if they +are better according to the interference reports from the BTS. + +==== TCH sigalling policy + +By default, in a situation when all SDCCHs are exhausted, OsmoBSC will be using TCH +channels for signalling (e.g for Location Updating or call establishment). This +behavior can be restricted to certain kinds of signalling or disabled completely. + +---- +OsmoBSC(config-net-bts)# channel allocator tch-signalling-policy ? + never Never allow TCH for signalling purposes + emergency Only allow TCH for signalling purposes when establishing an emergency call + voice Allow TCH for signalling purposes when establishing any voice call + always Always allow TCH for signalling purposes (default) +----
View file
osmo-bsc_1.8.1.tar.xz/doc/manuals/chapters/interf_meas.adoc -> osmo-bsc_1.9.0.tar.xz/doc/manuals/chapters/interf_meas.adoc
Changed
@@ -1,3 +1,4 @@ +interf_rep == Interference reporting According to 3GPP 48.058, section 6.1, the BTS shall periodically report the
View file
osmo-bsc_1.9.0.tar.xz/doc/manuals/osmobsc-cbsp-docinfo.xml
Added
@@ -0,0 +1,36 @@ + +<authorgroup> + <author> + <firstname>Harald</firstname> + <surname>Welte</surname> + <email>hwelte@sysmocom.de</email> + <authorinitials>HW</authorinitials> + <affiliation> + <shortaffil>sysmocom</shortaffil> + <orgname>sysmocom - s.f.m.c. GmbH</orgname> + <jobtitle>Managing Director</jobtitle> + </affiliation> + </author> +</authorgroup> + +<copyright> + <year>2022</year> + <holder>sysmocom - s.f.m.c. GmbH</holder> +</copyright> + +<legalnotice> + <para> + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + </para> + <para> + The Asciidoc source code of this manual can be found at + <ulink url="https://git.osmocom.org/osmo-bsc/"> + https://git.osmocom.org/osmo-bsc/ + </ulink> + </para> +</legalnotice>
View file
osmo-bsc_1.9.0.tar.xz/doc/manuals/osmobsc-cbsp.adoc
Added
@@ -0,0 +1,69 @@ +:gfdl-enabled: + +OsmoBSC CBSP Protocol Specification +=================================== +Harald Welte <hwelte@sysmocom.de> + +== Introduction + +This document describes the CBSP interface of *OsmoBSC* as spoken on the +BSC-CBC interface. Based on 3GPP TS 48.049 <<3gpp-ts-48-049>>, this document indicates +which of the 3GPP specified CBSP messages and IEs are implemented +according to 3GPP specifications, which of these are not or not fully +implemented, as well as OsmoBSC-specific extensions to the CBSP +interface not specified by 3GPP. + +For details on the standard CBSP messages and IE definitions, +please refer to the 3GPP documents. + +.3GPP document versions referred to by this document +cols="20%,80%" +|=== +|3GPP TS 48.049 | version 12.0.0 Release 12 +|=== + +.IETF documents referred to by his document +cols="20%,80%" +|=== +|IETF RFC 793 | Transmission Control Protocol +|=== + +== Overview + +The OsmoBSC BSC-CBC interface consists of CBSP messages transmitted over +TCP. + +The default TCP destination port number is TCP port 48049; this can be +changed by configuration, as described in the OsmoBSC user manual +<<userman-osmobsc>> and/or VTY reference manual <<vty-ref-osmobsc>>. + +.TCP port numbers used by OsmoBTS Abis/IP +options="header",width="50%",cols="35%,65%" +|=== +|TCP Port Number|Usage +|48049|CBSP +|=== + +OsmoBSC implements both _TCP server_ and _TCP client_ role; it is hence +configurable whether the CBC establishes the TCP connection to the BSC +(BSC in _TCP server_ role) or if the BSC establishes the TCP connection +to the CBC (BSC in _TCP client_ role). + +Currently, only transport of TCP via IPv4 is implemented. + +Any IP-capable link-layer protocol implemented in the underlying Linux +operating system can be used to transport the IP/TCP/CBSP of OsmoBSC. + + +include::{srcdir}/cbsp/procedures.adoc + +include::{srcdir}/cbsp/messages.adoc + + +include::./common/chapters/port_numbers.adoc + +include::./common/chapters/bibliography.adoc + +include::./common/chapters/glossary.adoc + +include::./common/chapters/gfdl.adoc
View file
osmo-bsc_1.8.1.tar.xz/doc/manuals/osmobsc-usermanual.adoc -> osmo-bsc_1.9.0.tar.xz/doc/manuals/osmobsc-usermanual.adoc
Changed
@@ -24,6 +24,8 @@ include::{srcdir}/chapters/bsc.adoc +include::{srcdir}/chapters/chan_alloc.adoc + include::{srcdir}/chapters/power_control.adoc include::{srcdir}/chapters/interf_meas.adoc
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/acc.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/acc.h
Changed
@@ -161,6 +161,8 @@ return acc_ramp->step_interval_sec; } +void acc_ramp_global_init(void); + void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts); int acc_ramp_set_step_size(struct acc_ramp *acc_ramp, unsigned int step_size); int acc_ramp_set_step_interval(struct acc_ramp *acc_ramp, unsigned int step_interval);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/bsc_msc_data.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/bsc_msc_data.h
Changed
@@ -59,8 +59,9 @@ MSC_CTR_BSSMAP_RX_UDT_UNKNOWN, MSC_CTR_BSSMAP_RX_DT1_CLEAR_CMD, MSC_CTR_BSSMAP_RX_DT1_CIPHER_MODE_CMD, - MSC_CTR_BSSMAP_RX_DT1_ASSIGMENT_RQST, + MSC_CTR_BSSMAP_RX_DT1_ASSIGNMENT_RQST, MSC_CTR_BSSMAP_RX_DT1_LCLS_CONNECT_CTRL, + MSC_CTR_BSSMAP_RX_DT1_HANDOVER_RQST, MSC_CTR_BSSMAP_RX_DT1_HANDOVER_CMD, MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST, MSC_CTR_BSSMAP_RX_DT1_CONFUSION,
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/bsc_stats.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/bsc_stats.h
Changed
@@ -22,6 +22,7 @@ struct osmo_stat_item_group_desc; struct gsm_network; +struct gsm_bts; /* OsmoBSC rate_ctr indexes */ enum { @@ -76,6 +77,7 @@ BSC_CTR_PAGING_ATTEMPTED, BSC_CTR_PAGING_DETACHED, BSC_CTR_PAGING_RESPONDED, + BSC_CTR_PAGING_EXPIRED, BSC_CTR_PAGING_NO_ACTIVE_PAGING, BSC_CTR_UNKNOWN_UNIT_ID, BSC_CTR_MSCPOOL_SUBSCR_NO_MSC, @@ -109,4 +111,6 @@ extern const struct osmo_stat_item_group_desc bsc_statg_desc; void bsc_update_connection_stats(struct gsm_network *net); -void bsc_update_time_cc_all_allocated(struct gsm_network *net); + +void all_allocated_update_bts(struct gsm_bts *bts); +void all_allocated_update_bsc();
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/bsc_subscr_conn_fsm.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/bsc_subscr_conn_fsm.h
Changed
@@ -9,6 +9,7 @@ enum gscon_fsm_event { /* local SCCP stack tells us incoming conn from MSC */ GSCON_EV_A_CONN_IND, + GSCON_EV_A_INITIAL_USER_DATA, /* RSL side requests CONNECT to MSC */ GSCON_EV_MO_COMPL_L3, /* MSC confirms the SCCP connection */ @@ -65,6 +66,7 @@ void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, int link_id, int allow_sacch); int gscon_sigtran_send(struct gsm_subscriber_connection *conn, struct msgb *msg); +void gscon_bssmap_clear(struct gsm_subscriber_connection *conn, enum gsm0808_cause cause); struct osmo_mgcpc_ep *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, uint16_t msc_assigned_cic, struct gsm_lchan *for_lchan);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/bsc_subscriber.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/bsc_subscriber.h
Changed
@@ -17,6 +17,8 @@ char imsiGSM23003_IMSI_MAX_DIGITS+1; uint32_t tmsi; + + uint32_t active_paging_requests; }; const char *bsc_subscr_name(struct bsc_subscr *bsub);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/bts.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/bts.h
Changed
@@ -12,10 +12,12 @@ #include <osmocom/abis/e1_input.h> +#include "osmocom/bsc/power_control.h" #include "osmocom/bsc/gsm_data.h" #include "osmocom/bsc/bts_trx.h" #include "osmocom/bsc/bts_sm.h" #include "osmocom/bsc/abis_om2000.h" +#include "osmocom/bsc/paging.h" enum bts_counter_id { BTS_CTR_CHREQ_TOTAL, @@ -53,10 +55,15 @@ BTS_CTR_PAGING_EXPIRED, BTS_CTR_PAGING_NO_ACTIVE_PAGING, BTS_CTR_PAGING_MSC_FLUSH, + BTS_CTR_PAGING_OVERLOAD, BTS_CTR_CHAN_ACT_TOTAL, BTS_CTR_CHAN_ACT_SDCCH, BTS_CTR_CHAN_ACT_TCH, BTS_CTR_CHAN_ACT_NACK, + BTS_CTR_CHAN_TCH_ACTIVE_MILLISECONDS_TOTAL, + BTS_CTR_CHAN_SDCCH_ACTIVE_MILLISECONDS_TOTAL, + BTS_CTR_CHAN_TCH_FULLY_ESTABLISHED, + BTS_CTR_CHAN_SDCCH_FULLY_ESTABLISHED, BTS_CTR_RSL_UNKNOWN, BTS_CTR_RSL_IPA_NACK, BTS_CTR_RSL_DELETE_IND, @@ -220,6 +227,7 @@ BTS_STAT_TS_BORKEN, BTS_STAT_NUM_TRX_RSL_CONNECTED, BTS_STAT_NUM_TRX_TOTAL, + BTS_STAT_T3113, }; extern const struct osmo_stat_item_desc bts_stat_desc; @@ -253,6 +261,13 @@ TRX_PHY_VERSION, }; +enum bts_tch_signalling_policy { + BTS_TCH_SIGNALLING_NEVER, + BTS_TCH_SIGNALLING_EMERG, + BTS_TCH_SIGNALLING_VOICE, + BTS_TCH_SIGNALLING_ALWAYS, +}; + struct vty; struct gsm_bts_model { @@ -293,9 +308,12 @@ struct tlv_definition nm_att_tlvdef; - /* features of a given BTS model set via gsm_bts_model_register() locally */ + /* features of a given BTS model set via gsm_bts_model_register() + * locally, see doc/bts-features.txt */ struct bitvec features; uint8_t _features_dataMAX_BTS_FEATURES/8; + /* BTS reports features during OML bring up */ + bool features_get_reported; }; struct gsm_gprs_cell { @@ -332,9 +350,13 @@ char versionMAX_VERSION_LENGTH; char sub_modelMAX_VERSION_LENGTH; - /* features of a given BTS set/reported via OML */ + /* features of a given BTS either hardcoded or set/reported via OML, + * see doc/bts-features.txt */ struct bitvec features; uint8_t _features_dataMAX_BTS_FEATURES/8; + /* Features have been reported by the BTS or were copied from the BTS + * model */ + bool features_known; /* Connected PCU version (if any) */ char pcu_versionMAX_VERSION_LENGTH; @@ -469,8 +491,10 @@ } pwr_ctrl; /* TS 44.060 Table 12.9.1 */ } gprs; - /* threshold (in percent) when BTS shall send CCCH LOAD IND */ - int ccch_load_ind_thresh; + /* CCCH Load Threshold: threshold (in percent) when BTS shall send CCCH LOAD IND */ + uint8_t ccch_load_ind_thresh; + /* CCCH Load Indication Period: how often (secs) to send CCCH LOAD IND when over CCCH Load Threshold. */ + uint8_t ccch_load_ind_period; /* RACH NM values */ int rach_b_thresh; @@ -499,9 +523,8 @@ * interference reported in RSL Resource Indication. */ bool chan_alloc_avoid_interf; - /* When true (default), TCH can be allocated to serve - * non-voicecall-related signalling services when SDCCHs are exhausted */ - bool chan_alloc_allow_tch_for_signalling; + /* If SDCCHs are exhausted, when can we use TCH for signalling purposes. */ + enum bts_tch_signalling_policy chan_alloc_tch_signalling_policy; enum neigh_list_manual_mode neigh_list_manual_mode; /* parameters from which we build SYSTEM INFORMATION */ @@ -585,7 +608,7 @@ struct osmo_timer_list cbch_timer; struct bts_smscb_chan_state cbch_basic; struct bts_smscb_chan_state cbch_extended; - struct osmo_timer_list etws_timer; /* when to stop ETWS PN */ + struct bts_etws_state etws; struct llist_head oml_fail_rep; struct llist_head chan_rqd_queue; @@ -622,10 +645,8 @@ /* At what point in the channel allocation sequence to dispatch the Immediate Assignment (Abis optimization) */ enum imm_ass_time imm_ass_time; - struct osmo_time_cc all_allocated_sdcch; - struct osmo_time_cc all_allocated_static_sdcch; - struct osmo_time_cc all_allocated_tch; - struct osmo_time_cc all_allocated_static_tch; + struct chan_counts chan_counts; + struct all_allocated all_allocated; }; #define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_bufSYSINFO_TYPE_2quateri) @@ -717,6 +738,7 @@ } struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, struct gsm_bts_sm *bts_sm, uint8_t bts_num); +int gsm_bts_check_cfg(struct gsm_bts *bts); char *gsm_bts_name(const struct gsm_bts *bts); @@ -731,6 +753,7 @@ /* return the gsm_lchan for the CBCH (if it exists at all) */ struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); +int gsm_set_bts_model(struct gsm_bts *bts, struct gsm_bts_model *model); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); @@ -742,6 +765,9 @@ unsigned long long bts_uptime(const struct gsm_bts *bts); +#define BTS_STORE_LCHAN_DURATIONS_INTERVAL 1 /* in seconds */ +void bts_store_lchan_durations(struct gsm_bts *bts); + char *get_model_oml_status(const struct gsm_bts *bts); /* reset the state of all MO in the BTS */ void gsm_bts_mo_reset(struct gsm_bts *bts);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h
Changed
@@ -28,9 +28,9 @@ struct gsm_bts; struct gsm_bts_trx; -struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nse_get(struct gsm_bts_sm *bts_sm); -struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nsvc_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, +struct msgb *nanobts_gen_set_bts_attr(struct gsm_bts *bts); +struct msgb *nanobts_gen_set_nse_attr(struct gsm_bts_sm *bts_sm); +struct msgb *nanobts_gen_set_cell_attr(struct gsm_bts *bts); +struct msgb *nanobts_gen_set_nsvc_attr(struct gsm_bts *bts); +struct msgb *nanobts_gen_set_radio_attr(struct gsm_bts *bts, struct gsm_bts_trx *trx);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/bts_trx.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/bts_trx.h
Changed
@@ -79,6 +79,9 @@ } rbs2000; }; struct gsm_bts_trx_ts tsTRX_NR_TS; + + struct chan_counts chan_counts; + struct load_counter lchan_load; }; static inline struct gsm_bts_trx *gsm_bts_bb_trx_get_trx(struct gsm_bts_bb_trx *bb_transc) {
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/chan_counts.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/chan_counts.h
Changed
@@ -3,8 +3,16 @@ struct gsm_bts; struct gsm_bts_trx; +struct gsm_bts_trx_ts; +struct gsm_lchan; -/* First array index to typedef chan_counts_arr. */ +void chan_counts_sig_init(); +void chan_counts_ts_update(struct gsm_bts_trx_ts *ts); +void chan_counts_ts_clear(struct gsm_bts_trx_ts *ts); +void chan_counts_trx_update(struct gsm_bts_trx *trx); +void chan_counts_bsc_verify(); + +/* First array index to chan_counts.val. */ enum chan_counts_dim1 { CHAN_COUNTS1_ALL = 0, CHAN_COUNTS1_STATIC = 1, @@ -12,7 +20,7 @@ _CHAN_COUNTS1_NUM }; -/* Second array index to typedef chan_counts_arr. */ +/* Second array index to chan_counts.val. */ enum chan_counts_dim2 { /* The maximum possible nr of lchans of this type. Counts all dynamic timeslots as if they are fully available * for this type, regardless of the current pchan mode. (For CHAN_COUNTS1_STATIC, of course no dyn TS are counted @@ -29,17 +37,29 @@ }; struct chan_counts { - unsigned int val_CHAN_COUNTS1_NUM_CHAN_COUNTS2_NUM_GSM_LCHAN_MAX; + /* Signed type, so that chan_counts_diff() can return negative values. */ + int val_CHAN_COUNTS1_NUM_CHAN_COUNTS2_NUM_GSM_LCHAN_MAX; }; -void chan_counts_for_bts(struct chan_counts *bts_counts, const struct gsm_bts *bts); -void chan_counts_for_trx(struct chan_counts *trx_counts, const struct gsm_bts_trx *trx); - static inline void chan_counts_zero(struct chan_counts *counts) { *counts = (struct chan_counts){0}; } +static inline bool chan_counts_is_zero(const struct chan_counts *counts) +{ + int i1, i2, i3; + for (i1 = 0; i1 < _CHAN_COUNTS1_NUM; i1++) { + for (i2 = 0; i2 < _CHAN_COUNTS2_NUM; i2++) { + for (i3 = 0; i3 < _GSM_LCHAN_MAX; i3++) { + if (counts->vali1i2i3) + return false; + } + } + } + return true; +} + static inline void chan_counts_dim3_add(struct chan_counts *dst, enum chan_counts_dim1 dst_dim1, enum chan_counts_dim2 dst_dim2, const struct chan_counts *add, @@ -68,9 +88,24 @@ chan_counts_dim3_add(dst, dst_dim1, i, add, add_dim1, i); } +static inline void chan_counts_dim2_sub(struct chan_counts *dst, enum chan_counts_dim1 dst_dim1, + const struct chan_counts *sub, enum chan_counts_dim1 sub_dim1) +{ + int i; + for (i = 0; i < _CHAN_COUNTS2_NUM; i++) + chan_counts_dim3_sub(dst, dst_dim1, i, sub, sub_dim1, i); +} + static inline void chan_counts_add(struct chan_counts *dst, const struct chan_counts *add) { int i; for (i = 0; i < _CHAN_COUNTS1_NUM; i++) chan_counts_dim2_add(dst, i, add, i); } + +static inline void chan_counts_sub(struct chan_counts *dst, const struct chan_counts *sub) +{ + int i; + for (i = 0; i < _CHAN_COUNTS1_NUM; i++) + chan_counts_dim2_sub(dst, i, sub, i); +}
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/gsm_04_08_rr.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/gsm_04_08_rr.h
Changed
@@ -3,6 +3,8 @@ #include <stdint.h> #include <osmocom/core/msgb.h> +enum handover_scope; + struct amr_mode; struct amr_multirate_conf; struct bsc_subscr; @@ -24,9 +26,9 @@ int gsm48_multirate_config(struct msgb *msg, const struct gsm48_multi_rate_conf *mr_conf, const struct amr_mode *modes, unsigned int num_modes); -struct msgb *gsm48_make_ho_cmd(struct gsm_lchan *new_lchan, uint8_t power_command, uint8_t ho_ref); -int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan, - uint8_t power_command, uint8_t ho_ref); +struct msgb *gsm48_make_ho_cmd(const struct gsm_lchan *new_lchan, + enum handover_scope ho_scope, bool async, + uint8_t power_command, uint8_t ho_ref); int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_command); int gsm48_send_rr_app_info(struct gsm_lchan *lchan, uint8_t apdu_id, uint8_t apdu_flags, const uint8_t *apdu_data, ssize_t apdu_data_len);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/gsm_08_08.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/gsm_08_08.h
Changed
@@ -7,7 +7,7 @@ struct gsm_subscriber_connection; void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci, enum gsm0808_cause cause); -void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr); +void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_a5_n); int bsc_compl_l3(struct gsm_lchan *lchan, struct msgb *msg, uint16_t chosen_channel); void bsc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, struct msgb *msg); void bsc_cm_update(struct gsm_subscriber_connection *conn,
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/gsm_data.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/gsm_data.h
Changed
@@ -29,10 +29,12 @@ #include <osmocom/gsm/rxlev_stat.h> #include <osmocom/gsm/protocol/gsm_08_58.h> #include <osmocom/gsm/protocol/gsm_12_21.h> +#include <osmocom/gsm/protocol/gsm_03_41.h> #include <osmocom/abis/e1_input.h> #include <osmocom/bsc/meas_rep.h> #include <osmocom/bsc/acc.h> #include <osmocom/bsc/osmux.h> +#include <osmocom/bsc/chan_counts.h> #define GSM_T3122_DEFAULT 10 @@ -56,6 +58,26 @@ #define OBSC_LINKID_CB(__msgb) (__msgb)->cb3 +/* Data Link Connection Identifier (DLCI) is defined in 3GPP TS 48.006, section 9.3.2. + * .... .SSS - SAPI value used on the radio link; + * CC.. .... - control channel identification: + * 00.. .... - indicates that the control channel is not further specified, + * 10.. .... - represents the FACCH or the SDCCH, + * 11.. .... - represents the SACCH, + * other values are reserved. */ +#define RSL_LINK_ID2DLCI(link_id) \ + ((link_id & 0x40 ? 0xc0 : 0x80) | (link_id & 0x07)) + +/* RSL Link Identifier is defined in 3GPP TS 3GPP TS 48.058, section 9.3.2. + * .... .SSS - SAPI value used on the radio link; + * ...P P... - priority for SAPI0 messages; + * CC.. .... - control channel identification: + * 00.. .... - main signalling channel (FACCH or SDCCH), + * 01.. .... - SACCH, + * other values are reserved. */ +#define DLCI2RSL_LINK_ID(dlci) \ + ((dlci & 0xc0) == 0xc0 ? 0x40 : 0x00) | (dlci & 0x07) + /* 3-bit long values */ #define EARFCN_PRIO_INVALID 8 #define EARFCN_MEAS_BW_INVALID 8 @@ -250,6 +272,8 @@ struct gsm0808_channel_type ct; struct gsm0808_speech_codec_list scl; struct gsm0808_encrypt_info ei; + /* The same information as in 'ei' but as the handy bitmask as on the wire. */ + uint8_t ei_as_bitmask; bool kc128_present; uint8_t kc12816; struct gsm_classmark classmark; @@ -404,6 +428,8 @@ bool last_eutran_plmn_valid; /* Is information stored in field below available? */ struct osmo_plmn_id last_eutran_plmn; } fast_return; + + enum gsm0808_cause clear_cause; }; @@ -506,7 +532,25 @@ #define A38_XOR_MIN_KEY_LEN 12 #define A38_XOR_MAX_KEY_LEN 16 #define A38_COMP128_KEY_LEN 16 -#define RSL_ENC_ALG_A5(x) (x+1) + +/* There are these representations of A5/n: + * + * - (uint8_t)(1<<n), either as a single bit, or combined as a list of + * permitted algorithms. + * A5/0 == 0x01, A5/3 == 0x08, none = 0 + * + * - n+1, used on the RSL wire. + * A5/0 == 1, A5/3 == 4, none = 0 + * + * - n, used for human interaction and returned by select_best_cipher(). + * A5/0 == 0, A5/3 == 3, none <= -1 + * + * These macros convert from n to the other representations: + */ +#define ALG_A5_NR_TO_RSL(A5_N) ((A5_N) >= 0 ? (A5_N)+1 : 0) +#define ALG_A5_NR_TO_BSSAP(A5_N) ALG_A5_NR_TO_RSL(A5_N) +#define ALG_A5_NR_TO_PERM_ALG_BITS(A5_N) ((A5_N) >= 0 ? 1<<(A5_N) : 0) + /* Up to 16 SI2quater are multiplexed; each fits 3 EARFCNS, so the practical maximum is 3*16. * The real maximum that fits in a total of 16 SI2quater rest octets also depends on the bits left by other SI2quater * rest octets elements, so to really fit 48 EARFCNs most other SI2quater elements need to be omitted. */ @@ -567,7 +611,7 @@ #define MAX_A5_KEY_LEN (128/8) struct gsm_encr { - uint8_t alg_id; + uint8_t alg_a5_n; /* N: 0 (A5/0), 1 (A5/1), ... 7 (A5/7) */ uint8_t key_len; uint8_t keyMAX_A5_KEY_LEN; bool kc128_present; @@ -846,6 +890,9 @@ uint8_t interf_band; /* MS power control state */ struct lchan_power_ctrl_state ms_power_ctrl; + /* Timestamps and markers to track active state duration. */ + struct timespec active_start; + struct timespec active_stored; }; /* One Timeslot in a TRX */ @@ -916,30 +963,12 @@ * Does not include count of secondary VAMOS lchans. */ uint8_t max_primary_lchans; struct gsm_lchan lchanTS_MAX_LCHAN; + + struct chan_counts chan_counts; }; #define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.bufi0) -/* - * This keeps track of the paging status of one BTS. It - * includes a number of pending requests, a back pointer - * to the gsm_bts, a timer and some more state. - */ -struct gsm_bts_paging_state { - /* pending requests */ - struct llist_head pending_requests; - struct gsm_bts *bts; - - struct osmo_timer_list work_timer; - struct osmo_timer_list credit_timer; - - /* free chans needed */ - int free_chans_need; - - /* load */ - uint16_t available_slots; -}; - struct gsm_envabtse { struct gsm_abis_mo mo; }; @@ -1064,6 +1093,27 @@ uint8_t overflow; }; +#define ETWS_PRIM_NOTIF_SIZE 56 +#define ETWS_SEC_INFO_SIZE (ETWS_PRIM_NOTIF_SIZE - sizeof(struct gsm341_etws_message)) + +/* per-BTS ETWS/PWS (Emergency) state */ +struct bts_etws_state { + /* are we actively broadcasting emergency in this cell? */ + bool active; + /* input parameters received from CBC */ + struct { + uint16_t msg_id; + uint16_t serial_nr; + uint16_t warn_type; + uint8_t sec_infoETWS_SEC_INFO_SIZE; + } input; + /* encoded ETWS primary notification */ + uint8_t primaryETWS_PRIM_NOTIF_SIZE; + + /* timer running for the duration of the ETWS Primary Notification (PN) */ + struct osmo_timer_list timer; +}; + struct bts_oml_fail_rep { struct llist_head list; time_t time; @@ -1103,6 +1153,7 @@ char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); void lchan_update_name(struct gsm_lchan *lchan); +uint64_t gsm_lchan_active_duration_ms(const struct gsm_lchan *lchan); static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) { @@ -1155,6 +1206,13 @@ int dst; /* daylight savings */ }; +struct all_allocated { + struct osmo_time_cc sdcch; + struct osmo_time_cc static_sdcch; + struct osmo_time_cc tch; + struct osmo_time_cc static_tch; +}; + struct gsm_network { struct osmo_plmn_id plmn; @@ -1234,6 +1292,9 @@ /* Timer to write each BTS's uptime counter state to the stats system. */ struct osmo_timer_list bts_store_uptime_timer; + /* Timer to write each BTS's set of lchan duration counters' state to the stats system. */ + struct osmo_timer_list bts_store_lchan_durations_timer; + struct { /* Single MGCP client configuration under msc node (also required for * MGCP proxy when sccp-lite is used) */ @@ -1262,10 +1323,8 @@ struct smlc_config *smlc;
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/handover_cfg.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/handover_cfg.h
Changed
@@ -268,6 +268,13 @@ "Time to suspend re-assignment after an lchan was re-assigned because of low RxQual\n" \ "Seconds\n") \ \ + HO_CFG_ONE_MEMBER(int, hodec2_penalty_low_rxqual_ho, 60, \ + "handover2 ", "penalty-time low-rxqual-ho", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER2 \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handover back to a cell after bad RxQual caused handover away from it\n" \ + "Seconds\n") \ + \ HO_CFG_ONE_MEMBER(int, hodec2_retries, 0, \ "handover2 ", "retries", "<0-9>", atoi, "%d", as_is, \ HO_CFG_STR_HANDOVER2 \
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/lcs_loc_req.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/lcs_loc_req.h
Changed
@@ -31,6 +31,15 @@ bool cell_id_present; struct gsm0808_cell_id cell_id; + bool client_type_present; + enum bssmap_le_lcs_client_type client_type; + + bool priority_present; + uint8_t priority; + + bool qos_present; + struct osmo_bssmap_le_lcs_qos qos; + struct osmo_mobile_identity imsi; struct osmo_mobile_identity imei; } req;
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/nm_common_fsm.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/nm_common_fsm.h
Changed
@@ -25,6 +25,9 @@ #include <osmocom/core/fsm.h> #include <osmocom/core/utils.h> +#include <osmocom/gsm/protocol/gsm_12_21.h> + +struct gsm_bts; /* Common */ enum nm_fsm_events { @@ -111,3 +114,7 @@ NM_GPRS_NSVC_ST_OP_ENABLED, }; extern struct osmo_fsm nm_gprs_nsvc_fsm; + +void nm_obj_fsm_becomes_enabled_disabled(struct gsm_bts *bts, void *obj, + enum abis_nm_obj_class obj_class, + bool running);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/paging.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/paging.h
Changed
@@ -33,14 +33,14 @@ struct bsc_msc_data; #define LOG_PAGING(PARAMS, SUBSYS, LEVEL, fmt, args...) \ - LOGP(SUBSYS, LEVEL, "(msc%d) Paging%s: %s: " fmt, \ + LOGP(SUBSYS, LEVEL, "(msc=%d) Paging%s: %s: " fmt, \ (PARAMS)->msc ? (PARAMS)->msc->nr : -1, \ (PARAMS)->reason == BSC_PAGING_FOR_LCS ? " for LCS" : "", \ bsc_subscr_name((PARAMS)->bsub), \ ##args) #define LOG_PAGING_BTS(PARAMS, BTS, SUBSYS, LEVEL, fmt, args...) \ - LOG_PAGING(PARAMS, SUBSYS, LEVEL, "(bts%u) " fmt, (BTS) ? (BTS)->nr : 255, ##args) + LOG_PAGING(PARAMS, SUBSYS, LEVEL, "(bts=%u) " fmt, (BTS) ? (BTS)->nr : 255, ##args) #define BSUB_USE_PAGING_START "paging-start" #define BSUB_USE_PAGING_REQUEST "paging-req" @@ -76,12 +76,16 @@ struct gsm_bts *bts; /* what kind of channel type do we ask the MS to establish */ int chan_type; + /* paging group of the subscriber: */ + uint8_t pgroup; /* Timer 3113: how long do we try to page? */ struct osmo_timer_list T3113; /* How often did we ask the BTS to page? */ int attempts; + /* Timestamp of last time the subscriber was paged */ + struct timespec last_attempt_ts; /* MSC that has issued this paging */ struct bsc_msc_data *msc; @@ -89,6 +93,36 @@ enum bsc_paging_reason reason; }; +/* + * This keeps track of the paging status of one BTS. It + * includes a number of pending requests, a back pointer + * to the gsm_bts, a timer and some more state. + */ +struct gsm_bts_paging_state { + /* pending requests */ + struct llist_head pending_requests; + /* Number of requests in pending_requests_len */ + unsigned int pending_requests_len; + struct gsm_bts *bts; + + struct osmo_timer_list work_timer; + struct osmo_timer_list credit_timer; + + /* Last time paging worker was triggered */ + struct timespec last_sched_ts; + + /* free chans needed */ + int free_chans_need; + + /* load */ + uint16_t available_slots; +}; + +void paging_global_init(void); + +void paging_init(struct gsm_bts *bts); +void paging_destructor(struct gsm_bts *bts); + /* schedule paging request */ int paging_request_bts(const struct bsc_paging_params *params, struct gsm_bts *bts); @@ -105,5 +139,7 @@ void paging_flush_bts(struct gsm_bts *bts, struct bsc_msc_data *msc); void paging_flush_network(struct gsm_network *net, struct bsc_msc_data *msc); +uint16_t paging_estimate_available_slots(struct gsm_bts *bts, unsigned int time_span_s); + int bsc_paging_start(struct bsc_paging_params *params); #endif
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/power_control.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/power_control.h
Changed
@@ -5,3 +5,95 @@ #include <osmocom/bsc/meas_rep.h> int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan, const struct gsm_meas_rep *mr); + +/* MS/BS Power related measurement averaging algo */ +enum gsm_power_ctrl_meas_avg_algo { + GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE = 0x00, + GSM_PWR_CTRL_MEAS_AVG_ALGO_UNWEIGHTED = 0x01, + GSM_PWR_CTRL_MEAS_AVG_ALGO_WEIGHTED = 0x02, + GSM_PWR_CTRL_MEAS_AVG_ALGO_MOD_MEDIAN = 0x03, + /* EWMA is an Osmocom specific algo */ + GSM_PWR_CTRL_MEAS_AVG_ALGO_OSMO_EWMA = 0x04, +}; + +/* MS/BS Power related measurement parameters */ +struct gsm_power_ctrl_meas_params { + /* Are these measurement paremeters to be taken into account by loop? */ + bool enabled; + + /* Thresholds (see 3GPP TS 45.008, section A.3.2.1) */ + uint8_t lower_thresh; /* lower (decreasing) direction */ + uint8_t upper_thresh; /* upper (increasing) direction */ + + /* Threshold Comparators for lower (decreasing) direction */ + uint8_t lower_cmp_p; /* P1 for RxLev, P3 for RxQual */ + uint8_t lower_cmp_n; /* N1 for RxLev, N3 for RxQual */ + /* Threshold Comparators for upper (increasing) direction */ + uint8_t upper_cmp_p; /* P2 for RxLev, P4 for RxQual */ + uint8_t upper_cmp_n; /* N2 for RxLev, N4 for RxQual */ + + /* Hreqave and Hreqt (see 3GPP TS 45.008, Annex A) */ + uint8_t h_reqave; + uint8_t h_reqt; + + /* AVG algorithm and its specific parameters */ + enum gsm_power_ctrl_meas_avg_algo algo; + union { + /* Exponentially Weighted Moving Average */ + struct { + /* Smoothing factor: higher the value - less smoothing */ + uint8_t alpha; /* 1 .. 99 (in %) */ + } ewma; + }; +}; + +enum gsm_power_ctrl_dir { + GSM_PWR_CTRL_DIR_UL, /* MS Power Control */ + GSM_PWR_CTRL_DIR_DL, /* BS Power Control */ +}; + +enum gsm_power_ctrl_mode { + /* Do not send MS/BS Power Control IEs */ + GSM_PWR_CTRL_MODE_NONE = 0, + /* Send MS/BS Power IE only (with target level) */ + GSM_PWR_CTRL_MODE_STATIC, + /* Send MS/BS Power Parameters IEs (dynamic mode) */ + GSM_PWR_CTRL_MODE_DYN_BTS, + /* Do not send MS/BS Power IEs and use BSC Power Loop */ + GSM_PWR_CTRL_MODE_DYN_BSC, + +}; + +/* MS/BS Power Control Parameters */ +struct gsm_power_ctrl_params { + /* Power Control direction: Uplink or Downlink */ + enum gsm_power_ctrl_dir dir; + /* Power Control mode to be used by the BTS */ + enum gsm_power_ctrl_mode mode; + + /* BS Power reduction value / maximum (in dB) */ + uint8_t bs_power_val_db; /* for static mode */ + uint8_t bs_power_max_db; /* for dynamic mode */ + + /* Power change step size (dynamic mode only) */ + uint8_t inc_step_size_db; /* increasing direction */ + uint8_t red_step_size_db; /* reducing direction */ + + /* Minimum interval between power level changes */ + uint8_t ctrl_interval; /* 1 step is 2 SACCH periods */ + + /* Measurement averaging parameters for RxLev & RxQual */ + struct gsm_power_ctrl_meas_params rxqual_meas; + struct gsm_power_ctrl_meas_params rxlev_meas; + /* Measurement averaging parameters for C/I: */ + struct gsm_power_ctrl_meas_params ci_fr_meas; + struct gsm_power_ctrl_meas_params ci_hr_meas; + struct gsm_power_ctrl_meas_params ci_amr_fr_meas; + struct gsm_power_ctrl_meas_params ci_amr_hr_meas; + struct gsm_power_ctrl_meas_params ci_sdcch_meas; + struct gsm_power_ctrl_meas_params ci_gprs_meas; +}; + +extern const struct gsm_power_ctrl_params power_ctrl_params_def; +void power_ctrl_params_def_reset(struct gsm_power_ctrl_params *params, + enum gsm_power_ctrl_dir dir);
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/signal.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/signal.h
Changed
@@ -69,8 +69,7 @@ S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */ S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */ S_NM_TEST_REP, /* GSM 12.21 Test Report */ - S_NM_STATECHG_OPER, /* Operational State changed*/ - S_NM_STATECHG_ADM, /* Administrative State changed */ + S_NM_STATECHG, /* NM Oper/Admin/Avail State changed. arg is struct nm_statechg_signal_data*/ S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */ S_NM_OPSTART_ACK, /* Received OPSTART ACK, arg is struct msgb *oml_msg */ S_NM_OPSTART_NACK, /* Received OPSTART NACK, arg is struct msgb *oml_msg */ @@ -78,6 +77,7 @@ S_NM_SET_RADIO_ATTR_ACK, /* Received Set Radio Carrier Attributes Ack, arg is struct msgb *oml_msg */ S_NM_SET_CHAN_ATTR_ACK, /* Received Set Radio Channel Attributes Ack, arg is struct msgb *oml_msg */ S_NM_SET_BTS_ATTR_ACK, /* Received Set BTS Attributes Ack, arg is struct msgb *oml_msg */ + S_NM_RUNNING_CHG, /* Object moves from/to NM running state (op=Enabled adm=Unlocked avail=OK) */ }; /* SS_LCHAN signals */ @@ -127,12 +127,13 @@ struct abis_om2k_mo; +/* data for <SS_NM, S_NM_STATECHG>: */ struct nm_statechg_signal_data { struct gsm_bts *bts; uint8_t obj_class; void *obj; - struct gsm_nm_state *old_state; - struct gsm_nm_state *new_state; + struct gsm_nm_state old_state; + struct gsm_nm_state new_state; /* This pointer is valid for TS 12.21 MO */ struct abis_om_obj_inst *obj_inst; @@ -140,6 +141,14 @@ struct abis_om2k_mo *om2k_mo; }; +/* data for <SS_NM, S_NM_RUNNING_CHG>: */ +struct nm_running_chg_signal_data { + struct gsm_bts *bts; + uint8_t obj_class; + void *obj; + bool running; +}; + struct nm_om2k_signal_data { struct gsm_bts *bts; void *obj;
View file
osmo-bsc_1.8.1.tar.xz/include/osmocom/bsc/smscb.h -> osmo-bsc_1.9.0.tar.xz/include/osmocom/bsc/smscb.h
Changed
@@ -9,6 +9,7 @@ struct bsc_cbc_link; /* smscb.c */ +void smscb_global_init(void); void bts_smscb_del(struct bts_smscb_message *smscb, struct bts_smscb_chan_state *cstate, const char *reason); const char *bts_smscb_msg2str(const struct bts_smscb_message *smscb); @@ -18,7 +19,6 @@ const char *bts_smscb_chan_state_name(const struct bts_smscb_chan_state *cstate); unsigned int bts_smscb_chan_load_percent(const struct bts_smscb_chan_state *cstate); unsigned int bts_smscb_chan_page_count(const struct bts_smscb_chan_state *cstate); -void smscb_vty_init(void); /* cbch_scheduler.c */ int bts_smscb_gen_sched_arr(struct bts_smscb_chan_state *cstate, struct bts_smscb_page ***arr_out); @@ -26,7 +26,9 @@ void bts_smscb_page_done(struct bts_smscb_chan_state *cstate, struct bts_smscb_page *page); int bts_smscb_rx_cbch_load_ind(struct gsm_bts *bts, bool cbch_extended, bool is_overflow, uint8_t slot_count); +void bts_cbch_init(struct gsm_bts *bts); void bts_cbch_timer_schedule(struct gsm_bts *bts); +void bts_cbch_timer_cb(void *data); enum bsc_cbc_link_mode { BSC_CBC_LINK_MODE_DISABLED = 0, @@ -61,6 +63,11 @@ struct msgb *msg; } client; }; -void cbc_vty_init(void); int bsc_cbc_link_restart(void); int cbsp_tx_decoded(struct bsc_cbc_link *cbc, struct osmo_cbsp_decoded *decoded); + +void bts_etws_init(struct gsm_bts *bts); + +/* smscb_vty.c: */ +void smscb_vty_init(void); +void cbc_vty_init(void);
View file
osmo-bsc_1.8.1.tar.xz/src/ipaccess/Makefile.am -> osmo-bsc_1.9.0.tar.xz/src/ipaccess/Makefile.am
Changed
@@ -9,6 +9,8 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/src/ipaccess/ipaccess-config.c -> osmo-bsc_1.9.0.tar.xz/src/ipaccess/ipaccess-config.c
Changed
@@ -268,6 +268,8 @@ return 0; } +static const struct value_string ipa_nvflag_strs; + static int print_attr_rep(struct msgb *mb) { /* Parse using nanoBTS own formatting for Get Attribute Response */ @@ -281,22 +283,67 @@ char oml_ip20 = {0}; uint16_t oml_port = 0; char unit_id40 = {0}; + unsigned int indent = 0; - abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)); + if (abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)) < 0) { + LOGPFOH(DNM, LOGL_ERROR, foh, "%s(): tlv_parse failed\n", __func__); + return -EINVAL; + } abis_nm_tlv_attr_primary_oml(&tp, &ia, &oml_port); osmo_strlcpy(oml_ip, inet_ntoa(ia), sizeof(oml_ip)); abis_nm_tlv_attr_unit_id(&tp, unit_id, sizeof(unit_id)); - fprintf(stdout, "{ \"primary_oml_ip\": \"%s\", \"primary_oml_port\": %" PRIu16 ", \"unit_id\": \"%s\" }\n", - oml_ip, oml_port, unit_id); +#define ENDL(last) \ + fprintf(stdout, "%s\n", last ? "" : ",") +#define print_offset(fmt, args...) \ + fprintf(stdout, "%*s" fmt, indent * 4, "", ## args) +#define print_field(field, fmt, args...) \ + print_offset("\"%s\": \"" fmt "\"", field, ## args) + + print_offset("{\n"); + indent++; + + print_field("primary_oml_ip", "%s", oml_ip); ENDL(false); + print_field("primary_oml_port", "%u", oml_port); ENDL(false); + print_field("unit_id", "%s", unit_id); ENDL(false); + + uint16_t Fx = (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)2 << 8) + | (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)0 << 0); + uint16_t Mx = (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)3 << 8) + | (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)1 << 0); + const struct value_string *nvflag = ipa_nvflag_strs; + + print_offset("\"nv_flags\": {\n"); + indent++; + + while (nvflag->value && nvflag->str) { + const char *val = (Fx & nvflag->value) ? "yes" : "no"; + if (~Mx & nvflag->value) + val = "unknown"; + print_field(nvflag->str, "%s", val); + + nvflag++; + + if (nvflag->value && nvflag->str) + ENDL(false); /* more fields to print */ + else + ENDL(true); /* this was the last field */ + } + + indent--; + print_offset("}\n"); + + indent--; + print_offset("}\n"); + return 0; } static int nm_state_event(int evt, uint8_t obj_class, void *obj, - struct gsm_nm_state *old_state, struct gsm_nm_state *new_state, + const struct gsm_nm_state *old_state, const struct gsm_nm_state *new_state, struct abis_om_obj_inst *obj_inst); static int nm_sig_cb(unsigned int subsys, unsigned int signal, @@ -323,11 +370,10 @@ printf("The BTS has nacked the restart. Exiting.\n"); exit(0); break; - case S_NM_STATECHG_OPER: - case S_NM_STATECHG_ADM: + case S_NM_STATECHG: nsd = signal_data; - nm_state_event(signal, nsd->obj_class, nsd->obj, nsd->old_state, - nsd->new_state, nsd->obj_inst); + nm_state_event(signal, nsd->obj_class, nsd->obj, &nsd->old_state, + &nsd->new_state, nsd->obj_inst); break; case S_NM_GET_ATTR_REP: fprintf(stderr, "Received SIGNAL S_NM_GET_ATTR_REP\n"); @@ -543,6 +589,7 @@ if (get_attr) { msgb_put_u8(nmsg_get, NM_ATT_IPACC_PRIM_OML_CFG); msgb_put_u8(nmsg_get, NM_ATT_IPACC_UNIT_ID); + msgb_put_u8(nmsg_get, NM_ATT_IPACC_NV_FLAGS); } if (unit_id) { len = strlen(unit_id); @@ -633,7 +680,7 @@ } static int nm_state_event(int evt, uint8_t obj_class, void *obj, - struct gsm_nm_state *old_state, struct gsm_nm_state *new_state, + const struct gsm_nm_state *old_state, const struct gsm_nm_state *new_state, struct abis_om_obj_inst *obj_inst) { if (obj_class == NM_OC_BASEB_TRANSC) { @@ -642,9 +689,9 @@ bootstrap_om(trx); found_trx = 1; } - } else if (evt == S_NM_STATECHG_OPER && + } else if (evt == S_NM_STATECHG && obj_class == NM_OC_RADIO_CARRIER && - new_state->availability == 3) { + new_state->availability == NM_AVSTATE_OFF_LINE) { struct gsm_bts_trx *trx = obj; if (net_listen_testnr)
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/Makefile.am -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/Makefile.am
Changed
@@ -106,6 +106,7 @@ system_information.c \ timeslot_fsm.c \ smscb.c \ + smscb_vty.c \ cbch_scheduler.c \ cbsp_link.c \ power_control.c \
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/abis_nm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/abis_nm.c
Changed
@@ -51,6 +51,7 @@ #include <osmocom/bsc/bts.h> #include <osmocom/bsc/nm_common_fsm.h> #include <osmocom/gsm/bts_features.h> +#include <osmocom/bsc/ipaccess.h> #define OM_ALLOC_SIZE 1024 #define OM_HEADROOM_SIZE 128 @@ -209,7 +210,7 @@ static int update_admstate(struct gsm_bts *bts, uint8_t obj_class, struct abis_om_obj_inst *obj_inst, uint8_t adm_state) { - struct gsm_nm_state *nm_state, new_state; + struct gsm_nm_state *nm_state; struct nm_statechg_signal_data nsd; memset(&nsd, 0, sizeof(nsd)); @@ -221,18 +222,18 @@ if (!nm_state) return -1; - new_state = *nm_state; - new_state.administrative = adm_state; - nsd.bts = bts; nsd.obj_class = obj_class; - nsd.old_state = nm_state; - nsd.new_state = &new_state; + nsd.old_state = *nm_state; + nsd.new_state = *nm_state; nsd.obj_inst = obj_inst; - osmo_signal_dispatch(SS_NM, S_NM_STATECHG_ADM, &nsd); + nsd.new_state.administrative = adm_state; + + /* Update current state before emitting signal: */ nm_state->administrative = adm_state; + osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd); return 0; } @@ -243,72 +244,67 @@ struct e1inp_sign_link *sign_link = mb->dst; struct gsm_bts *bts = sign_link->trx->bts; struct tlv_parsed tp; - struct gsm_nm_state *nm_state, new_state; + struct gsm_nm_state *nm_state; + struct nm_statechg_signal_data nsd; - memset(&new_state, 0, sizeof(new_state)); + memset(&nsd, 0, sizeof(nsd)); + nsd.obj = gsm_objclass2obj(bts, foh->obj_class, &foh->obj_inst); + if (!nsd.obj) { + LOGPFOH(DNM, LOGL_ERROR, foh, "unknown managed object\n"); + return -EINVAL; + } nm_state = gsm_objclass2nmstate(bts, foh->obj_class, &foh->obj_inst); if (!nm_state) { LOGPFOH(DNM, LOGL_ERROR, foh, "unknown managed object\n"); return -EINVAL; } - new_state = *nm_state; + nsd.obj_class = foh->obj_class; + nsd.old_state = *nm_state; + nsd.new_state = *nm_state; + nsd.obj_inst = &foh->obj_inst; + nsd.bts = bts; + + if (abis_nm_tlv_parse(&tp, bts, foh->data, oh->length - sizeof(*foh)) < 0) { + LOGPFOH(DNM, LOGL_ERROR, foh, "%s(): tlv_parse failed\n", __func__); + return -EINVAL; + } DEBUGPFOH(DNM, foh, "STATE CHG: "); - abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)); if (TLVP_PRESENT(&tp, NM_ATT_OPER_STATE)) { - new_state.operational = *TLVP_VAL(&tp, NM_ATT_OPER_STATE); + nsd.new_state.operational = *TLVP_VAL(&tp, NM_ATT_OPER_STATE); DEBUGPC(DNM, "OP_STATE=%s ", - abis_nm_opstate_name(new_state.operational)); + abis_nm_opstate_name(nsd.new_state.operational)); } if (TLVP_PRESENT(&tp, NM_ATT_AVAIL_STATUS)) { if (TLVP_LEN(&tp, NM_ATT_AVAIL_STATUS) == 0) - new_state.availability = 0xff; + nsd.new_state.availability = NM_AVSTATE_OK; else - new_state.availability = *TLVP_VAL(&tp, NM_ATT_AVAIL_STATUS); + nsd.new_state.availability = *TLVP_VAL(&tp, NM_ATT_AVAIL_STATUS); DEBUGPC(DNM, "AVAIL=%s(%02x) ", - abis_nm_avail_name(new_state.availability), - new_state.availability); + abis_nm_avail_name(nsd.new_state.availability), + nsd.new_state.availability); } else - new_state.availability = 0xff; + nsd.new_state.availability = NM_AVSTATE_OK; if (TLVP_PRESENT(&tp, NM_ATT_ADM_STATE)) { - new_state.administrative = *TLVP_VAL(&tp, NM_ATT_ADM_STATE); + nsd.new_state.administrative = *TLVP_VAL(&tp, NM_ATT_ADM_STATE); DEBUGPC(DNM, "ADM=%2s ", get_value_string(abis_nm_adm_state_names, - new_state.administrative)); + nsd.new_state.administrative)); } - if ((new_state.administrative != 0 && nm_state->administrative == 0) || - new_state.operational != nm_state->operational || - new_state.availability != nm_state->availability) { + if ((nsd.new_state.administrative != 0 && nsd.old_state.administrative == 0) || + nsd.new_state.operational != nsd.old_state.operational || + nsd.new_state.availability != nsd.old_state.availability) { DEBUGPC(DNM, "\n"); - /* Update the operational state of a given object in our in-memory data + /* Update the state of a given object in our in-memory data * structures and send an event to the higher layer */ - struct nm_statechg_signal_data nsd; - nsd.obj = gsm_objclass2obj(bts, foh->obj_class, &foh->obj_inst); - nsd.obj_class = foh->obj_class; - nsd.old_state = nm_state; - nsd.new_state = &new_state; - nsd.obj_inst = &foh->obj_inst; - nsd.bts = bts; - osmo_signal_dispatch(SS_NM, S_NM_STATECHG_OPER, &nsd); - nm_state->operational = new_state.operational; - nm_state->availability = new_state.availability; - if (nm_state->administrative == 0) - nm_state->administrative = new_state.administrative; + *nm_state = nsd.new_state; + osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd); } else { DEBUGPC(DNM, "(No State change detected)\n"); } -#if 0 - if (op_state == 1) { - /* try to enable objects that are disabled */ - abis_nm_opstart(bts, foh->obj_class, - foh->obj_inst.bts_nr, - foh->obj_inst.trx_nr, - foh->obj_inst.ts_nr); - } -#endif return 0; } @@ -374,8 +370,10 @@ sd = talloc_zero(tall_bsc_ctx, struct nm_fail_rep_signal_data); OSMO_ASSERT(sd); - if (abis_nm_tlv_parse(&sd->tp, bts, foh->data, oh->length-sizeof(*foh)) < 0) + if (abis_nm_tlv_parse(&sd->tp, bts, foh->data, oh->length - sizeof(*foh)) < 0) { + LOGPFOH(DNM, LOGL_ERROR, foh, "%s(): tlv_parse failed\n", __func__); goto fail; + } if (TLVP_PRESENT(&sd->tp, NM_ATT_ADD_TEXT)) { const uint8_t *val = TLVP_VAL(&sd->tp, NM_ATT_ADD_TEXT); @@ -593,21 +591,32 @@ } memcpy(bts->_features_data, TLVP_VAL(tp, NM_ATT_MANUF_ID), len); + bts->features_known = true; - /* Check each BTS feature in the reported vector */ + /* Log each BTS feature in the reported vector */ for (i = 0; i < len * 8; i++) { - bool Frep = osmo_bts_has_feature(&bts->features, i); - if (i >= _NUM_BTS_FEAT && Frep) { - LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: " - "unknown feature 0x%02x. Consider upgrading osmo-bsc.\n", i); + if (!osmo_bts_has_feature(&bts->features, i)) continue; - } - bool Fexp = osmo_bts_has_feature(&bts->model->features, i); - if (!Frep && Fexp) { - LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: " - "reported feature '%s' is not supported, while we thought it is.\n", - osmo_bts_features_name(i)); + if (i >= _NUM_BTS_FEAT) + LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: unknown feature 0x%02x is" + " supported\n", i); + else + LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: feature '%s' is" + " supported\n", osmo_bts_features_name(i)); + } + + /* Add features from the BTS model: nanobts may support more + * features than it reports, since we extend the enum of + * features for osmo-bts. */ + if (bts->type == GSM_BTS_TYPE_NANOBTS) { + for (i = 0; i < _NUM_BTS_FEAT; i++) { + if (osmo_bts_has_feature(&bts->model->features, i) /* intentional check against bts model */ + && !osmo_bts_has_feature(&bts->features, i)) { + LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: feature '%s' is" + " assumed to be supported\n", osmo_bts_features_name(i)); + osmo_bts_set_feature(&bts->features, i);
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/abis_om2000.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/abis_om2000.c
Changed
@@ -310,6 +310,7 @@ OM2K_DEI_MAX_ALLOWED_POWER = 0xa9, OM2K_DEI_MAX_ALLOWED_NUM_TRXCS = 0xaa, OM2K_DEI_MCTR_FEAT_STATUS_BMAP = 0xab, + OM2K_DEI_SEEN_UNKNOWN_D2 = 0xd2, }; enum abis_om2k_mostate { @@ -388,6 +389,7 @@ OM2K_DEI_FS_OFFSET = { TLV_TYPE_FIXED, 5 }, OM2K_DEI_EXT_COND_MAP_2_EXT = { TLV_TYPE_FIXED, 4 }, OM2K_DEI_TSS_MO_STATE = { TLV_TYPE_FIXED, 4 }, + OM2K_DEI_SEEN_UNKNOWN_D2 = { TLV_TYPE_FIXED, 6 }, }, }; @@ -950,13 +952,20 @@ static void update_mo_state(struct gsm_bts *bts, struct abis_om2k_mo *mo, uint8_t mo_state) { struct gsm_nm_state *nm_state = mo2nm_state(bts, mo); - struct gsm_nm_state new_state; struct nm_statechg_signal_data nsd; bool has_enabled_state; if (!nm_state) return; + memset(&nsd, 0, sizeof(nsd)); + + nsd.bts = bts; + nsd.obj = mo2obj(bts, mo); + nsd.old_state = *nm_state; + nsd.new_state = *nm_state; + nsd.om2k_mo = mo; + switch (mo->class) { case OM2K_MO_CLS_CF: case OM2K_MO_CLS_TRXC: @@ -967,36 +976,28 @@ break; } - new_state = *nm_state; switch (mo_state) { case OM2K_MOSTATE_RESET: - new_state.availability = NM_AVSTATE_POWER_OFF; + nsd.new_state.availability = NM_AVSTATE_POWER_OFF; break; case OM2K_MOSTATE_STARTED: - new_state.availability = has_enabled_state ? NM_AVSTATE_OFF_LINE : NM_AVSTATE_OK; + nsd.new_state.availability = has_enabled_state ? NM_AVSTATE_OFF_LINE : NM_AVSTATE_OK; break; case OM2K_MOSTATE_ENABLED: - new_state.availability = NM_AVSTATE_OK; + nsd.new_state.availability = NM_AVSTATE_OK; break; case OM2K_MOSTATE_DISABLED: - new_state.availability = NM_AVSTATE_POWER_OFF; + nsd.new_state.availability = NM_AVSTATE_POWER_OFF; break; default: - new_state.availability = NM_AVSTATE_DEGRADED; + nsd.new_state.availability = NM_AVSTATE_DEGRADED; break; } - memset(&nsd, 0, sizeof(nsd)); - - nsd.bts = bts; - nsd.obj = mo2obj(bts, mo); - nsd.old_state = nm_state; - nsd.new_state = &new_state; - nsd.om2k_mo = mo; - - osmo_signal_dispatch(SS_NM, S_NM_STATECHG_ADM, &nsd); + /* Update current state before emitting signal: */ + nm_state->availability = nsd.new_state.availability; - nm_state->availability = new_state.availability; + osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd); } static void update_op_state(struct gsm_bts *bts, const struct abis_om2k_mo *mo, uint8_t op_state) @@ -2883,7 +2884,7 @@ /* Bail if an the maximum number of TLV fields * have been parsed */ - if (tlv_count >= 11) { + if (tlv_count >= 20) { LOGP(DNM, LOGL_ERROR, "Rx MO=%s Fault Report: too many tlv elements!\n", abis_om2k_mo_name(mo)); return; @@ -2965,11 +2966,13 @@ switch (msg_type) { case OM2K_MSGT_CAL_TIME_REQ: rc = abis_om2k_cal_time_resp(bts); - break; + /* we receive this from MOs without FSM (https://osmocom.org/issues/4670) */ + goto no_mo; case OM2K_MSGT_FAULT_REP: display_fault_maps(msg->l2h, msgb_l2len(msg), &o2h->mo); rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_FAULT_REP_ACK); - break; + /* we receive this from MOs without FSM (https://osmocom.org/issues/4643) */ + goto no_mo; case OM2K_MSGT_NEGOT_REQ: rc = om2k_rx_negot_req(msg); break;
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/abis_rsl.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/abis_rsl.c
Changed
@@ -159,13 +159,13 @@ * 'out' must provide room for 17 bytes. */ static int build_encr_info(uint8_t *out, struct gsm_lchan *lchan) { - *out++ = lchan->encr.alg_id & 0xff; - switch (lchan->encr.alg_id) { + out0 = ALG_A5_NR_TO_RSL(lchan->encr.alg_a5_n); + switch (out0) { case GSM0808_ALG_ID_A5_1: case GSM0808_ALG_ID_A5_2: case GSM0808_ALG_ID_A5_3: if (!lchan->encr.key_len) { - LOG_LCHAN(lchan, LOGL_ERROR, "A5/%d encryption chosen, but missing Kc\n", lchan->encr.alg_id); + LOG_LCHAN(lchan, LOGL_ERROR, "A5/%d encryption chosen, but missing Kc\n", lchan->encr.alg_a5_n); return -EINVAL; } /* fall through */ @@ -177,7 +177,7 @@ * even for A5/0. Currently our ttcn3 test suite does expect the key to be present also for A5/0, see * f_cipher_mode() in bsc/MSC_ConnectionHandler.ttcn. */ if (lchan->encr.key_len) - memcpy(out, lchan->encr.key, lchan->encr.key_len); + memcpy(&out1, lchan->encr.key, lchan->encr.key_len); return 1 + lchan->encr.key_len; case GSM0808_ALG_ID_A5_4: @@ -185,11 +185,11 @@ LOG_LCHAN(lchan, LOGL_ERROR, "A5/4 encryption chosen, but missing Kc128\n"); return -EINVAL; } - memcpy(out, lchan->encr.kc128, sizeof(lchan->encr.kc128)); + memcpy(&out1, lchan->encr.kc128, sizeof(lchan->encr.kc128)); return 1 + sizeof(lchan->encr.kc128); default: - LOG_LCHAN(lchan, LOGL_ERROR, "A5/%d encryption not supported\n", lchan->encr.alg_id); + LOG_LCHAN(lchan, LOGL_ERROR, "A5/%d encryption not supported\n", lchan->encr.alg_a5_n); return -EINVAL; } } @@ -660,7 +660,7 @@ msg->l3h = len + 1; *len = msgb_l3len(msg); - if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) { + if (lchan->encr.alg_a5_n > 0) { uint8_t encr_infoMAX_A5_KEY_LEN+2; rc = build_encr_info(encr_info, lchan); if (rc > 0) @@ -764,7 +764,7 @@ msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm), (uint8_t *) &cm); - if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) { + if (lchan->encr.alg_a5_n > 0) { uint8_t encr_infoMAX_A5_KEY_LEN+2; rc = build_encr_info(encr_info, lchan); if (rc > 0) @@ -880,14 +880,14 @@ const struct osmo_mobile_identity *mi, uint8_t chan_needed, bool is_gprs) { - struct abis_rsl_dchan_hdr *dh; + struct abis_rsl_cchan_hdr *cch; struct msgb *msg = rsl_msgb_alloc(); uint8_t *l; int rc; - dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); - init_dchan_hdr(dh, RSL_MT_PAGING_CMD); - dh->chan_nr = RSL_CHAN_PCH_AGCH; + cch = (struct abis_rsl_cchan_hdr *) msgb_put(msg, sizeof(*cch)); + rsl_init_cchan_hdr(cch, RSL_MT_PAGING_CMD); + cch->chan_nr = RSL_CHAN_PCH_AGCH; msgb_tv_put(msg, RSL_IE_PAGING_GROUP, paging_group); @@ -926,23 +926,6 @@ return rsl_data_request(msg, 0); } -int imsi_str2bcd(uint8_t *bcd_out, const char *str_in) -{ - int i, len = strlen(str_in); - - for (i = 0; i < len; i++) { - int num = str_ini - 0x30; - if (num < 0 || num > 9) - return -1; - if (i % 2 == 0) - bcd_outi/2 = num; - else - bcd_outi/2 |= (num << 4); - } - - return 0; -} - /* Chapter 8.5.6 */ struct msgb *rsl_imm_assign_cmd_common(struct gsm_bts *bts, uint8_t len, uint8_t *val) { @@ -1221,7 +1204,12 @@ return -EINVAL; } - rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh)); + if (rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg) - sizeof(*dh)) < 0) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Failed to parse RSL %s\n", + rsl_or_ipac_msg_name(dh->c.msg_type)); + return -EINVAL; + } + cause_p = rsl_cause(&tp); LOG_LCHAN(lchan, LOGL_ERROR, "CHANNEL ACTIVATE NACK%s\n", rsl_cause_name(&tp)); @@ -1241,7 +1229,12 @@ struct tlv_parsed tp; const uint8_t *cause_p; - rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh)); + if (rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg) - sizeof(*dh)) < 0) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Failed to parse RSL %s\n", + rsl_or_ipac_msg_name(dh->c.msg_type)); + return -EINVAL; + } + cause_p = rsl_cause(&tp); LOG_LCHAN(lchan, LOGL_ERROR, "CONNECTION FAIL%s\n", rsl_cause_name(&tp)); @@ -1345,7 +1338,7 @@ && log_check_level(DMEAS, LOGL_DEBUG)) { for (i = 0; i < mr->num_cell; i++) { const struct gsm_meas_rep_cell *mrc = &mr->celli; - DEBUGP(DMEAS, "IDX=%u ARFCN=%u BSIC=%u => %d dBm\n", + DEBUGP(DMEAS, "IDX=%u ARFCN=%u BSIC=%u RXLEV=%ddBm\n", mrc->neigh_idx, mrc->arfcn, mrc->bsic, rxlev2dbm(mrc->rxlev)); } } @@ -1385,7 +1378,11 @@ memset(mr, 0, sizeof(*mr)); mr->lchan = msg->lchan; - rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh)); + if (rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg) - sizeof(*dh)) < 0) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Failed to parse RSL %s\n", + rsl_or_ipac_msg_name(dh->c.msg_type)); + return -EINVAL; + } if (!TLVP_PRESENT(&tp, RSL_IE_MEAS_RES_NR) || !TLVP_PRESENT(&tp, RSL_IE_UPLINK_MEAS) || @@ -1466,7 +1463,11 @@ .msg = msg, }; - rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh)); + if (rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg) - sizeof(*dh)) < 0) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Failed to parse RSL %s\n", + rsl_or_ipac_msg_name(dh->c.msg_type)); + return -EINVAL; + } if (TLVP_PRESENT(&tp, RSL_IE_ACCESS_DELAY)) d.access_delay = TLVP_VAL(&tp, RSL_IE_ACCESS_DELAY); @@ -1502,6 +1503,9 @@ int rc = 0; struct e1inp_sign_link *sign_link = msg->dst; + if (msgb_l2len(msg) < sizeof(*rslh)) + return -EINVAL; + if (rslh->ie_chan != RSL_IE_CHAN_NR) { LOGP(DRSL, LOGL_ERROR, "Rx RSL DCHAN: invalid RSL header, expecting Channel Number IE tag, got 0x%x\n", @@ -1602,7 +1606,14 @@ struct tlv_parsed tp; struct e1inp_sign_link *sign_link = msg->dst; - rsl_tlv_parse(&tp, rslh->data, msgb_l2len(msg)-sizeof(*rslh)); + if (msgb_l2len(msg) < sizeof(*rslh)) + return -EINVAL; + + if (rsl_tlv_parse(&tp, rslh->data, msgb_l2len(msg) - sizeof(*rslh)) < 0) { + LOGP(DRSL, LOGL_ERROR, "%s Failed to parse RSL %s\n", + gsm_trx_name(sign_link->trx), rsl_or_ipac_msg_name(rslh->msg_type)); + return -EINVAL; + } LOGP(DRSL, LOGL_ERROR, "%s ERROR REPORT%s\n", gsm_trx_name(sign_link->trx), rsl_cause_name(&tp)); @@ -1619,7 +1630,7 @@ struct gsm_bts_trx *trx = sign_link->trx; struct gsm_lchan *lchan; int ts_nr; - int rc, i; + int i; LOGP(DRSL, LOGL_DEBUG, "%s Rx Resource Indication\n", gsm_trx_name(trx)); @@ -1633,9 +1644,9 @@
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/acc.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/acc.c
Changed
@@ -411,122 +411,47 @@ } /* Implements osmo_signal_cbfn() -- trigger or abort ACC ramping upon changes RF lock state. */ -static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) +static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) { - struct nm_statechg_signal_data *nsd = signal_data; - struct acc_ramp *acc_ramp = handler_data; - struct gsm_bts_trx *trx = NULL; - bool trigger_ramping = false, abort_ramping = false; - - /* Handled signals map to an Administrative State Change ACK, or a State Changed Event Report. */ - if (signal != S_NM_STATECHG_ADM && signal != S_NM_STATECHG_OPER) + struct nm_running_chg_signal_data *nsd; + struct gsm_bts *bts; + struct gsm_bts_trx *trx; + if (signal != S_NM_RUNNING_CHG) return 0; - - if (nsd->obj_class != NM_OC_RADIO_CARRIER) + nsd = signal_data; + bts = nsd->bts; + switch (nsd->obj_class) { + case NM_OC_RADIO_CARRIER: + trx = (struct gsm_bts_trx *)nsd->obj; + break; + case NM_OC_BASEB_TRANSC: + trx = gsm_bts_bb_trx_get_trx((struct gsm_bts_bb_trx *)nsd->obj); + break; + default: return 0; - - trx = nsd->obj; - - LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: administrative state %s -> %s\n", - get_value_string(abis_nm_adm_state_names, nsd->old_state->administrative), - get_value_string(abis_nm_adm_state_names, nsd->new_state->administrative)); - LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: operational state %s -> %s\n", - abis_nm_opstate_name(nsd->old_state->operational), - abis_nm_opstate_name(nsd->new_state->operational)); + } /* We only care about state changes of the first TRX. */ - if (trx->nr != 0) + if (trx != trx->bts->c0) return 0; - /* RSL must already be up. We cannot send RACH system information to the BTS otherwise. */ - if (trx->rsl_link_primary == NULL) { - LOG_TRX(trx, DRSL, LOGL_DEBUG, - "ACC RAMP: ignoring state change because RSL link is down\n"); - return 0; - } - - /* Trigger or abort ACC ramping based on the new state of this TRX. */ - if (nsd->old_state->administrative != nsd->new_state->administrative) { - switch (nsd->new_state->administrative) { - case NM_STATE_UNLOCKED: - if (nsd->old_state->operational != nsd->new_state->operational) { - /* - * Administrative and operational state have both changed. - * Trigger ramping only if TRX 0 will be both enabled and unlocked. - */ - if (nsd->new_state->operational == NM_OPSTATE_ENABLED) - trigger_ramping = true; - else - LOG_TRX(trx, DRSL, LOGL_DEBUG, - "ACC RAMP: ignoring state change because TRX is " - "transitioning into operational state '%s'\n", - abis_nm_opstate_name(nsd->new_state->operational)); - } else { - /* - * Operational state has not changed. - * Trigger ramping only if TRX 0 is already usable. - */ - if (trx_is_usable(trx)) - trigger_ramping = true; - else - LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: ignoring state change " - "because TRX is not usable\n"); - } - break; - case NM_STATE_LOCKED: - case NM_STATE_SHUTDOWN: - abort_ramping = true; - break; - case NM_STATE_NULL: - default: - LOG_TRX(trx, DRSL, LOGL_ERROR, "ACC RAMP: unrecognized administrative state '0x%x' " - "reported for TRX 0\n", nsd->new_state->administrative); - break; - } - } - if (nsd->old_state->operational != nsd->new_state->operational) { - switch (nsd->new_state->operational) { - case NM_OPSTATE_ENABLED: - if (nsd->old_state->administrative != nsd->new_state->administrative) { - /* - * Administrative and operational state have both changed. - * Trigger ramping only if TRX 0 will be both enabled and unlocked. - */ - if (nsd->new_state->administrative == NM_STATE_UNLOCKED) - trigger_ramping = true; - else - LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: ignoring state change " - "because TRX is transitioning into administrative state '%s'\n", - get_value_string(abis_nm_adm_state_names, nsd->new_state->administrative)); - } else { - /* - * Administrative state has not changed. - * Trigger ramping only if TRX 0 is already unlocked. - */ - if (trx->mo.nm_state.administrative == NM_STATE_UNLOCKED) - trigger_ramping = true; - else - LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: ignoring state change " - "because TRX is in administrative state '%s'\n", - get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative)); - } - break; - case NM_OPSTATE_DISABLED: - abort_ramping = true; - break; - case NM_OPSTATE_NULL: - default: - LOG_TRX(trx, DRSL, LOGL_ERROR, "ACC RAMP: unrecognized operational state '0x%x' " - "reported for TRX 0\n", nsd->new_state->administrative); - break; + LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: nm_obj=%s running=%u\n", + get_value_string(abis_nm_obj_class_names, nsd->obj_class), nsd->running); + if (nsd->running) { + /* Trigger ramping only if TRX 0 is already usable. That usually + * means RCARRIER+BBTRANSC NM objects are running (op=enabled + * adm=unlocked) */ + if (trx_is_usable(trx)) { + LOG_BTS(bts, DPAG, LOGL_INFO, "ACC RAMP: C0 becomes available\n"); + acc_ramp_trigger(&trx->bts->acc_ramp); + } else { + LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: ignoring state change " + "because TRX is not usable\n"); } + } else { + acc_ramp_abort(&trx->bts->acc_ramp); } - - if (trigger_ramping) - acc_ramp_trigger(acc_ramp); - else if (abort_ramping) - acc_ramp_abort(acc_ramp); - return 0; } @@ -548,7 +473,6 @@ acc_ramp->chan_load_lower_threshold = ACC_RAMP_CHAN_LOAD_THRESHOLD_LOW; acc_ramp->chan_load_upper_threshold = ACC_RAMP_CHAN_LOAD_THRESHOLD_UP; osmo_timer_setup(&acc_ramp->step_timer, do_acc_ramping_step, acc_ramp); - osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, acc_ramp); } /*! @@ -646,3 +570,8 @@ acc_mgr_set_len_allowed_ramp(&acc_ramp->bts->acc_mgr, 10); } + +void acc_ramp_global_init(void) +{ + osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, NULL); +}
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/assignment_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/assignment_fsm.c
Changed
@@ -88,11 +88,19 @@ switch (gsm48_chan_mode_to_non_vamos(conn->assignment.req.ch_mode_rate_list0.chan_mode)) { \ case GSM48_CMODE_SIGN: \ rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_##counter##_SIGN)); \ + LOG_ASSIGNMENT(conn, LOGL_DEBUG, "incrementing rate counter: bts%u %s %s\n", \ + bts->nr, \ + bts_ctr_descriptionBTS_##counter##_SIGN.name, \ + bts_ctr_descriptionBTS_##counter##_SIGN.description); \ break; \ case GSM48_CMODE_SPEECH_V1: \ case GSM48_CMODE_SPEECH_EFR: \ case GSM48_CMODE_SPEECH_AMR: \ rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_##counter##_SPEECH)); \ + LOG_ASSIGNMENT(conn, LOGL_DEBUG, "incrementing rate counter: bts%u %s %s\n", \ + bts->nr, \ + bts_ctr_descriptionBTS_##counter##_SPEECH.name, \ + bts_ctr_descriptionBTS_##counter##_SPEECH.description); \ break; \ default: \ break; \ @@ -120,10 +128,13 @@ } if (conn->assignment.created_ci_for_msc) { - gscon_forget_mgw_endpoint_ci(conn, conn->assignment.created_ci_for_msc); + /* Store ci pointer locally, because gscon_forget_mgw_endpoint_ci() NULLs + * conn->assignment.created_ci_for_msc. */ + struct osmo_mgcpc_ep_ci *ci = conn->assignment.created_ci_for_msc; + gscon_forget_mgw_endpoint_ci(conn, ci); /* If this is the last endpoint released, the mgw_endpoint_fsm will terminate and tell * the gscon about it. */ - osmo_mgcpc_ep_ci_dlcx(conn->assignment.created_ci_for_msc); + osmo_mgcpc_ep_ci_dlcx(ci); } conn->assignment = (struct assignment_fsm_data){ @@ -218,7 +229,7 @@ resp = gsm0808_create_ass_compl2(lchan->abis_ip.ass_compl.rr_cause, chosen_channel, - lchan->encr.alg_id, perm_spch, + ALG_A5_NR_TO_BSSAP(lchan->encr.alg_a5_n), perm_spch, addr_local_p, sc_ptr, NULL, lcls_get_status(conn)); if (!resp) { @@ -275,17 +286,16 @@ } } - if (lchan_changed) { - /* Rembered this only for error handling: should assignment fail, assignment_reset() will release - * the MGW endpoint right away. If successful, the conn continues to use the endpoint. */ - conn->assignment.created_ci_for_msc = NULL; - - /* New RTP information is now accepted */ - conn->user_plane.msc_assigned_cic = conn->assignment.req.msc_assigned_cic; - osmo_strlcpy(conn->user_plane.msc_assigned_rtp_addr, conn->assignment.req.msc_rtp_addr, - sizeof(conn->user_plane.msc_assigned_rtp_addr)); - conn->user_plane.msc_assigned_rtp_port = conn->assignment.req.msc_rtp_port; - } + /* Rembered this only for error handling: should assignment fail, assignment_reset() will release + * the MGW endpoint right away. If successful, the conn continues to use the endpoint. */ + conn->assignment.created_ci_for_msc = NULL; + + /* New RTP information is now accepted. If there is no RTP stream, this information is zero / empty. Either way + * store the result of this assignment. */ + conn->user_plane.msc_assigned_cic = conn->assignment.req.msc_assigned_cic; + osmo_strlcpy(conn->user_plane.msc_assigned_rtp_addr, conn->assignment.req.msc_rtp_addr, + sizeof(conn->user_plane.msc_assigned_rtp_addr)); + conn->user_plane.msc_assigned_rtp_port = conn->assignment.req.msc_rtp_port; assignment_count_result(CTR_ASSIGNMENT_COMPLETED);
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bsc_ctrl_lookup.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bsc_ctrl_lookup.c
Changed
@@ -15,10 +15,6 @@ * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ #include <errno.h>
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bsc_init.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bsc_init.c
Changed
@@ -88,6 +88,18 @@ osmo_timer_schedule(&net->bts_store_uptime_timer, BTS_STORE_UPTIME_INTERVAL, 0); } +static void bsc_store_bts_lchan_durations(void *data) +{ + struct gsm_network *net = data; + struct gsm_bts *bts; + + llist_for_each_entry(bts, &net->bts_list, list) + bts_store_lchan_durations(bts); + + /* Keep this timer ticking. */ + osmo_timer_schedule(&net->bts_store_lchan_durations_timer, BTS_STORE_LCHAN_DURATIONS_INTERVAL, 0); +} + static struct gsm_network *bsc_network_init(void *ctx) { struct gsm_network *net = gsm_network_init(ctx); @@ -120,7 +132,7 @@ if (!net->bts_unknown_statg) goto err_free_all; - net->all_allocated_sdcch = (struct osmo_time_cc){ + net->all_allocated.sdcch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -131,7 +143,7 @@ .T_defs = net->T_defs, }, }; - net->all_allocated_static_sdcch = (struct osmo_time_cc){ + net->all_allocated.static_sdcch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -142,7 +154,7 @@ .T_defs = net->T_defs, }, }; - net->all_allocated_tch = (struct osmo_time_cc){ + net->all_allocated.tch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -153,7 +165,7 @@ .T_defs = net->T_defs, }, }; - net->all_allocated_static_tch = (struct osmo_time_cc){ + net->all_allocated.static_tch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -180,6 +192,10 @@ osmo_timer_setup(&net->bts_store_uptime_timer, bsc_store_bts_uptime, net); osmo_timer_schedule(&net->bts_store_uptime_timer, BTS_STORE_UPTIME_INTERVAL, 0); + /* Init lchan duration tracking timer. */ + osmo_timer_setup(&net->bts_store_lchan_durations_timer, bsc_store_bts_lchan_durations, net); + osmo_timer_schedule(&net->bts_store_lchan_durations_timer, BTS_STORE_LCHAN_DURATIONS_INTERVAL, 0); + net->cbc->net = net; net->cbc->mode = BSC_CBC_LINK_MODE_DISABLED; net->cbc->server.local_addr = bsc_cbc_default_server_local_addr;
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bsc_stats.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bsc_stats.c
Changed
@@ -93,6 +93,7 @@ BSC_CTR_PAGING_ATTEMPTED = {"paging:attempted", "Paging attempts for a subscriber"}, BSC_CTR_PAGING_DETACHED = {"paging:detached", "Paging request send failures because no responsible BTS was found"}, BSC_CTR_PAGING_RESPONDED = {"paging:responded", "Paging attempts with successful response"}, + BSC_CTR_PAGING_EXPIRED = {"paging:expired", "Paging Request expired because of timeout T3113"}, BSC_CTR_PAGING_NO_ACTIVE_PAGING = {"paging:no_active_paging", "Paging response without an active paging request (arrived after paging expiration?)"}, BSC_CTR_UNKNOWN_UNIT_ID = {"abis:unknown_unit_id", "Connection attempts from unknown IPA CCM Unit ID"}, @@ -182,6 +183,8 @@ bts_oml_connected++; if (trx_rsl_connected == num_trx) bts_rsl_all_trx_connected++; + + all_allocated_update_bts(bts); } osmo_stat_item_set(osmo_stat_item_group_get_item(net->bsc_statg, BSC_STAT_NUM_BTS_OML_CONNECTED), @@ -193,68 +196,41 @@ trx_rsl_connected_total); osmo_stat_item_set(osmo_stat_item_group_get_item(net->bsc_statg, BSC_STAT_NUM_TRX_TOTAL), num_trx_total); - /* Make sure to notice cells that become disconnected */ - bsc_update_time_cc_all_allocated(net); + /* This is optional, just running this to catch bugs in chan_counts accounting. If there is a bug, there will be + * a DLGLOBAL ERROR logged, and the error gets fixed. */ + chan_counts_bsc_verify(); } -void bsc_update_time_cc_all_allocated(struct gsm_network *net) +static void all_allocated_update(struct all_allocated *all_allocated, const struct chan_counts *c) { - struct gsm_bts *bts; - struct gsm_bts_trx *trx; - - struct chan_counts bsc_counts; - chan_counts_zero(&bsc_counts); - - llist_for_each_entry(bts, &net->bts_list, list) { - struct chan_counts bts_counts; - chan_counts_zero(&bts_counts); - - llist_for_each_entry(trx, &bts->trx_list, list) { - struct chan_counts trx_counts; - chan_counts_for_trx(&trx_counts, trx); - chan_counts_add(&bts_counts, &trx_counts); - } - - osmo_time_cc_set_flag(&bts->all_allocated_sdcch, - bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_SDCCH - && !bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_SDCCH); - - osmo_time_cc_set_flag(&bts->all_allocated_static_sdcch, - bts_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_SDCCH - && !bts_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_SDCCH); - - osmo_time_cc_set_flag(&bts->all_allocated_tch, - (bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_F - + bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_H) - && !(bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F - + bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H)); - - osmo_time_cc_set_flag(&bts->all_allocated_static_tch, - (bts_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_F - + bts_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_H) - && !(bts_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F - + bts_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H)); + osmo_time_cc_set_flag(&all_allocated->sdcch, + c->valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_SDCCH + && !c->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_SDCCH); + + osmo_time_cc_set_flag(&all_allocated->static_sdcch, + c->valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_SDCCH + && !c->valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_SDCCH); + + osmo_time_cc_set_flag(&all_allocated->tch, + (c->valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_F + + c->valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_H) + && !(c->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F + + c->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H)); + + osmo_time_cc_set_flag(&all_allocated->static_tch, + (c->valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_F + + c->valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_H) + && !(c->valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F + + c->valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H)); +} - chan_counts_add(&bsc_counts, &bts_counts); - } +void all_allocated_update_bts(struct gsm_bts *bts) +{ + all_allocated_update(&bts->all_allocated, &bts->chan_counts); +} - osmo_time_cc_set_flag(&net->all_allocated_sdcch, - bsc_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_SDCCH - && !bsc_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_SDCCH); - - osmo_time_cc_set_flag(&net->all_allocated_static_sdcch, - bsc_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_SDCCH - && !bsc_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_SDCCH); - - osmo_time_cc_set_flag(&net->all_allocated_tch, - (bsc_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_F - + bsc_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_H) - && !(bsc_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F - + bsc_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H)); - - osmo_time_cc_set_flag(&net->all_allocated_static_tch, - (bsc_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_F - + bsc_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_MAX_TOTALGSM_LCHAN_TCH_H) - && !(bsc_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F - + bsc_counts.valCHAN_COUNTS1_STATICCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H)); +void all_allocated_update_bsc() +{ + struct gsm_network *net = bsc_gsmnet; + all_allocated_update(&net->all_allocated, &net->chan_counts); }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bsc_subscr_conn_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bsc_subscr_conn_fsm.c
Changed
@@ -60,6 +60,8 @@ enum gscon_fsm_states { ST_INIT, + /* wait for initial BSSMAP after the MSC opened a new SCCP connection */ + ST_WAIT_INITIAL_USER_DATA, /* waiting for CC from MSC */ ST_WAIT_CC, /* active connection */ @@ -67,11 +69,13 @@ ST_ASSIGNMENT, ST_HANDOVER, /* BSSMAP CLEAR has been received */ - ST_CLEARING, + ST_WAIT_CLEAR_CMD, + ST_WAIT_SCCP_RLSD, }; static const struct value_string gscon_fsm_event_names = { {GSCON_EV_A_CONN_IND, "MT-CONNECT.ind"}, + {GSCON_EV_A_INITIAL_USER_DATA, "A_INITIAL_USER_DATA"}, {GSCON_EV_MO_COMPL_L3, "MO_COMPL_L3"}, {GSCON_EV_A_CONN_CFM, "MO-CONNECT.cfm"}, {GSCON_EV_A_CLEAR_CMD, "CLEAR_CMD"}, @@ -94,8 +98,10 @@ }; struct osmo_tdef_state_timeout conn_fsm_timeouts32 = { + ST_WAIT_INITIAL_USER_DATA = { .T = -25 }, ST_WAIT_CC = { .T = -3210 }, - ST_CLEARING = { .T = -4 }, + ST_WAIT_CLEAR_CMD = { .T = -4 }, + ST_WAIT_SCCP_RLSD = { .T = -4 }, }; /* Transition to a state, using the T timer defined in conn_fsm_timeouts. @@ -138,34 +144,79 @@ return rc; } -static void gscon_bssmap_clear(struct gsm_subscriber_connection *conn, - enum gsm0808_cause cause) +void gscon_bssmap_clear(struct gsm_subscriber_connection *conn, enum gsm0808_cause cause) { + /* already clearing? */ + switch (conn->fi->state) { + case ST_WAIT_CLEAR_CMD: + case ST_WAIT_SCCP_RLSD: + return; + default: + break; + } + conn->clear_cause = cause; + conn_fsm_state_chg(ST_WAIT_CLEAR_CMD); +} + +static void gscon_fsm_wait_clear_cmd_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ struct msgb *resp; int rc; - - if (conn->rx_clear_command) { - LOGPFSML(conn->fi, LOGL_DEBUG, "Not sending BSSMAP CLEAR REQUEST, already got CLEAR COMMAND from MSC\n"); - return; - } + struct gsm_subscriber_connection *conn = fi->priv; + enum gsm0808_cause cause = conn->clear_cause; if (!conn->sccp.msc) { - LOGPFSML(conn->fi, LOGL_ERROR, "Unable to deliver BSSMAP Clear Request message, no MSC for this conn\n"); - return; + LOGPFSML(fi, LOGL_ERROR, "Unable to deliver BSSMAP Clear Request message, no MSC for this conn\n"); + goto nothing_sent; } - LOGPFSML(conn->fi, LOGL_DEBUG, "Tx BSSMAP CLEAR REQUEST(%s) to MSC\n", gsm0808_cause_name(cause)); + LOGPFSML(fi, LOGL_DEBUG, "Tx BSSMAP CLEAR REQUEST(%s) to MSC\n", gsm0808_cause_name(cause)); resp = gsm0808_create_clear_rqst(cause); if (!resp) { - LOGPFSML(conn->fi, LOGL_ERROR, "Unable to compose BSSMAP Clear Request message\n"); - return; + LOGPFSML(fi, LOGL_ERROR, "Unable to compose BSSMAP Clear Request message\n"); + goto nothing_sent; } rate_ctr_inc(rate_ctr_group_get_ctr(conn->sccp.msc->msc_ctrs, MSC_CTR_BSSMAP_TX_DT1_CLEAR_RQST)); rc = osmo_bsc_sigtran_send(conn, resp); - if (rc < 0) + if (rc < 0) { LOGPFSML(conn->fi, LOGL_ERROR, "Unable to deliver BSSMAP Clear Request message\n"); + goto nothing_sent; + } + return; + +nothing_sent: + /* Normally, we request a CLEAR from the MSC and terminate as soon as the CLEAR COMMAND has been issued by the + * MSC. But if we are trying to clear without being able to send anything to the MSC, we might as well shut down + * the conn right away now. */ + conn_fsm_state_chg(ST_WAIT_SCCP_RLSD); +} + +void gscon_fsm_wait_sccp_rlsd_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = fi->priv; + + /* According to 3GPP 48.008 3.1.9.1. "The BSS need not wait for the radio channel + * release to be completed or for the guard timer to expire before returning the + * CLEAR COMPLETE message" */ + if (!gscon_sigtran_send(conn, gsm0808_create_clear_complete())) + rate_ctr_inc(rate_ctr_group_get_ctr(conn->sccp.msc->msc_ctrs, MSC_CTR_BSSMAP_TX_DT1_CLEAR_COMPLETE)); + + /* Give the handover_fsm a chance to book this as handover success before tearing down everything, + * making it look like a sudden death failure. */ + if (conn->ho.fi) + osmo_fsm_inst_dispatch(conn->ho.fi, HO_EV_CONN_RELEASING, NULL); + + if (conn->lcs.loc_req) + osmo_fsm_inst_dispatch(conn->lcs.loc_req->fi, LCS_LOC_REQ_EV_CONN_CLEAR, NULL); + + gscon_release_lchans(conn, true, bsc_gsm48_rr_cause_from_gsm0808_cause(conn->clear_cause)); + osmo_mgcpc_ep_clear(conn->user_plane.mgw_endpoint); + + /* If there is no SCCP connection at all, then no need to wait for an SCCP RLSD. */ + if (!conn->sccp.msc || conn->sccp.state != SUBSCR_SCCP_ST_CONNECTED) + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); } /* forward MO DTAP from RSL side to BSSAP side */ @@ -210,89 +261,133 @@ gscon_release_lchan(conn, conn->lchan, do_rr_release, false, cause_rr); } -static void handle_bssap_n_connect(struct osmo_fsm_inst *fi, struct osmo_scu_prim *scu_prim) +static int validate_initial_user_data(struct osmo_fsm_inst *fi, struct msgb *msg) { - struct gsm_subscriber_connection *conn = fi->priv; - struct msgb *msg = scu_prim->oph.msg; struct bssmap_header *bs; - uint8_t bssmap_type; + enum BSS_MAP_MSG_TYPE bssmap_type; msg->l3h = msgb_l2(msg); if (!msgb_l3(msg)) { LOGPFSML(fi, LOGL_ERROR, "internal error: no l3 in msg\n"); - goto refuse; + return -EINVAL; } if (msgb_l3len(msg) < sizeof(*bs)) { - LOGPFSML(fi, LOGL_NOTICE, "message too short for BSSMAP header (%u < %zu)\n", + LOGPFSML(fi, LOGL_ERROR, "message too short for BSSMAP header (%u < %zu)\n", msgb_l3len(msg), sizeof(*bs)); - goto refuse; + return -EINVAL; } bs = (struct bssmap_header*)msgb_l3(msg); if (msgb_l3len(msg) < (bs->length + sizeof(*bs))) { - LOGPFSML(fi, LOGL_NOTICE, + LOGPFSML(fi, LOGL_ERROR, "message too short for length indicated in BSSMAP header (%u < %u)\n", msgb_l3len(msg), bs->length); - goto refuse; + return -EINVAL; } switch (bs->type) { case BSSAP_MSG_BSS_MANAGEMENT: break; default: - LOGPFSML(fi, LOGL_NOTICE, - "message type not allowed for N-CONNECT: %s\n", gsm0808_bssap_name(bs->type)); - goto refuse; + LOGPFSML(fi, LOGL_ERROR, + "message type not allowed for initial BSSMAP: %s\n", gsm0808_bssap_name(bs->type)); + return -EINVAL; } msg->l4h = &msg->l3hsizeof(*bs); - bssmap_type = msg->l4h0; - - LOGPFSML(fi, LOGL_DEBUG, "Rx N-CONNECT: %s: %s\n", gsm0808_bssap_name(bs->type), - gsm0808_bssmap_name(bssmap_type)); + /* Validate initial message type. See also BSC_Tests.TC_outbound_connect. */ + bssmap_type = msg->l4h0; switch (bssmap_type) { case BSS_MAP_MSG_HANDOVER_RQST: case BSS_MAP_MSG_PERFORM_LOCATION_RQST: - break; + return 0; default: - LOGPFSML(fi, LOGL_NOTICE, "No support for N-CONNECT: %s: %s\n", + LOGPFSML(fi, LOGL_ERROR, "No support for initial BSSMAP: %s: %s\n", gsm0808_bssap_name(bs->type), gsm0808_bssmap_name(bssmap_type)); - goto refuse; + return -EINVAL; }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bsc_vty.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bsc_vty.c
Changed
@@ -64,6 +64,7 @@ #include <osmocom/bsc/bsc_subscr_conn_fsm.h> #include <osmocom/bsc/assignment_fsm.h> #include <osmocom/bsc/bssmap_reset.h> +#include <osmocom/bsc/bsc_msc_data.h> #include <inttypes.h> @@ -773,7 +774,7 @@ vty_out(vty, "Error: cannot find free lchan of type %s%s", gsm_lchant_name(from_lchan->type), VTY_NEWLINE); } - if (reassignment_request_to_lchan(ACTIVATE_FOR_VTY, from_lchan, to_lchan, -1, -1)) { + if (reassignment_request_to_lchan(ASSIGN_FOR_VTY, from_lchan, to_lchan, -1, -1)) { vty_out(vty, "Error: not allowed to start assignment for %s%s", gsm_lchan_name(from_lchan), VTY_NEWLINE); return CMD_WARNING; @@ -1043,9 +1044,6 @@ { struct gsm_paging_request *pag; - if (!bts->paging.bts) - return; - llist_for_each_entry(pag, &bts->paging.pending_requests, entry) paging_dump_vty(vty, pag); } @@ -1150,7 +1148,7 @@ return CMD_SUCCESS; } -#define NRI_STR "Mapping of Network Resource Indicators to this MSC, for MSC pooling\n" +#define NRI_STR "Mapping of Network Resource Indicators, for MSC pooling\n" #define NULL_NRI_STR "Define NULL-NRI values that cause re-assignment of an MS to a different MSC, for MSC pooling.\n" #define NRI_FIRST_LAST_STR "First value of the NRI value range, should not surpass the configured 'nri bitlen'.\n" \ "Last value of the NRI value range, should not surpass the configured 'nri bitlen' and be larger than the" \ @@ -1197,7 +1195,7 @@ DEFUN_ATTR(cfg_net_nri_null_del, cfg_net_nri_null_del_cmd, "nri null del <0-32767> <0-32767>", - NRI_STR NULL_NRI_STR "Remove NRI value or range from the NRI mapping for this MSC\n" + NRI_STR NULL_NRI_STR "Remove NRI value or range from the NRI mapping\n" NRI_FIRST_LAST_STR, CMD_ATTR_IMMEDIATE) { @@ -1702,6 +1700,7 @@ static int lchan_act_deact(struct vty *vty, const char **argv, int argc) { struct gsm_bts_trx_ts *ts; + struct gsm_bts *bts; struct gsm_lchan *lchan; bool vamos = (strcmp(argv3, "vamos-sub-slot") == 0); int ss_nr = atoi(argv4); @@ -1727,7 +1726,8 @@ return CMD_WARNING; } - if (vamos && !osmo_bts_has_feature(&ts->trx->bts->features, BTS_FEAT_VAMOS)) { + bts = ts->trx->bts; + if (vamos && bts->features_known && !osmo_bts_has_feature(&bts->features, BTS_FEAT_VAMOS)) { vty_out(vty, "BTS does not support VAMOS%s", VTY_NEWLINE); return CMD_WARNING; } @@ -1787,9 +1787,7 @@ struct gsm_network *net = gsmnet_from_vty(vty); const char *act_str = argv0; int activate; - int bts_nr; struct gsm_bts *bts; - int trx_nr; struct gsm_bts_trx *trx; if (!strcmp(act_str, "activate-all-lchan")) @@ -1797,12 +1795,9 @@ else activate = 0; - for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { - bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr); - for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { - trx = gsm_bts_trx_num(bts, trx_nr); + llist_for_each_entry(bts, &net->bts_list, list) { + llist_for_each_entry(trx, &bts->trx_list, list) lchan_act_trx(vty, trx, activate); - } } vty_out(vty, "%% All channels have been %s on all BTS/TRX, please " @@ -1957,6 +1952,7 @@ TSC_ARGS_DOC) { struct gsm_bts_trx_ts *ts; + struct gsm_bts *bts; struct gsm_lchan *lchan; int ss_nr = atoi(argv3); const char *vamos_str = argv4; @@ -1973,7 +1969,8 @@ return CMD_WARNING; } - if (!osmo_bts_has_feature(&ts->trx->bts->features, BTS_FEAT_VAMOS)) { + bts = ts->trx->bts; + if (bts->features_known && !osmo_bts_has_feature(&bts->features, BTS_FEAT_VAMOS)) { vty_out(vty, "%% BTS does not support VAMOS%s", VTY_NEWLINE); return CMD_WARNING; } @@ -2333,13 +2330,14 @@ return CMD_SUCCESS; } -/* FIXME: changing this value would not affect generated System Information */ -DEFUN(cfg_net_per_loc_upd, cfg_net_per_loc_upd_cmd, - "periodic location update <6-1530>", - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval in Minutes\n") +DEFUN_USRATTR(cfg_net_per_loc_upd, + cfg_net_per_loc_upd_cmd, + BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK, + "periodic location update <6-1530>", + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval in Minutes\n") { struct gsm_network *net = vty->index; struct osmo_tdef *d = osmo_tdef_get_entry(net->T_defs, 3212); @@ -2350,13 +2348,14 @@ return CMD_SUCCESS; } -/* FIXME: changing this value would not affect generated System Information */ -DEFUN(cfg_net_no_per_loc_upd, cfg_net_no_per_loc_upd_cmd, - "no periodic location update", - NO_STR - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n") +DEFUN_USRATTR(cfg_net_no_per_loc_upd, + cfg_net_no_per_loc_upd_cmd, + BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK, + "no periodic location update", + NO_STR + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n") { struct gsm_network *net = vty->index; struct osmo_tdef *d = osmo_tdef_get_entry(net->T_defs, 3212);
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bssmap_reset.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bssmap_reset.c
Changed
@@ -47,7 +47,7 @@ osmo_tdef_fsm_inst_state_chg(FI, STATE, \ bssmap_reset_timeouts, \ (bsc_gsmnet)->T_defs, \ - 5) + -1) struct bssmap_reset *bssmap_reset_alloc(void *ctx, const char *label, const struct bssmap_reset_cfg *cfg) {
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts.c
Changed
@@ -24,6 +24,8 @@ #include <osmocom/bsc/bts.h> #include <osmocom/bsc/debug.h> #include <osmocom/bsc/nm_common_fsm.h> +#include <osmocom/bsc/paging.h> +#include <osmocom/bsc/smscb.h> const struct value_string bts_attribute_names = { OSMO_VALUE_STRING(BTS_TYPE_VARIANT), @@ -91,12 +93,6 @@ return get_value_string(bts_type_names, type); } -static void bts_init_cbch_state(struct bts_smscb_chan_state *cstate, struct gsm_bts *bts) -{ - cstate->bts = bts; - INIT_LLIST_HEAD(&cstate->messages); -} - static LLIST_HEAD(bts_models); struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) @@ -148,6 +144,10 @@ static int gsm_bts_talloc_destructor(struct gsm_bts *bts) { + paging_destructor(bts); + + osmo_timer_del(&bts->cbch_timer); + bts->site_mgr->bts0 = NULL; if (bts->gprs.cell.mo.fi) { @@ -159,6 +159,9 @@ osmo_fsm_inst_free(bts->mo.fi); bts->mo.fi = NULL; } + + osmo_stat_item_group_free(bts->bts_statg); + rate_ctr_group_free(bts->bts_ctrs); return 0; } @@ -169,8 +172,6 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, struct gsm_bts_sm *bts_sm, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(bts_sm, struct gsm_bts); - struct gsm48_multi_rate_conf mr_cfg; - int i; if (!bts) return NULL; @@ -211,7 +212,7 @@ } bts->bts_statg = osmo_stat_item_group_alloc(bts, &bts_statg_desc, bts->nr); - bts->all_allocated_sdcch = (struct osmo_time_cc){ + bts->all_allocated.sdcch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -222,7 +223,7 @@ .T_defs = net->T_defs, }, }; - bts->all_allocated_static_sdcch = (struct osmo_time_cc){ + bts->all_allocated.static_sdcch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -233,7 +234,7 @@ .T_defs = net->T_defs, }, }; - bts->all_allocated_tch = (struct osmo_time_cc){ + bts->all_allocated.tch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -244,7 +245,7 @@ .T_defs = net->T_defs, }, }; - bts->all_allocated_static_tch = (struct osmo_time_cc){ + bts->all_allocated.static_tch = (struct osmo_time_cc){ .cfg = { .gran_usec = 1*1000000, .forget_sum_usec = 60*1000000, @@ -267,11 +268,11 @@ bts->c0->ts0.pchan_from_config = GSM_PCHAN_CCCH_SDCCH4; /* TODO: really?? */ bts->ccch_load_ind_thresh = 10; /* 10% of Load: Start sending CCCH LOAD IND */ + bts->ccch_load_ind_period = 1; /* Send CCCH LOAD IND every 1 second */ bts->rach_b_thresh = -1; bts->rach_ldavg_slots = -1; - bts->paging.free_chans_need = -1; - INIT_LLIST_HEAD(&bts->paging.pending_requests); + paging_init(bts); bts->features.data = &bts->_features_data0; bts->features.data_len = sizeof(bts->_features_data); @@ -290,7 +291,7 @@ bts->neigh_list_manual_mode = NL_MODE_AUTOMATIC; bts->early_classmark_allowed_3g = true; /* 3g Early Classmark Sending controlled by bts->early_classmark_allowed param */ bts->si_unused_send_empty = true; - bts->chan_alloc_allow_tch_for_signalling = true; + bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_ALWAYS; bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ bts->si_common.cell_sel_par.rxlev_acc_min = 0; bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; @@ -336,63 +337,96 @@ }; /* Set reasonable defaults for AMR-FR and AMR-HR rate configuration. - * (see also 3GPP TS 28.062, Table 7.11.3.1.3-2) */ - mr_cfg = (struct gsm48_multi_rate_conf) { + * The values are taken from 3GPP TS 51.010-1 (version 13.11.0). + * See 14.2.19.4.1 and 14.2.20.4.1 for AMR-FR and AMR-HR, respectively. */ + static const struct gsm48_multi_rate_conf amr_fr_mr_cfg = { .m4_75 = 1, - .m5_15 = 0, .m5_90 = 1, - .m6_70 = 0, - .m7_40 = 1, - .m7_95 = 0, - .m10_2 = 0, + .m7_95 = 1, .m12_2 = 1 }; - memcpy(bts->mr_full.gsm48_ie, &mr_cfg, sizeof(bts->mr_full.gsm48_ie)); - bts->mr_full.ms_mode0.mode = 0; - bts->mr_full.ms_mode1.mode = 2; - bts->mr_full.ms_mode2.mode = 4; - bts->mr_full.ms_mode3.mode = 7; - bts->mr_full.bts_mode0.mode = 0; - bts->mr_full.bts_mode1.mode = 2; - bts->mr_full.bts_mode2.mode = 4; - bts->mr_full.bts_mode3.mode = 7; - for (i = 0; i < 3; i++) { - bts->mr_full.ms_modei.hysteresis = 8; - bts->mr_full.ms_modei.threshold = 32; - bts->mr_full.bts_modei.hysteresis = 8; - bts->mr_full.bts_modei.threshold = 32; - } - bts->mr_full.num_modes = 4; - - mr_cfg = (struct gsm48_multi_rate_conf) { + static const struct gsm48_multi_rate_conf amr_hr_mr_cfg = { .m4_75 = 1, - .m5_15 = 0, .m5_90 = 1, - .m6_70 = 0, - .m7_40 = 1, - .m7_95 = 0, - .m10_2 = 0, - .m12_2 = 0 + .m6_70 = 1, + .m7_95 = 1, }; - memcpy(bts->mr_half.gsm48_ie, &mr_cfg, sizeof(bts->mr_half.gsm48_ie)); - bts->mr_half.ms_mode0.mode = 0; - bts->mr_half.ms_mode1.mode = 2; - bts->mr_half.ms_mode2.mode = 4; - bts->mr_half.ms_mode3.mode = 7; - bts->mr_half.bts_mode0.mode = 0; - bts->mr_half.bts_mode1.mode = 2; - bts->mr_half.bts_mode2.mode = 4; - bts->mr_half.bts_mode3.mode = 7; - for (i = 0; i < 3; i++) { - bts->mr_half.ms_modei.hysteresis = 8; - bts->mr_half.ms_modei.threshold = 32; - bts->mr_half.bts_modei.hysteresis = 8; - bts->mr_half.bts_modei.threshold = 32; - } - bts->mr_half.num_modes = 3; - bts_init_cbch_state(&bts->cbch_basic, bts); - bts_init_cbch_state(&bts->cbch_extended, bts); + memcpy(bts->mr_full.gsm48_ie, &amr_fr_mr_cfg, sizeof(bts->mr_full.gsm48_ie)); + memcpy(bts->mr_half.gsm48_ie, &amr_hr_mr_cfg, sizeof(bts->mr_half.gsm48_ie)); + + /* ^ C/I (dB) | FR / HR | + * | | + * | | + * MODE4 | | + * = | ----+---- THR_MX_Up(3) | 20.5 / 18.0 | + * | | | + * | = ----+---- THR_MX_Dn(4) | 18.5 / 16.0 | + * MODE3 | | + * | = ----+---- THR_MX_Up(2) | 14.5 / 14.0 | + * | | | + * = | ----+---- THR_MX_Dn(3) | 12.5 / 12.0 | + * MODE2 | | + * = | ----+---- THR_MX_Up(1) | 8.5 / 10.0 | + * | | | + * | = ----+---- THR_MX_Dn(2) | 6.5 / 8.0 | + * MODE1 | | + * | | + * | |
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_ericsson_rbs2000.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_ericsson_rbs2000.c
Changed
@@ -213,6 +213,14 @@ static int bts_model_rbs2k_start(struct gsm_network *net) { + osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); + osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL); + + return 0; +} + +int bts_model_rbs2k_init(void) +{ model_rbs2k.features.data = &model_rbs2k._features_data0; model_rbs2k.features.data_len = sizeof(model_rbs2k._features_data); @@ -222,13 +230,5 @@ osmo_bts_set_feature(&model_rbs2k.features, BTS_FEAT_HSCSD); osmo_bts_set_feature(&model_rbs2k.features, BTS_FEAT_MULTI_TSC); - osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); - osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL); - - return 0; -} - -int bts_model_rbs2k_init(void) -{ return gsm_bts_model_register(&model_rbs2k); }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts.c
Changed
@@ -131,6 +131,7 @@ NM_ATT_IPACC_REVOC_DATE = { TLV_TYPE_TL16V }, }, }, + .features_get_reported = true, }; @@ -456,8 +457,7 @@ switch (signal) { case S_NM_SW_ACTIV_REP: return sw_activ_rep(signal_data); - case S_NM_STATECHG_OPER: - case S_NM_STATECHG_ADM: + case S_NM_STATECHG: return nm_statechg_event(signal, signal_data); case S_NM_OPSTART_ACK: nm_rx_opstart_ack(signal_data); @@ -576,13 +576,14 @@ } } + osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OML_DOWN, NULL); + osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_OML_DOWN, NULL); + osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_OML_DOWN, NULL); osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_OML_DOWN, NULL); for (i = 0; i < ARRAY_SIZE(bts->site_mgr->gprs.nsvc); i++) osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nsvci.mo.fi, NM_EV_OML_DOWN, NULL); - osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OML_DOWN, NULL); - osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_OML_DOWN, NULL); gsm_bts_all_ts_dispatch(bts, TS_EV_OML_DOWN, NULL); bts->ip_access.flags = 0; @@ -696,6 +697,14 @@ DEBUGP(DLINP, "%s: Identified BTS %u/%u/%u\n", e1inp_signtype_name(type), dev->site_id, dev->bts_id, dev->trx_id); + /* Check if this BTS has a valid configuration. If not we will drop it + * immediately. */ + if (gsm_bts_check_cfg(bts) != 0) { + LOGP(DLINP, LOGL_NOTICE, "(bts=%u) BTS config invalid, dropping BTS!\n", bts->nr); + ipaccess_drop_oml_deferred(bts); + return NULL; + } + switch(type) { case E1INP_SIGN_OML: /* remove old OML signal link for this BTS. */
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
Changed
@@ -26,7 +26,8 @@ #include <osmocom/bsc/bts.h> #include <osmocom/gsm/bts_features.h> -struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts) +/* 3GPP TS 52.021 section 8.6.1 Set BTS Attributes */ +struct msgb *nanobts_gen_set_bts_attr(struct gsm_bts *bts) { struct msgb *msgb; uint8_t buf256; @@ -35,13 +36,14 @@ if (!msgb) return NULL; - /* Interference level Boundaries: 0 .. X5 (3GPP TS 52.021, section 9.4.25) */ + /* Interference level Boundaries: 0 .. X5 (3GPP TS 52.021 sec 9.4.25) */ msgb_tv_fixed_put(msgb, NM_ATT_INTERF_BOUND, sizeof(bts->interf_meas_params_cfg.bounds_dbm), &bts->interf_meas_params_cfg.bounds_dbm0); - /* Intave: Interference Averaging period (3GPP TS 52.021, section 9.4.24) */ + /* Intave: Interference Averaging period (3GPP TS 52.021 sec 9.4.24) */ msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, bts->interf_meas_params_cfg.avg_period); + /* Connection Failure Criterion (3GPP TS 52.021 sec 9.4.14) */ rlt = gsm_bts_get_radio_link_timeout(bts); if (rlt == -1) { /* Osmocom extension: Use infinite radio link timeout */ @@ -54,28 +56,30 @@ } msgb_tl16v_put(msgb, NM_ATT_CONN_FAIL_CRIT, 2, buf); + /* T200 (3GPP TS 52.021 sec 9.4.53) */ memcpy(buf, "\x1e\x24\x24\xa8\x34\x21\xa8", 7); msgb_tv_fixed_put(msgb, NM_ATT_T200, 7, buf); + /* Max Timing Advance (3GPP TS 52.021 sec 9.4.31) */ msgb_tv_put(msgb, NM_ATT_MAX_TA, 0x3f); - /* seconds */ + /* Overload Period (3GPP TS 52.021 sec 9.4.39), seconds */ memcpy(buf, "\x00\x01\x0a", 3); msgb_tv_fixed_put(msgb, NM_ATT_OVERL_PERIOD, 3, buf); - /* percent */ + /* CCCH Load Threshold (3GPP TS 12.21 sec 9.4.12), percent */ msgb_tv_put(msgb, NM_ATT_CCCH_L_T, bts->ccch_load_ind_thresh); - /* seconds */ - msgb_tv_put(msgb, NM_ATT_CCCH_L_I_P, 1); + /* CCCH Load Indication Period (3GPP TS 12.21 sec 9.4.11), seconds */ + msgb_tv_put(msgb, NM_ATT_CCCH_L_I_P, bts->ccch_load_ind_period); - /* busy threshold in - dBm */ + /* RACH Busy Threshold (3GPP TS 12.21 sec 9.4.44), -dBm */ buf0 = 90; /* -90 dBm as default "busy" threshold */ if (bts->rach_b_thresh != -1) buf0 = bts->rach_b_thresh & 0xff; msgb_tv_put(msgb, NM_ATT_RACH_B_THRESH, buf0); - /* rach load averaging 1000 slots */ + /* RACH Load Averaging Slots (3GPP TS 12.21 sec 9.4.45), 1000 slots */ buf0 = 0x03; buf1 = 0xe8; if (bts->rach_ldavg_slots != -1) { @@ -84,16 +88,18 @@ } msgb_tv_fixed_put(msgb, NM_ATT_LDAVG_SLOTS, 2, buf); - /* 10 milliseconds */ - msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1)); + /* BTS Air Timer (3GPP TS 12.21 sec 9.4.10), 10 milliseconds */ + msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1)/10); - /* 10 retransmissions of physical config */ + /* NY1 (3GPP TS 12.21 sec 9.4.37), 10 retransmissions of physical config */ msgb_tv_put(msgb, NM_ATT_NY1, 10); + /* BCCH ARFCN (3GPP TS 12.21 sec 9.4.8) */ buf0 = (bts->c0->arfcn >> 8) & 0x0f; buf1 = bts->c0->arfcn & 0xff; msgb_tv_fixed_put(msgb, NM_ATT_BCCH_ARFCN, 2, buf); + /* BSIC (3GPP TS 12.21 sec 9.4.9) */ msgb_tv_put(msgb, NM_ATT_BSIC, bts->bsic); abis_nm_ipaccess_cgi(buf, bts); @@ -102,7 +108,7 @@ return msgb; } -struct msgb *nanobts_attr_nse_get(struct gsm_bts_sm *bts_sm) +struct msgb *nanobts_gen_set_nse_attr(struct gsm_bts_sm *bts_sm) { struct msgb *msgb; uint8_t buf256; @@ -141,7 +147,7 @@ return msgb; } -struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts) +struct msgb *nanobts_gen_set_cell_attr(struct gsm_bts *bts) { struct msgb *msgb; uint8_t buf256; @@ -200,7 +206,7 @@ return msgb; } -struct msgb *nanobts_attr_nsvc_get(struct gsm_bts *bts) +struct msgb *nanobts_gen_set_nsvc_attr(struct gsm_bts *bts) { struct msgb *msgb; uint8_t buf256; @@ -245,7 +251,7 @@ return msgb; } -struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, +struct msgb *nanobts_gen_set_radio_attr(struct gsm_bts *bts, struct gsm_bts_trx *trx) { struct msgb *msgb;
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_nokia_site.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_nokia_site.c
Changed
@@ -204,8 +204,7 @@ return 0; switch (signal) { - case S_NM_STATECHG_OPER: - case S_NM_STATECHG_ADM: + case S_NM_STATECHG: nm_statechg_evt(signal, signal_data); break; default: @@ -1759,14 +1758,6 @@ static int bts_model_nokia_site_start(struct gsm_network *net) { - model_nokia_site.features.data = &model_nokia_site._features_data0; - model_nokia_site.features.data_len = - sizeof(model_nokia_site._features_data); - - osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HOPPING); - osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HSCSD); - osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_MULTI_TSC); - osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL); osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); @@ -1778,5 +1769,12 @@ int bts_model_nokia_site_init(void) { + model_nokia_site.features.data = &model_nokia_site._features_data0; + model_nokia_site.features.data_len = sizeof(model_nokia_site._features_data); + + osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HOPPING); + osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HSCSD); + osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_MULTI_TSC); + return gsm_bts_model_register(&model_nokia_site); }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_osmobts.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_osmobts.c
Changed
@@ -205,11 +205,8 @@ sizeof(model_osmobts._features_data); memset(model_osmobts.features.data, 0, model_osmobts.features.data_len); - osmo_bts_set_feature(&model_osmobts.features, BTS_FEAT_GPRS); - osmo_bts_set_feature(&model_osmobts.features, BTS_FEAT_EGPRS); - osmo_bts_set_feature(&model_osmobts.features, BTS_FEAT_PAGING_COORDINATION); - osmo_bts_set_feature(&model_osmobts.features, BTS_FEAT_IPV6_NSVC); - osmo_bts_set_feature(&model_osmobts.features, BTS_FEAT_CCN); + /* Adjust bts_init/bts_model_init in OsmoBTS to report new features. + * See also: doc/bts-features.txt */ model_osmobts.nm_att_tlvdef.defNM_ATT_OSMO_NS_LINK_CFG.type = TLV_TYPE_TL16V;
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_siemens_bs11.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_siemens_bs11.c
Changed
@@ -604,13 +604,6 @@ static int bts_model_bs11_start(struct gsm_network *net) { - model_bs11.features.data = &model_bs11._features_data0; - model_bs11.features.data_len = sizeof(model_bs11._features_data); - - osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HOPPING); - osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HSCSD); - osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_MULTI_TSC); - osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL); @@ -619,5 +612,12 @@ int bts_model_bs11_init(void) { + model_bs11.features.data = &model_bs11._features_data0; + model_bs11.features.data_len = sizeof(model_bs11._features_data); + + osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HOPPING); + osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HSCSD); + osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_MULTI_TSC); + return gsm_bts_model_register(&model_bs11); }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_trx.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_trx.c
Changed
@@ -338,6 +338,20 @@ result = false; } } + + if (trx->bts->features_known) { + const struct bitvec *ft = &trx->bts->features; + + if (ts->hopping.enabled && !osmo_bts_has_feature(ft, BTS_FEAT_HOPPING)) { + LOGP(DNM, LOGL_ERROR, "TS%d has freq. hopping enabled, but BTS does not support it\n", i); + result = false; + } + + if (ts->tsc != -1 && !osmo_bts_has_feature(ft, BTS_FEAT_MULTI_TSC)) { + LOGP(DNM, LOGL_ERROR, "TS%d has TSC != BCC, but BTS does not support it\n", i); + result = false; + } + } } return result; @@ -382,7 +396,7 @@ /* set all system information types for a TRX */ int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx) { - int i, rc; + int rc; struct gsm_bts *bts = trx->bts; uint8_t gen_si_MAX_SYSINFO_TYPE, n_si = 0, n; int si_len_MAX_SYSINFO_TYPE; @@ -420,42 +434,49 @@ /* Second, we generate the selected SI via RSL */ for (n = 0; n < n_si; n++) { - i = gen_sin; + const enum osmo_sysinfo_type si_type = gen_sin; + /* Only generate SI if this SI is not in "static" (user-defined) mode */ - if (!(bts->si_mode_static & (1 << i))) { + if (!(bts->si_mode_static & (1 << si_type))) { /* Set SI as being valid. gsm_generate_si() might unset * it, if SI is not required. */ - bts->si_valid |= (1 << i); - rc = gsm_generate_si(bts, i); + bts->si_valid |= (1 << si_type); + rc = gsm_generate_si(bts, si_type); if (rc < 0) goto err_out; - si_leni = rc; + si_lensi_type = rc; } else { - if (i == SYSINFO_TYPE_5 || i == SYSINFO_TYPE_5bis - || i == SYSINFO_TYPE_5ter) - si_leni = 18; - else if (i == SYSINFO_TYPE_6) - si_leni = 11; - else - si_leni = 23; + switch (si_type) { + case SYSINFO_TYPE_5: + case SYSINFO_TYPE_5bis: + case SYSINFO_TYPE_5ter: + si_lensi_type = 18; + break; + case SYSINFO_TYPE_6: + si_lensi_type = 11; + break; + default: + si_lensi_type = 23; + } } } /* Third, we send the selected SI via RSL */ for (n = 0; n < n_si; n++) { - i = gen_sin; + const enum osmo_sysinfo_type si_type = gen_sin; + /* 3GPP TS 08.58 §8.5.1 BCCH INFORMATION. If we don't currently * have this SI, we send a zero-length RSL BCCH FILLING / * SACCH FILLING in order to deactivate the SI, in case it * might have previously been active */ - if (!GSM_BTS_HAS_SI(bts, i)) { + if (!GSM_BTS_HAS_SI(bts, si_type)) { if (bts->si_unused_send_empty) - rc = rsl_si(trx, i, 0); + rc = rsl_si(trx, si_type, 0); else rc = 0; /* some nanoBTS fw don't like receiving empty unsupported SI */ } else - rc = rsl_si(trx, i, si_leni); + rc = rsl_si(trx, si_type, si_lensi_type); if (rc < 0) return rc; } @@ -468,6 +489,6 @@ err_out: LOGP(DRR, LOGL_ERROR, "Cannot generate SI%s for BTS %u: error <%s>, " "most likely a problem with neighbor cell list generation\n", - get_value_string(osmo_sitype_strs, i), bts->nr, strerror(-rc)); + get_value_string(osmo_sitype_strs, gen_sin), bts->nr, strerror(-rc)); return rc; }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_trx_vty.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_trx_vty.c
Changed
@@ -316,8 +316,9 @@ "Training Sequence Code of the Timeslot\n" "TSC\n") { struct gsm_bts_trx_ts *ts = vty->index; + const struct gsm_bts *bts = ts->trx->bts; - if (!osmo_bts_has_feature(&ts->trx->bts->model->features, BTS_FEAT_MULTI_TSC)) { + if (bts->features_known && !osmo_bts_has_feature(&bts->features, BTS_FEAT_MULTI_TSC)) { vty_out(vty, "%% This BTS does not support a TSC != BCC, " "falling back to BCC%s", VTY_NEWLINE); ts->tsc = -1; @@ -339,13 +340,12 @@ "Disable frequency hopping\n" "Enable frequency hopping\n") { struct gsm_bts_trx_ts *ts = vty->index; + const struct gsm_bts *bts = ts->trx->bts; int enabled = atoi(argv0); - if (enabled && !osmo_bts_has_feature(&ts->trx->bts->model->features, BTS_FEAT_HOPPING)) { - vty_out(vty, "%% BTS model does not seem to support freq. hopping%s", VTY_NEWLINE); - /* Allow enabling frequency hopping anyway, because the BTS might not have - * connected yet (thus not sent the feature vector), so we cannot know for - * sure. Jet print a warning and let it go. */ + if (enabled && bts->features_known && !osmo_bts_has_feature(&bts->features, BTS_FEAT_HOPPING)) { + vty_out(vty, "%% BTS does not support freq. hopping%s", VTY_NEWLINE); + return CMD_WARNING; } ts->hopping.enabled = enabled; @@ -569,6 +569,13 @@ vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u: Type %s%s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, lchan->nr, gsm_lchant_name(lchan->type), VTY_NEWLINE); + + if (lchan->activate.concluded) { + vty_out(vty, " Active for: %s seconds%s", + osmo_int_to_float_str_c(OTC_SELECT, gsm_lchan_active_duration_ms(lchan), 3), + VTY_NEWLINE); + } + vty_out_dyn_ts_details(vty, lchan->ts); vty_out(vty, " Connection: %u, State: %s%s%s%s", lchan->conn ? 1: 0, lchan_state_name(lchan), @@ -740,6 +747,11 @@ vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, trx->rsl_link_primary); } + + const struct load_counter *ll = &trx->lchan_load; + vty_out(vty, " Channel load: %u%%%s", + ll->total ? ll->used * 100 / ll->total : 0, + VTY_NEWLINE); } void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link,
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/bts_vty.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/bts_vty.c
Changed
@@ -528,10 +528,15 @@ return CMD_SUCCESS; } +#define CHAN_ALLOC_CMD "channel allocator" +#define CHAN_ALLOC_DESC \ + "Channel Allocator\n" \ + "Channel Allocator\n" + DEFUN_ATTR(cfg_bts_challoc, cfg_bts_challoc_cmd, - "channel allocator (ascending|descending)", - "Channel Allocator\n" "Channel Allocator\n" + CHAN_ALLOC_CMD " (ascending|descending)", + CHAN_ALLOC_DESC "Allocate Timeslots and Transceivers in ascending order\n" "Allocate Timeslots and Transceivers in descending order\n", CMD_ATTR_IMMEDIATE) @@ -548,8 +553,8 @@ DEFUN_ATTR(cfg_bts_chan_alloc_interf, cfg_bts_chan_alloc_interf_cmd, - "channel allocator avoid-interference (0|1)", - "Channel Allocator\n" "Channel Allocator\n" + CHAN_ALLOC_CMD " avoid-interference (0|1)", + CHAN_ALLOC_DESC "Configure whether reported interference levels from RES IND are used in channel allocation\n" "Ignore interference levels (default). Always assign lchans in a deterministic order.\n" "In channel allocation, prefer lchans with less interference.\n", @@ -565,21 +570,48 @@ return CMD_SUCCESS; } +DEFUN_ATTR(cfg_bts_chan_alloc_tch_signalling_policy, + cfg_bts_chan_alloc_tch_signalling_policy_cmd, + CHAN_ALLOC_CMD " tch-signalling-policy (never|emergency|voice|always)", + CHAN_ALLOC_DESC + "Configure when TCH/H or TCH/F channels can be used to serve signalling if SDCCHs are exhausted\n" + "Never allow TCH for signalling purposes\n" + "Only allow TCH for signalling purposes when establishing an emergency call\n" + "Allow TCH for signalling purposes when establishing any voice call\n" + "Always allow TCH for signalling purposes (default)\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_bts *bts = vty->index; + + if (!strcmp(argv0, "never")) + bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_NEVER; + else if (!strcmp(argv0, "emergency")) + bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_EMERG; + else if (!strcmp(argv0, "voice")) + bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_VOICE; + else + bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_ALWAYS; + + return CMD_SUCCESS; +} + DEFUN_ATTR(cfg_bts_chan_alloc_allow_tch_for_signalling, cfg_bts_chan_alloc_allow_tch_for_signalling_cmd, - "channel allocator allow-tch-for-signalling (0|1)", - "Channel Allocator\n" "Channel Allocator\n" + CHAN_ALLOC_CMD " allow-tch-for-signalling (0|1)", + CHAN_ALLOC_DESC "Configure whether TCH/H or TCH/F channels can be used to serve non-call-related signalling if SDCCHs are exhausted\n" "Forbid use of TCH for non-call-related signalling purposes\n" "Allow use of TCH for non-call-related signalling purposes (default)\n", - CMD_ATTR_IMMEDIATE) + CMD_ATTR_IMMEDIATE|CMD_ATTR_DEPRECATED) { struct gsm_bts *bts = vty->index; + vty_out(vty, "%% 'allow-tch-for-signalling' is deprecated, use 'tch-signalling-policy' instead.%s", VTY_NEWLINE); + if (!strcmp(argv0, "0")) - bts->chan_alloc_allow_tch_for_signalling = false; + bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_VOICE; else - bts->chan_alloc_allow_tch_for_signalling = true; + bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_ALWAYS; return CMD_SUCCESS; } @@ -926,6 +958,19 @@ return CMD_SUCCESS; } +DEFUN_USRATTR(cfg_bts_ccch_load_ind_period, + cfg_bts_ccch_load_ind_period_cmd, + X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK), + "ccch load-indication-period <0-255>", + CCCH_STR + "Period of time at which BTS sends RSL CCCH LOAD IND\n" + "CCCH Load Indication Period in seconds (Default: 1)\n") +{ + struct gsm_bts *bts = vty->index; + bts->ccch_load_ind_period = atoi(argv0); + return CMD_SUCCESS; +} + #define NM_STR "Network Management\n" DEFUN_USRATTR(cfg_bts_rach_nm_b_thresh, @@ -1376,7 +1421,7 @@ return CMD_WARNING; } - /* Can't use osmo_sockaddr_str_to_sockaddr() because the port would be overriden */ + /* Can't use osmo_sockaddr_str_to_sockaddr() because the port would be overridden */ bts->site_mgr->gprs.nsvcidx.remote.u.sas.ss_family = remote.af; switch (remote.af) { case AF_INET: @@ -1579,7 +1624,7 @@ struct gsm_bts *bts = vty->index; enum bts_gprs_mode mode = bts_gprs_mode_parse(argv0, NULL); - if (!bts_gprs_mode_is_compat(bts, mode)) { + if (bts->features_known && !bts_gprs_mode_is_compat(bts, mode)) { vty_out(vty, "%% This BTS type does not support %s%s", argv0, VTY_NEWLINE); return CMD_WARNING; @@ -2386,10 +2431,12 @@ #define AMR_TEXT "Adaptive Multi Rate settings\n" #define AMR_MODE_TEXT "Codec modes to use with AMR codec\n" -#define AMR_START_TEXT "Initial codec to use with AMR\n" \ - "Automatically\nFirst codec\nSecond codec\nThird codec\nFourth codec\n" -#define AMR_TH_TEXT "AMR threshold between codecs\nMS side\nBTS side\n" -#define AMR_HY_TEXT "AMR hysteresis between codecs\nMS side\nBTS side\n" +#define AMR_START_TEXT "Initial codec mode to use with AMR\n" \ + "Automatically\nFirst mode\nSecond mode\nThird mode\nFourth mode\n" +#define AMR_MS_BTS_TEXT "MS side\nBTS side\n" +#define AMR_TH_TEXT "Lower threshold(s) for switching between codec modes\n" AMR_MS_BTS_TEXT +#define AMR_HY_TEXT "Hysteresis value(s) to obtain the higher threshold(s) " \ + "for switching between codec modes\n" AMR_MS_BTS_TEXT static int get_amr_from_arg(struct vty *vty, int argc, const char *argv, int full) { @@ -2546,8 +2593,10 @@ #define AMR_TCHH_PAR_STR " (0|1|2|3|4|5)" #define AMR_TCHH_HELP_STR "4,75k\n5,15k\n5,90k\n6,70k\n7,40k\n7,95k\n" -#define AMR_TH_HELP_STR "Threshold between codec 1 and 2\n" -#define AMR_HY_HELP_STR "Hysteresis between codec 1 and 2\n" +#define AMR_TH_HELP_STR(a, b) \ + "Threshold between codec mode " a " and " b " (in 0.5 dB steps)\n" +#define AMR_HY_HELP_STR(a, b) \ + "Hysteresis between codec mode " a " and " b " (in 0.5 dB steps)\n" DEFUN_USRATTR(cfg_bts_amr_fr_modes1, cfg_bts_amr_fr_modes1_cmd, @@ -2612,7 +2661,7 @@ X(BSC_VTY_ATTR_NEW_LCHAN), "amr tch-f threshold (ms|bts) <0-63>", AMR_TEXT "Full Rate\n" AMR_TH_TEXT - AMR_TH_HELP_STR) + AMR_TH_HELP_STR("1", "2")) { get_amr_th_from_arg(vty, 2, argv, 1); return check_amr_config(vty); @@ -2623,7 +2672,8 @@ X(BSC_VTY_ATTR_NEW_LCHAN), "amr tch-f threshold (ms|bts) <0-63> <0-63>", AMR_TEXT "Full Rate\n" AMR_TH_TEXT - AMR_TH_HELP_STR AMR_TH_HELP_STR) + AMR_TH_HELP_STR("1", "2") + AMR_TH_HELP_STR("2", "3")) { get_amr_th_from_arg(vty, 3, argv, 1); return check_amr_config(vty); @@ -2634,7 +2684,9 @@ X(BSC_VTY_ATTR_NEW_LCHAN), "amr tch-f threshold (ms|bts) <0-63> <0-63> <0-63>", AMR_TEXT "Full Rate\n" AMR_TH_TEXT - AMR_TH_HELP_STR AMR_TH_HELP_STR AMR_TH_HELP_STR) + AMR_TH_HELP_STR("1", "2") + AMR_TH_HELP_STR("2", "3") + AMR_TH_HELP_STR("3", "4")) { get_amr_th_from_arg(vty, 4, argv, 1); return check_amr_config(vty); @@ -2645,7 +2697,7 @@ X(BSC_VTY_ATTR_NEW_LCHAN), "amr tch-f hysteresis (ms|bts) <0-15>", AMR_TEXT "Full Rate\n" AMR_HY_TEXT - AMR_HY_HELP_STR) + AMR_HY_HELP_STR("1", "2")) { get_amr_hy_from_arg(vty, 2, argv, 1); return check_amr_config(vty); @@ -2656,7 +2708,8 @@ X(BSC_VTY_ATTR_NEW_LCHAN), "amr tch-f hysteresis (ms|bts) <0-15> <0-15>", AMR_TEXT "Full Rate\n" AMR_HY_TEXT - AMR_HY_HELP_STR AMR_HY_HELP_STR) + AMR_HY_HELP_STR("1", "2") + AMR_HY_HELP_STR("2", "3")) { get_amr_hy_from_arg(vty, 3, argv, 1); return CMD_SUCCESS;
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/cbch_scheduler.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/cbch_scheduler.c
Changed
@@ -246,7 +246,7 @@ bts_smscb_page_done(cstate, page); } -static void bts_cbch_timer(void *data) +void bts_cbch_timer_cb(void *data) { struct gsm_bts *bts = (struct gsm_bts *)data; @@ -259,7 +259,6 @@ /* There is one SMSCB message (page) per eight 51-multiframes, i.e. 1.882 seconds */ void bts_cbch_timer_schedule(struct gsm_bts *bts) { - osmo_timer_setup(&bts->cbch_timer, &bts_cbch_timer, bts); osmo_timer_schedule(&bts->cbch_timer, 1, 882920); }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/cbsp_link.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/cbsp_link.c
Changed
@@ -21,7 +21,6 @@ #include <osmocom/bsc/gsm_data.h> -#include <osmocom/bsc/vty.h> #include <osmocom/bsc/debug.h> #include <osmocom/bsc/smscb.h> #include <osmocom/bsc/bsc_msc_data.h> @@ -301,6 +300,13 @@ { struct msgb *msg; + if (!cbc->client.cli && !cbc->server.srv) { + LOGP(DCBS, LOGL_ERROR, "Discarding Tx CBSP Message Type %s, link is down\n", + get_value_string(cbsp_msg_type_names, cbsp->msg_type)); + talloc_free(cbsp); + return 0; + } + msg = osmo_cbsp_encode(cbc, cbsp); if (!msg) { LOGP(DCBS, LOGL_ERROR, "Unable to encode CBSP Message Type %s: %s\n", @@ -312,349 +318,7 @@ osmo_stream_cli_send(cbc->client.cli, msg); else if (cbc->server.srv) osmo_stream_srv_send(cbc->server.srv, msg); - else { - LOGP(DCBS, LOGL_ERROR, "Discarding CBSP Message, link is down: %s\n", msgb_hexdump(msg)); - msgb_free(msg); - } talloc_free(cbsp); return 0; } - -static struct bsc_cbc_link *vty_cbc_data(struct vty *vty) -{ - return bsc_gsmnet->cbc; -} - -/********************************************************************************* - * VTY Interface (Configuration + Introspection) - *********************************************************************************/ - -DEFUN(cfg_cbc, cfg_cbc_cmd, - "cbc", "Configure CBSP Link to Cell Broadcast Centre\n") -{ - vty->node = CBC_NODE; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_mode, cfg_cbc_mode_cmd, - "mode (server|client|disabled)", - "Set OsmoBSC as CBSP server or client\n" - "CBSP Server: listen for inbound TCP connections from a remote Cell Broadcast Centre\n" - "CBSP Client: establish outbound TCP connection to a remote Cell Broadcast Centre\n" - "Disable CBSP link\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->mode = get_string_value(bsc_cbc_link_mode_names, argv0); - OSMO_ASSERT(cbc->mode >= 0); - - /* Immediately restart/stop CBSP only when coming from a telnet session. The settings from the config file take - * effect in osmo_bsc_main.c's invocation of bsc_cbc_link_restart(). */ - if (vty->type != VTY_FILE) - bsc_cbc_link_restart(); - - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_server, cfg_cbc_server_cmd, - "server", "Configure OsmoBSC's CBSP server role\n") -{ - vty->node = CBC_SERVER_NODE; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_server_local_ip, cfg_cbc_server_local_ip_cmd, - "local-ip " VTY_IPV46_CMD, - "Set IP Address to listen on for inbound CBSP from a Cell Broadcast Centre\n" - "IPv4 address\n" "IPv6 address\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - osmo_sockaddr_str_from_str(&cbc->server.local_addr, argv0, cbc->server.local_addr.port); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_server_local_port, cfg_cbc_server_local_port_cmd, - "local-port <1-65535>", - "Set TCP port to listen on for inbound CBSP from a Cell Broadcast Centre\n" - "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->server.local_addr.port = atoi(argv0); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client, cfg_cbc_client_cmd, - "client", "Configure OsmoBSC's CBSP client role\n") -{ - vty->node = CBC_CLIENT_NODE; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_remote_ip, cfg_cbc_client_remote_ip_cmd, - "remote-ip " VTY_IPV46_CMD, - "Set IP Address of the Cell Broadcast Centre, to establish CBSP link to\n" - "IPv4 address\n" "IPv6 address\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - osmo_sockaddr_str_from_str(&cbc->client.remote_addr, argv0, cbc->client.remote_addr.port); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_remote_port, cfg_cbc_client_remote_port_cmd, - "remote-port <1-65535>", - "Set TCP port of the Cell Broadcast Centre, to establish CBSP link to\n" - "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.remote_addr.port = atoi(argv0); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_local_ip, cfg_cbc_client_local_ip_cmd, - "local-ip " VTY_IPV46_CMD, - "Set local bind address for the outbound CBSP link to the Cell Broadcast Centre\n" - "IPv4 address\n" "IPv6 address\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - osmo_sockaddr_str_from_str(&cbc->client.local_addr, argv0, cbc->client.local_addr.port); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_local_port, cfg_cbc_client_local_port_cmd, - "local-port <1-65535>", - "Set local bind port for the outbound CBSP link to the Cell Broadcast Centre\n" - "port number\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.local_addr.port = atoi(argv0); - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_no_local_ip, cfg_cbc_client_no_local_ip_cmd, - "no local-ip", - NO_STR "Remove local IP address bind config for the CBSP client mode\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.local_addr = (struct osmo_sockaddr_str){ .port = cbc->client.local_addr.port }; - return CMD_SUCCESS; -} - -DEFUN(cfg_cbc_client_no_local_port, cfg_cbc_client_no_local_port_cmd, - "no local-port", - NO_STR "Remove local TCP port bind config for the CBSP client mode\n") -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - cbc->client.local_addr.port = 0; - return CMD_SUCCESS; -} - -static struct cmd_node cbc_node = { - CBC_NODE, - "%s(config-cbc)# ", - 1, -}; - -static struct cmd_node cbc_server_node = { - CBC_SERVER_NODE, - "%s(config-cbc-server)# ", - 1, -}; - -static struct cmd_node cbc_client_node = { - CBC_CLIENT_NODE, - "%s(config-cbc-client)# ", - 1, -}; - -static int config_write_cbc(struct vty *vty) -{ - struct bsc_cbc_link *cbc = vty_cbc_data(vty); - - bool default_server_local; - bool default_client_remote; - bool default_client_local; - - default_server_local = !osmo_sockaddr_str_cmp(&cbc->server.local_addr, - &bsc_cbc_default_server_local_addr); - default_client_remote = !osmo_sockaddr_str_is_set(&cbc->client.remote_addr); - default_client_local = !osmo_sockaddr_str_is_set(&cbc->client.local_addr); - - /* If all reflects default values, skip the 'cbc' section */ - if (cbc->mode == BSC_CBC_LINK_MODE_DISABLED - && default_server_local - && default_client_remote && default_client_local) - return 0; - - vty_out(vty, "cbc%s", VTY_NEWLINE);
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/chan_alloc.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/chan_alloc.c
Changed
@@ -44,8 +44,12 @@ struct gsm_bts_trx *trx; llist_for_each_entry(trx, &bts->trx_list, list) { + struct load_counter *ll = &trx->lchan_load; int i; + /* init per-TRX load counters */ + memset(ll, 0, sizeof(*ll)); + /* skip administratively deactivated transceivers */ if (!trx_is_usable(trx)) continue; @@ -66,6 +70,7 @@ ts->pchan_on_init == GSM_PCHAN_TCH_F_PDCH) && (ts->pchan_is == GSM_PCHAN_NONE || ts->pchan_is == GSM_PCHAN_PDCH)) { + ll->total++; pl->total++; /* Below loop would not count this timeslot, since in PDCH mode it has no usable * timeslots. But let's make it clear that the timeslot must not be counted again: */ @@ -77,11 +82,13 @@ if (lchan->type == GSM_LCHAN_CBCH) continue; + ll->total++; pl->total++; /* lchans under a BORKEN TS should be counted * as used just as BORKEN lchans under a normal TS */ if (ts->fi->state == TS_ST_BORKEN) { + ll->used++; pl->used++; continue; } @@ -90,6 +97,7 @@ case LCHAN_ST_UNUSED: break; default: + ll->used++; pl->used++; break; }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/chan_counts.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/chan_counts.c
Changed
@@ -26,6 +26,8 @@ #include <osmocom/bsc/bts_trx.h> #include <osmocom/bsc/lchan_fsm.h> #include <osmocom/bsc/chan_counts.h> +#include <osmocom/bsc/bsc_stats.h> +#include <osmocom/bsc/signal.h> static const unsigned int lchans_per_pchan_GSM_PCHAN_MAX_GSM_LCHAN_MAX = { GSM_PCHAN_NONE = {0}, @@ -68,75 +70,241 @@ dst->valdim1dim2i += lchans_per_pchanpchani; } -void chan_counts_for_trx(struct chan_counts *trx_counts, const struct gsm_bts_trx *trx) +static const char *chan_counts_dim1_name_CHAN_COUNTS1_NUM = { + CHAN_COUNTS1_ALL = "all", + CHAN_COUNTS1_STATIC = "static", + CHAN_COUNTS1_DYNAMIC = "dynamic", +}; + +static const char *chan_counts_dim2_name_CHAN_COUNTS2_NUM = { + CHAN_COUNTS2_MAX_TOTAL = "max", + CHAN_COUNTS2_CURRENT_TOTAL = "current", + CHAN_COUNTS2_ALLOCATED = "alloc", + CHAN_COUNTS2_FREE = "free", +}; + +int chan_counts_to_str_buf(char *buf, size_t buflen, const struct chan_counts *c) +{ + struct osmo_strbuf sb = { .buf = buf, .len = buflen }; + int i1, i2, i3; + OSMO_STRBUF_PRINTF(sb, "{"); + for (i1 = 0; i1 < _CHAN_COUNTS1_NUM; i1++) { + for (i2 = 0; i2 < _CHAN_COUNTS2_NUM; i2++) { + bool p12 = false; + + for (i3 = 0; i3 < _GSM_LCHAN_MAX; i3++) { + + int v = c->vali1i2i3; + if (v) { + if (!p12) { + p12 = true; + OSMO_STRBUF_PRINTF(sb, " %s.%s{", chan_counts_dim1_namei1, + chan_counts_dim2_namei2); + } + OSMO_STRBUF_PRINTF(sb, " %s=%d", gsm_lchant_name(i3), v); + } + } + + if (p12) + OSMO_STRBUF_PRINTF(sb, " }"); + } + } + OSMO_STRBUF_PRINTF(sb, " }"); + return sb.chars_needed; +} + +char *chan_counts_to_str_c(void *ctx, const struct chan_counts *c) +{ + OSMO_NAME_C_IMPL(ctx, 64, "ERROR", chan_counts_to_str_buf, c) +} + +void chan_counts_for_ts(struct chan_counts *ts_counts, const struct gsm_bts_trx_ts *ts) { - const struct gsm_bts_trx_ts *ts; const struct gsm_lchan *lchan; - int i; + bool ts_is_dynamic; - chan_counts_zero(trx_counts); + chan_counts_zero(ts_counts); - if (!trx_is_usable(trx)) + if (!ts_is_usable(ts)) return; - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - bool ts_is_dynamic; - struct chan_counts ts_count = {0}; - ts = &trx->tsi; - if (!ts_is_usable(ts)) - continue; - - /* Count the full potential nr of lchans for dynamic TS */ - chan_counts_per_pchan_add(&ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_MAX_TOTAL, ts->pchan_on_init); - - switch (ts->pchan_on_init) { - case GSM_PCHAN_TCH_F_PDCH: - case GSM_PCHAN_OSMO_DYN: - ts_is_dynamic = true; - break; - default: - ts_is_dynamic = false; - break; - } + /* Count the full potential nr of lchans for dynamic TS */ + chan_counts_per_pchan_add(ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_MAX_TOTAL, ts->pchan_on_init); - if (ts_is_dynamic && ts->pchan_is == GSM_PCHAN_PDCH) { - /* Dynamic timeslots in PDCH mode can become TCH or SDCCH immediately, - * so set CURRENT_TOTAL = MAX_TOTAL. */ - chan_counts_dim3_add(&ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_CURRENT_TOTAL, - &ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_MAX_TOTAL); - } else { - /* Static TS, or dyn TS that are currently fixed on a specific pchan: count lchans for the - * current pchan mode. */ - chan_counts_per_pchan_add(&ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_CURRENT_TOTAL, ts->pchan_is); - } + switch (ts->pchan_on_init) { + case GSM_PCHAN_TCH_F_PDCH: + case GSM_PCHAN_OSMO_DYN: + ts_is_dynamic = true; + break; + default: + ts_is_dynamic = false; + break; + } - /* Count currently allocated lchans */ - ts_for_n_lchans(lchan, ts, ts->max_primary_lchans) { - if (!lchan_state_is(lchan, LCHAN_ST_UNUSED)) - ts_count.valCHAN_COUNTS1_ALLCHAN_COUNTS2_ALLOCATEDlchan->type++; - } + if (ts_is_dynamic && ts->pchan_is == GSM_PCHAN_PDCH) { + /* Dynamic timeslots in PDCH mode can become TCH or SDCCH immediately, + * so set CURRENT_TOTAL = MAX_TOTAL. */ + chan_counts_dim3_add(ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_CURRENT_TOTAL, + ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_MAX_TOTAL); + } else { + /* Static TS, or dyn TS that are currently fixed on a specific pchan: count lchans for the + * current pchan mode. */ + chan_counts_per_pchan_add(ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_CURRENT_TOTAL, ts->pchan_is); + } + + /* Count currently allocated lchans */ + ts_for_n_lchans(lchan, ts, ts->max_primary_lchans) { + if (!lchan_state_is(lchan, LCHAN_ST_UNUSED)) + ts_counts->valCHAN_COUNTS1_ALLCHAN_COUNTS2_ALLOCATEDlchan->type++; + } + + chan_counts_dim3_add(ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_FREE, + ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_CURRENT_TOTAL); + chan_counts_dim3_sub(ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_FREE, + ts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_ALLOCATED); + + if (ts_is_dynamic) + chan_counts_dim2_add(ts_counts, CHAN_COUNTS1_DYNAMIC, ts_counts, CHAN_COUNTS1_ALL); + else + chan_counts_dim2_add(ts_counts, CHAN_COUNTS1_STATIC, ts_counts, CHAN_COUNTS1_ALL); +} + +static void chan_counts_diff(struct chan_counts *diff, const struct chan_counts *left, const struct chan_counts *right) +{ + chan_counts_zero(diff); + chan_counts_add(diff, right); + chan_counts_sub(diff, left); +} - chan_counts_dim3_add(&ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_FREE, - &ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_CURRENT_TOTAL); - chan_counts_dim3_sub(&ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_FREE, - &ts_count, CHAN_COUNTS1_ALL, CHAN_COUNTS2_ALLOCATED); +static void _chan_counts_ts_update(struct gsm_bts_trx_ts *ts, const struct chan_counts *ts_new_counts) +{ + struct chan_counts diff; + + chan_counts_diff(&diff, &ts->chan_counts, ts_new_counts); + if (chan_counts_is_zero(&diff)) + return; + + ts->chan_counts = *ts_new_counts; + chan_counts_add(&ts->trx->chan_counts, &diff); + chan_counts_add(&ts->trx->bts->chan_counts, &diff); + chan_counts_add(&bsc_gsmnet->chan_counts, &diff); + + all_allocated_update_bts(ts->trx->bts); + all_allocated_update_bsc(); + + LOGP(DLGLOBAL, LOGL_DEBUG, "change in channel counts: ts %u-%u-%u: %s\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr, chan_counts_to_str_c(OTC_SELECT, &diff)); + LOGP(DLGLOBAL, LOGL_DEBUG, "bsc channel counts: %s\n", + chan_counts_to_str_c(OTC_SELECT, &bsc_gsmnet->chan_counts)); +} + +/* Re-count this TS, and update ts->chan_counts. If the new ts->chan_counts differ, propagate the difference to + * trx->chan_counts, bts->chan_counts and gsm_network->chan_counts. */ +void chan_counts_ts_update(struct gsm_bts_trx_ts *ts) +{ + struct chan_counts ts_new_counts; + chan_counts_for_ts(&ts_new_counts, ts); + _chan_counts_ts_update(ts, &ts_new_counts); +} + +void chan_counts_ts_clear(struct gsm_bts_trx_ts *ts) +{ + struct chan_counts ts_new_counts = {0}; + _chan_counts_ts_update(ts, &ts_new_counts); +} - if (ts_is_dynamic)
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/gsm_04_08_rr.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/gsm_04_08_rr.c
Changed
@@ -325,8 +325,9 @@ msgb_tlv_put(msg, GSM48_IE_CELL_SEL_IND_AFTER_REL, len, buf); } - DEBUGP(DRR, "Sending Channel Release: Chan: Number: %d Type: %d RR-Cause: 0x%x '%s'\n", - lchan->nr, lchan->type, lchan->release.rr_cause, rr_cause_name(lchan->release.rr_cause)); + DEBUGP(DRR, "%s Tx Channel Release (cause=0x%02x '%s')\n", + gsm_lchan_name(lchan), lchan->release.rr_cause, + rr_cause_name(lchan->release.rr_cause)); /* Send actual release request to MS */ return gsm48_sendmsg(msg); @@ -358,7 +359,8 @@ gh->proto_discr = GSM48_PDISC_RR; gh->msg_type = GSM48_MT_RR_CLSM_ENQ; - DEBUGP(DRR, "%s TX CLASSMARK ENQUIRY %u\n", gsm_lchan_name(lchan), msgb_length(msg)); + DEBUGP(DRR, "%s Tx CLASSMARK ENQUIRY (len=%u)\n", + gsm_lchan_name(lchan), msgb_length(msg)); return gsm48_sendmsg(msg); } @@ -368,16 +370,14 @@ { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CIPH"); struct gsm48_hdr *gh; - uint8_t ciph_mod_set; + uint8_t ciph_mod_set = 0x00; msg->lchan = lchan; - DEBUGP(DRR, "TX CIPHERING MODE CMD\n"); + DEBUGP(DRR, "%s Tx CIPHERING MODE CMD\n", gsm_lchan_name(lchan)); - if (lchan->encr.alg_id <= RSL_ENC_ALG_A5(0)) - ciph_mod_set = 0; - else - ciph_mod_set = (lchan->encr.alg_id-2)<<1 | 1; + if (lchan->encr.alg_a5_n > 0) + ciph_mod_set = (lchan->encr.alg_a5_n - 1) << 1 | 0x01; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); gh->proto_discr = GSM48_PDISC_RR; @@ -533,19 +533,21 @@ #define GSM48_HOCMD_CCHDESC_LEN 16 /* Chapter 9.1.15: Handover Command */ -struct msgb *gsm48_make_ho_cmd(struct gsm_lchan *new_lchan, uint8_t power_command, uint8_t ho_ref) +struct msgb *gsm48_make_ho_cmd(const struct gsm_lchan *new_lchan, + enum handover_scope ho_scope, bool async, + uint8_t power_command, uint8_t ho_ref) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 HO CMD"); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_ho_cmd *ho = (struct gsm48_ho_cmd *) msgb_put(msg, sizeof(*ho)); - struct gsm_bts *bts = new_lchan->ts->trx->bts; + const struct gsm_bts *bts = new_lchan->ts->trx->bts; gh->proto_discr = GSM48_PDISC_RR; gh->msg_type = GSM48_MT_RR_HANDO_CMD; /* mandatory bits */ - gsm48_cell_desc(&ho->cell_desc, new_lchan->ts->trx->bts); + gsm48_cell_desc(&ho->cell_desc, bts); if (gsm48_lchan2chan_desc(&ho->chan_desc, new_lchan, gsm_ts_tsc(new_lchan->ts), false)) { msgb_free(msg); return NULL; @@ -553,8 +555,20 @@ ho->ho_ref = ho_ref; ho->power_command = power_command; + /* Synchronization Indication, TV (see 3GPP TS 44.018, 9.1.15.1). + * In the case of inter-RAT handover, always include this IE for the sake of + * explicitness. In the case of intra-RAT handover, include this IE only for + * the synchronized handover. If omitted, non-synchronized handover is assumed. */ + if (!async || (ho_scope & HO_INTER_BSC_IN)) { + /* Only the SI field (Non-synchronized/Synchronized) is present. + * TODO: ROT (Report Observed Time Difference), currently 0. + * TODO: NCI (Normal cell indication), currently 0. */ + const uint8_t sync_ind = async ? 0x00 : 0x01; + /* T (4 bit) + V (4 bit), see 3GPP TS 44.018, 10.5.2.39 */ + msgb_v_put(msg, GSM48_IE_SYNC_IND | (sync_ind & 0x0f)); + } + if (new_lchan->ts->hopping.enabled) { - struct gsm_bts *bts = new_lchan->ts->trx->bts; struct gsm48_system_information_type_1 *si1; si1 = GSM_BTS_SI(bts, SYSINFO_TYPE_1); @@ -563,7 +577,6 @@ GSM48_HOCMD_CCHDESC_LEN, si1->cell_channel_description); } - /* FIXME: optional bits for type of synchronization? */ msgb_tv_put(msg, GSM48_IE_CHANMODE_1, new_lchan->current_ch_mode_rate.chan_mode); @@ -574,6 +587,17 @@ new_lchan->ts->hopping.ma_data); } + /* (O) Cipher Mode Setting, TV (see 3GPP TS 44.018, 9.1.15.10). + * Omitted in the case of intra-RAT (GERAN-to-GERAN) handover. + * Shall be included in the case of inter-RAT handover. */ + if (ho_scope & HO_INTER_BSC_IN) { + uint8_t cms = 0x00; + if (new_lchan->encr.alg_a5_n > 0) + cms = (new_lchan->encr.alg_a5_n - 1) << 1 | 1; + /* T (4 bit) + V (4 bit), see 3GPP TS 44.018, 10.5.2.9 */ + msgb_v_put(msg, GSM48_IE_CIP_MODE_SET | (cms & 0x0f)); + } + /* in case of multi rate we need to attach a config */ if (gsm48_chan_mode_to_non_vamos(new_lchan->current_ch_mode_rate.chan_mode) == GSM48_CMODE_SPEECH_AMR) { if (put_mr_config_for_ms(msg, &new_lchan->current_mr_conf, @@ -587,16 +611,6 @@ return msg; } -int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan, - uint8_t power_command, uint8_t ho_ref) -{ - struct msgb *msg = gsm48_make_ho_cmd(new_lchan, power_command, ho_ref); - if (!msg) - return -EINVAL; - msg->lchan = old_lchan; - return gsm48_sendmsg(msg); -} - /* Chapter 9.1.2: Assignment Command */ int gsm48_send_rr_ass_cmd(struct gsm_lchan *current_lchan, struct gsm_lchan *new_lchan, uint8_t power_command) { @@ -607,7 +621,8 @@ (struct gsm48_ass_cmd *) msgb_put(msg, sizeof(*ass)); struct gsm_bts *bts = new_lchan->ts->trx->bts; - DEBUGP(DRR, "-> ASSIGNMENT COMMAND tch_mode=0x%02x\n", + DEBUGP(DRR, "%s Tx ASSIGNMENT COMMAND (tch_mode=0x%02x)\n", + gsm_lchan_name(current_lchan), new_lchan->current_ch_mode_rate.chan_mode); msg->lchan = current_lchan; @@ -697,7 +712,8 @@ (struct gsm48_chan_mode_modify *) msgb_put(msg, sizeof(*cmm)); struct gsm_bts *bts = lchan->ts->trx->bts; - DEBUGP(DRR, "-> CHANNEL MODE MODIFY mode=0x%02x\n", mode); + DEBUGP(DRR, "%s Tx CHANNEL MODE MODIFY (mode=0x%02x)\n", + gsm_lchan_name(lchan), mode); msg->lchan = lchan; gh->proto_discr = GSM48_PDISC_RR; @@ -999,7 +1015,7 @@ osmo_fsm_inst_dispatch(conn->ho.fi, HO_EV_RR_HO_FAIL, msg); break; case GSM48_MT_RR_CIPH_M_COMPL: - bsc_cipher_mode_compl(conn, msg, conn->lchan->encr.alg_id); + bsc_cipher_mode_compl(conn, msg, conn->lchan->encr.alg_a5_n); break; case GSM48_MT_RR_ASS_COMPL: if (conn->assignment.fi) @@ -1048,16 +1064,17 @@ * VTY configuration does not permit. */ if (msg_type == GSM48_MT_CC_EMERG_SETUP) { if (msg->lchan->ts->trx->bts->si_common.rach_control.t2 & 0x4) { - LOG_LCHAN(msg->lchan, LOGL_NOTICE, "MS attempts EMERGENCY SETUP although EMERGENCY CALLS" - " are not allowed in sysinfo (spec violation by MS!)\n"); - lchan_release(msg->lchan, true, true, GSM48_RR_CAUSE_PREMPTIVE_REL, + LOG_LCHAN(msg->lchan, LOGL_ERROR, "MS attempts EMERGENCY SETUP although EMERGENCY CALLS" + " are not allowed in sysinfo (cfg: network / bts / rach emergency call allowed 0)\n"); + lchan_release(msg->lchan, true, true, GSM48_RR_CAUSE_PROT_ERROR_UNSPC, gscon_last_eutran_plmn(msg->lchan->conn)); break; } if (!conn->sccp.msc->allow_emerg) { - LOG_LCHAN(msg->lchan, LOGL_NOTICE, "MS attempts EMERGENCY SETUP, but EMERGENCY CALLS are" - " denied on this BSC (check BTS config!)\n"); - lchan_release(msg->lchan, true, true, GSM48_RR_CAUSE_PREMPTIVE_REL, + LOG_LCHAN(msg->lchan, LOGL_ERROR, "MS attempts EMERGENCY SETUP, but EMERGENCY CALLS are" + " denied on MSC %d (cfg: msc %d / allow-emergency deny)\n", + conn->sccp.msc->nr, conn->sccp.msc->nr); + lchan_release(msg->lchan, true, true, GSM48_RR_CAUSE_PROT_ERROR_UNSPC, gscon_last_eutran_plmn(msg->lchan->conn)); break; }
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/gsm_08_08.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/gsm_08_08.c
Changed
@@ -71,12 +71,14 @@ { int rc; struct msgb *resp; + struct gsm_bts *bts; if (!msc_connected(conn)) return; - LOGP(DMSC, LOGL_NOTICE, "Tx MSC SAPI N REJECT (dlci=0x%02x, cause='%s')\n", - dlci, gsm0808_cause_name(cause)); + bts = conn_get_bts(conn); + LOG_BTS(bts, DMSC, LOGL_NOTICE, "Tx MSC SAPI N REJECT (dlci=0x%02x, cause='%s')\n", + dlci, gsm0808_cause_name(cause)); resp = gsm0808_create_sapi_reject_cause(dlci, cause); rate_ctr_inc(rate_ctr_group_get_ctr(conn->sccp.msc->msc_ctrs, MSC_CTR_BSSMAP_TX_DT1_SAPI_N_REJECT)); rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_TX_SCCP, resp); @@ -85,7 +87,7 @@ } /*! MS->MSC: Tell MSC that ciphering has been enabled. */ -void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr) +void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_a5_n) { int rc; struct msgb *resp; @@ -94,7 +96,7 @@ return; LOGP(DMSC, LOGL_DEBUG, "CIPHER MODE COMPLETE from MS, forwarding to MSC\n"); - resp = gsm0808_create_cipher_complete(msg, chosen_encr); + resp = gsm0808_create_cipher_complete(msg, ALG_A5_NR_TO_BSSAP(chosen_a5_n)); rate_ctr_inc(rate_ctr_group_get_ctr(conn->sccp.msc->msc_ctrs, MSC_CTR_BSSMAP_TX_DT1_CIPHER_COMPLETE)); rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_TX_SCCP, resp); if (rc != 0) @@ -536,15 +538,6 @@ return rc; } -/* Data Link Connection Identifier (DLCI) is defined in 3GPP TS 48.006, section 9.3.2. - * .... .SSS - SAPI value used on the radio link; - * CC.. .... - control channel identification: - * 00.. .... - indicates that the control channel is not further specified, - * 10.. .... - represents the FACCH or the SDCCH, - * 11.. .... - represents the SACCH, - * other values are reserved. */ -#define RSL_LINK_ID2DLCI(link_id) \ - (link_id & 0x40 ? 0xc0 : 0x80) | (link_id & 0x07) /*! MS->BSC/MSC: Um L3 message. */ void bsc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, struct msgb *msg)
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/gsm_data.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/gsm_data.c
Changed
@@ -62,16 +62,13 @@ struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, struct gsm_bts *start_bts) { - int i; struct gsm_bts *bts; int skip = 0; if (start_bts) skip = 1; - for (i = 0; i < net->num_bts; i++) { - bts = gsm_bts_num(net, i); - + llist_for_each_entry(bts, &net->bts_list, list) { if (skip) { if (start_bts == bts) skip = 0; @@ -124,7 +121,7 @@ net->num_bts++; bts->type = type; - bts->model = model; + gsm_set_bts_model(bts, model); bts->bsic = bsic; llist_add_tail(&bts->list, &net->bts_list); @@ -345,6 +342,21 @@ lchan->nr - (lchan->vamos.is_secondary ? ts->max_primary_lchans : 0)); } +/* If the lchan is currently active, return the duration since activation in milliseconds. + * Otherwise return 0. */ +uint64_t gsm_lchan_active_duration_ms(const struct gsm_lchan *lchan) +{ + struct timespec now, elapsed; + + if (lchan->active_start.tv_sec == 0 && lchan->active_start.tv_nsec == 0) + return 0; + + osmo_clock_gettime(CLOCK_MONOTONIC, &now); + timespecsub(&now, &lchan->active_start, &elapsed); + + return elapsed.tv_sec * 1000 + elapsed.tv_nsec / 1000000; +} + /* obtain the MO structure for a given object instance */ static inline struct gsm_abis_mo * gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, @@ -588,7 +600,7 @@ if (rc < 0) LOG_LCHAN(lchan, LOGL_ERROR, "Error encoding Channel Number: pchan %s ts %u ss %u%s\n", - gsm_pchan_name(lchan->ts->pchan_from_config), lchan->ts->nr, lchan->nr, + gsm_pchan_name(lchan->ts->pchan_from_config), lchan->ts->nr, lchan_nr, lchan->vamos.is_secondary ? " (VAMOS shadow)" : ""); return rc; } @@ -754,7 +766,7 @@ bool nm_is_running(const struct gsm_nm_state *s) { if (s->operational != NM_OPSTATE_ENABLED) return false; - if ((s->availability != NM_AVSTATE_OK) && (s->availability != 0xff)) + if (s->availability != NM_AVSTATE_OK) return false; if (s->administrative != NM_STATE_UNLOCKED) return false; @@ -948,10 +960,8 @@ bool ts_is_usable(const struct gsm_bts_trx_ts *ts) { - if (!trx_is_usable(ts->trx)) { - LOGP(DRLL, LOGL_DEBUG, "%s not usable\n", gsm_trx_name(ts->trx)); + if (!trx_is_usable(ts->trx)) return false; - } if (!ts->fi) return false; @@ -1129,220 +1139,6 @@ }, }; -/* Default MS/BS Power Control parameters (see 3GPP TS 45.008, table A.1) */ -const struct gsm_power_ctrl_params power_ctrl_params_def = { - /* Static Power Control is the safe default */ - .mode = GSM_PWR_CTRL_MODE_STATIC, - - /* BS Power reduction value / maximum (in dB) */ - .bs_power_val_db = 0, /* no attenuation in static mode */ - .bs_power_max_db = 12, /* up to 12 dB in dynamic mode */ - - /* Power increasing/reducing step size */ - .inc_step_size_db = 4, /* 2, 4, or 6 dB */ - .red_step_size_db = 2, /* 2 or 4 dB */ - - .ctrl_interval = 1, /* Trigger loop every second SACCH block. TS 45.008 sec 4.7.1 */ - - /* RxLev measurement parameters */ - .rxlev_meas = { - .enabled = true, - /* Thresholds for RxLev (see 3GPP TS 45.008, A.3.2.1) */ - .lower_thresh = 32, /* L_RXLEV_XX_P (-78 dBm) */ - .upper_thresh = 38, /* U_RXLEV_XX_P (-72 dBm) */ - - /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages - * out of LOWER_CMP_N averages are lower than L_RXLEV_XX_P */ - .lower_cmp_p = 10, /* P1 as in 3GPP TS 45.008, A.3.2.1 (case a) */ - .lower_cmp_n = 12, /* N1 as in 3GPP TS 45.008, A.3.2.1 (case a) */ - /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages - * out of UPPER_CMP_N averages are greater than L_RXLEV_XX_P */ - .upper_cmp_p = 19, /* P2 as in 3GPP TS 45.008, A.3.2.1 (case b) */ - .upper_cmp_n = 20, /* N2 as in 3GPP TS 45.008, A.3.2.1 (case b) */ - - /* No averaging (filtering) by default */ - .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, - - /* Hreqave: the period over which an average is produced */ - .h_reqave = 4, /* TODO: investigate a reasonable default value */ - /* Hreqt: the number of averaged results maintained */ - .h_reqt = 6, /* TODO: investigate a reasonable default value */ - }, - - /* RxQual measurement parameters */ - .rxqual_meas = { - .enabled = true, - /* Thresholds for RxQual (see 3GPP TS 45.008, A.3.2.1) */ - .lower_thresh = 3, /* L_RXQUAL_XX_P (0.8% <= BER < 1.6%) */ - .upper_thresh = 0, /* U_RXQUAL_XX_P (BER < 0.2%) */ - - /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages - * out of LOWER_CMP_N averages are lower than L_RXQUAL_XX_P */ - .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ - .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ - /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages - * out of UPPER_CMP_N averages are greater than L_RXQUAL_XX_P */ - .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ - .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ - - /* No averaging (filtering) by default */ - .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, - - /* Hreqave: the period over which an average is produced */ - .h_reqave = 4, /* TODO: investigate a reasonable default value */ - /* Hreqt: the number of averaged results maintained */ - .h_reqt = 6, /* TODO: investigate a reasonable default value */ - }, - - /* C/I measurement parameters. - * Target C/I retrieved from "GSM/EDGE: Evolution and Performance" Table 10.3. - * Set lower and upper so that (lower + upper) / 2 is equal or slightly - * above the target. - */ - .ci_fr_meas = { /* FR: Target C/I = 15 dB, Soft blocking threshold = 10 dB */ - .enabled = false, - .lower_thresh = 13, - .upper_thresh = 17, - - /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages - * out of LOWER_CMP_N averages are lower than L_CI_FR_XX_P */ - .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ - .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ - /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages - * out of UPPER_CMP_N averages are greater than L_CI_FR_XX_P */ - .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ - .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ - - /* No averaging (filtering) by default */ - .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, - - /* Hreqave: the period over which an average is produced */ - .h_reqave = 4, /* TODO: investigate a reasonable default value */ - /* Hreqt: the number of averaged results maintained */ - .h_reqt = 6, /* TODO: investigate a reasonable default value */ - }, - .ci_hr_meas = { /* HR: Target C/I = 18 dB, Soft blocking threshold = 13 dB */ - .enabled = false, - .lower_thresh = 16, - .upper_thresh = 21, - - /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages - * out of LOWER_CMP_N averages are lower than L_CI_HR_XX_P */ - .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ - .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ - /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages - * out of UPPER_CMP_N averages are greater than L_CI_HR_XX_P */ - .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ - .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ - - /* No averaging (filtering) by default */ - .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, - - /* Hreqave: the period over which an average is produced */ - .h_reqave = 4, /* TODO: investigate a reasonable default value */ - /* Hreqt: the number of averaged results maintained */ - .h_reqt = 6, /* TODO: investigate a reasonable default value */ - }, - .ci_amr_fr_meas = { /* AMR-FR: Target C/I = 9 dB, Soft blocking threshold = 4 dB */ - .enabled = false, - .lower_thresh = 7,
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/handover_decision_2.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/handover_decision_2.c
Changed
@@ -914,6 +914,19 @@ full_rate ? "TCH/F" : "TCH/H", ho_reason_name(global_ho_reason)); handover_request(&req); + + /* Apply penalty timer hodec2_penalty_low_rxqual_ho */ + if (global_ho_reason == HO_REASON_INTERFERENCE + || global_ho_reason == HO_REASON_BAD_QUALITY) { + struct gsm0808_cell_id bts_id; + struct gsm_subscriber_connection *conn = c->current.lchan->conn; + int timeout = ho_get_hodec2_penalty_low_rxqual_ho(c->current.bts->ho); + gsm_bts_cell_id(&bts_id, c->current.bts); + LOGPHOCAND(c, LOGL_DEBUG, "Applying penalty-time low-rxqual-ho %d s on bts %u (%s), reason: %s\n", + timeout, c->current.bts->nr, gsm0808_cell_id_name_c(OTC_SELECT, &bts_id), + ho_reason_name(global_ho_reason)); + penalty_timers_add(conn, &conn->hodec2.penalty_timers, &bts_id, timeout); + } } return 0; } @@ -991,13 +1004,13 @@ static void candidate_set_free_tch(struct ho_candidate *c) { - struct chan_counts bts_counts; + struct chan_counts *bts_counts; struct gsm_lchan *next_lchan; - chan_counts_for_bts(&bts_counts, c->current.bts); - c->current.free_tchf = bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F; + bts_counts = &c->current.bts->chan_counts; + c->current.free_tchf = bts_counts->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F; c->current.min_free_tchf = ho_get_hodec2_tchf_min_slots(c->current.bts->ho); - c->current.free_tchh = bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H; + c->current.free_tchh = bts_counts->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H; c->current.min_free_tchh = ho_get_hodec2_tchh_min_slots(c->current.bts->ho); switch (c->current.lchan->ts->pchan_is) { @@ -1029,10 +1042,10 @@ /* For inter-BSC handover, the target BTS is in a different BSC and hence NULL here. */ if (c->target.bts) { - chan_counts_for_bts(&bts_counts, c->target.bts); - c->target.free_tchf = bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F; + bts_counts = &c->target.bts->chan_counts; + c->target.free_tchf = bts_counts->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F; c->target.min_free_tchf = ho_get_hodec2_tchf_min_slots(c->target.bts->ho); - c->target.free_tchh = bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H; + c->target.free_tchh = bts_counts->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H; c->target.min_free_tchh = ho_get_hodec2_tchh_min_slots(c->target.bts->ho); /* Would the next TCH/F lchan occupy a dynamic timeslot that currently counts for free TCH/H timeslots? @@ -1435,7 +1448,8 @@ /* After upgrading TCH/H to TCH/F due to bad RxQual, start penalty timer to avoid re-assignment within * the same cell again, to avoid oscillation from RxQual noise combined with congestion resolution. */ - if (!rc && is_upgrade_to_tchf(best_cand, REQUIREMENT_A_MASK)) { + if (!rc && best_cand->target.bts == best_cand->current.bts + && is_upgrade_to_tchf(best_cand, REQUIREMENT_A_MASK)) { struct gsm0808_cell_id bts_id; gsm_bts_cell_id(&bts_id, best_cand->target.bts); penalty_timers_add(lchan->conn, &lchan->conn->hodec2.penalty_timers, &bts_id, @@ -1945,7 +1959,7 @@ static void bts_congestion_check(struct gsm_bts *bts) { - struct chan_counts bts_counts; + struct chan_counts *bts_counts; int min_free_tchf, min_free_tchh; int free_tchf, free_tchh; @@ -1973,9 +1987,9 @@ return; } - chan_counts_for_bts(&bts_counts, bts); - free_tchf = bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F; - free_tchh = bts_counts.valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H; + bts_counts = &bts->chan_counts; + free_tchf = bts_counts->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_F; + free_tchh = bts_counts->valCHAN_COUNTS1_ALLCHAN_COUNTS2_FREEGSM_LCHAN_TCH_H; LOGPHOBTS(bts, LOGL_INFO, "Congestion check: (free/want-free) TCH/F=%d/%d TCH/H=%d/%d\n", free_tchf, min_free_tchf, free_tchh, min_free_tchh);
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/handover_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/handover_fsm.c
Changed
@@ -490,6 +490,7 @@ LOG_HO(conn, LOGL_ERROR, "Failed to parse Encryption Information IE\n"); return false; } + req->ei_as_bitmask = *e->val; if ((e = TLVP_GET(tp, GSM0808_IE_KC_128))) { if (e->len != 16) { @@ -603,6 +604,23 @@ parse_old2new_bss_info(conn, e->val, e->len, req); } + /* Decode "Codec List (MSC Preferred)". First set len = 0 to empty the list. (For inter-BSC incoming handover, + * there can't possibly be a list here already, because the conn has just now been created; just do ensure + * sanity.) */ + conn->codec_list = (struct gsm0808_speech_codec_list){}; + if ((e = TLVP_GET(tp, GSM0808_IE_SPEECH_CODEC_LIST))) { + if (gsm0808_dec_speech_codec_list(&conn->codec_list, e->val, e->len) < 0) { + LOG_HO(conn, LOGL_ERROR, "incoming inter-BSC Handover: HO Request:" + " Unable to decode Codec List (MSC Preferred)\n"); + return false; + } + } + if (aoip && !conn->codec_list.len) { + LOG_HO(conn, LOGL_ERROR, "incoming inter-BSC Handover: HO Request:" + " Invalid or empty Codec List (MSC Preferred)\n"); + return false; + } + /* A lot of IEs remain ignored... */ return true; @@ -630,6 +648,7 @@ int match_idx; struct osmo_fsm_inst *fi; struct channel_mode_and_rate ch_mode_rate = {}; + int chosen_a5_n; handover_fsm_alloc(conn); @@ -645,7 +664,7 @@ ho_fsm_update_id(fi, "interBSCin"); if (!parse_ho_request(conn, ho_request_msg, req)) { - ho_fail(HO_RESULT_ERROR, "Invalid Handover Request message from MSC\n"); + ho_fail(HO_RESULT_ERROR, "Invalid Handover Request message from MSC"); return; } @@ -717,18 +736,30 @@ .msc_assigned_cic = req->msc_assigned_cic, }; - if (req->chosen_encr_alg) { - info.encr.alg_id = req->chosen_encr_alg; - if (info.encr.alg_id > 1 && !req->ei.key_len) { - ho_fail(HO_RESULT_ERROR, "Chosen Encryption Algorithm (Serving) reflects A5/%u" - " but there is no key (Encryption Information)", info.encr.alg_id - 1); + /* Figure out the encryption algorithm */ + chosen_a5_n = select_best_cipher(req->ei_as_bitmask, bsc_gsmnet->a5_encryption_mask); + if (chosen_a5_n < 0) { + ho_fail(HO_RESULT_FAIL_RR_HO_FAIL, + "There is no A5 encryption mode that both BSC and MSC permit: MSC 0x%x & BSC 0x%x = 0", + req->ei_as_bitmask, bsc_gsmnet->a5_encryption_mask); + return; + } + if (chosen_a5_n > 0 && !req->ei.key_len) { + /* There is no key. Is A5/0 permitted? */ + if ((req->ei_as_bitmask & bsc_gsmnet->a5_encryption_mask & 0x1) == 0x1) { + chosen_a5_n = 0; + } else { + ho_fail(HO_RESULT_ERROR, + "Encryption is required, but there is no key (Encryption Information)"); return; } } - if (req->ei.key_len) { + /* Put encryption info in the chan activation info */ + info.encr.alg_a5_n = chosen_a5_n; + if (chosen_a5_n > 0) { if (req->ei.key_len > sizeof(info.encr.key)) { - ho_fail(HO_RESULT_ERROR, "Encryption Information IE key length is too large: %u\n", + ho_fail(HO_RESULT_ERROR, "Encryption Information IE key length is too large: %u", req->ei.key_len); return; } @@ -902,7 +933,7 @@ ho_perf_params.chosen_channel_present = true; /* Chosen Encryption Algorithm 3.2.2.44 */ - ho_perf_params.chosen_encr_alg = lchan->encr.alg_id; + ho_perf_params.chosen_encr_alg = ALG_A5_NR_TO_BSSAP(lchan->encr.alg_a5_n); ho_perf_params.chosen_encr_alg_present = true; if (ho->new_lchan->activate.info.requires_voice_stream) { @@ -965,7 +996,7 @@ result = bsc_tx_bssmap_ho_complete(conn, ho->new_lchan); } /* Not 'else': above checks may still result in HO_RESULT_ERROR. */ - if (result == HO_RESULT_ERROR) { + if (result != HO_RESULT_OK) { /* Return a BSSMAP Handover Failure, as described in 3GPP TS 48.008 3.1.5.2.2 * "Handover Resource Allocation Failure" */ bsc_tx_bssmap_ho_failure(conn); @@ -1185,6 +1216,7 @@ struct handover *ho = &conn->ho; struct msgb *rr_ho_cmd = gsm48_make_ho_cmd(ho->new_lchan, + ho->scope, ho->async, ho->new_lchan->ms_power, ho->ho_ref); if (!rr_ho_cmd) {
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/lchan_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/lchan_fsm.c
Changed
@@ -204,6 +204,23 @@ return; lchan->activate.concluded = true; + /* Set active state timekeeping markers. */ + osmo_clock_gettime(CLOCK_MONOTONIC, &lchan->active_start); + lchan->active_stored = lchan->active_start; + + /* Increment rate counters tracking fully established lchans. */ + switch (lchan->type) { + case GSM_LCHAN_TCH_H: + case GSM_LCHAN_TCH_F: + rate_ctr_inc(rate_ctr_group_get_ctr(lchan->ts->trx->bts->bts_ctrs, BTS_CTR_CHAN_TCH_FULLY_ESTABLISHED)); + break; + case GSM_LCHAN_SDCCH: + rate_ctr_inc(rate_ctr_group_get_ctr(lchan->ts->trx->bts->bts_ctrs, BTS_CTR_CHAN_SDCCH_FULLY_ESTABLISHED)); + break; + default: + break; + } + switch (lchan->activate.info.activ_for) { case ACTIVATE_FOR_MS_CHANNEL_REQUEST: /* No signalling to do here, MS is free to use the channel, and should go on to connect @@ -478,8 +495,11 @@ { LOG_LCHAN(lchan, LOGL_DEBUG, "Clearing lchan state\n"); - if (lchan->conn) - gscon_forget_lchan(lchan->conn, lchan); + if (lchan->conn) { + struct gsm_subscriber_connection *conn = lchan->conn; + lchan_forget_conn(lchan); + gscon_forget_lchan(conn, lchan); + } if (lchan->rqd_ref) { talloc_free(lchan->rqd_ref); @@ -516,15 +536,20 @@ struct gsm_lchan *lchan = lchan_fi_lchan(fi); struct gsm_bts *bts = lchan->ts->trx->bts; lchan_reset(lchan); + chan_counts_ts_update(lchan->ts); osmo_fsm_inst_dispatch(lchan->ts->fi, TS_EV_LCHAN_UNUSED, lchan); - bsc_update_time_cc_all_allocated(bts->network); - /* Poll the channel request queue, so that waiting calls can make use of the lchan that just * has become unused now. */ abis_rsl_chan_rqd_queue_poll(bts); } +static void lchan_fsm_cbch_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + chan_counts_ts_update(lchan->ts); +} + static void lchan_fsm_wait_after_error_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_lchan *lchan = lchan_fi_lchan(fi); @@ -700,7 +725,7 @@ return; } - bsc_update_time_cc_all_allocated(bts->network); + chan_counts_ts_update(lchan->ts); lchan->conn = info->for_conn; @@ -747,7 +772,7 @@ : "none", gsm_lchant_name(lchan->type), gsm48_chan_mode_name(lchan->activate.ch_mode_rate.chan_mode), - (lchan->activate.info.encr.alg_id ? : 1)-1, + lchan->activate.info.encr.alg_a5_n, lchan->activate.info.encr.key_len ? osmo_hexdump_nospc(lchan->activate.info.encr.key, lchan->activate.info.encr.key_len) : "none"); @@ -1195,11 +1220,17 @@ lchan->sapissapi = LCHAN_SAPI_UNUSED; rll_indication(lchan, link_id, BSC_RLLR_IND_REL_IND); - /* Releasing SAPI 0 means the conn becomes invalid; but not if the link_id contains a TCH flag. - * (TODO: is this the correct interpretation?) */ + /* Releasing SAPI 0 means the conn becomes invalid; but not if the link_id contains a SACCH flag. */ if (lchan->conn && sapi == 0 && !(link_id & 0xc0)) { LOG_LCHAN(lchan, LOGL_DEBUG, "lchan is releasing\n"); gscon_lchan_releasing(lchan->conn, lchan); + + /* if SAPI=0 is gone, it makes no sense if other SAPIs are still around, + * this is not a valid configuration and we should forget about them. + * This is particularly relevant in case of Ericsson RBS6000, which doesn't + * seem to send a RLL_REL_IND for SAPI=3 if there was already one for SAPI=0 */ + for_each_active_sapi(sapi, 1, lchan) + lchan->sapissapi = LCHAN_SAPI_UNUSED; } /* The caller shall check whether all SAPIs are released and cause a state chg */ @@ -1392,8 +1423,9 @@ * lchan_reset(), we make sure it does. But in case of releases from error handling, the * conn might as well notice now already that its lchan is becoming unusable. */ if (lchan->conn) { - gscon_forget_lchan(lchan->conn, lchan); + struct gsm_subscriber_connection *conn = lchan->conn; lchan_forget_conn(lchan); + gscon_forget_lchan(conn, lchan); } rc = rsl_tx_rf_chan_release(lchan); @@ -1463,6 +1495,7 @@ /* The actual action besides all the beancounting above */ lchan_reset(lchan); + chan_counts_ts_update(lchan->ts); } static void lchan_fsm_borken(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -1536,6 +1569,7 @@ }, LCHAN_ST_CBCH = { .name = "CBCH", + .onenter = lchan_fsm_cbch_onenter, .out_state_mask = 0 | S(LCHAN_ST_UNUSED) ,
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/lchan_rtp_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/lchan_rtp_fsm.c
Changed
@@ -522,6 +522,12 @@ lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_ROLLBACK); return; + case LCHAN_RTP_EV_READY_TO_SWITCH_RTP: + /* Ignore / silence an "event not permitted" error. In case of an inter-BSC incoming handover, there is + * no previous lchan to be switched over, and we are already in this state when the usual handover code + * path emits this event. */ + return; + default: OSMO_ASSERT(false); } @@ -704,6 +710,7 @@ | S(LCHAN_RTP_EV_ESTABLISHED) | S(LCHAN_RTP_EV_RELEASE) | S(LCHAN_RTP_EV_ROLLBACK) + | S(LCHAN_RTP_EV_READY_TO_SWITCH_RTP) , .out_state_mask = 0 | S(LCHAN_RTP_ST_ESTABLISHED)
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/lcs_loc_req.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/lcs_loc_req.c
Changed
@@ -104,7 +104,7 @@ { struct tlv_parsed tp_arr1; struct tlv_parsed *tp = &tp_arr0; - struct tlv_p_entry *e; + const struct tlv_p_entry *e; int payload_length; #define PARSE_ERR(ERRMSG) do { \ @@ -127,6 +127,29 @@ lcs_loc_req->req.cell_id_present = true; } + /* 3GPP TS 49.031, section 10.14 (C) "LCS Client Type" */ + if (TLVP_PRES_LEN(tp, GSM0808_IE_LCS_CLIENT_TYPE, 1)) { + lcs_loc_req->req.client_type = *TLVP_VAL(tp, GSM0808_IE_LCS_CLIENT_TYPE); + lcs_loc_req->req.client_type_present = true; + } else if (lcs_loc_req->req.location_type.location_information == BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC) + PARSE_ERR("Missing LCS Client Type IE"); + + /* 3GPP TS 49.031, section 10.15 (O) "LCS Priority" */ + if (TLVP_PRES_LEN(tp, GSM0808_IE_LCS_PRIORITY, 1)) { + lcs_loc_req->req.priority = *TLVP_VAL(tp, GSM0808_IE_LCS_PRIORITY); + lcs_loc_req->req.priority_present = true; + } + + /* 3GPP TS 49.031, section 10.16 (C) "LCS QoS" */ + if (TLVP_PRES_LEN(tp, GSM0808_IE_LCS_QOS, sizeof(lcs_loc_req->req.qos))) { + size_t qos_len = TLVP_LEN(tp, GSM0808_IE_LCS_QOS); + if (qos_len > sizeof(lcs_loc_req->req.qos)) + qos_len = sizeof(lcs_loc_req->req.qos); + memcpy(&lcs_loc_req->req.qos, TLVP_VAL(tp, GSM0808_IE_LCS_QOS), qos_len); + lcs_loc_req->req.qos_present = true; + } else if (lcs_loc_req->req.location_type.location_information == BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC) + PARSE_ERR("Missing LCS QoS IE"); + if ((e = TLVP_GET(tp, GSM0808_IE_IMSI))) { if (osmo_mobile_identity_decode(&lcs_loc_req->req.imsi, e->val, e->len, false) || lcs_loc_req->req.imsi.type != GSM_MI_TYPE_IMSI) @@ -139,8 +162,6 @@ PARSE_ERR("Failed to parse IMEI IE"); } - // FIXME LCS QoS IE is mandatory for requesting the location - /* A lot of IEs remain ignored... */ return true; @@ -300,6 +321,17 @@ .cell_id = lcs_loc_req->req.cell_id, .imsi = lcs_loc_req->req.imsi, .imei = lcs_loc_req->req.imei, + + .lcs_client_type_present = lcs_loc_req->req.client_type_present, + .lcs_client_type = lcs_loc_req->req.client_type, + + .more_items = true, + + .lcs_priority_present = lcs_loc_req->req.priority_present, + .lcs_priority = lcs_loc_req->req.priority, + + .lcs_qos_present = lcs_loc_req->req.qos_present, + .lcs_qos = lcs_loc_req->req.qos, }, }, };
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/lcs_ta_req.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/lcs_ta_req.c
Changed
@@ -122,17 +122,6 @@ return; } - paging = (struct bsc_paging_params){ - .reason = BSC_PAGING_FOR_LCS, - .msc = loc_req->conn->sccp.msc, - .bsub = loc_req->conn->bsub, - .tmsi = GSM_RESERVED_TMSI, - .imsi = loc_req->req.imsi, - .chan_needed = RSL_CHANNEED_ANY, - }; - if (paging.bsub) - bsc_subscr_get(paging.bsub, BSUB_USE_PAGING_START); - /* Do we already have an active lchan with knowledge of TA? */ lchan = loc_req->conn->lchan; if (lchan) { @@ -147,6 +136,17 @@ return; } + paging = (struct bsc_paging_params){ + .reason = BSC_PAGING_FOR_LCS, + .msc = loc_req->conn->sccp.msc, + .bsub = loc_req->conn->bsub, + .tmsi = GSM_RESERVED_TMSI, + .imsi = loc_req->req.imsi, + .chan_needed = RSL_CHANNEED_ANY, + }; + if (paging.bsub) + bsc_subscr_get(paging.bsub, BSUB_USE_PAGING_START); + if (!loc_req->req.cell_id_present) { LOG_LCS_TA_REQ(lcs_ta_req, LOGL_DEBUG, "No Cell Identity in BSSMAP Location Request, paging entire BSS\n");
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/net_init.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/net_init.c
Changed
@@ -27,6 +27,7 @@ #include <osmocom/bsc/neighbor_ident.h> static struct osmo_tdef gsm_network_T_defs = { + { .T=4, .default_val=5, .desc="Timeout to receive BSSMAP RESET ACKNOWLEDGE from the MSC" }, { .T=7, .default_val=10, .desc="inter-BSC/MSC Handover outgoing, BSSMAP HO Required to HO Command timeout" }, { .T=8, .default_val=10, .desc="inter-BSC/MSC Handover outgoing, BSSMAP HO Command to final Clear timeout" }, { .T=10, .default_val=6, .desc="RR Assignment" }, @@ -70,6 +71,7 @@ .desc = "Forget-sum period for all_allocated:* rate counters:" " after this amount of idle time, forget internally cumulated time remainders. Zero to always" " keep remainders. See also X16, X17." }, + { .T=-25, .default_val=5, .desc="Timeout for initial user data after an MSC initiated an SCCP connection to the BSS" }, { .T=-3111, .default_val=4, .desc="Wait time after lchan was released in error (should be T3111 + 2s)" }, { .T=-3210, .default_val=20, .desc="After L3 Complete, wait for MSC to confirm" }, {}
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_bb_transc_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_bb_transc_fsm.c
Changed
@@ -40,6 +40,18 @@ #define nm_bb_transc_fsm_state_chg(fi, NEXT_STATE) \ osmo_fsm_inst_state_chg(fi, NEXT_STATE, 0, 0) +static inline void nm_bb_transc_fsm_becomes_enabled(struct gsm_bts_bb_trx *bb_transc) +{ + struct gsm_bts_trx *trx = gsm_bts_bb_trx_get_trx(bb_transc); + nm_obj_fsm_becomes_enabled_disabled(trx->bts, bb_transc, NM_OC_BASEB_TRANSC, true); +} + +static inline void nm_bb_transc_fsm_becomes_disabled(struct gsm_bts_bb_trx *bb_transc) +{ + struct gsm_bts_trx *trx = gsm_bts_bb_trx_get_trx(bb_transc); + nm_obj_fsm_becomes_enabled_disabled(trx->bts, bb_transc, NM_OC_BASEB_TRANSC, false); +} + ////////////////////////// // FSM STATE ACTIONS ////////////////////////// @@ -57,14 +69,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /*should not happen... */ nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED); @@ -86,7 +98,7 @@ } } -static void configure_loop(struct gsm_bts_bb_trx *bb_transc, struct gsm_nm_state *state, bool allow_opstart) +static void configure_loop(struct gsm_bts_bb_trx *bb_transc, const struct gsm_nm_state *state, bool allow_opstart) { struct gsm_bts_trx *trx = gsm_bts_bb_trx_get_trx(bb_transc); @@ -139,7 +151,7 @@ { struct gsm_bts_bb_trx *bb_transc = (struct gsm_bts_bb_trx *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_GET_ATTR_REP: @@ -149,7 +161,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED); @@ -179,8 +191,6 @@ { struct gsm_bts_bb_trx *bb_transc = (struct gsm_bts_bb_trx *)fi->priv; - /* Warning: In here we may be acessing an state older than new_state - from prev (syncrhonous) FSM state */ configure_loop(bb_transc, &bb_transc->mo.nm_state, true); } @@ -189,7 +199,7 @@ struct gsm_bts_bb_trx *bb_transc = (struct gsm_bts_bb_trx *)fi->priv; struct gsm_bts_trx *trx = gsm_bts_bb_trx_get_trx(bb_transc); struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_GET_ATTR_REP: @@ -199,7 +209,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED); return; @@ -243,29 +253,35 @@ bb_transc->mo.get_attr_rep_received = false; bb_transc->mo.opstart_sent = false; bb_transc->mo.adm_unlock_sent = false; + + nm_bb_transc_fsm_becomes_enabled(bb_transc); } static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_bts_bb_trx *bb_transc = (struct gsm_bts_bb_trx *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) return; switch (new_state->availability) { /* operational = DISABLED */ case NM_AVSTATE_NOT_INSTALLED: case NM_AVSTATE_POWER_OFF: + nm_bb_transc_fsm_becomes_disabled(bb_transc); nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_DISABLED_NOTINSTALLED); return; case NM_AVSTATE_DEPENDENCY: + nm_bb_transc_fsm_becomes_disabled(bb_transc); nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_DISABLED_DEPENDENCY); return; case NM_AVSTATE_OFF_LINE: case NM_AVSTATE_OK: + nm_bb_transc_fsm_becomes_disabled(bb_transc); nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_DISABLED_OFFLINE); return; default: @@ -287,8 +303,11 @@ bb_transc->mo.opstart_sent = false; break; case NM_EV_OML_DOWN: - if (fi->state != NM_BB_TRANSC_ST_OP_DISABLED_NOTINSTALLED) + if (fi->state != NM_BB_TRANSC_ST_OP_DISABLED_NOTINSTALLED) { + if (fi->state == NM_BB_TRANSC_ST_OP_ENABLED) + nm_bb_transc_fsm_becomes_disabled(bb_transc); nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_DISABLED_NOTINSTALLED); + } break; default: OSMO_ASSERT(0);
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_bts_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_bts_fsm.c
Changed
@@ -59,14 +59,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /*should not happen... */ nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED); @@ -88,7 +88,8 @@ } } -static void configure_loop(struct gsm_bts *bts, struct gsm_nm_state *state, bool allow_opstart) { +static void configure_loop(struct gsm_bts *bts, const struct gsm_nm_state *state, bool allow_opstart) +{ struct msgb *msgb; /* Request generic BTS-level attributes */ @@ -105,7 +106,7 @@ if (bts->mo.get_attr_rep_received && !bts->mo.set_attr_sent && !bts->mo.set_attr_ack_received) { bts->mo.set_attr_sent = true; - msgb = nanobts_attr_bts_get(bts); + msgb = nanobts_gen_set_bts_attr(bts); abis_nm_set_bts_attr(bts, msgb->data, msgb->len); msgb_free(msgb); } @@ -163,7 +164,7 @@ { struct gsm_bts *bts = (struct gsm_bts *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_GET_ATTR_REP: @@ -176,7 +177,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED); @@ -206,8 +207,6 @@ { struct gsm_bts *bts = (struct gsm_bts *)fi->priv; - /* Warning: In here we may be acessing an state older than new_state - from prev (syncrhonous) FSM state */ configure_loop(bts, &bts->mo.nm_state, true); } @@ -215,7 +214,7 @@ { struct gsm_bts *bts = (struct gsm_bts *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_GET_ATTR_REP: @@ -228,7 +227,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED); return; @@ -279,12 +278,12 @@ static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) return; switch (new_state->availability) { /* operational = DISABLED */ @@ -366,15 +365,15 @@ .action = st_op_disabled_offline, }, NM_BTS_ST_OP_ENABLED = { - .in_event_mask = - X(NM_EV_STATE_CHG_REP), - .out_state_mask = - X(NM_BTS_ST_OP_DISABLED_NOTINSTALLED) | - X(NM_BTS_ST_OP_DISABLED_DEPENDENCY) | - X(NM_BTS_ST_OP_DISABLED_OFFLINE), - .name = "ENABLED", - .onenter = st_op_enabled_on_enter, - .action = st_op_enabled, + .in_event_mask = + X(NM_EV_STATE_CHG_REP), + .out_state_mask = + X(NM_BTS_ST_OP_DISABLED_NOTINSTALLED) | + X(NM_BTS_ST_OP_DISABLED_DEPENDENCY) | + X(NM_BTS_ST_OP_DISABLED_OFFLINE), + .name = "ENABLED", + .onenter = st_op_enabled_on_enter, + .action = st_op_enabled, }, };
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_bts_sm_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_bts_sm_fsm.c
Changed
@@ -57,14 +57,14 @@ struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv; struct gsm_bts *bts = gsm_bts_sm_get_bts(site_mgr); struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* nanobts always go directly into Reported ENABLED state during startup, but we still need to OPSTART it, otherwise it won't @@ -102,12 +102,12 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED); return; @@ -142,12 +142,12 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED); return; @@ -173,12 +173,12 @@ static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) return; switch (new_state->availability) { /* operational = DISABLED */
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_channel_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_channel_fsm.c
Changed
@@ -58,14 +58,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /*should not happen... */ nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_ENABLED); @@ -87,7 +87,7 @@ } } -static void configure_loop(struct gsm_bts_trx_ts *ts, struct gsm_nm_state *state, bool allow_opstart) +static void configure_loop(struct gsm_bts_trx_ts *ts, const struct gsm_nm_state *state, bool allow_opstart) { enum abis_nm_chan_comb ccomb; struct gsm_bts_trx *trx = ts->trx; @@ -128,7 +128,7 @@ { struct gsm_bts_trx_ts *ts = (struct gsm_bts_trx_ts *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -138,7 +138,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_ENABLED); @@ -168,8 +168,6 @@ { struct gsm_bts_trx_ts *ts = (struct gsm_bts_trx_ts *)fi->priv; - /* Warning: In here we may be acessing an state older than new_state - from prev (syncrhonous) FSM state */ configure_loop(ts, &ts->mo.nm_state, true); } @@ -177,7 +175,7 @@ { struct gsm_bts_trx_ts *ts = (struct gsm_bts_trx_ts *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -187,7 +185,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_ENABLED); return; @@ -236,12 +234,12 @@ static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) return; switch (new_state->availability) { /* operational = DISABLED */
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_common_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_common_fsm.c
Changed
@@ -21,6 +21,7 @@ */ #include <osmocom/bsc/nm_common_fsm.h> +#include <osmocom/bsc/signal.h> const struct value_string nm_fsm_event_names = { { NM_EV_SW_ACT_REP, "SW_ACT_REP" }, @@ -34,3 +35,17 @@ { NM_EV_FEATURE_NEGOTIATED, "FEATURE_NEGOTIATED" }, { 0, NULL } }; + +void nm_obj_fsm_becomes_enabled_disabled(struct gsm_bts *bts, void *obj, + enum abis_nm_obj_class obj_class, bool running) +{ + struct nm_running_chg_signal_data nsd; + + memset(&nsd, 0, sizeof(nsd)); + nsd.bts = bts; + nsd.obj_class = obj_class; + nsd.obj = obj; + nsd.running = running; + + osmo_signal_dispatch(SS_NM, S_NM_RUNNING_CHG, &nsd); +}
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_gprs_cell_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_gprs_cell_fsm.c
Changed
@@ -57,14 +57,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_ENABLED); @@ -86,7 +86,8 @@ } } -static void configure_loop(struct gsm_gprs_cell *cell, struct gsm_nm_state *state, bool allow_opstart) { +static void configure_loop(struct gsm_gprs_cell *cell, const struct gsm_nm_state *state, bool allow_opstart) +{ struct msgb *msgb; struct gsm_bts *bts = container_of(cell, struct gsm_bts, gprs.cell); @@ -95,7 +96,7 @@ if (!cell->mo.set_attr_sent && !cell->mo.set_attr_ack_received) { cell->mo.set_attr_sent = true; - msgb = nanobts_attr_cell_get(bts); + msgb = nanobts_gen_set_cell_attr(bts); OSMO_ASSERT(msgb); abis_nm_ipaccess_set_attr(bts, NM_OC_GPRS_CELL, bts->bts_nr, 0, 0xff, msgb->data, msgb->len); @@ -137,7 +138,7 @@ { struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -147,7 +148,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_ENABLED); @@ -177,8 +178,6 @@ { struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv; - /* Warning: In here we may be acessing an state older than new_state - from prev (syncrhonous) FSM state */ configure_loop(cell, &cell->mo.nm_state, true); } @@ -187,7 +186,7 @@ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv; struct gsm_bts *bts = container_of(cell, struct gsm_bts, gprs.cell); struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -197,7 +196,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_ENABLED); return; @@ -246,12 +245,12 @@ static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) return; switch (new_state->availability) { /* operational = DISABLED */
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_gprs_nse_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_gprs_nse_fsm.c
Changed
@@ -58,14 +58,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_gprs_nse_fsm_state_chg(fi, NM_GPRS_NSE_ST_OP_ENABLED); @@ -87,14 +87,15 @@ } } -static void configure_loop(struct gsm_gprs_nse *nse, struct gsm_nm_state *state, bool allow_opstart) { +static void configure_loop(struct gsm_gprs_nse *nse, const struct gsm_nm_state *state, bool allow_opstart) +{ struct msgb *msgb; struct gsm_bts_sm *bts_sm = container_of(nse, struct gsm_bts_sm, gprs.nse); struct gsm_bts *bts = gsm_bts_sm_get_bts(bts_sm); if (!nse->mo.set_attr_sent && !nse->mo.set_attr_ack_received) { nse->mo.set_attr_sent = true; - msgb = nanobts_attr_nse_get(bts_sm); + msgb = nanobts_gen_set_nse_attr(bts_sm); abis_nm_ipaccess_set_attr(bts, NM_OC_GPRS_NSE, bts->bts_nr, 0xff, 0xff, msgb->data, msgb->len); @@ -138,7 +139,7 @@ { struct gsm_gprs_nse *nse = (struct gsm_gprs_nse *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -148,7 +149,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_gprs_nse_fsm_state_chg(fi, NM_GPRS_NSE_ST_OP_ENABLED); @@ -178,8 +179,6 @@ { struct gsm_gprs_nse *nse = (struct gsm_gprs_nse *)fi->priv; - /* Warning: In here we may be acessing an state older than new_state - from prev (syncrhonous) FSM state */ configure_loop(nse, &nse->mo.nm_state, true); } @@ -188,7 +187,7 @@ struct gsm_gprs_nse *nse = (struct gsm_gprs_nse *)fi->priv; struct gsm_bts_sm *bts_sm = container_of(nse, struct gsm_bts_sm, gprs.nse); struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -198,7 +197,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_gprs_nse_fsm_state_chg(fi, NM_GPRS_NSE_ST_OP_ENABLED); return; @@ -247,12 +246,12 @@ static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) return; switch (new_state->availability) { /* operational = DISABLED */
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_gprs_nsvc_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_gprs_nsvc_fsm.c
Changed
@@ -59,7 +59,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_FEATURE_NEGOTIATED: @@ -68,7 +68,7 @@ break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_gprs_nsvc_fsm_state_chg(fi, NM_GPRS_NSVC_ST_OP_ENABLED); @@ -90,7 +90,8 @@ } } -static void configure_loop(struct gsm_gprs_nsvc *nsvc, struct gsm_nm_state *state, bool allow_opstart) { +static void configure_loop(struct gsm_gprs_nsvc *nsvc, const struct gsm_nm_state *state, bool allow_opstart) +{ struct msgb *msgb; if (nsvc->bts->gprs.mode == BTS_GPRS_NONE) @@ -107,7 +108,7 @@ return; } nsvc->mo.set_attr_sent = true; - msgb = nanobts_attr_nsvc_get(nsvc->bts); + msgb = nanobts_gen_set_nsvc_attr(nsvc->bts); OSMO_ASSERT(msgb); abis_nm_ipaccess_set_attr(nsvc->bts, NM_OC_GPRS_NSVC, nsvc->bts->bts_nr, nsvc->id, 0xff, msgb->data, msgb->len); @@ -150,7 +151,7 @@ { struct gsm_gprs_nsvc *nsvc = (struct gsm_gprs_nsvc *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_FEATURE_NEGOTIATED: @@ -163,7 +164,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_gprs_nsvc_fsm_state_chg(fi, NM_GPRS_NSVC_ST_OP_ENABLED); @@ -193,8 +194,6 @@ { struct gsm_gprs_nsvc *nsvc = (struct gsm_gprs_nsvc *)fi->priv; - /* Warning: In here we may be acessing an state older than new_state - from prev (syncrhonous) FSM state */ configure_loop(nsvc, &nsvc->mo.nm_state, true); } @@ -202,7 +201,7 @@ { struct gsm_gprs_nsvc *nsvc = (struct gsm_gprs_nsvc *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_FEATURE_NEGOTIATED: @@ -215,7 +214,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_gprs_nsvc_fsm_state_chg(fi, NM_GPRS_NSVC_ST_OP_ENABLED); return; @@ -264,12 +263,12 @@ static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) return; switch (new_state->availability) { /* operational = DISABLED */
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/nm_rcarrier_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/nm_rcarrier_fsm.c
Changed
@@ -40,6 +40,16 @@ #define nm_rcarrier_fsm_state_chg(fi, NEXT_STATE) \ osmo_fsm_inst_state_chg(fi, NEXT_STATE, 0, 0) +static inline void nm_rcarrier_fsm_becomes_enabled(struct gsm_bts_trx *trx) +{ + nm_obj_fsm_becomes_enabled_disabled(trx->bts, trx, NM_OC_RADIO_CARRIER, true); +} + +static inline void nm_rcarrier_fsm_becomes_disabled(struct gsm_bts_trx *trx) +{ + nm_obj_fsm_becomes_enabled_disabled(trx->bts, trx, NM_OC_RADIO_CARRIER, false); +} + ////////////////////////// // FSM STATE ACTIONS ////////////////////////// @@ -57,14 +67,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /*should not happen... */ nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_ENABLED); @@ -86,13 +96,13 @@ } } -static void configure_loop(struct gsm_bts_trx *trx, struct gsm_nm_state *state, bool allow_opstart) +static void configure_loop(struct gsm_bts_trx *trx, const struct gsm_nm_state *state, bool allow_opstart) { struct msgb *msgb; if (!trx->mo.set_attr_sent && !trx->mo.set_attr_ack_received) { trx->mo.set_attr_sent = true; - msgb = nanobts_attr_radio_get(trx->bts, trx); + msgb = nanobts_gen_set_radio_attr(trx->bts, trx); abis_nm_set_radio_attr(trx, msgb->data, msgb->len); msgb_free(msgb); } @@ -134,7 +144,7 @@ { struct gsm_bts_trx *trx = (struct gsm_bts_trx *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -144,7 +154,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { /* should not happen... */ nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_ENABLED); @@ -174,8 +184,6 @@ { struct gsm_bts_trx *trx = (struct gsm_bts_trx *)fi->priv; - /* Warning: In here we may be acessing an state older than new_state - from prev (syncrhonous) FSM state */ configure_loop(trx, &trx->mo.nm_state, true); } @@ -183,7 +191,7 @@ { struct gsm_bts_trx *trx = (struct gsm_bts_trx *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SET_ATTR_ACK: @@ -193,7 +201,7 @@ return; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; + new_state = &nsd->new_state; if (new_state->operational == NM_OPSTATE_ENABLED) { nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_ENABLED); return; @@ -228,29 +236,54 @@ trx->mo.adm_unlock_sent = false; trx->mo.set_attr_ack_received = false; trx->mo.set_attr_sent = false; + + nm_rcarrier_fsm_becomes_enabled(trx); } static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_bts_trx *trx = (struct gsm_bts_trx *)fi->priv; struct nm_statechg_signal_data *nsd; - struct gsm_nm_state *new_state; + const struct gsm_nm_state *new_state; switch (event) { case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; - new_state = nsd->new_state; - if (new_state->operational == NM_OPSTATE_ENABLED) + new_state = &nsd->new_state; + /* Op state stays in Enabled, hence either Avail or Admin changed: */ + if (new_state->operational == NM_OPSTATE_ENABLED) { + /* Some sort of availability change we don't care about: */ + if (nsd->old_state.administrative == new_state->administrative) + return; + /* HACK: Admin state change without Op state change: + * According to TS 52.021 sec 5.3.1, Locking the NM obj should make + * it go into Disabled Dependency state, but current and older + * versions of osmo-bts (and potentially nanobts?) don't move from + * Operative=Enabled state and only change the Adminsitrative one. + * Let's account for this behavior here: */ + switch (new_state->administrative) { + case NM_STATE_LOCKED: + nm_rcarrier_fsm_becomes_disabled(trx); + break; + case NM_STATE_UNLOCKED: + nm_rcarrier_fsm_becomes_enabled(trx); + break; + } return; + } switch (new_state->availability) { /* operational = DISABLED */ case NM_AVSTATE_NOT_INSTALLED: case NM_AVSTATE_POWER_OFF: + nm_rcarrier_fsm_becomes_disabled(trx); nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_DISABLED_NOTINSTALLED); return; case NM_AVSTATE_DEPENDENCY: + nm_rcarrier_fsm_becomes_disabled(trx); nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_DISABLED_DEPENDENCY); return; case NM_AVSTATE_OFF_LINE: case NM_AVSTATE_OK: + nm_rcarrier_fsm_becomes_disabled(trx); nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_DISABLED_OFFLINE); return; default: @@ -278,8 +311,11 @@ trx->mo.force_rf_lock ? NM_STATE_LOCKED : NM_STATE_UNLOCKED); break; case NM_EV_OML_DOWN: - if (fi->state != NM_RCARRIER_ST_OP_DISABLED_NOTINSTALLED) + if (fi->state != NM_RCARRIER_ST_OP_DISABLED_NOTINSTALLED) { + if (fi->state == NM_RCARRIER_ST_OP_ENABLED) + nm_rcarrier_fsm_becomes_disabled(trx); nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_DISABLED_NOTINSTALLED); + } break; default: OSMO_ASSERT(0);
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/osmo_bsc_bssap.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/osmo_bsc_bssap.c
Changed
@@ -63,7 +63,7 @@ int rc; bool old_value = msc->remote_supports_osmux; - rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, length - 1, 0, 0); + rc = osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1); if (rc < 0) LOGP(DMSC, LOGL_NOTICE, "Failed parsing TLV looking for Osmux support\n"); @@ -114,8 +114,7 @@ /* Page a subscriber based on TMSI and LAC via the specified BTS. * The msc parameter is the MSC which issued the corresponding paging request. * Log an error if paging failed. */ -static void -page_subscriber(const struct bsc_paging_params *params, struct gsm_bts *bts, uint32_t lac) +static void page_subscriber(const struct bsc_paging_params *params, struct gsm_bts *bts, uint32_t lac) { int ret; @@ -132,16 +131,14 @@ "Paging request failed, or repeated paging on LAC %u\n", lac); } -static void -page_all_bts(const struct bsc_paging_params *params) +static void page_all_bts(const struct bsc_paging_params *params) { struct gsm_bts *bts; llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) page_subscriber(params, bts, GSM_LAC_RESERVED_ALL_BTS); } -static void -page_cgi(const struct bsc_paging_params *params) +static void page_cgi(const struct bsc_paging_params *params) { int i; for (i = 0; i < params->cil.id_list_len; i++) { @@ -170,8 +167,7 @@ } } -static void -page_lac_and_ci(const struct bsc_paging_params *params) +static void page_lac_and_ci(const struct bsc_paging_params *params) { int i; @@ -193,8 +189,7 @@ } } -static void -page_ci(const struct bsc_paging_params *params) +static void page_ci(const struct bsc_paging_params *params) { int i; @@ -214,8 +209,7 @@ } } -static void -page_lai_and_lac(const struct bsc_paging_params *params) +static void page_lai_and_lac(const struct bsc_paging_params *params) { int i; @@ -242,8 +236,7 @@ } } -static void -page_lac(const struct bsc_paging_params *params) +static void page_lac(const struct bsc_paging_params *params) { int i; @@ -277,7 +270,10 @@ .tmsi = GSM_RESERVED_TMSI, }; - tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); + if (osmo_bssap_tlv_parse(&tp, msg->l4h + 1, payload_length - 1) < 0) { + LOGP(DMSC, LOGL_ERROR, "%s(): tlv_parse() failed\n", __func__); + return -1; + } remain = payload_length - 1; if (!TLVP_PRESENT(&tp, GSM0808_IE_IMSI)) { @@ -400,17 +396,18 @@ return 0; } -/* select the best cipher permitted by the intersection of both masks */ -static int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask) +/* Select the best cipher permitted by the intersection of both masks. Return as the n in A5/n, or -1 if the + * intersection is empty. */ +int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask) { /* A5/7 ... A5/3: We assume higher is better, * but: A5/1 is better than A5/2, which is better than A5/0 */ - const uint8_t codec_strength8 = { 7, 6, 5, 4, 3, 1, 2, 0 }; + const uint8_t codec_by_strength8 = { 7, 6, 5, 4, 3, 1, 2, 0 }; uint8_t intersection = msc_mask & bsc_mask; int i; - for (i = 0; i < ARRAY_SIZE(codec_strength); i++) { - uint8_t codec = codec_strengthi; + for (i = 0; i < ARRAY_SIZE(codec_by_strength); i++) { + uint8_t codec = codec_by_strengthi; if (intersection & (1 << codec)) return codec; } @@ -423,7 +420,10 @@ struct tlv_parsed tp; enum gsm0808_cause cause_0808; - tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, length - 1, 0, 0); + if (osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1) < 0) { + LOGPFSML(conn->fi, LOGL_ERROR, "%s(): tlv_parse() failed\n", __func__); + return -1; + } cause_0808 = gsm0808_get_cause(&tp); if (cause_0808 < 0) { @@ -482,7 +482,11 @@ conn->ciphering_handled = 1; - tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); + if (osmo_bssap_tlv_parse(&tp, msg->l4h + 1, payload_length - 1) < 0) { + LOGPFSML(conn->fi, LOGL_ERROR, "%s(): tlv_parse() failed\n", __func__); + return -1; + } + if (!TLVP_PRESENT(&tp, GSM0808_IE_ENCRYPTION_INFORMATION)) { LOGP(DMSC, LOGL_ERROR, "IE Encryption Information missing.\n"); reject_cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; @@ -516,9 +520,6 @@ * a5_encryption == 2 --> 0x04 ... */ enc_bits_msc = data0; - /* The bit-mask of permitted ciphers from the MSC (sent in ASSIGNMENT COMMAND) is intersected - * with the vty-configured mask a the BSC. Finally, the best (highest) possible cipher is - * chosen. */ chosen_cipher = select_best_cipher(enc_bits_msc, bsc_gsmnet->a5_encryption_mask); if (chosen_cipher < 0) { LOGP(DMSC, LOGL_ERROR, "Reject: no overlapping A5 ciphers between BSC (0x%02x) " @@ -541,7 +542,7 @@ goto reject; } - conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(chosen_cipher); + conn->lchan->encr.alg_a5_n = chosen_cipher; if (enc_key_len) { conn->lchan->encr.key_len = enc_key_len; memcpy(conn->lchan->encr.key, enc_key, enc_key_len); @@ -633,16 +634,14 @@ struct msgb *resp; struct tlv_parsed tp; const uint8_t *config, *control; - int rc; OSMO_ASSERT(conn); - rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, length - 1, 0, 0); - if (rc < 0) { - LOGPFSML(conn->fi, LOGL_ERROR, "Error parsing TLVs of LCLS CONNT CTRL: %s\n", - msgb_hexdump(msg)); - return rc; + if (osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1) < 0) { + LOGPFSML(conn->fi, LOGL_ERROR, "%s(): tlv_parse() failed\n", __func__); + return -1; } + config = TLVP_VAL_MINLEN(&tp, GSM0808_IE_LCLS_CONFIG, 1); control = TLVP_VAL_MINLEN(&tp, GSM0808_IE_LCLS_CONN_STATUS_CTRL, 1); @@ -825,7 +824,10 @@ aoip = gscon_is_aoip(conn); - tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, length - 1, 0, 0); + if (osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1) < 0) { + LOGPFSML(conn->fi, LOGL_ERROR, "%s(): tlv_parse() failed\n", __func__); + return -1; + } /* Check for channel type element, if its missing, immediately reject */ if (!TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_TYPE)) { @@ -990,6 +992,24 @@ return -1; } +/* Handle Handover Request message, part of inter-BSC handover: + * The MSC opened a new SCCP connection and is asking this BSS to accept an inter-BSC incoming handover. + * If we accept, we'll send a Handover Request Acknowledge. + * This function is only called when the Handover Request is *not* included in the initial SCCP N-Connect message, but + * follows an "empty" N-Connect in a separate DT1 message.
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/osmo_bsc_main.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/osmo_bsc_main.c
Changed
@@ -359,24 +359,10 @@ osmo_fsm_inst_dispatch(ts->fi, TS_EV_RSL_READY, NULL); } - /* Start CBCH transmit timer if CBCH is present */ - if (trx->nr == 0 && gsm_bts_get_cbch(trx->bts)) - bts_cbch_timer_schedule(trx->bts); - /* Drop all expired channel requests in the list */ abis_rsl_chan_rqd_queue_flush(trx->bts); } -static void all_ts_dispatch_event(struct gsm_bts_trx *trx, uint32_t event) -{ - int ts_i; - for (ts_i = 0; ts_i < ARRAY_SIZE(trx->ts); ts_i++) { - struct gsm_bts_trx_ts *ts = &trx->tsts_i; - if (ts->fi) - osmo_fsm_inst_dispatch(ts->fi, event, 0); - } -} - struct osmo_timer_list update_connection_stats_timer; /* Periodically call bsc_update_connection_stats() to keep stat items updated. @@ -389,56 +375,6 @@ osmo_timer_schedule(&update_connection_stats_timer, 1, 0); } -static int check_bts(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx; - - if (!bts->model) - return -EFAULT; - - switch (bts->band) { - case GSM_BAND_1800: - if (bts->c0->arfcn < 512 || bts->c0->arfcn > 885) { - LOGP(DNM, LOGL_ERROR, "(bts=%u) GSM1800 channel (%u) must be between 512-885.\n", - bts->nr, bts->c0->arfcn); - return -EINVAL; - } - break; - case GSM_BAND_1900: - if (bts->c0->arfcn < 512 || bts->c0->arfcn > 810) { - LOGP(DNM, LOGL_ERROR, "(bts=%u) GSM1900 channel (%u) must be between 512-810.\n", - bts->nr, bts->c0->arfcn); - } - break; - case GSM_BAND_900: - if ((bts->c0->arfcn > 124 && bts->c0->arfcn < 955) || - bts->c0->arfcn > 1023) { - LOGP(DNM, LOGL_ERROR, "(bts=%u) GSM900 channel (%u) must be between 0-124, 955-1023.\n", - bts->nr, bts->c0->arfcn); - } - break; - case GSM_BAND_850: - if (bts->c0->arfcn < 128 || bts->c0->arfcn > 251) { - LOGP(DNM, LOGL_ERROR, "(bts=%u) GSM850 channel (%u) must be between 128-251.\n", - bts->nr, bts->c0->arfcn); - } - break; - default: - LOGP(DNM, LOGL_ERROR, "(bts=%u) Unsupported frequency band.\n", bts->nr); - } - - /* Verify the physical channel mapping */ - llist_for_each_entry(trx, &bts->trx_list, list) { - if (!trx_has_valid_pchan_config(trx)) { - LOGP(DNM, LOGL_ERROR, "TRX %u has invalid timeslot " - "configuration\n", trx->nr); - return -EINVAL; - } - } - - return 0; -} - static void bootstrap_bts(struct gsm_bts *bts) { unsigned int n = 0; @@ -492,7 +428,7 @@ case S_L_INP_TEI_UP: if (isd->link_type == E1INP_SIGN_OML) { /* Check parameters and apply vty config dependent parameters */ - rc = check_bts(trx->bts); + rc = gsm_bts_check_cfg(trx->bts); if (rc < 0) { LOGP(DNM, LOGL_ERROR, "(bts=%u) Error in BTS configuration -- cannot bootstrap BTS\n", trx->bts->nr); @@ -501,7 +437,7 @@ bootstrap_bts(trx->bts); } if (isd->link_type == E1INP_SIGN_RSL) { - rc = check_bts(trx->bts); + rc = gsm_bts_check_cfg(trx->bts); if (rc < 0) { LOGP(DNM, LOGL_ERROR, "(bts=%u) Error in BTS configuration -- cannot bootstrap RSL\n", trx->bts->nr); @@ -515,13 +451,16 @@ if (isd->link_type == E1INP_SIGN_OML) { rate_ctr_inc(rate_ctr_group_get_ctr(trx->bts->bts_ctrs, BTS_CTR_BTS_OML_FAIL)); - all_ts_dispatch_event(trx, TS_EV_OML_DOWN); + /* ip.access BTS models have a single global A-bis/OML link for all + * transceivers, so once it's lost we need to notify them all. */ + if (is_ipaccess_bts(trx->bts)) + gsm_bts_all_ts_dispatch(trx->bts, TS_EV_OML_DOWN, NULL); + else /* Other BTS models (e.g. Ericsson) have per-TRX OML links */ + gsm_trx_all_ts_dispatch(trx, TS_EV_OML_DOWN, NULL); } else if (isd->link_type == E1INP_SIGN_RSL) { rate_ctr_inc(rate_ctr_group_get_ctr(trx->bts->bts_ctrs, BTS_CTR_BTS_RSL_FAIL)); acc_ramp_abort(&trx->bts->acc_ramp); - all_ts_dispatch_event(trx, TS_EV_RSL_DOWN); - if (trx->nr == 0) - osmo_timer_del(&trx->bts->cbch_timer); + gsm_trx_all_ts_dispatch(trx, TS_EV_RSL_DOWN, NULL); } gsm_bts_sm_mo_reset(trx->bts->site_mgr); @@ -556,7 +495,7 @@ osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { - rc = check_bts(bts); + rc = gsm_bts_check_cfg(bts); if (rc < 0) { LOGP(DNM, LOGL_FATAL, "(bts=%u) cannot bootstrap BTS, invalid BTS configuration\n", bts->nr); return rc; @@ -941,6 +880,7 @@ rate_ctr_init(tall_bsc_ctx); osmo_fsm_set_dealloc_ctx(OTC_SELECT); + osmo_fsm_log_timeouts(true); /* Allocate global gsm_network struct */ rc = bsc_network_alloc(); @@ -983,6 +923,9 @@ assignment_fsm_init(); handover_fsm_init(); lb_init(); + acc_ramp_global_init(); + paging_global_init(); + smscb_global_init(); /* Read the config */ rc = bsc_network_configure(config_file); @@ -1074,6 +1017,7 @@ osmo_init_ignore_signals(); update_connection_stats_cb(NULL); + chan_counts_sig_init(); if (daemonize) { rc = osmo_daemonize();
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/osmo_bsc_msc.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/osmo_bsc_msc.c
Changed
@@ -53,8 +53,9 @@ MSC_CTR_BSSMAP_RX_UDT_UNKNOWN = {"bssmap:rx:udt:err_unknown", "Number of received BSSMAP unknown UDT messages"}, MSC_CTR_BSSMAP_RX_DT1_CLEAR_CMD = {"bssmap:rx:dt1:clear:cmd", "Number of received BSSMAP DT1 CLEAR CMD messages"}, MSC_CTR_BSSMAP_RX_DT1_CIPHER_MODE_CMD = {"bssmap:rx:dt1:cipher_mode:cmd", "Number of received BSSMAP DT1 CIPHER MODE CMD messages"}, - MSC_CTR_BSSMAP_RX_DT1_ASSIGMENT_RQST = {"bssmap:rx:dt1:assignment:rqst", "Number of received BSSMAP DT1 ASSIGMENT RQST messages"}, + MSC_CTR_BSSMAP_RX_DT1_ASSIGNMENT_RQST = {"bssmap:rx:dt1:assignment:rqst", "Number of received BSSMAP DT1 ASSIGNMENT RQST messages"}, MSC_CTR_BSSMAP_RX_DT1_LCLS_CONNECT_CTRL = {"bssmap:rx:dt1:lcls_connect_ctrl:cmd", "Number of received BSSMAP DT1 LCLS CONNECT CTRL messages"}, + MSC_CTR_BSSMAP_RX_DT1_HANDOVER_RQST = {"bssmap:rx:dt1:handover:rqst", "Number of received BSSMAP DT1 HANDOVER RQST messages"}, MSC_CTR_BSSMAP_RX_DT1_HANDOVER_CMD = {"bssmap:rx:dt1:handover:cmd", "Number of received BSSMAP DT1 HANDOVER CMD messages"}, MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST = {"bssmap:rx:dt1:classmark:rqst", "Number of received BSSMAP DT1 CLASSMARK RQST messages"}, MSC_CTR_BSSMAP_RX_DT1_CONFUSION = {"bssmap:rx:dt1:confusion", "Number of received BSSMAP DT1 CONFUSION messages"},
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/paging.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/paging.c
Changed
@@ -58,7 +58,27 @@ void *tall_paging_ctx = NULL; -#define PAGING_TIMER 0, 500000 +/* How many paging requests to Tx on RSL at max before going back to main loop */ +#define MAX_PAGE_REQ_PER_ITER 10 + +#define MAX_TX_DELAY_TIME_SEC 60 + +/* How often to attempt sending new paging requests (initial, not retrans): 250ms */ +static const struct timespec initial_period = { + .tv_sec = 0, + .tv_nsec = 250 * 1000 * 1000, +}; + +/* Minimum period between retransmits of paging req to a subscriber: 500ms */ +static const struct timespec retrans_period = { + .tv_sec = 0, + .tv_nsec = 500 * 1000 * 1000, +}; + +/* If no CCCH Lod Ind is received before this time period, the BTS is considered + * to have stopped sending CCCH Load Indication, probaby due to being under Load + * Threshold: */ +#define bts_no_ccch_load_ind_timeout_sec(bts) ((bts)->ccch_load_ind_period * 2) /* * Kill one paging request update the internal list... @@ -66,10 +86,14 @@ static void paging_remove_request(struct gsm_bts_paging_state *paging_bts, struct gsm_paging_request *to_be_deleted) { + to_be_deleted->bsub->active_paging_requests--; osmo_timer_del(&to_be_deleted->T3113); llist_del(&to_be_deleted->entry); + paging_bts->pending_requests_len--; bsc_subscr_put(to_be_deleted->bsub, BSUB_USE_PAGING_REQUEST); talloc_free(to_be_deleted); + if (llist_empty(&paging_bts->pending_requests)) + osmo_timer_del(&paging_bts->work_timer); } static void page_ms(struct gsm_paging_request *request) @@ -80,9 +104,9 @@ log_set_context(LOG_CTX_BSC_SUBSCR, request->bsub); - LOG_BTS(bts, DPAG, LOGL_INFO, "Going to send paging commands: %s" - " for ch. type %d (attempt %d)\n", bsc_subscr_name(request->bsub), - request->chan_type, request->attempts); + LOG_PAGING_BTS(request, bts, DPAG, LOGL_INFO, + "Going to send paging command for ch. type %d (attempt %d)\n", + request->chan_type, request->attempts); if (request->bsub->tmsi == GSM_RESERVED_TMSI) { mi = (struct osmo_mobile_identity){ @@ -102,24 +126,28 @@ log_set_context(LOG_CTX_BSC_SUBSCR, NULL); } +static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts); + static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts) { - if (llist_empty(&paging_bts->pending_requests)) - return; - + /* paging_handle_pending_requests() will schedule work_timer if work + * needs to be partitioned in several iterations. */ if (!osmo_timer_pending(&paging_bts->work_timer)) - osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER); + paging_handle_pending_requests(paging_bts); } - -static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts); static void paging_give_credit(void *data) { - struct gsm_bts_paging_state *paging_bts = data; - - LOG_BTS(paging_bts->bts, DPAG, LOGL_NOTICE, "No PCH LOAD IND, adding 20 slots)\n"); - paging_bts->available_slots = 20; - paging_handle_pending_requests(paging_bts); + struct gsm_bts_paging_state *paging_bts_st = data; + struct gsm_bts *bts = paging_bts_st->bts; + unsigned int load_ind_timeout = bts_no_ccch_load_ind_timeout_sec(bts); + uint16_t estimated_slots = paging_estimate_available_slots(bts, load_ind_timeout); + LOG_BTS(bts, DPAG, LOGL_INFO, + "Timeout waiting for CCCH Load Indication, assuming BTS is below Load Threshold (available_slots %u -> %u)\n", + paging_bts_st->available_slots, estimated_slots); + paging_bts_st->available_slots = estimated_slots; + paging_schedule_if_needed(paging_bts_st); + osmo_timer_schedule(&bts->paging.credit_timer, load_ind_timeout, 0); } /*! count the number of free channels for given RSL channel type required @@ -181,7 +209,10 @@ */ static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts) { - struct gsm_paging_request *request = NULL; + struct gsm_paging_request *request, *initial_request; + unsigned int num_paged = 0; + struct gsm_bts *bts = paging_bts->bts; + struct timespec now, retrans_ts; /* * Determine if the pending_requests list is empty and @@ -192,43 +223,72 @@ return; } - /* - * In case the BTS does not provide us with load indication and we - * ran out of slots, call an autofill routine. It might be that the - * BTS did not like our paging messages and then we have counted down - * to zero and we do not get any messages. - */ - if (paging_bts->available_slots == 0) { - osmo_timer_setup(&paging_bts->credit_timer, paging_give_credit, - paging_bts); - osmo_timer_schedule(&paging_bts->credit_timer, 5, 0); - return; - } + osmo_clock_gettime(CLOCK_MONOTONIC, &now); + paging_bts->last_sched_ts = now; - request = llist_entry(paging_bts->pending_requests.next, - struct gsm_paging_request, entry); + /* do while loop: Try send at most first MAX_PAGE_REQ_PER_ITER paging + * requests (or before if there are no more available slots). Since + * transmitted requests are re-appended at the end of the list, we check + * until we find the first req again, in order to avoid retransmitting + * repeated requests until next time paging is scheduled. */ + initial_request = llist_first_entry(&paging_bts->pending_requests, + struct gsm_paging_request, entry); + request = initial_request; + do { + /* We run out of available slots. Wait until next CCCH Load Ind + * arrives or credit_timer triggers to keep processing requests. + */ + if (paging_bts->available_slots == 0) { + LOG_PAGING_BTS(request, request->bts, DPAG, LOGL_INFO, + "Paging delayed: waiting for available slots at BTS\n"); + return; + } + + /* we need to determine the number of free channels */ + if (paging_bts->free_chans_need != -1 && + can_send_pag_req(request->bts, request->chan_type) != 0) { + LOG_PAGING_BTS(request, request->bts, DPAG, LOGL_INFO, + "Paging delayed: not enough free channels (<%d)\n", + paging_bts->free_chans_need); + goto sched_next_iter; + } - /* we need to determine the number of free channels */ - if (paging_bts->free_chans_need != -1) { - if (can_send_pag_req(request->bts, request->chan_type) != 0) - goto skip_paging; - } - - /* Skip paging if the bts is down. */ - if (!request->bts->oml_link) - goto skip_paging; - - /* handle the paging request now */ - page_ms(request); - paging_bts->available_slots--; - request->attempts++; - - /* take the current and add it to the back */ - llist_del(&request->entry); - llist_add_tail(&request->entry, &paging_bts->pending_requests); + /* If we reach around back of the queue (retransmitions), check + * if time to retransmit has elapsed. Otherwise, wait until its + * time to retransmit. */ + if (request->attempts > 0) { + timespecadd(&request->last_attempt_ts, &retrans_period, &retrans_ts); + if (timespeccmp(&now, &retrans_ts, <)) { + struct timespec tdiff; + timespecsub(&retrans_ts, &now, &tdiff); + LOG_PAGING_BTS(request, request->bts, DPAG, LOGL_DEBUG, + "Paging delayed: retransmission happens in %lld.%06lds\n", + (long long)tdiff.tv_sec, tdiff.tv_nsec / 1000); + osmo_timer_schedule(&paging_bts->work_timer, tdiff.tv_sec, tdiff.tv_nsec / 1000); + return; + } + } -skip_paging: - osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER); + /* handle the paging request now */ + page_ms(request); + paging_bts->available_slots--; + request->last_attempt_ts = now; + request->attempts++; + num_paged++; +
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/pcu_sock.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/pcu_sock.c
Changed
@@ -15,10 +15,6 @@ * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ #include <stdio.h> @@ -198,9 +194,9 @@ if (rlcc->cs_mask & (1 << GPRS_MCS9)) info_ind->flags |= PCU_IF_FLAG_MCS9; } -#warning "isn't dl_tbf_ext wrong?: * 10 and no ntohs" + /* TODO: isn't dl_tbf_ext wrong?: * 10 and no ntohs */ info_ind->dl_tbf_ext = rlcc->parameterT_DL_TBF_EXT; -#warning "isn't ul_tbf_ext wrong?: * 10 and no ntohs" + /* TODO: isn't ul_tbf_ext wrong?: * 10 and no ntohs */ info_ind->ul_tbf_ext = rlcc->parameterT_UL_TBF_EXT; info_ind->initial_cs = rlcc->initial_cs; info_ind->initial_mcs = rlcc->initial_mcs;
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/power_control.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/power_control.c
Changed
@@ -259,3 +259,218 @@ return 1; } + +/* Default MS/BS Power Control parameters (see 3GPP TS 45.008, table A.1) */ +const struct gsm_power_ctrl_params power_ctrl_params_def = { + /* Static Power Control is the safe default */ + .mode = GSM_PWR_CTRL_MODE_STATIC, + + /* BS Power reduction value / maximum (in dB) */ + .bs_power_val_db = 0, /* no attenuation in static mode */ + .bs_power_max_db = 12, /* up to 12 dB in dynamic mode */ + + /* Power increasing/reducing step size */ + .inc_step_size_db = 4, /* 2, 4, or 6 dB */ + .red_step_size_db = 2, /* 2 or 4 dB */ + + /* RxLev measurement parameters */ + .rxlev_meas = { + .enabled = true, + /* Thresholds for RxLev (see 3GPP TS 45.008, A.3.2.1) */ + .lower_thresh = 32, /* L_RXLEV_XX_P (-78 dBm) */ + .upper_thresh = 38, /* U_RXLEV_XX_P (-72 dBm) */ + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_RXLEV_XX_P */ + .lower_cmp_p = 10, /* P1 as in 3GPP TS 45.008, A.3.2.1 (case a) */ + .lower_cmp_n = 12, /* N1 as in 3GPP TS 45.008, A.3.2.1 (case a) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_RXLEV_XX_P */ + .upper_cmp_p = 19, /* P2 as in 3GPP TS 45.008, A.3.2.1 (case b) */ + .upper_cmp_n = 20, /* N2 as in 3GPP TS 45.008, A.3.2.1 (case b) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, + + /* Hreqave: the period over which an average is produced */ + .h_reqave = 4, /* TODO: investigate a reasonable default value */ + /* Hreqt: the number of averaged results maintained */ + .h_reqt = 6, /* TODO: investigate a reasonable default value */ + }, + + /* RxQual measurement parameters */ + .rxqual_meas = { + .enabled = true, + /* Thresholds for RxQual (see 3GPP TS 45.008, A.3.2.1) */ + .lower_thresh = 3, /* L_RXQUAL_XX_P (0.8% <= BER < 1.6%) */ + .upper_thresh = 0, /* U_RXQUAL_XX_P (BER < 0.2%) */ + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_RXQUAL_XX_P */ + .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_RXQUAL_XX_P */ + .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, + + /* Hreqave: the period over which an average is produced */ + .h_reqave = 4, /* TODO: investigate a reasonable default value */ + /* Hreqt: the number of averaged results maintained */ + .h_reqt = 6, /* TODO: investigate a reasonable default value */ + }, + + /* C/I measurement parameters. + * Target C/I retrieved from "GSM/EDGE: Evolution and Performance" Table 10.3. + * Set lower and upper so that (lower + upper) / 2 is equal or slightly + * above the target. + */ + .ci_fr_meas = { /* FR: Target C/I = 15 dB, Soft blocking threshold = 10 dB */ + .enabled = false, + .lower_thresh = 13, + .upper_thresh = 17, + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_CI_FR_XX_P */ + .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_CI_FR_XX_P */ + .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, + + /* Hreqave: the period over which an average is produced */ + .h_reqave = 4, /* TODO: investigate a reasonable default value */ + /* Hreqt: the number of averaged results maintained */ + .h_reqt = 6, /* TODO: investigate a reasonable default value */ + }, + .ci_hr_meas = { /* HR: Target C/I = 18 dB, Soft blocking threshold = 13 dB */ + .enabled = false, + .lower_thresh = 16, + .upper_thresh = 21, + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_CI_HR_XX_P */ + .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_CI_HR_XX_P */ + .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, + + /* Hreqave: the period over which an average is produced */ + .h_reqave = 4, /* TODO: investigate a reasonable default value */ + /* Hreqt: the number of averaged results maintained */ + .h_reqt = 6, /* TODO: investigate a reasonable default value */ + }, + .ci_amr_fr_meas = { /* AMR-FR: Target C/I = 9 dB, Soft blocking threshold = 4 dB */ + .enabled = false, + .lower_thresh = 7, + .upper_thresh = 11, + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_CI_AMR_FR_XX_P */ + .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_CI_AMR_FR_XX_P */ + .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, + + /* Hreqave: the period over which an average is produced */ + .h_reqave = 4, /* TODO: investigate a reasonable default value */ + /* Hreqt: the number of averaged results maintained */ + .h_reqt = 6, /* TODO: investigate a reasonable default value */ + }, + .ci_amr_hr_meas = { /* AMR-HR: Target C/I = 15 dB, Soft blocking threshold = 10 dB */ + .enabled = false, + .lower_thresh = 13, + .upper_thresh = 17, + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_CI_AMR_HR_XX_P */ + .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_CI_AMR_HR_XX_P */ + .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, + + /* Hreqave: the period over which an average is produced */ + .h_reqave = 4, /* TODO: investigate a reasonable default value */ + /* Hreqt: the number of averaged results maintained */ + .h_reqt = 6, /* TODO: investigate a reasonable default value */ + }, + .ci_sdcch_meas = { /* SDCCH: Target C/I = 14 dB, Soft blocking threshold = 9 dB */ + .enabled = false, + .lower_thresh = 12, + .upper_thresh = 16, + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_CI_SDCCH_XX_P */ + .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_CI_SDCCH_XX_P */ + .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, + + /* Hreqave: the period over which an average is produced */ + .h_reqave = 4, /* TODO: investigate a reasonable default value */ + /* Hreqt: the number of averaged results maintained */ + .h_reqt = 6, /* TODO: investigate a reasonable default value */ + }, + .ci_gprs_meas = { /* GPRS: Target C/I = 20 dB, Soft blocking threshold = 15 dB */ + .enabled = false, + .lower_thresh = 18, + .upper_thresh = 24, + + /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages + * out of LOWER_CMP_N averages are lower than L_CI_GPRS_XX_P */ + .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */ + /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages + * out of UPPER_CMP_N averages are greater than L_CI_GPRS_XX_P */ + .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */ + + /* No averaging (filtering) by default */ + .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE, +
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/smscb.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/smscb.c
Changed
@@ -22,10 +22,12 @@ #include <limits.h> #include <osmocom/core/stats.h> +#include <osmocom/core/utils.h> #include <osmocom/core/select.h> #include <osmocom/core/msgb.h> #include <osmocom/core/talloc.h> #include <osmocom/core/byteswap.h> +#include <osmocom/core/signal.h> #include <osmocom/gsm/cbsp.h> #include <osmocom/gsm/protocol/gsm_23_041.h> @@ -37,11 +39,11 @@ #include <osmocom/bsc/debug.h> #include <osmocom/bsc/gsm_data.h> #include <osmocom/bsc/smscb.h> -#include <osmocom/bsc/vty.h> #include <osmocom/bsc/gsm_04_08_rr.h> #include <osmocom/bsc/lchan_fsm.h> #include <osmocom/bsc/abis_rsl.h> #include <osmocom/bsc/bts.h> +#include <osmocom/bsc/signal.h> /********************************************************************************* * Helper Functions @@ -58,8 +60,6 @@ INIT_LLIST_HEAD(old); } -#define ETWS_PRIM_NOTIF_SIZE 56 - /* Build a ETWS Primary Notification message as per TS 23.041 9.4.1.3 */ static int gen_etws_primary_notification(uint8_t *out, uint16_t serial_nr, uint16_t msg_id, uint16_t warn_type, const uint8_t *sec_info) @@ -71,13 +71,24 @@ osmo_store16be(serial_nr, out); etws->msg_id = osmo_htons(msg_id); etws->warning_type = osmo_htons(warn_type); - - if (sec_info) - memcpy(etws->data, sec_info, ETWS_PRIM_NOTIF_SIZE - sizeof(*etws)); + memcpy(etws->data, sec_info, ETWS_PRIM_NOTIF_SIZE - sizeof(*etws)); return ETWS_PRIM_NOTIF_SIZE; } +static void bts_cbch_init_state(struct bts_smscb_chan_state *cstate, struct gsm_bts *bts) +{ + cstate->bts = bts; + INIT_LLIST_HEAD(&cstate->messages); +} + +void bts_cbch_init(struct gsm_bts *bts) +{ + bts_cbch_init_state(&bts->cbch_basic, bts); + bts_cbch_init_state(&bts->cbch_extended, bts); + osmo_timer_setup(&bts->cbch_timer, &bts_cbch_timer_cb, bts); +} + /*! Obtain SMSCB Channel State for given BTS (basic or extended CBCH) */ struct bts_smscb_chan_state *bts_get_smscb_chan(struct gsm_bts *bts, bool extended) { @@ -244,6 +255,12 @@ llist_add_tail(¢->list, &r_state->num_completed.list); } +static bool etws_msg_id_matches(uint16_t a, uint16_t b) +{ + /* ETWS messages are identified by the twelve most significant bits of the Message ID */ + return (a & 0xFFF0) == (b & 0xFFF0); +} + /*! Iterate over all BTSs, find matching ones, execute command on BTS, add result * to succeeded/failed lists. * \paramin net GSM network in which we operate @@ -384,6 +401,9 @@ page = &smscb->pagei++; msg_param = (struct gsm23041_msg_param_gsm *) &page->data0; + /* ensure we don't overflow in the memcpy below */ + osmo_static_assert(sizeof(*page) > sizeof(*msg_param) + sizeof(cont->data), smscb_space); + /* build 6 byte header according to TS 23.041 9.4.1.2 */ osmo_store16be(wrepl->new_serial_nr, &msg_param->serial_nr); osmo_store16be(wrepl->msg_id, &msg_param->message_id); @@ -393,7 +413,9 @@ OSMO_ASSERT(cont->user_len <= ARRAY_SIZE(cont->data)); OSMO_ASSERT(cont->user_len <= ARRAY_SIZE(page->data) - sizeof(*msg_param)); - memcpy(&msg_param->content, cont->data, cont->user_len); + /* we must not use cont->user_len as length here, as it would truncate any + * possible 7-bit padding at the end. Always copy the whole page */ + memcpy(&msg_param->content, cont->data, sizeof(cont->data)); bytes_used = sizeof(*msg_param) + cont->user_len; /* compute number of valid blocks in page */ page->num_blocks = bytes_used / 22; @@ -454,6 +476,54 @@ return cbsp_tx_decoded(cbc, cbsp); } +/* transmit a CBSP RESTART-INDICATION message stating a cell is operative again */ +int cbsp_tx_restart_bts(struct bsc_cbc_link *cbc, bool is_emerg, struct gsm_bts *bts) +{ + struct osmo_cbsp_decoded *cbsp = osmo_cbsp_decoded_alloc(cbc, CBSP_MSGT_RESTART); + struct osmo_cbsp_cell_ent cell_ent; + + if (is_emerg) + cbsp->u.restart.bcast_msg_type = 0x01; + cbsp->u.restart.recovery_ind = 0x00; /* message data available */ + cbsp->u.restart.cell_list.id_discr = CELL_IDENT_LAC_AND_CI; + + cell_ent = (struct osmo_cbsp_cell_ent){ + .cell_id = { + .lac_and_ci = { + .lac = bts->location_area_code, + .ci = bts->cell_identity, + } + } + }; + llist_add(&cell_ent.list, &cbsp->u.restart.cell_list.list); + + return cbsp_tx_decoded(cbc, cbsp); +} + +/* transmit a CBSP FAILURE-INDICATION message stating all message data was lost for one cell */ +int cbsp_tx_failure_bts(struct bsc_cbc_link *cbc, bool is_emerg, struct gsm_bts *bts) +{ + struct osmo_cbsp_decoded *cbsp = osmo_cbsp_decoded_alloc(cbc, CBSP_MSGT_FAILURE); + struct osmo_cbsp_fail_ent fail_ent; + + if (is_emerg) + cbsp->u.failure.bcast_msg_type = 0x01; + + fail_ent = (struct osmo_cbsp_fail_ent){ + .id_discr = CELL_IDENT_LAC_AND_CI, + .cell_id = { + .lac_and_ci = { + .lac = bts->location_area_code, + .ci = bts->cell_identity, + } + }, + .cause = OSMO_CBSP_CAUSE_CELL_BROADCAST_NOT_OPERATIONAL + }; + llist_add(&fail_ent.list, &cbsp->u.failure.fail_list); + + return cbsp_tx_decoded(cbc, cbsp); +} + /* transmit a CBSP KEEPALIVE COMPLETE to the CBC */ static int tx_cbsp_keepalive_compl(struct bsc_cbc_link *cbc) { @@ -465,25 +535,34 @@ * Per-BTS Processing of CBSP from CBC, called via cbsp_per_bts() *********************************************************************************/ +static void etws_pn_stop(struct gsm_bts *bts, bool timeout) +{ + if (osmo_bts_has_feature(&bts->features, BTS_FEAT_ETWS_PN)) { + LOG_BTS(bts, DCBS, LOGL_NOTICE, "ETWS PN broadcast via PCH disabled (cause=%s)\n", + timeout ? "timeout" : "request"); + rsl_etws_pn_command(bts, RSL_CHAN_PCH_AGCH, NULL, 0); + } + bts->etws.active = false; + if (!timeout) + osmo_timer_del(&bts->etws.timer); +} + /* timer call-back once ETWS warning period has expired */ static void etws_pn_cb(void *data) { struct gsm_bts *bts = (struct gsm_bts *)data; - LOG_BTS(bts, DCBS, LOGL_NOTICE, "ETWS PN Timeout; disabling broadcast via PCH\n"); - rsl_etws_pn_command(bts, RSL_CHAN_PCH_AGCH, NULL, 0); + etws_pn_stop(bts, true); } -static void etws_primary_to_bts(struct gsm_bts *bts, const struct osmo_cbsp_write_replace *wrepl) + +/* the actual "execution" part: Send ETWS to all active lchan in the BTS and via PCH */ +static void bts_send_etws(struct gsm_bts *bts) { - uint8_t etws_primaryETWS_PRIM_NOTIF_SIZE; + struct bts_etws_state *bes = &bts->etws; struct gsm_bts_trx *trx; unsigned int count = 0; int i, j; - gen_etws_primary_notification(etws_primary, wrepl->new_serial_nr, wrepl->msg_id, - wrepl->u.emergency.warning_type, - wrepl->u.emergency.warning_sec_info); - /* iterate over all lchan in each TS in each TRX of this BTS */ llist_for_each_entry(trx, &bts->trx_list, list) { for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { @@ -492,8 +571,8 @@ struct gsm_lchan *lchan = &ts->lchanj; if (!lchan_may_receive_data(lchan)) continue; - gsm48_send_rr_app_info(lchan, 0x1, 0x0, etws_primary,
View file
osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/smscb_vty.c
Added
@@ -0,0 +1,421 @@ +/* CBSP (Cell Broadcast Service Protocol) Handling for OsmoBSC */ +/* + * (C) 2019 by Harald Welte <laforge@gnumonks.org> + * + * 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 Affero 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 <osmocom/bsc/gsm_data.h> +#include <osmocom/bsc/vty.h> +#include <osmocom/bsc/debug.h> +#include <osmocom/bsc/smscb.h> +#include <osmocom/bsc/bsc_msc_data.h> +#include <osmocom/bsc/bts.h> + +#include <osmocom/core/talloc.h> +#include <osmocom/core/socket.h> +#include <osmocom/gsm/cbsp.h> + +/********************************************************************************* + * cbc + *********************************************************************************/ +static struct bsc_cbc_link *vty_cbc_data(struct vty *vty) +{ + return bsc_gsmnet->cbc; +} + +DEFUN(cfg_cbc, cfg_cbc_cmd, + "cbc", "Configure CBSP Link to Cell Broadcast Centre\n") +{ + vty->node = CBC_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_mode, cfg_cbc_mode_cmd, + "mode (server|client|disabled)", + "Set OsmoBSC as CBSP server or client\n" + "CBSP Server: listen for inbound TCP connections from a remote Cell Broadcast Centre\n" + "CBSP Client: establish outbound TCP connection to a remote Cell Broadcast Centre\n" + "Disable CBSP link\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->mode = get_string_value(bsc_cbc_link_mode_names, argv0); + OSMO_ASSERT(cbc->mode >= 0); + + /* Immediately restart/stop CBSP only when coming from a telnet session. The settings from the config file take + * effect in osmo_bsc_main.c's invocation of bsc_cbc_link_restart(). */ + if (vty->type != VTY_FILE) + bsc_cbc_link_restart(); + + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_server, cfg_cbc_server_cmd, + "server", "Configure OsmoBSC's CBSP server role\n") +{ + vty->node = CBC_SERVER_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_server_local_ip, cfg_cbc_server_local_ip_cmd, + "local-ip " VTY_IPV46_CMD, + "Set IP Address to listen on for inbound CBSP from a Cell Broadcast Centre\n" + "IPv4 address\n" "IPv6 address\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + osmo_sockaddr_str_from_str(&cbc->server.local_addr, argv0, cbc->server.local_addr.port); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_server_local_port, cfg_cbc_server_local_port_cmd, + "local-port <1-65535>", + "Set TCP port to listen on for inbound CBSP from a Cell Broadcast Centre\n" + "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->server.local_addr.port = atoi(argv0); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client, cfg_cbc_client_cmd, + "client", "Configure OsmoBSC's CBSP client role\n") +{ + vty->node = CBC_CLIENT_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_remote_ip, cfg_cbc_client_remote_ip_cmd, + "remote-ip " VTY_IPV46_CMD, + "Set IP Address of the Cell Broadcast Centre, to establish CBSP link to\n" + "IPv4 address\n" "IPv6 address\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + osmo_sockaddr_str_from_str(&cbc->client.remote_addr, argv0, cbc->client.remote_addr.port); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_remote_port, cfg_cbc_client_remote_port_cmd, + "remote-port <1-65535>", + "Set TCP port of the Cell Broadcast Centre, to establish CBSP link to\n" + "CBSP port number (Default: " OSMO_STRINGIFY_VAL(CBSP_TCP_PORT) ")\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.remote_addr.port = atoi(argv0); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_local_ip, cfg_cbc_client_local_ip_cmd, + "local-ip " VTY_IPV46_CMD, + "Set local bind address for the outbound CBSP link to the Cell Broadcast Centre\n" + "IPv4 address\n" "IPv6 address\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + osmo_sockaddr_str_from_str(&cbc->client.local_addr, argv0, cbc->client.local_addr.port); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_local_port, cfg_cbc_client_local_port_cmd, + "local-port <1-65535>", + "Set local bind port for the outbound CBSP link to the Cell Broadcast Centre\n" + "port number\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.local_addr.port = atoi(argv0); + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_no_local_ip, cfg_cbc_client_no_local_ip_cmd, + "no local-ip", + NO_STR "Remove local IP address bind config for the CBSP client mode\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.local_addr = (struct osmo_sockaddr_str){ .port = cbc->client.local_addr.port }; + return CMD_SUCCESS; +} + +DEFUN(cfg_cbc_client_no_local_port, cfg_cbc_client_no_local_port_cmd, + "no local-port", + NO_STR "Remove local TCP port bind config for the CBSP client mode\n") +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + cbc->client.local_addr.port = 0; + return CMD_SUCCESS; +} + +static struct cmd_node cbc_node = { + CBC_NODE, + "%s(config-cbc)# ", + 1, +}; + +static struct cmd_node cbc_server_node = { + CBC_SERVER_NODE, + "%s(config-cbc-server)# ", + 1, +}; + +static struct cmd_node cbc_client_node = { + CBC_CLIENT_NODE, + "%s(config-cbc-client)# ", + 1, +}; + +static int config_write_cbc(struct vty *vty) +{ + struct bsc_cbc_link *cbc = vty_cbc_data(vty); + + bool default_server_local; + bool default_client_remote; + bool default_client_local; + + default_server_local = !osmo_sockaddr_str_cmp(&cbc->server.local_addr, + &bsc_cbc_default_server_local_addr); + default_client_remote = !osmo_sockaddr_str_is_set(&cbc->client.remote_addr); + default_client_local = !osmo_sockaddr_str_is_set(&cbc->client.local_addr); + + /* If all reflects default values, skip the 'cbc' section */ + if (cbc->mode == BSC_CBC_LINK_MODE_DISABLED + && default_server_local + && default_client_remote && default_client_local) + return 0; + + vty_out(vty, "cbc%s", VTY_NEWLINE); + vty_out(vty, " mode %s%s", bsc_cbc_link_mode_name(cbc->mode), VTY_NEWLINE); +
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/system_information.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/system_information.c
Changed
@@ -504,20 +504,29 @@ bool pgsm = false; memset(chan_list, 0, 16); - if (bts->band == GSM_BAND_900 - && bts->c0->arfcn >= 1 && bts->c0->arfcn <= 124) + /* According to 3GPP TS 44.018, section 10.5.2.1b.2, only ARFCN values + * in range 1..124 can be encoded using the 'bit map 0' format. */ + if (bts->band == GSM_BAND_900) pgsm = true; + /* Check presence of E-GSM ARFCN 0 */ + if (pgsm && bitvec_get_bit_pos(bv, 0) == ONE) + pgsm = false; + /* Check presence of E-GSM ARFCNs 975..1023 */ + for (i = 975; pgsm && i <= 1023; i++) { + if (bitvec_get_bit_pos(bv, i) == ONE) + pgsm = false; + } + /* P-GSM-only handsets only support 'bit map 0 format' */ if (!bis && !ter && pgsm) { chan_list0 = 0; - for (i = 0; i < bv->data_len*8; i++) { - if (i >= 1 && i <= 124 - && bitvec_get_bit_pos(bv, i)) { - rc = freq_list_bm0_set_arfcn(chan_list, i); - if (rc < 0) - return rc; - } + for (i = 1; i <= 124; i++) { + if (!bitvec_get_bit_pos(bv, i)) + continue; + rc = freq_list_bm0_set_arfcn(chan_list, i); + if (rc < 0) + return rc; } return 0; } @@ -553,7 +562,7 @@ max = i; } - if (max == -1) { + if (arfcns == 0) { /* Empty set, use 'bit map 0 format' */ chan_list0 = 0; return 0; @@ -709,7 +718,7 @@ struct gsm_sysinfo_freq freq1024; memset(freq, 0, sizeof(freq)); - gsm48_decode_freq_list(freq, chan_list, 16, 0xce, 1); + gsm48_decode_freq_list(freq, chan_list, 16, mask, 1); for (i = 0; i < 1024; i++) { if (freqi.mask) { if (!n) @@ -954,6 +963,10 @@ si3->header.skip_indicator = 0; si3->header.system_information = GSM48_MT_RR_SYSINFO_3; + /* The value in bts->si_common.chan_desc may get out of sync with the actual value + * in net->T_defs (e.g. after changing it via the VTY), so we need to sync it here. */ + bts->si_common.chan_desc.t3212 = osmo_tdef_get(bts->network->T_defs, 3212, OSMO_TDEF_CUSTOM, 0); + si3->cell_identity = htons(bts->cell_identity); gsm48_generate_lai2(&si3->lai, bts_lai(bts)); si3->control_channel_desc = bts->si_common.chan_desc; @@ -1057,14 +1070,9 @@ memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); /* ip.access nanoBTS needs l2_plen!! */ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: + if (is_ipaccess_bts(bts)) { *output++ = GSM48_LEN2PLEN(l2_plen); l2_plen++; - break; - default: - break; } si5 = (struct gsm48_system_information_type_5 *) output; @@ -1093,14 +1101,9 @@ memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); /* ip.access nanoBTS needs l2_plen!! */ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: + if (is_ipaccess_bts(bts)) { *output++ = GSM48_LEN2PLEN(l2_plen); l2_plen++; - break; - default: - break; } si5b = (struct gsm48_system_information_type_5bis *) output; @@ -1137,14 +1140,9 @@ memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); /* ip.access nanoBTS needs l2_plen!! */ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: + if (is_ipaccess_bts(bts)) { *output++ = GSM48_LEN2PLEN(l2_plen); l2_plen++; - break; - default: - break; } si5t = (struct gsm48_system_information_type_5ter *) output; @@ -1177,14 +1175,9 @@ memset(&si6_ro_info, 0, sizeof(si6_ro_info)); /* ip.access nanoBTS needs l2_plen!! */ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: + if (is_ipaccess_bts(bts)) { *output++ = GSM48_LEN2PLEN(l2_plen); l2_plen++; - break; - default: - break; } si6 = (struct gsm48_system_information_type_6 *) output; @@ -1201,50 +1194,17 @@ gsm48_set_dtx(&si6->cell_options, bts->dtxu, bts->dtxu, false); /* SI6 Rest Octets: 10.5.2.35a: PCH / NCH info, VBS/VGCS options */ - si6_ro_info.band_indicator_1900 = is_dcs_net(bts); + si6_ro_info.band_indicator_1900 = !is_dcs_net(bts); rc = osmo_gsm48_rest_octets_si6_encode(si6->rest_octets, &si6_ro_info); return l2_plen + rc; } -static struct osmo_gsm48_si13_info si13_default = { - .cell_opts = { - .nmo = GPRS_NMO_II, - .t3168 = 2000, - .t3192 = 1500, - .drx_timer_max = 3, - .bs_cv_max = 15, - .ctrl_ack_type_use_block = true, - .ext_info_present = 0, - .ext_info = { - .egprs_supported = 0, /* overridden in gsm_generate_si() */ - .use_egprs_p_ch_req = 0, /* overridden in generate_si13() */ - .bep_period = 5, - .pfc_supported = 0, - .dtm_supported = 0, - .bss_paging_coordination = 0, - .ccn_active = false, - }, - }, - .pwr_ctrl_pars = { - .alpha = 0, /* a = 0.0 */ - .t_avg_w = 16, - .t_avg_t = 16, - .pc_meas_chan = 0, /* downling measured on CCCH */ - .n_avg_i = 8, - }, - .bcch_change_mark = 1, - .si_change_field = 0, - .rac = 0, /* needs to be patched */ - .spgc_ccch_sup = 0, - .net_ctrl_ord = 0, - .prio_acc_thr = 6, -}; - static int generate_si13(enum osmo_sysinfo_type t, struct gsm_bts *bts) { struct gsm48_system_information_type_13 *si13 = (struct gsm48_system_information_type_13 *) GSM_BTS_SI(bts, t); + struct osmo_gsm48_si13_info si13_info; int ret; memset(si13, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); @@ -1253,33 +1213,66 @@ si13->header.skip_indicator = 0; si13->header.system_information = GSM48_MT_RR_SYSINFO_13; - si13_default.rac = bts->gprs.rac; - si13_default.net_ctrl_ord = bts->gprs.net_ctrl_ord; - - si13_default.cell_opts.ctrl_ack_type_use_block = - bts->gprs.ctrl_ack_type_use_block; - - /* Information about the other SIs */ - si13_default.bcch_change_mark = bts->bcch_change_mark; + si13_info = (struct osmo_gsm48_si13_info){ + .cell_opts = { + .nmo = GPRS_NMO_II,
View file
osmo-bsc_1.8.1.tar.xz/src/osmo-bsc/timeslot_fsm.c -> osmo-bsc_1.9.0.tar.xz/src/osmo-bsc/timeslot_fsm.c
Changed
@@ -229,6 +229,7 @@ } break; } + chan_counts_ts_update(ts); } static void ts_setup_lchans(struct gsm_bts_trx_ts *ts) @@ -315,11 +316,19 @@ osmo_fsm_inst_state_chg(fi, TS_ST_UNUSED, 0, 0); } +static void ts_fsm_not_initialized_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); + chan_counts_ts_clear(ts); +} + static void ts_fsm_unused_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); struct gsm_bts *bts = ts->trx->bts; + chan_counts_ts_update(ts); + /* We are entering the unused state. There must by definition not be any lchans waiting to be * activated. */ if (ts_lchans_waiting(ts)) { @@ -665,6 +674,8 @@ return; } + chan_counts_ts_update(ts); + /* Make sure dyn TS pchan_is is updated. For TCH/F_PDCH, there are only PDCH or TCH/F modes, but * for Osmocom style TCH/F_TCH/H_SDCCH8_PDCH the pchan_is == NONE until an lchan is activated. */ if (ts->pchan_on_init == GSM_PCHAN_OSMO_DYN) @@ -848,6 +859,7 @@ static const struct osmo_fsm_state ts_fsm_states = { TS_ST_NOT_INITIALIZED = { .name = "NOT_INITIALIZED", + .onenter = ts_fsm_not_initialized_onenter, .action = ts_fsm_not_initialized, .in_event_mask = 0 | S(TS_EV_OML_READY)
View file
osmo-bsc_1.8.1.tar.xz/src/utils/Makefile.am -> osmo-bsc_1.9.0.tar.xz/src/utils/Makefile.am
Changed
@@ -9,6 +9,8 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/src/utils/meas_db.c -> osmo-bsc_1.9.0.tar.xz/src/utils/meas_db.c
Changed
@@ -59,8 +59,6 @@ static int _insert_ud(struct meas_db_state *st, unsigned long meas_id, int dtx, int uplink, const struct gsm_meas_rep_unidir *ud) { - unsigned long rowid; - SCK_OK(st->db, sqlite3_bind_int(st->stmt_ins_ud, 1, meas_id)); SCK_OK(st->db, sqlite3_bind_int(st->stmt_ins_ud, 2, rxlev2dbm(ud->full.rx_lev))); @@ -86,7 +84,6 @@ const char *scenario, const struct gsm_meas_rep *mr) { - int rc; sqlite3_int64 rowid, ul_rowid, dl_rowid; SCK_OK(st->db, sqlite3_bind_int(st->stmt_ins_mr, 1, timestamp)); @@ -257,7 +254,7 @@ static int check_create_tbl(struct meas_db_state *st) { - int i, rc; + int i; for (i = 0; i < ARRAY_SIZE(create_stmts); i++) { SCK_OK(st->db, sqlite3_exec(st->db, create_stmtsi,
View file
osmo-bsc_1.8.1.tar.xz/src/utils/meas_pcap2db.c -> osmo-bsc_1.9.0.tar.xz/src/utils/meas_pcap2db.c
Changed
@@ -61,7 +61,7 @@ static void pcap_cb(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes) { - const char *cur = bytes; + const u_char *cur = bytes; const struct iphdr *ip; const struct udphdr *udp; const struct meas_feed_meas *mfm;
View file
osmo-bsc_1.8.1.tar.xz/tests/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/Makefile.am
Changed
@@ -1,12 +1,13 @@ SUBDIRS = \ + abis \ acc \ bsc \ codec_pref \ gsm0408 \ - abis \ - subscr \ - nanobts_omlattr \ handover \ + nanobts_omlattr \ + paging \ + subscr \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. @@ -43,6 +44,7 @@ power_ctrl.vty \ interf_meas.vty \ acch_overpower.vty \ + bts_features.vty \ ctrl/osmo-bsc-neigh-test.cfg \ ctrl/osmo-bsc-apply-config-file.cfg \ ctrl/osmo-bsc-apply-config-file-invalid.cfg \
View file
osmo-bsc_1.8.1.tar.xz/tests/abis/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/abis/Makefile.am
Changed
@@ -7,8 +7,10 @@ -Wall \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -16,7 +18,7 @@ abis_test.ok \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ abis_test \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/tests/acc/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/acc/Makefile.am
Changed
@@ -7,8 +7,10 @@ -Wall \ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -16,7 +18,7 @@ acc_test.ok \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ acc_test \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/tests/acc/acc_test.c -> osmo-bsc_1.9.0.tar.xz/tests/acc/acc_test.c
Changed
@@ -33,9 +33,7 @@ static void clock_debug(char* str) { - struct timespec ts; struct timeval tv; - osmo_clock_gettime(CLOCK_MONOTONIC, &ts); osmo_gettimeofday(&tv, NULL); fprintf(stderr, "sys={%lu.%06lu}: %s\n", tv.tv_sec, tv.tv_usec, str); @@ -60,8 +58,6 @@ #define bts_del(bts) _bts_del(bts, __func__) static inline void _bts_del(struct gsm_bts *bts, const char *msg) { - osmo_stat_item_group_free(bts->bts_statg); - rate_ctr_group_free(bts->bts_ctrs); if (osmo_timer_pending(&bts->acc_mgr.rotate_timer)) osmo_timer_del(&bts->acc_mgr.rotate_timer); if (osmo_timer_pending(&bts->acc_ramp.step_timer)) @@ -492,13 +488,14 @@ osmo_gettimeofday_override = true; osmo_gettimeofday_override_time = (struct timeval) {0, 0}; - tall_bsc_ctx = talloc_named_const(NULL, 0, "gsm0408_test"); + tall_bsc_ctx = talloc_named_const(NULL, 0, "acc_test"); osmo_init_logging2(tall_bsc_ctx, &log_info); log_set_log_level(osmo_stderr_target, LOGL_INFO); log_set_print_category_hex(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 0); log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); log_set_use_color(osmo_stderr_target, 0); + log_parse_category_mask(osmo_stderr_target, "DRSL,1:"); osmo_fsm_log_addr(false); net = gsm_network_init(tall_bsc_ctx);
View file
osmo-bsc_1.8.1.tar.xz/tests/acc/acc_test.ok -> osmo-bsc_1.9.0.tar.xz/tests/acc/acc_test.ok
Changed
@@ -1,21 +1,5 @@ ===test_acc_mgr_no_ramp=== -NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_CELL_OP{DISABLED_NOTINSTALLED}: Allocated -NM_RCARRIER_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BB_TRANSC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) -NM_GPRS_NSE_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated +(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) BTS allocation OK in test_acc_mgr_no_ramp() do_allowed_len_adm_loop(1) (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3fe (active_len=9, ramp_len=10, adm_len=9, perm_len=10, rotation=on) @@ -121,41 +105,9 @@ *** Barring zero ACCs *** (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) pcu_info_update(): t2=0x00 t3=0x00, allowed: 0 1 2 3 4 5 6 7 8 9 -NM_GPRS_NSVC_OP(nsvc0){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSVC_OP(nsvc1){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSE_OP(nse0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_CELL_OP(gprs-cell0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated -NM_BB_TRANSC_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_RCARRIER_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts1){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts2){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts3){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts4){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts5){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts6){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts7){DISABLED_NOTINSTALLED}: Deallocated BTS deallocated OK in test_acc_mgr_no_ramp() ===test_acc_mgr_manual_ramp=== -NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_CELL_OP{DISABLED_NOTINSTALLED}: Allocated -NM_RCARRIER_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BB_TRANSC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) -NM_GPRS_NSE_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated +(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) BTS allocation OK in test_acc_mgr_manual_ramp() do_allowed_len_ramp_loop(1) (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3fe (active_len=9, ramp_len=9, adm_len=10, perm_len=10, rotation=on) @@ -391,41 +343,9 @@ pcu_info_update(): t2=0x03 t3=0xff, allowed: (bts=0) ACC: New ACC allowed subset 0x24c (active_len=4, ramp_len=4, adm_len=4, perm_len=4, rotation=off) pcu_info_update(): t2=0x01 t3=0xb3, allowed: 2 3 6 9 -NM_GPRS_NSVC_OP(nsvc0){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSVC_OP(nsvc1){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSE_OP(nse0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_CELL_OP(gprs-cell0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated -NM_BB_TRANSC_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_RCARRIER_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts1){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts2){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts3){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts4){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts5){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts6){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts7){DISABLED_NOTINSTALLED}: Deallocated BTS deallocated OK in test_acc_mgr_manual_ramp() ===test_acc_mgr_rotate(true, 1)=== -NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_CELL_OP{DISABLED_NOTINSTALLED}: Allocated -NM_RCARRIER_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BB_TRANSC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) -NM_GPRS_NSE_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated +(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) BTS allocation OK in test_acc_mgr_rotate() *** Barring one ACC *** (bts=0) ACC: New ACC allowed subset 0x1ff (active_len=9, ramp_len=10, adm_len=10, perm_len=9, rotation=off) @@ -492,41 +412,9 @@ sys={40.000000}: select() (bts=0) ACC: rotate ACC allowed active subset 0x001 -> 0x002 (active_len=1, ramp_len=10, adm_len=1, perm_len=9, rotation=on) pcu_info_update(): t2=0x03 t3=0xfd, allowed: 1 -NM_GPRS_NSVC_OP(nsvc0){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSVC_OP(nsvc1){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSE_OP(nse0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_CELL_OP(gprs-cell0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated -NM_BB_TRANSC_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_RCARRIER_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts1){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts2){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts3){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts4){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts5){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts6){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts7){DISABLED_NOTINSTALLED}: Deallocated BTS deallocated OK in test_acc_mgr_rotate() ===test_acc_mgr_rotate(false, 1)=== -NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_CELL_OP{DISABLED_NOTINSTALLED}: Allocated -NM_RCARRIER_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BB_TRANSC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) -NM_GPRS_NSE_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated +(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) BTS allocation OK in test_acc_mgr_rotate() (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x200 (active_len=1, ramp_len=10, adm_len=1, perm_len=10, rotation=on) pcu_info_update(): t2=0x01 t3=0xff, allowed: 9 @@ -590,41 +478,9 @@ sys={40.000000}: select() (bts=0) ACC: rotate ACC allowed active subset 0x100 -> 0x200 (active_len=1, ramp_len=10, adm_len=1, perm_len=10, rotation=on) pcu_info_update(): t2=0x01 t3=0xff, allowed: 9 -NM_GPRS_NSVC_OP(nsvc0){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSVC_OP(nsvc1){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_NSE_OP(nse0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated -NM_GPRS_CELL_OP(gprs-cell0){DISABLED_NOTINSTALLED}: Deallocated -NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated -NM_BB_TRANSC_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_RCARRIER_OP(bts0-trx0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts0){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts1){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts2){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts3){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts4){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts5){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts6){DISABLED_NOTINSTALLED}: Deallocated -NM_CHAN_OP(bts0-trx0-ts7){DISABLED_NOTINSTALLED}: Deallocated BTS deallocated OK in test_acc_mgr_rotate() ===test_acc_mgr_rotate(true, 2)=== -NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_CELL_OP{DISABLED_NOTINSTALLED}: Allocated -NM_RCARRIER_OP{DISABLED_NOTINSTALLED}: Allocated -NM_BB_TRANSC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -NM_CHAN_OP{DISABLED_NOTINSTALLED}: Allocated -(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) -NM_GPRS_NSE_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated -NM_GPRS_NSVC_OP{DISABLED_NOTINSTALLED}: Allocated +(bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off) BTS allocation OK in test_acc_mgr_rotate() *** Barring one ACC *** (bts=0) ACC: New ACC allowed subset 0x1ff (active_len=9, ramp_len=10, adm_len=10, perm_len=9, rotation=off) @@ -691,41 +547,9 @@ sys={40.000000}: select() (bts=0) ACC: rotate ACC allowed active subset 0x101 -> 0x003 (active_len=2, ramp_len=10, adm_len=2, perm_len=9, rotation=on) pcu_info_update(): t2=0x03 t3=0xfc, allowed: 0 1 -NM_GPRS_NSVC_OP(nsvc0){DISABLED_NOTINSTALLED}: Deallocated
View file
osmo-bsc_1.8.1.tar.xz/tests/bsc/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/bsc/Makefile.am
Changed
@@ -13,7 +13,6 @@ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ - $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -25,7 +24,7 @@ bsc_test.ok \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ bsc_test \ $(NULL)
View file
osmo-bsc_1.9.0.tar.xz/tests/bts_features.vty
Added
@@ -0,0 +1,27 @@ +OsmoBSC> ### see doc/bts-features.txt + +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# network + +OsmoBSC(config-net)# ### osmo-bts: all feature checks pass before it is connected (features_get_reported is true) +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# gprs mode egprs +OsmoBSC(config-net-bts)# trx 0 +OsmoBSC(config-net-bts-trx)# timeslot 2 +OsmoBSC(config-net-bts-trx-ts)# hopping enabled 1 +OsmoBSC(config-net-bts-trx-ts)# exit +OsmoBSC(config-net-bts-trx)# exit +OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# ### bs11: checks against hardcoded features (features_get_reported is false) +OsmoBSC(config-net)# bts 1 +OsmoBSC(config-net-bts)# type bs11 +OsmoBSC(config-net-bts)# gprs mode egprs +% This BTS type does not support egprs +OsmoBSC(config-net-bts)# trx 0 +OsmoBSC(config-net-bts-trx)# timeslot 2 +OsmoBSC(config-net-bts-trx-ts)# hopping enabled 1 +OsmoBSC(config-net-bts-trx-ts)# exit +OsmoBSC(config-net-bts-trx)# exit +OsmoBSC(config-net-bts)# exit
View file
osmo-bsc_1.8.1.tar.xz/tests/codec_pref/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/codec_pref/Makefile.am
Changed
@@ -8,6 +8,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ $(NULL) @@ -18,7 +19,7 @@ codec_pref_test.ok \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ codec_pref_test \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/tests/gsm0408/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/gsm0408/Makefile.am
Changed
@@ -9,9 +9,11 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ gsm0408_test \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/tests/gsm0408/gsm0408_test.c -> osmo-bsc_1.9.0.tar.xz/tests/gsm0408/gsm0408_test.c
Changed
@@ -29,6 +29,7 @@ #include <osmocom/bsc/system_information.h> #include <osmocom/bsc/abis_rsl.h> #include <osmocom/bsc/bts.h> +#include <osmocom/bsc/bss.h> #include <osmocom/core/application.h> #include <osmocom/core/byteswap.h> @@ -136,8 +137,6 @@ #define bts_del(bts) _bts_del(bts, __func__) static inline void _bts_del(struct gsm_bts *bts, const char *msg) { - osmo_stat_item_group_free(bts->bts_statg); - rate_ctr_group_free(bts->bts_ctrs); if (osmo_timer_pending(&bts->acc_mgr.rotate_timer)) osmo_timer_del(&bts->acc_mgr.rotate_timer); /* no need to llist_del(&bts->list), we never registered the bts there. */ @@ -555,6 +554,71 @@ msgb_free(msg); } +/* Similar to list_arfcn() from system_information.c, but uses printf(). + * Another difference is that the text is printed even if n is 0. */ +static void print_cell_chan_desc(uint8_t *cd, const char *text) +{ + struct gsm_sysinfo_freq freq1024; + unsigned int n = 0, i; + + memset(freq, 0, sizeof(freq)); + gsm48_decode_freq_list(freq, cd, 16, 0xce, 1); + + printf("%s:", text); + for (i = 0; i < 1024; i++) { + if (!freqi.mask) + continue; + printf(" %u", i); + n++; + } + if (!n) + printf(" (empty set)"); + printf("\n"); +} + +static void test_cell_chan_desc(struct gsm_network *net) +{ + struct gsm_bts *bts = bts_init(net); + uint8_t cell_chan_desc16; + + printf("Testing generation of the Cell Channel Description IE:\n"); + + bts_model_unknown_init(); + bts->type = GSM_BTS_TYPE_UNKNOWN; + bts->model = bts_model_find(bts->type); + OSMO_ASSERT(bts->model != NULL); + + bts->band = GSM_BAND_900; + bts->c0->arfcn = 10; /* BCCH carrier */ + + /* Case a) only the BCCH carrier */ + bitvec_set_bit_pos(&bts->si_common.cell_alloc, bts->c0->arfcn, ONE); + + OSMO_ASSERT(generate_cell_chan_list(&cell_chan_desc0, bts) == 0); + print_cell_chan_desc(&cell_chan_desc0, "Case a) only the BCCH carrier"); + + /* Case b) more carriers from P-GSM band */ + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 1, ONE); + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 3, ONE); + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 64, ONE); + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 99, ONE); + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 124, ONE); + + OSMO_ASSERT(generate_cell_chan_list(&cell_chan_desc0, bts) == 0); + print_cell_chan_desc(&cell_chan_desc0, "Case b) more carriers from P-GSM band"); + + /* Case c) more carriers from E-GSM band */ + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 0, ONE); + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 975, ONE); + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 1001, ONE); + bitvec_set_bit_pos(&bts->si_common.cell_alloc, 1023, ONE); + + OSMO_ASSERT(generate_cell_chan_list(&cell_chan_desc0, bts) == 0); + print_cell_chan_desc(&cell_chan_desc0, "Case c) more carriers from E-GSM band"); + + bts_del(bts); +} + static const struct log_info_cat log_categories = { }; @@ -591,6 +655,8 @@ test_gsm48_multirate_config(); + test_cell_chan_desc(net); + printf("Done.\n"); return EXIT_SUCCESS;
View file
osmo-bsc_1.8.1.tar.xz/tests/gsm0408/gsm0408_test.ok -> osmo-bsc_1.9.0.tar.xz/tests/gsm0408/gsm0408_test.ok
Changed
@@ -187,4 +187,10 @@ gsm48_multirate_config(): rc=0, lv=0520340bf330 gsm48_multirate_config(): rc=0, lv=0420140bf0 gsm48_multirate_config(): rc=0, lv=022004 +BTS allocation OK in test_cell_chan_desc() +Testing generation of the Cell Channel Description IE: +Case a) only the BCCH carrier: 10 +Case b) more carriers from P-GSM band: 1 3 10 64 99 124 +Case c) more carriers from E-GSM band: 0 3 10 64 99 124 975 1001 1023 +BTS deallocated OK in test_cell_chan_desc() Done.
View file
osmo-bsc_1.8.1.tar.xz/tests/handover/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/handover/Makefile.am
Changed
@@ -26,7 +26,7 @@ $(srcdir)/test*.ho_vty \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ handover_test \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/tests/handover/handover_test.c -> osmo-bsc_1.9.0.tar.xz/tests/handover/handover_test.c
Changed
@@ -479,6 +479,8 @@ .len = 5, }; + chan_counts_ts_update(lchan->ts); + return lchan; } @@ -522,6 +524,7 @@ continue; lchan_clear(lchan); } + chan_counts_ts_update(ts); } bool _set_ts_use(struct gsm_bts *bts, struct gsm_bts_trx *trx, const char * const *ts_use) @@ -1685,7 +1688,7 @@ /* Stub */ int osmo_bsc_sigtran_open_conn(struct gsm_subscriber_connection *conn, struct msgb *msg) { return 0; } void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci, enum gsm0808_cause cause) {} -void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr) {} +void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_a5_n) {} int bsc_compl_l3(struct gsm_lchan *lchan, struct msgb *msg, uint16_t chosen_channel) { return 0; } void bsc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, struct msgb *msg) {} @@ -1710,3 +1713,7 @@ }; return &ret; } +struct mgcp_client *osmo_mgcpc_ep_client(const struct osmo_mgcpc_ep *ep) +{ + return NULL; +}
View file
osmo-bsc_1.8.1.tar.xz/tests/handover/test_rxqual.ho_vty -> osmo-bsc_1.9.0.tar.xz/tests/handover/test_rxqual.ho_vty
Changed
@@ -10,6 +10,10 @@ # See Performance Enhancements in a Frequency Hopping GSM Network (Nielsen Wigard 2002), Chapter # 2.1.1, "Interference" in the list of triggers on p.157. +# first show undesired oscillation when penalty-time low-rxqual-ho is disabled +network + handover2 penalty-time low-rxqual-ho 0 + create-n-bts 2 set-ts-use trx 0 0 states * TCH/F - - - - - - meas-rep repeat 9 lchan 0 0 1 0 rxlev 40 rxqual 6 ta 0 neighbors 30 @@ -19,3 +23,27 @@ expect-ts-use trx 0 0 states * - - - - - - - expect-ts-use trx 1 0 states * TCH/F - - - - - - +# Now the channel is on bts 1, which has lower rxlev than bts 0. +# The result is an undesired ho oscillation, because the penalty timer is zero +meas-rep lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40 +expect-ho from lchan 1 0 1 0 to lchan 0 0 1 0 + +# Set a proper penalty timeout and report bad-rxqual again +network + handover2 penalty-time low-rxqual-ho 10 +meas-rep repeat 10 lchan 0 0 1 0 rxlev 40 rxqual 6 ta 0 neighbors 30 +expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0 + +# This time the penalty timer prevents oscillation +meas-rep repeat 10 lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40 +expect-no-chan + +# After the penalty timeout passes, we do go back to the cell with stronger rxlev +wait 10 +meas-rep lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40 +expect-ho from lchan 1 0 1 0 to lchan 0 0 1 0 +# If the rxqual is still bad here after the penalty timeout, well, then we quickly snap back to the weaker cell, once +meas-rep repeat 10 lchan 0 0 1 0 rxlev 40 rxqual 6 ta 0 neighbors 30 +expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0 +meas-rep repeat 10 lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40 +expect-no-chan
View file
osmo-bsc_1.8.1.tar.xz/tests/handover_cfg.vty -> osmo-bsc_1.9.0.tar.xz/tests/handover_cfg.vty
Changed
@@ -6,7 +6,7 @@ OsmoBSC# ### No handover config present OsmoBSC# show running-config -... !handover +... !^\s+handover OsmoBSC# ### Toggling handover on network level affects 'show network': OsmoBSC# configure terminal @@ -44,17 +44,17 @@ OsmoBSC(config-net)# show running-config ... network -... !handover +... !^\s+handover handover 1 -... !handover +... !^\s+handover bts 0 -... !handover +... !^\s+handover handover 0 -... !handover +... !^\s+handover bts 1 -... !handover +... !^\s+handover handover1 power budget interval 23 -... !handover +... !^\s+handover OsmoBSC(config-net)# ### Set global default to 'off', now bts 1 also uses the global default of 'off': OsmoBSC(config-net)# handover 0 @@ -65,17 +65,17 @@ OsmoBSC(config-net)# show running-config ... network -... !handover +... !^\s+handover handover 0 -... !handover +... !^\s+handover bts 0 -... !handover +... !^\s+handover handover 0 -... !handover +... !^\s+handover bts 1 -... !handover +... !^\s+handover handover1 power budget interval 23 -... !handover +... !^\s+handover OsmoBSC(config-net)# ### Remove the global setting, i.e. use the factory default net level, with same effect: OsmoBSC(config-net)# handover default @@ -89,15 +89,15 @@ OsmoBSC(config-net)# show running-config ... network -... !handover +... !^\s+handover bts 0 -... !handover +... !^\s+handover handover 0 -... !handover +... !^\s+handover bts 1 -... !handover +... !^\s+handover handover1 power budget interval 23 -... !handover +... !^\s+handover OsmoBSC(config-net)# ### Re-enable net-level handover, but bts 0 remains disabled explicitly OsmoBSC(config-net)# handover 1 @@ -108,17 +108,17 @@ OsmoBSC(config-net)# show running-config ... network -... !handover +... !^\s+handover handover 1 -... !handover +... !^\s+handover bts 0 -... !handover +... !^\s+handover handover 0 -... !handover +... !^\s+handover bts 1 -... !handover +... !^\s+handover handover1 power budget interval 23 -... !handover +... !^\s+handover OsmoBSC(config-net)# ### Remove explicit setting of bts 0 to also use the global setting: OsmoBSC(config-net)# bts 0 @@ -133,15 +133,15 @@ OsmoBSC(config-net-bts)# show running-config ... network -... !handover +... !^\s+handover handover 1 -... !handover +... !^\s+handover bts 0 -... !handover +... !^\s+handover bts 1 -... !handover +... !^\s+handover handover1 power budget interval 23 -... !handover +... !^\s+handover OsmoBSC(config-net-bts)# ### Verify that 'min rxlev' value range stops at -50 OsmoBSC(config-net-bts)# handover2 min rxlev ? @@ -190,6 +190,7 @@ handover2 penalty-time failed-ho (<0-99999>|default) handover2 penalty-time failed-assignment (<0-99999>|default) handover2 penalty-time low-rxqual-assignment (<0-99999>|default) + handover2 penalty-time low-rxqual-ho (<0-99999>|default) handover2 retries (<0-9>|default) handover2 congestion-check (disabled|<1-999>|now) ... @@ -389,6 +390,7 @@ failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries' failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries' low-rxqual-assignment Time to suspend re-assignment after an lchan was re-assigned because of low RxQual + low-rxqual-ho Time to suspend handover back to a cell after bad RxQual caused handover away from it OsmoBSC(config-net)# handover2 penalty-time max-distance ? <0-99999> Seconds @@ -613,6 +615,7 @@ failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries' failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries' low-rxqual-assignment Time to suspend re-assignment after an lchan was re-assigned because of low RxQual + low-rxqual-ho Time to suspend handover back to a cell after bad RxQual caused handover away from it OsmoBSC(config-net-bts)# handover2 penalty-time max-distance ? <0-99999> Seconds
View file
osmo-bsc_1.8.1.tar.xz/tests/nanobts_omlattr/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/nanobts_omlattr/Makefile.am
Changed
@@ -8,9 +8,11 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ nanobts_omlattr_test \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.c -> osmo-bsc_1.9.0.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.c
Changed
@@ -34,82 +34,82 @@ extern struct gsm_bts_model bts_model_nanobts; -static void test_nanobts_attr_bts_get(struct gsm_bts *bts, uint8_t *expected) +static void test_nanobts_gen_set_bts_attr(struct gsm_bts *bts, uint8_t *expected) { struct msgb *msgb; - printf("Testing nanobts_attr_bts_get()...\n"); + printf("Testing nanobts_gen_set_bts_attr()...\n"); - msgb = nanobts_attr_bts_get(bts); + msgb = nanobts_gen_set_bts_attr(bts); printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); - OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len)); msgb_free(msgb); printf("ok.\n"); printf("\n"); } -static void test_nanobts_attr_nse_get(struct gsm_bts *bts, uint8_t *expected) +static void test_nanobts_gen_set_nse_attr(struct gsm_bts *bts, uint8_t *expected) { struct msgb *msgb; - printf("Testing nanobts_attr_nse_get()...\n"); + printf("Testing nanobts_gen_set_nse_attr()...\n"); - msgb = nanobts_attr_nse_get(bts->site_mgr); + msgb = nanobts_gen_set_nse_attr(bts->site_mgr); printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); - OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len)); msgb_free(msgb); printf("ok.\n"); printf("\n"); } -static void test_nanobts_attr_cell_get(struct gsm_bts *bts, uint8_t *expected) +static void test_nanobts_gen_set_cell_attr(struct gsm_bts *bts, uint8_t *expected) { struct msgb *msgb; - printf("Testing nanobts_attr_cell_get()...\n"); + printf("Testing nanobts_gen_set_cell_attr()...\n"); - msgb = nanobts_attr_cell_get(bts); + msgb = nanobts_gen_set_cell_attr(bts); printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); - OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len)); msgb_free(msgb); printf("ok.\n"); printf("\n"); } -static void test_nanobts_attr_nsvc_get(struct gsm_bts *bts, uint8_t *expected) +static void test_nanobts_gen_set_nsvc_attr(struct gsm_bts *bts, uint8_t *expected) { struct msgb *msgb; - printf("Testing nanobts_attr_nsvc_get()...\n"); + printf("Testing nanobts_gen_set_nsvc_attr()...\n"); - msgb = nanobts_attr_nsvc_get(bts); + msgb = nanobts_gen_set_nsvc_attr(bts); printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); - OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len)); msgb_free(msgb); printf("ok.\n"); printf("\n"); } -static void test_nanobts_attr_radio_get(struct gsm_bts *bts, +static void test_nanobts_gen_set_radio_attr(struct gsm_bts *bts, struct gsm_bts_trx *trx, uint8_t *expected) { struct msgb *msgb; - printf("Testing nanobts_attr_nsvc_get()...\n"); + printf("Testing nanobts_gen_set_nsvc_attr()...\n"); - msgb = nanobts_attr_radio_get(bts, trx); + msgb = nanobts_gen_set_radio_attr(bts, trx); printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); - OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + OSMO_ASSERT(msgb_eq_data_print(msgb, expected, msgb->len)); msgb_free(msgb); printf("ok.\n"); @@ -154,7 +154,7 @@ bts->network = net; trx = talloc_zero(ctx, struct gsm_bts_trx); - /* Parameters needed by nanobts_attr_bts_get() */ + /* Parameters needed by nanobts_gen_set_bts_attr() */ bts->rach_b_thresh = -1; bts->rach_ldavg_slots = -1; bts->c0->arfcn = 866; @@ -167,13 +167,13 @@ 0x02, 0x01, 0x20, 0x33, 0x1e, 0x24, 0x24, 0xa8, 0x34, 0x21, 0xa8, 0x1f, 0x3f, 0x25, 0x00, 0x01, 0x0a, 0x0c, 0x0a, 0x0b, 0x01, 0x2a, 0x5a, 0x2b, - 0x03, 0xe8, 0x0a, 0x0d, + 0x03, 0xe8, 0x0a, 0x01, 0x23, 0x0a, 0x08, 0x03, 0x62, 0x09, 0x3f, 0x99, 0x00, 0x07, 0x00, 0xf1, 0x10, 0x00, 0x01, 0x05, 0x39 }; - /* Parameters needed to test nanobts_attr_nse_get() */ + /* Parameters needed to test nanobts_gen_set_nse_attr() */ bts->site_mgr->gprs.nse.nsei = 101; uint8_t attr_nse_expected = { 0x9d, 0x00, 0x02, 0x00, 0x65, 0xa0, 0x00, 0x07, 0x03, 0x03, 0x03, @@ -182,7 +182,7 @@ 0x0a, 0x03, 0x0a, 0x03 }; - /* Parameters needed to test nanobts_attr_cell_get() */ + /* Parameters needed to test nanobts_gen_set_cell_attr() */ bts->gprs.rac = 0x00; bts->gprs.cell.bvci = 2; bts->gprs.mode = BTS_GPRS_GPRS; @@ -194,7 +194,7 @@ 0xfa, 0x00, 0xfa, 0x02 }; - /* Parameters needed to test nanobts_attr_nsvc_get() */ + /* Parameters needed to test nanobts_gen_set_nsvc_attr() */ struct osmo_sockaddr_str addr; osmo_sockaddr_str_from_str(&addr, "10.9.1.101", 23000); osmo_sockaddr_str_to_sockaddr(&addr, &bts->site_mgr->gprs.nsvc0.remote.u.sas); @@ -205,7 +205,7 @@ 0x09, 0x01, 0x65, 0x5a, 0x3c }; - /* Parameters needed to test nanobts_attr_radio_get() */ + /* Parameters needed to test nanobts_gen_set_radio_attr() */ trx->arfcn = 866; trx->max_power_red = 22; bts->c0->max_power_red = 22; @@ -213,11 +213,11 @@ { 0x2d, 0x0b, 0x05, 0x00, 0x02, 0x03, 0x62 }; /* Run tests */ - test_nanobts_attr_bts_get(bts, attr_bts_expected); - test_nanobts_attr_nse_get(bts, attr_nse_expected); - test_nanobts_attr_cell_get(bts, attr_cell_expected); - test_nanobts_attr_nsvc_get(bts, attr_nscv_expected); - test_nanobts_attr_radio_get(bts, trx, attr_radio_expected); + test_nanobts_gen_set_bts_attr(bts, attr_bts_expected); + test_nanobts_gen_set_nse_attr(bts, attr_nse_expected); + test_nanobts_gen_set_cell_attr(bts, attr_cell_expected); + test_nanobts_gen_set_nsvc_attr(bts, attr_nscv_expected); + test_nanobts_gen_set_radio_attr(bts, trx, attr_radio_expected); /* NSVC IPv6 test */ struct osmo_sockaddr_str addr6; @@ -234,7 +234,7 @@ 0xfd, 0x00, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, }; - test_nanobts_attr_nsvc_get(bts, attr_nscv6_expected); + test_nanobts_gen_set_nsvc_attr(bts, attr_nscv6_expected); printf("Done\n");
View file
osmo-bsc_1.8.1.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.ok -> osmo-bsc_1.9.0.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.ok
Changed
@@ -1,29 +1,29 @@ -Testing nanobts_attr_bts_get()... -result= 19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a0d230a080362093f99000700f11000010539 -expected=19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a0d230a080362093f99000700f11000010539 +Testing nanobts_gen_set_bts_attr()... +result= 19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a01230a080362093f99000700f11000010539 +expected=19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a01230a080362093f99000700f11000010539 ok. -Testing nanobts_attr_nse_get()... +Testing nanobts_gen_set_nse_attr()... result= 9d00020065a00007030303031e030aa1000b03030303030a030a030a03 expected=9d00020065a00007030303031e030aa1000b03030303030a030a030a03 ok. -Testing nanobts_attr_cell_get()... +Testing nanobts_gen_set_cell_attr()... result= 9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 expected=9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 ok. -Testing nanobts_attr_nsvc_get()... +Testing nanobts_gen_set_nsvc_attr()... result= 9f00020065a2000859d80a0901655a3c expected=9f00020065a2000859d80a0901655a3c ok. -Testing nanobts_attr_nsvc_get()... +Testing nanobts_gen_set_nsvc_attr()... result= 2d0b0500020362 expected=2d0b0500020362 ok. -Testing nanobts_attr_nsvc_get()... +Testing nanobts_gen_set_nsvc_attr()... result= 9f00020065fd001629005a3c59e2fd005678901234567890123456789012 expected=9f00020065fd001629005a3c59e2fd005678901234567890123456789012 ok.
View file
osmo-bsc_1.8.1.tar.xz/tests/nri_cfg.vty -> osmo-bsc_1.9.0.tar.xz/tests/nri_cfg.vty
Changed
@@ -121,7 +121,7 @@ OsmoBSC(config-net)# nri null ? add Add NULL-NRI value (or range) - del Remove NRI value or range from the NRI mapping for this MSC + del Remove NRI value or range from the NRI mapping OsmoBSC(config-net)# nri null add ? <0-32767> First value of the NRI value range, should not surpass the configured 'nri bitlen'.
View file
osmo-bsc_1.8.1.tar.xz/tests/osmo-bsc.vty -> osmo-bsc_1.9.0.tar.xz/tests/osmo-bsc.vty
Changed
@@ -166,18 +166,20 @@ allocator Channel Allocator OsmoBSC(config-net-bts)# channel allocator ? - ascending Allocate Timeslots and Transceivers in ascending order - descending Allocate Timeslots and Transceivers in descending order - avoid-interference Configure whether reported interference levels from RES IND are used in channel allocation - allow-tch-for-signalling Configure whether TCH/H or TCH/F channels can be used to serve non-call-related signalling if SDCCHs are exhausted + ascending Allocate Timeslots and Transceivers in ascending order + descending Allocate Timeslots and Transceivers in descending order + avoid-interference Configure whether reported interference levels from RES IND are used in channel allocation + tch-signalling-policy Configure when TCH/H or TCH/F channels can be used to serve signalling if SDCCHs are exhausted OsmoBSC(config-net-bts)# channel allocator avoid-interference ? 0 Ignore interference levels (default). Always assign lchans in a deterministic order. 1 In channel allocation, prefer lchans with less interference. -OsmoBSC(config-net-bts)# channel allocator allow-tch-for-signalling ? - 0 Forbid use of TCH for non-call-related signalling purposes - 1 Allow use of TCH for non-call-related signalling purposes (default) +OsmoBSC(config-net-bts)# channel allocator tch-signalling-policy ? + never Never allow TCH for signalling purposes + emergency Only allow TCH for signalling purposes when establishing an emergency call + voice Allow TCH for signalling purposes when establishing any voice call + always Always allow TCH for signalling purposes (default) OsmoBSC(config-net-bts)# show running-config ... !channel allocator avoid-interference @@ -194,18 +196,34 @@ ... !channel allocator avoid-interference OsmoBSC(config-net-bts)# show running-config -... !channel allocator allow-tch-for-signalling -OsmoBSC(config-net-bts)# channel allocator allow-tch-for-signalling 0 +... !channel allocator tch-signalling-policy +OsmoBSC(config-net-bts)# channel allocator tch-signalling-policy never OsmoBSC(config-net-bts)# show running-config ... bts 0 ... - channel allocator allow-tch-for-signalling 0 + channel allocator tch-signalling-policy never ... -OsmoBSC(config-net-bts)# channel allocator allow-tch-for-signalling 1 +OsmoBSC(config-net-bts)# channel allocator tch-signalling-policy emergency OsmoBSC(config-net-bts)# show running-config -... !channel allocator allow-tch-for-signalling +... + bts 0 +... + channel allocator tch-signalling-policy emergency +... + +OsmoBSC(config-net-bts)# channel allocator tch-signalling-policy voice +OsmoBSC(config-net-bts)# show running-config +... + bts 0 +... + channel allocator tch-signalling-policy voice +... + +OsmoBSC(config-net-bts)# channel allocator tch-signalling-policy always +OsmoBSC(config-net-bts)# show running-config +... !channel allocator tch-signalling-policy OsmoBSC(config-net-bts)# immediate-assignment? immediate-assignment Configure time of Immediate Assignment after ChanRqd RACH (Abis optimization)
View file
osmo-bsc_1.9.0.tar.xz/tests/paging
Added
+(directory)
View file
osmo-bsc_1.9.0.tar.xz/tests/paging/Makefile.am
Added
@@ -0,0 +1,38 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + paging_test.ok \ + $(NULL) + +check_PROGRAMS = \ + paging_test \ + $(NULL) + +paging_test_SOURCES = \ + paging_test.c \ + $(NULL) + +paging_test_LDFLAGS = \ + -Wl,--wrap=abis_rsl_sendmsg \ + $(NULL) + +paging_test_LDADD = \ + $(top_builddir)/src/osmo-bsc/libbsc.la \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(NULL)
View file
osmo-bsc_1.9.0.tar.xz/tests/paging/paging_test.c
Added
@@ -0,0 +1,296 @@ +/* + * (C) 2022 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> + * 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 <stdio.h> +#include <stdlib.h> +#include <inttypes.h> + +#include <osmocom/core/msgb.h> +#include <osmocom/core/application.h> +#include <osmocom/core/utils.h> +#include <osmocom/gsm/protocol/gsm_12_21.h> +#include <osmocom/gsm/gsm23003.h> +#include <osmocom/gsm/rsl.h> + +#include <osmocom/bsc/gsm_data.h> +#include <osmocom/bsc/bts.h> +#include <osmocom/bsc/abis_nm.h> +#include <osmocom/bsc/debug.h> +#include <osmocom/bsc/bss.h> + +struct timespec *clk_monotonic_override; +unsigned int _sent_pg_cmd_rsl; + +static void clock_debug(char *str) +{ + struct timeval tv; + osmo_gettimeofday(&tv, NULL); + fprintf(stderr, "sys={%lu.%06lu}: %s\n", + tv.tv_sec, tv.tv_usec, str); +} + + +static void clock_set(uint64_t sec, uint64_t usec) +{ + osmo_gettimeofday_override_time.tv_sec = sec; + osmo_gettimeofday_override_time.tv_usec = usec; + clk_monotonic_override->tv_sec = sec; + clk_monotonic_override->tv_nsec = usec * 1000; +} + +static void clock_inc(unsigned int sec, unsigned int usec) +{ + osmo_gettimeofday_override_add(sec, usec); + osmo_clock_override_add(CLOCK_MONOTONIC, sec, usec * 1000); +} + +#define bts_init(net) _bts_init(net, __func__) +static inline struct gsm_bts *_bts_init(struct gsm_network *net, const char *msg) +{ + struct nm_running_chg_signal_data nsd; + struct gsm_bts_sm *bts_sm = gsm_bts_sm_alloc(net, 0); + struct gsm_bts *bts = bts_sm->bts0; + if (!bts) { + fprintf(stderr, "BTS allocation failure in %s()\n", msg); + exit(1); + } + fprintf(stderr, "BTS allocation OK in %s()\n", msg); + + bts->network = net; + + /* Make sure trx_is_usable() returns true for bts->c0: */ + bts->c0->mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->mo.nm_state.administrative = NM_STATE_UNLOCKED; + bts->c0->bb_transc.mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->bb_transc.mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->bb_transc.mo.nm_state.administrative = NM_STATE_UNLOCKED; + bts->c0->rsl_link_primary = (struct e1inp_sign_link *)(intptr_t)0x01; /* Fake RSL is UP */ + + /* Emulate signal stating the TRX C0 is ready: */ + memset(&nsd, 0, sizeof(nsd)); + nsd.bts = bts; + nsd.obj_class = NM_OC_RADIO_CARRIER; + nsd.obj = bts->c0; + nsd.running = true; + osmo_signal_dispatch(SS_NM, S_NM_RUNNING_CHG, &nsd); + + return bts; +} + +#define bts_del(bts) _bts_del(bts, __func__) +static inline void _bts_del(struct gsm_bts *bts, const char *msg) +{ + /* no need to llist_del(&bts->list), we never registered the bts there. */ + talloc_free(bts->site_mgr); + fprintf(stderr, "BTS deallocated OK in %s()\n", msg); +} + +static void emu_bsc_paging_cmd_from_msc(struct gsm_network *net, struct gsm_bts *bts, const char *imsi) +{ + int ret; + struct bsc_paging_params params = { + .reason = BSC_PAGING_FROM_CN, + .msc = NULL, + .tmsi = GSM_RESERVED_TMSI, + .imsi = { + .type = GSM_MI_TYPE_IMSI, + } + }; + OSMO_STRLCPY_ARRAY(params.imsi.imsi, imsi); + params.bsub = bsc_subscr_find_or_create_by_imsi(net->bsc_subscribers, params.imsi.imsi, + BSUB_USE_PAGING_START); + ret = paging_request_bts(¶ms, bts); + OSMO_ASSERT(ret == 1); +} + +static void test_paging500(struct gsm_network *net) +{ + fprintf(stderr, "===%s===\n", __func__); + int i; + clock_set(0, 0); + _sent_pg_cmd_rsl = 0; + struct gsm_bts *bts = bts_init(net); + + for (i = 0; i < 500; i++) { + char imsi32; + snprintf(imsi, sizeof(imsi), "1234%06u", i); + emu_bsc_paging_cmd_from_msc(net, bts, imsi); + } + + while (_sent_pg_cmd_rsl < 500) { + osmo_timers_prepare(); + int nearest_ms = osmo_timers_nearest_ms(); + if (nearest_ms == -1) + nearest_ms = 250; + clock_inc(0, nearest_ms*1000); + clock_debug("select()"); + osmo_select_main_ctx(0); + if (llist_empty(&bts->paging.pending_requests)) { + fprintf(stderr, "ERROR: some request timed out before being sent! %u\n", _sent_pg_cmd_rsl); + OSMO_ASSERT(0); + } + } + + bts_del(bts); +} + +static void test_paging500_combined(struct gsm_network *net) +{ + fprintf(stderr, "===%s===\n", __func__); + int i; + clock_set(0, 0); + _sent_pg_cmd_rsl = 0; + struct gsm_bts *bts = bts_init(net); + bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_C; + + for (i = 0; i < 500; i++) { + char imsi32; + snprintf(imsi, sizeof(imsi), "1234%06u", i); + emu_bsc_paging_cmd_from_msc(net, bts, imsi); + } + + while (_sent_pg_cmd_rsl < 500) { + osmo_timers_prepare(); + int nearest_ms = osmo_timers_nearest_ms(); + if (nearest_ms == -1) + nearest_ms = 250; + clock_inc(0, nearest_ms*1000); + clock_debug("select()"); + osmo_select_main_ctx(0); + if (llist_empty(&bts->paging.pending_requests)) { + fprintf(stderr, "ERROR: some request timed out before being sent! %u\n", _sent_pg_cmd_rsl); + OSMO_ASSERT(0); + } + } + + bts_del(bts); +} + +static void test_paging500_samepgroup(struct gsm_network *net) +{ + fprintf(stderr, "===%s===\n", __func__); + int i; + clock_set(0, 0); + _sent_pg_cmd_rsl = 0; + struct gsm_bts *bts = bts_init(net); + + unsigned int num_pgroups = gsm48_number_of_paging_subchannels(&bts->si_common.chan_desc); + fprintf(stderr, "Number of paging groups: %u\n", num_pgroups); + + for (i = 0; i < 500; i++) { + char imsi32; + snprintf(imsi, sizeof(imsi), "1234%08u", i*num_pgroups);
View file
osmo-bsc_1.9.0.tar.xz/tests/paging/paging_test.ok
Added
@@ -0,0 +1,9523 @@ +===test_paging500=== +BTS allocation OK in test_paging500() +(bts=0) C0 becomes available for paging +(bts=0) Estimated 67 paging available_slots over 2 seconds +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000000: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000000: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(msc=-1) Paging: subscr-IMSI-1234000000: (bts=0) Going to send paging command for ch. type 0 (attempt 0) +abis_rsl_sendmsg: Paging CMD IMSI-1234000000 +(bts=0) Paged 1 subscribers during last iteration. Scheduling next batch in 0.250000s (available_slots=66) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000001: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000001: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(msc=-1) Paging: subscr-IMSI-1234000001: (bts=0) New req arrived: re-scheduling next batch in 0.250000s +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000002: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000002: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000003: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000003: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000004: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000004: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000005: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000005: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000006: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000006: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000007: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000007: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000008: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000008: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000009: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000009: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000010: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000010: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000011: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000011: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000012: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000012: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000013: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000013: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000014: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000014: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000015: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000015: (bts=0) Paging request: T3113 expires in 9 seconds (estimated 9) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000016: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000016: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000017: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000017: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000018: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000018: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000019: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000019: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000020: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000020: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000021: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000021: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000022: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000022: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000023: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000023: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000024: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000024: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000025: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000025: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000026: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000026: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000027: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000027: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000028: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000028: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000029: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000029: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000030: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000030: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000031: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000031: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000032: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000032: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000033: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000033: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000034: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000034: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000035: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000035: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000036: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000036: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000037: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000037: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000038: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000038: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000039: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000039: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000040: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000040: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000041: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000041: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000042: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000042: (bts=0) Paging request: T3113 expires in 10 seconds (estimated 10) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000043: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000043: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000044: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000044: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000045: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000045: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000046: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000046: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000047: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000047: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000048: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000048: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000049: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000049: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000050: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000050: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000051: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000051: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000052: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000052: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000053: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000053: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000054: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000054: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000055: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000055: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000056: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000056: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000057: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000057: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000058: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000058: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000059: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000059: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000060: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000060: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000061: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000061: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000062: (bts=0) Start paging +(msc=-1) Paging: subscr-IMSI-1234000062: (bts=0) Paging request: T3113 expires in 11 seconds (estimated 11) +(bts=0) Estimated 2039 paging available_slots over 60 seconds +(msc=-1) Paging: subscr-IMSI-1234000063: (bts=0) Start paging
View file
osmo-bsc_1.8.1.tar.xz/tests/subscr/Makefile.am -> osmo-bsc_1.9.0.tar.xz/tests/subscr/Makefile.am
Changed
@@ -9,6 +9,8 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -22,7 +24,7 @@ bsc_subscr_test.err \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ bsc_subscr_test \ $(NULL)
View file
osmo-bsc_1.8.1.tar.xz/tests/testsuite.at -> osmo-bsc_1.9.0.tar.xz/tests/testsuite.at
Changed
@@ -1,19 +1,6 @@ AT_INIT AT_BANNER(Regression tests.) -AT_SETUP(gsm0408) -AT_KEYWORDS(gsm0408) -cat $abs_srcdir/gsm0408/gsm0408_test.ok > expout -AT_CHECK($abs_top_builddir/tests/gsm0408/gsm0408_test, , expout, ignore) -AT_CLEANUP - -AT_SETUP(bsc_subscr) -AT_KEYWORDS(bsc_subscr) -cat $abs_srcdir/subscr/bsc_subscr_test.ok > expout -cat $abs_srcdir/subscr/bsc_subscr_test.err > experr -AT_CHECK($abs_top_builddir/tests/subscr/bsc_subscr_test, , expout, experr) -AT_CLEANUP - AT_SETUP(abis) AT_KEYWORDS(abis) cat $abs_srcdir/abis/abis_test.ok > expout @@ -38,10 +25,10 @@ AT_CHECK($abs_top_builddir/tests/codec_pref/codec_pref_test, , expout, ignore) AT_CLEANUP -AT_SETUP(nanobts_omlattr) -AT_KEYWORDS(nanobts_omlattr) -cat $abs_srcdir/nanobts_omlattr/nanobts_omlattr_test.ok > expout -AT_CHECK($abs_top_builddir/tests/nanobts_omlattr/nanobts_omlattr_test, , expout, ignore) +AT_SETUP(gsm0408) +AT_KEYWORDS(gsm0408) +cat $abs_srcdir/gsm0408/gsm0408_test.ok > expout +AT_CHECK($abs_top_builddir/tests/gsm0408/gsm0408_test, , expout, ignore) AT_CLEANUP AT_SETUP(handover_tests) @@ -49,3 +36,22 @@ cat $abs_srcdir/handover/handover_tests.ok > expout AT_CHECK($abs_srcdir/handover/handover_tests.sh $abs_srcdir/handover $abs_builddir/handover, , expout, ignore) AT_CLEANUP + +AT_SETUP(paging) +AT_KEYWORDS(paging) +cat $abs_srcdir/paging/paging_test.ok > experr +AT_CHECK($abs_top_builddir/tests/paging/paging_test, , ignore, experr) +AT_CLEANUP + +AT_SETUP(nanobts_omlattr) +AT_KEYWORDS(nanobts_omlattr) +cat $abs_srcdir/nanobts_omlattr/nanobts_omlattr_test.ok > expout +AT_CHECK($abs_top_builddir/tests/nanobts_omlattr/nanobts_omlattr_test, , expout, ignore) +AT_CLEANUP + +AT_SETUP(subscr) +AT_KEYWORDS(subscr) +cat $abs_srcdir/subscr/bsc_subscr_test.ok > expout +cat $abs_srcdir/subscr/bsc_subscr_test.err > experr +AT_CHECK($abs_top_builddir/tests/subscr/bsc_subscr_test, , expout, experr) +AT_CLEANUP
View file
osmo-bsc_1.8.1.tar.xz/tests/timer.vty -> osmo-bsc_1.9.0.tar.xz/tests/timer.vty
Changed
@@ -1,6 +1,7 @@ OsmoBSC> enable OsmoBSC# show timer +net: T4 = 5 s Timeout to receive BSSMAP RESET ACKNOWLEDGE from the MSC (default: 5 s) net: T7 = 10 s inter-BSC/MSC Handover outgoing, BSSMAP HO Required to HO Command timeout (default: 10 s) net: T8 = 10 s inter-BSC/MSC Handover outgoing, BSSMAP HO Command to final Clear timeout (default: 10 s) net: T10 = 6 s RR Assignment (default: 6 s) @@ -32,6 +33,7 @@ net: X16 = 1000 ms Granularity for all_allocated:* rate counters: amount of milliseconds that one counter increment represents. See also X17, X18 (default: 1000 ms) net: X17 = 0 ms Rounding threshold for all_allocated:* rate counters: round up to the next counter increment after this many milliseconds. If set to half of X16 (or 0), employ the usual round() behavior: round up after half of a granularity period. If set to 1, behave like ceil(): already increment the counter immediately when all channels are allocated. If set >= X16, behave like floor(): only increment after a full X16 period of all channels being occupied. See also X16, X18 (default: 0 ms) net: X18 = 60000 ms Forget-sum period for all_allocated:* rate counters: after this amount of idle time, forget internally cumulated time remainders. Zero to always keep remainders. See also X16, X17. (default: 60000 ms) +net: X25 = 5 s Timeout for initial user data after an MSC initiated an SCCP connection to the BSS (default: 5 s) net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s) net: X3210 = 20 s After L3 Complete, wait for MSC to confirm (default: 20 s) mgw: X2427 = 5 s timeout for MGCP response from MGW (default: 5 s) @@ -53,6 +55,7 @@ OsmoBSC# configure terminal OsmoBSC(config)# network OsmoBSC(config-net)# timer +net: T4 = 5 s Timeout to receive BSSMAP RESET ACKNOWLEDGE from the MSC (default: 5 s) net: T7 = 10 s inter-BSC/MSC Handover outgoing, BSSMAP HO Required to HO Command timeout (default: 10 s) net: T8 = 10 s inter-BSC/MSC Handover outgoing, BSSMAP HO Command to final Clear timeout (default: 10 s) net: T10 = 6 s RR Assignment (default: 6 s) @@ -84,6 +87,7 @@ net: X16 = 1000 ms Granularity for all_allocated:* rate counters: amount of milliseconds that one counter increment represents. See also X17, X18 (default: 1000 ms) net: X17 = 0 ms Rounding threshold for all_allocated:* rate counters: round up to the next counter increment after this many milliseconds. If set to half of X16 (or 0), employ the usual round() behavior: round up after half of a granularity period. If set to 1, behave like ceil(): already increment the counter immediately when all channels are allocated. If set >= X16, behave like floor(): only increment after a full X16 period of all channels being occupied. See also X16, X18 (default: 0 ms) net: X18 = 60000 ms Forget-sum period for all_allocated:* rate counters: after this amount of idle time, forget internally cumulated time remainders. Zero to always keep remainders. See also X16, X17. (default: 60000 ms) +net: X25 = 5 s Timeout for initial user data after an MSC initiated an SCCP connection to the BSS (default: 5 s) net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s) net: X3210 = 20 s After L3 Complete, wait for MSC to confirm (default: 20 s) mgw: X2427 = 5 s timeout for MGCP response from MGW (default: 5 s)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.