Projects
osmocom:latest
osmo-bsc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
osmo-bsc.spec
Deleted
@@ -1,156 +0,0 @@ -# -# spec file for package osmo-bsc -# -# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de> -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -## Disable LTO for now since it breaks compilation of the tests -## https://osmocom.org/issues/4113 -%define _lto_cflags %{nil} - -Name: osmo-bsc -Requires: osmocom-latest -Version: 1.11.1 -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.11.1.tar.xz -Source1: rpmlintrc -BuildRequires: automake >= 1.9 -BuildRequires: libtool >= 2 -BuildRequires: pkgconfig >= 0.20 -%if 0%{?suse_version} -BuildRequires: systemd-rpm-macros -%endif -BuildRequires: pkgconfig(libcrypto) >= 0.9.5 -BuildRequires: pkgconfig(libosmo-mgcp-client) >= 1.12.0 -BuildRequires: pkgconfig(libosmo-netif) >= 1.4.0 -BuildRequires: pkgconfig(libosmo-sigtran) >= 1.8.0 -BuildRequires: pkgconfig(libosmoabis) >= 1.5.0 -BuildRequires: pkgconfig(libosmocore) >= 1.9.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.9.0 -BuildRequires: pkgconfig(libosmogb) >= 1.9.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.9.0 -BuildRequires: pkgconfig(libosmovty) >= 1.9.0 -BuildRequires: pkgconfig(talloc) -%{?systemd_requires} - -%description -OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks. - -%package abisip-find -Requires: osmocom-latest -Summary: CLI utility to find ip.access compatible BTS -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description abisip-find -Command line utility to find ip.access compatible BTS. - -%package ipaccess-utils -Requires: osmocom-latest -Summary: Command line utilities for ip.access nanoBTS -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description ipaccess-utils -This package contains utilities that are specific for nanoBTS when being -used together with OpenBSC. It contains mainly two tools: ipaccess-config -and ipaccess-proxy. - -%package bs11-utils -Requires: osmocom-latest -Summary: Command line utilities for Siemens BS-11 BTS -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description bs11-utils -There is a tool in this package for configuring the Siemens BS-11 BTS. -Additionally, it contains one tool for making use of an ISDN-card and the -public telephone network as frequency standard for the E1 line. - -%package meas-utils -Requires: osmocom-latest -Summary: Command line utilities for OsmoBSC's measurement reports -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description meas-utils -This package contains utilities for handling OsmoBSC's measurement reports - * meas_json to convert measurement feed into a JSON feed - -%prep -%setup -n osmo-bsc -q - -%build -echo "%{version}" >.tarball-version -autoreconf -fi -%configure \ - --docdir=%{_docdir}/%{name} \ - --with-systemdsystemunitdir=%{_unitdir} -make %{?_smp_mflags} - -%install -%make_install - -%if 0%{?suse_version} -%preun -%service_del_preun %{name}.service - -%postun -%service_del_postun %{name}.service - -%pre -%service_add_pre %{name}.service - -%post -%service_add_post %{name}.service -%endif - -%check -make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) - -%files -%license COPYING -%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 -%dir %{_docdir}/%{name}/examples/osmo-bsc/siemens -%{_docdir}/%{name}/examples/osmo-bsc/*/osmo-bsc*.cfg -%dir %{_sysconfdir}/osmocom -%config(noreplace) %{_sysconfdir}/osmocom/osmo-bsc.cfg -%{_unitdir}/%{name}.service - -%files abisip-find -%{_bindir}/abisip-find - -%files ipaccess-utils -%{_bindir}/ipaccess-config -%{_bindir}/ipaccess-proxy - -%files bs11-utils -%{_bindir}/bs11_config -%{_bindir}/isdnsync - -%files meas-utils -%{_bindir}/meas_json - -%changelog
View file
osmo-bsc_1.11.1.tar.xz/contrib/osmo-bsc.spec.in
Deleted
@@ -1,155 +0,0 @@ -# -# spec file for package osmo-bsc -# -# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de> -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -## Disable LTO for now since it breaks compilation of the tests -## https://osmocom.org/issues/4113 -%define _lto_cflags %{nil} - -Name: osmo-bsc -Requires: osmocom-latest -Version: @VERSION@ -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: %{name}-%{version}.tar.xz -BuildRequires: automake >= 1.9 -BuildRequires: libtool >= 2 -BuildRequires: pkgconfig >= 0.20 -%if 0%{?suse_version} -BuildRequires: systemd-rpm-macros -%endif -BuildRequires: pkgconfig(libcrypto) >= 0.9.5 -BuildRequires: pkgconfig(libosmo-mgcp-client) >= 1.12.0 -BuildRequires: pkgconfig(libosmo-netif) >= 1.4.0 -BuildRequires: pkgconfig(libosmo-sigtran) >= 1.8.0 -BuildRequires: pkgconfig(libosmoabis) >= 1.5.0 -BuildRequires: pkgconfig(libosmocore) >= 1.9.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.9.0 -BuildRequires: pkgconfig(libosmogb) >= 1.9.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.9.0 -BuildRequires: pkgconfig(libosmovty) >= 1.9.0 -BuildRequires: pkgconfig(talloc) -%{?systemd_requires} - -%description -OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks. - -%package abisip-find -Requires: osmocom-latest -Summary: CLI utility to find ip.access compatible BTS -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description abisip-find -Command line utility to find ip.access compatible BTS. - -%package ipaccess-utils -Requires: osmocom-latest -Summary: Command line utilities for ip.access nanoBTS -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description ipaccess-utils -This package contains utilities that are specific for nanoBTS when being -used together with OpenBSC. It contains mainly two tools: ipaccess-config -and ipaccess-proxy. - -%package bs11-utils -Requires: osmocom-latest -Summary: Command line utilities for Siemens BS-11 BTS -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description bs11-utils -There is a tool in this package for configuring the Siemens BS-11 BTS. -Additionally, it contains one tool for making use of an ISDN-card and the -public telephone network as frequency standard for the E1 line. - -%package meas-utils -Requires: osmocom-latest -Summary: Command line utilities for OsmoBSC's measurement reports -License: GPL-2.0-or-later -Group: Productivity/Telephony/Utilities - -%description meas-utils -This package contains utilities for handling OsmoBSC's measurement reports - * meas_json to convert measurement feed into a JSON feed - -%prep -%setup -q - -%build -echo "%{version}" >.tarball-version -autoreconf -fi -%configure \ - --docdir=%{_docdir}/%{name} \ - --with-systemdsystemunitdir=%{_unitdir} -make %{?_smp_mflags} - -%install -%make_install - -%if 0%{?suse_version} -%preun -%service_del_preun %{name}.service - -%postun -%service_del_postun %{name}.service - -%pre -%service_add_pre %{name}.service - -%post -%service_add_post %{name}.service -%endif - -%check -make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) - -%files -%license COPYING -%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 -%dir %{_docdir}/%{name}/examples/osmo-bsc/siemens -%{_docdir}/%{name}/examples/osmo-bsc/*/osmo-bsc*.cfg -%dir %{_sysconfdir}/osmocom -%config(noreplace) %{_sysconfdir}/osmocom/osmo-bsc.cfg -%{_unitdir}/%{name}.service - -%files abisip-find -%{_bindir}/abisip-find - -%files ipaccess-utils -%{_bindir}/ipaccess-config -%{_bindir}/ipaccess-proxy - -%files bs11-utils -%{_bindir}/bs11_config -%{_bindir}/isdnsync - -%files meas-utils -%{_bindir}/meas_json - -%changelog
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/openbscdefines.h
Deleted
@@ -1,34 +0,0 @@ -/* - * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.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/>. - * - */ - -#ifndef OPENBSCDEFINES_H -#define OPENBSCDEFINES_H - -#ifdef BUILDING_ON_WINDOWS - #ifdef BUILDING_OPENBSC - #define BSC_API __declspec(dllexport) - #else - #define BSC_API __declspec(dllimport) - #endif -#else - #define BSC_API __attribute__((visibility("default"))) -#endif - -#endif
View file
osmo-bsc_1.11.1.dsc -> osmo-bsc_1.12.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.11.1 +Version: 1.12.0 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-bsc Standards-Version: 3.9.8 Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc -Build-Depends: debhelper (>= 10), dh-autoreconf, autotools-dev, autoconf, automake, libtool, pkg-config, python3-minimal, libcdk5-dev, libtalloc-dev, libosmocore-dev (>= 1.9.0), libosmo-sigtran-dev (>= 1.8.0), libosmo-abis-dev (>= 1.5.0), libosmo-netif-dev (>= 1.4.0), libosmo-mgcp-client-dev (>= 1.12.0), osmo-gsm-manuals-dev (>= 1.5.0) +Build-Depends: debhelper (>= 10), dh-autoreconf, autotools-dev, autoconf, automake, libtool, pkg-config, python3-minimal, libcdk5-dev, libtalloc-dev, libosmocore-dev (>= 1.10.0), libosmo-sigtran-dev (>= 1.9.0), libosmo-abis-dev (>= 1.6.0), libosmo-netif-dev (>= 1.5.0), libosmo-mgcp-client-dev (>= 1.13.0), osmo-gsm-manuals-dev (>= 1.6.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: - 1fe619c22b7d81a3831a602ed57d3997926ee4e4 616988 osmo-bsc_1.11.1.tar.xz + 5776bbcc9e58d62c0770a6fdb8e9f6b45654c536 625248 osmo-bsc_1.12.0.tar.xz Checksums-Sha256: - 80f4eab03e584022238d22a8c90cd25197b487a5a76b0be827238c2b86488b15 616988 osmo-bsc_1.11.1.tar.xz + b4f52cfae24b596a6803006a7b974b62d5e9089e526bb91d1522569f22f99c72 625248 osmo-bsc_1.12.0.tar.xz Files: - 0305d2e39a0912de82e478c989038508 616988 osmo-bsc_1.11.1.tar.xz + 64139539a29f6de77d1b26da2af01327 625248 osmo-bsc_1.12.0.tar.xz
View file
osmo-bsc_1.12.0.tar.xz/.github
Added
+(directory)
View file
osmo-bsc_1.12.0.tar.xz/.github/FUNDING.yml
Added
@@ -0,0 +1 @@ +open_collective: osmocom
View file
osmo-bsc_1.11.1.tar.xz/.tarball-version -> osmo-bsc_1.12.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.11.1 +1.12.0
View file
osmo-bsc_1.11.1.tar.xz/Makefile.am -> osmo-bsc_1.12.0.tar.xz/Makefile.am
Changed
@@ -19,7 +19,7 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = \ .version \ - contrib/osmo-bsc.spec.in \ + README.md \ debian \ git-version-gen \ osmoappdesc.py \
View file
osmo-bsc_1.11.1.tar.xz/README.md -> osmo-bsc_1.12.0.tar.xz/README.md
Changed
@@ -2,24 +2,25 @@ ===================================== This repository contains a C-language implementation of a GSM Base Station -Controller (BSC). IT is part of the +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). + + * *A over IP* towards an MSC (e.g. osmo-msc(https://osmocom.org/projects/osmomsc/wiki)): 3GPP AoIP or SCCPlite + * *Abis* interfaces towards various kinds of BTS (e.g. osmo-bts(https://osmocom.org/projects/osmobts/wiki/Wiki), 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(https://osmocom.org/projects/osmo-cbc/wiki)). + * Lb interface towards a *SMLC* (Serving Mobile Location Centre, such as osmo-smlc(https://osmocom.org/projects/osmo-smlc/wiki/OsmoSMLC)). Homepage -------- -You can find the OsmoBSC issue tracker and wiki online at -<https://osmocom.org/projects/osmobsc> and <https://osmocom.org/projects/osmobsc/wiki>. +You can find the OsmoBSC homepage with issue tracker and wiki online at +<https://osmocom.org/projects/osmobsc/wiki>. GIT Repository @@ -49,6 +50,14 @@ describing the level of CBSP conformance. +Forum +----- + +We welcome any osmo-bsc related discussions in the +Cellular Network Infrastructure -> 2G/3G RAN (GERAN)(https://discourse.osmocom.org/c/cni/geran) +section of the osmocom discourse (web based Forum). + + Mailing List ------------ @@ -61,13 +70,22 @@ Rules(https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules) when posting. + +Issue Tracker +------------- + +We use the issue tracker of the osmo-bsc project on osmocom.org(https://osmocom.org/projects/osmobsc/issues) for +tracking the state of bug reports and feature requests. Feel free to submit any issues you may find, or help +us out by resolving existing issues. + + 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 +We use a Gerrit based patch submission/review process for managing contributions. Please see <https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for more details @@ -90,6 +108,3 @@ 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.11.1.tar.xz/TODO-RELEASE -> osmo-bsc_1.12.0.tar.xz/TODO-RELEASE
Changed
@@ -1,9 +1,9 @@ # When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install -# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info -# In short: +# according to https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release +# In short: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info # LIBVERSION=c:r:a # If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. -# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:a. # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. -#library what description / commit summary line +#library what description / commit summary line
View file
osmo-bsc_1.11.1.tar.xz/configure.ac -> osmo-bsc_1.12.0.tar.xz/configure.ac
Changed
@@ -61,14 +61,14 @@ AC_SUBST(osmo_ac_meas_vis) dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.9.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.9.0) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.5.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.4.0) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.8.0) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.12.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.10.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.10.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.6.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.5.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.13.0) dnl checks for header files AC_HEADER_STDC @@ -251,5 +251,4 @@ doc/manuals/Makefile contrib/Makefile contrib/systemd/Makefile - contrib/osmo-bsc.spec Makefile)
View file
osmo-bsc_1.11.1.tar.xz/contrib/systemd/osmo-bsc.service -> osmo-bsc_1.12.0.tar.xz/contrib/systemd/osmo-bsc.service
Changed
@@ -7,8 +7,11 @@ Service Type=simple Restart=always +LimitNOFILE=65536 StateDirectory=osmocom WorkingDirectory=%S/osmocom +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s RestartSec=2
View file
osmo-bsc_1.11.1.tar.xz/debian/changelog -> osmo-bsc_1.12.0.tar.xz/debian/changelog
Changed
@@ -1,11 +1,124 @@ -osmo-bsc (1.11.1) unstable; urgency=medium +osmo-bsc (1.12.0) unstable; urgency=medium + + Vadim Yanitskiy + * struct gsm_bts_trx_ts, gsm_abis_mo: drop unused nm_attr + * bts_siemens_bs11: remove ip.access nanoBTS specific code + * abis_nm: separate parsing of osmo-bts features into a function + * abis_nm: parse feature flags in NM_ATT_IPACC_SUPP_FEATURES + * nm_{bb_transc,bts}_fsm: rework sending of Get Attributes + * abis_nm: get rid of MAX_BTS_ATTR + * gsm_data: refactor/simplify and expose gsm_objclass2mo() + * bts_ipaccess_nanobts: clean up, use gsm_objclass2mo() + * oml: ipacc: parse Object Version from SW Activated Report + * oml: ipacc: log supported features using LOGL_INFO + * oml: ipacc: fix copy-pasted talloc chunk names + * abis_nm: fix bts->nr vs bts->bts_nr + * oml: ipacc: add missing is_ipa_abisip_bts() checks + * abis_nm: handle NM_EV_SW_ACT_REP in ST_OP_DISABLED_{DEPENDENCY,OFFLINE} + * abis_nm: delay configure_loop() until NM_MT_SW_ACTIVATED_REP + * oml: ipacc: send GPRS Cell attributes based on IPA Object Version + * oml: ipacc: fix sending hard-coded GPRS Cell attributes + * abis_nm: send Get Attributes to Rado Carrier MO(s) + * abis_nm: send Get Attributes to GPRS Cell MO(s) + * gsm_data: fix wrong variable set in gsm_pchan2chan_nr() + * gsm_data: use ABIS_RSL_CHAN_NR_CBITS_* in gsm_pchan2chan_nr() + * vgcs_fsm: fix NULL pointer dereference in vgcs_call_fsm_busy() + * Remove unused OpenBSC leftover 'openbscdefines.h' + * build: include README.md into the release tarball + * bsc_ctrl: do not overwrite rc in bsc_base_ctrl_cmds_install() + * lchan_fsm: fix -Wgnu-designator warnings printed by clang + * abis_nm: misc/cosmetic changes to abis_nm_sw_act_req_ack() + * abis_nm: fix -Wunused-but-set-variable (bug) + * README.md: cosmetic: fix a typo + + Harald Welte + * oml: ipacc: print all supported versions of MOs + * fix spelling s/omso/osmo/ in bts_variant_names + * Fix license header in various source code files. + * bsc_ctrl_lookup.c: Use AGPLv3, not GPLv2 + * CBSP: Port over to use osmo_io via libosmo-netif + * Add funding link to github mirror + * README.md: Overhaul (more links, fix markdown formatting) + * README.md Add Forum + Issue Tracker sections + + Matan Perelman + * si2quater: Invalidate thresh_lo, prio and qrxlm when needed + * ctrl: Add cell barred + * ctrl: Add rxlev access min control + * abis_rsl: Add rach expiry timeout + * ctrl: Add rach expiry timeout + * ctrl: Add radio link timeout + * vty: Ensure radio-link-timeout is a multiple of 4 + * ctrl: Fix missing reply in set_bts_cell_reselection_offset + * ctrl: Add rach max transmission + * ctrl: Add ms max power + * ctrl: Remove unused vty includes + * ctrl: Split bts_trx_ts_ctrl from bts_trx_ctrl + * ctrl: Add ms power + * ctrl: Add lchan show + * ctrl: Add lchan show to all ctrl levels + + Pau Espin Pedrol + * sccplite: Support multiple MGW in MGW pool + * Drop unused local var + * abis_nm_sw_act_req_ack: attr_len should be unsigned + * lb: Log name of unhandled sigtran primitive + * cbsp_link.c: Update somo_stream read_cb2 functions to accommodate for new API param + + Oliver Smith + * vty: make NCC Permitted (SI2) configurable + * recover BORKEN lchans for missing ACK scenarios + * vty: show mscs: tweak output + * vty: show mscs: add BSSMAP state + * .deb/.rpm: various fixes related to non-root + * contrib: remove rpm spec file + * debian/postinst: add checks, be verbose + + arehbein + * meas_feed: Use osmo_io instead of write queue + * osmo-bsc: Have PCU socket connection use osmo_wqueue + * bsc: Make socket queue max. length configurable Philipp Maier * pcuif_proto: rename PCU_IF_FLAG_SYSMO to PCU_IF_FLAG_DIRECT_PHY * pcuif_proto: clean up last remains of old PCUIF v10 * pcuif_proto: signal BTS model via PCUIF - -- Oliver Smith <osmith@sysmocom.de> Tue, 12 Dec 2023 16:53:00 +0100 + Andreas Eversberg + * Do not generate 'bit map 0' neighbor lists with R-GSM ARFCN + * Select correct neighbor list for measurement report decoding + * ASCI: Make neigh_list_get_arfcn() available to other users + * ASCI: Add System Information 10 support + * SI10: Fix uninitialized l_bts pointer + * SI10: Fix uninitialized last_i index + * ASCI: Repeat notification after assigning MS to VGCS/VBS channel + * Use uniform log format for default config files + * Only check for intersecting AMR codec support on matching TS rate + * Also track downtime when OML link is lost + * VTY: Add command `show bts brief` + * Add vty commands "no gprs nsvc ..." + + Neels Hofmeyr + * use X6 timer for REL ACK, not T3111 + * systemd,manual: set LimitNOFILE=65536 + * vty: disallow combination of early-IA and frequency hopping + * err log: output sigtran prim name instead of number + * silence error message for N-STATE prim + + Keith Whyte + * VTY: fix config indentation for pcu-socket params + + Max + * .deb/.rpm: add osmocom user during package install + + Alexander Couzens + * ipaccess-config: fix crash when doing test procedures + * ipaccess-config: rename build_physconf to build_physconf_arfcn_by_rxlev + + Mychaela N. Falconia + * add support for RTP extensions via TW-TS-003 + + -- Oliver Smith <osmith@sysmocom.de> Wed, 24 Jul 2024 17:00:06 +0200 osmo-bsc (1.11.0) unstable; urgency=medium
View file
osmo-bsc_1.11.1.tar.xz/debian/control -> osmo-bsc_1.12.0.tar.xz/debian/control
Changed
@@ -12,12 +12,12 @@ python3-minimal, libcdk5-dev, libtalloc-dev, - libosmocore-dev (>= 1.9.0), - libosmo-sigtran-dev (>= 1.8.0), - libosmo-abis-dev (>= 1.5.0), - libosmo-netif-dev (>= 1.4.0), - libosmo-mgcp-client-dev (>= 1.12.0), - osmo-gsm-manuals-dev (>= 1.5.0) + libosmocore-dev (>= 1.10.0), + libosmo-sigtran-dev (>= 1.9.0), + libosmo-abis-dev (>= 1.6.0), + libosmo-netif-dev (>= 1.5.0), + libosmo-mgcp-client-dev (>= 1.13.0), + osmo-gsm-manuals-dev (>= 1.6.0) Standards-Version: 3.9.8 Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc
View file
osmo-bsc_1.11.1.tar.xz/debian/copyright -> osmo-bsc_1.12.0.tar.xz/debian/copyright
Changed
@@ -25,31 +25,6 @@ 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/>. -Files: src/libbsc/bsc_ctrl_lookup.c - src/libbsc/pcu_sock.c -Copyright: 2008-2010 Harald Welte <laforge@gnumonks.org> - 2009-2012 Andreas Eversberg <jolly@eversberg.eu> - 2010-2011 Daniel Willmann <daniel@totalueberwachung.de> - 2010-2011 On-Waves - 2012 Holger Hans Peter Freyther -License: GPL-2.0+ - 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 2 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, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - . - On Debian systems, the complete text of the GNU General Public License - Version 2 can be found in `/usr/share/common-licenses/GPL-2'. - Files: osmoappdesc.py Copyright: 2013 Katerina Barone-Adesi <kat.obsc@gmail.com> License: GPL-3.0+
View file
osmo-bsc_1.12.0.tar.xz/debian/postinst
Added
@@ -0,0 +1,38 @@ +#!/bin/sh -e +case "$1" in + configure) + # Create the osmocom group and user (if it doesn't exist yet) + if ! getent group osmocom >/dev/null; then + groupadd --system osmocom + fi + if ! getent passwd osmocom >/dev/null; then + useradd \ + --system \ + --gid osmocom \ + --home-dir /var/lib/osmocom \ + --shell /sbin/nologin \ + --comment "Open Source Mobile Communications" \ + osmocom + fi + + # Fix permissions of previous (root-owned) install (OS#4107) + if dpkg --compare-versions "$2" le "1.12.0"; then + if -e /etc/osmocom/osmo-bsc.cfg ; then + chown -v osmocom:osmocom /etc/osmocom/osmo-bsc.cfg + chmod -v 0660 /etc/osmocom/osmo-bsc.cfg + fi + + if -d /etc/osmocom ; then + chown -v root:osmocom /etc/osmocom + chmod -v 2775 /etc/osmocom + fi + + mkdir -p /var/lib/osmocom + chown -R -v osmocom:osmocom /var/lib/osmocom + fi + ;; +esac + +# dh_installdeb(1) will replace this with shell code automatically +# generated by other debhelper scripts. +#DEBHELPER#
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus01-4trx.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus01-4trx.cfg
Changed
@@ -7,6 +7,12 @@ no login ! log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level lmi info logging level linp info logging level nm debug
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-16kbps.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-16kbps.cfg
Changed
@@ -10,6 +10,12 @@ no login ! log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level lmi info logging level linp info logging level nm debug
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-64kbps.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-64kbps.cfg
Changed
@@ -7,6 +7,12 @@ no login ! log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level lmi info logging level linp info logging level nm debug
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-4trx.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-4trx.cfg
Changed
@@ -7,6 +7,12 @@ no login ! log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level lmi info logging level linp info logging level nm debug
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-8trx.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-8trx.cfg
Changed
@@ -7,6 +7,12 @@ no login ! log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level lmi info logging level linp info logging level nm debug
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg
Changed
@@ -7,6 +7,12 @@ no login ! log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level lmi info logging level linp info logging level nm debug
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg
Changed
@@ -11,7 +11,9 @@ logging color 1 logging print category-hex 0 logging print category 1 - logging print file 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level llapd notice logging level nm debug e1_input
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/osmo-bsc-4trx.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc-4trx.cfg
Changed
@@ -1,4 +1,12 @@ ! osmo-bsc configuration example with 4 TRX +log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 + e1_input e1_line 0 driver ipa network
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
Changed
@@ -1,3 +1,11 @@ +log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 + network network country code 901 mobile network code 70
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/osmo-bsc.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc.cfg
Changed
@@ -1,6 +1,14 @@ ! osmo-bsc default configuration ! (assumes STP to run on 127.0.0.1 and uses default point codes) ! +log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 + e1_input e1_line 0 driver ipa network
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
Changed
@@ -1,5 +1,13 @@ ! osmo-bsc configuration example for custom SCCP addresses ! +log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 + e1_input e1_line 0 driver ipa network
View file
osmo-bsc_1.11.1.tar.xz/doc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg -> osmo-bsc_1.12.0.tar.xz/doc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg
Changed
@@ -11,8 +11,9 @@ logging color 1 logging print category-hex 0 logging print category 1 - logging timestamp 1 - logging print file 1 + logging timestamp 0 + logging print file basename last + logging print level 1 logging level llapd notice logging level linp notice logging level lmi notice
View file
osmo-bsc_1.11.1.tar.xz/doc/lchan-fsm.dot -> osmo-bsc_1.12.0.tar.xz/doc/lchan-fsm.dot
Changed
@@ -32,6 +32,7 @@ WAIT_TS_READY -> UNUSED label="error/timeout",style=dashed,constraint=false {WAIT_ACTIV_ACK,WAIT_RF_RELEASE_ACK} -> BORKEN label="error/timeout",style=dashed BORKEN -> WAIT_AFTER_ERROR label="late RF Release ACK" + BORKEN -> WAIT_RF_RELEASE_ACK label="late Activation ACK" WAIT_RLL_RTP_ESTABLISH -> WAIT_RLL_RTP_RELEASED label=error,style=dashed WAIT_ACTIV_ACK -> rtp label="LCHAN_RTP_EV_LCHAN_READY",style=dotted @@ -44,4 +45,13 @@ WAIT_RSL_CHAN_MODE_MODIFY_ACK -> ESTABLISHED label="LCHAN_EV_RSL_CHAN_MODE_MODIFY_ACK\nno change to RTP" WAIT_RR_CHAN_MODE_MODIFY_ACK -> BORKEN label="error/timeout",style=dashed WAIT_RSL_CHAN_MODE_MODIFY_ACK -> BORKEN label="error/timeout",style=dashed + + BORKEN -> RECOVER_WAIT_ACTIV_ACK label="X28" + RECOVER_WAIT_ACTIV_ACK -> BORKEN label="error/timeout",style=dashed + + RECOVER_WAIT_ACTIV_ACK -> UNUSED label="rx ACK" + RECOVER_WAIT_ACTIV_ACK -> RECOVER_WAIT_RF_RELEASE_ACK label="rx NACK" + + RECOVER_WAIT_RF_RELEASE_ACK -> UNUSED label="rx ACK" + RECOVER_WAIT_RF_RELEASE_ACK -> BORKEN label="error/timeout",style=dashed }
View file
osmo-bsc_1.11.1.tar.xz/doc/manuals/chapters/running.adoc -> osmo-bsc_1.12.0.tar.xz/doc/manuals/chapters/running.adoc
Changed
@@ -69,6 +69,24 @@ has to configure a distinct point-code. See <<cs7_config>>. +=== Configure limits + +When connecting hundreds of TRX to OsmoBSC, it may be necessary to adjust the +operating system's limit on open file descriptors for the osmo-bsc process. A +typical default limit imposed by operating systems is 1024; this would be +exceeded by, for example, about 205 BTS with 4 TRX each. (Each BTS with 4 TRX +requires 5 file descriptors for Abis; 205 * 5 already exceeds 1024, sockets for +other interfaces not considered yet.) + +It should be ok to set an OS limit on open file descriptors as high as 65536 +for osmo-bsc, which practically rules out failure from running out of file +descriptors anywhere (<50,000 TRX). + +When using systemd, the file descriptor limit may be adjusted in the service +file by the `LimitNOFILE` setting ("Number of Open FILE descriptors"). OsmoBSC +ships a systemd service file with a high LimitNOFILE setting. + + === Configure primary links ==== Connect to an MSC's _A_ interface
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/Makefile.am -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/Makefile.am
Changed
@@ -46,7 +46,6 @@ neighbor_ident.h \ network_listen.h \ nm_common_fsm.h \ - openbscdefines.h \ osmo_bsc.h \ osmo_bsc_grace.h \ osmo_bsc_rf.h \
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/abis_nm.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/abis_nm.h
Changed
@@ -29,9 +29,6 @@ #include <osmocom/bsc/gsm_data.h> #include <osmocom/bsc/signal.h> -/* max number of attributes represented as 3GPP TS 52.021 §9.4.62 SW Description array */ -#define MAX_BTS_ATTR 5 - /* The BCCH info from an ip.access test, in host byte order * and already parsed... */ struct ipac_bcch_info { @@ -89,7 +86,8 @@ int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len); int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb); int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1, - uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len); + uint8_t i2, uint8_t i3, int nack, + const uint8_t *attr, unsigned int attr_len); int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *msg); int abis_nm_event_reports(struct gsm_bts *bts, int on); int abis_nm_reset_resource(struct gsm_bts *bts);
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/bts.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/bts.h
Changed
@@ -375,8 +375,8 @@ struct e1inp_sign_link *oml_link; /* Timer to use for deferred drop of OML link, see \ref ipaccess_drop_oml_deferred */ struct osmo_timer_list oml_drop_link_timer; - /* when OML link was established */ - time_t uptime; + /* when OML link was established or lost */ + time_t updowntime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; @@ -663,6 +663,9 @@ /* We will ignore CHAN RQD with access delay greater than rach_max_delay */ uint8_t rach_max_delay; + /* We will ignore CHAN RQD sitting in the queue for period greater than rach_expiry_timeout */ + uint8_t rach_expiry_timeout; + /* Is Fast return to LTE allowed during Chan Release in this BTS? */ bool srvcc_fast_return_allowed; @@ -692,6 +695,17 @@ return false; } +static inline bool is_nanobts(const struct gsm_bts *bts) +{ + switch (bts->type) { + case GSM_BTS_TYPE_NANOBTS: + return true; + default: + break; + } + return false; +} + static inline bool is_osmobts(const struct gsm_bts *bts) { switch (bts->type) { @@ -801,7 +815,7 @@ #define BTS_STORE_UPTIME_INTERVAL 10 /* in seconds */ void bts_store_uptime(struct gsm_bts *bts); -unsigned long long bts_uptime(const struct gsm_bts *bts); +unsigned long long bts_updowntime(const struct gsm_bts *bts); #define BTS_STORE_LCHAN_DURATIONS_INTERVAL 1 /* in seconds */ void bts_store_lchan_durations(struct gsm_bts *bts);
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h
Changed
@@ -23,12 +23,19 @@ #include <stdint.h> #include <osmocom/core/msgb.h> +#include <osmocom/gsm/tlv.h> struct gsm_bts_sm; struct gsm_bts; struct gsm_bts_trx; struct gsm_gprs_nsvc; +extern const struct tlv_definition ipacc_eie_tlv_def; + +int ipacc_parse_supp_features(const struct gsm_bts *bts, + const struct abis_om_fom_hdr *foh, + const uint8_t *data, uint16_t data_len); + 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);
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/bts_sm.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/bts_sm.h
Changed
@@ -40,6 +40,7 @@ /* data read via VTY config file, to configure the BTS * via OML from BSC */ int id; + bool enabled; uint16_t nsvci; uint16_t local_port; /* on the BTS */ struct osmo_sockaddr remote;
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/bts_trx.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/bts_trx.h
Changed
@@ -43,7 +43,6 @@ struct e1inp_sign_link *oml_link; struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; struct gsm_bts_bb_trx bb_transc; uint16_t arfcn;
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/ctrl.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/ctrl.h
Changed
@@ -1,6 +1,7 @@ #pragma once #include <osmocom/ctrl/control_cmd.h> +#include <osmocom/bsc/gsm_data.h> struct gsm_network; struct gsm_bts; @@ -11,8 +12,14 @@ /* Used internally in different ctrl source code files: */ int bsc_bts_ctrl_cmds_install(void); int bsc_bts_trx_ctrl_cmds_install(void); +int bsc_bts_trx_ts_ctrl_cmds_install(void); +int bsc_bts_trx_ts_lchan_ctrl_cmds_install(void); void ctrl_generate_bts_location_state_trap(struct gsm_bts *bts, struct bsc_msc_data *msc); void osmo_bsc_send_trap(struct ctrl_cmd *cmd, struct bsc_msc_data *msc_data); +char *lchan_dump_full_ctrl(const void *t, struct gsm_lchan *lchan); +char *ts_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx_ts *ts); +char *trx_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx *trx); +char *bts_lchan_dump_full_ctrl(const void *t, struct gsm_bts *bts); enum bsc_ctrl_node {
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/gsm_04_08_rr.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/gsm_04_08_rr.h
Changed
@@ -2,6 +2,7 @@ #include <stdint.h> #include <osmocom/core/msgb.h> +#include <osmocom/core/bitvec.h> enum handover_scope; @@ -37,6 +38,7 @@ int gsm48_send_uplink_busy(struct gsm_lchan *lchan); int gsm48_send_uplink_free(struct gsm_lchan *lchan, uint8_t acc_bit, uint8_t *uic); int gsm48_rx_rr_modif_ack(struct msgb *msg); +int neigh_list_get_arfcn(struct gsm_bts *bts, const struct bitvec *nbv, unsigned int idx); int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg); struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/gsm_data.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/gsm_data.h
Changed
@@ -150,6 +150,7 @@ uint16_t msc_rtp_port; bool use_osmux; uint8_t osmux_cid; + uint8_t rtp_extensions; /* Rate/codec setting in preference order (need at least 1 !) */ int n_ch_mode_rate; @@ -359,6 +360,7 @@ /* RTP address where the MSC expects us to send the RTP stream coming from the BTS. */ char msc_assigned_rtp_addrINET6_ADDRSTRLEN; uint16_t msc_assigned_rtp_port; + uint8_t rtp_extensions; /* The endpoint at the MGW used to join both BTS and MSC side connections, e.g. * "rtpbridge/23@mgw". */ @@ -526,9 +528,9 @@ struct abis_om_obj_inst obj_inst; const char *name; struct gsm_nm_state nm_state; - struct tlv_parsed *nm_attr; struct gsm_bts *bts; struct osmo_fsm_inst *fi; + bool sw_act_rep_received; bool opstart_sent; bool adm_unlock_sent; bool get_attr_sent; @@ -538,6 +540,12 @@ bool rsl_connect_sent; bool rsl_connect_ack_received; bool force_rf_lock; + /* vendor specific fields below */ + union { + struct { + uint8_t obj_version; + } ipaccess; + }; }; /* Ericsson OM2000 Managed Object */ @@ -668,7 +676,6 @@ bool is_rsl_ready; struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; uint8_t nm_chan_comb; int tsc; /* -1 == use BTS TSC */ @@ -892,6 +899,8 @@ void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3); +struct gsm_abis_mo *gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst); struct gsm_nm_state * gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, const struct abis_om_obj_inst *obj_inst); @@ -1061,6 +1070,7 @@ /* PCU socket state */ char *pcu_sock_path; + unsigned int pcu_sock_wqueue_len_max; struct pcu_sock_state *pcu_state; };
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/lchan_fsm.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/lchan_fsm.h
Changed
@@ -33,6 +33,8 @@ LCHAN_ST_WAIT_RF_RELEASE_ACK, LCHAN_ST_WAIT_AFTER_ERROR, LCHAN_ST_BORKEN, + LCHAN_ST_RECOVER_WAIT_ACTIV_ACK, /*< Attempt to recover from BORKEN: first try to activate the lchan */ + LCHAN_ST_RECOVER_WAIT_RF_RELEASE_ACK, /*< Attempt to recover from BORKEN: then try to release it */ }; enum lchan_fsm_event {
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/meas_feed.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/meas_feed.h
Changed
@@ -35,12 +35,12 @@ }; #define MEAS_FEED_VERSION 1 -#define MEAS_FEED_WQUEUE_MAX_LEN_DEFAULT 100 +#define MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT 100 int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port); void meas_feed_scenario_set(const char *name); -void meas_feed_wqueue_max_length_set(unsigned int max_length); +void meas_feed_txqueue_max_length_set(unsigned int max_length); void meas_feed_cfg_get(char **host, uint16_t *port); const char *meas_feed_scenario_get(void); -unsigned int meas_feed_wqueue_max_length_get(void); +unsigned int meas_feed_txqueue_max_length_get(void);
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/pcu_if.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/pcu_if.h
Changed
@@ -1,17 +1,19 @@ #ifndef _PCU_IF_H #define _PCU_IF_H +#include <osmocom/core/write_queue.h> #include <osmocom/gsm/l1sap.h> extern int pcu_direct; #define PCUIF_HDR_SIZE (sizeof(struct gsm_pcu_if) - sizeof(((struct gsm_pcu_if *)0)->u)) +#define BSC_PCU_SOCK_WQUEUE_LEN_DEFAULT 100 + struct pcu_sock_state { struct gsm_network *net; /* backpointer to GSM network */ struct osmo_fd listen_bfd; /* fd for listen socket */ - struct osmo_fd conn_bfd; /* fd for connection to lcr */ - struct llist_head upqueue; /* queue for sending messages */ + struct osmo_wqueue upqueue; /* For sending messages; has fd for conn. to PCU */ }; /* Check if BTS has a PCU connection */
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/system_information.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/system_information.h
Changed
@@ -5,18 +5,24 @@ #include <osmocom/gsm/gsm48_arfcn_range_encode.h> +/* Complete length of SYSTEM INFORMATION 10 (SACCH) */ +#define SI10_LENGTH 21 + struct gsm_bts; int band_compatible(const struct gsm_bts *bts, int arfcn); int generate_cell_chan_alloc(struct gsm_bts *bts); int generate_cell_chan_list(uint8_t *chan_list, struct gsm_bts *bts); int gsm_generate_si(struct gsm_bts *bts, enum osmo_sysinfo_type type); +int gsm_generate_si10(struct gsm48_system_information_type_10 *si10, size_t len, + const struct gsm_subscriber_connection *conn); size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e); unsigned range1024_p(unsigned n); unsigned range512_q(unsigned m); int range_encode(enum osmo_gsm48_range r, int *arfcns, int arfcns_used, int *w, int f0, uint8_t *chan_list); uint8_t si2q_num(struct gsm_bts *bts); +int bts_earfcn_del(struct gsm_bts *bts, uint16_t earfcn); int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, uint8_t qrx, uint8_t meas_bw); int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble);
View file
osmo-bsc_1.11.1.tar.xz/include/osmocom/bsc/vty.h -> osmo-bsc_1.12.0.tar.xz/include/osmocom/bsc/vty.h
Changed
@@ -51,6 +51,7 @@ int bts_vty_init(void); void bts_dump_vty(struct vty *vty, struct gsm_bts *bts); +void bts_dump_vty_oml_link_state(struct vty *vty, struct gsm_bts *bts); void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx, bool print_rsl, bool show_connected); void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts); void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan);
View file
osmo-bsc_1.11.1.tar.xz/src/ipaccess/ipaccess-config.c -> osmo-bsc_1.12.0.tar.xz/src/ipaccess/ipaccess-config.c
Changed
@@ -212,7 +212,7 @@ static const uint8_t phys_conf_min = { 0x02 }; -static uint16_t build_physconf(uint8_t *physconf_buf, const struct rxlev_stats *st) +static uint16_t build_physconf_arfcn_by_rxlev(uint8_t *physconf_buf, const struct rxlev_stats *st) { uint16_t *whitelist = (uint16_t *) (physconf_buf + 4); int num_arfcn; @@ -244,7 +244,7 @@ /* Dump RxLev results */ //rxlev_stat_dump(&trx->ipaccess.rxlev_stat); /* Create whitelist from results */ - physconf_len = build_physconf(physconf_buf, + physconf_len = build_physconf_arfcn_by_rxlev(physconf_buf, &trx->ipaccess.rxlev_stat); /* Start next test about BCCH channel usage */ ipac_nwl_test_start(trx, NM_IPACC_TESTNO_BCCH_CHAN_USAGE, @@ -254,7 +254,7 @@ /* Dump BCCH RxLev results */ //rxlev_stat_dump(&trx->ipaccess.rxlev_stat); /* Create whitelist from results */ - physconf_len = build_physconf(physconf_buf, + physconf_len = build_physconf_arfcn_by_rxlev(physconf_buf, &trx->ipaccess.rxlev_stat); /* Start next test about BCCH info */ ipac_nwl_test_start(trx, NM_IPACC_TESTNO_BCCH_INFO,
View file
osmo-bsc_1.11.1.tar.xz/src/ipaccess/network_listen.c -> osmo-bsc_1.12.0.tar.xz/src/ipaccess/network_listen.c
Changed
@@ -98,6 +98,7 @@ memcpy(payload, phys_conf, phys_conf_len); } + msg->l3h = msg->data; abis_nm_perform_test(trx->bts, NM_OC_RADIO_CARRIER, 0, trx->nr, 0xff, testnr, 1, msg); trx->ipaccess.test_nr = testnr;
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/Makefile.am -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/Makefile.am
Changed
@@ -46,6 +46,8 @@ bts.c \ bts_trx.c \ bts_trx_ctrl.c \ + bts_trx_ts_ctrl.c \ + bts_trx_ts_lchan_ctrl.c \ bts_ericsson_rbs2000.c \ bts_init.c \ bts_ipaccess_nanobts.c \
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/abis_nm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/abis_nm.c
Changed
@@ -52,11 +52,15 @@ #include <osmocom/bsc/nm_common_fsm.h> #include <osmocom/gsm/bts_features.h> #include <osmocom/bsc/ipaccess.h> +#include <osmocom/bsc/bts_ipaccess_nanobts_omlattr.h> #define OM_ALLOC_SIZE 1024 #define OM_HEADROOM_SIZE 128 #define IPACC_SEGMENT_SIZE 245 +/* max number of SW Description IEs we can parse */ +#define SW_DESCR_MAX 5 + #define LOGPMO(mo, ss, lvl, fmt, args ...) \ LOGP(ss, lvl, "OC=%s(%02x) INST=(%02x,%02x,%02x): " fmt, \ get_value_string(abis_nm_obj_class_names, (mo)->obj_class), \ @@ -560,6 +564,45 @@ return ari + num_unreported + 1; /* we have to account for 1st byte with number of unreported attributes */ } +/* Parse Attribute Response Info content for 3GPP TS 52.021 §9.4.30 Manufacturer Id */ +static void parse_osmo_bts_features(struct gsm_bts *bts, + const uint8_t *data, uint16_t data_len) +{ + /* log potential BTS feature vector overflow */ + if (data_len > sizeof(bts->_features_data)) { + LOGPMO(&bts->mo, DNM, LOGL_NOTICE, + "Get Attributes Response: feature vector is truncated " + "(from %u to %zu bytes)\n", data_len, sizeof(bts->_features_data)); + data_len = sizeof(bts->_features_data); + } + + /* check that max. expected BTS attribute is above given feature vector length */ + if (data_len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT)) { + LOGPMO(&bts->mo, DNM, LOGL_NOTICE, + "Get Attributes Response: reported unexpectedly long (%u bytes) " + "feature vector - most likely it was compiled against newer BSC headers. " + "Consider upgrading your BSC to later version.\n", data_len); + } + + memcpy(bts->_features_data, data, data_len); + bts->features_known = true; + + /* Log each BTS feature in the reported vector */ + for (unsigned int i = 0; i < data_len * 8; i++) { + if (!osmo_bts_has_feature(&bts->features, i)) + continue; + + 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)); + } + } +} + /* Handle 3GPP TS 52.021 §8.11.3 Get Attribute Response (with nanoBTS specific attribute formatting) */ static int parse_attr_resp_info_attr(struct gsm_bts *bts, const struct gsm_bts_trx *trx, struct abis_om_fom_hdr *foh, struct tlv_parsed *tp) { @@ -570,42 +613,22 @@ uint16_t port; struct in_addr ia = {0}; char unit_id40; - struct abis_nm_sw_desc sw_descrMAX_BTS_ATTR; - /* Parse Attribute Response Info content for 3GPP TS 52.021 §9.4.30 Manufacturer Id */ - if (bts->type == GSM_BTS_TYPE_OSMOBTS && TLVP_PRES_LEN(tp, NM_ATT_MANUF_ID, 2)) { - len = TLVP_LEN(tp, NM_ATT_MANUF_ID); - - /* log potential BTS feature vector overflow */ - if (len > sizeof(bts->_features_data)) { - LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: feature vector is truncated " - "(from %u to %zu bytes)\n", len, sizeof(bts->_features_data)); - len = sizeof(bts->_features_data); - } - - /* check that max. expected BTS attribute is above given feature vector length */ - if (len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT)) { - LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: reported unexpectedly long (%u bytes) " - "feature vector - most likely it was compiled against newer BSC headers. " - "Consider upgrading your BSC to later version.\n", len); - } - - memcpy(bts->_features_data, TLVP_VAL(tp, NM_ATT_MANUF_ID), len); - bts->features_known = true; - - /* Log each BTS feature in the reported vector */ - for (i = 0; i < len * 8; i++) { - if (!osmo_bts_has_feature(&bts->features, i)) - continue; - - 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)); + switch (bts->type) { + case GSM_BTS_TYPE_OSMOBTS: + if (TLVP_PRES_LEN(tp, NM_ATT_MANUF_ID, 2)) { + parse_osmo_bts_features(bts, TLVP_VAL(tp, NM_ATT_MANUF_ID), + TLVP_LEN(tp, NM_ATT_MANUF_ID)); } - + /* fall-through */ + case GSM_BTS_TYPE_NANOBTS: + if (TLVP_PRESENT(tp, NM_ATT_IPACC_SUPP_FEATURES)) { + ipacc_parse_supp_features(bts, foh, TLVP_VAL(tp, NM_ATT_IPACC_SUPP_FEATURES), + TLVP_LEN(tp, NM_ATT_IPACC_SUPP_FEATURES)); + } + break; + default: + break; } /* Parse Attribute Response Info content for 3GPP TS 52.021 §9.4.28 Manufacturer Dependent State */ @@ -617,6 +640,7 @@ /* Parse Attribute Response Info content for 3GPP TS 52.021 §9.4.61 SW Configuration */ if (TLVP_PRESENT(tp, NM_ATT_SW_CONFIG)) { + struct abis_nm_sw_desc sw_descrSW_DESCR_MAX; data = TLVP_VAL(tp, NM_ATT_SW_CONFIG); len = TLVP_LEN(tp, NM_ATT_SW_CONFIG); /* after parsing manufacturer-specific attributes there's list of replies in form of sw-conf structure: */ @@ -728,15 +752,20 @@ struct tlv_parsed tp; const uint8_t *sw_config; int ret, sw_config_len, len; - struct abis_nm_sw_desc sw_descrMAX_BTS_ATTR; + struct abis_nm_sw_desc sw_descrSW_DESCR_MAX; DEBUGPFOH(DNM, foh, "Software Activate Request, ACKing and Activating\n"); + if (oh->length < sizeof(*foh)) { + LOGPFOH(DNM, LOGL_ERROR, foh, "Software Activate Request with length too small: %u\n", oh->length); + return -EINVAL; + } + ret = abis_nm_sw_act_req_ack(sign_link->trx->bts, foh->obj_class, foh->obj_inst.bts_nr, foh->obj_inst.trx_nr, foh->obj_inst.ts_nr, 0, - foh->data, oh->length-sizeof(*foh)); + foh->data, oh->length - sizeof(*foh)); if (ret != 0) { LOGPFOH(DNM, LOGL_ERROR, foh, "Sending SW ActReq ACK failed: %d\n", ret); return ret; @@ -1669,7 +1698,7 @@ break; case GSM_BTS_TYPE_NANOBTS: sw->obj_class = NM_OC_BASEB_TRANSC; - sw->obj_instance0 = sw->bts->nr; + sw->obj_instance0 = sw->bts->bts_nr; sw->obj_instance1 = sw->trx_nr; sw->obj_instance2 = 0xff; break; @@ -2140,12 +2169,13 @@ } int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1, - uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len) + uint8_t i2, uint8_t i3, int nack, + const uint8_t *attr, unsigned int attr_len) { struct abis_om_hdr *oh; struct msgb *msg = nm_msgb_alloc(); uint8_t msgtype = NM_MT_SW_ACT_REQ_ACK; - uint8_t len = att_len; + uint8_t len = attr_len; if (nack) { len += 2; @@ -2153,12 +2183,10 @@ } oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); - fill_om_fom_hdr(oh, att_len, msgtype, obj_class, i1, i2, i3); + fill_om_fom_hdr(oh, len, msgtype, obj_class, i1, i2, i3); - if (attr) { - uint8_t *ptr = msgb_put(msg, att_len); - memcpy(ptr, attr, att_len); - } + if (attr != NULL && attr_len > 0) + memcpy(msgb_put(msg, attr_len), attr, attr_len); if (nack) msgb_tv_put(msg, NM_ATT_NACK_CAUSES, NM_NACK_OBJCLASS_NOTSUPP); @@ -3078,7 +3106,7 @@ oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, 0, NM_MT_IPACC_RESTART, NM_OC_BASEB_TRANSC, - trx->bts->nr, trx->nr, 0xff); + trx->bts->bts_nr, trx->nr, 0xff); return abis_nm_sendmsg_direct(trx->bts, msg); }
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/abis_rsl.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/abis_rsl.c
Changed
@@ -1975,7 +1975,6 @@ * requests from the queue to prevent the queue from growing indefinetly. */ static void reduce_rach_dos(struct gsm_bts *bts) { - int rlt = gsm_bts_get_radio_link_timeout(bts); time_t timestamp_current = time(NULL); struct chan_rqd *rqd; struct chan_rqd *rqd_tmp; @@ -1983,9 +1982,9 @@ /* Drop all expired channel requests in the list */ llist_for_each_entry_safe(rqd, rqd_tmp, &bts->chan_rqd_queue, entry) { - /* If the channel request is older than the radio link timeout we drop it. This also means that the + /* If the channel request is older than the rach expiry timeout we drop it. This also means that the * queue is under its overflow limit again. */ - if (timestamp_current - rqd->timestamp > rlt) { + if (timestamp_current - rqd->timestamp > bts->rach_expiry_timeout) { LOG_BTS(bts, DRSL, LOGL_INFO, "CHAN RQD: tossing expired channel request" "(ra=0x%02x, neci=0x%02x, chreq_reason=0x%02x)\n", rqd->ref.ra, bts->network->neci, rqd->reason); @@ -3034,6 +3033,11 @@ if (lchan->abis_ip.osmux.use) msgb_tlv_put(msg, RSL_IE_OSMO_OSMUX_CID, 1, &lchan->abis_ip.osmux.local_cid); + /* Are we serving a GSM subscriber for whom the CN requested + * the use of RTP extensions? */ + if (lchan->conn && lchan->conn->user_plane.rtp_extensions) + msgb_tlv_put(msg, RSL_IE_OSMO_RTP_EXTENSIONS, 1, + &lchan->conn->user_plane.rtp_extensions); msg->dst = rsl_chan_link(lchan); @@ -3078,6 +3082,9 @@ msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD2, lchan->abis_ip.rtp_payload2); if (lchan->abis_ip.osmux.use) msgb_tlv_put(msg, RSL_IE_OSMO_OSMUX_CID, 1, &lchan->abis_ip.osmux.local_cid); + if (lchan->conn && lchan->conn->user_plane.rtp_extensions) + msgb_tlv_put(msg, RSL_IE_OSMO_RTP_EXTENSIONS, 1, + &lchan->conn->user_plane.rtp_extensions); msg->dst = rsl_chan_link(lchan);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/assignment_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/assignment_fsm.c
Changed
@@ -22,6 +22,8 @@ #include <osmocom/core/tdef.h> #include <osmocom/gsm/gsm0808.h> +#include <osmocom/gsm/rtp_extensions.h> +#include <osmocom/gsm/bts_features.h> #include <osmocom/mgcp_client/mgcp_client_endpoint_fsm.h> @@ -172,6 +174,13 @@ msg->l3h1 = msgb_l3len(msg) - 2; } +static void bssap_extend_twts003(struct msgb *msg, uint8_t accepted_ext) +{ + OSMO_ASSERT(msg->l3h1 == msgb_l3len(msg) - 2); /*TL not in len */ + msgb_tlv_put(msg, GSM0808_IE_THEMWI_RTP_EXTENSIONS, 1, &accepted_ext); + msg->l3h1 = msgb_l3len(msg) - 2; +} + static void send_assignment_complete(struct gsm_subscriber_connection *conn) { int rc; @@ -267,6 +276,9 @@ conn->assignment.req.use_osmux) bssap_extend_osmux(resp, osmux_cid); + if (conn->user_plane.rtp_extensions) + bssap_extend_twts003(resp, conn->user_plane.rtp_extensions); + rate_ctr_inc(rate_ctr_group_get_ctr(conn->sccp.msc->msc_ctrs, MSC_CTR_BSSMAP_TX_DT1_ASSIGNMENT_COMPLETE)); rc = gscon_sigtran_send(conn, resp); if (rc) { @@ -478,6 +490,7 @@ .aoip = gscon_is_aoip(conn), .msc_assigned_cic = conn->user_plane.msc_assigned_cic, .msc_rtp_port = conn->user_plane.msc_assigned_rtp_port, + .rtp_extensions = conn->user_plane.rtp_extensions, .n_ch_mode_rate = 1, .ch_mode_rate_list = { lchan->current_ch_mode_rate }, .target_lchan = to_lchan, @@ -522,6 +535,31 @@ return _reassignment_request(assign_for, lchan, NULL, new_lchan_type, -1, -1); } +/* + * The CN may have requested RTP extensions (payload format modifications + * contrary to the stipulations of TS 48.103) via BSSMAP IE of TW-TS-003. + * This function checks whether or not we can fulfill that request + * based on BTS capabilities, and sets the bitmask of accepted extensions + * that will be passed on to the BTS via Abis RSL. + */ +static void handle_rtp_extensions(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + const struct assignment_request *req = &conn->assignment.req; + uint8_t requested_ext = req->rtp_extensions; + uint8_t accepted_ext = 0; + + if ((requested_ext & OSMO_RTP_EXT_TWTS001) && + osmo_bts_has_feature(&bts->features, BTS_FEAT_TWTS001)) + accepted_ext |= OSMO_RTP_EXT_TWTS001; + + if ((requested_ext & OSMO_RTP_EXT_TWTS002) && + osmo_bts_has_feature(&bts->features, BTS_FEAT_TWTS002)) + accepted_ext |= OSMO_RTP_EXT_TWTS002; + + conn->user_plane.rtp_extensions = accepted_ext; +} + void assignment_fsm_start(struct gsm_subscriber_connection *conn, struct gsm_bts *bts, struct assignment_request *req) { @@ -553,6 +591,8 @@ return; conn->assignment.ch_indctr = req->ch_indctr; + handle_rtp_extensions(conn, bts); + if (!req->target_lchan && reuse_existing_lchan(conn)) { /* The already existing lchan is suitable for this mode */ conn->assignment.new_lchan = NULL;
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bsc_ctrl.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bsc_ctrl.c
Changed
@@ -820,6 +820,45 @@ return CTRL_CMD_HANDLED; } +/* Return full information about all logical channels. + * format: show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_net_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_network *net = cmd->node; + int bts_nr; + bool first_bts = true; + char *bts_dump; + + cmd->reply = talloc_strdup(cmd, ""); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { + bts_dump = bts_lchan_dump_full_ctrl(cmd, gsm_bts_num(net, bts_nr)); + if (!bts_dump) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + if (!strlen(bts_dump)) + continue; + cmd->reply = talloc_asprintf_append(cmd->reply, first_bts ? "%s" : "\n%s", bts_dump); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + first_bts = false; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(net_show_lchan_full, "show-lchan full"); + static int bsc_base_ctrl_cmds_install(struct gsm_network *net) { int rc = 0; @@ -837,8 +876,9 @@ rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc0_connection_status); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_notification); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_inform_msc); + rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_show_lchan_full); - rc = ctrl_cmd_install(CTRL_NODE_MSC, &cmd_msc_connection_status); + rc |= ctrl_cmd_install(CTRL_NODE_MSC, &cmd_msc_connection_status); rc |= osmo_signal_register_handler(SS_L_INPUT, &bts_connection_status_trap_cb, net); rc |= osmo_signal_register_handler(SS_MSC, &msc_connection_status_trap_cb, net);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bsc_ctrl_lookup.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bsc_ctrl_lookup.c
Changed
@@ -6,14 +6,14 @@ * All Rights Reserved * * 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 2 of the License, or + * 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. + * GNU Affero General Public License for more details. * */ @@ -43,6 +43,7 @@ struct gsm_bts *bts = NULL; struct gsm_bts_trx *trx = NULL; struct gsm_bts_trx_ts *ts = NULL; + struct gsm_lchan *lchan = NULL; struct bsc_msc_data *msc = NULL; char *token = vector_slot(vline, *i); long num; @@ -89,6 +90,20 @@ goto err_missing; *node_data = ts; *node_type = CTRL_NODE_TS; + } else if (!strcmp(token, "lchan")) { + if (*node_type != CTRL_NODE_TS || !*node_data) + goto err_missing; + ts = *node_data; + (*i)++; + if (!ctrl_parse_get_num(vline, *i, &num)) + goto err_index; + + if ((num >= 0) && (num < TS_MAX_LCHAN)) + lchan = &ts->lchannum; + if (!lchan) + goto err_missing; + *node_data = lchan; + *node_type = CTRL_NODE_LCHAN; } else if (!strcmp(token, "msc")) { if (*node_type != CTRL_NODE_ROOT || !net) goto err_missing;
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bsc_init.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bsc_init.c
Changed
@@ -204,6 +204,7 @@ net->cbc->client.remote_addr = (struct osmo_sockaddr_str){ .port = CBSP_TCP_PORT, }; net->cbc->client.local_addr = (struct osmo_sockaddr_str){}; + net->pcu_sock_wqueue_len_max = BSC_PCU_SOCK_WQUEUE_LEN_DEFAULT; return net; err_free_all:
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bsc_vty.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bsc_vty.c
Changed
@@ -257,6 +257,22 @@ return CMD_SUCCESS; } +DEFUN(show_bts_brief, show_bts_brief_cmd, "show bts brief", + SHOW_STR "Display information about a BTS\n" + "Display availability status of all BTS\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct gsm_bts *bts; + + /* Print OML state of BTSs. */ + llist_for_each_entry(bts, &net->bts_list, list) { + vty_out(vty, "BTS %d:", bts->nr); + bts_dump_vty_oml_link_state(vty, bts); + } + + return CMD_SUCCESS; +} + DEFUN(show_bts_fail_rep, show_bts_fail_rep_cmd, "show bts <0-255> fail-rep reset", SHOW_STR "Display information about a BTS\n" "BTS number\n" "OML failure reports\n" @@ -385,7 +401,7 @@ uint16_t meas_port; char *meas_host; const char *meas_scenario; - unsigned int max_len = meas_feed_wqueue_max_length_get(); + unsigned int max_len = meas_feed_txqueue_max_length_get(); meas_feed_cfg_get(&meas_host, &meas_port); meas_scenario = meas_feed_scenario_get(); @@ -396,7 +412,7 @@ if (strlen(meas_scenario) > 0) vty_out(vty, " meas-feed scenario %s%s", meas_scenario, VTY_NEWLINE); - if (max_len != MEAS_FEED_WQUEUE_MAX_LEN_DEFAULT) + if (max_len != MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT) vty_out(vty, " meas-feed write-queue-max-length %u%s", max_len, VTY_NEWLINE); } @@ -415,7 +431,10 @@ } if (gsmnet->pcu_sock_path) - vty_out(vty, " pcu-socket %s%s", gsmnet->pcu_sock_path, VTY_NEWLINE); + vty_out(vty, " pcu-socket %s%s", gsmnet->pcu_sock_path, VTY_NEWLINE); + if (gsmnet->pcu_sock_wqueue_len_max != BSC_PCU_SOCK_WQUEUE_LEN_DEFAULT) + vty_out(vty, " pcu-socket-wqueue-length %u%s", gsmnet->pcu_sock_wqueue_len_max, + VTY_NEWLINE); neighbor_ident_vty_write_network(vty, " "); mgcp_client_pool_config_write(vty, " "); @@ -764,14 +783,12 @@ struct gsm_subscriber_connection *conn; struct gsm_network *net = gsmnet_from_vty(vty); bool no_conns = true; - unsigned int count = 0; vty_out(vty, "Active subscriber connections: %s", VTY_NEWLINE); llist_for_each_entry(conn, &net->subscr_conns, entry) { dump_one_subscr_conn(vty, conn); no_conns = false; - count++; } if (no_conns) @@ -2426,7 +2443,7 @@ "Maximum number of messages to be queued waiting for transmission\n", CMD_ATTR_IMMEDIATE) { - meas_feed_wqueue_max_length_set(atoi(argv0)); + meas_feed_txqueue_max_length_set(atoi(argv0)); return CMD_SUCCESS; } @@ -2486,8 +2503,29 @@ return CMD_SUCCESS; } -DEFUN_ATTR(cfg_net_pcu_sock, - cfg_net_pcu_sock_cmd, +DEFUN_ATTR(cfg_bts_pcu_sock_wqueue_len, cfg_bts_pcu_sock_wqueue_len_cmd, + "pcu-socket-wqueue-length <1-2147483646>", + "Configure the PCU socket queue length\n" + "Queue length\n", + CMD_ATTR_IMMEDIATE) +{ + size_t dropped_msgs = 0; + struct gsm_network *net = gsmnet_from_vty(vty); + size_t old = net->pcu_sock_wqueue_len_max; + net->pcu_sock_wqueue_len_max = atoi(argv0); + if (net->pcu_state) + dropped_msgs = osmo_wqueue_set_maxlen(&net->pcu_state->upqueue, net->pcu_sock_wqueue_len_max); + if (dropped_msgs) { + LOGP(DPCU, LOGL_INFO, "Have dropped %zu messages due to shortened max. message queue size (from: %zu to %u)\n", + dropped_msgs, old, net->pcu_sock_wqueue_len_max); + vty_out(vty, "Have dropped %zu messages due to shortened max. message queue size (from: %zu to %u)%s", + dropped_msgs, old, net->pcu_sock_wqueue_len_max, VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_net_pcu_sock_path, + cfg_net_pcu_sock_path_cmd, "pcu-socket PATH", "PCU Socket Path for using OsmoPCU co-located with BSC\n" "Path in the file system for the unix-domain PCU socket\n", @@ -3228,13 +3266,19 @@ { struct bsc_msc_data *msc; llist_for_each_entry(msc, &bsc_gsmnet->mscs, entry) { - vty_out(vty, "%d %s %s ", + vty_out(vty, "MSC %d: %s <-> ", msc->a.cs7_instance, - osmo_ss7_asp_protocol_name(msc->a.asp_proto), osmo_sccp_inst_addr_name(msc->a.sccp, &msc->a.bsc_addr)); vty_out(vty, "%s%s", osmo_sccp_inst_addr_name(msc->a.sccp, &msc->a.msc_addr), VTY_NEWLINE); + vty_out(vty, " ASP protocol: %s%s", + osmo_ss7_asp_protocol_name(msc->a.asp_proto), + VTY_NEWLINE); + vty_out(vty, " BSSMAP state: %s%s", + msc->a.bssmap_reset ? osmo_fsm_inst_state_name(msc->a.bssmap_reset->fi) : "", + VTY_NEWLINE); + } return CMD_SUCCESS; @@ -3597,7 +3641,8 @@ install_element(GSMNET_NODE, &cfg_net_meas_feed_wqueue_max_len_cmd); install_element(GSMNET_NODE, &cfg_net_timer_cmd); install_element(GSMNET_NODE, &cfg_net_allow_unusable_timeslots_cmd); - install_element(GSMNET_NODE, &cfg_net_pcu_sock_cmd); + install_element(GSMNET_NODE, &cfg_net_pcu_sock_path_cmd); + install_element(GSMNET_NODE, &cfg_bts_pcu_sock_wqueue_len_cmd); install_element(GSMNET_NODE, &cfg_net_no_pcu_sock_cmd); /* Timer configuration commands (generic osmo_tdef API) */ @@ -3605,6 +3650,7 @@ install_element_ve(&bsc_show_net_cmd); install_element_ve(&show_bts_cmd); + install_element_ve(&show_bts_brief_cmd); install_element_ve(&show_bts_fail_rep_cmd); install_element_ve(&show_rejected_bts_cmd); install_element_ve(&show_trx_cmd);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bssmap_reset.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bssmap_reset.c
Changed
@@ -198,7 +198,7 @@ static struct osmo_fsm_state bssmap_reset_fsm_states = { BSSMAP_RESET_ST_DISC = { - .name = "DISC", + .name = "DISCONNECTED", .in_event_mask = 0 | S(BSSMAP_RESET_EV_RX_RESET) | S(BSSMAP_RESET_EV_RX_RESET_ACK) @@ -213,7 +213,7 @@ .action = bssmap_reset_disc_action, }, BSSMAP_RESET_ST_CONN = { - .name = "CONN", + .name = "CONNECTED", .in_event_mask = 0 | S(BSSMAP_RESET_EV_RX_RESET) | S(BSSMAP_RESET_EV_RX_RESET_ACK)
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts.c
Changed
@@ -49,7 +49,7 @@ { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, - { BTS_OSMO_TRX, "omso-bts-trx" }, + { BTS_OSMO_TRX, "osmo-bts-trx" }, { 0, NULL } }; @@ -470,6 +470,7 @@ bts->interf_meas_params_cfg = interf_meas_params_def; bts->rach_max_delay = 63; + bts->rach_expiry_timeout = 32; /* SRVCC is enabled by default */ bts->srvcc_fast_return_allowed = true; @@ -765,7 +766,8 @@ void bts_store_uptime(struct gsm_bts *bts) { - osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_UPTIME_SECONDS), bts_uptime(bts)); + osmo_stat_item_set(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_UPTIME_SECONDS), + bts->oml_link ? bts_updowntime(bts) : 0); } void bts_store_lchan_durations(struct gsm_bts *bts) @@ -823,20 +825,20 @@ rate_ctr_add(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHAN_SDCCH_ACTIVE_MILLISECONDS_TOTAL), elapsed_sdcch_ms); } -unsigned long long bts_uptime(const struct gsm_bts *bts) +unsigned long long bts_updowntime(const struct gsm_bts *bts) { struct timespec tp; - if (!bts->uptime || !bts->oml_link) + if (!bts->updowntime) return 0; if (osmo_clock_gettime(CLOCK_MONOTONIC, &tp) != 0) { - LOGP(DNM, LOGL_ERROR, "BTS %u uptime computation failure: %s\n", bts->nr, strerror(errno)); + LOGP(DNM, LOGL_ERROR, "BTS %u uptime/downtime computation failure: %s\n", bts->nr, strerror(errno)); return 0; } /* monotonic clock helps to ensure that the conversion is valid */ - return difftime(tp.tv_sec, bts->uptime); + return difftime(tp.tv_sec, bts->updowntime); } char *get_model_oml_status(const struct gsm_bts *bts)
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts_ctrl.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_ctrl.c
Changed
@@ -24,9 +24,6 @@ #include <osmocom/ctrl/control_cmd.h> -#include <osmocom/vty/command.h> -#include <osmocom/vty/misc.h> - #include <osmocom/bsc/ctrl.h> #include <osmocom/bsc/osmo_bsc_rf.h> #include <osmocom/bsc/bts.h> @@ -252,6 +249,8 @@ CTRL_CMD_DEFINE_RANGE(bts_ci, "cell-identity", struct gsm_bts, cell_identity, 0, 65535); CTRL_CMD_DEFINE_RANGE(bts_bsic, "bsic", struct gsm_bts, bsic, 0, 63); CTRL_CMD_DEFINE_RANGE(bts_rach_max_delay, "rach-max-delay", struct gsm_bts, rach_max_delay, 1, 127); +CTRL_CMD_DEFINE_RANGE(bts_rach_expiry_timeout, "rach-expiry-timeout", struct gsm_bts, rach_expiry_timeout, 4, 64); +CTRL_CMD_DEFINE_RANGE(bts_ms_max_power, "ms-max-power", struct gsm_bts, ms_max_power, 0, 40); static int set_bts_apply_config(struct ctrl_cmd *cmd, void *data) { @@ -370,7 +369,7 @@ { const struct gsm_bts *bts = cmd->node; - cmd->reply = talloc_asprintf(cmd, "%llu", bts_uptime(bts)); + cmd->reply = talloc_asprintf(cmd, "%llu", bts->oml_link ? bts_updowntime(bts) : 0); if (!cmd->reply) { cmd->reply = "OOM"; return CTRL_CMD_ERROR; @@ -717,7 +716,6 @@ static int set_bts_si2quater_neighbor_list_del_earfcn(struct ctrl_cmd *cmd, void *data) { struct gsm_bts *bts = (struct gsm_bts *)cmd->node; - struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; int earfcn; if (osmo_str_to_int(&earfcn, cmd->value, 10, 0, 65535) < 0) { @@ -725,7 +723,7 @@ return CTRL_CMD_ERROR; } - if (osmo_earfcn_del(e, earfcn) < 0) { + if (bts_earfcn_del(bts, earfcn) < 0) { cmd->reply = "Failed to delete a (not existent?) neighbor EARFCN"; return CTRL_CMD_ERROR; } @@ -835,7 +833,6 @@ static int set_bts_si2quater_neighbor_list_add_earfcn(struct ctrl_cmd *cmd, void *data) { struct gsm_bts *bts = (struct gsm_bts *)cmd->node; - struct osmo_earfcn_si2q *neighbors = &bts->si_common.si2quater_neigh_list; char *earfcn_str, *thresh_hi_str, *thresh_lo_str, *prio_str, *qrxlv_str, *meas_str, *saveptr, *tmp; int earfcn, thresh_hi, thresh_lo, prio, qrxlv, meas, result; @@ -914,7 +911,7 @@ cmd->reply = "OOM"; } - if (osmo_earfcn_del(neighbors, earfcn) != 0) + if (bts_earfcn_del(bts, earfcn) != 0) cmd->reply = "Failed to roll-back adding EARFCN"; return CTRL_CMD_ERROR; @@ -1041,6 +1038,7 @@ struct gsm_bts *bts = cmd->node; bts->si_common.cell_ro_sel_par.present = 1; bts->si_common.cell_ro_sel_par.cell_resel_off = atoi(cmd->value) / 2; + cmd->reply = "OK"; return CTRL_CMD_REPLY; } @@ -1145,6 +1143,91 @@ CTRL_CMD_DEFINE(bts_cell_reselection_hysteresis, "cell-reselection-hysteresis"); + +static int verify_bts_radio_link_timeout(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + int radio_link_timeout; + struct gsm_bts *bts = cmd->node; + + if (strcmp(value, "infinite") == 0) { + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + cmd->reply = "Infinite radio link timeout not supported by BTS"; + return 1; + } + return 0; + } + + radio_link_timeout = atoi(cmd->value); + + if (radio_link_timeout < 0 || radio_link_timeout > 64) { + cmd->reply = "Value is out of range"; + return 1; + } else if (radio_link_timeout % 4 != 0) { + cmd->reply = "Value must be a multiple of 4"; + return 1; + } + + return 0; +} + +static int get_bts_radio_link_timeout(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + + cmd->reply = talloc_asprintf(cmd, "%u", gsm_bts_get_radio_link_timeout(bts)); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} + +static int set_bts_radio_link_timeout(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + gsm_bts_set_radio_link_timeout(bts, atoi(cmd->value)); + cmd->reply = "OK"; + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE(bts_radio_link_timeout, "radio-link-timeout"); + +static int verify_bts_rxlev_access_min(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + int rxlev_access_min = atoi(cmd->value); + + if (rxlev_access_min < 0 || rxlev_access_min > 63) { + cmd->reply = "Value is out of range"; + return 1; + } + + return 0; +} + +static int get_bts_rxlev_access_min(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + + cmd->reply = talloc_asprintf(cmd, "%u", bts->si_common.cell_sel_par.rxlev_acc_min); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} + +static int set_bts_rxlev_access_min(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + bts->si_common.cell_sel_par.rxlev_acc_min = atoi(cmd->value); + cmd->reply = "OK"; + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE(bts_rxlev_access_min, "rach-rxlev-access-min"); + /* Return space concatenated set of pairs <class>,<barred/allowed> */ static int get_bts_rach_access_control_class(struct ctrl_cmd *cmd, void *data) { @@ -1264,6 +1347,72 @@ CTRL_CMD_DEFINE_WO(bts_rach_access_control_class_allow, "rach-access-control-class allow"); +static int verify_bts_rach_cell_barred(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + int bar = atoi(cmd->value); + + if ((bar != 0) && (bar != 1)) + return 1; + + return 0; +} + +static int get_bts_rach_cell_barred(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + + cmd->reply = talloc_asprintf(cmd, "%u", bts->si_common.rach_control.cell_bar); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} + +static int set_bts_rach_cell_barred(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + bts->si_common.rach_control.cell_bar = atoi(cmd->value); + cmd->reply = "OK"; + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE(bts_rach_cell_barred, "rach-cell-barred"); + +static int verify_bts_rach_max_trans(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + int max_trans = atoi(cmd->value); + + if ((max_trans != 1) && (max_trans != 2) && (max_trans != 4) && (max_trans != 7)) + return 1; + + return 0; +} + +static int get_bts_rach_max_trans(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + + cmd->reply = talloc_asprintf(cmd, "%u", rach_max_trans_raw2val(bts->si_common.rach_control.max_trans)); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} + +static int set_bts_rach_max_trans(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + bts->si_common.rach_control.max_trans = rach_max_trans_val2raw(atoi(cmd->value)); + cmd->reply = "OK"; + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE(bts_rach_max_trans, "rach-max-transmission"); + /* Return space concatenated set of tuples <UARFCN>,<scrambling code>,<diversity bit> */ static int get_bts_neighbor_list_si2quater_uarfcn(struct ctrl_cmd *cmd, void *data) { @@ -1330,6 +1479,53 @@ CTRL_CMD_DEFINE_RO(bts_neighbor_list_si2quater_earfcn, "neighbor-list si2quater earfcns"); +char *bts_lchan_dump_full_ctrl(const void *t, struct gsm_bts *bts) +{ + int trx_nr; + bool first_trx = true; + char *trx_dump, *dump; + struct gsm_bts_trx *trx; + + dump = talloc_strdup(t, ""); + if (!dump) + return NULL; + + for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { + trx = gsm_bts_trx_num(bts, trx_nr); + trx_dump = trx_lchan_dump_full_ctrl(t, trx); + if (!trx_dump) + return NULL; + if (!strlen(trx_dump)) + continue; + dump = talloc_asprintf_append(dump, first_trx ? "%s" : "\n%s", trx_dump); + if (!dump) + return NULL; + first_trx = false; + } + + return dump; +} + +/* Return full information about all logical channels in a BTS. + * format: bts.<0-255>.show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_bts_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + + cmd->reply = bts_lchan_dump_full_ctrl(cmd, bts); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(bts_show_lchan_full, "show-lchan full"); + int bsc_bts_ctrl_cmds_install(void) { int rc = 0; @@ -1339,6 +1535,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_ci); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_bsic); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_max_delay); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_expiry_timeout); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_apply_config); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_si); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_power_ctrl_defs); @@ -1363,11 +1560,17 @@ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_cell_reselection_offset); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_cell_reselection_penalty_time); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_cell_reselection_hysteresis); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_ms_max_power); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_radio_link_timeout); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rxlev_access_min); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_access_control_class); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_access_control_class_bar); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_access_control_class_allow); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_cell_barred); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_max_trans); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si2quater_uarfcn); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si2quater_earfcn); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_show_lchan_full); rc |= neighbor_ident_ctrl_init();
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts.c
Changed
@@ -195,156 +195,78 @@ /* Callback function to be called every time we receive a 12.21 SW activated report */ static int sw_activ_rep(struct msgb *mb) { - struct abis_om_fom_hdr *foh = msgb_l3(mb); + const struct abis_om_fom_hdr *foh = msgb_l3(mb); struct e1inp_sign_link *sign_link = mb->dst; struct gsm_bts *bts = sign_link->trx->bts; - struct gsm_bts_trx *trx; - struct gsm_gprs_nsvc *nsvc; - struct gsm_bts_trx_ts *ts; + struct gsm_abis_mo *mo; + struct tlv_parsed tp; if (!is_ipa_abisip_bts(bts)) return 0; - switch (foh->obj_class) { - case NM_OC_SITE_MANAGER: - osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_SW_ACT_REP, NULL); - break; - case NM_OC_BTS: - osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_SW_ACT_REP, NULL); - break; - case NM_OC_BASEB_TRANSC: - if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr))) - return -EINVAL; - osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_SW_ACT_REP, NULL); - break; - case NM_OC_RADIO_CARRIER: - if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr))) - return -EINVAL; - osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_SW_ACT_REP, NULL); - break; - case NM_OC_CHANNEL: - if (!(ts = abis_nm_get_ts(mb))) - return -EINVAL; - osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_SW_ACT_REP, NULL); - break; - case NM_OC_GPRS_NSE: - osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_SW_ACT_REP, NULL); - break; - case NM_OC_GPRS_CELL: - osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_SW_ACT_REP, NULL); - break; - case NM_OC_GPRS_NSVC: - if (!(nsvc = gsm_bts_sm_nsvc_num(bts->site_mgr, foh->obj_inst.trx_nr))) - return -EINVAL; - osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_SW_ACT_REP, NULL); - break; + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + if (mo == NULL) { + LOGPFOH(DNM, LOGL_ERROR, foh, "Rx SW activated report for non-existent MO\n"); + return -ENOENT; } - return 0; -} -static void nm_rx_opstart_ack_chan(struct msgb *oml_msg) -{ - struct gsm_bts_trx_ts *ts; - ts = abis_nm_get_ts(oml_msg); - if (!ts) - /* error already logged in abis_nm_get_ts() */ - return; - if (!ts->fi) { - LOG_TS(ts, LOGL_ERROR, "Channel OPSTART ACK for uninitialized TS\n"); - return; + if (abis_nm_tlv_parse(&tp, bts, &foh->data0, msgb_l3len(mb) - sizeof(*foh)) < 0) { + LOGPFOH(DNM, LOGL_ERROR, foh, "%s(): tlv_parse failed\n", __func__); + return -EINVAL; + } + + mo->ipaccess.obj_version = 0; /* implicit default */ + if (TLVP_PRES_LEN(&tp, NM_ATT_IPACC_OBJ_VERSION, 1)) { + const uint8_t *versions = TLVP_VAL(&tp, NM_ATT_IPACC_OBJ_VERSION); + char buf256; + struct osmo_strbuf sb = { .buf = buf, .len = sizeof(buf) }; + + /* nanoBTS may report several Object Versions; the first one will + * be used by default unless requested explicitly before OPSTARTing. */ + mo->ipaccess.obj_version = versions0; + + OSMO_STRBUF_PRINTF(sb, "%u (default)", versions0); + for (uint16_t i = 1; i < TLVP_LEN(&tp, NM_ATT_IPACC_OBJ_VERSION); i++) + OSMO_STRBUF_PRINTF(sb, ", %u", versionsi); + LOGPFOH(DNM, LOGL_INFO, foh, "IPA Object Versions supported: %s\n", buf); } - osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_OPSTART_ACK, NULL); + + osmo_fsm_inst_dispatch(mo->fi, NM_EV_SW_ACT_REP, NULL); + return 0; } static void nm_rx_opstart_ack(struct msgb *oml_msg) { - struct abis_om_fom_hdr *foh = msgb_l3(oml_msg); + const struct abis_om_fom_hdr *foh = msgb_l3(oml_msg); struct e1inp_sign_link *sign_link = oml_msg->dst; struct gsm_bts *bts = sign_link->trx->bts; - struct gsm_bts_trx *trx; - struct gsm_gprs_nsvc *nsvc; + struct gsm_abis_mo *mo; - switch (foh->obj_class) { - case NM_OC_SITE_MANAGER: - osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - case NM_OC_BTS: - osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - case NM_OC_RADIO_CARRIER: - if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr))) - return; - osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - case NM_OC_BASEB_TRANSC: - if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr))) - return; - osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - case NM_OC_CHANNEL: - nm_rx_opstart_ack_chan(oml_msg); - break; - case NM_OC_GPRS_NSE: - osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - case NM_OC_GPRS_CELL: - osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - case NM_OC_GPRS_NSVC: - if (!(nsvc = gsm_bts_sm_nsvc_num(bts->site_mgr, foh->obj_inst.trx_nr))) - return; - osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - default: - break; - } + if (!is_ipa_abisip_bts(bts)) + return; + + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + if (mo == NULL) + LOGPFOH(DNM, LOGL_ERROR, foh, "Rx OPSTART ACK for non-existent MO\n"); + else + osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL); } static void nm_rx_opstart_nack(struct msgb *oml_msg) { - struct abis_om_fom_hdr *foh = msgb_l3(oml_msg); + const struct abis_om_fom_hdr *foh = msgb_l3(oml_msg); struct e1inp_sign_link *sign_link = oml_msg->dst; struct gsm_bts *bts = sign_link->trx->bts; - struct gsm_bts_trx *trx; - struct gsm_bts_trx_ts *ts; - struct gsm_gprs_nsvc *nsvc; + struct gsm_abis_mo *mo; - switch (foh->obj_class) { - case NM_OC_SITE_MANAGER: - osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_OPSTART_NACK, NULL); - break; - case NM_OC_BTS: - osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OPSTART_ACK, NULL); - break; - case NM_OC_RADIO_CARRIER: - if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr))) - return; - osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_OPSTART_NACK, NULL); - break; - case NM_OC_BASEB_TRANSC: - if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr))) - return; - osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_OPSTART_NACK, NULL); - break; - case NM_OC_CHANNEL: - if (!(ts = abis_nm_get_ts(oml_msg))) - return; - osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_OPSTART_NACK, NULL); - break; - case NM_OC_GPRS_NSE: - osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_OPSTART_NACK, NULL); - break; - case NM_OC_GPRS_CELL: - osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_OPSTART_NACK, NULL); - break; - case NM_OC_GPRS_NSVC: - if (!(nsvc = gsm_bts_sm_nsvc_num(bts->site_mgr, foh->obj_inst.trx_nr))) - return; - osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_OPSTART_NACK, NULL); - break; - default: - break; - } + if (!is_ipa_abisip_bts(bts)) + return; + + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + if (mo == NULL) + LOGPFOH(DNM, LOGL_ERROR, foh, "Rx OPSTART NACK for non-existent MO\n"); + else + osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_NACK, NULL); } static void nm_rx_get_attr_rep(struct msgb *oml_msg) @@ -352,20 +274,16 @@ struct abis_om_fom_hdr *foh = msgb_l3(oml_msg); struct e1inp_sign_link *sign_link = oml_msg->dst; struct gsm_bts *bts = sign_link->trx->bts; - struct gsm_bts_trx *trx; + struct gsm_abis_mo *mo; - switch (foh->obj_class) { - case NM_OC_BTS: - osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_GET_ATTR_REP, NULL); - break; - case NM_OC_BASEB_TRANSC: - if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr))) - return; - osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_GET_ATTR_REP, NULL); - break; - default: - LOGPFOH(DNM, LOGL_ERROR, foh, "Get Attributes Response received on incorrect object class %d!\n", foh->obj_class); - } + if (!is_ipa_abisip_bts(bts)) + return; + + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + if (mo == NULL) + LOGPFOH(DNM, LOGL_ERROR, foh, "Rx Get Attribute Report for non-existent MO\n"); + else + osmo_fsm_inst_dispatch(mo->fi, NM_EV_GET_ATTR_REP, NULL); } static void nm_rx_set_bts_attr_ack(struct msgb *oml_msg) @@ -374,6 +292,9 @@ struct e1inp_sign_link *sign_link = oml_msg->dst; struct gsm_bts *bts = sign_link->trx->bts; + if (!is_ipa_abisip_bts(bts)) + return; + if (foh->obj_class != NM_OC_BTS) { LOG_BTS(bts, DNM, LOGL_ERROR, "Set BTS Attr Ack received on non BTS object!\n"); return; @@ -387,8 +308,12 @@ struct abis_om_fom_hdr *foh = msgb_l3(oml_msg); struct e1inp_sign_link *sign_link = oml_msg->dst; struct gsm_bts *bts = sign_link->trx->bts; - struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + struct gsm_bts_trx *trx; + if (!is_ipa_abisip_bts(bts)) + return; + + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); if (!trx || foh->obj_class != NM_OC_RADIO_CARRIER) { LOGPFOH(DNM, LOGL_ERROR, foh, "Set Radio Carrier Attr Ack received on non Radio Carrier object!\n"); return; @@ -399,8 +324,14 @@ static void nm_rx_set_chan_attr_ack(struct msgb *oml_msg) { struct abis_om_fom_hdr *foh = msgb_l3(oml_msg); - struct gsm_bts_trx_ts *ts = abis_nm_get_ts(oml_msg); + struct e1inp_sign_link *sign_link = oml_msg->dst; + struct gsm_bts *bts = sign_link->trx->bts; + struct gsm_bts_trx_ts *ts; + if (!is_ipa_abisip_bts(bts)) + return; + + ts = abis_nm_get_ts(oml_msg); if (!ts || foh->obj_class != NM_OC_CHANNEL) { LOGPFOH(DNM, LOGL_ERROR, foh, "Set Channel Attr Ack received on non Radio Channel object!\n"); return; @@ -596,6 +527,8 @@ struct gsm_bts_trx_ts *ts ; uint8_t tn; uint8_t i; + struct timespec tp; + int rc; /* First of all, remove deferred drop if enabled */ osmo_timer_del(&bts->oml_drop_link_timer); @@ -606,7 +539,8 @@ LOG_BTS(bts, DLINP, LOGL_NOTICE, "Dropping OML link: %s\n", reason); e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; - bts->uptime = 0; + rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp); + bts->updowntime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for downtime */ osmo_stat_item_dec(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_OML_CONNECTED), 1); gsm_bts_stats_reset(bts); @@ -779,7 +713,7 @@ E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp); - bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ + bts->updowntime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ if (!(sign_link->trx->bts->ip_access.flags & OML_UP)) { e1inp_event(sign_link->ts, S_L_INP_TEI_UP, sign_link->tei, sign_link->sapi);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
Changed
@@ -1,6 +1,6 @@ /* ip.access nanoBTS specific code, OML attribute table generator */ -/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> +/* (C) 2016-2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> * All Rights Reserved * * Author: Philipp Maier @@ -26,13 +26,81 @@ #include <osmocom/bsc/bts.h> #include <osmocom/gsm/bts_features.h> +const struct tlv_definition ipacc_eie_tlv_def = { + .def = { + /* TODO: add more values from enum ipac_eie */ + NM_IPAC_EIE_FREQ_BANDS = { TLV_TYPE_TL16V }, + NM_IPAC_EIE_MAX_TA = { TLV_TYPE_TL16V }, + NM_IPAC_EIE_CIPH_ALGOS = { TLV_TYPE_TL16V }, + NM_IPAC_EIE_CHAN_TYPES = { TLV_TYPE_TL16V }, + NM_IPAC_EIE_CHAN_MODES = { TLV_TYPE_TL16V }, + NM_IPAC_EIE_GPRS_CODING = { TLV_TYPE_TL16V }, + NM_IPAC_EIE_RTP_FEATURES = { TLV_TYPE_TL16V }, + NM_IPAC_EIE_RSL_FEATURES = { TLV_TYPE_TL16V }, + } +}; + +static inline uint32_t ipacc_parse_supp_flags(const struct abis_om_fom_hdr *foh, + const struct value_string *flags, + const struct tlv_p_entry *e, + const char *text) +{ + uint32_t u32 = 0; + + for (unsigned int i = 0; i < OSMO_MAX(e->len, 4); i++) + u32 |= e->vali << (i * 8); + for (const struct value_string *vs = flags; vs->value && vs->str; vs++) { + if (u32 & vs->value) + LOGPFOH(DNM, LOGL_INFO, foh, "%s '%s' is supported\n", text, vs->str); + } + + return u32; +} + +/* Parse ip.access Supported Features IE */ +int ipacc_parse_supp_features(const struct gsm_bts *bts, + const struct abis_om_fom_hdr *foh, + const uint8_t *data, uint16_t data_len) +{ + const struct tlv_p_entry *e; + struct tlv_parsed tp; + + if (tlv_parse(&tp, &ipacc_eie_tlv_def, data, data_len, 0, 0) < 0) { + LOGPFOH(DNM, LOGL_ERROR, foh, "%s(): tlv_parse failed\n", __func__); + return -EINVAL; + } + + /* TODO: store the flags in the respective MO state */ + if ((e = TLVP_GET(&tp, NM_IPAC_EIE_FREQ_BANDS)) != NULL) + ipacc_parse_supp_flags(foh, abis_nm_ipacc_freq_band_desc, e, "Freq. band"); + if ((e = TLVP_GET(&tp, NM_IPAC_EIE_CIPH_ALGOS)) != NULL) + ipacc_parse_supp_flags(foh, abis_nm_ipacc_ciph_algo_desc, e, "Ciphering algorithm"); + if ((e = TLVP_GET(&tp, NM_IPAC_EIE_CHAN_TYPES)) != NULL) + ipacc_parse_supp_flags(foh, abis_nm_ipacc_chant_desc, e, "Channel type"); + if ((e = TLVP_GET(&tp, NM_IPAC_EIE_CHAN_MODES)) != NULL) + ipacc_parse_supp_flags(foh, abis_nm_ipacc_chanm_desc, e, "Channel mode"); + if ((e = TLVP_GET(&tp, NM_IPAC_EIE_GPRS_CODING)) != NULL) + ipacc_parse_supp_flags(foh, abis_nm_ipacc_gprs_coding_desc, e, "GPRS Coding Scheme"); + if ((e = TLVP_GET(&tp, NM_IPAC_EIE_RTP_FEATURES)) != NULL) + ipacc_parse_supp_flags(foh, abis_nm_ipacc_rtp_feat_desc, e, "RTP Feature"); + if ((e = TLVP_GET(&tp, NM_IPAC_EIE_RSL_FEATURES)) != NULL) + ipacc_parse_supp_flags(foh, abis_nm_ipacc_rsl_feat_desc, e, "RSL Feature"); + if (TLVP_PRES_LEN(&tp, NM_IPAC_EIE_MAX_TA, 1)) { + uint8_t u8 = *TLVP_VAL(&tp, NM_IPAC_EIE_MAX_TA); + LOGPFOH(DNM, LOGL_DEBUG, foh, "Max Timing Advance %u\n", u8); + } + + return 0; +} + /* 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; int rlt; - msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + msgb = msgb_alloc(1024, __func__); if (!msgb) return NULL; @@ -116,7 +184,8 @@ struct abis_nm_ipacc_att_ns_cfg ns_cfg; struct abis_nm_ipacc_att_bssgp_cfg bssgp_cfg; struct gsm_bts *bts = gsm_bts_sm_get_bts(bts_sm); - msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + msgb = msgb_alloc(1024, __func__); if (!msgb) return NULL; @@ -158,11 +227,12 @@ struct msgb *nanobts_gen_set_cell_attr(struct gsm_bts *bts) { + const struct gsm_gprs_cell *cell = &bts->gprs.cell; + const struct gprs_rlc_cfg *rlcc = &cell->rlc_cfg; struct msgb *msgb; - struct abis_nm_ipacc_att_rlc_cfg rlc_cfg; - struct abis_nm_ipacc_att_rlc_cfg_2 rlc_cfg_2; uint8_t buf2; - msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + msgb = msgb_alloc(1024, __func__); if (!msgb) return NULL; @@ -170,54 +240,88 @@ buf0 = bts->gprs.rac; msgb_tl16v_put(msgb, NM_ATT_IPACC_RAC, 1, buf); - buf0 = 5; /* repeat time (50ms) */ - buf1 = 3; /* repeat count */ + buf0 = rlcc->paging.repeat_time / 50; /* units of 50ms */ + buf1 = rlcc->paging.repeat_count; msgb_tl16v_put(msgb, NM_ATT_IPACC_GPRS_PAGING_CFG, 2, buf); /* BVCI 925 */ - buf0 = bts->gprs.cell.bvci >> 8; - buf1 = bts->gprs.cell.bvci & 0xff; + buf0 = cell->bvci >> 8; + buf1 = cell->bvci & 0xff; msgb_tl16v_put(msgb, NM_ATT_IPACC_BVCI, 2, buf); /* all timers in seconds, unless otherwise stated */ - rlc_cfg = (struct abis_nm_ipacc_att_rlc_cfg){ - .t3142 = 20, /* T3142 */ - .t3169 = 5, /* T3169 */ - .t3191 = 5, /* T3191 */ - .t3193_10ms = 160, /* T3193 (units of 10ms) */ - .t3195 = 5, /* T3195 */ - .n3101 = 10, /* N3101 */ - .n3103 = 4, /* N3103 */ - .n3105 = 8, /* N3105 */ - .rlc_cv_countdown = 15, /* RLC CV countdown */ + const struct abis_nm_ipacc_att_rlc_cfg rlc_cfg = { + .t3142 = rlcc->parameterRLC_T3142, + .t3169 = rlcc->parameterRLC_T3169, + .t3191 = rlcc->parameterRLC_T3191, + .t3193_10ms = rlcc->parameterRLC_T3193, + .t3195 = rlcc->parameterRLC_T3195, + .n3101 = rlcc->parameterRLC_N3101, + .n3103 = rlcc->parameterRLC_N3103, + .n3105 = rlcc->parameterRLC_N3105, + .rlc_cv_countdown = rlcc->parameterCV_COUNTDOWN, }; msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG, sizeof(rlc_cfg), (const uint8_t *)&rlc_cfg); - if (bts->gprs.mode == BTS_GPRS_EGPRS) { - buf0 = 0x8f; - buf1 = 0xff; - } else { - buf0 = 0x0f; + switch (bts->type) { + case GSM_BTS_TYPE_NANOBTS: + if (cell->mo.ipaccess.obj_version < 4) + break; + /* fall-through */ + case GSM_BTS_TYPE_OSMOBTS: + /* CS1..CS4 flags encoded in the first octet */ + buf0 = rlcc->cs_mask & 0x0f; + /* MCS1..MSC8 flags encoded in the second octet */ buf1 = 0x00; + if (bts->gprs.mode == BTS_GPRS_EGPRS) { + /* MSC9 is special and also goes to the first octet */ + if (rlcc->cs_mask & (1 << GPRS_MCS9)) + buf0 |= (1 << 7); + buf1 = (rlcc->cs_mask >> 4) & 0xff; + } + msgb_tl16v_put(msgb, NM_ATT_IPACC_CODING_SCHEMES, 2, buf); + break; + default: + break; } - msgb_tl16v_put(msgb, NM_ATT_IPACC_CODING_SCHEMES, 2, buf); - rlc_cfg_2 = (struct abis_nm_ipacc_att_rlc_cfg_2){ - .t_dl_tbf_ext_10ms = htons(250), /* 0..500 */ - .t_ul_tbf_ext_10ms = htons(250), /* 0..500 */ - .initial_cs = 2, /* CS2 */ - }; - msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_2, sizeof(rlc_cfg_2), (const uint8_t *)&rlc_cfg_2); + switch (bts->type) { + case GSM_BTS_TYPE_NANOBTS: + if (cell->mo.ipaccess.obj_version < 20) + break; + /* fall-through */ + case GSM_BTS_TYPE_OSMOBTS: + { + const struct abis_nm_ipacc_att_rlc_cfg_2 rlc_cfg_2 = { + .t_dl_tbf_ext_10ms = htons(rlcc->parameterT_DL_TBF_EXT / 10), + .t_ul_tbf_ext_10ms = htons(rlcc->parameterT_UL_TBF_EXT / 10), + .initial_cs = rlcc->initial_cs, + }; + msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_2, + sizeof(rlc_cfg_2), (const uint8_t *)&rlc_cfg_2); + break; + } + default: + break; + } -#if 0 - /* EDGE model only, breaks older models. - * Should inquire the BTS capabilities */ - struct abis_nm_ipacc_att_rlc_cfg_3 rlc_cfg_3; - rlc_cfg_3 = (struct abis_nm_ipacc_att_rlc_cfg_3){ - .initial_mcs = 2, /* MCS2 */ - }; - msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_3, sizeof(rlc_cfg_3), (const uint8_t *)&rlc_cfg_3); -#endif + switch (bts->type) { + case GSM_BTS_TYPE_NANOBTS: + if (cell->mo.ipaccess.obj_version < 30) + break; + /* fall-through */ + case GSM_BTS_TYPE_OSMOBTS: + { + const struct abis_nm_ipacc_att_rlc_cfg_3 rlc_cfg_3 = { + .initial_mcs = rlcc->initial_mcs, + }; + msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_3, + sizeof(rlc_cfg_3), (const uint8_t *)&rlc_cfg_3); + break; + } + default: + break; + } return msgb; } @@ -226,7 +330,8 @@ { struct msgb *msgb; uint8_t buf256; - msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + msgb = msgb_alloc(1024, __func__); if (!msgb) return NULL; @@ -271,7 +376,8 @@ { struct msgb *msgb; uint8_t buf256; - msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + msgb = msgb_alloc(1024, __func__); if (!msgb) return NULL;
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts_siemens_bs11.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_siemens_bs11.c
Changed
@@ -423,57 +423,35 @@ patch_nm_tables(trx->bts); - switch (trx->bts->type) { - case GSM_BTS_TYPE_BS11: - /* FIXME: discover this by fetching an attribute */ + /* FIXME: discover this by fetching an attribute */ #if 0 - trx->nominal_power = 15; /* 15dBm == 30mW PA configuration */ + trx->nominal_power = 15; /* 15dBm == 30mW PA configuration */ #else - trx->nominal_power = 24; /* 24dBm == 250mW PA configuration */ + trx->nominal_power = 24; /* 24dBm == 250mW PA configuration */ #endif - abis_nm_conn_terr_sign(trx, e1l->e1_nr, e1l->e1_ts, - e1l->e1_ts_ss); - abis_nm_establish_tei(trx->bts, trx->nr, e1l->e1_nr, - e1l->e1_ts, e1l->e1_ts_ss, trx->rsl_tei_primary); - - /* Set Radio Attributes */ - if (trx == trx->bts->c0) - abis_nm_set_radio_attr(trx, bs11_attr_radio, - sizeof(bs11_attr_radio)); - else { - uint8_t trx1_attr_radiosizeof(bs11_attr_radio); - uint8_t arfcn_low = trx->arfcn & 0xff; - uint8_t arfcn_high = (trx->arfcn >> 8) & 0x0f; - memcpy(trx1_attr_radio, bs11_attr_radio, - sizeof(trx1_attr_radio)); - - /* patch ARFCN into TRX Attributes */ - trx1_attr_radio2 &= 0xf0; - trx1_attr_radio2 |= arfcn_high; - trx1_attr_radio3 = arfcn_low; - - abis_nm_set_radio_attr(trx, trx1_attr_radio, - sizeof(trx1_attr_radio)); - } - break; - case GSM_BTS_TYPE_NANOBTS: - switch (trx->bts->band) { - case GSM_BAND_850: - case GSM_BAND_900: - trx->nominal_power = 20; - break; - case GSM_BAND_1800: - case GSM_BAND_1900: - trx->nominal_power = 23; - break; - default: - LOGP(DNM, LOGL_ERROR, "Unsupported nanoBTS GSM band %s\n", - gsm_band_name(trx->bts->band)); - break; - } - break; - default: - break; + abis_nm_conn_terr_sign(trx, e1l->e1_nr, e1l->e1_ts, + e1l->e1_ts_ss); + abis_nm_establish_tei(trx->bts, trx->nr, e1l->e1_nr, + e1l->e1_ts, e1l->e1_ts_ss, trx->rsl_tei_primary); + + /* Set Radio Attributes */ + if (trx == trx->bts->c0) + abis_nm_set_radio_attr(trx, bs11_attr_radio, + sizeof(bs11_attr_radio)); + else { + uint8_t trx1_attr_radiosizeof(bs11_attr_radio); + uint8_t arfcn_low = trx->arfcn & 0xff; + uint8_t arfcn_high = (trx->arfcn >> 8) & 0x0f; + memcpy(trx1_attr_radio, bs11_attr_radio, + sizeof(trx1_attr_radio)); + + /* patch ARFCN into TRX Attributes */ + trx1_attr_radio2 &= 0xf0; + trx1_attr_radio2 |= arfcn_high; + trx1_attr_radio3 = arfcn_low; + + abis_nm_set_radio_attr(trx, trx1_attr_radio, + sizeof(trx1_attr_radio)); } for (i = 0; i < TRX_NR_TS; i++) @@ -484,17 +462,11 @@ { struct gsm_bts_trx *trx; - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - patch_nm_tables(bts); - abis_nm_raw_msg(bts, sizeof(msg_1), msg_1); /* set BTS SiteMgr attr*/ - abis_nm_set_bts_attr(bts, bs11_attr_bts, sizeof(bs11_attr_bts)); - abis_nm_raw_msg(bts, sizeof(msg_3), msg_3); /* set BTS handover attr */ - abis_nm_raw_msg(bts, sizeof(msg_4), msg_4); /* set BTS power control attr */ - break; - default: - break; - } + patch_nm_tables(bts); + abis_nm_raw_msg(bts, sizeof(msg_1), msg_1); /* set BTS SiteMgr attr*/ + abis_nm_set_bts_attr(bts, bs11_attr_bts, sizeof(bs11_attr_bts)); + abis_nm_raw_msg(bts, sizeof(msg_3), msg_3); /* set BTS handover attr */ + abis_nm_raw_msg(bts, sizeof(msg_4), msg_4); /* set BTS power control attr */ llist_for_each_entry(trx, &bts->trx_list, list) nm_reconfig_trx(trx);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts_trx_ctrl.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_trx_ctrl.c
Changed
@@ -19,112 +19,11 @@ * */ -#include <errno.h> -#include <time.h> - #include <osmocom/ctrl/control_cmd.h> -#include <osmocom/vty/command.h> -#include <osmocom/vty/misc.h> - #include <osmocom/bsc/ctrl.h> -#include <osmocom/bsc/osmo_bsc_rf.h> #include <osmocom/bsc/bts.h> -#include <osmocom/bsc/ipaccess.h> -#include <osmocom/bsc/chan_alloc.h> #include <osmocom/bsc/abis_nm.h> -#include <osmocom/bsc/neighbor_ident.h> -#include <osmocom/bsc/system_information.h> - -/********************* - * TS_NODE - *********************/ - -static int verify_ts_hopping_arfcn_add(struct ctrl_cmd *cmd, const char *value, void *_data) -{ - int64_t arfcn; - enum gsm_band unused; - if (osmo_str_to_int64(&arfcn, value, 10, 0, 1024) < 0) - return 1; - if (gsm_arfcn2band_rc(arfcn, &unused) < 0) { - return 1; - } - return 0; -} -static int set_ts_hopping_arfcn_add(struct ctrl_cmd *cmd, void *data) -{ - struct gsm_bts_trx_ts *ts = cmd->node; - int arfcn = atoi(cmd->value); - - bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ONE); - - /* Update Cell Allocation (list of all the frequencies allocated to a cell) */ - if (generate_cell_chan_alloc(ts->trx->bts) != 0) { - bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ZERO); /* roll-back */ - cmd->reply = "Failed to re-generate Cell Allocation"; - return CTRL_CMD_ERROR; - } - - cmd->reply = "OK"; - return CTRL_CMD_REPLY; -} -/* Parameter format: "<arfcn>" */ -CTRL_CMD_DEFINE_WO(ts_hopping_arfcn_add, "hopping-arfcn-add"); - -static int verify_ts_hopping_arfcn_del(struct ctrl_cmd *cmd, const char *value, void *_data) -{ - int64_t arfcn; - enum gsm_band unused; - if (strcmp(value, "all") == 0) - return 0; - if (osmo_str_to_int64(&arfcn, value, 10, 0, 1024) < 0) - return 1; - if (gsm_arfcn2band_rc(arfcn, &unused) < 0) { - return 1; - } - return 0; -} -static int set_ts_hopping_arfcn_del(struct ctrl_cmd *cmd, void *data) -{ - struct gsm_bts_trx_ts *ts = cmd->node; - bool all = (strcmp(cmd->value, "all") == 0); - int arfcn; - - if (all) { - bitvec_zero(&ts->hopping.arfcns); - } else { - arfcn = atoi(cmd->value); - bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ZERO); - } - - /* Update Cell Allocation (list of all the frequencies allocated to a cell) */ - if (generate_cell_chan_alloc(ts->trx->bts) != 0) { - if (!all) - bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ONE); /* roll-back */ - cmd->reply = "Failed to re-generate Cell Allocation"; - return CTRL_CMD_ERROR; - } - - cmd->reply = "OK"; - return CTRL_CMD_REPLY; -} -/* Parameter format: "(<arfcn>|all)" */ -CTRL_CMD_DEFINE_WO(ts_hopping_arfcn_del, "hopping-arfcn-del"); - - -static int bsc_bts_trx_ts_ctrl_cmds_install(void) -{ - int rc = 0; - - rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_hopping_arfcn_add); - rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_hopping_arfcn_del); - - return rc; -} - -/********************* - * TRX_NODE - *********************/ static int get_trx_rf_locked(struct ctrl_cmd *cmd, void *data) { @@ -198,6 +97,51 @@ } CTRL_CMD_DEFINE(trx_max_power, "max-power-reduction"); +char *trx_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx *trx) +{ + int ts_nr; + bool first_ts = true; + char *ts_dump, *dump; + + dump = talloc_strdup(t, ""); + if (!dump) + return NULL; + + for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { + ts_dump = ts_lchan_dump_full_ctrl(t, &trx->tsts_nr); + if (!ts_dump) + return NULL; + if (!strlen(ts_dump)) + continue; + dump = talloc_asprintf_append(dump, first_ts ? "%s" : "\n%s", ts_dump); + if (!dump) + return NULL; + first_ts = false; + } + + return dump; +} + +/* Return full information about all logical channels in a TRX. + * format: bts.<0-255>.trx.<0-255>.show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_trx_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts_trx *trx = cmd->node; + + cmd->reply = trx_lchan_dump_full_ctrl(cmd, trx); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(trx_show_lchan_full, "show-lchan full"); + int bsc_bts_trx_ctrl_cmds_install(void) { int rc = 0; @@ -205,6 +149,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power); rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_arfcn); rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_rf_locked); + rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_show_lchan_full); rc |= bsc_bts_trx_ts_ctrl_cmds_install();
View file
osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_trx_ts_ctrl.c
Added
@@ -0,0 +1,151 @@ +/* + * (C) 2013-2015 by Holger Hans Peter Freyther + * (C) 2013-2022 by sysmocom s.f.m.c. GmbH + * + * 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/ctrl/control_cmd.h> + +#include <osmocom/bsc/ctrl.h> +#include <osmocom/bsc/bts.h> +#include <osmocom/bsc/system_information.h> + +static int verify_ts_hopping_arfcn_add(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + int64_t arfcn; + enum gsm_band unused; + if (osmo_str_to_int64(&arfcn, value, 10, 0, 1024) < 0) + return 1; + if (gsm_arfcn2band_rc(arfcn, &unused) < 0) + return 1; + return 0; +} +static int set_ts_hopping_arfcn_add(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts_trx_ts *ts = cmd->node; + int arfcn = atoi(cmd->value); + + bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ONE); + + /* Update Cell Allocation (list of all the frequencies allocated to a cell) */ + if (generate_cell_chan_alloc(ts->trx->bts) != 0) { + bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ZERO); /* roll-back */ + cmd->reply = "Failed to re-generate Cell Allocation"; + return CTRL_CMD_ERROR; + } + + cmd->reply = "OK"; + return CTRL_CMD_REPLY; +} +/* Parameter format: "<arfcn>" */ +CTRL_CMD_DEFINE_WO(ts_hopping_arfcn_add, "hopping-arfcn-add"); + +static int verify_ts_hopping_arfcn_del(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + int64_t arfcn; + enum gsm_band unused; + if (strcmp(value, "all") == 0) + return 0; + if (osmo_str_to_int64(&arfcn, value, 10, 0, 1024) < 0) + return 1; + if (gsm_arfcn2band_rc(arfcn, &unused) < 0) + return 1; + return 0; +} +static int set_ts_hopping_arfcn_del(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts_trx_ts *ts = cmd->node; + bool all = (strcmp(cmd->value, "all") == 0); + int arfcn; + + if (all) { + bitvec_zero(&ts->hopping.arfcns); + } else { + arfcn = atoi(cmd->value); + bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ZERO); + } + + /* Update Cell Allocation (list of all the frequencies allocated to a cell) */ + if (generate_cell_chan_alloc(ts->trx->bts) != 0) { + if (!all) + bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, ONE); /* roll-back */ + cmd->reply = "Failed to re-generate Cell Allocation"; + return CTRL_CMD_ERROR; + } + + cmd->reply = "OK"; + return CTRL_CMD_REPLY; +} +/* Parameter format: "(<arfcn>|all)" */ +CTRL_CMD_DEFINE_WO(ts_hopping_arfcn_del, "hopping-arfcn-del"); + +char *ts_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx_ts *ts) +{ + bool first_lchan = true; + char *lchan_dump, *dump; + struct gsm_lchan *lchan; + + dump = talloc_strdup(t, ""); + if (!dump) + return NULL; + + ts_for_n_lchans(lchan, ts, ts->max_lchans_possible) { + lchan_dump = lchan_dump_full_ctrl(t, lchan); + if (!lchan_dump) + return NULL; + dump = talloc_asprintf_append(dump, first_lchan ? "%s" : "\n%s", lchan_dump); + if (!dump) + return NULL; + first_lchan = false; + } + + return dump; +} + +/* Return full information about all logical channels in a timeslot. + * format: bts.<0-255>.trx.<0-255>.ts.<0-8>.show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_ts_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts_trx_ts *ts = cmd->node; + + cmd->reply = ts_lchan_dump_full_ctrl(cmd, ts); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(ts_show_lchan_full, "show-lchan full"); + +int bsc_bts_trx_ts_ctrl_cmds_install(void) +{ + int rc = 0; + + rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_hopping_arfcn_add); + rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_hopping_arfcn_del); + rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_show_lchan_full); + + rc |= bsc_bts_trx_ts_lchan_ctrl_cmds_install(); + + return rc; +}
View file
osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_trx_ts_lchan_ctrl.c
Added
@@ -0,0 +1,152 @@ +/* + * Copyright (C) 2024 by sysmocom s.f.m.c. GmbH + * + * 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 <osmocom/ctrl/control_cmd.h> + +#include <osmocom/bsc/ctrl.h> +#include <osmocom/bsc/bts.h> +#include <osmocom/bsc/system_information.h> +#include <osmocom/bsc/abis_rsl.h> +#include <osmocom/bsc/lchan_fsm.h> + +static int verify_lchan_ms_power(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + int ms_power = atoi(cmd->value); + + if (ms_power < 0 || ms_power > 40) { + cmd->reply = "Value is out of range"; + return 1; + } + + return 0; +} + +/* power control management: Get lchan's ms power in dBm + * format: bts.<0-255>.trx.<0-255>.ts.<0-8>.lchan.<0-8>.ms-power */ +static int get_lchan_ms_power(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_lchan *lchan = cmd->node; + + cmd->reply = talloc_asprintf(cmd, "%u", ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power)); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} + +/* power control management: Set lchan's ms power in dBm. + * For static ms power control it will change the ms tx power. + * For dynamic ms power control it will limit the maximum power level. + * format: bts.<0-255>.trx.<0-255>.ts.<0-8>.lchan.<0-8>.ms-power <ms power> + * ms power is in range 0..40 */ +static int set_lchan_ms_power(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_lchan *lchan = cmd->node; + + lchan->ms_power = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, atoi(cmd->value)); + rsl_chan_ms_power_ctrl(lchan); + cmd->reply = "OK"; + return CTRL_CMD_REPLY; +} + +CTRL_CMD_DEFINE(lchan_ms_power, "ms-power"); + + +char *lchan_dump_full_ctrl(const void *t, struct gsm_lchan *lchan) +{ + struct in_addr ia; + char *interference = ",", *tmsi = "", *ipa_bound = ",,", *ipa_conn = ",,"; + + if (lchan->interf_dbm != INTERF_DBM_UNKNOWN) { + interference = talloc_asprintf(t, "%d,%u", lchan->interf_dbm, lchan->interf_band); + if (!interference) + return NULL; + } + + if (lchan->conn && lchan->conn->bsub && lchan->conn->bsub->tmsi != GSM_RESERVED_TMSI) { + tmsi = talloc_asprintf(t, "0x%08x", lchan->conn->bsub->tmsi); + if (!tmsi) + return NULL; + } + + if (is_ipa_abisip_bts(lchan->ts->trx->bts) && lchan->abis_ip.bound_ip) { + ia.s_addr = htonl(lchan->abis_ip.bound_ip); + ipa_bound = talloc_asprintf(t, "%s,%u,%u", inet_ntoa(ia), lchan->abis_ip.bound_port, + lchan->abis_ip.conn_id); + if (!ipa_bound) + return NULL; + } + + if (is_ipa_abisip_bts(lchan->ts->trx->bts) && lchan->abis_ip.connect_ip) { + ia.s_addr = htonl(lchan->abis_ip.connect_ip); + ipa_conn = talloc_asprintf(t, "%s,%u,0x%02x", inet_ntoa(ia), lchan->abis_ip.connect_port, + lchan->abis_ip.speech_mode); + if (!ipa_conn) + return NULL; + } + + return talloc_asprintf(t, "%u,%u,%u,%u,%s,%u,%s,%s,%u,%u,%s,%s,%s,%s,%s,%s", + lchan->ts->trx->bts->nr, + lchan->ts->trx->nr, + lchan->ts->nr, + lchan->nr, + gsm_chan_t_name(lchan->type), + lchan->conn ? 1 : 0, lchan_state_name(lchan), + lchan->fi && lchan->fi->state == LCHAN_ST_BORKEN ? lchan->last_error : "", + lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red - lchan->bs_power_db, + ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + interference, + gsm48_chan_mode_name(lchan->current_ch_mode_rate.chan_mode), + lchan->conn && lchan->conn->bsub && strlen(lchan->conn->bsub->imsi) ? lchan->conn->bsub->imsi : "", + tmsi, + ipa_bound, + ipa_conn + ); +} + +/* Return full information about a logical channel. + * format: bts.<0-255>.trx.<0-255>.ts.<0-8>.lchan.<0-8>.show.full + * result format: <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>,<ms power>,<interference dbm>, + * <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>,<ipa bound conn id>,<ipa conn ip>, + * <ipa conn port>,<ipa conn speech mode> + */ +static int get_lchan_show_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_lchan *lchan = cmd->node; + cmd->reply = lchan_dump_full_ctrl(cmd, lchan); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(lchan_show_full, "show full"); + + +int bsc_bts_trx_ts_lchan_ctrl_cmds_install(void) +{ + int rc = 0; + + rc |= ctrl_cmd_install(CTRL_NODE_LCHAN, &cmd_lchan_ms_power); + rc |= ctrl_cmd_install(CTRL_NODE_LCHAN, &cmd_lchan_show_full); + + return rc; +}
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts_trx_vty.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_trx_vty.c
Changed
@@ -349,6 +349,13 @@ return CMD_WARNING; } + if (enabled && bts->imm_ass_time != IMM_ASS_TIME_POST_CHAN_ACK) { + vty_out(vty, + "%% ERROR: 'hopping enabled 1' works only with 'immediate-assignment post-chan-ack'%s", + VTY_NEWLINE); + return CMD_WARNING; + } + ts->hopping.enabled = enabled; return CMD_SUCCESS;
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/bts_vty.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/bts_vty.c
Changed
@@ -772,6 +772,19 @@ return CMD_SUCCESS; } +DEFUN_ATTR(cfg_bts_rach_expiry_timeout, + cfg_bts_rach_expiry_timeout_cmd, + "rach expiry-timeout <4-64>", + RACH_STR + "Set the timeout for channel requests expiry\n" + "Maximum timeout before dropping channel requests\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_bts *bts = vty->index; + bts->rach_expiry_timeout = atoi(argv0); + return CMD_SUCCESS; +} + #define REP_ACCH_STR "FACCH/SACCH repetition\n" DEFUN_USRATTR(cfg_bts_rep_dl_facch, @@ -1405,6 +1418,61 @@ return CMD_SUCCESS; } +#define NCC_STR "Network Colour Code\n" +#define NCC_PERMITTED_STR "Set permitted NCCs\n" + +DEFUN_USRATTR(cfg_bts_ncc_permitted_all, + cfg_bts_ncc_permitted_all_cmd, + X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK), + "ncc-permitted all\n", + NCC_PERMITTED_STR + "Permit all NCCs (default)\n") +{ + struct gsm_bts *bts = vty->index; + + bts->si_common.ncc_permitted = 0xff; + return CMD_SUCCESS; +} + +DEFUN_USRATTR(cfg_bts_ncc_permitted, + cfg_bts_ncc_permitted_cmd, + X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK), + "ncc-permitted <1-8> <1-8> <1-8> <1-8> <1-8> <1-8> <1-8>\n", + NCC_PERMITTED_STR + NCC_STR NCC_STR NCC_STR NCC_STR NCC_STR NCC_STR NCC_STR) +{ + struct gsm_bts *bts = vty->index; + int i; + int ncc_prev = -1; + + if (argc == 1 && !strcmp(argv0, "all")) { + bts->si_common.ncc_permitted = 0xff; + return CMD_SUCCESS; + } + + bts->si_common.ncc_permitted = 0x00; + + /* Check if NCCs are in order (like get_amr_from_arg) */ + for (i = 0; i < argc; i++) { + int ncc = atoi(argvi); + if (ncc_prev > ncc) { + vty_out(vty, "%% NCCs must be listed in order%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (ncc_prev == ncc) { + vty_out(vty, "%% NCCs must be unique%s", VTY_NEWLINE); + return CMD_WARNING; + } + ncc_prev = ncc; + } + + for (i = 0; i < argc; i++) + bts->si_common.ncc_permitted |= 1 << (atoi(argvi) - 1); + + return CMD_SUCCESS; +} + DEFUN_USRATTR(cfg_bts_radio_link_timeout, cfg_bts_radio_link_timeout_cmd, X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK), @@ -1413,8 +1481,15 @@ "Radio link timeout value (lost SACCH block)\n") { struct gsm_bts *bts = vty->index; + unsigned int radio_link_timeout = atoi(argv0); - gsm_bts_set_radio_link_timeout(bts, atoi(argv0)); + /* According to Table 10.5.2.3.1 in TS 144.018 */ + if (radio_link_timeout % 4 != 0) { + vty_out(vty, "%% Radio link timeout must be a multiple of 4%s", VTY_NEWLINE); + return CMD_WARNING; + } + + gsm_bts_set_radio_link_timeout(bts, radio_link_timeout); return CMD_SUCCESS; } @@ -1489,6 +1564,22 @@ #define NSVC_TEXT "Network Service Virtual Connection (NS-VC)\n" \ "NSVC Logical Number\n" +DEFUN_USRATTR(cfg_no_bts_gprs_nsvc, + cfg_no_bts_gprs_nsvc_cmd, + X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK), + "no gprs nsvc <0-1>", + NO_STR GPRS_TEXT NSVC_TEXT) +{ + struct gsm_bts *bts = vty->index; + int idx = atoi(argv0); + + GPRS_CHECK_ENABLED(bts); + + bts->site_mgr->gprs.nsvcidx.enabled = false; + + return CMD_SUCCESS; +} + DEFUN_USRATTR(cfg_bts_gprs_nsvci, cfg_bts_gprs_nsvci_cmd, X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK), @@ -1503,6 +1594,7 @@ GPRS_CHECK_ENABLED(bts); bts->site_mgr->gprs.nsvcidx.nsvci = atoi(argv1); + bts->site_mgr->gprs.nsvcidx.enabled = true; return CMD_SUCCESS; } @@ -1523,6 +1615,7 @@ GPRS_CHECK_ENABLED(bts); bts->site_mgr->gprs.nsvcidx.local_port = atoi(argv1); + bts->site_mgr->gprs.nsvcidx.enabled = true; return CMD_SUCCESS; } @@ -1544,6 +1637,7 @@ /* sockaddr_in and sockaddr_in6 have the port at the same position */ bts->site_mgr->gprs.nsvcidx.remote.u.sin.sin_port = htons(atoi(argv1)); + bts->site_mgr->gprs.nsvcidx.enabled = true; return CMD_SUCCESS; } @@ -1576,9 +1670,11 @@ switch (remote.af) { case AF_INET: osmo_sockaddr_str_to_in_addr(&remote, &bts->site_mgr->gprs.nsvcidx.remote.u.sin.sin_addr); + bts->site_mgr->gprs.nsvcidx.enabled = true; break; case AF_INET6: osmo_sockaddr_str_to_in6_addr(&remote, &bts->site_mgr->gprs.nsvcidx.remote.u.sin6.sin6_addr); + bts->site_mgr->gprs.nsvcidx.enabled = true; break; } @@ -2087,7 +2183,6 @@ "measurement bandwidth\n" "measurement bandwidth (8 means NA)\n") { struct gsm_bts *bts = vty->index; - struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; uint16_t arfcn = atoi(argv0); uint8_t thresh_hi = atoi(argv1), thresh_lo = atoi(argv2), prio = atoi(argv3), qrx = atoi(argv4), meas = atoi(argv5); @@ -2123,7 +2218,7 @@ vty_out(vty, "%% Warning: not enough space in SI2quater (%u/%u used) for a given EARFCN %u%s", bts->si2q_count, SI2Q_MAX_NUM, arfcn, VTY_NEWLINE); - if (osmo_earfcn_del(e, arfcn) != 0) + if (bts_earfcn_del(bts, arfcn) != 0) vty_out(vty, "%% Failed to roll-back adding EARFCN %u%s", arfcn, VTY_NEWLINE); return CMD_WARNING; @@ -2140,9 +2235,8 @@ "EARFCN\n") { struct gsm_bts *bts = vty->index; - struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; uint16_t arfcn = atoi(argv0); - int r = osmo_earfcn_del(e, arfcn); + int r = bts_earfcn_del(bts, arfcn); if (r < 0) { vty_out(vty, "%% Unable to delete arfcn %u: %s%s", arfcn, strerror(-r), VTY_NEWLINE); @@ -3169,13 +3263,35 @@ CMD_ATTR_IMMEDIATE) { struct gsm_bts *bts = vty->index; + enum imm_ass_time imm_ass_time; if (!strcmp(argv0, "pre-ts-ack")) - bts->imm_ass_time = IMM_ASS_TIME_PRE_TS_ACK; + imm_ass_time = IMM_ASS_TIME_PRE_TS_ACK; else if (!strcmp(argv0, "pre-chan-ack")) - bts->imm_ass_time = IMM_ASS_TIME_PRE_CHAN_ACK; + imm_ass_time = IMM_ASS_TIME_PRE_CHAN_ACK; else - bts->imm_ass_time = IMM_ASS_TIME_POST_CHAN_ACK; + imm_ass_time = IMM_ASS_TIME_POST_CHAN_ACK; + + if (imm_ass_time != IMM_ASS_TIME_POST_CHAN_ACK) { + struct gsm_bts_trx *trx; + + /* Early-IA does not work with frequency hopping, because the IMM ASS does not convey an ARFCN when + * frequency hopping is in use. Make sure the user knows that. */ + llist_for_each_entry(trx, &bts->trx_list, list) { + int ts_nr; + for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { + struct gsm_bts_trx_ts *ts = &trx->tsts_nr; + if (ts->hopping.enabled) { + vty_out(vty, "%% ERROR: 'hopping enabled 1' works only with" + " 'immediate-assignment post-chan-ack', see timeslot %s%s", + ts->fi->id, VTY_NEWLINE); + return CMD_WARNING; + } + } + } + } + + bts->imm_ass_time = imm_ass_time; return CMD_SUCCESS; } @@ -3897,7 +4013,6 @@ void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; - unsigned long long sec; struct gsm_bts_trx *trx; int ts_hopping_total; int ts_non_hopping_total; @@ -4029,14 +4144,7 @@ if (is_ipa_abisip_bts(bts)) { vty_out(vty, " OML Link: "); e1isl_dump_vty_tcp(vty, bts->oml_link); - vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); - if (bts_setup_ramp_active(bts->network)) - vty_out(vty, " BTS Ramping: %s", bts_setup_ramp_get_state_str(bts)); - sec = bts_uptime(bts); - if (sec) - vty_out(vty, " %llu days %llu hours %llu min. %llu sec.", - OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60); - vty_out(vty, "%s", VTY_NEWLINE); + bts_dump_vty_oml_link_state(vty, bts); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); @@ -4114,6 +4222,20 @@ bts_dump_vty_features(vty, bts); } +void bts_dump_vty_oml_link_state(struct vty *vty, struct gsm_bts *bts) +{ + unsigned long long sec; + + vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); + if (bts_setup_ramp_active(bts->network)) + vty_out(vty, " BTS Ramping: %s", bts_setup_ramp_get_state_str(bts)); + sec = bts_updowntime(bts); + if (sec) + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60); + vty_out(vty, "%s", VTY_NEWLINE); +} + static void config_write_bts_gprs(struct vty *vty, struct gsm_bts *bts) { unsigned int i; @@ -4150,6 +4272,11 @@ const struct gsm_gprs_nsvc *nsvc = &bts_sm->gprs.nsvci; struct osmo_sockaddr_str remote; + if (!nsvc->enabled) { + vty_out(vty, " no gprs nsvc %u%s", i, VTY_NEWLINE); + continue; + } + vty_out(vty, " gprs nsvc %u nsvci %u%s", i, nsvc->nsvci, VTY_NEWLINE); @@ -4345,6 +4472,24 @@ #undef cfg_out +static void config_write_bts_ncc_permitted(struct vty *vty, const char *prefix, const struct gsm_bts *bts) +{ + int i; + uint8_t ncc_permitted = bts->si_common.ncc_permitted; + + if (ncc_permitted == 0xff) + return; + + vty_out(vty, "%sncc-permitted", prefix); + + for (i = 0; i < 8; i++) { + if ((ncc_permitted & (1 << i))) + vty_out(vty, " %d", i + 1); + } + + vty_out(vty, "%s", VTY_NEWLINE); +} + static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) { int i; @@ -4445,6 +4590,7 @@ rach_max_trans_raw2val(bts->si_common.rach_control.max_trans), VTY_NEWLINE); vty_out(vty, " rach max-delay %u%s", bts->rach_max_delay, VTY_NEWLINE); + vty_out(vty, " rach expiry-timeout %u%s", bts->rach_expiry_timeout, VTY_NEWLINE); vty_out(vty, " channel-description attach %u%s", bts->si_common.chan_desc.att, VTY_NEWLINE); @@ -4724,6 +4870,8 @@ config_write_power_ctrl(vty, 2, bts, &bts->bs_power_ctrl); config_write_power_ctrl(vty, 2, bts, &bts->ms_power_ctrl); + config_write_bts_ncc_permitted(vty, " ", bts); + config_write_bts_model(vty, bts); } @@ -4789,6 +4937,7 @@ install_element(BTS_NODE, &cfg_bts_rach_tx_integer_cmd); install_element(BTS_NODE, &cfg_bts_rach_max_trans_cmd); install_element(BTS_NODE, &cfg_bts_rach_max_delay_cmd); + install_element(BTS_NODE, &cfg_bts_rach_expiry_timeout_cmd); install_element(BTS_NODE, &cfg_bts_chan_desc_att_cmd); install_element(BTS_NODE, &cfg_bts_chan_dscr_att_cmd); install_element(BTS_NODE, &cfg_bts_chan_desc_bs_pa_mfrms_cmd); @@ -4828,6 +4977,7 @@ install_element(BTS_NODE, &cfg_bts_gprs_bvci_cmd); install_element(BTS_NODE, &cfg_bts_gprs_cell_timer_cmd); install_element(BTS_NODE, &cfg_bts_gprs_nsei_cmd); + install_element(BTS_NODE, &cfg_no_bts_gprs_nsvc_cmd); install_element(BTS_NODE, &cfg_bts_gprs_nsvci_cmd); install_element(BTS_NODE, &cfg_bts_gprs_nsvc_lport_cmd); install_element(BTS_NODE, &cfg_bts_gprs_nsvc_rport_cmd); @@ -4906,6 +5056,8 @@ install_element(BTS_NODE, &cfg_bts_immediate_assignment_cmd); install_element(BTS_NODE, &cfg_bts_nch_position_cmd); install_element(BTS_NODE, &cfg_bts_no_nch_position_cmd); + install_element(BTS_NODE, &cfg_bts_ncc_permitted_all_cmd); + install_element(BTS_NODE, &cfg_bts_ncc_permitted_cmd); neighbor_ident_vty_init(); /* See also handover commands added on bts level from handover_vty.c */
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/cbsp_link.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/cbsp_link.c
Changed
@@ -54,7 +54,6 @@ static int cbsp_srv_closed_cb(struct osmo_stream_srv *conn) { struct bsc_cbc_link *cbc = osmo_stream_srv_get_data(conn); - //struct osmo_fd *ofd = osmo_stream_srv_get_ofd(conn); LOGP(DCBS, LOGL_NOTICE, "CBSP Server lost connection from %s\n", cbc->server.sock_name); talloc_free(cbc->server.sock_name); @@ -63,29 +62,28 @@ return 0; } -static int cbsp_srv_cb(struct osmo_stream_srv *conn) +static int cbsp_srv_read_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg) { struct bsc_cbc_link *cbc = osmo_stream_srv_get_data(conn); - struct osmo_fd *ofd = osmo_stream_srv_get_ofd(conn); struct osmo_cbsp_decoded *decoded; - struct msgb *msg; - int rc; - /* READ */ - rc = osmo_cbsp_recv_buffered(cbc, ofd->fd, &msg, &cbc->server.msg); - if (rc <= 0) { - if (rc == -EAGAIN || rc == -EINTR) { - /* more data needs to be read */ + if (res <= 0) { + if (res == -EAGAIN || res == -EINTR) { + msgb_free(msg); return 0; - } else if (rc == -EPIPE || rc == -ECONNRESET) { - /* lost connection */ - } else if (rc == 0) { - /* connection closed */ } + /* + if (rc == -EPIPE || rc == -ECONNRESET) { + // lost connection + } else if (rc == 0) { + // connection closed + } */ + msgb_free(msg); osmo_stream_srv_destroy(conn); cbc->server.srv = NULL; return -EBADF; } + OSMO_ASSERT(msg); decoded = osmo_cbsp_decode(conn, msg); if (decoded) { @@ -117,12 +115,15 @@ return -1; } - srv = osmo_stream_srv_create(cbc, link, fd, cbsp_srv_cb, cbsp_srv_closed_cb, cbc); + srv = osmo_stream_srv_create2(cbc, link, fd, cbc); if (!srv) { LOGP(DCBS, LOGL_ERROR, "Unable to create stream server for %s\n", osmo_sock_get_name2(fd)); return -1; } + osmo_stream_srv_set_read_cb(srv, cbsp_srv_read_cb); + osmo_stream_srv_set_closed_cb(srv, cbsp_srv_closed_cb); + osmo_stream_srv_set_segmentation_cb(srv, osmo_cbsp_segmentation_cb); cbc->server.srv = srv; if (cbc->server.sock_name) @@ -141,11 +142,10 @@ static int cbsp_client_connect_cb(struct osmo_stream_cli *cli) { struct bsc_cbc_link *cbc = osmo_stream_cli_get_data(cli); - struct osmo_fd *ofd = osmo_stream_cli_get_ofd(cli); if (cbc->client.sock_name) talloc_free(cbc->client.sock_name); - cbc->client.sock_name = osmo_sock_get_name(cbc, ofd->fd); + cbc->client.sock_name = osmo_sock_get_name(cbc, osmo_stream_cli_get_fd(cli)); LOGP(DCBS, LOGL_NOTICE, "CBSP Client connected to CBC: %s\n", cbc->client.sock_name); @@ -165,28 +165,27 @@ return 0; } -static int cbsp_client_read_cb(struct osmo_stream_cli *cli) +static int cbsp_client_read_cb(struct osmo_stream_cli *cli, int res, struct msgb *msg) { struct bsc_cbc_link *cbc = osmo_stream_cli_get_data(cli); - struct osmo_fd *ofd = osmo_stream_cli_get_ofd(cli); struct osmo_cbsp_decoded *decoded; - struct msgb *msg = NULL; - int rc; - /* READ */ - rc = osmo_cbsp_recv_buffered(cbc, ofd->fd, &msg, &cbc->client.msg); - if (rc <= 0) { - if (rc == -EAGAIN || rc == -EINTR) { - /* more data needs to be read */ + if (res <= 0) { + if (res == -EAGAIN || res == -EINTR) { + msgb_free(msg); return 0; - } else if (rc == -EPIPE || rc == -ECONNRESET) { - /* lost connection */ - } else if (rc == 0) { - /* connection closed */ } + /* + if (rc == -EPIPE || rc == -ECONNRESET) { + // lost connection + } else if (rc == 0) { + // connection closed + } */ + msgb_free(msg); osmo_stream_cli_reconnect(cli); return -EBADF; } + OSMO_ASSERT(msg); decoded = osmo_cbsp_decode(cli, msg); if (decoded) { @@ -244,7 +243,8 @@ osmo_stream_cli_set_data(cbc->client.cli, cbc); osmo_stream_cli_set_connect_cb(cbc->client.cli, cbsp_client_connect_cb); osmo_stream_cli_set_disconnect_cb(cbc->client.cli, cbsp_client_disconnect_cb); - osmo_stream_cli_set_read_cb(cbc->client.cli, cbsp_client_read_cb); + osmo_stream_cli_set_read_cb2(cbc->client.cli, cbsp_client_read_cb); + osmo_stream_cli_set_segmentation_cb(cbc->client.cli, osmo_cbsp_segmentation_cb); } /* CBC side */ osmo_stream_cli_set_addr(cbc->client.cli, cbc->client.remote_addr.ip);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/codec_pref.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/codec_pref.c
Changed
@@ -481,22 +481,28 @@ rc = -1; } - bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_full.gsm48_ie; - rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie); - if (rc_rate < 0) { - LOGP(DMSC, LOGL_FATAL, - "network amr tch-f mode config of BTS %u does not intersect with amr-config of MSC %u\n", - bts->nr, msc->nr); - rc = -1; + /* Full rate codec check, only if any full rate TS is configured. */ + if (test_codec_support_bts_rate(bts, true)) { + bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_full.gsm48_ie; + rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie); + if (rc_rate < 0) { + LOGP(DMSC, LOGL_FATAL, + "network amr tch-f mode config of BTS %u does not intersect with amr-config of MSC %u\n", + bts->nr, msc->nr); + rc = -1; + } } - bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_half.gsm48_ie; - rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie); - if (rc_rate < 0) { - LOGP(DMSC, LOGL_FATAL, - "network amr tch-h mode config of BTS %u does not intersect with amr-config of MSC %u\n", - bts->nr, msc->nr); - rc = -1; + /* Half rate codec check, only if any half rate TS is configured. */ + if (test_codec_support_bts_rate(bts, false)) { + bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_half.gsm48_ie; + rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie); + if (rc_rate < 0) { + LOGP(DMSC, LOGL_FATAL, + "network amr tch-h mode config of BTS %u does not intersect with amr-config of MSC %u\n", + bts->nr, msc->nr); + rc = -1; + } } } }
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/e1_config.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/e1_config.c
Changed
@@ -197,7 +197,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp); - bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ + bts->updowntime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/gsm_04_08_rr.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/gsm_04_08_rr.c
Changed
@@ -854,7 +854,7 @@ * 2) SI*ter entries (if available) * ARFCN 0 is at the end of each sub list. * Both sub lists are stored in one bitvec (nbv), iterate twice through it. */ -static int neigh_list_get_arfcn(struct gsm_bts *bts, const struct bitvec *nbv, unsigned int idx) +int neigh_list_get_arfcn(struct gsm_bts *bts, const struct bitvec *nbv, unsigned int idx) { unsigned int arfcn, i = 0; @@ -893,8 +893,7 @@ if (bitvec_get_bit_pos(nbv, 0) == ONE && !band_compatible(bts, 0) && i == idx) return 0; - LOGP(DRR, LOGL_ERROR, "Invalid BCCH channel list index %d in measurement report\n", idx); - return 0; + return -EINVAL; } int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg) @@ -902,8 +901,9 @@ struct gsm48_hdr *gh = msgb_l3(msg); uint8_t *data = gh->data; struct gsm_bts *bts = msg->lchan->ts->trx->bts; - struct bitvec *nbv = &bts->si_common.neigh_list; + struct bitvec *nbv; struct gsm_meas_rep_cell *mrc; + int rc; if (gh->msg_type != GSM48_MT_RR_MEAS_REP) return -EINVAL; @@ -927,11 +927,21 @@ return 0; } + /* If the phone reports BA-IND 1 this is a report for the SI5* set. + * If we have generated SI5* with manual SI5 neighbor list, the measurements refer to it. */ + if ((rep->flags & MEAS_REP_F_BA1) && bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) + nbv = &bts->si_common.si5_neigh_list; + else + nbv = &bts->si_common.neigh_list; + /* an encoding nightmare in perfection */ mrc = &rep->cell0; mrc->rxlev = data3 & 0x3f; mrc->neigh_idx = data4 >> 3; - mrc->arfcn = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + rc = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + if (rc < 0) + goto error; + mrc->arfcn = rc; mrc->bsic = ((data4 & 0x07) << 3) | (data5 >> 5); if (rep->num_cell < 2) return 0; @@ -939,7 +949,10 @@ mrc = &rep->cell1; mrc->rxlev = ((data5 & 0x1f) << 1) | (data6 >> 7); mrc->neigh_idx = (data6 >> 2) & 0x1f; - mrc->arfcn = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + rc = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + if (rc < 0) + goto error; + mrc->arfcn = rc; mrc->bsic = ((data6 & 0x03) << 4) | (data7 >> 4); if (rep->num_cell < 3) return 0; @@ -947,7 +960,10 @@ mrc = &rep->cell2; mrc->rxlev = ((data7 & 0x0f) << 2) | (data8 >> 6); mrc->neigh_idx = (data8 >> 1) & 0x1f; - mrc->arfcn = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + rc = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + if (rc < 0) + goto error; + mrc->arfcn = rc; mrc->bsic = ((data8 & 0x01) << 5) | (data9 >> 3); if (rep->num_cell < 4) return 0; @@ -955,7 +971,10 @@ mrc = &rep->cell3; mrc->rxlev = ((data9 & 0x07) << 3) | (data10 >> 5); mrc->neigh_idx = data10 & 0x1f; - mrc->arfcn = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + rc = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + if (rc < 0) + goto error; + mrc->arfcn = rc; mrc->bsic = data11 >> 2; if (rep->num_cell < 5) return 0; @@ -963,7 +982,10 @@ mrc = &rep->cell4; mrc->rxlev = ((data11 & 0x03) << 4) | (data12 >> 4); mrc->neigh_idx = ((data12 & 0xf) << 1) | (data13 >> 7); - mrc->arfcn = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + rc = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + if (rc < 0) + goto error; + mrc->arfcn = rc; mrc->bsic = (data13 >> 1) & 0x3f; if (rep->num_cell < 6) return 0; @@ -971,10 +993,18 @@ mrc = &rep->cell5; mrc->rxlev = ((data13 & 0x01) << 5) | (data14 >> 3); mrc->neigh_idx = ((data14 & 0x07) << 2) | (data15 >> 6); - mrc->arfcn = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + rc = neigh_list_get_arfcn(bts, nbv, mrc->neigh_idx); + if (rc < 0) + goto error; + mrc->arfcn = rc; mrc->bsic = data15 & 0x3f; return 0; + +error: + LOGP(DRR, LOGL_ERROR, "Invalid BCCH channel list index %d in measurement report\n", mrc->neigh_idx); + rep->num_cell = 0; + return 0; } /* 9.1.29 RR Status */
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/gsm_data.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/gsm_data.c
Changed
@@ -327,85 +327,56 @@ } /* 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, - const struct abis_om_obj_inst *obj_inst) +struct gsm_abis_mo *gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, + const struct abis_om_obj_inst *obj_inst) { struct gsm_bts_trx *trx; - struct gsm_abis_mo *mo = NULL; switch (obj_class) { case NM_OC_BTS: - mo = &bts->mo; - break; + return &bts->mo; case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->mo; - break; + return trx != NULL ? &trx->mo : NULL; case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bb_transc.mo; - break; + return trx != NULL ? &trx->bb_transc.mo : NULL; case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); if (obj_inst->ts_nr >= TRX_NR_TS) return NULL; - mo = &trx->tsobj_inst->ts_nr.mo; - break; + trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); + return trx != NULL ? &trx->tsobj_inst->ts_nr.mo : NULL; case NM_OC_SITE_MANAGER: - mo = &bts->site_mgr->mo; - break; + return &bts->site_mgr->mo; case NM_OC_BS11: switch (obj_inst->bts_nr) { case BS11_OBJ_CCLK: - mo = &bts->bs11.cclk.mo; - break; + return &bts->bs11.cclk.mo; case BS11_OBJ_BBSIG: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.bbsig.mo; - break; + return trx != NULL ? &trx->bs11.bbsig.mo : NULL; case BS11_OBJ_PA: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.pa.mo; - break; - default: - return NULL; + return trx != NULL ? &trx->bs11.pa.mo : NULL; } break; case NM_OC_BS11_RACK: - mo = &bts->bs11.rack.mo; - break; + return &bts->bs11.rack.mo; case NM_OC_BS11_ENVABTSE: if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) return NULL; - mo = &bts->bs11.envabtseobj_inst->trx_nr.mo; - break; + return &bts->bs11.envabtseobj_inst->trx_nr.mo; case NM_OC_GPRS_NSE: - mo = &bts->site_mgr->gprs.nse.mo; - break; + return &bts->site_mgr->gprs.nse.mo; case NM_OC_GPRS_CELL: - mo = &bts->gprs.cell.mo; - break; + return &bts->gprs.cell.mo; case NM_OC_GPRS_NSVC: if (obj_inst->trx_nr >= ARRAY_SIZE(bts->site_mgr->gprs.nsvc)) return NULL; - mo = &bts->site_mgr->gprs.nsvcobj_inst->trx_nr.mo; - break; + return &bts->site_mgr->gprs.nsvcobj_inst->trx_nr.mo; } - return mo; + + return NULL; } /* obtain the gsm_nm_state data structure for a given object instance */ @@ -489,22 +460,20 @@ if (vamos_is_secondary) cbits = ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Bm_ACCHs; else - cbits = 0x01; + cbits = ABIS_RSL_CHAN_NR_CBITS_Bm_ACCHs; break; case GSM_PCHAN_PDCH: if (lchan_nr != 0) return -EINVAL; - cbits = RSL_CHAN_OSMO_PDCH >> 3; + cbits = ABIS_RSL_CHAN_NR_CBITS_OSMO_PDCH; break; case GSM_PCHAN_TCH_H: if (lchan_nr >= 2) return -EINVAL; if (vamos_is_secondary) cbits = ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(lchan_nr); - else { - cbits = 0x02; - cbits += lchan_nr; - } + else + cbits = ABIS_RSL_CHAN_NR_CBITS_Lm_ACCHs(lchan_nr); break; case GSM_PCHAN_CCCH_SDCCH4: case GSM_PCHAN_CCCH_SDCCH4_CBCH: @@ -514,24 +483,22 @@ * See osmo-bts-xxx/oml.c:opstart_compl(). */ if (lchan_nr == CCCH_LCHAN) - chan_nr = 0; - else if (lchan_nr >= 4) + lchan_nr = 0; + else if (lchan_nr > 4) return -EINVAL; - cbits = 0x04; - cbits += lchan_nr; + cbits = ABIS_RSL_CHAN_NR_CBITS_SDCCH4_ACCH(lchan_nr); break; case GSM_PCHAN_SDCCH8_SACCH8C: case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: if (lchan_nr >= 8) return -EINVAL; - cbits = 0x08; - cbits += lchan_nr; + cbits = ABIS_RSL_CHAN_NR_CBITS_SDCCH8_ACCH(lchan_nr); break; default: case GSM_PCHAN_CCCH: if (lchan_nr != 0) return -EINVAL; - cbits = 0x10; + cbits = ABIS_RSL_CHAN_NR_CBITS_BCCH; break; }
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/lb.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/lb.c
Changed
@@ -209,8 +209,9 @@ break; default: - LOGP(DLCS, LOGL_ERROR, "Unhandled SIGTRAN operation %s on primitive %u\n", - get_value_string(osmo_prim_op_names, oph->operation), oph->primitive); + LOGP(DLCS, LOGL_ERROR, "Unhandled SIGTRAN primitive %s.%s\n", + osmo_scu_prim_type_name(oph->primitive), + get_value_string(osmo_prim_op_names, oph->operation)); break; }
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/lchan_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/lchan_fsm.c
Changed
@@ -330,10 +330,13 @@ LCHAN_ST_WAIT_RLL_RTP_ESTABLISH = { .T = 3101 }, LCHAN_ST_WAIT_RLL_RTP_RELEASED = { .T = 3109 }, LCHAN_ST_WAIT_BEFORE_RF_RELEASE = { .T = 3111 }, - LCHAN_ST_WAIT_RF_RELEASE_ACK = { .T = 3111 }, + LCHAN_ST_WAIT_RF_RELEASE_ACK = { .T = -6 }, LCHAN_ST_WAIT_AFTER_ERROR = { .T = -3111 }, LCHAN_ST_WAIT_RR_CHAN_MODE_MODIFY_ACK = { .T = -13 }, LCHAN_ST_WAIT_RSL_CHAN_MODE_MODIFY_ACK = { .T = -14 }, + LCHAN_ST_BORKEN = { .T = -28 }, + LCHAN_ST_RECOVER_WAIT_ACTIV_ACK = { .T = -6 }, + LCHAN_ST_RECOVER_WAIT_RF_RELEASE_ACK = { .T = -6 }, }; /* Transition to a state, using the T timer defined in lchan_fsm_timeouts. @@ -380,6 +383,8 @@ LCHAN_ST_BORKEN = LCHAN_ST_BORKEN, LCHAN_ST_WAIT_RR_CHAN_MODE_MODIFY_ACK = LCHAN_ST_WAIT_RF_RELEASE_ACK, LCHAN_ST_WAIT_RSL_CHAN_MODE_MODIFY_ACK = LCHAN_ST_WAIT_RF_RELEASE_ACK, + LCHAN_ST_RECOVER_WAIT_ACTIV_ACK = LCHAN_ST_BORKEN, + LCHAN_ST_RECOVER_WAIT_RF_RELEASE_ACK = LCHAN_ST_BORKEN, }; #define lchan_fail(fmt, args...) lchan_fail_to(lchan_fsm_on_errorfi->state, fmt, ## args) @@ -1631,6 +1636,71 @@ } } +static void lchan_fsm_recover_wait_activ_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int rc; + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + + LOG_LCHAN(lchan, LOGL_INFO, "attempting to recover from BORKEN lchan\n"); + + lchan->type = GSM_LCHAN_SDCCH; + lchan->activate.info.ta_known = true; + + chan_counts_ts_update(lchan->ts); + + rc = rsl_tx_chan_activ(lchan, RSL_ACT_INTRA_NORM_ASS, 0); + if (rc) + lchan_fail("Tx Chan Activ failed: %s (%d)", strerror(-rc), rc); +} + +static void lchan_fsm_recover_wait_activ_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + + switch (event) { + + case LCHAN_EV_RSL_CHAN_ACTIV_ACK: + lchan_fsm_state_chg(LCHAN_ST_RECOVER_WAIT_RF_RELEASE_ACK); + break; + + case LCHAN_EV_RSL_CHAN_ACTIV_NACK: + /* If an earlier lchan activ got through to the BTS, but the + * ACK did not get back to the BSC, it may still be active on + * the BTS side. Proceed to release it. */ + LOG_LCHAN(lchan, LOGL_NOTICE, "received NACK for activation of BORKEN lchan, assuming still active\n"); + lchan_fsm_state_chg(LCHAN_ST_RECOVER_WAIT_RF_RELEASE_ACK); + break; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_fsm_recover_wait_rf_release_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int rc; + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + + rc = rsl_tx_rf_chan_release(lchan); + if (rc) + lchan_fail("Tx RSL RF Channel Release failed: %s (%d)\n", strerror(-rc), rc); +} + +static void lchan_fsm_recover_wait_rf_release_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + switch (event) { + + case LCHAN_EV_RSL_RF_CHAN_REL_ACK: + LOG_LCHAN(lchan, LOGL_NOTICE, "successfully recovered BORKEN lchan\n"); + lchan_fsm_state_chg(LCHAN_ST_UNUSED); + break; + + default: + OSMO_ASSERT(false); + } +} + #define S(x) (1 << (x)) static const struct osmo_fsm_state lchan_fsm_states = { @@ -1820,6 +1890,32 @@ | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) | S(LCHAN_ST_UNUSED) | S(LCHAN_ST_WAIT_AFTER_ERROR) + | S(LCHAN_ST_RECOVER_WAIT_ACTIV_ACK) + , + }, + LCHAN_ST_RECOVER_WAIT_ACTIV_ACK = { + .name = "RECOVER_WAIT_ACTIV_ACK", + .onenter = lchan_fsm_recover_wait_activ_ack_onenter, + .action = lchan_fsm_recover_wait_activ_ack, + .in_event_mask = 0 + | S(LCHAN_EV_RSL_CHAN_ACTIV_ACK) + | S(LCHAN_EV_RSL_CHAN_ACTIV_NACK) + , + .out_state_mask = 0 + | S(LCHAN_ST_BORKEN) + | S(LCHAN_ST_RECOVER_WAIT_RF_RELEASE_ACK) + , + }, + LCHAN_ST_RECOVER_WAIT_RF_RELEASE_ACK = { + .name = "RECOVER_WAIT_RF_RELEASE_ACK", + .onenter = lchan_fsm_recover_wait_rf_release_ack_onenter, + .action = lchan_fsm_recover_wait_rf_release_ack, + .in_event_mask = 0 + | S(LCHAN_EV_RSL_RF_CHAN_REL_ACK) + , + .out_state_mask = 0 + | S(LCHAN_ST_BORKEN) + | S(LCHAN_ST_UNUSED) , }, }; @@ -1893,6 +1989,10 @@ lchan_fsm_state_chg(LCHAN_ST_UNUSED); return 0; + case LCHAN_ST_BORKEN: + lchan_fsm_state_chg(LCHAN_ST_RECOVER_WAIT_ACTIV_ACK); + return 0; + default: lchan->release.in_error = true; lchan->release.rsl_error_cause = RSL_ERR_INTERWORKING;
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/meas_feed.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/meas_feed.c
Changed
@@ -6,7 +6,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/socket.h> -#include <osmocom/core/write_queue.h> +#include <osmocom/core/osmo_io.h> #include <osmocom/core/talloc.h> #include <osmocom/core/utils.h> @@ -23,17 +23,14 @@ #include <osmocom/bsc/lchan.h> struct meas_feed_state { - struct osmo_wqueue wqueue; - unsigned int wqueue_max_len; + struct osmo_io_fd *io_fd; char scenario31+1; char *dst_host; uint16_t dst_port; + size_t txqueue_max; }; -static struct meas_feed_state g_mfs = { - .wqueue.bfd.fd = -1, - .wqueue_max_len = MEAS_FEED_WQUEUE_MAX_LEN_DEFAULT, -}; +static struct meas_feed_state g_mfs = { .txqueue_max = MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT }; static int process_meas_rep(struct gsm_meas_rep *mr) { @@ -41,7 +38,7 @@ struct meas_feed_meas *mfm; struct bsc_subscr *bsub; - OSMO_ASSERT(g_mfs.wqueue.bfd.fd != -1); + OSMO_ASSERT(g_mfs.io_fd != NULL); /* ignore measurements as long as we don't know who it is */ if (!mr->lchan) { @@ -90,7 +87,7 @@ mfm->ss_nr = mr->lchan->nr; /* and send it to the socket */ - if (osmo_wqueue_enqueue(&g_mfs.wqueue, msg) != 0) { + if (osmo_iofd_write_msgb(g_mfs.io_fd, msg)) { LOGP(DMEAS, LOGL_ERROR, "meas_feed %s: sending measurement report failed\n", gsm_lchan_name(mr->lchan)); msgb_free(msg); @@ -115,63 +112,54 @@ return 0; } -static int feed_write_cb(struct osmo_fd *ofd, struct msgb *msg) -{ - return write(ofd->fd, msgb_data(msg), msgb_length(msg)); -} - -static int feed_read_cb(struct osmo_fd *ofd) -{ - int rc; - char buf256; - - rc = read(ofd->fd, buf, sizeof(buf)); - osmo_fd_read_disable(ofd); - - return rc; -} - static void meas_feed_close(void) { - if (g_mfs.wqueue.bfd.fd == -1) + if (g_mfs.io_fd == NULL) return; osmo_signal_unregister_handler(SS_LCHAN, meas_feed_sig_cb, NULL); - osmo_wqueue_clear(&g_mfs.wqueue); - osmo_fd_unregister(&g_mfs.wqueue.bfd); - close(g_mfs.wqueue.bfd.fd); - g_mfs.wqueue.bfd.fd = -1; + osmo_iofd_close(g_mfs.io_fd); + osmo_iofd_free(g_mfs.io_fd); + g_mfs.io_fd = NULL; +} + +static void meas_feed_noop_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +{ } int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port) { int rc; - + /* osmo_io code throws an error if 'write_cb' is NULL, so we set a no-op */ + struct osmo_io_ops meas_feed_oio = { + .read_cb = NULL, + .write_cb = meas_feed_noop_cb, + .segmentation_cb = NULL + }; /* Already initialized */ - if (g_mfs.wqueue.bfd.fd > 0) { + if (g_mfs.io_fd != NULL) { /* No change needed, do nothing */ if (!strcmp(dst_host, g_mfs.dst_host) && dst_port == g_mfs.dst_port) return 0; meas_feed_close(); } - osmo_wqueue_init(&g_mfs.wqueue, g_mfs.wqueue_max_len); - g_mfs.wqueue.write_cb = feed_write_cb; - g_mfs.wqueue.read_cb = feed_read_cb; - - rc = osmo_sock_init_ofd(&g_mfs.wqueue.bfd, AF_UNSPEC, SOCK_DGRAM, - IPPROTO_UDP, dst_host, dst_port, - OSMO_SOCK_F_CONNECT); + rc = osmo_sock_init(AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, dst_host, dst_port, OSMO_SOCK_F_CONNECT); if (rc < 0) { - g_mfs.wqueue.bfd.fd = -1; + osmo_signal_unregister_handler(SS_LCHAN, meas_feed_sig_cb, NULL); return rc; } + g_mfs.io_fd = osmo_iofd_setup(NULL, rc, "meas_iofd", OSMO_IO_FD_MODE_READ_WRITE, &meas_feed_oio, NULL); + if (!g_mfs.io_fd) + return -1; + osmo_iofd_set_txqueue_max_length(g_mfs.io_fd, g_mfs.txqueue_max); + if ((rc = osmo_iofd_register(g_mfs.io_fd, rc))) + return rc; - osmo_fd_read_disable(&g_mfs.wqueue.bfd); osmo_talloc_replace_string(NULL, &g_mfs.dst_host, dst_host); g_mfs.dst_port = dst_port; osmo_signal_register_handler(SS_LCHAN, meas_feed_sig_cb, NULL); LOGP(DMEAS, LOGL_DEBUG, "meas_feed: started %s\n", - osmo_sock_get_name2(g_mfs.wqueue.bfd.fd)); + osmo_sock_get_name2(osmo_iofd_get_fd(g_mfs.io_fd))); return 0; } @@ -181,16 +169,16 @@ *host = g_mfs.dst_host; } -void meas_feed_wqueue_max_length_set(unsigned int max_length) +void meas_feed_txqueue_max_length_set(unsigned int max_length) { - g_mfs.wqueue_max_len = max_length; - if (g_mfs.wqueue.bfd.fd) - g_mfs.wqueue.max_length = max_length; + g_mfs.txqueue_max = max_length; + if (g_mfs.io_fd) + osmo_iofd_set_txqueue_max_length(g_mfs.io_fd, max_length); } -unsigned int meas_feed_wqueue_max_length_get(void) +unsigned int meas_feed_txqueue_max_length_get(void) { - return g_mfs.wqueue_max_len; + return g_mfs.txqueue_max; } void meas_feed_scenario_set(const char *name)
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/net_init.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/net_init.c
Changed
@@ -74,6 +74,7 @@ " 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 = -28, .default_val = 30, .desc = "Interval at which to try to recover a BORKEN lchan" }, { .T = -3105, .default_val = GSM_NY1_DEFAULT, .unit = OSMO_TDEF_CUSTOM, .desc = "Ny1: Maximum number of Physical Information (re)transmissions" }, { .T = -3111, .default_val = 4, .desc = "Wait time after lchan was released in error (should be T3111 + 2s)" },
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_bb_transc_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_bb_transc_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -61,6 +61,7 @@ { struct gsm_bts_bb_trx *bb_transc = (struct gsm_bts_bb_trx *)fi->priv; + bb_transc->mo.sw_act_rep_received = false; bb_transc->mo.get_attr_sent = false; bb_transc->mo.get_attr_rep_received = false; bb_transc->mo.adm_unlock_sent = false; @@ -71,11 +72,14 @@ static void st_op_disabled_notinstalled(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; const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: + bb_transc->mo.sw_act_rep_received = true; + break; case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -109,15 +113,25 @@ if (bts_setup_ramp_wait(trx->bts)) return; + /* nanoBTS only: delay until SW Activated Report is received, which + * tells us the IPA Object version (may be used to set attr conditionally). */ + if (is_nanobts(trx->bts) && !bb_transc->mo.sw_act_rep_received) + return; + /* Request TRX-level attributes */ if (!bb_transc->mo.get_attr_sent && !bb_transc->mo.get_attr_rep_received) { - bb_transc->mo.get_attr_sent = true; - /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ - const uint8_t trx_attr = { NM_ATT_MANUF_STATE, NM_ATT_SW_CONFIG, NM_ATT_IPACC_SUPP_FEATURES }; - /* we should not request more attributes than we're ready to handle */ - OSMO_ASSERT(sizeof(trx_attr) < MAX_BTS_ATTR); + uint8_t attr_buf3; /* enlarge if needed */ + uint8_t *ptr = &attr_buf0; + + *(ptr++) = NM_ATT_MANUF_STATE; + *(ptr++) = NM_ATT_SW_CONFIG; + if (is_ipa_abisip_bts(trx->bts)) + *(ptr++) = NM_ATT_IPACC_SUPP_FEATURES; + + OSMO_ASSERT((ptr - attr_buf) <= sizeof(attr_buf)); abis_nm_get_attr(trx->bts, NM_OC_BASEB_TRANSC, 0, trx->nr, 0xff, - trx_attr, sizeof(trx_attr)); + &attr_buf0, (ptr - attr_buf)); + bb_transc->mo.get_attr_sent = true; } if (bb_transc->mo.get_attr_rep_received && @@ -170,6 +184,10 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + bb_transc->mo.sw_act_rep_received = true; + configure_loop(bb_transc, &bb_transc->mo.nm_state, false); + break; case NM_EV_GET_ATTR_REP: bb_transc->mo.get_attr_rep_received = true; bb_transc->mo.get_attr_sent = false; @@ -229,6 +247,10 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + bb_transc->mo.sw_act_rep_received = true; + configure_loop(bb_transc, &bb_transc->mo.nm_state, true); + break; case NM_EV_GET_ATTR_REP: bb_transc->mo.get_attr_rep_received = true; bb_transc->mo.get_attr_sent = false; @@ -370,6 +392,7 @@ }, NM_BB_TRANSC_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_GET_ATTR_REP) | X(NM_EV_RSL_CONNECT_ACK) | @@ -385,6 +408,7 @@ }, NM_BB_TRANSC_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_GET_ATTR_REP) | X(NM_EV_RSL_CONNECT_ACK) |
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_bts_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_bts_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -48,6 +48,7 @@ { struct gsm_bts *bts = (struct gsm_bts *)fi->priv; + bts->mo.sw_act_rep_received = false; bts->mo.get_attr_sent = false; bts->mo.get_attr_rep_received = false; bts->mo.set_attr_sent = false; @@ -58,11 +59,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_bts *bts = (struct gsm_bts *)fi->priv; struct nm_statechg_signal_data *nsd; const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: + bts->mo.sw_act_rep_received = true; + break; case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -96,15 +100,25 @@ if (bts_setup_ramp_wait(bts)) return; + /* nanoBTS only: delay until SW Activated Report is received, which + * tells us the IPA Object version (may be used to set attr conditionally). */ + if (is_nanobts(bts) && !bts->mo.sw_act_rep_received) + return; + /* Request generic BTS-level attributes */ if (!bts->mo.get_attr_sent && !bts->mo.get_attr_rep_received) { - bts->mo.get_attr_sent = true; - /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ - const uint8_t bts_attr = { NM_ATT_MANUF_ID, NM_ATT_SW_CONFIG, NM_ATT_IPACC_SUPP_FEATURES}; - /* we should not request more attributes than we're ready to handle */ - OSMO_ASSERT(sizeof(bts_attr) < MAX_BTS_ATTR); + uint8_t attr_buf3; /* enlarge if needed */ + uint8_t *ptr = &attr_buf0; + + *(ptr++) = NM_ATT_MANUF_ID; + *(ptr++) = NM_ATT_SW_CONFIG; + if (is_ipa_abisip_bts(bts)) + *(ptr++) = NM_ATT_IPACC_SUPP_FEATURES; + + OSMO_ASSERT((ptr - attr_buf) <= sizeof(attr_buf)); abis_nm_get_attr(bts, NM_OC_BTS, 0, 0xff, 0xff, - bts_attr, sizeof(bts_attr)); + &attr_buf0, (ptr - attr_buf)); + bts->mo.get_attr_sent = true; } if (bts->mo.get_attr_rep_received && @@ -174,6 +188,10 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + bts->mo.sw_act_rep_received = true; + configure_loop(bts, &bts->mo.nm_state, false); + break; case NM_EV_GET_ATTR_REP: rx_get_attr_rep(bts, false); return; @@ -227,6 +245,10 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + bts->mo.sw_act_rep_received = true; + configure_loop(bts, &bts->mo.nm_state, true); + break; case NM_EV_GET_ATTR_REP: rx_get_attr_rep(bts, true); return; @@ -361,6 +383,7 @@ }, NM_BTS_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_GET_ATTR_REP) | X(NM_EV_SET_ATTR_ACK) | @@ -375,6 +398,7 @@ }, NM_BTS_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_GET_ATTR_REP) | X(NM_EV_SET_ATTR_ACK) |
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_bts_sm_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_bts_sm_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -49,6 +49,7 @@ struct gsm_bts *bts = gsm_bts_sm_get_bts(site_mgr); site_mgr->peer_has_no_avstate_offline = (bts->type == GSM_BTS_TYPE_NANOBTS); + site_mgr->mo.sw_act_rep_received = false; site_mgr->mo.opstart_sent = false; } @@ -61,6 +62,8 @@ switch (event) { case NM_EV_SW_ACT_REP: + site_mgr->mo.sw_act_rep_received = true; + break; case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -107,6 +110,11 @@ if (bts_setup_ramp_wait(bts)) return; + /* nanoBTS only: delay until SW Activated Report is received, which + * tells us the IPA Object version (may be used to set attr conditionally). */ + if (is_nanobts(bts) && !site_mgr->mo.sw_act_rep_received) + return; + if (allow_opstart && !site_mgr->mo.opstart_sent) { site_mgr->mo.opstart_sent = true; abis_nm_opstart(bts, NM_OC_SITE_MANAGER, 0xff, 0xff, 0xff); @@ -116,10 +124,15 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv; struct nm_statechg_signal_data *nsd; const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + site_mgr->mo.sw_act_rep_received = true; + configure_loop(site_mgr, &site_mgr->mo.nm_state, false); + break; case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -160,6 +173,10 @@ struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv; switch (event) { + case NM_EV_SW_ACT_REP: + site_mgr->mo.sw_act_rep_received = true; + configure_loop(site_mgr, &site_mgr->mo.nm_state, true); + break; case NM_EV_STATE_CHG_REP: nsd = (struct nm_statechg_signal_data *)data; new_state = &nsd->new_state; @@ -255,6 +272,7 @@ }, NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_SETUP_RAMP_READY), .out_state_mask = @@ -266,6 +284,7 @@ }, NM_BTS_SM_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_SETUP_RAMP_READY), .out_state_mask =
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_channel_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_channel_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -136,6 +136,9 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + configure_loop(ts, &ts->mo.nm_state, false); + break; case NM_EV_SET_ATTR_ACK: ts->mo.set_attr_ack_received = true; ts->mo.set_attr_sent = false; @@ -186,6 +189,9 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + configure_loop(ts, &ts->mo.nm_state, true); + break; case NM_EV_SET_ATTR_ACK: ts->mo.set_attr_ack_received = true; ts->mo.set_attr_sent = false; @@ -312,6 +318,7 @@ }, NM_CHAN_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY), @@ -325,6 +332,7 @@ }, NM_CHAN_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY),
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_common_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_common_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>.
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_gprs_cell_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_gprs_cell_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -48,6 +48,9 @@ { struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv; + cell->mo.sw_act_rep_received = false; + cell->mo.get_attr_sent = false; + cell->mo.get_attr_rep_received = false; cell->mo.set_attr_sent = false; cell->mo.set_attr_ack_received = false; cell->mo.adm_unlock_sent = false; @@ -56,11 +59,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv; struct nm_statechg_signal_data *nsd; const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: + cell->mo.sw_act_rep_received = true; + break; case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -98,6 +104,28 @@ if (bts_setup_ramp_wait(bts)) return; + /* nanoBTS only: delay until SW Activated Report is received, which + * tells us the IPA Object version (may be used to set attr conditionally). */ + if (is_nanobts(bts) && !cell->mo.sw_act_rep_received) + return; + + if (!cell->mo.get_attr_sent && !cell->mo.get_attr_rep_received) { + uint8_t attr_buf2; /* enlarge if needed */ + uint8_t *ptr = &attr_buf0; + + *(ptr++) = NM_ATT_SW_CONFIG; + if (is_ipa_abisip_bts(bts)) + *(ptr++) = NM_ATT_IPACC_SUPP_FEATURES; + + OSMO_ASSERT((ptr - attr_buf) <= sizeof(attr_buf)); + abis_nm_get_attr(bts, NM_OC_GPRS_CELL, + bts->bts_nr, 0x00, 0xff, + &attr_buf0, (ptr - attr_buf)); + cell->mo.get_attr_sent = true; + } + + /* OS#6172: old osmo-bts versions do NACK Get Attributes for GPRS Cell, + * so we do not check if cell->mo.get_attr_rep_received is set here. */ if (!cell->mo.set_attr_sent && !cell->mo.set_attr_ack_received) { cell->mo.set_attr_sent = true; msgb = nanobts_gen_set_cell_attr(bts); @@ -145,6 +173,15 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + cell->mo.sw_act_rep_received = true; + configure_loop(cell, &cell->mo.nm_state, false); + break; + case NM_EV_GET_ATTR_REP: + cell->mo.get_attr_rep_received = true; + cell->mo.get_attr_sent = false; + configure_loop(cell, &cell->mo.nm_state, false); + return; case NM_EV_SET_ATTR_ACK: cell->mo.set_attr_ack_received = true; cell->mo.set_attr_sent = false; @@ -196,6 +233,15 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + cell->mo.sw_act_rep_received = true; + configure_loop(cell, &cell->mo.nm_state, true); + break; + case NM_EV_GET_ATTR_REP: + cell->mo.get_attr_rep_received = true; + cell->mo.get_attr_sent = false; + configure_loop(cell, &cell->mo.nm_state, true); + return; case NM_EV_SET_ATTR_ACK: cell->mo.set_attr_ack_received = true; cell->mo.set_attr_sent = false; @@ -325,7 +371,9 @@ }, NM_GPRS_CELL_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | + X(NM_EV_GET_ATTR_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY), .out_state_mask = @@ -338,7 +386,9 @@ }, NM_GPRS_CELL_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | + X(NM_EV_GET_ATTR_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY), .out_state_mask =
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_gprs_nse_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_gprs_nse_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -49,6 +49,7 @@ { struct gsm_gprs_nse *nse = (struct gsm_gprs_nse *)fi->priv; + nse->mo.sw_act_rep_received = false; nse->mo.set_attr_sent = false; nse->mo.set_attr_ack_received = false; nse->mo.adm_unlock_sent = false; @@ -57,11 +58,14 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_gprs_nse *nse = (struct gsm_gprs_nse *)fi->priv; struct nm_statechg_signal_data *nsd; const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: + nse->mo.sw_act_rep_received = true; + break; case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -97,6 +101,11 @@ if (bts_setup_ramp_wait(bts)) return; + /* nanoBTS only: delay until SW Activated Report is received, which + * tells us the IPA Object version (may be used to set attr conditionally). */ + if (is_nanobts(bts) && !nse->mo.sw_act_rep_received) + return; + if (!nse->mo.set_attr_sent && !nse->mo.set_attr_ack_received) { nse->mo.set_attr_sent = true; msgb = nanobts_gen_set_nse_attr(bts_sm); @@ -146,6 +155,10 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + nse->mo.sw_act_rep_received = true; + configure_loop(nse, &nse->mo.nm_state, false); + break; case NM_EV_SET_ATTR_ACK: nse->mo.set_attr_ack_received = true; nse->mo.set_attr_sent = false; @@ -197,6 +210,10 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + nse->mo.sw_act_rep_received = true; + configure_loop(nse, &nse->mo.nm_state, true); + break; case NM_EV_SET_ATTR_ACK: nse->mo.set_attr_ack_received = true; nse->mo.set_attr_sent = false; @@ -327,6 +344,7 @@ }, NM_GPRS_NSE_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY), @@ -340,6 +358,7 @@ }, NM_GPRS_NSE_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY),
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_gprs_nsvc_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_gprs_nsvc_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -49,6 +49,7 @@ { struct gsm_gprs_nsvc *nsvc = (struct gsm_gprs_nsvc *)fi->priv; + nsvc->mo.sw_act_rep_received = false; nsvc->mo.set_attr_sent = false; nsvc->mo.set_attr_sent = false; nsvc->mo.set_attr_ack_received = false; @@ -58,12 +59,15 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_gprs_nsvc *nsvc = (struct gsm_gprs_nsvc *)fi->priv; struct nm_statechg_signal_data *nsd; const struct gsm_nm_state *new_state; switch (event) { - case NM_EV_FEATURE_NEGOTIATED: case NM_EV_SW_ACT_REP: + nsvc->mo.sw_act_rep_received = true; + break; + case NM_EV_FEATURE_NEGOTIATED: case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -92,6 +96,10 @@ static bool has_valid_nsvc(const struct gsm_gprs_nsvc *nsvc) { + /* If not configured (enabled) at all. */ + if (!nsvc->enabled) + return false; + /* remote address must be valid */ if (osmo_sockaddr_is_any(&nsvc->remote)) return false; @@ -116,6 +124,11 @@ if (bts_setup_ramp_wait(nsvc->bts)) return; + /* nanoBTS only: delay until SW Activated Report is received, which + * tells us the IPA Object version (may be used to set attr conditionally). */ + if (is_nanobts(nsvc->bts) && !nsvc->mo.sw_act_rep_received) + return; + /* We need to know BTS features in order to know if we can set IPv6 addresses */ if (gsm_bts_features_negotiated(nsvc->bts) && !nsvc->mo.set_attr_sent && !nsvc->mo.set_attr_ack_received) { @@ -176,6 +189,9 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + nsvc->mo.sw_act_rep_received = true; + /* fall-through */ case NM_EV_FEATURE_NEGOTIATED: configure_loop(nsvc, &nsvc->mo.nm_state, false); return; @@ -229,6 +245,9 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + nsvc->mo.sw_act_rep_received = true; + /* fall-through */ case NM_EV_FEATURE_NEGOTIATED: configure_loop(nsvc, &nsvc->mo.nm_state, true); return; @@ -355,6 +374,7 @@ }, NM_GPRS_NSVC_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_FEATURE_NEGOTIATED) | X(NM_EV_SET_ATTR_ACK) | @@ -369,6 +389,7 @@ }, NM_GPRS_NSVC_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | X(NM_EV_FEATURE_NEGOTIATED) | X(NM_EV_SET_ATTR_ACK) |
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/nm_rcarrier_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/nm_rcarrier_fsm.c
Changed
@@ -13,7 +13,7 @@ * 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. + * 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/>. @@ -58,6 +58,9 @@ { struct gsm_bts_trx *trx = (struct gsm_bts_trx *)fi->priv; + trx->mo.sw_act_rep_received = false; + trx->mo.get_attr_sent = false; + trx->mo.get_attr_rep_received = false; trx->mo.set_attr_sent = false; trx->mo.set_attr_ack_received = false; trx->mo.adm_unlock_sent = false; @@ -66,11 +69,14 @@ static void st_op_disabled_notinstalled(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; const struct gsm_nm_state *new_state; switch (event) { case NM_EV_SW_ACT_REP: + trx->mo.sw_act_rep_received = true; + break; case NM_EV_SETUP_RAMP_READY: break; case NM_EV_STATE_CHG_REP: @@ -104,6 +110,28 @@ if (bts_setup_ramp_wait(trx->bts)) return; + /* nanoBTS only: delay until SW Activated Report is received, which + * tells us the IPA Object version (may be used to set attr conditionally). */ + if (is_nanobts(trx->bts) && !trx->mo.sw_act_rep_received) + return; + + if (!trx->mo.get_attr_sent && !trx->mo.get_attr_rep_received) { + uint8_t attr_buf2; /* enlarge if needed */ + uint8_t *ptr = &attr_buf0; + + *(ptr++) = NM_ATT_SW_CONFIG; + if (is_ipa_abisip_bts(trx->bts)) + *(ptr++) = NM_ATT_IPACC_SUPP_FEATURES; + + OSMO_ASSERT((ptr - attr_buf) <= sizeof(attr_buf)); + abis_nm_get_attr(trx->bts, NM_OC_RADIO_CARRIER, + trx->bts->bts_nr, trx->nr, 0xff, + &attr_buf0, (ptr - attr_buf)); + trx->mo.get_attr_sent = true; + } + + /* OS#6172: old osmo-bts versions do NACK Get Attributes for Radio Carrier, + * so we do not check if trx->mo.get_attr_rep_received is set here. */ if (!trx->mo.set_attr_sent && !trx->mo.set_attr_ack_received) { trx->mo.set_attr_sent = true; msgb = nanobts_gen_set_radio_attr(trx->bts, trx); @@ -151,6 +179,15 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + trx->mo.sw_act_rep_received = true; + configure_loop(trx, &trx->mo.nm_state, false); + break; + case NM_EV_GET_ATTR_REP: + trx->mo.get_attr_rep_received = true; + trx->mo.get_attr_sent = false; + configure_loop(trx, &trx->mo.nm_state, false); + return; case NM_EV_SET_ATTR_ACK: trx->mo.set_attr_ack_received = true; trx->mo.set_attr_sent = false; @@ -201,6 +238,15 @@ const struct gsm_nm_state *new_state; switch (event) { + case NM_EV_SW_ACT_REP: + trx->mo.sw_act_rep_received = true; + configure_loop(trx, &trx->mo.nm_state, true); + break; + case NM_EV_GET_ATTR_REP: + trx->mo.get_attr_rep_received = true; + trx->mo.get_attr_sent = false; + configure_loop(trx, &trx->mo.nm_state, true); + return; case NM_EV_SET_ATTR_ACK: trx->mo.set_attr_ack_received = true; trx->mo.set_attr_sent = false; @@ -348,7 +394,9 @@ }, NM_RCARRIER_ST_OP_DISABLED_DEPENDENCY = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | + X(NM_EV_GET_ATTR_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY), .out_state_mask = @@ -361,7 +409,9 @@ }, NM_RCARRIER_ST_OP_DISABLED_OFFLINE = { .in_event_mask = + X(NM_EV_SW_ACT_REP) | X(NM_EV_STATE_CHG_REP) | + X(NM_EV_GET_ATTR_REP) | X(NM_EV_SET_ATTR_ACK) | X(NM_EV_SETUP_RAMP_READY), .out_state_mask =
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/osmo_bsc_bssap.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/osmo_bsc_bssap.c
Changed
@@ -992,6 +992,26 @@ return 0; } +static int bssmap_handle_ass_req_tp_rtp_ext(struct tlv_parsed *tp, + struct assignment_request *req, + uint8_t *cause) +{ + /* If the special TW-TS-003 BSSMAP IE is not included, + * we are in standard 3GPP-compliant operation mode - + * no more work is needed here. */ + if (!TLVP_PRESENT(tp, GSM0808_IE_THEMWI_RTP_EXTENSIONS)) + return 0; + + /* the format is TLV with one required byte of value */ + if (TLVP_LEN(tp, GSM0808_IE_THEMWI_RTP_EXTENSIONS) < 1) { + *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; + return -1; + } + + req->rtp_extensions = *TLVP_VAL(tp, GSM0808_IE_THEMWI_RTP_EXTENSIONS); + return 0; +} + static int bssmap_handle_ass_req_ct_data(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, struct gsm0808_channel_type *ct, struct assignment_request *req, uint8_t *cause) @@ -1056,6 +1076,10 @@ return -1; } + /* optional RTP extensions per TW-TS-003 */ + if (bssmap_handle_ass_req_tp_rtp_ext(tp, req, cause) < 0) + return -1; + return 0; }
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/osmo_bsc_main.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/osmo_bsc_main.c
Changed
@@ -39,6 +39,7 @@ #include <osmocom/bsc/handover_fsm.h> #include <osmocom/bsc/smscb.h> #include <osmocom/bsc/lb.h> +#include <osmocom/bsc/meas_feed.h> #include <osmocom/ctrl/control_cmd.h> #include <osmocom/ctrl/control_if.h> @@ -971,6 +972,7 @@ acc_ramp_global_init(); paging_global_init(); smscb_global_init(); + meas_feed_txqueue_max_length_set(MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT); /* Read the config */ rc = bsc_network_configure(config_file);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/osmo_bsc_mgcp.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/osmo_bsc_mgcp.c
Changed
@@ -2,6 +2,7 @@ * SCCPlite MGCP handling * * (C) 2018 by Harald Welte <laforge@gnumonks.org> + * (C) 2023 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 @@ -19,6 +20,15 @@ * */ +#include <string.h> + +#include <osmocom/core/utils.h> +#include <osmocom/core/msgb.h> +#include <osmocom/core/socket.h> +#include <osmocom/core/sockaddr_str.h> +#include <osmocom/mgcp_client/mgcp_client_endpoint_fsm.h> +#include <osmocom/mgcp_client/mgcp_client.h> + #include <osmocom/bsc/bsc_msc_data.h> #include <osmocom/bsc/osmo_bsc.h> #include <osmocom/bsc/gsm_data.h> @@ -46,22 +56,123 @@ return osmo_msc_data_find(bsc_gsmnet, msc_nr); } +/* negative on error, zero upon success */ +static int parse_local_endpoint_name(char *buf, size_t buf_len, const char *data) +{ + char line1024; + char *epstart, *sep; + const char *start = data; + char *eol = strpbrk(start, "\r\n"); + + if (!eol) + return -1; + + if (eol - start > sizeof(line)) + return -1; + memcpy(line, start, eol - start); + lineeol - start = '\0'; + + if (!(epstart = strchr(line, ' '))) + return -1; + epstart++; + /* epstart now points to trans */ + + if (!(epstart = strchr(epstart, ' '))) + return -1; + epstart++; + /* epstart now points to endpoint */ + if (!(sep = strchr(epstart, '@'))) + return -1; + if (sep - epstart >= buf_len) + return -1; + + *sep = '\0'; + osmo_strlcpy(buf, epstart, buf_len); + return 0; +} + /* We received an IPA-encapsulated MGCP message from a MSC. Transfers msg ownership. */ int bsc_sccplite_rx_mgcp(struct osmo_ss7_asp *asp, struct msgb *msg) { struct bsc_msc_data *msc; + struct gsm_subscriber_connection *conn; + char rcv_ep_local_name1024; + struct osmo_sockaddr_str osa_str = {}; + struct osmo_sockaddr osa = {}; + socklen_t dest_len; + struct mgcp_client *mgcp_cli = NULL; int rc; - LOGP(DMSC, LOGL_NOTICE, "%s: Received IPA-encapsulated MGCP: %s\n", + LOGP(DMSC, LOGL_INFO, "%s: Received IPA-encapsulated MGCP: %s\n", osmo_ss7_asp_get_name(asp), msg->l2h); + msc = msc_from_asp(asp); - if (msc) { - /* we don't have a write queue here as we simply expect the socket buffers - * to be large enough to deal with whatever small/infrequent MGCP messages */ - rc = send(msc->mgcp_ipa.ofd.fd, msgb_l2(msg), msgb_l2len(msg), 0); - } else + if (!msc) { + rc = 0; + goto free_msg_ret; + } + + rc = parse_local_endpoint_name(rcv_ep_local_name, sizeof(rcv_ep_local_name), (const char *)msg->l2h); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "(%s:) Received IPA-encapsulated MGCP: Failed to parse CIC\n", + osmo_ss7_asp_get_name(asp)); + goto free_msg_ret; + } + + /* Lookup which conn attached to the MSC holds an MGW endpoint with the + * name Endpoint Number as the one provided in the MGCP msg we received + * from MSC. Since CIC are unique per MSC, that's the same MGW in the + * pool where we have to forward the MGCP message. */ + llist_for_each_entry(conn, &bsc_gsmnet->subscr_conns, entry) { + const char *ep_local_name; + if (conn->sccp.msc != msc) + continue; /* Only conns belonging to this MSC */ + if (!conn->user_plane.mgw_endpoint) + continue; + ep_local_name = osmo_mgcpc_ep_local_name(conn->user_plane.mgw_endpoint); + LOGPFSMSL(conn->fi, DMSC, LOGL_DEBUG, "ep_local_name='%s' vs rcv_ep_local_name='%s'\n", + ep_local_name ? : "(null)", rcv_ep_local_name); + if (!ep_local_name) + continue; + if (strcmp(ep_local_name, rcv_ep_local_name) != 0) + continue; + mgcp_cli = osmo_mgcpc_ep_client(conn->user_plane.mgw_endpoint); + if (!mgcp_cli) + continue; + break; + } + + if (!mgcp_cli) { + LOGP(DMSC, LOGL_ERROR, "(%s:) Received IPA-encapsulated MGCP: Failed to find associated MGW\n", + osmo_ss7_asp_get_name(asp)); rc = 0; + goto free_msg_ret; + } + + rc = osmo_sockaddr_str_from_str(&osa_str, mgcp_client_remote_addr_str(mgcp_cli), + mgcp_client_remote_port(mgcp_cli)); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "(%s:) Received IPA-encapsulated MGCP: Failed to parse MGCP address %s:%u\n", + osmo_ss7_asp_get_name(asp), mgcp_client_remote_addr_str(mgcp_cli), mgcp_client_remote_port(mgcp_cli)); + goto free_msg_ret; + } + + LOGP(DMSC, LOGL_NOTICE, "%s: Forwarding IPA-encapsulated MGCP to MGW at " OSMO_SOCKADDR_STR_FMT "\n", + osmo_ss7_asp_get_name(asp), OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULL(&osa_str)); + + rc = osmo_sockaddr_str_to_sockaddr(&osa_str, &osa.u.sas); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "(%s:) Received IPA-encapsulated MGCP: Failed to parse MGCP address " OSMO_SOCKADDR_STR_FMT "\n", + osmo_ss7_asp_get_name(asp), OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULL(&osa_str)); + goto free_msg_ret; + } + dest_len = osmo_sockaddr_size(&osa); + + /* we don't have a write queue here as we simply expect the socket buffers + * to be large enough to deal with whatever small/infrequent MGCP messages */ + rc = sendto(msc->mgcp_ipa.ofd.fd, msgb_l2(msg), msgb_l2len(msg), 0, &osa.u.sa, dest_len); +free_msg_ret: msgb_free(msg); return rc; }
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/osmo_bsc_msc.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/osmo_bsc_msc.c
Changed
@@ -376,26 +376,15 @@ int osmo_bsc_msc_init(struct bsc_msc_data *msc) { - struct gsm_network *net = msc->network; - struct mgcp_client *mgcp_cli; int rc; /* Everything below refers to SCCP-Lite MSC connections only. */ if (msc_is_aoip(msc)) return 0; - /* Note: MGW is preselected here at startup, which means currently - * osmo-bsc configured for SCCPLite doesn't support MGW pools with more - * than 1 MGW. - */ - mgcp_cli = mgcp_client_pool_get(net->mgw.mgw_pool); - OSMO_ASSERT(mgcp_cli); rc = osmo_sock_init2_ofd(&msc->mgcp_ipa.ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, msc->mgcp_ipa.local_addr, msc->mgcp_ipa.local_port, - mgcp_client_remote_addr_str(mgcp_cli), - mgcp_client_remote_port(mgcp_cli), - OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); - mgcp_client_pool_put(mgcp_cli); + NULL, 0, OSMO_SOCK_F_BIND); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "msc %u: Could not create/connect/bind MGCP proxy socket: %d\n", msc->nr, rc);
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/osmo_bsc_sigtran.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/osmo_bsc_sigtran.c
Changed
@@ -363,9 +363,16 @@ handle_pcstate_ind(osmo_sccp_get_ss7(sccp), &scu_prim->u.pcstate); break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_STATE, PRIM_OP_INDICATION): + LOGP(DMSC, LOGL_DEBUG, "SCCP-User-SAP: Ignoring %s.%s\n", + osmo_scu_prim_type_name(oph->primitive), + get_value_string(osmo_prim_op_names, oph->operation)); + break; + default: - LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN operation %s on primitive %u\n", - get_value_string(osmo_prim_op_names, oph->operation), oph->primitive); + LOGP(DMSC, LOGL_ERROR, "SCCP-User-SAP: Unhandled %s.%s\n", + osmo_scu_prim_type_name(oph->primitive), + get_value_string(osmo_prim_op_names, oph->operation)); break; }
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/pcu_sock.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/pcu_sock.c
Changed
@@ -64,7 +64,7 @@ if (!state) return false; - if (state->conn_bfd.fd <= 0) + if (state->upqueue.bfd.fd <= 0) return false; return true; } @@ -713,6 +713,8 @@ return rc; } +static void pcu_sock_close(struct pcu_sock_state *state); + /* * PCU socket interface */ @@ -722,6 +724,7 @@ struct pcu_sock_state *state = net->pcu_state; struct osmo_fd *conn_bfd; struct gsm_pcu_if *pcu_prim = (struct gsm_pcu_if *) msg->data; + int rc; if (!state) { if (pcu_prim->msg_type != PCU_IF_MSG_TIME_IND) @@ -730,7 +733,7 @@ msgb_free(msg); return -EINVAL; } - conn_bfd = &state->conn_bfd; + conn_bfd = &state->upqueue.bfd; if (conn_bfd->fd <= 0) { if (pcu_prim->msg_type != PCU_IF_MSG_TIME_IND) LOGP(DPCU, LOGL_NOTICE, "PCU socket not connected, " @@ -738,8 +741,17 @@ msgb_free(msg); return -EIO; } - msgb_enqueue(&state->upqueue, msg); - osmo_fd_write_enable(conn_bfd); + rc = osmo_wqueue_enqueue(&state->upqueue, msg); + if (rc < 0) { + if (rc == -ENOSPC) + LOGP(DPCU, LOGL_NOTICE, + "PCU not reacting (more than %u messages waiting). Closing connection\n", + state->upqueue.max_length); + pcu_sock_close(state); + msgb_free(msg); + return rc; + } + return 0; } @@ -771,7 +783,7 @@ static void pcu_sock_close(struct pcu_sock_state *state) { - struct osmo_fd *bfd = &state->conn_bfd; + struct osmo_fd *bfd = &state->upqueue.bfd; struct gsm_bts *bts; LOGP(DPCU, LOGL_NOTICE, "PCU socket has LOST connection\n"); @@ -790,10 +802,7 @@ } /* flush the queue */ - while (!llist_empty(&state->upqueue)) { - struct msgb *msg = msgb_dequeue(&state->upqueue); - msgb_free(msg); - } + osmo_wqueue_clear(&state->upqueue); } static int pcu_sock_read(struct osmo_fd *bfd) @@ -842,45 +851,22 @@ return -1; } -static int pcu_sock_write(struct osmo_fd *bfd) +static int pcu_sock_write(struct osmo_fd *bfd, struct msgb *msg) { struct pcu_sock_state *state = bfd->data; int rc; - while (!llist_empty(&state->upqueue)) { - struct msgb *msg, *msg2; - struct gsm_pcu_if *pcu_prim; - - /* peek at the beginning of the queue */ - msg = llist_entry(state->upqueue.next, struct msgb, list); - pcu_prim = (struct gsm_pcu_if *)msg->data; - - osmo_fd_write_disable(bfd); - - /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ - if (!msgb_length(msg)) { - LOGP(DPCU, LOGL_ERROR, "message type (%d) with ZERO " - "bytes!\n", pcu_prim->msg_type); - goto dontsend; - } - - /* try to send it over the socket */ - rc = write(bfd->fd, msgb_data(msg), msgb_length(msg)); - if (rc == 0) - goto close; - if (rc < 0) { - if (errno == EAGAIN) { - osmo_fd_write_enable(bfd); - break; - } - goto close; - } + /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ + OSMO_ASSERT(msgb_length(msg) > 0); + /* try to send it over the socket */ + rc = write(bfd->fd, msgb_data(msg), msgb_length(msg)); + if (OSMO_UNLIKELY(rc == 0)) + goto close; + if (OSMO_UNLIKELY(rc < 0)) { + if (errno == EAGAIN) + return -EAGAIN; + return -1; -dontsend: - /* _after_ we send it, we can deueue */ - msg2 = msgb_dequeue(&state->upqueue); - assert(msg == msg2); - msgb_free(msg); } return 0; @@ -890,21 +876,6 @@ return -1; } -static int pcu_sock_cb(struct osmo_fd *bfd, unsigned int flags) -{ - int rc = 0; - - if (flags & OSMO_FD_READ) - rc = pcu_sock_read(bfd); - if (rc < 0) - return rc; - - if (flags & OSMO_FD_WRITE) - rc = pcu_sock_write(bfd); - - return rc; -} - static void pdch_act_bts(struct gsm_bts *bts) { struct gsm_bts_trx *trx; @@ -927,7 +898,7 @@ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags) { struct pcu_sock_state *state = (struct pcu_sock_state *)bfd->data; - struct osmo_fd *conn_bfd = &state->conn_bfd; + struct osmo_fd *conn_bfd = &state->upqueue.bfd; struct sockaddr_un un_addr; struct gsm_bts *bts; socklen_t len; @@ -948,7 +919,7 @@ return 0; } - osmo_fd_setup(conn_bfd, fd, OSMO_FD_READ, pcu_sock_cb, state, 0); + osmo_fd_setup(conn_bfd, fd, OSMO_FD_READ, osmo_wqueue_bfd_cb, state, 0); if (osmo_fd_register(conn_bfd) != 0) { LOGP(DPCU, LOGL_ERROR, "Failed to register new connection fd\n"); @@ -979,9 +950,11 @@ if (!state) return -ENOMEM; - INIT_LLIST_HEAD(&state->upqueue); + osmo_wqueue_init(&state->upqueue, net->pcu_sock_wqueue_len_max); + state->upqueue.read_cb = pcu_sock_read; + state->upqueue.write_cb = pcu_sock_write; + state->upqueue.bfd.fd = -1; state->net = net; - state->conn_bfd.fd = -1; bfd = &state->listen_bfd; @@ -1020,7 +993,7 @@ if (!state) return; - conn_bfd = &state->conn_bfd; + conn_bfd = &state->upqueue.bfd; if (conn_bfd->fd > 0) pcu_sock_close(state); bfd = &state->listen_bfd;
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/power_control.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/power_control.c
Changed
@@ -14,7 +14,7 @@ * 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. + * 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/>.
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/system_information.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/system_information.c
Changed
@@ -216,6 +216,26 @@ return scramble; } +int bts_earfcn_del(struct gsm_bts *bts, uint16_t earfcn) +{ + struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; + int r; + + r = osmo_earfcn_del(e, earfcn); + + if (r < 0) + return r; + + /* If the last earfcn was removed, invlidate common neighbours limitations */ + if (si2q_earfcn_count(e) == 0) { + e->thresh_lo_valid = false; + e->qrxlm_valid = false; + e->prio_valid = false; + } + + return r; +} + int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, uint8_t qrx, uint8_t meas_bw) { @@ -223,7 +243,7 @@ int r; /* EARFCN may already exist, so we delete it to avoid duplicates */ - if (osmo_earfcn_del(e, earfcn) == 0) + if (bts_earfcn_del(bts, earfcn) == 0) LOGP(DRR, LOGL_NOTICE, "EARFCN %u is already in the list, modifying\n", earfcn); if (meas_bw < EARFCN_MEAS_BW_INVALID) @@ -525,8 +545,8 @@ /* 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++) { + /* Check presence of R-GSM / E-GSM ARFCNs 955..1023 */ + for (i = 955; pgsm && i <= 1023; i++) { if (bitvec_get_bit_pos(bv, i) == ONE) pgsm = false; } @@ -1226,6 +1246,269 @@ return l2_plen + rc; } +static int si10_rest_octets_encode(struct gsm_bts *s_bts, struct bitvec *bv, struct gsm_bts *n_bts, uint8_t index) +{ + /* The BA-IND must be equal to the BA-IND in SI5*. */ + /* <BA ind : bit(1)> */ + bitvec_set_bit(bv, 1); + + /* Do we have neighbor cells ? */ + /* { L <spare padding> | H <neighbour information> } */ + if (!n_bts) + return 0; + bitvec_set_bit(bv, H); + + /* <first frequency: bit(5)> */ + bitvec_set_uint(bv, index, 5); + + /* <bsic : bit(6)> */ + bitvec_set_uint(bv, n_bts->bsic, 6); + + /* We do not provide empty cell information. */ + /* { H <cell parameters> | L } */ + bitvec_set_bit(bv, H); + + /* If cell is barred, we do not need further cell info. */ + /* <cell barred> | L <further cell info> */ + if (n_bts->si_common.rach_control.cell_bar) { + /* H */ + bitvec_set_bit(bv, H); + /* We are done with the first cell info. */ + return 0; + } + bitvec_set_bit(bv, L); + + /* If LA is different for serving cell, we need to add CRH. */ + /* { H <cell reselect hysteresis : bit(3)> | L } */ + if (s_bts->location_area_code != n_bts->location_area_code) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, n_bts->si_common.cell_sel_par.cell_resel_hyst, 3); + } else + bitvec_set_bit(bv, L); + + /* <ms txpwr max cch : bit(5)> */ + bitvec_set_uint(bv, n_bts->si_common.cell_sel_par.ms_txpwr_max_ccch, 5); + + /* <rxlev access min : bit(6)> */ + bitvec_set_uint(bv, n_bts->si_common.cell_sel_par.rxlev_acc_min, 6); + + /* <cell reselect offset : bit(6)> */ + if (n_bts->si_common.cell_ro_sel_par.present) + bitvec_set_uint(bv, n_bts->si_common.cell_ro_sel_par.cell_resel_off, 6); + else + bitvec_set_uint(bv, 0, 6); + + /* <temporary offset : bit(3)> */ + if (n_bts->si_common.cell_ro_sel_par.present) + bitvec_set_uint(bv, n_bts->si_common.cell_ro_sel_par.temp_offs, 3); + else + bitvec_set_uint(bv, 0, 3); + + /* <penalty time : bit(5)> */ + if (n_bts->si_common.cell_ro_sel_par.present) + bitvec_set_uint(bv, n_bts->si_common.cell_ro_sel_par.penalty_time, 5); + else + bitvec_set_uint(bv, 0, 5); + + /* We are done with the first cell info. */ + return 0; +} + +static int si10_rest_octets_encode_other(struct gsm_bts *s_bts, struct bitvec *bv, struct gsm_bts *l_bts, + struct gsm_bts *n_bts, uint8_t last_index, uint8_t index) +{ + int rc; + + /* If the bv buffer would overflow, then the bits are not written. Each bitvec_set_* call will return + * an error code. This error is returned with this function. */ + + /* { H <info field> } */ + bitvec_set_bit(bv, H); + + /* How many frequency indices do we skip? */ + /* <next frequency>** L <differential cell info> */ + while ((last_index = (last_index + 1) & 0x1f) != index) { + /* H */ + bitvec_set_bit(bv, H); + } + bitvec_set_bit(bv, L); + + /* If NCC is equal, just send BCC, otherwise send complete BSIC. */ + /* { H <BCC : bit(3)> | L <bsic : bit(6)> } */ + if ((l_bts->bsic & 0x38) == (n_bts->bsic & 0x38)) + bitvec_set_uint(bv, n_bts->bsic & 0x07, 3); + else + bitvec_set_uint(bv, n_bts->bsic, 6); + + /* We do not provide empty cell information. */ + /* { H <cell parameters> | L } */ + bitvec_set_bit(bv, H); + + /* If cell is barred, we do not need further cell info. */ + /* <cell barred> | L <further cell info> */ + if (n_bts->si_common.rach_control.cell_bar) { + /* H */ + rc = bitvec_set_bit(bv, H); + /* We are done with the other cell info. */ + return rc; + } + bitvec_set_bit(bv, L); + + /* If LA is different for serving cell, we need to add CRH. */ + /* { H <cell reselect hysteresis : bit(3)> | L } */ + if (s_bts->location_area_code != n_bts->location_area_code) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, n_bts->si_common.cell_sel_par.cell_resel_hyst, 3); + } else + bitvec_set_bit(bv, L); + + /* { H <ms txpwr max cch : bit(5)> | L } */ + if (l_bts->si_common.cell_sel_par.ms_txpwr_max_ccch != n_bts->si_common.cell_sel_par.ms_txpwr_max_ccch) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, n_bts->si_common.cell_sel_par.ms_txpwr_max_ccch, 5); + } else + bitvec_set_bit(bv, L); + + /* { H <rxlev access min : bit(6)> | L } */ + if (l_bts->si_common.cell_sel_par.rxlev_acc_min != n_bts->si_common.cell_sel_par.rxlev_acc_min) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, n_bts->si_common.cell_sel_par.rxlev_acc_min, 6); + } else + bitvec_set_bit(bv, L); + + /* { H <cell reselect offset : bit(6)> | L } */ + if (l_bts->si_common.cell_ro_sel_par.present != n_bts->si_common.cell_ro_sel_par.present || + (n_bts->si_common.cell_ro_sel_par.present && + l_bts->si_common.cell_ro_sel_par.cell_resel_off != n_bts->si_common.cell_ro_sel_par.cell_resel_off)) { + bitvec_set_bit(bv, H); + if (n_bts->si_common.cell_ro_sel_par.present) + bitvec_set_uint(bv, n_bts->si_common.cell_ro_sel_par.cell_resel_off, 6); + else + bitvec_set_uint(bv, 0, 6); + } else + bitvec_set_bit(bv, L); + + /* { H <temporary offset : bit(3)> | L } */ + if (l_bts->si_common.cell_ro_sel_par.present != n_bts->si_common.cell_ro_sel_par.present || + (n_bts->si_common.cell_ro_sel_par.present && + l_bts->si_common.cell_ro_sel_par.temp_offs != n_bts->si_common.cell_ro_sel_par.temp_offs)) { + bitvec_set_bit(bv, H); + if (n_bts->si_common.cell_ro_sel_par.present) + bitvec_set_uint(bv, n_bts->si_common.cell_ro_sel_par.temp_offs, 3); + else + bitvec_set_uint(bv, 0, 3); + } else + bitvec_set_bit(bv, L); + + /* { H <penalty time : bit(5)> | L } */ + if (l_bts->si_common.cell_ro_sel_par.present != n_bts->si_common.cell_ro_sel_par.present || + (n_bts->si_common.cell_ro_sel_par.present && + l_bts->si_common.cell_ro_sel_par.penalty_time != n_bts->si_common.cell_ro_sel_par.penalty_time)) { + bitvec_set_bit(bv, H); + if (n_bts->si_common.cell_ro_sel_par.present) + rc = bitvec_set_uint(bv, n_bts->si_common.cell_ro_sel_par.penalty_time, 5); + else + rc = bitvec_set_uint(bv, 0, 5); + } else + rc = bitvec_set_bit(bv, L); + + /* We are done with the other cell info. */ + return rc; +} + +/* Generate SI 10 and return the number of bits used in the rest octet. */ +int gsm_generate_si10(struct gsm48_system_information_type_10 *si10, size_t len, + const struct gsm_subscriber_connection *conn) +{ + struct bitvec *nbv; + struct gsm_bts *s_bts = conn->lchan->ts->trx->bts, *l_bts = NULL; + int i, last_i = -1; + bool any_neighbor = false; + int rc; + + struct bitvec bv = { + .data_len = len - sizeof(*si10), + .data = si10->rest_octets, + }; + + si10->rr_short_pd = 0; /* 3GPP TS 24.007 §11.3.2.1 */ + si10->msg_type = GSM48_MT_RR_SH_SI10; + si10->l2_header = 0; /* 3GPP TS 44.006 §6.4a */ + + /* If we have gernerated SI5 with separate SI5 list, the used frequency indexes refer to it. */ + if (s_bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) + nbv = &s_bts->si_common.si5_neigh_list; + else + nbv = &s_bts->si_common.neigh_list; + + /* Get up to 32 possible neighbor frequencies that SI10 can refer to. */ + for (i = 0; i < 32; i++) { + struct gsm_bts *c_bts, *n_bts; + struct gsm_subscriber_connection *c; + unsigned int save_cur_bit; + int16_t arfcn; + arfcn = neigh_list_get_arfcn(s_bts, nbv, i); + /* End of list */ + if (arfcn < 0) + break; + /* Is this neighbour used for this group call? */ + n_bts = NULL; + llist_for_each_entry(c, &conn->vgcs_chan.call->vgcs_call.chan_list, vgcs_chan.list) { + if (c == conn) + continue; + if (!c->lchan) + continue; + c_bts = c->lchan->ts->trx->bts; + if (c_bts->c0->arfcn != arfcn) + continue; + n_bts = c_bts; + break; + } + if (n_bts) { + if (!any_neighbor) { + /* First neighbor, so generate rest octets with first cell info. */ + LOGP(DRR, LOGL_INFO, "SI 10 with cell ID %d.\n", n_bts->cell_identity); + rc = si10_rest_octets_encode(s_bts, &bv, n_bts, i); + if (rc < 0) + return rc; + any_neighbor = true; + } else { + /* Save current position, so we can restore to last position in case of failure. */ + save_cur_bit = bv.cur_bit; + /* Nth neighbor, so add rest octets with differential cell info. */ + LOGP(DRR, LOGL_INFO, "Append cell ID %d to SI 10.\n", n_bts->cell_identity); + OSMO_ASSERT(l_bts && last_i >= 0); + rc = si10_rest_octets_encode_other(s_bts, &bv, l_bts, n_bts, last_i, i); + if (rc < 0) { + LOGP(DRR, LOGL_INFO, "Skip cell ID %d, SI 10 would overflow.\n", + n_bts->cell_identity); + /* Resore last position. */ + bv.cur_bit = save_cur_bit; + break; + } + } + last_i = i; + l_bts = n_bts; + } + } + + /* If no neighbor exists, generate rest octets without any neighbor info. */ + if (!any_neighbor) { + LOGP(DRR, LOGL_INFO, "SI 10 without any neighbor cell.\n"); + rc = si10_rest_octets_encode(s_bts, &bv, NULL, 0); + if (rc < 0) + return rc; + } + + /* Do spare padding. We cannot do it earlier, because encoding might corrupt it if differential cell info + * does not fit into the message. */ + while ((bv.cur_bit & 7)) + bitvec_set_bit(&bv, L); + memset(bv.data + bv.cur_bit / 8, GSM_MACBLOCK_PADDING, bv.data_len - bv.cur_bit / 8); + + return len; +} + static int generate_si13(enum osmo_sysinfo_type t, struct gsm_bts *bts) { struct gsm48_system_information_type_13 *si13 =
View file
osmo-bsc_1.11.1.tar.xz/src/osmo-bsc/vgcs_fsm.c -> osmo-bsc_1.12.0.tar.xz/src/osmo-bsc/vgcs_fsm.c
Changed
@@ -53,6 +53,7 @@ #include <osmocom/bsc/gsm_04_08_rr.h> #include <osmocom/bsc/bts_trx.h> #include <osmocom/bsc/bts.h> +#include <osmocom/bsc/system_information.h> #define S(x) (1 << (x)) @@ -129,6 +130,38 @@ * VGCS call FSM */ +/* Add/update SI10. It must be called whenever a channel is activated or failed. */ +static void si10_update(struct gsm_subscriber_connection *conn) +{ + struct gsm_subscriber_connection *c; + uint8_t si10SI10_LENGTH; + int rc; + + /* Skip SI10 update, if not all channels have been activated or failed. */ + llist_for_each_entry(c, &conn->vgcs_call.chan_list, vgcs_chan.list) { + if (c->vgcs_chan.fi->state == VGCS_CHAN_ST_WAIT_EST) { + LOG_CALL(conn, LOGL_DEBUG, "There is a channel, not yet active. No SI10 update now.\n"); + return; + } + } + + LOG_CALL(conn, LOGL_DEBUG, "New channel(s) added, updating SI10 for all channels.\n"); + + /* Go through all channels. */ + llist_for_each_entry(c, &conn->vgcs_call.chan_list, vgcs_chan.list) { + /* Skip all channels that failed to activate or have not been aktivated yet. + * There shouldn't be any channel in that state now. */ + if (!c->lchan) + continue; + /* Encode SI 10 for this channel. Skip, if it fails. */ + rc = gsm_generate_si10((struct gsm48_system_information_type_10 *)si10, sizeof(si10), c); + if (rc < 0) + continue; + /* Add SI 10 to SACCH of this channel c. */ + rsl_sacch_info_modify(c->lchan, RSL_SYSTEM_INFO_10, si10, sizeof(si10)); + } +} + static void vgcs_call_detach_and_destroy(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) { struct gsm_subscriber_connection *conn = fi->priv, *c; @@ -284,8 +317,10 @@ break; case VGCS_EV_MSC_DTAP: LOG_CALL(conn, LOGL_DEBUG, "MSC sends DTAP message to talker.\n"); - if (!conn->vgcs_call.talker) + if (!conn->vgcs_call.talker) { msgb_free(data); + break; + } rc = osmo_fsm_inst_dispatch(conn->vgcs_call.talker->vgcs_chan.fi, VGCS_EV_MSC_DTAP, data); if (rc < 0) msgb_free(data); @@ -667,6 +702,9 @@ LOG_CHAN(conn, LOGL_DEBUG, "lchan failed.\n"); /* BTS reports failure on channel request. */ osmo_fsm_inst_state_chg(fi, VGCS_CHAN_ST_NULL, 0, 0); + /* Add/update SI10. */ + if (conn->vgcs_chan.call) + si10_update(conn->vgcs_chan.call); /* Report failure to MSC. */ bsc_tx_vgcs_vbs_assignment_fail(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE); break; @@ -691,9 +729,12 @@ osmo_fsm_inst_state_chg(fi, VGCS_CHAN_ST_ACTIVE_FREE, 0, 0); else osmo_fsm_inst_state_chg(fi, VGCS_CHAN_ST_ACTIVE_BLOCKED, 0, 0); - /* Add call to notification channel. */ - if (conn->vgcs_chan.call) + if (conn->vgcs_chan.call) { + /* Add call to notification channel. */ rsl_notification_cmd(conn->lchan->ts->trx->bts, conn->lchan, &conn->vgcs_chan.gc_ie, NULL); + /* Add/update SI10. */ + si10_update(conn->vgcs_chan.call); + } /* Report result to MSC. */ bsc_tx_vgcs_vbs_assignment_result(conn, &conn->vgcs_chan.ct, &conn->vgcs_chan.ci, conn->vgcs_chan.call_id); @@ -702,6 +743,9 @@ LOG_CHAN(conn, LOGL_DEBUG, "MGW endpoint failed.\n"); /* MGW reports failure. */ osmo_fsm_inst_state_chg(fi, VGCS_CHAN_ST_NULL, 0, 0); + /* Add/update SI10. */ + if (conn->vgcs_chan.call) + si10_update(conn->vgcs_chan.call); /* Report failure to MSC. */ bsc_tx_vgcs_vbs_assignment_fail(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE); break; @@ -753,6 +797,8 @@ /* Report talker detection to call state machine. */ if (conn->vgcs_chan.call) osmo_fsm_inst_dispatch(conn->vgcs_chan.call->vgcs_call.fi, VGCS_EV_CALLING_ASSIGNED, conn); + /* Repeat notification for the MS that has been assigned. */ + rsl_notification_cmd(conn->lchan->ts->trx->bts, conn->lchan, &conn->vgcs_chan.gc_ie, NULL); break; case VGCS_EV_CLEANUP: LOG_CHAN(conn, LOGL_DEBUG, "SCCP connection clearing.\n");
View file
osmo-bsc_1.11.1.tar.xz/tests/bts_features.vty -> osmo-bsc_1.12.0.tar.xz/tests/bts_features.vty
Changed
@@ -25,3 +25,34 @@ OsmoBSC(config-net-bts-trx-ts)# exit OsmoBSC(config-net-bts-trx)# exit OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# exit +OsmoBSC(config)# exit + +OsmoBSC# ### test ncc-permitted +OsmoBSC# show running-config +... !ncc-permitted +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# ncc-permitted 3 2 +% NCCs must be listed in order +OsmoBSC(config-net-bts)# ncc-permitted 2 2 +% NCCs must be unique +OsmoBSC(config-net-bts)# ncc-permitted 2 3 4 5 6 7 8 +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# exit +OsmoBSC(config)# exit +OsmoBSC# show running-config +... + ncc-permitted 2 3 4 5 6 7 8 +... +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# ncc-permitted all +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# exit +OsmoBSC(config)# exit +OsmoBSC# show running-config +... !ncc-permitted
View file
osmo-bsc_1.12.0.tar.xz/tests/early_ia.vty
Added
@@ -0,0 +1,24 @@ +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# bts 0 + +OsmoBSC(config-net-bts)# ### Check that first setting early-IA and then enabling frequency hopping throws an error +OsmoBSC(config-net-bts)# immediate-assignment pre-chan-ack +OsmoBSC(config-net-bts)# trx 0 +OsmoBSC(config-net-bts-trx)# timeslot 2 +OsmoBSC(config-net-bts-trx-ts)# hopping enabled 1 +% ERROR: 'hopping enabled 1' works only with 'immediate-assignment post-chan-ack' +OsmoBSC(config-net-bts-trx-ts)# hopping enabled 0 +OsmoBSC(config-net-bts-trx-ts)# exit +OsmoBSC(config-net-bts-trx)# exit +OsmoBSC(config-net-bts)# immediate-assignment post-chan-ack + +OsmoBSC(config-net-bts)# ### Check that first enabling frequency hopping and then setting early-IA throws an error +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)# immediate-assignment pre-chan-ack +% ERROR: 'hopping enabled 1' works only with 'immediate-assignment post-chan-ack', see timeslot 0-0-2-NONE
View file
osmo-bsc_1.11.1.tar.xz/tests/gprs_params.vty -> osmo-bsc_1.12.0.tar.xz/tests/gprs_params.vty
Changed
@@ -41,10 +41,8 @@ gprs ns timer tns-test 30 gprs ns timer tns-alive 3 gprs ns timer tns-alive-retries 10 - gprs nsvc 0 nsvci 0 - gprs nsvc 0 local udp port 0 - gprs nsvc 1 nsvci 0 - gprs nsvc 1 local udp port 0 + no gprs nsvc 0 + no gprs nsvc 1 ... @@ -104,13 +102,12 @@ ... OsmoBSC(config-net-bts)# ### Disable secondary NSVC -OsmoBSC(config-net-bts)# gprs nsvc 1 remote udp port 0 +OsmoBSC(config-net-bts)# no gprs nsvc 1 OsmoBSC(config-net-bts)# show running-config ... bts 0 ... gprs nsvc 0 nsvci 4242 gprs nsvc 0 local udp port 0 - gprs nsvc 1 nsvci 2424 - gprs nsvc 1 local udp port 23023 + no gprs nsvc 1 ...
View file
osmo-bsc_1.11.1.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.c -> osmo-bsc_1.12.0.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.c
Changed
@@ -73,6 +73,8 @@ printf("Testing nanobts_gen_set_cell_attr()...\n"); + bts->gprs.cell.mo.ipaccess.obj_version = 30; + 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)); @@ -211,7 +213,7 @@ 0x02, 0x00, 0x02, 0xa3, 0x00, 0x09, 0x14, 0x05, 0x05, 0xa0, 0x05, 0x0a, 0x04, 0x08, 0x0f, 0xa8, 0x00, 0x02, 0x0f, 0x00, 0xa9, 0x00, 0x05, 0x00, - 0xfa, 0x00, 0xfa, 0x02 + 0xfa, 0x00, 0xfa, 0x02, 0xac, 0x00, 0x01, 0x06, }; /* Parameters needed to test nanobts_gen_set_nsvc_attr() */
View file
osmo-bsc_1.11.1.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.ok -> osmo-bsc_1.12.0.tar.xz/tests/nanobts_omlattr/nanobts_omlattr_test.ok
Changed
@@ -9,8 +9,8 @@ ok. Testing nanobts_gen_set_cell_attr()... -result= 9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 -expected=9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 +result= 9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02ac000106 +expected=9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02ac000106 ok. Testing nanobts_gen_set_nsvc_attr()...
View file
osmo-bsc_1.11.1.tar.xz/tests/timer.vty -> osmo-bsc_1.12.0.tar.xz/tests/timer.vty
Changed
@@ -34,6 +34,7 @@ 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: X28 = 30 s Interval at which to try to recover a BORKEN lchan (default: 30 s) net: X3105 = 17 Ny1: Maximum number of Physical Information (re)transmissions (default: 17) net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s) net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages in the paging queue surpasses this threshold, then new incoming paging requests will if possible replace a request in retransmission state from the queue or otherwise be discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s) @@ -90,6 +91,7 @@ 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: X28 = 30 s Interval at which to try to recover a BORKEN lchan (default: 30 s) net: X3105 = 17 Ny1: Maximum number of Physical Information (re)transmissions (default: 17) net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s) net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages in the paging queue surpasses this threshold, then new incoming paging requests will if possible replace a request in retransmission state from the queue or otherwise be discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s)
View file
rpmlintrc
Deleted
@@ -1,5 +0,0 @@ -# Don't abort the build when finding a library that depends on a package with -# a specific version. This is intentional for nightly builds, we don't want -# libraries from different build dates to be mixed as they might have ABI -# incompatibilities. -setBadness('shlib-fixed-dependency', 0)
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
.