Compare commits

..

2 Commits

Author SHA1 Message Date
Harald Welte
30afa983e1 Bump version: 1.2.0.1-2bb3 → 1.2.1
Tag patch release with gcc-10 compilation fixes

Change-Id: I37eb6c31b2463f43ed79a64d1f5cf7eb3b1bafb8
2020-07-26 11:52:24 +02:00
Harald Welte
2bb3d23f87 fix compilation with gcc-10
/usr/bin/ld: /home/laforge/projects/git/osmo-bts/tests/sysmobts/../../src/osmo-bts-sysmo/tch.c:584: undefined reference to `femtobts_tch_pl_names'
/usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: multiple definition of `pdch_msu_size'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: first defined here
/usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: multiple definition of `femtobts_l1prim_type'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: first defined here

see also: https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000651.html

Change-Id: I4a9896153876fcda496365776883827746205f00
2020-07-26 11:48:22 +02:00
350 changed files with 13450 additions and 40926 deletions

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
open_collective: osmocom

24
.gitignore vendored
View File

@@ -35,10 +35,10 @@ src/osmo-bts-sysmo/osmo-bts-sysmo-remote
src/osmo-bts-sysmo/sysmobts-mgr src/osmo-bts-sysmo/sysmobts-mgr
src/osmo-bts-sysmo/sysmobts-util src/osmo-bts-sysmo/sysmobts-util
src/osmo-bts-lc15/lc15bts-mgr src/osmo-bts-litecell15/lc15bts-mgr
src/osmo-bts-lc15/lc15bts-util src/osmo-bts-litecell15/lc15bts-util
src/osmo-bts-lc15/misc/.dirstamp src/osmo-bts-litecell15/misc/.dirstamp
src/osmo-bts-lc15/osmo-bts-lc15 src/osmo-bts-litecell15/osmo-bts-lc15
src/osmo-bts-trx/osmo-bts-trx src/osmo-bts-trx/osmo-bts-trx
@@ -54,8 +54,6 @@ src/osmo-bts-oc2g/misc/.dirstamp
tests/atconfig tests/atconfig
tests/package.m4 tests/package.m4
tests/amr/amr_test
tests/csd/csd_test
tests/agch/agch_test tests/agch/agch_test
tests/paging/paging_test tests/paging/paging_test
tests/cipher/cipher_test tests/cipher/cipher_test
@@ -64,9 +62,6 @@ tests/meas/meas_test
tests/misc/misc_test tests/misc/misc_test
tests/handover/handover_test tests/handover/handover_test
tests/tx_power/tx_power_test tests/tx_power/tx_power_test
tests/ta_control/ta_control_test
tests/power/ms_power_loop_test
tests/power/bs_power_loop_test
tests/testsuite tests/testsuite
tests/testsuite.log tests/testsuite.log
@@ -89,24 +84,15 @@ debian/*.substvars
debian/osmo-bts-trx-dbg/ debian/osmo-bts-trx-dbg/
debian/osmo-bts-trx/ debian/osmo-bts-trx/
debian/tmp/ debian/tmp/
/tests/power/power_test
# manuals # manuals
doc/manuals/*.html doc/manuals/*.html
doc/manuals/*.svg doc/manuals/*.svg
doc/manuals/*.pdf doc/manuals/*.pdf
doc/manuals/vty/*.pdf
doc/manuals/*__*.png doc/manuals/*__*.png
doc/manuals/*.check doc/manuals/*.check
doc/manuals/generated/ doc/manuals/generated/
doc/manuals/vty/osmobts-*-vty-reference.xml
doc/manuals/vty/osmobts-*-vty-reference.xml.inc.gen
doc/manuals/vty/osmobts-*-vty-reference.xml.inc.merged
doc/manuals/osmomsc-usermanual.xml doc/manuals/osmomsc-usermanual.xml
doc/manuals/common doc/manuals/common
doc/manuals/build doc/manuals/build
contrib/osmo-bts.spec
contrib/ber/rtp_ber
contrib/ber/rtp_gen_map
arm-poky-linux-gnueabi-libtool

View File

@@ -5,12 +5,9 @@ SUBDIRS = include src tests doc contrib
# package the contrib and doc # package the contrib and doc
EXTRA_DIST = \ EXTRA_DIST = \
.version \
README.md \
contrib/dump_docs.py \ contrib/dump_docs.py \
debian \ git-version-gen .version \
git-version-gen \ README.md
$(NULL)
AM_DISTCHECK_CONFIGURE_FLAGS = \ AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)

View File

@@ -20,50 +20,34 @@ Several kinds of BTS hardware are supported:
* sysmocom sysmoBTS * sysmocom sysmoBTS
* Octasic octphy * Octasic octphy
* Nutaq litecell 1.5 * Nutaq litecell 1.5
* OpenCellular 2G (OC-2G)
* software-defined radio based osmo-bts-trx (e.g. USRP B210, UmTRX, LimeSDR) * software-defined radio based osmo-bts-trx (e.g. USRP B210, UmTRX, LimeSDR)
Homepage Homepage
-------- --------
The official homepage of the project is The official homepage of the project is
<https://osmocom.org/projects/osmobts/wiki> https://osmocom.org/projects/osmobts/wiki
GIT Repository GIT Repository
-------------- --------------
You can clone from the official osmo-bts.git repository using You can clone from the official osmo-bts.git repository using
git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-bts git clone git://git.osmocom.org/osmo-bts.git
There is a web interface at <https://gitea.osmocom.org/cellular-infrastructure/osmo-bts> There is a cgit interface at http://git.osmocom.org/osmo-bts/
Documentation Documentation
------------- -------------
User Manuals and VTY reference manuals are [optionally] built in PDF form We provide a
as part of the build process. [User Manual](http://ftp.osmocom.org/docs/latest/osmobts-usermanual.pdf)
as well as a
Pre-rendered PDF version of the current "master" can be found at [VTY Reference Manual](http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf)
[User Manual](https://ftp.osmocom.org/docs/latest/osmobts-usermanual.pdf) and a
as well as the VTY reference manuals [Abis reference MAnual](http://ftp.osmocom.org/docs/latest/osmobts-abis.pdf)
* [VTY Reference Manual for osmo-bts-sysmo](https://ftp.osmocom.org/docs/latest/osmobts-sysmo-vty-reference.pdf)
* [VTY Reference Manual for osmo-bts-trx](https://ftp.osmocom.org/docs/latest/osmobts-trx-vty-reference.pdf)
* [VTY Reference Manual for osmo-bts-lc15](https://ftp.osmocom.org/docs/latest/osmobts-lc15-vty-reference.pdf)
* [VTY Reference Manual for osmo-bts-oc2g](https://ftp.osmocom.org/docs/latest/osmobts-oc2g-vty-reference.pdf)
* [VTY Reference Manual for osmo-bts-octphy](https://ftp.osmocom.org/docs/latest/osmobts-octphy-vty-reference.pdf)
There also is an
[Abis reference Manual](https://ftp.osmocom.org/docs/latest/osmobts-abis.pdf)
describing the OsmoBTS specific A-bis dialect. describing the OsmoBTS specific A-bis dialect.
Forum
-----
We welcome any osmo-bts related discussions in the
[Cellular Network Infrastructure -> 2G RAN (GERAN)](https://discourse.osmocom.org/c/cni/geran)
section of the osmocom discourse (web based Forum).
Mailing List Mailing List
------------ ------------
@@ -76,20 +60,13 @@ Please observe the [Osmocom Mailing List
Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules) Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules)
when posting. when posting.
Issue Tracker
-------------
We use the [issue tracker of the osmo-bts project on osmocom.org](https://osmocom.org/projects/osmobts/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 Contributing
------------ ------------
Our coding standards are described at Our coding standards are described at
https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
We use a Gerrit based patch submission/review process for managing We us a gerrit based patch submission/review process for managing
contributions. Please see contributions. Please see
https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for
more details more details
@@ -100,7 +77,7 @@ https://gerrit.osmocom.org/#/q/project:osmo-bts+status:open
Known Limitations Known Limitations
================= =================
As of January 2021, the following known limitations exist in this As of March 17, 2017, the following known limitations exist in this
implementation: implementation:
Common Core Common Core
@@ -110,6 +87,10 @@ Common Core
* System Information limited to 1,2,2bis,2ter,2quater,3,4,5,6,9,13 * System Information limited to 1,2,2bis,2ter,2quater,3,4,5,6,9,13
* No RATSCCH in AMR * No RATSCCH in AMR
* Will reject TS 12.21 STARTING TIME in SET BTS ATTR / SET CHAN ATTR * Will reject TS 12.21 STARTING TIME in SET BTS ATTR / SET CHAN ATTR
* No support for frequency hopping
* No reporting of interference levels as part of TS 08.58 RF RES IND
* No error reporting in case PAGING COMMAND fails due to queue overflow
* No use of TS 08.58 BS Power and MS Power parameters
* No support of TS 08.58 MultiRate Control * No support of TS 08.58 MultiRate Control
* No support of TS 08.58 Supported Codec Types * No support of TS 08.58 Supported Codec Types
* No support of Bter frame / ENHANCED MEASUREMENT REPORT * No support of Bter frame / ENHANCED MEASUREMENT REPORT

View File

@@ -1,9 +0,0 @@
# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install
# 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: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

View File

@@ -9,8 +9,6 @@ AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([dist-bzip2]) AM_INIT_AUTOMAKE([dist-bzip2])
AC_CONFIG_TESTDIR(tests) AC_CONFIG_TESTDIR(tests)
CFLAGS="$CFLAGS -std=gnu11"
dnl kernel style compile messages dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@@ -24,11 +22,6 @@ AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
LT_INIT LT_INIT
dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang
AS_CASE(["$LD"],[*clang*],
[AS_CASE(["${host_os}"],
[*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
dnl check for pkg-config (explained in detail in libosmocore/configure.ac) dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
if test "x$PKG_CONFIG_INSTALLED" = "xno"; then if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
@@ -69,15 +62,14 @@ then
fi fi
dnl checks for libraries dnl checks for libraries
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.11.0) PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.11.0) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.11.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.11.0) PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.11.0) PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 1.11.0) PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 2.0.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.6.0)
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 2.0.0) PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.6.0)
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.6.0)
AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
AC_ARG_ENABLE(sysmobts-calib, AC_ARG_ENABLE(sysmobts-calib,
@@ -350,56 +342,6 @@ then
AC_SUBST([OSMO_GSM_MANUALS_DIR]) AC_SUBST([OSMO_GSM_MANUALS_DIR])
fi fi
AC_ARG_ENABLE([external_tests],
AC_HELP_STRING([--enable-external-tests],
[Include the VTY/CTRL tests in make check [default=no]]),
[enable_ext_tests="$enableval"],[enable_ext_tests="no"])
if test "x$enable_ext_tests" = "xyes" ; then
AC_CHECK_PROG(PYTHON3_AVAIL,python3,yes)
if test "x$PYTHON3_AVAIL" != "xyes" ; then
AC_MSG_ERROR([Please install python3 to run the VTY/CTRL tests.])
fi
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
AC_MSG_ERROR([Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.])
fi
fi
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
AC_MSG_RESULT([$enable_ext_tests])
AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
#
# SystemTap support
#
AC_MSG_CHECKING([whether to include systemtap tracing support])
AC_ARG_ENABLE([systemtap],
[AS_HELP_STRING([--enable-systemtap],
[Enable inclusion of systemtap trace support])],
[ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no'])
AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes])
AC_MSG_RESULT(${ENABLE_SYSTEMTAP})
if test "x${ENABLE_SYSTEMTAP}" = xyes; then
# Additional configuration for --enable-systemtap is HERE
AC_CHECK_PROGS(DTRACE, dtrace)
if test -z "$DTRACE"; then
AC_MSG_ERROR([dtrace not found])
fi
AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'],
[SDT_H_FOUND='no';
AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using SystemTap probes.])
AC_ARG_WITH([tapset-install-dir],
[AS_HELP_STRING([--with-tapset-install-dir],
[The absolute path where the tapset dir will be installed])],
[if test "x${withval}" = x; then
ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"
else
ABS_TAPSET_DIR="${withval}"
fi], [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"])
AC_SUBST(ABS_TAPSET_DIR)
fi
# https://www.freedesktop.org/software/systemd/man/daemon.html # https://www.freedesktop.org/software/systemd/man/daemon.html
AC_ARG_WITH([systemdsystemunitdir], AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
@@ -427,7 +369,7 @@ AC_OUTPUT(
src/osmo-bts-virtual/Makefile src/osmo-bts-virtual/Makefile
src/osmo-bts-omldummy/Makefile src/osmo-bts-omldummy/Makefile
src/osmo-bts-sysmo/Makefile src/osmo-bts-sysmo/Makefile
src/osmo-bts-lc15/Makefile src/osmo-bts-litecell15/Makefile
src/osmo-bts-oc2g/Makefile src/osmo-bts-oc2g/Makefile
src/osmo-bts-trx/Makefile src/osmo-bts-trx/Makefile
src/osmo-bts-octphy/Makefile src/osmo-bts-octphy/Makefile
@@ -440,16 +382,12 @@ AC_OUTPUT(
tests/sysmobts/Makefile tests/sysmobts/Makefile
tests/misc/Makefile tests/misc/Makefile
tests/handover/Makefile tests/handover/Makefile
tests/ta_control/Makefile
tests/tx_power/Makefile tests/tx_power/Makefile
tests/power/Makefile tests/power/Makefile
tests/meas/Makefile tests/meas/Makefile
tests/amr/Makefile
tests/csd/Makefile
doc/Makefile doc/Makefile
doc/examples/Makefile doc/examples/Makefile
doc/manuals/Makefile doc/manuals/Makefile
contrib/Makefile contrib/Makefile
contrib/ber/Makefile
contrib/systemd/Makefile contrib/systemd/Makefile
Makefile) Makefile)

View File

@@ -1 +1 @@
SUBDIRS = systemd ber SUBDIRS = systemd

View File

@@ -1,28 +0,0 @@
AM_CPPFLAGS = \
$(all_includes) \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
-I$(builddir) \
$(NULL)
AM_CFLAGS = \
-Wall \
$(LIBOSMOCORE_CFLAGS) \
$(LIBOSMOTRAU_CFLAGS) \
$(LIBOSMOCODEC_CFLAGS) \
$(NULL)
LDADD = \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOTRAU_LIBS) \
$(LIBOSMOCODEC_LIBS) \
$(NULL)
noinst_PROGRAMS = rtp_ber rtp_gen_map
rtp_ber_SOURCES = rtp_ber.c codec_bit_class.h
rtp_gen_map_SOURCES = rtp_gen_map.c
update_codec_bit_class_h: rtp_gen_map
$(AM_V_GEN)./$< > $(top_srcdir)/contrib/ber/codec_bit_class.h

View File

@@ -1,26 +0,0 @@
BER testing tool
----------------
* Check all configs (MSC/BSC/BTS) for proper codec support
- FR enabled
- EFR enabled
- AMR 12.2 enabled (and all other modes disabled !)
- Use `amr-payload octet-aligned` in BSC config
* Check BTS config
- Disable jitter buffer : `bts N / rtp jitter-buffer 0`
* Check BSC config
- Disable radio timeout : `network / bts n / radio-link-timeout infinite`
* Start BER testing tool
- `./rtp_ber 4000`
* On the MSC CLI, start a silent-call, then request GSM to test loop
- `subscriber imsi <XXX> silent-call start tch/f speech-amr`
- `subscriber imsi <XXX> ms-test close-loop b`
Don't forget to terminate the loop and terminate the silent call !
- `subscriber imsi <XXX> ms-test open-loop`
- `subscriber imsi <XXX> silent-call stop`

View File

@@ -1,59 +0,0 @@
static const int gsm_fr_bitclass[] = {
-1, -1, -1, -1, 0, 0, 0, 0, 1, 2, 0, 0, 0, 1, 2, 2,
0, 0, 1, 2, 2, 0, 0, 1, 2, 2, 0, 1, 1, 2, 0, 1,
2, 2, 0, 1, 2, 1, 2, 2, 0, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1,
1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1,
2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2,
1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1,
1, 2, 1, 1, 2, 1, 1, 2, 0, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1,
1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1,
2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2,
1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1,
2, 2, 1, 2, 2, 1, 2, 2,
};
static const int gsm_efr_bitclass[] = {
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0,
1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
1, 1, 1, 1, 2, 2, 1, 2,
};
static const int gsm_amr_12_2_bitclass[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, -1, -1, -1, -1,
};

View File

@@ -1,483 +0,0 @@
/* RTP based GSM BER testing for osmo-bts, implementing ideas described in
* https://osmocom.org/projects/osmobts/wiki/BER_Testing
*
* In short: The command transmits a PRBS sequence encapsulated in RTP frames, which are sent
* to the BTS, which transmits that data in the (unimpaired) downlink. The mobile station
* receives the data and is instructed to loop it back in the (possibly impaired) uplink.
* The BTS receives that uplink, puts in in RTP frames which end up being received back by this
* very tool. By correlating the received RTP with the PRBS sequence, this tool can compute
* the BER (Bit Error Rate) of the (possibly impaired) uplink. Doing this with different
* RF channel model simulators in the uplink allows to establish BER at different levels and
* channel conditions. */
/* (C) 2019 sysmocom - s.f.m.c. GmbH; Author: Sylvain Munaut
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocom/codec/codec.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/prbs.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/utils.h>
#include <osmocom/trau/osmo_ortp.h>
#include <codec_bit_class.h>
struct app_state {
struct osmo_rtp_socket *rs;
enum {
WAIT_CONN = 0, /* Wait for incoming connection */
WAIT_LOOP, /* Wait for a somewhat valid packet to start measuring */
RUNNING, /* Main state */
} state;
int pt;
int ref_len;
uint8_t ref_bytes[GSM_FR_BYTES]; /* FR is the largest possible one */
ubit_t ref_bits[8*GSM_FR_BYTES];
struct osmo_timer_list rtp_timer;
uint16_t rx_last_seq;
uint32_t rx_last_ts;
uint32_t rx_idx;
uint32_t tx_idx;
const int *err_tbl; /* Classification table */
int err_frames; /* Number of accumulated frames */
int err_cnt[3]; /* Bit error counter */
int err_tot[3]; /* Total # bits in that class */
};
#define FLOW_REG_TX_MAX_ADVANCE 200
#define FLOW_REG_TX_MIN_ADVANCE 50
const struct log_info log_info;
static const uint8_t amr_size_by_ft[] = {
[0] = 12, /* 4.75 */
[1] = 13, /* 5.15 */
[2] = 15, /* 5.9 */
[3] = 17, /* 6.7 */
[4] = 19, /* 7.4 */
[5] = 20, /* 7.95 */
[6] = 26, /* 10.2 */
[7] = 31, /* 12.2 */
[8] = 5, /* SID */
};
static const char * const amr_rate_by_ft[] = {
[0] = "4.75",
[1] = "5.15",
[2] = "5.9",
[3] = "6.7",
[4] = "7.4",
[5] = "7.95",
[6] = "10.2",
[7] = "12.2",
[8] = "SID",
};
static void
_gsm_fr_gen_ref(struct app_state *as)
{
struct osmo_prbs_state pn9;
/* Length */
as->ref_len = GSM_FR_BYTES;
/* Marker */
as->ref_bits[0] = 1;
as->ref_bits[1] = 1;
as->ref_bits[2] = 0;
as->ref_bits[3] = 1;
/* PN */
osmo_prbs_state_init(&pn9, &osmo_prbs9);
pn9.state = 31;
osmo_prbs_get_ubits(&as->ref_bits[4], 260, &pn9);
/* Convert to bytes */
osmo_ubit2pbit_ext(as->ref_bytes, 0, as->ref_bits, 0, 8*GSM_FR_BYTES, 0);
/* Init error classes */
as->err_tot[0] = 50;
as->err_tot[1] = 132;
as->err_tot[2] = 78;
as->err_tbl = gsm_fr_bitclass;
}
static void
_gsm_efr_gen_ref(struct app_state *as)
{
struct osmo_prbs_state pn9;
/* Length */
as->ref_len = GSM_EFR_BYTES;
/* Marker */
as->ref_bits[0] = 1;
as->ref_bits[1] = 1;
as->ref_bits[2] = 0;
as->ref_bits[3] = 0;
/* PN */
osmo_prbs_state_init(&pn9, &osmo_prbs9);
pn9.state = 31;
osmo_prbs_get_ubits(&as->ref_bits[4], 244, &pn9);
/* Convert to bytes */
osmo_ubit2pbit_ext(as->ref_bytes, 0, as->ref_bits, 0, 8*GSM_EFR_BYTES, 0);
/* Init error classes */
as->err_tot[0] = 50;
as->err_tot[1] = 125;
as->err_tot[2] = 73;
as->err_tbl = gsm_efr_bitclass;
}
static void
_gsm_amr_gen_ref(struct app_state *as)
{
struct osmo_prbs_state pn9;
uint8_t hdr[2];
/* Length */
as->ref_len = 33;
/* Header */
hdr[0] = 0x70;
hdr[1] = 0x3c;
osmo_pbit2ubit_ext(as->ref_bits, 0, hdr, 0, 16, 0);
/* PN */
osmo_prbs_state_init(&pn9, &osmo_prbs9);
pn9.state = 31;
osmo_prbs_get_ubits(&as->ref_bits[16], 244, &pn9);
/* Unused bits */
as->ref_bits[260] = 0;
as->ref_bits[261] = 0;
as->ref_bits[262] = 0;
as->ref_bits[263] = 0;
/* Convert to bytes */
osmo_ubit2pbit_ext(as->ref_bytes, 0, as->ref_bits, 0, 264, 0);
/* Init error classes */
as->err_tot[0] = 81;
as->err_tot[1] = 163;
as->err_tot[2] = -1;
as->err_tbl = gsm_amr_12_2_bitclass;
}
static void
_gsm_gen_ref(struct app_state *as)
{
switch (as->pt) {
case RTP_PT_GSM_FULL:
_gsm_fr_gen_ref(as);
break;
case RTP_PT_GSM_EFR:
_gsm_efr_gen_ref(as);
break;
case RTP_PT_AMR:
_gsm_amr_gen_ref(as);
break;
default:
fprintf(stderr, "[!] Unsupported payload type for BER measurement\n");
}
}
static int
_gsm_ber(struct app_state *as, const uint8_t *payload, unsigned int payload_len)
{
ubit_t rx_bits[8*33];
int err[3]; /* Class 1a, 1b, 2 */
int ones;
int i, j;
if (payload) {
/* Process real-payload */
osmo_pbit2ubit_ext(rx_bits, 0, payload, 0, 8*payload_len, 0);
err[0] = err[1] = err[2] = 0;
ones = 0;
for (i = 0; i < 8 * payload_len; i++) {
j = as->err_tbl[i];
if (j >= 0) {
err[j] += rx_bits[i] ^ as->ref_bits[i];
ones += rx_bits[i];
}
}
if (ones < 32) { // This frames is probably us underrunning Tx, don't use it
fprintf(stderr, "[w] Frame ignored as probably TX underrun %d %d\n", as->tx_idx, as->rx_idx);
return 1;
}
} else {
/* No payload -> Lost frame completely */
err[0] = as->err_tot[0] / 2;
err[1] = as->err_tot[1] / 2;
err[2] = as->err_tot[2] / 2;
}
if (as->state == RUNNING) {
/* Update records */
if (err[0] != 0) {
/* Class 1a bits bad -> Frame error */
as->err_cnt[0]++;
}
as->err_cnt[1] += err[1]; /* Class 1b */
as->err_cnt[2] += err[2]; /* class 2 */
as->err_frames++;
/* Enough for a read-out ? */
if (as->err_frames == 200) {
printf("FBER: %4.2f C1b RBER: %5.3f C2 RBER: %5.3f\n",
100.0f * as->err_cnt[0] / as->err_frames,
100.0f * as->err_cnt[1] / (as->err_tot[1] * as->err_frames),
100.0f * as->err_cnt[2] / (as->err_tot[2] * as->err_frames)
);
memset(as->err_cnt, 0, sizeof(as->err_cnt));
as->err_frames = 0;
}
}
return err[0] != 0;
}
static int
_rtp_check_payload_type(const uint8_t *payload, unsigned int payload_len)
{
uint8_t ft;
int pt = -1;
switch (payload_len) {
case GSM_FR_BYTES: /* FR or AMR 12.2k */
/* Check for AMR */
ft = (payload[1] >> 3) & 0xf;
if (ft == 7)
pt = RTP_PT_AMR;
/* Check for FR */
else if ((payload[0] & 0xF0) == 0xD0)
pt = RTP_PT_GSM_FULL;
/* None of the above */
else
fprintf(stderr, "[!] FR without 0xD0 signature or AMR with unknwon Frame Type ?!?\n");
break;
case GSM_EFR_BYTES: /* EFR */
if ((payload[0] & 0xF0) != 0xC0)
fprintf(stderr, "[!] EFR without 0xC0 signature ?!?\n");
pt = RTP_PT_GSM_EFR;
break;
case GSM_HR_BYTES: /* HR */
pt = RTP_PT_GSM_HALF;
break;
default: /* AMR */
{
uint8_t cmr, cmi, sti;
cmr = payload[0] >> 4;
ft = (payload[1] >> 3) & 0xf;
if (payload_len != amr_size_by_ft[ft]+2)
fprintf(stderr, "AMR FT %u(%s) but size %u\n",
ft, amr_rate_by_ft[ft], payload_len);
switch (ft) {
case 0: case 1: case 2: case 3:
case 4: case 5: case 6: case 7:
cmi = ft;
printf("AMR SPEECH with FT/CMI %u(%s), "
"CMR %u\n",
cmi, amr_rate_by_ft[cmi],
cmr);
break;
case 8: /* SID */
cmi = (payload[2+4] >> 1) & 0x7;
sti = payload[2+4] & 0x10;
printf("AMR SID %s with CMI %u(%s), CMR %u(%s)\n",
sti ? "UPDATE" : "FIRST",
cmi, amr_rate_by_ft[cmi],
cmr, amr_rate_by_ft[cmr]);
break;
}
}
break;
}
return pt;
}
static void
rtp_timer_cb(void *priv)
{
struct app_state *as = (struct app_state *)priv;
/* Send at least one frame if we're not too far ahead */
if (as->tx_idx < (as->rx_idx + FLOW_REG_TX_MAX_ADVANCE)) {
osmo_rtp_send_frame(as->rs, as->ref_bytes, as->ref_len, GSM_RTP_DURATION);
as->tx_idx++;
} else {
fprintf(stderr, "Skipped\n");
}
/* Then maybe a second one to try and catch up to RX */
if (as->tx_idx < (as->rx_idx + FLOW_REG_TX_MIN_ADVANCE)) {
osmo_rtp_send_frame(as->rs, as->ref_bytes, as->ref_len, GSM_RTP_DURATION);
as->tx_idx++;
}
/* Re-schedule */
osmo_timer_schedule(&as->rtp_timer, 0, 20000);
}
static int
rtp_seq_num_diff(uint16_t new, uint16_t old)
{
int d = (int)new - (int)old;
while (d > 49152)
d -= 65536;
while (d < -49152)
d += 65536;
return d;
}
static void
rtp_rx_cb(struct osmo_rtp_socket *rs,
const uint8_t *payload, unsigned int payload_len,
uint16_t seq_number, uint32_t timestamp, bool marker)
{
struct app_state *as = (struct app_state *)rs->priv;
int pt, rc, d;
// printf("Rx(%u, %d, %d, %d): %s\n", payload_len, seq_number, timestamp, marker, osmo_hexdump(payload, payload_len));
/* Identify payload */
pt = _rtp_check_payload_type(payload, payload_len);
/* First packet ? */
if (as->state == WAIT_CONN) {
/* Setup for this payload type */
as->pt = pt;
osmo_rtp_socket_set_pt(as->rs, pt);
_gsm_gen_ref(as);
/* Timer every 20 ms */
osmo_timer_setup(&as->rtp_timer, rtp_timer_cb, as);
osmo_timer_add(&as->rtp_timer);
osmo_timer_schedule(&as->rtp_timer, 0, 20000);
/* Init our time tracking */
as->rx_last_seq = seq_number;
as->rx_last_ts = timestamp;
/* Now we wait for a loop */
as->state = WAIT_LOOP;
}
/* RX sequence & timstamp tracking */
if (rtp_seq_num_diff(seq_number, as->rx_last_seq) > 1)
fprintf(stderr, "[!] RTP sequence number discontinuity (%d -> %d)\n", as->rx_last_seq, seq_number);
d = (timestamp - as->rx_last_ts) / GSM_RTP_DURATION;
as->rx_idx += d;
as->rx_last_seq = seq_number;
as->rx_last_ts = timestamp;
/* Account for missing frames in BER tracking */
if (d > 1) {
fprintf(stderr, "[!] RTP %d missing frames assumed lost @%d\n", d-1, seq_number);
while (--d)
_gsm_ber(as, NULL, 0);
}
/* BER analysis */
rc = _gsm_ber(as, payload, payload_len);
if ((as->state == WAIT_LOOP) && (rc == 0))
as->state = RUNNING;
}
int main(int argc, char **argv)
{
struct app_state _as, *as = &_as;
int rc, port;
/* Args */
if (argc < 2)
return -1;
port = atoi(argv[1]);
/* App init */
memset(as, 0x00, sizeof(struct app_state));
log_init(&log_info, NULL);
osmo_rtp_init(NULL);
/* Start auto-connect RTP socket */
as->rs = osmo_rtp_socket_create(NULL, 0);
as->rs->priv = as;
as->rs->rx_cb = rtp_rx_cb;
/* Jitter buffer gets in the way, we want the raw traffic */
osmo_rtp_socket_set_param(as->rs, OSMO_RTP_P_JIT_ADAP, 0);
osmo_rtp_socket_set_param(as->rs, OSMO_RTP_P_JITBUF, 0);
/* Bind to requested port */
fprintf(stderr, "[+] Binding RTP socket on port %u...\n", port);
rc = osmo_rtp_socket_bind(as->rs, "0.0.0.0", port);
if (rc < 0) {
fprintf(stderr, "[!] error binding RTP socket: %d\n", rc);
return rc;
}
/* We 'connect' to the first source we hear from */
osmo_rtp_socket_autoconnect(as->rs);
/* Main loop */
while (1)
osmo_select_main(0);
return 0;
}

View File

@@ -1,145 +0,0 @@
/* utility to generate codec_bit_class.h, a file with structures
* describing which [protection] class each bit of a given codec frame belongs to */
/* (C) 2019 sysmocom - s.f.m.c. GmbH; Author: Sylvain Munaut
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <osmocom/codec/codec.h>
static int
gen_table_fr(int *tbl)
{
int i, j;
tbl[0] = tbl[1] = tbl[2] = tbl[3] = -1;
for (i = 0; i < 260; i++) {
j = 4 + gsm610_bitorder[i];
if (i < 50)
tbl[j] = 0; /* Class 1a */
else if (i < 182)
tbl[j] = 1; /* Class 1b */
else
tbl[j] = 2; /* Class 2 */
}
return GSM_FR_BYTES * 8;
}
static int
gen_table_efr(int *tbl)
{
int i, j, k;
tbl[0] = tbl[1] = tbl[2] = tbl[3] = -1;
for (i = 0; i < 260; i++) {
j = gsm660_bitorder[i];
if (j < 71)
k = j;
else if (j < 73)
k = 71;
else if (j < 123)
k = j - 2;
else if (j < 125)
k = 119;
else if (j < 178)
k = j - 4;
else if (j < 180)
k = 172;
else if (j < 230)
k = j - 6;
else if (j < 232)
k = 222;
else if (j < 252)
k = j - 8;
else
continue;
if (i < 50)
tbl[k] = 0; /* Class 1a */
else if (i < 182)
tbl[k] = 1; /* Class 1b */
else
tbl[k] = 2; /* Class 2 */
}
return GSM_EFR_BYTES * 8;
}
static int
gen_table_amr_12_2(int *tbl)
{
int i;
for (i = 0; i < 16; i++)
tbl[i] = -1;
for (i = 0; i < 244; i++)
tbl[i+16] = i < 81 ? 0 : 1;
for (i = 0; i < 4; i++)
tbl[i+16+244] = -1;
return 8 * 33;
}
static void
print_table(const char *name, int *tbl, int len)
{
int i;
printf("static const int %s[] = {\n", name);
for (i = 0; i < len; i++) {
if ((i & 15) == 0)
printf("\t");
printf("%2d", tbl[i]);
if (((i & 15) == 15) || (i == len-1))
printf(",\n");
else
printf(", ");
}
printf("};\n\n");
}
int main(int argc, char *argv[])
{
int tbl[33*8];
int rv;
rv = gen_table_fr(tbl);
print_table("gsm_fr_bitclass", tbl, rv);
rv = gen_table_efr(tbl);
print_table("gsm_efr_bitclass", tbl, rv);
rv = gen_table_amr_12_2(tbl);
print_table("gsm_amr_12_2_bitclass", tbl, rv);
return 0;
}

View File

@@ -8,8 +8,8 @@ export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib" export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-netif "" --disable-doxygen
osmo-build-dep.sh libosmo-abis "" --disable-dahdi osmo-build-dep.sh libosmo-abis
cd "$deps" cd "$deps"
@@ -17,7 +17,6 @@ configure_flags="\
--enable-sanitize \ --enable-sanitize \
--enable-werror \ --enable-werror \
--enable-trx \ --enable-trx \
--enable-external-tests \
" "
build_bts "osmo-bts-trx" "$configure_flags" build_bts "osmo-bts-trx" "$configure_flags"

View File

@@ -43,6 +43,7 @@ build_bts() {
conf_flags="$*" conf_flags="$*"
if [ "$WITH_MANUALS" = "1" ]; then if [ "$WITH_MANUALS" = "1" ]; then
conf_flags="$conf_flags --enable-manuals" conf_flags="$conf_flags --enable-manuals"
osmo-build-dep.sh osmo-gsm-manuals
export PATH="$inst/bin:$PATH" export PATH="$inst/bin:$PATH"
fi fi
@@ -50,12 +51,12 @@ build_bts() {
./configure $conf_flags ./configure $conf_flags
$MAKE $PARALLEL_MAKE $MAKE $PARALLEL_MAKE
$MAKE check || cat-testlogs.sh $MAKE check || cat-testlogs.sh
DISTCHECK_CONFIGURE_FLAGS="$conf_flags" $MAKE $PARALLEL_MAKE distcheck || cat-testlogs.sh DISTCHECK_CONFIGURE_FLAGS="$conf_flags" $MAKE distcheck || cat-testlogs.sh
# Manuals: publish # Manuals: publish
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
$MAKE -C "$base/doc/manuals" publish $MAKE -C "$base/doc/manuals" publish
fi fi
$MAKE $PARALLEL_MAKE maintainer-clean $MAKE maintainer-clean
} }

View File

@@ -4,12 +4,12 @@
# shellcheck source=contrib/jenkins_common.sh # shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib" export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen osmo-build-dep.sh libosmo-abis
osmo-build-dep.sh libosmo-netif "" --disable-doxygen
osmo-build-dep.sh libosmo-abis "" --disable-dahdi
cd "$deps" cd "$deps"
osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"

View File

@@ -4,12 +4,12 @@
# shellcheck source=contrib/jenkins_common.sh # shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib" export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen osmo-build-dep.sh libosmo-abis
osmo-build-dep.sh libosmo-netif "" --disable-doxygen
osmo-build-dep.sh libosmo-abis "" --disable-dahdi
cd "$deps" cd "$deps"
osmo-layer1-headers.sh oc2g "$FIRMWARE_VERSION" osmo-layer1-headers.sh oc2g "$FIRMWARE_VERSION"

View File

@@ -4,12 +4,12 @@
# shellcheck source=contrib/jenkins_common.sh # shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib" export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen osmo-build-dep.sh libosmo-abis
osmo-build-dep.sh libosmo-netif "" --disable-doxygen
osmo-build-dep.sh libosmo-abis "" --disable-dahdi
cd "$deps" cd "$deps"
osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION"

View File

@@ -8,8 +8,8 @@ export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib" export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-netif "" --disable-doxygen
osmo-build-dep.sh libosmo-abis "" --disable-dahdi osmo-build-dep.sh libosmo-abis
cd "$deps" cd "$deps"
@@ -20,7 +20,6 @@ configure_flags="\
--with-octsdr-2g=$deps/layer1-headers/ \ --with-octsdr-2g=$deps/layer1-headers/ \
--enable-octphy \ --enable-octphy \
--enable-trx \ --enable-trx \
--enable-external-tests \
" "
build_bts "osmo-bts-octphy+trx" "$configure_flags" build_bts "osmo-bts-octphy+trx" "$configure_flags"

View File

@@ -4,12 +4,12 @@
# shellcheck source=contrib/jenkins_common.sh # shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib" export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen osmo-build-dep.sh libosmo-abis
osmo-build-dep.sh libosmo-netif "" --disable-doxygen
osmo-build-dep.sh libosmo-abis "" --disable-dahdi
cd "$deps" cd "$deps"
osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION"
@@ -21,7 +21,6 @@ configure_flags="\
--enable-werror \ --enable-werror \
--enable-sysmocom-bts \ --enable-sysmocom-bts \
--with-sysmobts=$inst/include/ \ --with-sysmobts=$inst/include/ \
--enable-external-tests \
" "
# This will not work for the femtobts # This will not work for the femtobts

View File

@@ -2,15 +2,11 @@
Description=osmo-bts manager for LC15 / sysmoBTS 2100 Description=osmo-bts manager for LC15 / sysmoBTS 2100
After=lc15-sysdev-remap.service After=lc15-sysdev-remap.service
Wants=lc15-sysdev-remap.service Wants=lc15-sysdev-remap.service
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
NotifyAccess=all NotifyAccess=all
WatchdogSec=21780s WatchdogSec=21780s
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
Restart=always Restart=always
RestartSec=2 RestartSec=2

View File

@@ -2,15 +2,11 @@
Description=osmo-bts manager for OC-2G Description=osmo-bts manager for OC-2G
After=oc2g-sysdev-remap.service After=oc2g-sysdev-remap.service
Wants=oc2g-sysdev-remap.service Wants=oc2g-sysdev-remap.service
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
NotifyAccess=all NotifyAccess=all
WatchdogSec=21780s WatchdogSec=21780s
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
Restart=always Restart=always
RestartSec=2 RestartSec=2

View File

@@ -1,22 +1,17 @@
[Unit] [Unit]
Description=osmo-bts for LC15 / sysmoBTS 2100 Description=osmo-bts for LC15 / sysmoBTS 2100
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts-lc15.cfg -M ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts-lc15.cfg -M
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
RuntimeDirectory=osmo-bts RuntimeDirectory=osmo-bts
Restart=always Restart=always
RestartSec=2 RestartSec=2
RestartPreventExitStatus=1
# CPU scheduling policy: # The msg queues must be read fast enough
CPUSchedulingPolicy=rr CPUSchedulingPolicy=rr
# For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority): CPUSchedulingPriority=1
CPUSchedulingPriority=11
# See sched(7) for further details on real-time policies and priorities
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@@ -1,22 +1,17 @@
[Unit] [Unit]
Description=osmo-bts for OC-2G Description=osmo-bts for OC-2G
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts-oc2g.cfg -M ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts-oc2g.cfg -M
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
RuntimeDirectory=osmo-bts RuntimeDirectory=osmo-bts
Restart=always Restart=always
RestartSec=2 RestartSec=2
RestartPreventExitStatus=1
# CPU scheduling policy: # The msg queues must be read fast enough
CPUSchedulingPolicy=rr CPUSchedulingPolicy=rr
# For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority): CPUSchedulingPriority=1
CPUSchedulingPriority=11
# See sched(7) for further details on real-time policies and priorities
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@@ -1,7 +1,5 @@
[Unit] [Unit]
Description=osmo-bts for sysmocom sysmoBTS Description=osmo-bts for sysmocom sysmoBTS
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
@@ -9,16 +7,13 @@ ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts-sysmo.cfg -M ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts-sysmo.cfg -M
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s' ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s'
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
Restart=always Restart=always
RestartSec=2 RestartSec=2
RestartPreventExitStatus=1
# CPU scheduling policy: # The msg queues must be read fast enough
CPUSchedulingPolicy=rr CPUSchedulingPolicy=rr
# For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority): CPUSchedulingPriority=1
CPUSchedulingPriority=20
# See sched(7) for further details on real-time policies and priorities
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@@ -1,24 +1,15 @@
[Unit] [Unit]
Description=Osmocom osmo-bts for osmo-trx Description=Osmocom osmo-bts for osmo-trx
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/osmo-bts-trx -s -c /etc/osmocom/osmo-bts-trx.cfg ExecStart=/usr/bin/osmo-bts-trx -s -c /etc/osmocom/osmo-bts-trx.cfg
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
Restart=always Restart=always
RestartSec=2 RestartSec=2
User=osmocom
Group=osmocom
AmbientCapabilities=CAP_SYS_NICE
# CPU scheduling policy: # Let it process messages quickly enough
CPUSchedulingPolicy=rr CPUSchedulingPolicy=rr
# For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority): CPUSchedulingPriority=1
CPUSchedulingPriority=11
# See sched(7) for further details on real-time policies and priorities
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@@ -1,24 +1,15 @@
[Unit] [Unit]
Description=Osmocom GSM BTS for virtual Um layer based on GSMTAP/UDP Description=Osmocom GSM BTS for virtual Um layer based on GSMTAP/UDP
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/osmo-bts-virtual -s -c /etc/osmocom/osmo-bts-virtual.cfg ExecStart=/usr/bin/osmo-bts-virtual -s -c /etc/osmocom/osmo-bts-virtual.cfg
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
Restart=always Restart=always
RestartSec=2 RestartSec=2
User=osmocom
Group=osmocom
AmbientCapabilities=CAP_SYS_NICE
# CPU scheduling policy: # Let it process messages quickly enough
CPUSchedulingPolicy=rr CPUSchedulingPolicy=rr
# For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority): CPUSchedulingPriority=1
CPUSchedulingPriority=11
# See sched(7) for further details on real-time policies and priorities
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@@ -1,13 +1,9 @@
[Unit] [Unit]
Description=osmo-bts manager for sysmoBTS Description=osmo-bts manager for sysmoBTS
After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
Restart=always Restart=always
RestartSec=2 RestartSec=2

1421
debian/changelog vendored

File diff suppressed because it is too large Load Diff

2
debian/compat vendored
View File

@@ -1 +1 @@
10 9

35
debian/control vendored
View File

@@ -1,42 +1,26 @@
Source: osmo-bts Source: osmo-bts
Maintainer: Osmocom team <openbsc@lists.osmocom.org> Maintainer: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Section: net Section: net
Priority: optional Priority: optional
Build-Depends: debhelper (>= 10), Build-Depends: debhelper (>= 9),
pkg-config, pkg-config,
dh-autoreconf, dh-autoreconf,
dh-systemd (>= 1.5),
autotools-dev, autotools-dev,
pkg-config, pkg-config,
libosmocore-dev (>= 1.11.0), libosmocore-dev,
libosmo-abis-dev (>= 2.0.0), libosmo-abis-dev,
libosmo-netif-dev (>= 1.6.0),
libgps-dev, libgps-dev,
txt2man, txt2man,
osmo-gsm-manuals-dev (>= 1.6.0) osmo-gsm-manuals-dev
Standards-Version: 3.9.8 Standards-Version: 3.9.8
Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-bts Vcs-Browser: http://git.osmocom.org/osmo-bts/
Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-bts Vcs-Git: git://git.osmocom.org/osmo-bts
Homepage: https://projects.osmocom.org/projects/osmobts Homepage: https://projects.osmocom.org/projects/osmobts
Package: osmo-bts
Architecture: any
Depends: osmo-bts-trx, osmo-bts-virtual, ${misc:Depends}
Description: Base Transceiver Station for GSM
OsmoBTS is a software implementation of Layer2/3 of a BTS. It implements the
following protocols/interfaces:
LAPDm (GSM 04.06)
RTP
A-bis/IP in IPA multiplex
OML (GSM TS 12.21)
RSL (GSM TS 08.58)
.
OsmoBTS is modular and has support for multiple back-ends. A back-end talks to
a specific L1/PHY implementation of the respective BTS hardware. Based on this
architecture, it should be relatively easy to add a new back-end to support
so-far unsupported GSM PHY/L1 and associated hardware.
Package: osmo-bts-trx Package: osmo-bts-trx
Architecture: any Architecture: any
Conflicts: osmo-bts
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}
Description: osmo-bts-trx GSM BTS with osmo-trx Description: osmo-bts-trx GSM BTS with osmo-trx
osmo-bts-trx to be used with the osmo-trx application osmo-bts-trx to be used with the osmo-trx application
@@ -51,6 +35,7 @@ Description: Debug symbols for the osmo-bts-trx
Package: osmo-bts-virtual Package: osmo-bts-virtual
Architecture: any Architecture: any
Conflicts: osmo-bts
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Virtual Osmocom GSM BTS (no RF hardware; GSMTAP/UDP) Description: Virtual Osmocom GSM BTS (no RF hardware; GSMTAP/UDP)
This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but

View File

@@ -1,39 +0,0 @@
#!/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.13.0"; then
if [ -e /etc/osmocom/osmo-bts-trx.cfg ]; then
chown -v osmocom:osmocom /etc/osmocom/osmo-bts-trx.cfg
chmod -v 0660 /etc/osmocom/osmo-bts-trx.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

@@ -3,3 +3,4 @@ lib/systemd/system/osmo-bts-virtual.service
usr/bin/osmo-bts-virtual usr/bin/osmo-bts-virtual
usr/bin/osmo-bts-omldummy usr/bin/osmo-bts-omldummy
usr/share/doc/osmo-bts/examples/osmo-bts-virtual/osmo-bts-virtual.cfg usr/share/doc/osmo-bts/examples/osmo-bts-virtual/osmo-bts-virtual.cfg
usr/share/doc/osmo-bts/examples/osmo-bts-virtual/openbsc-virtual.cfg

View File

@@ -1,39 +0,0 @@
#!/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.13.0"; then
if [ -e /etc/osmocom/osmo-bts-virtual.cfg ]; then
chown -v osmocom:osmocom /etc/osmocom/osmo-bts-virtual.cfg
chmod -v 0660 /etc/osmocom/osmo-bts-virtual.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

@@ -1,29 +1,17 @@
# all config examples must be listed here unconditionally, so that OSMOCONF_FILES = virtual/osmo-bts-virtual.cfg
# all of them end up in the release tarball (see OS#6349)
EXTRA_DIST = \
trx/osmo-bts-trx.cfg \
trx/osmo-bts-trx-calypso.cfg \
octphy/osmo-bts-trx2dsp1.cfg \
octphy/osmo-bts-octphy.cfg \
oc2g/osmo-bts-oc2g.cfg \
oc2g/oc2gbts-mgr.cfg \
sysmo/sysmobts-mgr.cfg \
sysmo/osmo-bts-sysmo.cfg \
litecell15/osmo-bts-lc15.cfg \
litecell15/lc15bts-mgr.cfg \
virtual/osmo-bts-virtual.cfg \
$(NULL)
doc_virtualdir = $(docdir)/examples/osmo-bts-virtual doc_virtualdir = $(docdir)/examples/osmo-bts-virtual
doc_virtual_DATA = \ doc_virtual_DATA = \
virtual/osmo-bts-virtual.cfg virtual/osmo-bts-virtual.cfg \
OSMOCONF_FILES = virtual/osmo-bts-virtual.cfg virtual/openbsc-virtual.cfg
EXTRA_DIST = $(doc_virtual_DATA)
if ENABLE_SYSMOBTS if ENABLE_SYSMOBTS
doc_sysmodir = $(docdir)/examples/osmo-bts-sysmo doc_sysmodir = $(docdir)/examples/osmo-bts-sysmo
doc_sysmo_DATA = \ doc_sysmo_DATA = \
sysmo/osmo-bts-sysmo.cfg \ sysmo/osmo-bts-sysmo.cfg \
sysmo/sysmobts-mgr.cfg sysmo/sysmobts-mgr.cfg
EXTRA_DIST += $(doc_sysmo_DATA)
OSMOCONF_FILES += sysmo/osmo-bts-sysmo.cfg sysmo/sysmobts-mgr.cfg OSMOCONF_FILES += sysmo/osmo-bts-sysmo.cfg sysmo/sysmobts-mgr.cfg
endif endif
@@ -32,6 +20,7 @@ doc_trxdir = $(docdir)/examples/osmo-bts-trx
doc_trx_DATA = \ doc_trx_DATA = \
trx/osmo-bts-trx.cfg \ trx/osmo-bts-trx.cfg \
trx/osmo-bts-trx-calypso.cfg trx/osmo-bts-trx-calypso.cfg
EXTRA_DIST += $(doc_trx_DATA)
OSMOCONF_FILES += trx/osmo-bts-trx.cfg OSMOCONF_FILES += trx/osmo-bts-trx.cfg
endif endif
@@ -40,6 +29,7 @@ doc_octphydir = $(docdir)/examples/osmo-bts-octphy
doc_octphy_DATA = \ doc_octphy_DATA = \
octphy/osmo-bts-trx2dsp1.cfg \ octphy/osmo-bts-trx2dsp1.cfg \
octphy/osmo-bts-octphy.cfg octphy/osmo-bts-octphy.cfg
EXTRA_DIST += $(doc_octphy_DATA)
OSMOCONF_FILES += octphy/osmo-bts-octphy.cfg OSMOCONF_FILES += octphy/osmo-bts-octphy.cfg
endif endif
@@ -48,6 +38,7 @@ doc_lc15dir = $(docdir)/examples/osmo-bts-lc15
doc_lc15_DATA = \ doc_lc15_DATA = \
litecell15/osmo-bts-lc15.cfg \ litecell15/osmo-bts-lc15.cfg \
litecell15/lc15bts-mgr.cfg litecell15/lc15bts-mgr.cfg
EXTRA_DIST += $(doc_lc15_DATA)
OSMOCONF_FILES += litecell15/osmo-bts-lc15.cfg litecell15/lc15bts-mgr.cfg OSMOCONF_FILES += litecell15/osmo-bts-lc15.cfg litecell15/lc15bts-mgr.cfg
endif endif
@@ -56,6 +47,7 @@ doc_oc2gdir = $(docdir)/examples/osmo-bts-oc2g
doc_oc2g_DATA = \ doc_oc2g_DATA = \
oc2g/osmo-bts-oc2g.cfg \ oc2g/osmo-bts-oc2g.cfg \
oc2g/oc2gbts-mgr.cfg oc2g/oc2gbts-mgr.cfg
EXTRA_DIST += $(doc_oc2g_DATA)
OSMOCONF_FILES += oc2g/osmo-bts-oc2g.cfg oc2g/oc2gbts-mgr.cfg OSMOCONF_FILES += oc2g/osmo-bts-oc2g.cfg oc2g/oc2gbts-mgr.cfg
endif endif

View File

@@ -3,12 +3,10 @@
!! !!
! !
log stderr log stderr
logging filter all 1
logging color 1 logging color 1
logging print category-hex 0 logging print category 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level temp info logging level temp info
logging level fw info logging level fw info
logging level find info logging level find info

View File

@@ -4,11 +4,7 @@
! !
log stderr log stderr
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl info logging level rsl info
logging level oml info logging level oml info
logging level rll notice logging level rll notice
@@ -39,7 +35,7 @@ phy 1
trx-calibration-path /mnt/rom/factory/calib trx-calibration-path /mnt/rom/factory/calib
bts 0 bts 0
band 900 band 900
ipa unit-id 6969 0 ipa unit-id 1500 0
oml remote-ip 192.168.234.185 oml remote-ip 192.168.234.185
trx 0 trx 0
phy 0 instance 0 phy 0 instance 0

View File

@@ -3,12 +3,10 @@
!! !!
! !
log stderr log stderr
logging filter all 1
logging color 1 logging color 1
logging print category-hex 0 logging print category 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level temp info logging level temp info
logging level fw info logging level fw info
logging level find info logging level find info

View File

@@ -4,11 +4,7 @@
! !
log stderr log stderr
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl info logging level rsl info
logging level oml info logging level oml info
logging level rll notice logging level rll notice
@@ -36,7 +32,7 @@ phy 0
trx-calibration-path /mnt/rom/factory/calib trx-calibration-path /mnt/rom/factory/calib
bts 0 bts 0
band 900 band 900
ipa unit-id 6969 0 ipa unit-id 1500 0
oml remote-ip 10.42.0.1 oml remote-ip 10.42.0.1
trx 0 trx 0
phy 0 instance 0 phy 0 instance 0

View File

@@ -4,11 +4,7 @@
! !
log stderr log stderr
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl info logging level rsl info
logging level oml info logging level oml info
logging level rll notice logging level rll notice
@@ -29,7 +25,7 @@ phy 0
instance 0 instance 0
bts 0 bts 0
band 1800 band 1800
ipa unit-id 6969 0 ipa unit-id 1234 0
oml remote-ip 127.0.0.1 oml remote-ip 127.0.0.1
trx 0 trx 0
phy 0 instance 0 phy 0 instance 0

View File

@@ -4,11 +4,7 @@
! !
log stderr log stderr
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl info logging level rsl info
logging level oml info logging level oml info
logging level rll notice logging level rll notice
@@ -30,7 +26,7 @@ phy 0
instance 1 instance 1
bts 0 bts 0
band 1800 band 1800
ipa unit-id 6969 0 ipa unit-id 1234 0
oml remote-ip 127.0.0.1 oml remote-ip 127.0.0.1
trx 0 trx 0
phy 0 instance 0 phy 0 instance 0

View File

@@ -4,11 +4,7 @@
! !
log stderr log stderr
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl info logging level rsl info
logging level oml info logging level oml info
logging level rll notice logging level rll notice
@@ -27,7 +23,7 @@ phy 0
instance 0 instance 0
bts 0 bts 0
band 1800 band 1800
ipa unit-id 6969 0 ipa unit-id 666 0
oml remote-ip 10.1.2.3 oml remote-ip 10.1.2.3
trx 0 trx 0
phy 0 instance 0 phy 0 instance 0

View File

@@ -3,12 +3,9 @@
!! !!
! !
log stderr log stderr
logging filter all 1
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level temp info logging level temp info
logging level fw info logging level fw info
logging level find info logging level find info

View File

@@ -1,15 +1,11 @@
! !
! OsmoBTS configuration example for CalypsoBTS ! OsmoBTS configuration example for CalypsoBTS
! https://osmocom.org/projects/baseband/wiki/CalypsoBTS ! http://osmocom.org/projects/baseband/wiki/CalypsoBTS
!! !!
! !
log stderr log stderr
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl notice logging level rsl notice
logging level oml notice logging level oml notice
logging level rll notice logging level rll notice
@@ -26,15 +22,17 @@ line vty
! !
phy 0 phy 0
instance 0 instance 0
osmotrx rx-gain 1
osmotrx ip local 127.0.0.1 osmotrx ip local 127.0.0.1
osmotrx ip remote 127.0.0.1 osmotrx ip remote 127.0.0.1
osmotrx timing-advance-loop
osmotrx ms-power-loop -65
osmotrx legacy-setbsic osmotrx legacy-setbsic
osmotrx fn-advance 20
osmotrx rts-advance 5
bts 0 bts 0
oml remote-ip 127.0.0.1 oml remote-ip 127.0.0.1
ipa unit-id 6969 0 ipa unit-id 1801 0
gsmtap-sapi pdtch
gsmtap-sapi ccch
band 900 band 900
trx 0 trx 0
phy 0 instance 0 phy 0 instance 0
nominal-tx-power 23

View File

@@ -4,11 +4,7 @@
! !
log stderr log stderr
logging color 1 logging color 1
logging print category-hex 0
logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl notice logging level rsl notice
logging level oml notice logging level oml notice
logging level rll notice logging level rll notice
@@ -25,11 +21,14 @@ line vty
! !
phy 0 phy 0
instance 0 instance 0
osmotrx rx-gain 1
osmotrx ip local 127.0.0.1 osmotrx ip local 127.0.0.1
osmotrx ip remote 127.0.0.1 osmotrx ip remote 127.0.0.1
bts 0 bts 0
band 1800 band 1800
ipa unit-id 6969 0 ipa unit-id 6969 0
oml remote-ip 127.0.0.1 oml remote-ip 192.168.122.1
gsmtap-sapi ccch
gsmtap-sapi pdtch
trx 0 trx 0
phy 0 instance 0 phy 0 instance 0

View File

@@ -0,0 +1,151 @@
!
! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 0
logging print category 1
logging timestamp 1
logging level all info
logging level rll notice
logging level cc notice
logging level mm debug
logging level rr notice
logging level rsl notice
logging level nm info
logging level mncc notice
logging level pag notice
logging level meas notice
logging level sccp notice
logging level msc notice
logging level mgcp notice
logging level ho notice
logging level db notice
logging level ref notice
logging level gprs debug
logging level ns info
logging level bssgp debug
logging level llc debug
logging level sndcp debug
logging level nat notice
logging level ctrl notice
logging level smpp debug
logging level filter debug
logging level ranap debug
logging level sua debug
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
!
stats interval 5
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
network
network country code 262
mobile network code 42
short name OpenBSC
long name OpenBSC
auth policy accept-all
authorized-regexp .*
location updating reject cause 13
encryption a5 0
neci 1
paging any use tch 0
rrlp mode ms-based
mm info 1
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 4
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3122 10
timer t3141 0
subscriber-keep-in-ram 0
bts 0
type sysmobts
band DCS1800
cell_identity 6969
location_area_code 1
base_station_id_code 63
ms max power 0
cell reselection hysteresis 4
rxlev access min 0
periodic location update 30
radio-link-timeout 32
channel allocator descending
rach tx integer 9
rach max transmission 7
channel-descrption attach 1
channel-descrption bs-pa-mfrms 5
channel-descrption bs-ag-blks-res 1
ip.access unit_id 6969 0
oml ip.access stream_id 255 line 0
neighbor-list mode automatic
codec-support fr
gprs mode none
no force-combined-si
trx 0
rf_locked 0
arfcn 666
nominal power 0
max_power_red 0
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
hopping enabled 0
timeslot 1
phys_chan_config SDCCH8
hopping enabled 0
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
mncc-int
default-codec tch-f fr
default-codec tch-h hr
nitb
subscriber-create-on-demand
subscriber-create-on-demand random 1 24
assign-tmsi

View File

@@ -3,12 +3,10 @@
!! !!
! !
log stderr log stderr
logging color 1 logging filter all 0
logging print category-hex 0 logging color 0
logging print category 1 logging print category 1
logging timestamp 0 logging timestamp 0
logging print file basename last
logging print level 1
logging level rsl info logging level rsl info
logging level oml info logging level oml info
logging level rll notice logging level rll notice
@@ -52,6 +50,7 @@ bts 0
rtp jitter-buffer 100 rtp jitter-buffer 100
paging queue-size 200 paging queue-size 200
paging lifetime 0 paging lifetime 0
uplink-power-target -75
min-qual-rach 50 min-qual-rach 50
min-qual-norm -5 min-qual-norm -5
trx 0 trx 0

View File

@@ -3,6 +3,7 @@ EXTRA_DIST = dtx.dot \
osmobts-abis-docinfo.xml \ osmobts-abis-docinfo.xml \
osmobts-usermanual.adoc \ osmobts-usermanual.adoc \
osmobts-usermanual-docinfo.xml \ osmobts-usermanual-docinfo.xml \
osmobts-vty-reference.xml \
rtp-amr.adoc \ rtp-amr.adoc \
rtp-amr-docinfo.xml \ rtp-amr-docinfo.xml \
regen_doc.sh \ regen_doc.sh \
@@ -17,32 +18,8 @@ if BUILD_MANUALS
osmobts-abis.pdf: $(srcdir)/abis/*.adoc $(srcdir)/abis/*.msc osmobts-abis.pdf: $(srcdir)/abis/*.adoc $(srcdir)/abis/*.msc
rtp-amr.pdf: $(srcdir)/dtx.dot rtp-amr.pdf: $(srcdir)/dtx.dot
# NOTE: osmo-bts-omldummy has no VTY interface VTY_REFERENCE = osmobts-vty-reference.xml
VARIANTS = virtual include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
if ENABLE_SYSMOBTS
VARIANTS += sysmo
endif
if ENABLE_TRX
VARIANTS += trx
endif
if ENABLE_OCTPHY
VARIANTS += octphy
endif
if ENABLE_LC15BTS
VARIANTS += lc15
endif
if ENABLE_OC2GBTS
VARIANTS += oc2g
endif
# This is a significantly modified, multi-target adopted copy of
# $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
include $(srcdir)/vty/Makefile.vty-reference.inc
OSMO_REPOSITORY = osmo-bts OSMO_REPOSITORY = osmo-bts
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc

View File

@@ -3,17 +3,16 @@
=== List of Messages === List of Messages
The following tables list the OML messages used by OsmoBTS, grouped by their The following tables list the OML messages used by OsmoBTS, grouped by their
level of compliance with 3GPP TS 52.021 [[3gpp-ts-52-021]] (previously 3GPP TS level of compliance with 3GPP TS 12.21.
12.21).
==== Messages Compliant With TS 52.021 ==== Messages Compliant With TS 12.21
Specific limitations apply, see the linked sections. Specific limitations apply, see the linked sections.
.Messages compliant with TS 52.021 .Messages compliant with TS 12.21
[options="header",cols="10%,10%,20%,35%,5%,20%"] [options="header",cols="10%,10%,20%,35%,5%,20%"]
|=== |===
| TS 52.021 § | type code (hex) | This document § | Message | <-/-> | Received/Sent by OsmoBTS | TS 12.21 § | type code (hex) | This document § | Message | <-/-> | Received/Sent by OsmoBTS
6+<| *SW Download Management Messages:* 6+<| *SW Download Management Messages:*
| 8.3.7 | 0x10 | <<sw_act_rep>> | SW Activated Report | -> | Sent | 8.3.7 | 0x10 | <<sw_act_rep>> | SW Activated Report | -> | Sent
6+<| *Air Interface Management Messages:* 6+<| *Air Interface Management Messages:*
@@ -35,16 +34,12 @@ Specific limitations apply, see the linked sections.
.3+.| 8.9.2 | 0x74 .3+.| <<opstart>> | Opstart | <- | Received .3+.| 8.9.2 | 0x74 .3+.| <<opstart>> | Opstart | <- | Received
| 0x75 | Opstart Ack | -> | Sent | 0x75 | Opstart Ack | -> | Sent
| 0x76 | Opstart Nack | -> | Sent | 0x76 | Opstart Nack | -> | Sent
6+<| *Other Messages:*
.3+.| 8.11.1 | 0x81 | <<get_attributes>> | Get Attributes | <- | Received
| 8.11.3 | 0x82 | <<get_attr_resp>> | Get Attribute Response | -> | Sent
| 8.11.1 | 0x83 | | Get Attributes Nack | -> | Sent
|=== |===
==== Messages Specific to OsmoBTS ==== Messages Specific to OsmoBTS
.Messages specific to OsmoBTS, not found in 3GPP TS 52.021 .Messages specific to OsmoBTS, not found in 3GPP TS 12.21
[options="header"] [options="header"]
[options="header",cols="20%,55%,5%,20%"] [options="header",cols="20%,55%,5%,20%"]
|=== |===
@@ -54,10 +49,10 @@ Specific limitations apply, see the linked sections.
==== Messages Not Implemented by OsmoBTS ==== Messages Not Implemented by OsmoBTS
.3GPP TS 52.021 messages not implemented by OsmoBTS .3GPP TS 12.21 messages not implemented by OsmoBTS
[options="header",cols="10%,10%,80%"] [options="header",cols="10%,10%,80%"]
|=== |===
| TS 52.021 § | type code (hex) | Message | TS 12.21 § | type code (hex) | Message
3+<| *SW Download Management Messages:* 3+<| *SW Download Management Messages:*
.3+.| 8.3.1 | 0x01 | Load Data Initiate .3+.| 8.3.1 | 0x01 | Load Data Initiate
| 0x02 | Load Data Initiate Ack | 0x02 | Load Data Initiate Ack
@@ -141,6 +136,9 @@ Specific limitations apply, see the linked sections.
| 8.10.3 | 0x8C | Stop Measurement | 8.10.3 | 0x8C | Stop Measurement
| 8.10.4 | 0x8D | Start Measurement | 8.10.4 | 0x8D | Start Measurement
3+<| *Other Messages:* 3+<| *Other Messages:*
| 8.11.1 | 0x81 | Get Attributes
| 8.11.3 | 0x82 | Get Attribute(s) Response
| 8.11.1 | 0x83 | Get Attributes Nack
.3+.| 8.11.2 | 0x84 | Set Alarm Threshold .3+.| 8.11.2 | 0x84 | Set Alarm Threshold
| 0x85 | Set Alarm Threshold Ack | 0x85 | Set Alarm Threshold Ack
| 0x86 | Set Alarm Threshold Nack | 0x86 | Set Alarm Threshold Nack
@@ -153,7 +151,7 @@ Specific limitations apply, see the linked sections.
==== SW Activated Report ==== SW Activated Report
OsmoBTS will send an _SW Activated Report_ when RF has been activated OsmoBTS will send an _SW Activated Report_ when RF has been activated
successfully. The message is compliant with 3GPP TS 52.021 § 8.3.7. successfully. The message is compliant with 3GPP TS 12.21 § 8.3.7.
Upon RF activation, two _SW Activated Report_ messages will be sent, for the Object Classes Upon RF activation, two _SW Activated Report_ messages will be sent, for the Object Classes
@@ -165,13 +163,13 @@ Upon RF activation, two _SW Activated Report_ messages will be sent, for the Obj
OsmoBTS will receive a _Set BTS Attributes_ message and reply with a OsmoBTS will receive a _Set BTS Attributes_ message and reply with a
corresponding ACK message on success. IE handling is fully compliant to TS corresponding ACK message on success. IE handling is fully compliant to TS
52.021, except that a change of BCCH ARFCN or BSIC while in operation is not 12.21, except that a change of BCCH ARFCN or BSIC while in operation is not
supported, and hence the _Starting Time_ IE is rejected. supported, and hence the _Starting Time_ IE is rejected.
._Set BTS Attributes_ IEs not handled by OsmoBTS ._Set BTS Attributes_ IEs not handled by OsmoBTS
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 52.021 § | IE Name | Handling | TS 12.21 § | IE Name | Handling
| 9.4.52 | Starting Time | not supported (provokes NACK cause 0x10) | 9.4.52 | Starting Time | not supported (provokes NACK cause 0x10)
|=== |===
@@ -179,13 +177,13 @@ supported, and hence the _Starting Time_ IE is rejected.
[[set_radio_attr]] [[set_radio_attr]]
==== Set Radio Carrier Attributes ==== Set Radio Carrier Attributes
This message conforms to 3GPP TS 52.021, with the following limitation, This message conforms to 3GPP TS 12.21, with the following limitation,
as frequency hopping is not supported by OsmoBTS: as frequency hopping is not supported by OsmoBTS:
._Set Radio Carrier Attributes_ IE limitations ._Set Radio Carrier Attributes_ IE limitations
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 52.021 § | IE Name | Handling | TS 12.21 § | IE Name | Handling
| 9.4.5 | ARFCN List | ignored | 9.4.5 | ARFCN List | ignored
|=== |===
@@ -193,14 +191,14 @@ as frequency hopping is not supported by OsmoBTS:
[[set_chan_attr]] [[set_chan_attr]]
==== Set Channel Attributes ==== Set Channel Attributes
This message conforms to 3GPP TS 52.021, with the following limitation: the This message conforms to 3GPP TS 12.21, with the following limitation: the
following 3GPP TS 52.021 IEs provoke a NACK response when sent to OsmoBTS, as following 3GPP TS 12.21 IEs provoke a NACK response when sent to OsmoBTS, as
frequency hopping is not supported: frequency hopping is not supported:
._Set Channel Attributes_ IE limitations ._Set Channel Attributes_ IE limitations
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 52.021 § | IE Name | Handling | TS 12.21 § | IE Name | Handling
| 9.4.21 | HSN | not supported (provokes NACK cause 0x10) | 9.4.21 | HSN | not supported (provokes NACK cause 0x10)
| 9.4.27 | MAIO | not supported (provokes NACK cause 0x10) | 9.4.27 | MAIO | not supported (provokes NACK cause 0x10)
| 9.4.52 | Starting Time | not supported (provokes NACK cause 0x10) | 9.4.52 | Starting Time | not supported (provokes NACK cause 0x10)
@@ -209,54 +207,34 @@ frequency hopping is not supported:
[[state_changed_rep]] [[state_changed_rep]]
==== State Changed Event Report ==== State Changed Event Report
This message is compliant with 3GPP TS 52.021. Exactly these IEs are sent by This message is compliant with 3GPP TS 12.21. Exactly these IEs are sent by
OsmoBTS: OsmoBTS:
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type (0xf5) | 3GPP TS 52.021 9.1 | M | V | 1 | Message Type (0xf5) | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 52.021 9.2 | M | V | 1 | Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 52.021 9.3 | M | V | 3 | Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| Operational State | 3GPP TS 52.021 9.4.38 | O | TV | 2 | Operational State | 3GPP TS 12.21 9.4.38 | O | TV | 2
| Availability Status | 3GPP TS 52.021 9.4.7 | O | TL16V (with length of 1) | 3 | Availability Status | 3GPP TS 12.21 9.4.7 | O | TL16V (with length of 1) | 3
|=== |===
[[chg_adm_state]] [[chg_adm_state]]
==== Change Administrative State ==== Change Administrative State
This message is compliant with 3GPP TS 52.021 § 8.8.5. It applies to all of the This message is compliant with 3GPP TS 12.21 § 8.8.5. It applies to all of the
Object Classes defined in 3GPP TS 52.021 § 9.2 as well as Object Classes defined in 3GPP TS 12.21 § 9.2 as well as
<<addnl_obj_classes>>. <<addnl_obj_classes>>.
[[opstart]] [[opstart]]
==== Opstart ==== Opstart
This message is compliant with 3GPP TS 52.021 § 8.9.2. It applies to all of the This message is compliant with 3GPP TS 12.21 § 8.9.2. It applies to all of the
Object Classes defined in 3GPP TS 52.021 § 9.2 as well as Object Classes defined in 3GPP TS 12.21 § 9.2 as well as
<<addnl_obj_classes>>. <<addnl_obj_classes>>.
[[get_attributes]]
==== Get Attributes
This message is compliant with 3GPP TS 52.021 § 8.11.1.
For a list of supported attributes, see <<get_attr_resp>>.
[[get_attr_resp]]
==== Get Attribute Response
This message is compliant with 3GPP TS 52.021 § 8.11.3.
The following attributes are provided by OsmoBTS:
[options="header"]
|===
| 3GPP TS 52.021 chapter | description | see
| 9.4.61 | SW Configuration | <<NM_ATT_SW_CONFIG>>
| 9.4.30 | Manufacturer Id | <<NM_ATT_MANUF_ID>>
|===
=== Details on OsmoBTS Specific Messages === Details on OsmoBTS Specific Messages
@@ -274,9 +252,9 @@ The message specifics depend on the Object Class and are detailed in
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type (0xf5) | 3GPP TS 52.021 9.1 | M | V | 1 | Message Type (0xf5) | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 52.021 9.2 | M | V | 1 | Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 52.021 9.3 | M | V | 3 | Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
5+<| _Object Class specific IEs follow, see <<addnl_obj_classes>>..._ 5+<| _Object Class specific IEs follow, see <<addnl_obj_classes>>..._
|=== |===
@@ -284,7 +262,7 @@ The message specifics depend on the Object Class and are detailed in
[[addnl_obj_classes]] [[addnl_obj_classes]]
=== Additional Object Classes === Additional Object Classes
In addition to 3GPP TS 52.021 Chapter 9.2, the following managed objects In addition to 3GPP TS 12.21 Chapter 9.2, the following managed objects
are supported: are supported:
.Additional Managed Object Classes .Additional Managed Object Classes
@@ -306,9 +284,9 @@ with the following Information Elements:
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type | 3GPP TS 52.021 9.1 | M | V | 1 | Message Type | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 52.021 9.2 | M | V | 1 | Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 52.021 9.3 | M | V | 3 | Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| GPRS NSEI | <<NM_ATT_IPACC_NSEI>> | O | TL16V | >= 5 | GPRS NSEI | <<NM_ATT_IPACC_NSEI>> | O | TL16V | >= 5
| GPRS NS Configuration | <<NM_ATT_IPACC_NS_LINK_CFG>> | O | TL16V | >= 10 | GPRS NS Configuration | <<NM_ATT_IPACC_NS_LINK_CFG>> | O | TL16V | >= 10
| GPRS BSSGP Configuration | <<NM_ATT_IPACC_BSSGP_CFG>> | O | TL16V | >= 14 | GPRS BSSGP Configuration | <<NM_ATT_IPACC_BSSGP_CFG>> | O | TL16V | >= 14
@@ -323,9 +301,9 @@ message with the following Information Elements:
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type | 3GPP TS 52.021 9.1 | M | V | 1 | Message Type | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 52.021 9.2 | M | V | 1 | Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 52.021 9.3 | M | V | 3 | Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| GPRS Routing Area Code | <<NM_ATT_IPACC_RAC>> | O | TL16V | >= 4 | GPRS Routing Area Code | <<NM_ATT_IPACC_RAC>> | O | TL16V | >= 4
| GPRS Paging Configuration | <<NM_ATT_IPACC_GPRS_PAGING_CFG>> | O | TL16V | >= 5 | GPRS Paging Configuration | <<NM_ATT_IPACC_GPRS_PAGING_CFG>> | O | TL16V | >= 5
| GPRS RLC Configuration | <<NM_ATT_IPACC_RLC_CFG>> | O | TL16V | >= 12 | GPRS RLC Configuration | <<NM_ATT_IPACC_RLC_CFG>> | O | TL16V | >= 12
@@ -343,9 +321,9 @@ Attribute* message with the following Information Elements:
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type | 3GPP TS 52.021 9.1 | M | V | 1 | Message Type | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 52.021 9.2 | M | V | 1 | Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 52.021 9.3 | M | V | 3 | Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| GPRS NSVCI | <<NM_ATT_IPACC_NSVCI>> | O | TL16V | >= 5 | GPRS NSVCI | <<NM_ATT_IPACC_NSVCI>> | O | TL16V | >= 5
| GPRS NS Link Configuration | <<NM_ATT_IPACC_NS_LINK_CFG>> | O | TL16V | >= 11 | GPRS NS Link Configuration | <<NM_ATT_IPACC_NS_LINK_CFG>> | O | TL16V | >= 11
|=== |===
@@ -354,9 +332,9 @@ Attribute* message with the following Information Elements:
=== Information Elements Overview === Information Elements Overview
All of the IEs handled by OsmoBTS are listed below, with limitations and All of the IEs handled by OsmoBTS are listed below, with limitations and
additions to TS 52.021 specified in more detail. additions to TS 12.21 specified in more detail.
==== IEs Conforming to TS 52.021 ==== IEs Conforming to TS 12.21
The following Information Elements are accepted by OsmoBTS. The following Information Elements are accepted by OsmoBTS.
@@ -368,10 +346,10 @@ IEs marked __ignored__ and additionally marked as being received by OsmoBTS
(<-) are in fact parsed and their values are stored by OsmoBTS, but these (<-) are in fact parsed and their values are stored by OsmoBTS, but these
stored items are currently not used in the OsmoBTS code base. stored items are currently not used in the OsmoBTS code base.
.IEs conforming to TS 52.021 .IEs conforming to TS 12.21
[options="header",cols="5%,10%,40%,5%,40%"] [options="header",cols="5%,10%,40%,5%,40%"]
|=== |===
| tag (hex) | TS 52.021 § | IE name | <-/-> | Received/Sent by OsmoBTS | tag (hex) | TS 12.21 § | IE name | <-/-> | Received/Sent by OsmoBTS
| 0x00 | 9.4.1 | Abis Channel | | _ignored_ | 0x00 | 9.4.1 | Abis Channel | | _ignored_
| 0x01 | 9.4.2 | Additional Info | | _ignored_ | 0x01 | 9.4.2 | Additional Info | | _ignored_
| 0x02 | 9.4.3 | Additional Text | | _ignored_ | 0x02 | 9.4.3 | Additional Text | | _ignored_
@@ -394,8 +372,8 @@ stored items are currently not used in the OsmoBTS code base.
| 0x13 | 9.4.19 | File Version | | _ignored_ | 0x13 | 9.4.19 | File Version | | _ignored_
| 0x14 | 9.4.20 | GSM Time | | _ignored_ | 0x14 | 9.4.20 | GSM Time | | _ignored_
| 0x16 | 9.4.22 | HW Configuration | | _ignored_ | 0x16 | 9.4.22 | HW Configuration | | _ignored_
| 0x18 | 9.4.24 | Intave Parameter | <- | | 0x18 | 9.4.24 | Intave Parameter | <- | _ignored_
| 0x19 | 9.4.25 | Interference level Boundaries | <- | | 0x19 | 9.4.25 | Interference level Boundaries | <- | _ignored_
| 0x1a | 9.4.26 | List of Required Attributes | | _ignored_ | 0x1a | 9.4.26 | List of Required Attributes | | _ignored_
| 0x1c | 9.4.28 | Manufacturer Dependent State | | _ignored_ | 0x1c | 9.4.28 | Manufacturer Dependent State | | _ignored_
| 0x1d | 9.4.29 | Manufacturer Dependent Thresholds | | _ignored_ | 0x1d | 9.4.29 | Manufacturer Dependent Thresholds | | _ignored_
@@ -427,20 +405,20 @@ stored items are currently not used in the OsmoBTS code base.
| 0x38 | 9.4.58 | VSWR Thresholds | | _ignored_ | 0x38 | 9.4.58 | VSWR Thresholds | | _ignored_
| 0x39 | 9.4.59 | Window Size | | _ignored_ | 0x39 | 9.4.59 | Window Size | | _ignored_
| 0x40 | 9.4.60 | TSC | <- | Received, with limitations: see <<NM_ATT_TSC>> | 0x40 | 9.4.60 | TSC | <- | Received, with limitations: see <<NM_ATT_TSC>>
| 0x41 | 9.4.61 | SW Configuration | -> | Sent, see <<NM_ATT_SW_CONFIG>> | 0x41 | 9.4.61 | SW Configuration | | _ignored_
| 0x43 | 9.4.63 | Perceived Severity | | _ignored_ | 0x43 | 9.4.63 | Perceived Severity | | _ignored_
| 0x44 | 9.4.64 | Get Attribute Response Info | -> | Sent, see <<NM_ATT_MANUF_ID>> | 0x44 | 9.4.64 | Get Attribute Response Info | | _ignored_
| 0x45 | 9.4.65 | Outstanding Alarm Sequence | | _ignored_ | 0x45 | 9.4.65 | Outstanding Alarm Sequence | | _ignored_
| 0x46 | 9.4.66 | HW Conf Change Info | | _ignored_ | 0x46 | 9.4.66 | HW Conf Change Info | | _ignored_
| 0x47 | 9.4.32 | Measurement Result | | _ignored_ | 0x47 | 9.4.32 | Measurement Result | | _ignored_
|=== |===
==== IEs Not Conforming to TS 52.021 ==== IEs Not Conforming to TS 12.21
.IEs not conforming to TS 52.021 .IEs not conforming to TS 12.21
[options="header",cols="5%,10%,30%,55%"] [options="header",cols="5%,10%,30%,55%"]
|=== |===
| tag (hex) | TS 52.021 § | IE name | Description | tag (hex) | TS 12.21 § | IE name | Description
| 0x15 | 9.4.21 | HSN | presence causes NACK response | 0x15 | 9.4.21 | HSN | presence causes NACK response
| 0x17 | 9.4.23 | HW Description | _ignored_ by OsmoBTS, but coding may differ, see <<ie_hw_desc>> | 0x17 | 9.4.23 | HW Description | _ignored_ by OsmoBTS, but coding may differ, see <<ie_hw_desc>>
| 0x1b | 9.4.27 | MAIO | presence causes NACK response | 0x1b | 9.4.27 | MAIO | presence causes NACK response
@@ -453,14 +431,14 @@ stored items are currently not used in the OsmoBTS code base.
==== Additional Attributes and Parameters ==== Additional Attributes and Parameters
The following Information Elements are defined in addition to those The following Information Elements are defined in addition to those
specified in 3GPP TS 52.021 Chapter 9.4. specified in 3GPP TS 12.21 Chapter 9.4.
All of these additional IEs are _received_ by OsmoBTS. All of these additional IEs are _received_ by OsmoBTS.
These attributes are not used by OsmoBTS, but These attributes are not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket. simply passed to OsmoPCU connected to the PCU socket.
.Additional IEs handled by OsmoBTS but not defined in TS 52.021 .Additional IEs handled by OsmoBTS but not defined in TS 12.21
[options="header",cols="5%,50%,45%"] [options="header",cols="5%,50%,45%"]
|=== |===
| tag (hex) | IE name | Description | tag (hex) | IE name | Description
@@ -487,7 +465,7 @@ simply passed to OsmoPCU connected to the PCU socket.
[[ie_hw_desc]] [[ie_hw_desc]]
==== HW Description ==== HW Description
TS 52.021 suggests a series of 5 length-value pairs for the _HW Description_ IE. TS 12.21 suggests a series of 5 length-value pairs for the _HW Description_ IE.
Instead, OsmoBTS interprets it as a single TL16V. The value of this IE is Instead, OsmoBTS interprets it as a single TL16V. The value of this IE is
ignored by OsmoBTS, yet the coding may affect message parsing. ignored by OsmoBTS, yet the coding may affect message parsing.
@@ -509,7 +487,7 @@ exactly one ARFCN.
[[ie_chan_comb]] [[ie_chan_comb]]
==== Additional Channel Combinations ==== Additional Channel Combinations
In addition to 3GPP TS 52.021 Chapter 9.4.13, the following channel In addition to 3GPP TS 12.21 Chapter 9.4.13, the following channel
combinations are supported: combinations are supported:
.Additional Channel Combinations .Additional Channel Combinations
@@ -535,7 +513,7 @@ work, please see the <<rsl-dynamic-channels>>.
[[ie_conn_fail_crit]] [[ie_conn_fail_crit]]
==== Connection Failure Criterion ==== Connection Failure Criterion
3GPP TS 52.021 Chapter 9.4.14 specifies two different options for the 3GPP TS 12.21 Chapter 9.4.14 specifies two different options for the
_Connection Failure Criterion_. OsmoBTS only implements the option _Connection Failure Criterion_. OsmoBTS only implements the option
coded as 0x01, i.e. based upon uplink SACCH error rate coded as 0x01, i.e. based upon uplink SACCH error rate
(RADIO_LINK_TIMEOUT). (RADIO_LINK_TIMEOUT).
@@ -545,7 +523,7 @@ coded as 0x01, i.e. based upon uplink SACCH error rate
Due to limitations in the currently supported PHY implementations, Due to limitations in the currently supported PHY implementations,
OsmoBTS supports only one global TSC for all channels on one TRX, rather OsmoBTS supports only one global TSC for all channels on one TRX, rather
than a separate TSC for each timeslot, as expected by 3GPP TS 52.021. than a separate TSC for each timeslot, as expected by 3GPP TS 12.21.
[[NM_ATT_IPACC_DST_IP]] [[NM_ATT_IPACC_DST_IP]]
@@ -805,91 +783,10 @@ It is encoded as follows:
This attribute is not used by OsmoBTS, but This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket. simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_SW_CONFIG]]
==== SW Configuration
The SW Configuration IE is compliant with 3GPP TS 52.021 9.4.61: it contains a
number of SW Description IEs (9.4.62).
.Coding of SW Configuration IE
[options="header",cols="20%,80%"]
|===
| octet | value
| 1 | NM_ATT_SW_CONFIG IEI (0x41)
| 2-3 | length of value part
| 4 | NM_ATT_SW_DESCR IEI (0x42)
| 5 | NM_ATT_FILE_ID IEI (0x12)
| 6-7 | length of file name
| 8-N | ASCII coded file name (without terminating nul)
| N+1 | NM_ATT_FILE_VERSION IEI (0x13)
| N+2 - N+3 | length of file content
| N+4 - M | file content
| M+1 | NM_ATT_SW_DESCR IEI (0x42)
| M+2 | NM_ATT_FILE_ID IEI (0x12)
2+| ...
|===
.File names and content sent in the SW Configuration IE
[options="header",cols="20%,80%"]
|===
| file name | content
| 'osmobts' | ASCII coded OsmoBTS version number like "1.2.3" or "1.2.3.4-abcd"
| 'BTS_TYPE_VARIANT' | one of "osmo-bts-lc15", "osmo-bts-oc2g", "osmo-bts-octphy",
"osmo-bts-omldummy", "osmo-bts-sysmo", "osmo-bts-trx", "osmo-bts-virtual"
| 'BTS_SUB_MODEL' | This file may be omitted; if present, may contain an ASCII
coded model number like "sysmoBTS 1002"
|===
[[NM_ATT_MANUF_ID]]
==== Manufacturer Id
The coding of the Manufacturer Id attribute is a sequence of bit flags (a bit
vector), where a zero flag indicates absence and a set flag indicates presence
of a specific BTS feature.
The number of flags transmitted depends on the software version of OsmoBTS and
the BTS backend in use. More flags may be added in the future. The flag bits
transmitted are followed by zero bits up to the next full octet boundary.
These features are currently defined:
.coding of BTS feature flags sent in the Manufacturer Id attribute
[options="header",cols="5%,5%,30%,60%"]
|===
| octet | bit | feature name | description
.8+.| 0 | 7 | HSCSD | High-Speed Circuit-Switched Data
| 6 | GPRS | General Packet Radio Service
| 5 | EGPRS | Enhanced GPRS (EDGE)
| 4 | ECSD | Enhanced Circuit-Switched Data
| 3 | HOPPING | Frequency Hopping
| 2 | MULTI_TSC | Multi-TSC
| 1 | OML_ALERTS | OML Alerts
| 0 | AGCH_PCH_PROP | AGCH/PCH proportional allocation
.8+.| 1 | 7 | CBCH | Cell Broadcast Channel
| 6 | SPEECH_F_V1 | Fullrate speech V1
| 5 | SPEECH_H_V1 | Halfrate speech V1
| 4 | SPEECH_F_EFR | Fullrate speech EFR
| 3 | SPEECH_F_AMR | Fullrate speech AMR
| 2 | SPEECH_H_AMR | Halfrate speech AMR
| 1 | ETWS_PN | ETWS Primary Notification via PCH
| 0 | PAGING_COORDINATION | BSS Paging Coordination
.8+.| 2 | 7 | IPV6_NSVC | NSVC IPv6
| 6 | ACCH_REP | FACCH/SACCH Repetition
| 5 | CCN | Cell Change Notification
| 4 | VAMOS | Voice services over Adaptive Multi-user channels on One Slot
| 3 2.4+.| reserved for future use, sent as zero
| 2
| 1
| 0
|===
=== A-bis OML Initialization / BTS bring-up === A-bis OML Initialization / BTS bring-up
At the time an Abis/IP BTS connects to via OML to the BSC, it is At the time an Abis/IP BTS connects to via OML to the BSC, it is
initialized according to the procedures described in 3GPP TS 52.021 as initialized according to the procedures described in 3GPP TS 12.21 as
amended by this document. amended by this document.
Each Managed Object (MO) is separately initialized. The initialization Each Managed Object (MO) is separately initialized. The initialization

View File

@@ -3,16 +3,16 @@
=== List of Messages === List of Messages
The following tables list the RSL messages used by OsmoBTS A-bis/IP, The following tables list the RSL messages used by OsmoBTS A-bis/IP,
grouped by their level of compliance with 3GPP TS 48.058. grouped by their level of compliance with 3GPP TS 08.58.
==== Messages Compliant With TS 48.058 ==== Messages Compliant With TS 08.58
Specific additions and limitations apply, see the linked sections. Specific additions and limitations apply, see the linked sections.
.Messages compliant with TS 48.058 .Messages compliant with TS 08.58
[options="header",cols="10%,20%,45%,5%,20%"] [options="header",cols="10%,20%,45%,5%,20%"]
|=== |===
| TS 48.058 § | This document § | Message | <-/-> | Received/Sent by OsmoBTS | TS 08.58 § | This document § | Message | <-/-> | Received/Sent by OsmoBTS
5+<| *Radio link layer management messages* 5+<| *Radio link layer management messages*
| 8.3.1 | - | DATA REQUEST | <- | Received | 8.3.1 | - | DATA REQUEST | <- | Received
| 8.3.2 | - | DATA INDICATION | -> | Sent | 8.3.2 | - | DATA INDICATION | -> | Sent
@@ -59,7 +59,7 @@ Specific additions and limitations apply, see the linked sections.
==== Messages Specific to OsmoBTS ==== Messages Specific to OsmoBTS
.Messages specific to OsmoBTS, not found in 3GPP TS 48.058 .Messages specific to OsmoBTS, not found in 3GPP TS 08.58
[options="header",cols="15%,15%,45%,5%,20%"] [options="header",cols="15%,15%,45%,5%,20%"]
|=== |===
2+| This document § | Message | <-/-> | Received/Sent by OsmoBTS 2+| This document § | Message | <-/-> | Received/Sent by OsmoBTS
@@ -87,10 +87,10 @@ Specific additions and limitations apply, see the linked sections.
==== Messages Not Implemented by OsmoBTS ==== Messages Not Implemented by OsmoBTS
.3GPP TS 48.058 messages not implemented by OsmoBTS .3GPP TS 08.58 messages not implemented by OsmoBTS
[options="header",cols="10%,90%"] [options="header",cols="10%,90%"]
|=== |===
| TS 48.058 § | Message | TS 08.58 § | Message
2+<| *DEDICATED CHANNEL MANAGEMENT MESSAGES* 2+<| *DEDICATED CHANNEL MANAGEMENT MESSAGES*
| 8.4.12 | PHYSICAL CONTEXT REQUEST | 8.4.12 | PHYSICAL CONTEXT REQUEST
| 8.4.13 | PHYSICAL CONTEXT CONFIRM | 8.4.13 | PHYSICAL CONTEXT CONFIRM
@@ -123,7 +123,7 @@ Specific additions and limitations apply, see the linked sections.
==== Channel Activation ==== Channel Activation
When used on a timeslot using the non-standard channel combination When used on a timeslot using the non-standard channel combination
'NM_CHANC_OSMO_DYN' as configured by OML, the regular 'NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH' as configured by OML, the regular
RSL channel activation procedures can not only be used for activation RSL channel activation procedures can not only be used for activation
of circuit-switched channels, but also for activation of a PDCH. of circuit-switched channels, but also for activation of a PDCH.
@@ -135,24 +135,24 @@ dynamic PDCH protocol employed by nanoBTS devices (<<ipa_style_pdch_mgmt>>).
[[MEASUREMENT_RESULT]] [[MEASUREMENT_RESULT]]
==== Measurement Result ==== Measurement Result
Conforms to 3GPP TS 48.058 § 8.4.8 with this limitation: Conforms to 3GPP TS 08.58 § 8.4.8 with this limitation:
._Measurement Result_ IE limitations ._Measurement Result_ IE limitations
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.37 | MS Timing Offset | never sent by OsmoBTS | 9.3.37 | MS Timing Offset | never sent by OsmoBTS
|=== |===
[[MODE_MODIFY]] [[MODE_MODIFY]]
==== Mode Modify ==== Mode Modify
Conforms to 3GPP TS 48.058 § 8.4.9 with these limitations: Conforms to 3GPP TS 08.58 § 8.4.9 with these limitations:
._Mode Modify_ IE limitations ._Mode Modify_ IE limitations
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.45 | Main channel reference | _ignored_ | 9.3.45 | Main channel reference | _ignored_
| 9.3.53 | MultiRate Control | _ignored_ | 9.3.53 | MultiRate Control | _ignored_
| 9.3.54 | Supported Codec Types | _ignored_ | 9.3.54 | Supported Codec Types | _ignored_
@@ -161,12 +161,12 @@ Conforms to 3GPP TS 48.058 § 8.4.9 with these limitations:
[[MS_POWER_CONTROL]] [[MS_POWER_CONTROL]]
==== MS Power Control ==== MS Power Control
Conforms to 3GPP TS 48.058 § 8.4.15 with these limitations: Conforms to 3GPP TS 08.58 § 8.4.15 with these limitations:
._MS Power Control_ IE limitations ._MS Power Control_ IE limitations
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.31 | MS Power Parameters | _ignored_ | 9.3.31 | MS Power Parameters | _ignored_
|=== |===
@@ -174,12 +174,12 @@ Conforms to 3GPP TS 48.058 § 8.4.15 with these limitations:
[[SACCH_INFO_MODIFY]] [[SACCH_INFO_MODIFY]]
==== SACCH Info Modify ==== SACCH Info Modify
Conforms to 3GPP TS 48.058 § 8.4.20, with these exceptions: Conforms to 3GPP TS 08.58 § 8.4.20, with these exceptions:
._SACCH Info Modify_ IE limitations ._SACCH Info Modify_ IE limitations
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.30 | System Info Type | See below for available types | 9.3.30 | System Info Type | See below for available types
| 9.3.23 | Starting Time | not supported, provokes an _Error Report_ response | 9.3.23 | Starting Time | not supported, provokes an _Error Report_ response
|=== |===
@@ -192,7 +192,6 @@ Conforms to 3GPP TS 48.058 § 8.4.20, with these exceptions:
| 0x06 | RSL_SYSTEM_INFO_6 | 0x06 | RSL_SYSTEM_INFO_6
| 0x0d | RSL_SYSTEM_INFO_5bis | 0x0d | RSL_SYSTEM_INFO_5bis
| 0x0e | RSL_SYSTEM_INFO_5ter | 0x0e | RSL_SYSTEM_INFO_5ter
| 0x0f | RSL_SYSTEM_INFO_10
| 0x47 | RSL_EXT_MEAS_ORDER | 0x47 | RSL_EXT_MEAS_ORDER
| 0x48 | RSL_MEAS_INFO | 0x48 | RSL_MEAS_INFO
|=== |===
@@ -200,12 +199,12 @@ Conforms to 3GPP TS 48.058 § 8.4.20, with these exceptions:
[[BCCH_INFORMATION]] [[BCCH_INFORMATION]]
==== BCCH Information ==== BCCH Information
Conforms to 3GPP TS 48.058 § 8.5.1, with these limitations and extensions: Conforms to 3GPP TS 08.58 § 8.5.1, with these limitations and extensions:
._BCCH Information_ IE details ._BCCH Information_ IE details
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.30 | System Info Type | See <<SACCH_INFO_MODIFY>> for available types | 9.3.30 | System Info Type | See <<SACCH_INFO_MODIFY>> for available types
| 9.3.11 | L3 Info | This IE may be included instead of a 9.3.39 _Full BCCH Info_ IE. | 9.3.11 | L3 Info | This IE may be included instead of a 9.3.39 _Full BCCH Info_ IE.
The _Full BCCH Info_ takes precedence over _L3 Info_. The _Full BCCH Info_ takes precedence over _L3 Info_.
@@ -216,12 +215,12 @@ Conforms to 3GPP TS 48.058 § 8.5.1, with these limitations and extensions:
[[CHANNEL_REQUIRED]] [[CHANNEL_REQUIRED]]
==== Channel Required ==== Channel Required
Conforms to 3GPP TS 48.058 § 8.5.3, with these limitations: Conforms to 3GPP TS 08.58 § 8.5.3, with these limitations:
._Channel Required_ message IE details ._Channel Required_ message IE details
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.16 | Physical Context | never sent by OsmoBTS | 9.3.16 | Physical Context | never sent by OsmoBTS
|=== |===
@@ -229,12 +228,12 @@ Conforms to 3GPP TS 48.058 § 8.5.3, with these limitations:
[[PAGING_COMMAND]] [[PAGING_COMMAND]]
==== Paging Command ==== Paging Command
Conforms to 3GPP TS 48.058 § 8.5.5, with these limitations: Conforms to 3GPP TS 08.58 § 8.5.5, with these limitations:
._Paging Command_ message IE details ._Paging Command_ message IE details
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.49 | eMLPP Priority | _ignored_ | 9.3.49 | eMLPP Priority | _ignored_
|=== |===
@@ -245,28 +244,28 @@ in any way.
[[RF_RESOURCE_INDICATION]] [[RF_RESOURCE_INDICATION]]
==== RF Resource Indication ==== RF Resource Indication
For all osmo-bts variants, except osmo-bts-trx, this message does not conform This message does not conform to 3GPP TS 08.58 § 8.6.1, in that it omits the
to 3GPP TS 48.058 § 8.6.1, in that it omits the _Resource Information_ IE that _Resource Information_ IE that would contain the actual payload data, which
would contain the actual payload data, which renders this message void. renders this message void.
._RF Resource Indication_ message IE exceptions ._RF Resource Indication_ message IE exceptions
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.21 | Resource Information | DSP based osmo-bts variants omit this IE, though | 9.3.21 | Resource Information | OsmoBTS omits this IE, though TS 08.58
TS 48.058 specifies it as mandatory. specifies it as mandatory.
|=== |===
[[SACCH_FILLING]] [[SACCH_FILLING]]
==== SACCH Filling ==== SACCH Filling
Conforms to 3GPP TS 48.058 § 8.6.2, with these limitations: Conforms to 3GPP TS 08.58 § 8.6.2, with these limitations:
._SACCH Filling_ message IE limitations ._SACCH Filling_ message IE limitations
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.3.30 | System Info Type | See <<SACCH_INFO_MODIFY>> for available types | 9.3.30 | System Info Type | See <<SACCH_INFO_MODIFY>> for available types
| 9.3.23 | Starting Time | _ignored_ | 9.3.23 | Starting Time | _ignored_
|=== |===
@@ -276,7 +275,7 @@ Conforms to 3GPP TS 48.058 § 8.6.2, with these limitations:
=== User Plane Transport Management === User Plane Transport Management
This chapter defines the A-bis/IP specific RSL procedures that are This chapter defines the A-bis/IP specific RSL procedures that are
introduced in addition to the 3GPP TS 48.058 standard procedures. introduced in addition to the 3GPP TS 08.58 standard procedures.
In classic A-bis over E1, user plane traffic is carried over 16kBps In classic A-bis over E1, user plane traffic is carried over 16kBps
sub-slots of 64kBps E1 time-slots according to ETSI/3GPP TS 08.60. As sub-slots of 64kBps E1 time-slots according to ETSI/3GPP TS 08.60. As
@@ -418,16 +417,16 @@ include::dyn_ts_ipa_style2.msc[]
==== Osmocom Style Dynamic Channels ==== Osmocom Style Dynamic Channels
This method is in use when OML uses This method is in use when OML uses
'NM_CHANC_OSMO_DYN' (0x90) for the given time-slot. 'NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH' (0x90) for the given time-slot.
The activation of PDCH is performed by using the regular 'RSL CHANNEL ACTIVATE' The activation of PDCH is performed by using the regular 'RSL CHANNEL ACTIVATE'
procedure according to <<CHANNEL_ACTIVATION>>, with these modifications: procedure according to <<CHANNEL_ACTIVATION>>, with these modifications:
* The 'C-bits' part of the 'Channel Number' IE take the non-standard binary * The 'C-bits' part of the 'Channel Number' IE take the non-standard binary
value 11000 (C5 through C1 as seen in 3GPP TS 48.058 § 9.3.1). value 11000 (C5 thru C1 as seen in 3GPP TS 08.58 § 9.3.1).
* The 'A-bits' part of the 'Activation Type' IE take the non-standard binary * The 'A-bits' part of the 'Activation Type' IE take the non-standard binary
value 1111, with an additional fourth bit (add A4 to A3 through A1 as seen in value 1111, with an additional fourth bit (add A4 to A3 thru A1 as seen in
3GPP TS 48.058 § 9.3.3; all remaining reserved bits as well as the 'R' bit are 3GPP TS 08.58 § 9.3.3; all remaining reserved bits as well as the 'R' bit are
coded as zero). coded as zero).
* The normally mandatory 'Channel Mode' IE is omitted; none of the optional IEs * The normally mandatory 'Channel Mode' IE is omitted; none of the optional IEs
are included. are included.
@@ -437,7 +436,7 @@ Hence the message consists of exactly these IEs:
.PDCH type _Channel Activation_ message IEs .PDCH type _Channel Activation_ message IEs
[options="header",cols="10%,30%,60%"] [options="header",cols="10%,30%,60%"]
|=== |===
| TS 48.058 § | IE Name | Handling | TS 08.58 § | IE Name | Handling
| 9.1 | Message discriminator | Dedicated Channel Management | 9.1 | Message discriminator | Dedicated Channel Management
| 9.2 | Message type | CHANnel ACTIVation | 9.2 | Message type | CHANnel ACTIVation
| 9.3.1 | Channel number | 'C-bits' 11000, plus TS bits as usual | 9.3.1 | Channel number | 'C-bits' 11000, plus TS bits as usual
@@ -477,26 +476,6 @@ signaling for it.
See <<OSMO_ETWS_CMD>> for the Osmocom implementation. See <<OSMO_ETWS_CMD>> for the Osmocom implementation.
=== BCCH carrier power reduction operation
According to 3GPP TS 45.008, section 7.1, the BCCH carrier (sometimes called C0) of
a BTS shall maintain discontinuous Downlink transmission at full power in order to
stay "visible" to the mobile stations. Because of that, early versions of this 3GPP
document prohibited BS power reduction on C0. However, a new feature was introduced
version 13.0.0 (2015-11) - "BCCH carrier power reduction operation".
This is a special mode of operation, in which the variation of RF power level for
some timeslots is relaxed for the purpose of energy saving. In other words, the
output power on some timeslots, except the timeslot(s) carrying BCCH/CCCH, can be
lower than the full power. In this case the maximum allowed difference is 6 dB.
Unfortunately, 3GPP did not specify in which way the BTS is instructed to activate
and deactivate the BCCH carrier power reduction mode. Osmocom had to invent their
own non-standard approach: the BSC needs to send _BS POWER CONTROL_ message with
the _Channel Number_ IE set to 0x80 (BCCH) and the _Message Discriminator_ set to
0x06 (Common Channel Management messages).
=== Message Formats and Contents === Message Formats and Contents
[[rsl_crcx_msg]] [[rsl_crcx_msg]]
@@ -509,15 +488,14 @@ number*.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5 | Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5
| Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3 | Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3
| IP Speech Mode | <<RSL_IE_IPAC_SPEECH_MODE>> | O | TV | 2 | IP Speech Mode | <<RSL_IE_IPAC_SPEECH_MODE>> | O | TV | 2
| RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2 | RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2
| RTP CSD Format | <<RSL_IE_IPAC_RTP_CSD_FORMAT>> | O | TV | 2
|=== |===
[[rsl_crcx_msg_ack]] [[rsl_crcx_msg_ack]]
@@ -530,10 +508,10 @@ in response to the *Create Connection (CRCX)*.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | M | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_ID>> | M | TV | 3
| Source IP Address | <<RSL_IE_IPAC_LOCAL_IP>> | O | TV | 5 | Source IP Address | <<RSL_IE_IPAC_LOCAL_IP>> | O | TV | 5
| Source IP Port | <<RSL_IE_IPAC_LOCAL_PORT>> | O | TV | 3 | Source IP Port | <<RSL_IE_IPAC_LOCAL_PORT>> | O | TV | 3
@@ -550,13 +528,13 @@ sent in response to the *Create Connection (CRCX)*.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5 | Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5
| Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3 | Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3
| Cause | 48.058 9.3.26 | O | TLV | >= 3 | Cause | 08.58 9.3.26 | O | TLV | >= 3
|=== |===
@@ -569,16 +547,15 @@ properties of a user-plane RTP connection.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5 | Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5
| Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3 | Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3
| IP Speech Mode | <<RSL_IE_IPAC_SPEECH_MODE>> | O | TV | 2 | IP Speech Mode | <<RSL_IE_IPAC_SPEECH_MODE>> | O | TV | 2
| RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2 | RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2
| RTP CSD Format | <<RSL_IE_IPAC_RTP_CSD_FORMAT>> | O | TV | 2
|=== |===
[[rsl_mdcx_msg_ack]] [[rsl_mdcx_msg_ack]]
@@ -591,10 +568,10 @@ response to a *Modify Connection (MDCX)*
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Source IP Address | <<RSL_IE_IPAC_LOCAL_IP>> | C | TV | 5 | Source IP Address | <<RSL_IE_IPAC_LOCAL_IP>> | C | TV | 5
| Source IP Port | <<RSL_IE_IPAC_LOCAL_PORT>> | C | TV | 3 | Source IP Port | <<RSL_IE_IPAC_LOCAL_PORT>> | C | TV | 3
@@ -612,11 +589,11 @@ Connection (MDCX)*.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Cause | 48.058 9.3.26 | M | TLV | >= 3 | Cause | 08.58 9.3.26 | M | TLV | >= 3
|=== |===
[[rsl_dlcx_ind_msg]] [[rsl_dlcx_ind_msg]]
@@ -629,13 +606,13 @@ time of RF Channel release.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | M | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_ID>> | M | TV | 3
| Connection Id | <<RSL_IE_IPAC_CONN_STAT>> | M | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_STAT>> | M | TV | 3
| Cause | 48.058 9.3.26 | M | TLV | >= 3 | Cause | 08.58 9.3.26 | M | TLV | >= 3
|=== |===
[[rsl_dlcx_msg]] [[rsl_dlcx_msg]]
@@ -648,10 +625,10 @@ number.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
|=== |===
@@ -666,10 +643,10 @@ Channel number. It is sent in response to the *Delete Connection
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Connection Statistics | <<RSL_IE_IPAC_CONN_STAT>> | C | TV | 29 | Connection Statistics | <<RSL_IE_IPAC_CONN_STAT>> | C | TV | 29
|=== |===
@@ -685,12 +662,12 @@ Channel number. It is sent in response to the *Delete Connection
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3 | Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Cause | 48.058 9.3.26 | M | TLV | >= 3 | Cause | 08.58 9.3.26 | M | TLV | >= 3
|=== |===
[[rsl_pdch_act]] [[rsl_pdch_act]]
@@ -702,10 +679,10 @@ a IPA style dynamic TCH/F+PDCH channel.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
|=== |===
NOTE:: This message is *not* used by Osmocom style dynamic channels NOTE:: This message is *not* used by Osmocom style dynamic channels
@@ -719,11 +696,11 @@ of a PDCH on a IPA style dynamic TCH/F+PDCH channel.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Frame Number | 48.058 9.3.8 | O | TV | 3 | Frame Number | 08.58 9.3.8 | O | TV | 3
|=== |===
NOTE:: This message is *not* used by Osmocom style dynamic channels NOTE:: This message is *not* used by Osmocom style dynamic channels
@@ -737,11 +714,11 @@ of a PDCH on a IPA style dynamic TCH/F+PDCH channel.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Cause | 48.058 9.3.26 | M | TLV | >= 3 | Cause | 08.58 9.3.26 | M | TLV | >= 3
|=== |===
NOTE:: This message is *not* used by Osmocom style dynamic channels NOTE:: This message is *not* used by Osmocom style dynamic channels
@@ -755,10 +732,10 @@ on a IPA style dynamic TCH/F+PDCH channel.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
|=== |===
NOTE:: This message is *not* used by Osmocom style dynamic channels NOTE:: This message is *not* used by Osmocom style dynamic channels
@@ -772,10 +749,10 @@ of a PDCH on a IPA style dynamic TCH/F+PDCH channel.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
|=== |===
NOTE:: This message is *not* used by Osmocom style dynamic channels NOTE:: This message is *not* used by Osmocom style dynamic channels
@@ -789,11 +766,11 @@ on a IPA style dynamic TCH/F+PDCH channel.
[options="header"] [options="header"]
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| Cause | 48.058 9.3.26 | M | TLV | >= 3 | Cause | 08.58 9.3.26 | M | TLV | >= 3
|=== |===
NOTE:: This message is *not* used by Osmocom style dynamic channels NOTE:: This message is *not* used by Osmocom style dynamic channels
@@ -817,10 +794,10 @@ The Channel Number IE is set to the Downlink CCCH (PCH).
[cols="30%,25%,15%,15%,15%"] [cols="30%,25%,15%,15%,15%"]
|=== |===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH | INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 48.058 9.1 | M | V | 1 | Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1 | Message type | <<own_msg_types>> | M | V | 1
| Channel number | 48.058 9.3.1 | M | TV | 2 | Channel number | 08.58 9.3.1 | M | TV | 2
| SMSCB Message | 48.058 9.3.42 | M | TLV | 2-58 | SMSCB Message | 08.58 9.3.42 | M | TLV | 2-58
|=== |===
@@ -830,7 +807,7 @@ The Channel Number IE is set to the Downlink CCCH (PCH).
==== A-bis/IP specific RSL Message discriminators ==== A-bis/IP specific RSL Message discriminators
The following message discriminators are used in addition to those The following message discriminators are used in addition to those
indicated in 3GPP TS 48.058 Section 9.1: indicated in 3GPP TS 08.58 Section 9.1:
.OsmoBTS specific new message discriminators .OsmoBTS specific new message discriminators
[options="header",cols="10%,50%,40%"] [options="header",cols="10%,50%,40%"]
@@ -858,54 +835,37 @@ indicated in 3GPP TS 48.058 Section 9.1:
==== A-bis/IP specific RSL IEIs ==== A-bis/IP specific RSL IEIs
The following Information Element Identifiers (IEIs) are used in The following Information Element Identifiers (IEIs) are used in
addition to those indicated in 3GPP TS 48.058 Section 9.3: addition to those indicated in 3GPP TS 08.58 Section 9.3:
.A-bis/IP specific information elements .A-bis/IP specific information elements
[options="header",cols="10%,50%,40%"] [options="header",cols="10%,50%,40%"]
|=== |===
| IEI | Name | This document § | IEI | Name | This document §
| 0x01 | RSL_IE_CHAN_NR | <<RSL_IE_CHAN_NR>> | 0x01 | RSL_IE_CHAN_NR | <<RSL_IE_CHAN_NR>>
| 0x60 | RSL_IE_OSMO_REP_ACCH_CAP | <<RSL_IE_OSMO_REP_ACCH_CAP>> | 0xf0 | RSL_IE_IPAC_REMOTE_IP | <<RSL_IE_IPAC_REMOTE_IP>>
| 0x61 | RSL_IE_OSMO_TRAINING_SEQUENCE | <<RSL_IE_OSMO_TRAINING_SEQUENCE>>
| 0x62 | RSL_IE_OSMO_TEMP_OVP_ACCH_CAP | <<RSL_IE_OSMO_TEMP_OVP_ACCH_CAP>>
| 0x63 | RSL_IE_OSMO_OSMUX_CID | <<RSL_IE_OSMO_OSMUX_CID>>
| 0xf0 | RSL_IE_IPAC_REMOTE_IP | <<RSL_IE_IPAC_REMOTE_IP>>
| 0xf1 | RSL_IE_IPAC_REMOTE_PORT | <<RSL_IE_IPAC_REMOTE_PORT>> | 0xf1 | RSL_IE_IPAC_REMOTE_PORT | <<RSL_IE_IPAC_REMOTE_PORT>>
| 0xf3 | RSL_IE_IPAC_LOCAL_PORT | <<RSL_IE_IPAC_LOCAL_PORT>> | 0xf3 | RSL_IE_IPAC_LOCAL_PORT | <<RSL_IE_IPAC_LOCAL_PORT>>
| 0xf4 | RSL_IE_IPAC_SPEECH_MODE | <<RSL_IE_IPAC_SPEECH_MODE>> | 0xf4 | RSL_IE_IPAC_SPEECH_MODE | <<RSL_IE_IPAC_SPEECH_MODE>>
| 0xf5 | RSL_IE_IPAC_LOCAL_IP | <<RSL_IE_IPAC_LOCAL_IP>> | 0xf5 | RSL_IE_IPAC_LOCAL_IP | <<RSL_IE_IPAC_LOCAL_IP>>
| 0xf6 | RSL_IE_IPAC_CONN_STAT | <<RSL_IE_IPAC_CONN_STAT>> | 0xf6 | RSL_IE_IPAC_CONN_STAT | <<RSL_IE_IPAC_CONN_STAT>>
| 0xf8 | RSL_IE_IPAC_CONN_ID | <<RSL_IE_IPAC_CONN_ID>> | 0xf8 | RSL_IE_IPAC_CONN_ID | <<RSL_IE_IPAC_CONN_ID>>
| 0xf9 | RSL_IE_IPAC_RTP_CSD_FORMAT | <<RSL_IE_IPAC_RTP_CSD_FORMAT>>
| 0xfc | RSL_IE_IPAC_RTP_PAYLOAD2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | 0xfc | RSL_IE_IPAC_RTP_PAYLOAD2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>>
|=== |===
[[RSL_IE_CHAN_NR]] [[RSL_IE_CHAN_NR]]
==== RSL_IE_CHAN_NR ==== RSL_IE_CHAN_NR
This information element is coded as described in 3GPP TS 48.058 Section 9.3.1, This information element is coded like 3GPP TS 08.58 Section 9.3.1,
but in addition supports the following vendor specific values: but in addition supports the following extended coding:
.RSL Channel Number extensions * C5..C1 bits 0b11000 for PDCH type channels
[options="header",cols="5%,5%,5%,5%,5%,75%"]
|===
| C5 | C4 | C3 | C2 | C1 | Description
| 1 | 1 | 0 | 0 | 0 | PDCH `<1>`
| 1 | 1 | 0 | 0 | 1 | CBCH on SDCCH4
| 1 | 1 | 0 | 1 | 0 | CBCH on SDCCH8
| 1 | 1 | 1 | 0 | 1 | VAMOS TCH/F `<2>`
| 1 | 1 | 1 | 1 | T | VAMOS TCH/H `<2>`
|===
`<1>` This extension is only valid on an Osmocom-style dynamic channel, having
configured the 'NM_CHANC_IPAC_TCHFull_PDCH' channel combination by OML.
`<2>` These Osmocom specific values are used by osmo-bsc to address logical
channels on the shadow timeslots in VAMOS mode, iff the BTS is an osmo-bts
and VAMOS capable.
The TN-Bits are not re-defined in this case but use the same encoding The TN-Bits are not re-defined in this case but use the same encoding
as specified in TS 48.058 Section 9.3.1. as specified in TS 08.58 Section 9.3.1.
NOTE:: The above extension is only valid on an Osmocom-style dynamic
channel, having configured the 'NM_CHANC_IPAC_TCHFull_PDCH' channel
combination by OML.
[[RSL_IE_IPAC_REMOTE_IP]] [[RSL_IE_IPAC_REMOTE_IP]]
==== RSL_IE_IPAC_REMOTE_IP ==== RSL_IE_IPAC_REMOTE_IP
@@ -959,8 +919,8 @@ IEI followed by four bytes IPv4 address.
This information element contains statistics about the RTP connection. This information element contains statistics about the RTP connection.
It is encoded as 30 bytes, with the first byte as IEI, the second byte as length It is encoded as 29 bytes, with the first byte as IEI and 28 bytes
(=28), and 28 bytes fixed-length payload encoded as follows: fixed-length payload encoded as follows:
.A-bis/IP Connection Statistics .A-bis/IP Connection Statistics
[options="header",width="60%",cols="15%,15%,70%"] [options="header",width="60%",cols="15%,15%,70%"]
@@ -993,147 +953,6 @@ This information element contains the RTP payload identifier, which is
used in the PT (Payload Type) field of the RTP header in subsequent used in the PT (Payload Type) field of the RTP header in subsequent
transmissions of the RTP flow. transmissions of the RTP flow.
[[RSL_IE_OSMO_REP_ACCH_CAP]]
==== RSL_IE_OSMO_REP_ACCH_CAP
This is a one byte length TLV IE that is used to enable or disable repeated ACCH
capabilities on the BTS side during Channel Activation and Mode Modify.
The IE contains a bitfield in the lower nibble in order to set the ACCH repetition
policy for each of the two channel types individually. Depending on the state of the
bits (see table below) the ACCH repetition mode is either enabled or disabled completely.
The lower 3 bit of the higher nibble are used to signal an RXQUAL threshold to set the
BER on which UL-SACCH or DL-FACCH repetition shall be turned on. If the field is set
to 0, then UL-SACCH and DL-FACCH will be always on. DL-FACCH will also be turned on
automatically as soon as the MS requests a DL-SACCH repetition.
If the IE is not present, then ACCH repetition completely is disabled.
[options="header"]
|===
| *bit* | 7 | 6 - 4 | 3 | 2 | 1 | 0
| byte at offset 0 | 0 | RXQUAL | UL-SACCH | DL-SACCH | DL-FACCH/ALL | DL-FACCH/CMD
|===
(Bits 7 is reserved for future use and must be set to zero.)
[[RSL_IE_OSMO_TRAINING_SEQUENCE]]
==== RSL_IE_OSMO_TRAINING_SEQUENCE
This TLV IE instructs the BTS to use a specific training sequence set and
training sequence code for a given lchan. It is sent by OsmoBSC in RSL CHANNEL
ACTIVATION and MODE MODIFY messages to the BTS, iff the BTS is VAMOS-capable,
i.e. if an Abis-over-IP connected BTS indicated BTS_FEAT_VAMOS in the OML BTS
features (Manufacturer Id information element, see <<NM_ATT_MANUF_ID>>).
If this information element is present, the receiver shall ignore any other
training sequence set and training sequence code bits from other information
elements of the same RSL message.
This is an Osmocom-specific extension of the RSL layer, which was added to
express more than two TSC sets. For VAMOS operation, OsmoBSC selects from one
of four separate training sequence codings per modulation scheme, while usual
RSL IEs are only able to express a single-bit TSC set number. For clarity, this
IE contains both the TSC set and the TSC in one IE, and is defined as
overruling any other IEs containing TSC or TSC set numbers.
The first value octet indicates the training sequence set, and the second octet
indicates the training sequence code to be used. Receiving values from a
reserved value range should be considered an error condition.
.RSL_IE_OSMO_TRAINING_SEQUENCE
[options="header",width="80%",cols="20%,80%"]
|===
| IE octet | value
| octet 1 | RSL_IE_OSMO_TRAINING_SEQUENCE IEI (0x61)
| octet 2 | length of the value part (2)
| octet 3 | TSC set
| octet 4 | TSC
|===
The training sequence set (TSC set) is coded like the 'CS Domain TSC Set' bits,
as defined in the 'Extended TSC Set' IE in 3GPP TS 44.018 10.5.2.82
<<3gpp-ts-44-018>>, and corresponds to the 'TSC Set' as defined in 3GPP TS
45.002 <<3gpp-ts-45-002>>. The encoded training sequence set number ranges from
0 to 3, any other values are reserved for future use. The encoded 0 corresponds
to TSC Set 1, see <<RSL_IE_OSMO_TRAINING_SEQUENCE__TSC_set_coding>>.
[[RSL_IE_OSMO_TRAINING_SEQUENCE__TSC_set_coding]]
.TSC set (octet 3) coding
[options="header",width="80%",cols="20%,80%"]
|===
| octet 3 value | interpretation
| 0 | 'TSC Set 1' as in 3GPP TS 45.002
| 1 | 'TSC Set 2'
| 2 | 'TSC Set 3'
| 3 | 'TSC Set 4'
| 4..255 | reserved values
|===
The training sequence code (TSC) corresponds to the 'TSC' bits as defined in
the 'Channel Description 2' IE in 3GPP TS 44.018 10.5.2.5a <<3gpp-ts-44-018>>.
The training sequence code ranges from 0 to 7, any other values are reserved
for future use.
.TSC (octet 4) coding
[options="header",width="80%",cols="20%,80%"]
|===
| octet 4 value | interpretation
| 0 | 'Training Sequence Code (TSC) 0' as in 3GPP TS 45.002
| 1 | 'Training Sequence Code (TSC) 1'
| 2 | 'Training Sequence Code (TSC) 2'
| 3 | 'Training Sequence Code (TSC) 3'
| 4 | 'Training Sequence Code (TSC) 4'
| 5 | 'Training Sequence Code (TSC) 5'
| 6 | 'Training Sequence Code (TSC) 6'
| 7 | 'Training Sequence Code (TSC) 7'
| 8..255 | reserved values
|===
[[RSL_IE_OSMO_TEMP_OVP_ACCH_CAP]]
==== RSL_IE_OSMO_TEMP_OVP_ACCH_CAP
FIXME: this IE has been defined, but remains to be documented.
[[RSL_IE_OSMO_OSMUX_CID]]
==== RSL_IE_OSMO_OSMUX_CID
FIXME: this IE has been defined, but remains to be documented.
[[RSL_IE_IPAC_RTP_CSD_FORMAT]]
==== RSL_IE_IPAC_RTP_CSD_FORMAT
This information element contains the RTP Circuit Switched Data format.
.A-bis/IP RTP CSD Format
[options="header",width="60%",cols="15%,15%,70%"]
|===
| Offset | Size | Description
| 0 | 4 | RTP CSD Format D
| 4 | 4 | RTP CSD Format IR
|===
.A-bis/IP RTP CSD Format D Values
[options="header",width="40%",cols="20%,80%"]
|===
| Value | Description
| 0 | External TRAU format
| 1 | Non-TRAU Packed format
| 2 | TRAU within the BTS
| 3 | IWF-Free BTS-BTS Data
|===
.A-bis/IP RTP CSD Format IR Values
[options="header",width="40%",cols="20%,80%"]
|===
| Value | Description
| 0 | 8 kb/s
| 1 | 16 kb/s
| 2 | 32 kb/s
| 3 | 48 kb/s
|===
=== A-bis RSL Initialization / BTS bring-up === A-bis RSL Initialization / BTS bring-up
Upon receiving the 'IPA RSL CONNECT' OML message by the respective Upon receiving the 'IPA RSL CONNECT' OML message by the respective
@@ -1158,3 +977,4 @@ The initialization of the primary and secondary TRX slightly differ, as
illustrated by the differences of <<rsl-msc-pri>> and <<rsl-msc-sec>>. illustrated by the differences of <<rsl-msc-pri>> and <<rsl-msc-sec>>.
Since the secondary TRX has no BCCH, it does not (need to) receive any 'RSL Since the secondary TRX has no BCCH, it does not (need to) receive any 'RSL
BCCH INFORMATION' messages from the BSC. BCCH INFORMATION' messages from the BSC.

View File

@@ -82,13 +82,13 @@ order to specify which PHY instance is allocated to this specific TRX.
| bts-specific | bts_model_phy_instance_set_defaults() | Called for every PHY Instance created | bts-specific | bts_model_phy_instance_set_defaults() | Called for every PHY Instance created
| common | bts_controlif_setup() | Initialization of Control Interface | common | bts_controlif_setup() | Initialization of Control Interface
| bts-specific | bts_model_ctrl_cmds_install() | Install model-specific control interface commands | bts-specific | bts_model_ctrl_cmds_install() | Install model-specific control interface commands
| common | telnet_init_default() | Initialization of telnet interface | common | telnet_init() | Initialization of telnet interface
| common | pcu_sock_init() | Initialization of PCU socket | common | pcu_sock_init() | Initialization of PCU socket
| common | main() | Installation of signal handlers | common | main() | Installation of signal handlers
| common | abis_open() | Start of the A-bis connection to BSC | common | abis_open() | Start of the A-bis connection to BSC
| common | phy_links_open() | Iterate over list of configured PHY links | common | phy_links_open() | Iterate over list of configured PHY links
| bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links | bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links
| bts-specific | bts_model_phy_link_close() | Close each of the configured PHY links | common | write_pid_file() | Generate the pid file
| common | osmo_daemonize() | Fork as daemon in background (if configured) | common | osmo_daemonize() | Fork as daemon in background (if configured)
| common | bts_main() | Run main loop until global variable quit >= 2 | common | bts_main() | Run main loop until global variable quit >= 2
|=== |===

View File

@@ -248,7 +248,7 @@ current GSM frame number.
GSM is a TDMA (time division multiple access) system on the radio GSM is a TDMA (time division multiple access) system on the radio
interface. OsmoTRX is the "clock master" of that in the Osmocom interface. OsmoTRX is the "clock master" of that in the Osmocom
implementation. It informs OsmoBTS of the current GSM frame implementation. It informs OsmoBTS of the current GSM frame
number. However, as there is non-zero delays (UDP packet transmission number. However, as there is non-zero delays (UDP packet trnsmission
delay, operating system scheduler delay on both OsmoTRX and OsmoBTS delay, operating system scheduler delay on both OsmoTRX and OsmoBTS
side, ...), OsmoBTS must compensate for that delay by "advancing" side, ...), OsmoBTS must compensate for that delay by "advancing"
the clock a certain amount of time. the clock a certain amount of time.
@@ -266,11 +266,12 @@ underruns on the OsmoTRX side.
The detailed value will depend on your underlying computer systems, The detailed value will depend on your underlying computer systems,
operating system and related tuning parameters. Running OsmoTRX operating system and related tuning parameters. Running OsmoTRX
on a remote host will inevitably require a higher fn-advance than on a remote host will inevitably require a higher fn-advance then
running it on the same machine, where the UDP packets are just passed running it on the same machine, where the UDP packetes are just passed
over the loopback device. over the loopback device.
The default value for `fn-advance` is 2 (corresponding to 9.2 milliseconds). The default value for `fn-advance` is 20 (corresponding to 92
milliseconds).
===== `osmotrx rts-advance <0-30>` ===== `osmotrx rts-advance <0-30>`
@@ -289,7 +290,7 @@ reported on L1SAP to higher layers will be computed as follows:
N + fn-advance + rts-advance N + fn-advance + rts-advance
The default value of `rts-advance` is 3 (corresponding to 14 milliseconds). The default value of `rts-advance` is 5 (corresponding to 23 milliseconds).
Do not change this unless you have a good reason! Do not change this unless you have a good reason!
===== `osmotrx rx-gain <0-50>` ===== `osmotrx rx-gain <0-50>`

View File

@@ -19,7 +19,7 @@ The OsmoBTS executables (`osmo-bts-sysmo`, `osmo-bts-trx`,
generic command line options: generic command line options:
==== SYNOPSIS ==== SYNOPSIS
*osmo-bts-sysmo* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE' ] [-s] [-T] [-e 'LOGLEVEL'] *osmo-bts-sysmo* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE' ] [-s] [-T] [-e 'LOGLEVEL'] [-r 'PRIO'] [-i 'GSMTAP-IP'] [-t <1-255>]
==== OPTIONS ==== OPTIONS
*-h, --help*:: *-h, --help*::
@@ -48,6 +48,16 @@ generic command line options:
Set the global log level for logging to stderr. This has mostly Set the global log level for logging to stderr. This has mostly
been deprecated by VTY based logging configuration, see been deprecated by VTY based logging configuration, see
<<logging>> for further information. <<logging>> for further information.
*-r, --realtime 'PRIO'*::
Enable use of the Linux kernel realtime priority scheduler with
the specified priority.
It is recommended you use this option on low-performance
embedded systems or systems that encounter high non-GSM/GPRS
load.
*-i, --gsmtap-ip 'GSMTAP-IP'*::
Specify the destination IP address for GSMTAP messages.
*-t, --trx-num <1-255>*::
Specify the number of TRX supported by this BTS.
There may be additional, hardware specific command line options by the There may be additional, hardware specific command line options by the
different bts_model implementations. different bts_model implementations.
@@ -108,22 +118,11 @@ them via UDP/IP. At that point, they can be captured with utilities like
*tcpdump* or *tshark* for further analysis by the *wireshark* protocol *tcpdump* or *tshark* for further analysis by the *wireshark* protocol
analyzer. analyzer.
In order to activate this feature, you first need to make sure to specify In order to activate this feature, you first need to make sure to start
the remote address of _GSMTAP_ host in the configuration file. In most OsmoBTS using the `-i` or `--gsmtap-ip` command line option, specifying
cases, using 127.0.0.1 for passing the messages over the loopback (`lo`) the destination IP address for the GSMTAP messages. In most cases,
device will be sufficient: using 127.0.0.1 for passing the messages over the loopback (`lo`) device
will be sufficient.
.Example: Enabling GSMTAP Um-frame logging to localhost
----
bts 0
gsmtap-remote-host 127.0.0.1 <1>
----
<1> Destination address for _GSMTAP_ Um-frames
NOTE: Changing this parameter at run-time will not affect the existing
_GSMTAP_ connection, full program restart is required.
NOTE: Command line parameters `-i` and `--gsmtap-ip` have been deprecated.
OsmoBTS can selectively trace such messages by their L1 SAPI, for both OsmoBTS can selectively trace such messages by their L1 SAPI, for both
Rx and Tx. For a complete list of L1 SAPI values, please refer to the Rx and Tx. For a complete list of L1 SAPI values, please refer to the
@@ -138,7 +137,8 @@ node of the OsmoBTS VTY.
OsmoBTS> enable OsmoBTS> enable
OsmoBTS# configure terminal OsmoBTS# configure terminal
OsmoBTS(config)# bts 0 OsmoBTS(config)# bts 0
OsmoBTS(bts)# gsmtap-sapi sdcch OsmoBTS(bts)# trx 0
OsmoBTS(trx)# gsmtap-sapi sdcch
OsmoBTS(trx)# write <1> OsmoBTS(trx)# write <1>
---- ----
<1> the `write` command will make the configuration persistent in the <1> the `write` command will make the configuration persistent in the
@@ -146,37 +146,18 @@ configuration file. This is not required if you wish to enable GSMTAP
only in the current session of OsmoBTS. only in the current session of OsmoBTS.
De-activation can be performed similarly by using the `no gsmtap-sapi De-activation can be performed similarly by using the `no gsmtap-sapi
sdcch` command at the `bts` node of the OsmoBTS VTY. sdcch` command at the `trx` node of the OsmoBTS VTY.
It may be useful to enable all SAPIs with a few exceptions, or vice versa
disable everything using one command. For this purpose, the VTY provides
`gsmtap-sapi enable-all` and `gsmtap-sapi disable-all` commands.
.Example: Enabling all SAPIs except PDTCH and PTCCH
----
bts 0
gsmtap-sapi enable-all <1>
no gsmtap-sapi pdtch <2>
no gsmtap-sapi ptcch <2>
----
<1> Enable all available SAPIs
<2> Exclude PDTCH and PTCCH SAPIs
From the moment they are enabled via VTY, GSMTAP messages will be From the moment they are enabled via VTY, GSMTAP messages will be
generated and sent in UDP encapsulation to the IANA-registered UDP port generated and sent in UDP encapsulation to the IANA-registered UDP port
for GSMTAP (4729) of the specified remote address. for GSMTAP (4729) at the IP address specified in the command line
argument.
==== Configuring power ramping ==== Configuring power ramping
OsmoBTS can ramp up the power of its trx over time. This helps reduce OsmoBTS can ramp up the power of its trx over time. This helps reduce
cell congestion in busy environments. cell congestion in busy environments.
Some models of OsmoBTS (such as osmo-bts-trx) also support ramping down the
transmit power over time until finally ceasing broadcast, for instance due to a
trx becoming administratively locked or due to the whole BTS being gracefully
shut down. This allows for mobile stations camping on the cell to gradually move
to other cells in the area once the signal drop is detected.
In this example, the trx starts with 5dBm output power which increases by 1dB In this example, the trx starts with 5dBm output power which increases by 1dB
every two seconds until it reaches nominal power. every two seconds until it reaches nominal power.
Power ramping can use the power-ramp commands at the CONFIG TRX node of the Power ramping can use the power-ramp commands at the CONFIG TRX node of the

View File

@@ -43,7 +43,7 @@ See <<vty>> for further information.
=== OsmoBTS Control Interface === OsmoBTS Control Interface
The general structure of the Osmocom control interface is described in The general structure of the Omsocom control interface is described in
<<common-control-if>>. <<common-control-if>>.
The number of control interface commands/attributes is currently quite The number of control interface commands/attributes is currently quite

View File

@@ -1,39 +0,0 @@
include::{commondir}/chapters/osmux/osmux.adoc[]
=== Osmux Support in {program-name}
Osmux usage in {program-name} in managed through the VTY commands in node
`osmux`. Command `use (on|off|only)` is used to configure use policy of Osmux
within {program-name}. Once enabled (`on` or `only`), {program-name} will
announce the _OSMUX_ BTS feature towards the BSC over OML. This way, the BSC
becomes aware that this BTS supports using Osmux to transfer voice call user
data when the AMR codec is selected.
It is then up to the BSC to decide whether to use Osmux or not when establishing
a new call. If the BSC decides to use Osmux for a given call, then the _IPACC
CRCX/MDCX_ messages sent by the BSC will contain an extra _Osmux CID_ IE
appended, which contains the Osmux CID to be used by the BTS to send Osmux
frames to the co-located BSC MGW (aka the BSC MGW' local CID, or {program-name}'
remote CID). The IP address and port provided in the same messages refer to the
address and port where Osmux frames with the provided CID are expected to be
received. Similarly, {program-name} appends an _Osmux CID_ IE to the _IPACC
CRCX/MDCX ACK_ message it generates, this time with its own local Osmux CID.
Same goes for the BTS' local IP address and port where Osmux frames are expected
to be received.
{program-name} will behave differently during call set up based on the VTY
command `use (on|off|only)` presented above:
* `off`: If _IPACC CRCX_ from BSC contains _Osmux CID_ IE, meaning
BSC wants to use Osmux for this call, then {program-name} will reject the
request and the call set up will fail.
* `on`: {program-name} will support and accept both Osmux and non-Osmux (RTP)
upon call set up. If _IPACC CRCX_ from BSC contains the _Osmux CID_ IE on a
AMR call (`Channel Mode GSM3`), it will set up an Osmux stream on its end and
provide the BSC with the BTS-local CID. If the BSC provides no _Osmux CID_ IE,
then {program-name} will set up a regular RTP based call.
* `only`: Same as per `on`, except that {program-name} will accept only Osmux
calls on the CN-side, this is, if _IPACC CRCX_ from BSC doesn't
contain an _Osmux CID_ IE, it will reject the assignment and the call set up
will fail. This means also that only AMR calls (`Channel Mode GSM3`) are
allowed.

View File

@@ -1,50 +0,0 @@
==== Full example of QoS for osmo-bts uplink QoS
In the below example we will show the full set of configuration required
for both DSCP and PCP differentiation of uplink Abis traffic by osmo-bts.
What we want to achieve in this example is the following configuration:
.DSCP and PCP assignments for osmo-bts uplink traffic in this example
[options="header",width="30%",cols="2,1,1"]
|===
|Traffic |DSCP|PCP
|A-bis RSL | 56| 7
|A-bis RTP | 46| 6
|A-bis OML | 34| 5
|===
. configure the osmocom program to set the DSCP value
. configure an egrees QoS map to map from priority to PCP
.Example Step 1: add related VTY configuration to `osmo-bts.cfg`
----
...
e1_input
ipa ip-dscp oml 34
ipa socket-priority oml 5
ipa ip-dscp rsl 56
ipa socket-priority rsl 7
...
bts 0
rtp ip-dscp 46
rtp socket-priority 6
...
----
.Example Step 2: egress QoS map to map from socket priority to PCP values
----
$ sudo ip link set dev eth0.9<1> type vlan egress-qos-map 0:0 1:1 5:5 6:6 7:7 <2>
----
<1> make sure to specify your specific VLAN interface name here instead of `eth0.9`.
<2> create a egress QoS map that maps the priority value 1:1 to the PCP. We also include the
mapping 1:1 from the osmo-pcu example (see <<userman-osmopcu>>) here.
NOTE:: The settings of the `ip` command are volatile and only active until
the next reboot (or the network device or VLAN is removed). Please refer to
the documentation of your specific Linux distribution in order to find out how
to make such settings persistent by means of an `ifup` hook whenever the interface
comes up. For CentOS/RHEL 8 this can e.g. be achieved by means of an `/sbin/ifup-local
script` (when using `network-scripts` and not NetworkManager). For Debian or Ubuntu,
this typically involves adding `up` lines to `/etc/network/interfaces` or a `/etc/network/if-up.d`
script.

View File

@@ -1,3 +1,39 @@
<revhistory>
<revision>
<revnumber>1</revnumber>
<date>December 2015</date>
<authorinitials>NJH, HW</authorinitials>
<revremark>
Initial version, reflecting OsmoBTS master branch as on 2015-Dec-7
(commit e28a20a2d9d049cd6312e218a7646593bbc43431).
</revremark>
</revision>
<revision>
<revnumber>2</revnumber>
<date>February 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Updated version with Message Sequence Chart of OML and RSL bring-up.
</revremark>
</revision>
<revision>
<revnumber>2.1</revnumber>
<date>February 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Fix A-bis OML/RSL port number swap in message seqeuence charts.
</revremark>
</revision>
<revision>
<revnumber>2.2</revnumber>
<date>July 2016</date>
<authorinitials>NJH, HW</authorinitials>
<revremark>
Add description on Dynamic Channel Configuration in OML and activation in RSL.
</revremark>
</revision>
</revhistory>
<authorgroup> <authorgroup>
<author> <author>
@@ -25,7 +61,7 @@
</authorgroup> </authorgroup>
<copyright> <copyright>
<year>2015-2021</year> <year>2015-2016</year>
<holder>sysmocom - s.f.m.c. GmbH</holder> <holder>sysmocom - s.f.m.c. GmbH</holder>
</copyright> </copyright>

View File

@@ -87,8 +87,6 @@ include::{srcdir}/abis/rtp.adoc[]
include::./common/chapters/port_numbers.adoc[] include::./common/chapters/port_numbers.adoc[]
include::./common/chapters/bibliography.adoc[]
include::./common/chapters/glossary.adoc[] include::./common/chapters/glossary.adoc[]
include::./common/chapters/gfdl.adoc[] include::./common/chapters/gfdl.adoc[]

View File

@@ -1,3 +1,14 @@
<revhistory>
<revision>
<revnumber>1</revnumber>
<date>January 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Initial version, reflecting OsmoBTS master branch as on FIXME
(commit FIXME).
</revremark>
</revision>
</revhistory>
<authorgroup> <authorgroup>
<author> <author>
@@ -14,7 +25,7 @@
</authorgroup> </authorgroup>
<copyright> <copyright>
<year>2016-2021</year> <year>2016</year>
<holder>sysmocom - s.f.m.c. GmbH</holder> <holder>sysmocom - s.f.m.c. GmbH</holder>
</copyright> </copyright>

View File

@@ -1,5 +1,4 @@
:gfdl-enabled: :gfdl-enabled:
:program-name: OsmoBTS
OsmoBTS User Manual OsmoBTS User Manual
=================== ===================
@@ -31,12 +30,6 @@ include::{srcdir}/chapters/bts-models.adoc[]
include::{srcdir}/chapters/architecture.adoc[] include::{srcdir}/chapters/architecture.adoc[]
include::{srcdir}/chapters/osmux_bts.adoc[]
include::./common/chapters/qos-dscp-pcp.adoc[]
include::./common/chapters/vty_cpu_sched.adoc[]
include::./common/chapters/trx_if.adoc[] include::./common/chapters/trx_if.adoc[]
include::./common/chapters/control_if.adoc[] include::./common/chapters/control_if.adoc[]

View File

@@ -6,25 +6,24 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML 5.0//EN" <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML 5.0//EN"
"http://docbook.org/xml/5.0/dtd/docbook.dtd" [ "http://docbook.org/xml/5.0/dtd/docbook.dtd" [
<!ENTITY chapter-vty SYSTEM "./common/chapters/vty.xml" > <!ENTITY chapter-vty SYSTEM "./common/chapters/vty.xml" >
<!ENTITY sections-vty SYSTEM "@@GENERATED@@" > <!ENTITY sections-vty SYSTEM "generated/docbook_vty.xml" >
]> ]>
<book> <book>
<info> <info>
<revhistory> <revhistory>
<revision> <revision>
<revnumber>v2</revnumber> <revnumber>v1</revnumber>
<date>@@REV_DATE@@</date> <date>13th October 2016</date>
<authorinitials>s.f.m.c.</authorinitials> <authorinitials>hw</authorinitials>
<revremark>Automatic build (@@REV_NUMBER@@)</revremark> <revremark>Initial</revremark>
</revision> </revision>
</revhistory> </revhistory>
<title>OsmoBTS VTY Reference</title> <title>OsmoBTS VTY Reference</title>
<subtitle>@@VARIANT@@</subtitle>
<copyright> <copyright>
<year>@@CR_YEAR@@</year> <year>2016</year>
</copyright> </copyright>
<legalnotice> <legalnotice>

View File

@@ -1,3 +1,29 @@
<revhistory>
<revision>
<revnumber>1</revnumber>
<date>October 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Initial version
</revremark>
</revision>
<revision>
<revnumber>2</revnumber>
<date>November 2016</date>
<authorinitials>MS</authorinitials>
<revremark>
FSM added
</revremark>
</revision>
<revision>
<revnumber>3</revnumber>
<date>July 2017</date>
<authorinitials>PE</authorinitials>
<revremark>
Add section and update sequence charts to describe requirement to receive all PH-DATA.ind events
</revremark>
</revision>
</revhistory>
<authorgroup> <authorgroup>
<author> <author>
@@ -25,7 +51,7 @@
</authorgroup> </authorgroup>
<copyright> <copyright>
<year>2016-2021</year> <year>2016</year>
<holder>sysmocom - s.f.m.c. GmbH</holder> <holder>sysmocom - s.f.m.c. GmbH</holder>
</copyright> </copyright>

View File

@@ -1,37 +0,0 @@
DOCBOOKS = $(foreach v,$(VARIANTS),vty/osmobts-$(v)-vty-reference.xml)
DOCBOOKS_DEPS = $(DOCBOOKS) $(addsuffix .inc,$(DOCBOOKS))
INC_DIR = $(abspath $(builddir)/vty)
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.docbook.inc
CLEAN_FILES += $(DOCBOOKS_DEPS)
CLEAN_FILES += $(addsuffix .inc.gen,$(DOCBOOKS))
CLEAN_FILES += $(addsuffix .inc.merged,$(DOCBOOKS))
$(INC_DIR):
mkdir -p $@
vty/osmobts-%-vty-reference.xml: $(top_srcdir)/src/osmo-bts-% $(INC_DIR)
sed -e "s|@@GENERATED@@|$@.inc|" \
-e "s|@@VARIANT@@|$(notdir $<)|" \
-e "s|@@REV_NUMBER@@|$(VERSION)|" \
-e "s|@@REV_DATE@@|$(shell date +"%dth %B %Y")|" \
-e "s|@@CR_YEAR@@|$(shell date +"%Y")|" \
$(srcdir)/vty/osmobts-vty-reference.xml > $@
vty/osmobts-%-vty-reference.xml.inc: $(top_builddir)/src/osmo-bts-*/osmo-bts-% \
$(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \
$(OSMO_GSM_MANUALS_DIR)/common/chapters/vty.xml \
$(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl \
$(srcdir)/vty/*.xml $(INC_DIR)
# a) Invoke osmo-bts-% to generate the list of commands first
$< --vty-ref-mode default --vty-ref-xml > "$@.gen"
# ... filter garbage potentially printed by libraries to stdout
sed -i '/^<vtydoc/,$$!d' "$@.gen"
# b) Merge the result of a) with global and local additions
$(OSMO_GSM_MANUALS_DIR)/build/vty_reference_combine.sh \
$(realpath $(OSMO_GSM_MANUALS_DIR)/merge_doc.xsl) "$@.gen" \
$(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \
$(srcdir)/vty/*additions*.xml > "$@.merged"
# c) Convert the result of b) into a valid docbook
xsltproc $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl "$@.merged" > $@

View File

@@ -1,26 +1 @@
<!-- ex:ts=2:sw=2:et --> <vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'/>
<vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'>
<node id='phy-inst'>
<!-- FIXME: This command appears twice for some reason. -->
<command id='osmotrx maxdly &lt;0-63&gt;'>
<description>
Access Burst is the first burst a mobile transmits in order to establish a connection and it
is used to estimate Timing Advance (TA) which is then applied to Normal Bursts to compensate
for signal delay due to distance. So changing this setting effectively changes maximum range
of the cell, because Access Bursts with a delay higher than this value will be ignored.
</description>
</command>
<!-- FIXME: This command appears unconditionally, despite being hidden. -->
<command id='osmotrx maxdlynb &lt;0-63&gt;'>
<description>
USE FOR TESTING ONLY, DO NOT CHANGE IN PRODUCTION USE!
During the normal operation, delay of Normal Bursts is controlled by the Timing Advance loop
and thus Normal Bursts arrive to a BTS with no more than a couple GSM symbols, which is
already taken into account in osmo-trx. Changing this setting will have no effect in
production installations except increasing osmo-trx CPU load. This setting is only useful
when testing with a transmitter which cannot precisely synchronize to the BTS downlink
signal, like R&amp;S CMD57.
</description>
</command>
</node>
</vtydoc>

File diff suppressed because it is too large Load Diff

View File

@@ -21,12 +21,13 @@ The start-up procedure of OsmoBTS can be described as follows:
| bts-specific | bts_model_phy_instance_set_defaults() | Called for every PHY Instance created | bts-specific | bts_model_phy_instance_set_defaults() | Called for every PHY Instance created
| common | bts_controlif_setup() | Initialization of Control Interface | common | bts_controlif_setup() | Initialization of Control Interface
| bts-specific | bts_model_ctrl_cmds_install() | bts-specific | bts_model_ctrl_cmds_install()
| common | telnet_init_default() | Initialization of telnet interface | common | telnet_init() | Initialization of telnet interface
| common | pcu_sock_init() | Initialization of PCU socket | common | pcu_sock_init() | Initialization of PCU socket
| common | main() | Installation of signal handlers | common | main() | Installation of signal handlers
| common | abis_open() | Start of the A-bis connection to BSC | common | abis_open() | Start of the A-bis connection to BSC
| common | phy_links_open() | Iterate over list of configured PHY links | common | phy_links_open() | Iterate over list of configured PHY links
| bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links | bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links
| common | write_pid_file() | Generate the pid file
| common | osmo_daemonize() | Fork as daemon in background (if configured) | common | osmo_daemonize() | Fork as daemon in background (if configured)
| common | bts_main() | Run main loop until global variable quit >= 2 | common | bts_main() | Run main loop until global variable quit >= 2
| bts-specific | bts_model_oml_estab() | Called by core once OML link is established | bts-specific | bts_model_oml_estab() | Called by core once OML link is established

View File

@@ -1,98 +0,0 @@
== rx_tchf_fn(): TCH/FS, TCH/EFS, TCH/AFS, TCH/F2.4, and FACCH/F
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 4
| | | | | | | | | | | | | | | | | | | | | a | b | c | d | Rx bid={0,1,2,3}, decode
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 4
| | | | | | | | | | | | | | | | | a | b | c | d | e | f | g | h | Rx bid={0,1,2,3}, decode
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 4
|
|<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>| frame A
| |<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>| frame B
@ decoding from here
== rx_tchf_fn(): TCH/F14.4, TCH/F9.6, TCH/F4.8
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 4
| | | | | | | | | | | | | | | | | | | | | a | b | c | d | Rx bid={0,1,2,3}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 4
| | | | | | | | | | | | | | | | | a | b | c | d | e | f | g | h | Rx bid={0,1,2,3}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 4
| | | | | | | | | | | | | a | b | c | d | e | f | g | h | i | j | k | l | Rx bid={0,1,2,3}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 4
| | | | | | | | | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | Rx bid={0,1,2,3}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 4
| | | | | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | Rx bid={0,1,2,3}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 4
| a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | Rx bid={0,1,2,3}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 4
|
|<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>| frame A
| |<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>| frame B
@ decoding from here
== rx_tchh_fn(): TCH/HS, TCH/AHS
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | | | | | a | b | | | Rx bid={0,1}, decode
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | | | a | b | c | d | | | Rx bid={0,1}, decode
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | a | b | c | d | e | f | | | Rx bid={0,1}, decode
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
|
|<~~~~~~~~~~~~~>| frame A
| |<~~~~~~~~~~~~~>| frame B
@ decoding from here
== rx_tchh_fn(): FACCH/H
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | | | | | a | b | | | Rx bid={0,1}, decode
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | | | a | b | c | d | | | Rx bid={0,1}
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | a | b | c | d | e | f | | | Rx bid={0,1}, decode
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+ << 2
|
|<~~~~~~~~~~~~~~~~~~~~~>| frame A
| |<~~~~~~~~~~~~~~~~~~~~~>| frame B
@ decoding from here
== rx_tchh_fn(): TCH/H4.8, TCH/H2.4
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | | | | | a | b | | | Rx bid={0,1}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | | | a | b | c | d | | | Rx bid={0,1}
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | | | a | b | c | d | e | f | | | Rx bid={0,1}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | | | a | b | c | d | e | f | g | h | | | Rx bid={0,1}
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | | | a | b | c | d | e | f | g | h | i | j | | | Rx bid={0,1}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | | | a | b | c | d | e | f | g | h | i | j | k | l | | | Rx bid={0,1}
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | | | a | b | c | d | e | f | g | h | i | j | k | l | m | n | | | Rx bid={0,1}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | | | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | | | Rx bid={0,1}
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | | | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | | | Rx bid={0,1}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| | | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | | | Rx bid={0,1}
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
| a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | | | Rx bid={0,1}, decode
|---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ << 2
|
|<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>| frame A
| |<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>| frame B
@ decoding from here

View File

@@ -1,40 +1,5 @@
noinst_HEADERS = \ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h measurement.h \
abis.h \ oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \
abis_osmo.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \
asci.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \
bts.h \ dtx_dl_amr_fsm.h
bts_model.h \
bts_shutdown_fsm.h \
bts_sm.h \
bts_trx.h \
gsm_data.h \
logging.h \
measurement.h \
oml.h \
paging.h \
rsl.h \
rtp_input_preen.h \
signal.h \
vty.h \
amr.h \
pcu_if.h \
pcuif_proto.h \
handover.h \
msg_utils.h \
tx_power.h \
control_if.h \
cbch.h \
csd_rlp.h \
csd_v110.h \
l1sap.h \
lchan.h \
power_control.h \
scheduler.h \
scheduler_backend.h \
phy_link.h \
dtx_dl_amr_fsm.h \
ta_control.h \
nm_common_fsm.h \
notification.h \
osmux.h \
$(NULL)

View File

@@ -6,15 +6,19 @@
#include <osmo-bts/gsm_data.h> #include <osmo-bts/gsm_data.h>
enum abis_link_fsm_event { #define OML_RETRY_TIMER 5
ABIS_LINK_EV_SIGN_LINK_OML_UP, #define OML_PING_TIMER 20
ABIS_LINK_EV_SIGN_LINK_DOWN,
ABIS_LINK_EV_VTY_RM_ADDR, /* data: struct bsc_oml_host* being removed */ enum {
LINK_STATE_IDLE = 0,
LINK_STATE_RETRYING,
LINK_STATE_CONNECTING,
LINK_STATE_CONNECT,
}; };
void abis_init(struct gsm_bts *bts); void abis_init(struct gsm_bts *bts);
int abis_open(struct gsm_bts *bts, char *model_name); struct e1inp_line *abis_open(struct gsm_bts *bts, char *dst_host,
char *model_name);
int abis_oml_sendmsg(struct msgb *msg); int abis_oml_sendmsg(struct msgb *msg);

View File

@@ -1,10 +0,0 @@
#pragma once
#include <osmocom/core/msgb.h>
#include <osmo-bts/pcuif_proto.h>
struct gsm_bts;
int down_osmo(struct gsm_bts *bts, struct msgb *msg);
int abis_osmo_pcu_tx_container(struct gsm_bts *bts, const struct gsm_pcu_if_container *container);

View File

@@ -14,6 +14,5 @@ int amr_parse_mr_conf(struct amr_multirate_conf *amr_mrc,
void amr_set_mode_pref(uint8_t *data, const struct amr_multirate_conf *amr_mrc, void amr_set_mode_pref(uint8_t *data, const struct amr_multirate_conf *amr_mrc,
uint8_t cmi, uint8_t cmr); uint8_t cmi, uint8_t cmr);
unsigned int amr_get_initial_mode(struct gsm_lchan *lchan); unsigned int amr_get_initial_mode(struct gsm_lchan *lchan);
void amr_init_mr_conf_def(struct gsm_lchan *lchan);
#endif /* _OSMO_BTS_AMR_H */ #endif /* _OSMO_BTS_AMR_H */

View File

@@ -1,43 +0,0 @@
#pragma once
#include <stdint.h>
#include <osmo-bts/lchan.h>
enum {
VGCS_TALKER_NONE = 0,
VGCS_TALKER_WAIT_FRAME,
VGCS_TALKER_ACTIVE,
};
void vgcs_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay, uint32_t fn);
void vgcs_lchan_activate(struct gsm_lchan *lchan);
void vgcs_lchan_react(struct gsm_lchan *lchan);
void vgcs_talker_frame(struct gsm_lchan *lchan);
void vgcs_talker_reset(struct gsm_lchan *lchan, bool ul_access);
void vgcs_listener_reset(struct gsm_lchan *lchan);
static inline bool vgcs_is_uplink_free(struct gsm_lchan *lchan)
{
return lchan->asci.uplink_free;
}
static inline void vgcs_uplink_free_get(struct gsm_lchan *lchan, uint8_t *msg)
{
memcpy(msg, lchan->asci.uplink_free_msg, GSM_MACBLOCK_LEN);
}
static inline void vgcs_uplink_free_set(struct gsm_lchan *lchan, uint8_t *msg)
{
memcpy(lchan->asci.uplink_free_msg, msg, GSM_MACBLOCK_LEN);
lchan->asci.uplink_free = true;
}
static inline void vgcs_uplink_free_reset(struct gsm_lchan *lchan)
{
lchan->asci.uplink_free = false;
}

View File

@@ -2,13 +2,7 @@
#define _BTS_H #define _BTS_H
#include <osmocom/core/rate_ctr.h> #include <osmocom/core/rate_ctr.h>
#include <osmocom/core/socket.h>
#include <osmo-bts/gsm_data.h> #include <osmo-bts/gsm_data.h>
#include <osmo-bts/bts_trx.h>
#include <osmo-bts/osmux.h>
struct gsm_bts_trx;
enum bts_global_status { enum bts_global_status {
BTS_STATUS_RF_ACTIVE, BTS_STATUS_RF_ACTIVE,
@@ -19,449 +13,51 @@ enum bts_global_status {
enum { enum {
BTS_CTR_PAGING_RCVD, BTS_CTR_PAGING_RCVD,
BTS_CTR_PAGING_DROP, BTS_CTR_PAGING_DROP,
BTS_CTR_PAGING_DROP_PS,
BTS_CTR_PAGING_SENT, BTS_CTR_PAGING_SENT,
BTS_CTR_PAGING_CONG,
BTS_CTR_RACH_RCVD, BTS_CTR_RACH_RCVD,
BTS_CTR_RACH_DROP, BTS_CTR_RACH_DROP,
BTS_CTR_RACH_HO, BTS_CTR_RACH_HO,
BTS_CTR_RACH_VGCS,
BTS_CTR_RACH_CS, BTS_CTR_RACH_CS,
BTS_CTR_RACH_PS, BTS_CTR_RACH_PS,
BTS_CTR_AGCH_RCVD, BTS_CTR_AGCH_RCVD,
BTS_CTR_AGCH_SENT, BTS_CTR_AGCH_SENT,
BTS_CTR_AGCH_DELETED, BTS_CTR_AGCH_DELETED,
BTS_CTR_RTP_RX_TOTAL,
BTS_CTR_RTP_RX_MARKER,
BTS_CTR_RTP_RX_DROP_PREEN,
BTS_CTR_RTP_RX_DROP_LOOPBACK,
BTS_CTR_RTP_RX_DROP_OVERFLOW,
BTS_CTR_RTP_RX_DROP_V110_DEC,
BTS_CTR_RTP_TX_TOTAL,
BTS_CTR_RTP_TX_MARKER,
}; };
/* Used by OML layer for BTS Attribute reporting */
enum bts_attribute {
BTS_TYPE_VARIANT,
BTS_SUB_MODEL,
TRX_PHY_VERSION,
};
const char *btsatttr2str(enum bts_attribute v);
enum gsm_bts_type_variant {
BTS_UNKNOWN,
BTS_OSMO_LITECELL15,
BTS_OSMO_OC2G,
BTS_OSMO_OCTPHY,
BTS_OSMO_SYSMO,
BTS_OSMO_TRX,
BTS_OSMO_VIRTUAL,
BTS_OSMO_OMLDUMMY,
_NUM_BTS_VARIANT
};
const char *btsvariant2str(enum gsm_bts_type_variant v);
enum bts_impl_flag {
/* TODO: add a brief description of this flag */
BTS_INTERNAL_FLAG_MS_PWR_CTRL_DSP,
/* When this flag is set then the measurement data is included in
* (PRIM_PH_DATA) and struct ph_tch_param (PRIM_TCH). Otherwise the
* measurement data is passed using a separate MPH INFO MEAS IND.
* (See also ticket: OS#2977) */
BTS_INTERNAL_FLAG_MEAS_PAYLOAD_COMB,
/* Whether the BTS model requires RadioCarrier MO to be in Enabled state
* (OPSTARTed) before OPSTARTing the RadioChannel MOs. See OS#5157 */
BTS_INTERNAL_FLAG_NM_RCHANNEL_DEPENDS_RCARRIER,
/* Whether the BTS model reports interference measurements to L1SAP. */
BTS_INTERNAL_FLAG_INTERF_MEAS,
_BTS_INTERNAL_FLAG_NUM, /* must be at the end */
};
/* BTS implementation flags (internal use, not exposed via OML) */
#define bts_internal_flag_get(bts, flag) \
((bts->flags & (typeof(bts->flags))(1 << flag)) != 0)
#define bts_internal_flag_set(bts, flag) \
bts->flags |= (typeof(bts->flags))(1 << flag)
struct gprs_rlc_cfg {
uint16_t parameter[_NUM_RLC_PAR];
struct {
uint16_t repeat_time; /* ms */
uint8_t repeat_count;
} paging;
uint32_t cs_mask; /* bitmask of gprs_cs */
uint8_t initial_cs;
uint8_t initial_mcs;
};
struct bts_smscb_state {
struct llist_head queue; /* list of struct smscb_msg */
int queue_len;
struct rate_ctr_group *ctrs;
struct smscb_msg *cur_msg; /* current SMS-CB */
struct smscb_msg *default_msg; /* default broadcast message; NULL if none */
};
/* Tx power filtering algorithm */
enum bts_pf_algo {
BTS_PF_ALGO_NONE = 0,
BTS_PF_ALGO_EWMA,
};
/* UL/DL power control parameters */
struct bts_power_ctrl_params {
/* Target value to strive to */
int target_dbm;
/* Tolerated deviation from target */
int hysteresis_db;
/* How many dB do we raise power at maximum */
int raise_step_max_db;
/* How many dB do we lower power at maximum */
int lower_step_max_db;
/* RxLev filtering algorithm */
enum bts_pf_algo pf_algo;
/* (Optional) filtering parameters */
union {
/* Exponentially Weighted Moving Average */
struct {
/* Smoothing factor: higher the value - less smoothing */
uint8_t alpha; /* 1 .. 99 (in %) */
} ewma;
} pf;
};
/* GPRS CELL; ip.access specific NM Object */
struct gsm_gprs_cell {
struct gsm_abis_mo mo;
uint16_t bvci;
uint8_t timer[11];
struct gprs_rlc_cfg rlc_cfg;
struct {
uint32_t gprs_codings; /* see NM_IPAC_F_GPRS_CODING_* flags */
} support;
};
/* Struct that holds one OML-Address (Address of the BSC) */
struct bsc_oml_host {
struct llist_head list;
char *addr;
};
#define BTS_PCU_SOCK_WQUEUE_LEN_DEFAULT 100
/* One BTS */
struct gsm_bts {
/* list header in g_bts_sm->bts_list */
struct llist_head list;
/* number of the BTS in network */
uint8_t nr;
/* human readable name / description */
char *description;
/* Cell Identity */
uint16_t cell_identity;
/* location area code of this BTS */
uint16_t location_area_code;
/* Base Station Identification Code (BSIC), lower 3 bits is BCC,
* which is used as TSC for the CCCH */
uint8_t bsic;
bool bsic_configured;
/* type of BTS */
enum gsm_bts_type_variant variant;
enum gsm_band band;
char version[MAX_VERSION_LENGTH];
char sub_model[MAX_VERSION_LENGTH];
/* public features of a given BTS (set/reported via OML) */
struct bitvec *features;
/* implementation flags of a given BTS (not exposed via OML) */
uint16_t flags;
/* Connected PCU version (if any) */
char pcu_version[MAX_VERSION_LENGTH];
/* maximum Tx power that the MS is permitted to use in this cell */
int ms_max_power;
/* how do we talk OML with this TRX? */
struct e1inp_sign_link *oml_link;
struct timespec oml_conn_established_timestamp;
/* OSMO extenion link associated to same line as oml_link: */
struct e1inp_sign_link *osmo_link;
/* Abis network management O&M handle */
struct gsm_abis_mo mo;
/* number of this BTS on given E1 link */
uint8_t bts_nr;
/* DTX features of this BTS */
bool dtxd;
/* CCCH is on C0 */
struct gsm_bts_trx *c0;
struct gsm_bts_sm *site_mgr;
/* bitmask of all SI that are present/valid in si_buf */
uint32_t si_valid;
/* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */
uint8_t si2q_index; /* distinguish individual SI2quater messages */
uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */
/* buffers where we put the pre-computed SI */
sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM];
/* offsets used while generating SI2quater */
size_t e_offset;
size_t u_offset;
/* decoded SI rest octets - *unmodified* as received from BSC */
struct osmo_gsm48_si_ro_info si3_ro_decoded;
struct osmo_gsm48_si_ro_info si4_ro_decoded;
/* is SI GPRS Indicator currently disabled due to lack of PCU connection? */
bool si_gprs_ind_disabled;
/* ip.access Unit ID's have Site/BTS/TRX layout */
union {
struct {
uint16_t site_id;
uint16_t bts_id;
uint32_t flags;
uint32_t rsl_ip;
} ip_access;
};
/* Not entirely sure how ip.access specific this is */
struct {
struct gsm_gprs_cell cell;
uint8_t rac;
} gprs;
/* transceivers */
int num_trx;
struct llist_head trx_list;
struct rate_ctr_group *ctrs;
bool supp_meas_toa256;
struct {
/* Interference Boundaries for OML */
int16_t boundary[6];
uint8_t intave;
} interference;
uint32_t t200_fn[7];
unsigned int t3105_ms;
unsigned int t3115_ms; /* VGCS UPLINK GRANT repeat timer */
struct {
uint8_t overload_period;
struct {
/* Input parameters from OML */
uint8_t load_ind_thresh; /* percent */
uint8_t load_ind_period; /* seconds */
/* Internal data */
struct osmo_timer_list timer;
unsigned int pch_total;
unsigned int pch_used;
} ccch;
struct {
/* Input parameters from OML */
int16_t busy_thresh; /* in dBm */
uint16_t averaging_slots;
/* Internal data */
unsigned int total; /* total nr */
unsigned int busy; /* above busy_thresh */
unsigned int access; /* access bursts */
} rach;
} load;
uint8_t ny1;
uint8_t ny2; /* maximum number of repetitions for the VGCS UPLINK GRANT */
uint8_t max_ta;
/* AGCH queuing */
struct {
struct llist_head queue;
int length;
int max_length;
int thresh_level; /* Cleanup threshold in percent of max len */
int low_level; /* Low water mark in percent of max len */
int high_level; /* High water mark in percent of max len */
/* TODO: Use a rate counter group instead */
uint64_t dropped_msgs;
uint64_t merged_msgs;
uint64_t rejected_msgs;
uint64_t agch_msgs;
uint64_t pch_msgs;
} agch_queue;
struct {
uint8_t *prim_notif; /* ETWS primary notification (NULL if none) */
ssize_t prim_notif_len; /* Length of prim_notif; expected 56 bytes */
uint8_t page_size;
uint8_t num_pages; /* total number of pages */
uint8_t next_page; /* next page number to be sent */
bool pni; /* Primary Notification Identifier */
} etws;
/* Advanced Speech Call Items (VBS/VGCS) + NCH related bits */
struct {
int pos_nch; /* position of the NCH or < 0, if not available */
uint8_t nln, nln_status; /* current notification list number and status */
struct llist_head notifications;
int notification_entries; /* current number of entries in the list */
int notification_count; /* counter to count all entries */
} asci;
struct paging_state *paging_state;
struct llist_head bsc_oml_hosts;
unsigned int rtp_jitter_buf_ms;
bool rtp_jitter_adaptive;
uint16_t rtp_port_range_start;
uint16_t rtp_port_range_end;
uint16_t rtp_port_range_next;
int rtp_ip_dscp;
int rtp_priority;
bool rtp_nogaps_mode; /* emit RTP stream without any gaps */
bool use_ul_ecu; /* "rtp internal-uplink-ecu" option */
bool emit_hr_rfc5993;
struct {
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
uint8_t max_ta; /* maximum timing advance */
} support;
struct {
uint8_t tc4_ctr;
} si;
struct gsm_time gsm_time;
/* frame number statistics (FN in PH-RTS.ind vs. PH-DATA.ind */
struct {
int32_t min; /* minimum observed */
int32_t max; /* maximum observed */
int32_t avg256; /* accumulator */
uint32_t avg_count; /* number of samples accumulated in avg256 */
uint32_t avg_window; /* number of averages in avg_count */
} fn_stats;
/* Radio Link Timeout counter. -1 disables timeout for
* lab/measurement purpose */
struct {
int oml; /* value communicated by BSC in OML */
int current; /* actual currently applied value */
bool vty_override; /* OML value overridden by VTY */
} radio_link_timeout;
/* Default (fall-back) Dynamic Power Control parameters for all transceivers */
struct gsm_power_ctrl_params bs_dpc_params; /* BS Dynamic Power Control */
struct gsm_power_ctrl_params ms_dpc_params; /* MS Dynamic Power Control */
/* Maximum BCCH carrier power reduction */
uint8_t c0_power_red_db;
/* used by the sysmoBTS to adjust band */
uint8_t auto_band;
/* State for SMSCB (Cell Broadcast) for BASIC and EXTENDED channel */
struct bts_smscb_state smscb_basic;
struct bts_smscb_state smscb_extended;
int smscb_queue_tgt_len; /* ideal/target queue length */
int smscb_queue_max_len; /* maximum queue length */
int smscb_queue_hyst; /* hysteresis for CBCH load indications */
int16_t min_qual_rach; /* minimum link quality (in centiBels) for Access Bursts */
int16_t min_qual_norm; /* minimum link quality (in centiBels) for Normal Bursts */
uint16_t max_ber10k_rach; /* Maximum permitted RACH BER in 0.01% */
struct {
char *sock_path;
unsigned int sock_wqueue_len_max;
} pcu;
/* GSMTAP Um logging (disabled by default) */
struct {
struct gsmtap_inst *inst;
char *remote_host;
char *local_host;
uint32_t sapi_mask;
uint8_t sapi_acch;
bool rlp;
bool rlp_skip_null;
} gsmtap;
struct osmux_state osmux;
struct osmo_fsm_inst *shutdown_fi; /* FSM instance to manage shutdown procedure during process exit */
bool shutdown_fi_exit_proc; /* exit process when shutdown_fsm is finished? */
bool shutdown_fi_skip_power_ramp; /* Skip power ramping and change power in one step? */
struct osmo_fsm_inst *abis_link_fi; /* FSM instance to manage abis connection during process startup and link failure */
struct osmo_tdef *T_defs; /* Timer defines */
void *model_priv; /* Allocated by bts_model, contains model specific data pointer */
};
extern const struct value_string bts_impl_flag_desc[];
extern void *tall_bts_ctx; extern void *tall_bts_ctx;
#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i])
#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i))
#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0])
static inline struct gsm_bts *gsm_gprs_cell_get_bts(struct gsm_gprs_cell *cell)
{
return (struct gsm_bts *)container_of(cell, struct gsm_bts, gprs.cell);
}
struct gsm_bts *gsm_bts_alloc(struct gsm_bts_sm *bts_sm, uint8_t bts_num);
struct gsm_bts *gsm_bts_num(const struct gsm_bts_sm *bts_sm, int num);
int bts_init(struct gsm_bts *bts); int bts_init(struct gsm_bts *bts);
int bts_trx_init(struct gsm_bts_trx *trx);
void bts_shutdown(struct gsm_bts *bts, const char *reason); void bts_shutdown(struct gsm_bts *bts, const char *reason);
void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc, bool skip_power_ramp);
int bts_link_estab(struct gsm_bts *bts); int bts_link_estab(struct gsm_bts *bts);
int trx_link_estab(struct gsm_bts_trx *trx);
int trx_set_available(struct gsm_bts_trx *trx, int avail);
int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg); int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg);
struct msgb *bts_agch_dequeue(struct gsm_bts *bts);
int bts_agch_max_queue_length(int T, int bcch_conf); int bts_agch_max_queue_length(int T, int bcch_conf);
int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
int is_ag_res);
enum ccch_msgt {
CCCH_MSGT_AGCH,
CCCH_MSGT_PCH,
CCCH_MSGT_NCH,
};
int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt, enum ccch_msgt ccch);
int bts_supports_cipher(struct gsm_bts *bts, int rsl_cipher);
uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time); uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time);
void regenerate_si3_restoctets(struct gsm_bts *bts); void regenerate_si3_restoctets(struct gsm_bts *bts);
void regenerate_si4_restoctets(struct gsm_bts *bts); uint8_t *lchan_sacch_get(struct gsm_lchan *lchan);
int get_si4_ro_offset(const uint8_t *si4_buf); int lchan_init_lapdm(struct gsm_lchan *lchan);
void load_timer_start(struct gsm_bts *bts); void load_timer_start(struct gsm_bts *bts);
void load_timer_stop(struct gsm_bts *bts); uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg);
bool load_timer_is_running(const struct gsm_bts *bts);
void bts_update_status(enum bts_global_status which, int on); void bts_update_status(enum bts_global_status which, int on);
bool trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx);
struct gsm_time *get_time(struct gsm_bts *bts); struct gsm_time *get_time(struct gsm_bts *bts);
int bts_main(int argc, char **argv); int bts_main(int argc, char **argv);
bool bts_supports_cm(const struct gsm_bts *bts, int bts_supports_cm(struct gsm_bts *bts, enum gsm_phys_chan_config pchan,
const struct rsl_ie_chan_mode *cm); enum gsm48_chan_mode cm);
int32_t bts_get_avg_fn_advance(const struct gsm_bts *bts); int32_t bts_get_avg_fn_advance(struct gsm_bts *bts);
/* return the gsm_lchan for the CBCH (if it exists at all) */
struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts);
int bts_set_c0_pwr_red(struct gsm_bts *bts, const uint8_t red);
/* Context information to be put in the control buffer (db) of the AGCH msg
* buffer */
struct bts_agch_msg_cb {
uint32_t msg_id;
bool confirm;
} __attribute__ ((packed));
#endif /* _BTS_H */ #endif /* _BTS_H */

View File

@@ -5,7 +5,6 @@
#include <osmocom/gsm/tlv.h> #include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/gsm_utils.h> #include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmo-bts/gsm_data.h> #include <osmo-bts/gsm_data.h>
@@ -21,8 +20,8 @@ int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type,
struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr,
void *obj); void *obj);
int bts_model_apply_oml(struct gsm_bts *bts, const struct msgb *msg, int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg,
struct gsm_abis_mo *mo, void *obj); struct tlv_parsed *new_attr, int obj_kind, void *obj);
int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
void *obj); void *obj);
@@ -31,20 +30,17 @@ int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo,
void *obj, uint8_t adm_state); void *obj, uint8_t adm_state);
int bts_model_trx_deact_rf(struct gsm_bts_trx *trx); int bts_model_trx_deact_rf(struct gsm_bts_trx *trx);
int bts_model_trx_close(struct gsm_bts_trx *trx);
/* Implementation should call bts_model_trx_close_cb when done */ int bts_model_vty_init(struct gsm_bts *bts);
void bts_model_trx_close(struct gsm_bts_trx *trx);
int bts_model_vty_init(void *ctx); void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts);
void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx);
void bts_model_config_write_bts(struct vty *vty, const struct gsm_bts *bts); void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink);
void bts_model_config_write_trx(struct vty *vty, const struct gsm_bts_trx *trx); void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst);
void bts_model_config_write_phy(struct vty *vty, const struct phy_link *plink);
void bts_model_config_write_phy_inst(struct vty *vty, const struct phy_instance *pinst);
int bts_model_oml_estab(struct gsm_bts *bts); int bts_model_oml_estab(struct gsm_bts *bts);
/* Implementation should call power_trx_change_compl() to confirm power change applied */
int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm); int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm);
int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan); int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan);
@@ -66,10 +62,4 @@ void bts_model_phy_instance_set_defaults(struct phy_instance *pinst);
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts); int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts);
void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan); void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan);
/* BTS model specific implementations are expected to call these functions as a
* response to some of the APIs above:
*/
void bts_model_trx_close_cb(struct gsm_bts_trx *trx, int rc);
#endif #endif

View File

@@ -1,43 +0,0 @@
/* BTS shutdown FSM */
/* (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
* Author: Pau Espin Pedrol <pespin@sysmocom.de>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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/>.
*
*/
#pragma once
#include <osmocom/core/fsm.h>
enum bts_shutdown_fsm_states {
BTS_SHUTDOWN_ST_NONE,
BTS_SHUTDOWN_ST_WAIT_RAMP_DOWN_COMPL,
BTS_SHUTDOWN_ST_WAIT_TRX_CLOSED,
BTS_SHUTDOWN_ST_EXIT,
};
enum bts_shutdown_fsm_events {
BTS_SHUTDOWN_EV_START,
BTS_SHUTDOWN_EV_TRX_RAMP_COMPL,
BTS_SHUTDOWN_EV_TRX_CLOSED,
};
extern struct osmo_fsm bts_shutdown_fsm;
struct gsm_bts;
bool bts_shutdown_in_progress(const struct gsm_bts *bts);

View File

@@ -1,48 +0,0 @@
#pragma once
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/socket.h>
#include <osmocom/gsm/gsm23003.h>
#include <osmo-bts/oml.h>
struct pcu_sock_state;
/* GPRS NSVC; ip.access specific NM Object */
struct gsm_gprs_nse;
struct gsm_gprs_nsvc {
struct gsm_abis_mo mo;
struct gsm_gprs_nse *nse;
/* data read via VTY config file, to configure the BTS
* via OML from BSC */
int id;
uint16_t nsvci;
struct osmo_sockaddr local; /* on the BTS */
struct osmo_sockaddr remote; /* on the SGSN */
};
/* GPRS NSE; ip.access specific NM Object */
struct gsm_gprs_nse {
struct gsm_abis_mo mo;
uint16_t nsei;
uint8_t timer[7];
struct gsm_gprs_nsvc nsvc[2];
};
struct gsm_bts *gsm_gprs_nse_get_bts(const struct gsm_gprs_nse *nse);
/* BTS Site Manager */
struct gsm_bts_sm {
struct gsm_abis_mo mo;
struct llist_head bts_list;
unsigned int num_bts;
struct osmo_plmn_id plmn;
struct {
struct pcu_sock_state *pcu_state;
struct gsm_gprs_nse nse;
} gprs;
};
extern struct gsm_bts_sm *g_bts_sm;
struct gsm_bts_sm *gsm_bts_sm_alloc(void *talloc_ctx);

View File

@@ -1,74 +0,0 @@
#pragma once
#include <osmocom/core/sockaddr_str.h>
#include <osmo-bts/gsm_data.h>
struct gsm_bts_bb_trx {
struct gsm_abis_mo mo;
/* how do we talk RSL with this TRX? */
struct {
struct osmo_sockaddr_str rem_addrstr;
uint8_t tei;
struct e1inp_sign_link *link;
} rsl;
};
/* One TRX in a BTS */
struct gsm_bts_trx {
/* list header in bts->trx_list */
struct llist_head list;
struct gsm_bts *bts;
/* number of this TRX in the BTS */
uint8_t nr;
/* human readable name / description */
char *description;
/* NM Radio Carrier and Baseband Transciever */
struct gsm_abis_mo mo;
struct gsm_bts_bb_trx bb_transc;
uint16_t arfcn;
int nominal_power; /* in dBm */
unsigned int max_power_red; /* in actual dB */
uint8_t max_power_backoff_8psk; /* in actual dB OC-2G only */
uint8_t c0_idle_power_red; /* in actual dB OC-2G only */
uint8_t ta_ctrl_interval; /* 1 step is 2 SACCH periods */
struct trx_power_params power_params;
struct gsm_power_ctrl_params *bs_dpc_params; /* BS Dynamic Power Control */
struct gsm_power_ctrl_params *ms_dpc_params; /* MS Dynamic Power Control */
bool ms_pwr_ctl_soft; /* is power control loop done by osmocom software? */
/* The associated PHY instance */
struct phy_instance *pinst;
struct {
uint32_t freq_bands; /* see NM_IPAC_F_FREQ_BAND_* flags */
uint32_t chan_types; /* see NM_IPAC_F_CHANT_* flags */
uint32_t chan_modes; /* see NM_IPAC_F_CHANM_* flags */
} support;
struct gsm_bts_trx_ts ts[TRX_NR_TS];
};
static inline struct gsm_bts_trx *gsm_bts_bb_trx_get_trx(struct gsm_bts_bb_trx *bb_transc) {
return (struct gsm_bts_trx *)container_of(bb_transc, struct gsm_bts_trx, bb_transc);
}
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
void gsm_bts_trx_init_shadow_ts(struct gsm_bts_trx *trx);
void gsm_bts_trx_free_shadow_ts(struct gsm_bts_trx *trx);
char *gsm_trx_name(const struct gsm_bts_trx *trx);
const char *gsm_trx_unit_id(struct gsm_bts_trx *trx);
int trx_link_estab(struct gsm_bts_trx *trx);
void trx_operability_update(struct gsm_bts_trx *trx);
uint8_t num_agch(const struct gsm_bts_trx *trx, const char * arg);
int pos_nch(const struct gsm_bts_trx *trx, const char *arg);
bool trx_ms_pwr_ctrl_is_osmo(const struct gsm_bts_trx *trx);
#define LOGPTRX(trx, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_trx_name(trx), ## args)

View File

@@ -21,5 +21,3 @@ int bts_process_smscb_cmd(struct gsm_bts *bts, struct rsl_ie_cb_cmd_type cmd_typ
/* call-back from bts model specific code when it wants to obtain a CBCH /* call-back from bts model specific code when it wants to obtain a CBCH
* block for a given gsm_time. outbuf must have 23 bytes of space. */ * block for a given gsm_time. outbuf must have 23 bytes of space. */
int bts_cbch_get(struct gsm_bts *bts, uint8_t *outbuf, struct gsm_time *g_time); int bts_cbch_get(struct gsm_bts *bts, uint8_t *outbuf, struct gsm_time *g_time);
void bts_cbch_reset(struct gsm_bts *bts);

View File

@@ -1,4 +1,5 @@
#pragma once #pragma once
int bts_ctrl_cmds_install(struct gsm_bts *bts); int bts_ctrl_cmds_install(struct gsm_bts *bts);
struct ctrl_handle *bts_controlif_setup(struct gsm_bts *bts, uint16_t port); struct ctrl_handle *bts_controlif_setup(struct gsm_bts *bts,
const char *bind_addr, uint16_t port);

View File

@@ -1,36 +0,0 @@
/*
* Declarations for functions in csd_rlp.c: alignment of downlink RLP frames
* and RLP GSMTAP mechanism for CSD NT modes.
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <osmocom/core/bits.h>
#include <osmocom/gsm/l1sap.h>
#include <osmo-bts/lchan.h>
extern const uint8_t csd_tchf48_nt_e2_map[26];
/* Per TS 48.020 section 15.1, the cadence of E2+E3 bits in a properly
* aligned sequence of pseudo-V.110 frames forming a single RLP frame
* is 00-01-10-11. The following constant captures this bit sequence
* in hex, for comparison against align_bits output from
* csd_v110_rtp_decode() or against rlpdl_align_bits accumulator
* in CSD NT lchan state.
*/
#define NTCSD_ALIGNED_EBITS 0x1B
void ntcsd_dl_reset(struct gsm_lchan *lchan);
void ntcsd_dl_input_48(struct gsm_lchan *lchan, const ubit_t *data_bits,
uint8_t align_bits);
void ntcsd_dl_input_96(struct gsm_lchan *lchan, const ubit_t *data_bits,
uint8_t align_bits);
bool ntcsd_dl_output(struct gsm_lchan *lchan, ubit_t *rlp_frame_out);
void gsmtap_csd_rlp_process(struct gsm_lchan *lchan, bool is_uplink,
const struct ph_tch_param *tch_ind,
const ubit_t *data, unsigned int data_len);
void gsmtap_csd_rlp_dl(struct gsm_lchan *lchan, uint32_t fn,
const ubit_t *data, unsigned int data_len);

View File

@@ -1,24 +0,0 @@
#pragma once
/* RFC4040 "clearmode" RTP payload length */
#define RFC4040_RTP_PLEN 160
struct gsm_lchan;
struct csd_v110_lchan_desc {
uint16_t num_frames; /* number of V.110 frames in a radio block */
uint16_t num_frame_bits; /* number of bits in each V.110 frame */
uint16_t num_other_bits; /* number of other bits (e.g. M-bits for TCH/F14.4) */
uint8_t ra2_ir; /* intermediate rate (8 or 16 kbit/s) for RA2 step */
};
extern const struct csd_v110_lchan_desc csd_v110_lchan_desc[256];
#define CSD_V110_NUM_BITS(desc) \
((desc)->num_frames * (desc)->num_frame_bits + (desc)->num_other_bits)
int csd_v110_rtp_encode(const struct gsm_lchan *lchan, uint8_t *rtp,
const uint8_t *data, size_t data_len,
uint8_t nt48_half_num);
int csd_v110_rtp_decode(const struct gsm_lchan *lchan, uint8_t *data,
uint8_t *align_bits, const uint8_t *rtp, size_t rtp_len);

View File

@@ -1,33 +1,13 @@
#ifndef _GSM_DATA_H #ifndef _GSM_DATA_H
#define _GSM_DATA_H #define _GSM_DATA_H
#include <stdbool.h>
#include <stdint.h>
#include <osmocom/core/timer.h> #include <osmocom/core/timer.h>
#include <osmocom/core/bitvec.h>
#include <osmocom/core/statistics.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/linuxlist.h> #include <osmocom/core/linuxlist.h>
#include <osmocom/core/tdef.h> #include <osmocom/gsm/lapdm.h>
#include <osmocom/gsm/gsm23003.h> #include <osmocom/gsm/gsm23003.h>
#include <osmocom/gsm/gsm0502.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/rxlev_stat.h>
#include <osmocom/gsm/sysinfo.h>
#include <osmocom/gsm/bts_features.h>
#include <osmocom/gsm/gsm48_rest_octets.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/abis/e1_input.h>
#include <osmo-bts/paging.h> #include <osmo-bts/paging.h>
#include <osmo-bts/tx_power.h> #include <osmo-bts/tx_power.h>
#include <osmo-bts/oml.h>
#include <osmo-bts/lchan.h>
#define GSM_FR_BITS 260 #define GSM_FR_BITS 260
#define GSM_EFR_BITS 244 #define GSM_EFR_BITS 244
@@ -36,209 +16,45 @@
#define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ #define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */
#define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ #define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */
#define GSM_SUPERFRAME (26*51) /* 1326 TDMA frames */
#define GSM_HYPERFRAME (2048*GSM_SUPERFRAME) /* GSM_HYPERFRAME frames */
#define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DEFAULT 41 #define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DEFAULT 41
#define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DISABLE 999999 #define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DISABLE 999999
#define GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT 41 #define GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT 41
#define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91 #define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91
#define LOGPLCHAN(lchan, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_lchan_name(lchan), ## args)
/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: struct gsm_network {
4-bit index is used (2#1111 = 10#15) */ struct llist_head bts_list;
#define SI2Q_MAX_NUM 16 unsigned int num_bts;
/* length in bits (for single SI2quater message) */ struct osmo_plmn_id plmn;
#define SI2Q_MAX_LEN 160 struct pcu_sock_state *pcu_state;
#define SI2Q_MIN_LEN 18
/* lchans 0..3 are SDCCH in combined channel configuration,
use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
#define CCCH_LCHAN 4
#define CBCH_LCHAN 2
#define TRX_NR_TS 8
#define TS_MAX_LCHAN 8
#define MAX_VERSION_LENGTH 64
/* NM_IPAC_F_CHANT_* mask for NM_IPAC_EIE_CHAN_TYPES (common) */
#define NM_IPAC_MASK_CHANT_COMMON \
(NM_IPAC_F_CHANT_TCHF | \
NM_IPAC_F_CHANT_TCHH | \
NM_IPAC_F_CHANT_SDCCH8 | \
NM_IPAC_F_CHANT_BCCH | \
NM_IPAC_F_CHANT_BCCH_SDCCH4)
/* NM_IPAC_F_CHANM_SPEECH_* mask for NM_IPAC_EIE_CHAN_MODES */
#define NM_IPAC_MASK_CHANM_SPEECH \
(NM_IPAC_F_CHANM_SPEECH_FS | \
NM_IPAC_F_CHANM_SPEECH_EFS | \
NM_IPAC_F_CHANM_SPEECH_AFS | \
NM_IPAC_F_CHANM_SPEECH_HS | \
NM_IPAC_F_CHANM_SPEECH_AHS)
/* NM_IPAC_F_CHANM_CSD_NT_* mask for NM_IPAC_EIE_CHAN_MODES */
#define NM_IPAC_MASK_CHANM_CSD_NT \
(NM_IPAC_F_CHANM_CSD_NT_4k8 | \
NM_IPAC_F_CHANM_CSD_NT_9k6 | \
NM_IPAC_F_CHANM_CSD_NT_14k4)
/* NM_IPAC_F_CHANM_CSD_T_* mask for NM_IPAC_EIE_CHAN_MODES */
#define NM_IPAC_MASK_CHANM_CSD_T \
(NM_IPAC_F_CHANM_CSD_T_1200_75 | \
NM_IPAC_F_CHANM_CSD_T_600 | \
NM_IPAC_F_CHANM_CSD_T_1k2 | \
NM_IPAC_F_CHANM_CSD_T_2k4 | \
NM_IPAC_F_CHANM_CSD_T_4k8 | \
NM_IPAC_F_CHANM_CSD_T_9k6 | \
NM_IPAC_F_CHANM_CSD_T_14k4)
/* NM_IPAC_F_GPRS_CODING_CS[1-4] mask for NM_IPAC_EIE_GPRS_CODING */
#define NM_IPAC_MASK_GPRS_CODING_CS \
(NM_IPAC_F_GPRS_CODING_CS1 | \
NM_IPAC_F_GPRS_CODING_CS2 | \
NM_IPAC_F_GPRS_CODING_CS3 | \
NM_IPAC_F_GPRS_CODING_CS4)
/* NM_IPAC_F_GPRS_CODING_MCS[1-9] mask for NM_IPAC_EIE_GPRS_CODING */
#define NM_IPAC_MASK_GPRS_CODING_MCS \
(NM_IPAC_F_GPRS_CODING_MCS1 | \
NM_IPAC_F_GPRS_CODING_MCS2 | \
NM_IPAC_F_GPRS_CODING_MCS3 | \
NM_IPAC_F_GPRS_CODING_MCS4 | \
NM_IPAC_F_GPRS_CODING_MCS5 | \
NM_IPAC_F_GPRS_CODING_MCS6 | \
NM_IPAC_F_GPRS_CODING_MCS7 | \
NM_IPAC_F_GPRS_CODING_MCS8 | \
NM_IPAC_F_GPRS_CODING_MCS9)
enum gsm_bts_trx_ts_flags {
TS_F_PDCH_ACTIVE = 0x1000,
TS_F_PDCH_ACT_PENDING = 0x2000,
TS_F_PDCH_DEACT_PENDING = 0x4000,
TS_F_PDCH_PENDING_MASK = 0x6000 /*<
TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */
}; };
/* One Timeslot in a TRX */ enum lchan_ciph_state {
struct gsm_bts_trx_ts { LCHAN_CIPH_NONE,
struct gsm_bts_trx *trx; LCHAN_CIPH_RX_REQ,
/* number of this timeslot at the TRX */ LCHAN_CIPH_RX_CONF,
uint8_t nr; LCHAN_CIPH_RXTX_REQ,
LCHAN_CIPH_RX_CONF_TX_REQ,
enum gsm_phys_chan_config pchan; LCHAN_CIPH_RXTX_CONF,
struct {
enum gsm_phys_chan_config pchan_is;
enum gsm_phys_chan_config pchan_want;
} dyn;
unsigned int flags;
struct gsm_abis_mo mo;
/* Training Sequence Code (range 0..7) */
uint8_t tsc_oml; /* configured via OML */
bool tsc_oml_configured;
uint8_t tsc_rsl; /* configured via RSL (Osmo extension) */
bool tsc_rsl_configured;
uint8_t tsc; /* TSC currently in use. Preference: RSL, OML, BTS-BSIC-OML */
/* Training Sequence Set (range 0..3) */
uint8_t tsc_set;
/* Actual BCCH carrier power reduction */
uint8_t c0_power_red_db;
/* Frequency hopping parameters (configured via OML) */
struct {
bool enabled;
uint8_t maio;
uint8_t hsn;
uint16_t arfcn_list[64];
uint8_t arfcn_num;
} hopping;
/* Transceiver "cache" for frequency hopping */
const struct gsm_bts_trx *fh_trx_list[64];
/* Implementation specific structure(s) */
void *priv;
/* VAMOS specific fields */
struct {
/* NULL if BTS_FEAT_VAMOS is not set */
struct gsm_bts_trx_ts *peer;
bool is_shadow;
} vamos;
struct gsm_lchan lchan[TS_MAX_LCHAN];
}; };
enum gprs_rlc_par { #include <osmo-bts/gsm_data_shared.h>
RLC_T3142,
RLC_T3169,
RLC_T3191,
RLC_T3193,
RLC_T3195,
RLC_N3101,
RLC_N3103,
RLC_N3105,
CV_COUNTDOWN,
T_DL_TBF_EXT, /* ms */
T_UL_TBF_EXT, /* ms */
_NUM_RLC_PAR
};
enum gprs_cs {
GPRS_CS1,
GPRS_CS2,
GPRS_CS3,
GPRS_CS4,
GPRS_MCS1,
GPRS_MCS2,
GPRS_MCS3,
GPRS_MCS4,
GPRS_MCS5,
GPRS_MCS6,
GPRS_MCS7,
GPRS_MCS8,
GPRS_MCS9,
_NUM_GRPS_CS
};
/* The amount of time within which a sudden disconnect of a newly established
* OML connection will cause a special warning to be logged. */
#define OSMO_BTS_OML_CONN_EARLY_DISCONNECT 10 /* in seconds */
extern struct osmo_tdef_group bts_tdef_groups[];
extern struct osmo_tdef bts_T_defs[];
extern struct osmo_tdef abis_T_defs[];
extern const struct value_string gsm_pchant_names[13];
extern const struct value_string gsm_pchant_descs[13];
const char *gsm_pchan_name(enum gsm_phys_chan_config c);
const char *gsm_lchant_name(enum gsm_chan_t c);
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
#define GSM_TS_NAME_FMT \
"bts=%u,trx=%u,ts=%u" "%s"
#define GSM_TS_NAME_ARGS(ts) \
(ts)->trx->bts->nr, (ts)->trx->nr, (ts)->nr, \
(ts)->vamos.is_shadow ? ",shadow" : ""
#define BSIC2BCC(bsic) ((bsic) & 0x07)
#define BTS_TSC(bts) BSIC2BCC((bts)->bsic)
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
int *rc);
enum gsm_phys_chan_config ts_pchan(const struct gsm_bts_trx_ts *ts);
uint8_t ts_subslots(const struct gsm_bts_trx_ts *ts);
bool ts_is_tch(const struct gsm_bts_trx_ts *ts);
void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state);
int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts, int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts,
enum gsm_phys_chan_config pchan); enum gsm_phys_chan_config pchan);
/* cipher code */ /* cipher code */
#define CIPHER_A5(x) (1 << (x-1)) #define CIPHER_A5(x) (1 << (x-1))
int bts_supports_cipher(struct gsm_bts *bts, int rsl_cipher);
bool ts_is_pdch(const struct gsm_bts_trx_ts *ts); bool ts_is_pdch(const struct gsm_bts_trx_ts *ts);
void gsm_ts_apply_configured_tsc(struct gsm_bts_trx_ts *ts); int bts_model_check_cm_mode(enum gsm_phys_chan_config pchan, enum gsm48_chan_mode cm);
void gsm_ts_release(struct gsm_bts_trx_ts *ts);
#endif /* _GSM_DATA_H */ #endif /* _GSM_DATA_H */

View File

@@ -0,0 +1,871 @@
#ifndef _GSM_DATA_SHAREDH
#define _GSM_DATA_SHAREDH
#include <regex.h>
#include <stdbool.h>
#include <stdint.h>
#include <osmocom/codec/ecu.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/bitvec.h>
#include <osmocom/core/statistics.h>
#include <osmocom/core/utils.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/rxlev_stat.h>
#include <osmocom/gsm/sysinfo.h>
#include <osmocom/gsm/meas_rep.h>
#include <osmocom/gsm/gsm48_rest_octets.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/abis/e1_input.h>
#include <osmocom/gsm/lapdm.h>
/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1:
4-bit index is used (2#1111 = 10#15) */
#define SI2Q_MAX_NUM 16
/* length in bits (for single SI2quater message) */
#define SI2Q_MAX_LEN 160
#define SI2Q_MIN_LEN 18
/* Channel Request reason */
enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_EMERG,
GSM_CHREQ_REASON_PAG,
GSM_CHREQ_REASON_CALL,
GSM_CHREQ_REASON_LOCATION_UPD,
GSM_CHREQ_REASON_OTHER,
GSM_CHREQ_REASON_PDCH,
};
/* lchans 0..3 are SDCCH in combined channel configuration,
use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
#define CCCH_LCHAN 4
#define TRX_NR_TS 8
#define TS_MAX_LCHAN 8
#define HARDCODED_ARFCN 123
#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
/* for multi-drop config */
#define HARDCODED_BTS0_TS 1
#define HARDCODED_BTS1_TS 6
#define HARDCODED_BTS2_TS 11
#define MAX_VERSION_LENGTH 64
#define MAX_BTS_FEATURES 128
enum gsm_hooks {
GSM_HOOK_NM_SWLOAD,
GSM_HOOK_RR_PAGING,
GSM_HOOK_RR_SECURITY,
};
enum bts_gprs_mode {
BTS_GPRS_NONE = 0,
BTS_GPRS_GPRS = 1,
BTS_GPRS_EGPRS = 2,
};
struct gsm_lchan;
struct osmo_rtp_socket;
struct pcu_sock_state;
struct smscb_msg;
/* Network Management State */
struct gsm_nm_state {
uint8_t operational;
uint8_t administrative;
uint8_t availability;
};
struct gsm_abis_mo {
/* A-bis OML Object Class */
uint8_t obj_class;
/* is there still some procedure pending? */
uint8_t procedure_pending;
/* A-bis OML Object Instance */
struct abis_om_obj_inst obj_inst;
/* human-readable name */
const char *name;
/* NM State */
struct gsm_nm_state nm_state;
/* Attributes configured in this MO */
struct tlv_parsed *nm_attr;
/* BTS to which this MO belongs */
struct gsm_bts *bts;
};
#define MAX_A5_KEY_LEN (128/8)
#define A38_XOR_MIN_KEY_LEN 12
#define A38_XOR_MAX_KEY_LEN 16
#define A38_COMP128_KEY_LEN 16
#define RSL_ENC_ALG_A5(x) (x+1)
#define MAX_EARFCN_LIST 32
/* is the data link established? who established it? */
#define LCHAN_SAPI_UNUSED 0
#define LCHAN_SAPI_MS 1
#define LCHAN_SAPI_NET 2
#define LCHAN_SAPI_REL 3
/* state of a logical channel */
enum gsm_lchan_state {
LCHAN_S_NONE, /* channel is not active */
LCHAN_S_ACT_REQ, /* channel activation requested */
LCHAN_S_ACTIVE, /* channel is active and operational */
LCHAN_S_REL_REQ, /* channel release has been requested */
LCHAN_S_REL_ERR, /* channel is in an error state */
LCHAN_S_BROKEN, /* channel is somehow unusable */
LCHAN_S_INACTIVE, /* channel is set inactive */
};
/* BTS ONLY */
#define MAX_NUM_UL_MEAS 104
#define LC_UL_M_F_L1_VALID (1 << 0)
#define LC_UL_M_F_RES_VALID (1 << 1)
#define LC_UL_M_F_OSMO_EXT_VALID (1 << 2)
struct bts_ul_meas {
/* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */
uint16_t ber10k;
/* timing advance offset (in 1/256 bits) */
int16_t ta_offs_256bits;
/* C/I ratio in dB */
float c_i;
/* flags */
uint8_t is_sub:1;
/* RSSI in dBm * -1 */
uint8_t inv_rssi;
};
struct bts_codec_conf {
uint8_t hr;
uint8_t efr;
uint8_t amr;
};
struct amr_mode {
uint8_t mode;
uint8_t threshold;
uint8_t hysteresis;
};
struct amr_multirate_conf {
uint8_t gsm48_ie[2];
struct amr_mode ms_mode[4];
struct amr_mode bts_mode[4];
uint8_t num_modes;
};
/* /BTS ONLY */
enum lchan_csd_mode {
LCHAN_CSD_M_NT,
LCHAN_CSD_M_T_1200_75,
LCHAN_CSD_M_T_600,
LCHAN_CSD_M_T_1200,
LCHAN_CSD_M_T_2400,
LCHAN_CSD_M_T_9600,
LCHAN_CSD_M_T_14400,
LCHAN_CSD_M_T_29000,
LCHAN_CSD_M_T_32000,
};
/* State of the SAPIs in the lchan */
enum lchan_sapi_state {
LCHAN_SAPI_S_NONE,
LCHAN_SAPI_S_REQ,
LCHAN_SAPI_S_ASSIGNED,
LCHAN_SAPI_S_REL,
LCHAN_SAPI_S_ERROR,
};
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
/* The logical subslot number in the TS */
uint8_t nr;
/* The logical channel type */
enum gsm_chan_t type;
/* RSL channel mode */
enum rsl_cmod_spd rsl_cmode;
/* If TCH, traffic channel mode */
enum gsm48_chan_mode tch_mode;
enum lchan_csd_mode csd_mode;
/* State */
enum gsm_lchan_state state;
const char *broken_reason;
/* Encryption information */
struct {
uint8_t alg_id;
uint8_t key_len;
uint8_t key[MAX_A5_KEY_LEN];
} encr;
/* AMR bits */
uint8_t mr_bts_lv[7];
/* Established data link layer services */
int sacch_deact;
struct {
uint32_t bound_ip;
uint32_t connect_ip;
uint16_t bound_port;
uint16_t connect_port;
uint16_t conn_id;
uint8_t rtp_payload;
uint8_t rtp_payload2;
uint8_t speech_mode;
struct osmo_rtp_socket *rtp_socket;
} abis_ip;
uint8_t rqd_ta;
char *name;
/* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23.
* Currently we don't share these headers so this is a magic number. */
struct llist_head sapi_cmds;
uint8_t sapis_dl[23];
uint8_t sapis_ul[23];
struct lapdm_channel lapdm_ch;
struct llist_head dl_tch_queue;
struct {
/* bitmask of all SI that are present/valid in si_buf */
uint32_t valid;
/* bitmask of all SI that do not mirror the BTS-global SI values */
uint32_t overridden;
uint32_t last;
/* buffers where we put the pre-computed SI:
SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */
sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM];
} si;
struct {
uint8_t flags;
/* RSL measurement result number, 0 at lchan_act */
uint8_t res_nr;
/* current Tx power level of the BTS */
uint8_t bts_tx_pwr;
/* number of measurements stored in array below */
uint8_t num_ul_meas;
struct bts_ul_meas uplink[MAX_NUM_UL_MEAS];
/* last L1 header from the MS */
uint8_t l1_info[2];
struct gsm_meas_rep_unidir ul_res;
int16_t ms_toa256;
/* Frame number of the last measurement indication receceived */
uint32_t last_fn;
/* Osmocom extended measurement results, see LC_UL_M_F_EXTD_VALID */
struct {
/* minimum value of toa256 during measurement period */
int16_t toa256_min;
/* maximum value of toa256 during measurement period */
int16_t toa256_max;
/* standard deviation of toa256 value during measurement period */
uint16_t toa256_std_dev;
} ext;
} meas;
struct {
struct amr_multirate_conf amr_mr;
struct {
struct osmo_fsm_inst *dl_amr_fsm;
/* TCH cache */
uint8_t cache[20];
/* FACCH cache */
uint8_t facch[GSM_MACBLOCK_LEN];
uint8_t len;
uint32_t fn;
bool is_update;
/* set for each SID frame to detect talkspurt for codecs
without explicit ONSET event */
bool ul_sid;
/* indicates if DTXd was active during DL measurement
period */
bool dl_active;
/* last UL SPEECH resume flag */
bool is_speech_resume;
} dtx;
uint8_t last_cmr;
uint32_t last_fn;
} tch;
/* 3GPP TS 48.058 § 9.3.37: [0; 255] ok, -1 means invalid*/
int16_t ms_t_offs;
/* 3GPP TS 45.010 § 1.2 round trip propagation delay (in symbols) or -1 */
int16_t p_offs;
/* BTS-side ciphering state (rx only, bi-directional, ...) */
uint8_t ciph_state;
uint8_t ciph_ns;
uint8_t loopback;
struct {
uint8_t active;
uint8_t ref;
/* T3105: PHYS INF retransmission */
struct osmo_timer_list t3105;
/* counts up to Ny1 */
unsigned int phys_info_count;
} ho;
/* S counter for link loss */
int s;
/* Kind of the release/activation. E.g. RSL or PCU */
int rel_act_kind;
/* RTP header Marker bit to indicate beginning of speech after pause */
bool rtp_tx_marker;
/* power handling */
struct {
uint8_t current;
uint8_t max;
bool fixed;
} ms_power_ctrl;
/* Power levels for BTS */
uint8_t bs_power;
struct msgb *pending_rel_ind_msg;
/* ECU (Error Concealment Unit) state */
struct osmo_ecu_state *ecu_state;
};
static inline uint8_t lchan_get_ta(const struct gsm_lchan *lchan)
{
return lchan->meas.l1_info[1];
}
extern const struct value_string lchan_ciph_state_names[];
static inline const char *lchan_ciph_state_name(uint8_t state) {
return get_value_string(lchan_ciph_state_names, state);
}
enum gsm_bts_trx_ts_flags {
TS_F_PDCH_ACTIVE = 0x1000,
TS_F_PDCH_ACT_PENDING = 0x2000,
TS_F_PDCH_DEACT_PENDING = 0x4000,
TS_F_PDCH_PENDING_MASK = 0x6000 /*<
TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */
};
/* One Timeslot in a TRX */
struct gsm_bts_trx_ts {
struct gsm_bts_trx *trx;
/* number of this timeslot at the TRX */
uint8_t nr;
enum gsm_phys_chan_config pchan;
struct {
enum gsm_phys_chan_config pchan_is;
enum gsm_phys_chan_config pchan_want;
struct msgb *pending_chan_activ;
} dyn;
unsigned int flags;
struct gsm_abis_mo mo;
struct tlv_parsed nm_attr;
uint8_t nm_chan_comb;
int tsc; /* -1 == use BTS TSC */
struct {
/* Parameters below are configured by VTY */
int enabled;
uint8_t maio;
uint8_t hsn;
struct bitvec arfcns;
uint8_t arfcns_data[1024/8];
/* This is the pre-computed MA for channel assignments */
struct bitvec ma;
uint8_t ma_len; /* part of ma_data that is used */
uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
} hopping;
struct gsm_lchan lchan[TS_MAX_LCHAN];
};
/* One TRX in a BTS */
struct gsm_bts_trx {
/* list header in bts->trx_list */
struct llist_head list;
struct gsm_bts *bts;
/* number of this TRX in the BTS */
uint8_t nr;
/* human readable name / description */
char *description;
/* how do we talk RSL with this TRX? */
uint8_t rsl_tei;
struct e1inp_sign_link *rsl_link;
/* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
struct e1inp_sign_link *oml_link;
struct gsm_abis_mo mo;
struct tlv_parsed nm_attr;
struct {
struct gsm_abis_mo mo;
} bb_transc;
uint16_t arfcn;
int nominal_power; /* in dBm */
unsigned int max_power_red; /* in actual dB */
uint8_t max_power_backoff_8psk; /* in actual dB OC-2G only */
uint8_t c0_idle_power_red; /* in actual dB OC-2G only */
struct trx_power_params power_params;
bool ms_pwr_ctl_soft; /* is power control loop done by osmocom software? */
struct {
void *l1h;
} role_bts;
union {
struct {
unsigned int test_state;
uint8_t test_nr;
struct rxlev_stats rxlev_stat;
} ipaccess;
};
struct gsm_bts_trx_ts ts[TRX_NR_TS];
};
#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i])
#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i))
#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0])
#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0])
enum gsm_bts_type_variant {
BTS_UNKNOWN,
BTS_OSMO_LITECELL15,
BTS_OSMO_OC2G,
BTS_OSMO_OCTPHY,
BTS_OSMO_SYSMO,
BTS_OSMO_TRX,
BTS_OSMO_VIRTUAL,
BTS_OSMO_OMLDUMMY,
_NUM_BTS_VARIANT
};
/* Used by OML layer for BTS Attribute reporting */
enum bts_attribute {
BTS_TYPE_VARIANT,
BTS_SUB_MODEL,
TRX_PHY_VERSION,
};
struct vty;
/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility
with BTS compiled against earlier version of this header. Also make sure that the description strings
gsm_bts_features_descs[] in gsm_data_shared.c are also updated accordingly! */
enum gsm_bts_features {
BTS_FEAT_HSCSD,
BTS_FEAT_GPRS,
BTS_FEAT_EGPRS,
BTS_FEAT_ECSD,
BTS_FEAT_HOPPING,
BTS_FEAT_MULTI_TSC,
BTS_FEAT_OML_ALERTS,
BTS_FEAT_AGCH_PCH_PROP,
BTS_FEAT_CBCH,
BTS_FEAT_SPEECH_F_V1,
BTS_FEAT_SPEECH_H_V1,
BTS_FEAT_SPEECH_F_EFR,
BTS_FEAT_SPEECH_F_AMR,
BTS_FEAT_SPEECH_H_AMR,
BTS_FEAT_ETWS_PN,
BTS_FEAT_MS_PWR_CTRL_DSP,
_NUM_BTS_FEAT
};
extern const struct value_string gsm_bts_features_descs[];
struct gsm_bts_gprs_nsvc {
struct gsm_bts *bts;
/* data read via VTY config file, to configure the BTS
* via OML from BSC */
int id;
uint16_t nsvci;
uint16_t local_port; /* on the BTS */
uint16_t remote_port; /* on the SGSN */
uint32_t remote_ip; /* on the SGSN */
struct gsm_abis_mo mo;
};
enum gprs_rlc_par {
RLC_T3142,
RLC_T3169,
RLC_T3191,
RLC_T3193,
RLC_T3195,
RLC_N3101,
RLC_N3103,
RLC_N3105,
CV_COUNTDOWN,
T_DL_TBF_EXT, /* ms */
T_UL_TBF_EXT, /* ms */
_NUM_RLC_PAR
};
enum gprs_cs {
GPRS_CS1,
GPRS_CS2,
GPRS_CS3,
GPRS_CS4,
GPRS_MCS1,
GPRS_MCS2,
GPRS_MCS3,
GPRS_MCS4,
GPRS_MCS5,
GPRS_MCS6,
GPRS_MCS7,
GPRS_MCS8,
GPRS_MCS9,
_NUM_GRPS_CS
};
struct gprs_rlc_cfg {
uint16_t parameter[_NUM_RLC_PAR];
struct {
uint16_t repeat_time; /* ms */
uint8_t repeat_count;
} paging;
uint32_t cs_mask; /* bitmask of gprs_cs */
uint8_t initial_cs;
uint8_t initial_mcs;
};
struct bts_smscb_state {
struct llist_head queue; /* list of struct smscb_msg */
int queue_len;
struct rate_ctr_group *ctrs;
struct smscb_msg *cur_msg; /* current SMS-CB */
struct smscb_msg *default_msg; /* default broadcast message; NULL if none */
};
/* The amount of time within which a sudden disconnect of a newly established
* OML connection will cause a special warning to be logged. */
#define OSMO_BTS_OML_CONN_EARLY_DISCONNECT 10 /* in seconds */
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
struct llist_head list;
/* number of the BTS in network */
uint8_t nr;
/* human readable name / description */
char *description;
/* Cell Identity */
uint16_t cell_identity;
/* location area code of this BTS */
uint16_t location_area_code;
/* Base Station Identification Code (BSIC), lower 3 bits is BCC,
* which is used as TSC for the CCCH */
uint8_t bsic;
/* type of BTS */
enum gsm_bts_type_variant variant;
enum gsm_band band;
char version[MAX_VERSION_LENGTH];
char sub_model[MAX_VERSION_LENGTH];
/* features of a given BTS set/reported via OML */
struct bitvec features;
uint8_t _features_data[MAX_BTS_FEATURES/8];
/* Connected PCU version (if any) */
char pcu_version[MAX_VERSION_LENGTH];
/* maximum Tx power that the MS is permitted to use in this cell */
int ms_max_power;
/* how do we talk OML with this TRX? */
uint8_t oml_tei;
struct e1inp_sign_link *oml_link;
struct timespec oml_conn_established_timestamp;
/* Abis network management O&M handle */
struct abis_nm_h *nmh;
struct gsm_abis_mo mo;
/* number of this BTS on given E1 link */
uint8_t bts_nr;
/* DTX features of this BTS */
enum gsm48_dtx_mode dtxu;
bool dtxd;
/* CCCH is on C0 */
struct gsm_bts_trx *c0;
struct {
struct gsm_abis_mo mo;
} site_mgr;
/* bitmask of all SI that are present/valid in si_buf */
uint32_t si_valid;
/* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */
uint8_t si2q_index; /* distinguish individual SI2quater messages */
uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */
/* buffers where we put the pre-computed SI */
sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM];
/* offsets used while generating SI2quater */
size_t e_offset;
size_t u_offset;
/* decoded SI3 rest octets - *unmodified* as received from BSC */
struct osmo_gsm48_si_ro_info si3_ro_decoded;
/* is SI3 GPRS Indicator currently disabled due to lack of PCU connection? */
bool si3_gprs_ind_disabled;
/* ip.access Unit ID's have Site/BTS/TRX layout */
union {
struct {
uint16_t site_id;
uint16_t bts_id;
uint32_t flags;
uint32_t rsl_ip;
} ip_access;
};
/* Not entirely sure how ip.access specific this is */
struct {
uint8_t supports_egprs_11bit_rach;
enum bts_gprs_mode mode;
struct {
struct gsm_abis_mo mo;
uint16_t nsei;
uint8_t timer[7];
} nse;
struct {
struct gsm_abis_mo mo;
uint16_t bvci;
uint8_t timer[11];
struct gprs_rlc_cfg rlc_cfg;
} cell;
struct gsm_bts_gprs_nsvc nsvc[2];
uint8_t rac;
uint8_t net_ctrl_ord;
bool ctrl_ack_type_use_block;
} gprs;
/* RACH NM values */
int rach_b_thresh;
int rach_ldavg_slots;
/* transceivers */
int num_trx;
struct llist_head trx_list;
/* SI related items */
int force_combined_si;
int bcch_change_mark;
struct rate_ctr_group *ctrs;
bool supp_meas_toa256;
struct {
/* Interference Boundaries for OML */
int16_t boundary[6];
uint8_t intave;
} interference;
unsigned int t200_ms[7];
unsigned int t3105_ms;
struct {
uint8_t overload_period;
struct {
/* Input parameters from OML */
uint8_t load_ind_thresh; /* percent */
uint8_t load_ind_period; /* seconds */
/* Internal data */
struct osmo_timer_list timer;
unsigned int pch_total;
unsigned int pch_used;
} ccch;
struct {
/* Input parameters from OML */
int16_t busy_thresh; /* in dBm */
uint16_t averaging_slots;
/* Internal data */
unsigned int total; /* total nr */
unsigned int busy; /* above busy_thresh */
unsigned int access; /* access bursts */
} rach;
} load;
uint8_t ny1;
uint8_t max_ta;
/* AGCH queuing */
struct {
struct llist_head queue;
int length;
int max_length;
int thresh_level; /* Cleanup threshold in percent of max len */
int low_level; /* Low water mark in percent of max len */
int high_level; /* High water mark in percent of max len */
/* TODO: Use a rate counter group instead */
uint64_t dropped_msgs;
uint64_t merged_msgs;
uint64_t rejected_msgs;
uint64_t agch_msgs;
uint64_t pch_msgs;
} agch_queue;
struct {
uint8_t *prim_notif; /* ETWS primary notification (NULL if none) */
ssize_t prim_notif_len; /* Length of prim_notif; expected 56 bytes */
uint8_t page_size;
uint8_t num_pages; /* total number of pages */
uint8_t next_page; /* next page number to be sent */
bool pni; /* Primary Notification Identifier */
} etws;
struct paging_state *paging_state;
char *bsc_oml_host;
struct llist_head oml_queue;
unsigned int rtp_jitter_buf_ms;
bool rtp_jitter_adaptive;
uint16_t rtp_port_range_start;
uint16_t rtp_port_range_end;
uint16_t rtp_port_range_next;
struct {
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
} support;
struct {
uint8_t tc4_ctr;
} si;
struct gsm_time gsm_time;
/* frame number statistics (FN in PH-RTS.ind vs. PH-DATA.ind */
struct {
int32_t min; /* minimum observed */
int32_t max; /* maximum observed */
int32_t avg256; /* accumulator */
uint32_t avg_count; /* number of samples accumulated in avg256 */
uint32_t avg_window; /* number of averages in avg_count */
} fn_stats;
/* Radio Link Timeout counter. -1 disables timeout for
* lab/measurement purpose */
int radio_link_timeout;
int ul_power_target; /* Uplink Rx power target */
/* used by the sysmoBTS to adjust band */
uint8_t auto_band;
/* State for SMSCB (Cell Broadcast) for BASIC and EXTENDED channel */
struct bts_smscb_state smscb_basic;
struct bts_smscb_state smscb_extended;
int smscb_queue_tgt_len; /* ideal/target queue length */
int smscb_queue_max_len; /* maximum queue length */
int smscb_queue_hyst; /* hysteresis for CBCH load indications */
int16_t min_qual_rach; /* minimum link quality (in centiBels) for Access Bursts */
int16_t min_qual_norm; /* minimum link quality (in centiBels) for Normal Bursts */
uint16_t max_ber10k_rach; /* Maximum permitted RACH BER in 0.01% */
struct {
char *sock_path;
} pcu;
void *model_priv; /* Allocated by bts_model, contains model specific data pointer */
};
struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num);
struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
enum bts_attribute str2btsattr(const char *s);
const char *btsatttr2str(enum bts_attribute v);
enum gsm_bts_type_variant str2btsvariant(const char *arg);
const char *btsvariant2str(enum gsm_bts_type_variant v);
extern const struct value_string gsm_chreq_descs[];
extern const struct value_string gsm_pchant_names[13];
extern const struct value_string gsm_pchant_descs[13];
const char *gsm_pchan_name(enum gsm_phys_chan_config c);
enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
const char *gsm_lchant_name(enum gsm_chan_t c);
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
char *gsm_trx_name(const struct gsm_bts_trx *trx);
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
char *gsm_lchan_name_compute(const struct gsm_lchan *lchan);
const char *gsm_lchans_name(enum gsm_lchan_state s);
static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
{
return lchan->name;
}
static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat)
{
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
return bitvec_set_bit_pos(&bts->features, feat, 1);
}
static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat)
{
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
return bitvec_get_bit_pos(&bts->features, feat);
}
void gsm_abis_mo_reset(struct gsm_abis_mo *mo);
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);
void *
gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
const struct abis_om_obj_inst *obj_inst);
uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
enum gsm_phys_chan_config as_pchan);
/* return the gsm_lchan for the CBCH (if it exists at all) */
struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts);
/*
* help with parsing regexps
*/
int gsm_parse_reg(void *ctx, regex_t *reg, char **str,
int argc, const char **argv) __attribute__ ((warn_unused_result));
#define BSIC2BCC(bsic) ((bsic) & 0x3)
static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
{
if (ts->tsc != -1)
return ts->tsc;
else
return ts->trx->bts->bsic & 7;
}
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
int *rc);
enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts);
uint8_t ts_subslots(struct gsm_bts_trx_ts *ts);
bool ts_is_tch(struct gsm_bts_trx_ts *ts);
const char *gsm_trx_unit_id(struct gsm_bts_trx *trx);
int lchan2ecu_codec(const struct gsm_lchan *lchan);
#endif

View File

@@ -4,8 +4,6 @@
#include <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_08_58.h> #include <osmocom/gsm/protocol/gsm_08_58.h>
#define L1SAP_MSGB_HEADROOM 128
/* lchan link ID */ /* lchan link ID */
#define LID_SACCH 0x40 #define LID_SACCH 0x40
#define LID_DEDIC 0x00 #define LID_DEDIC 0x00
@@ -21,11 +19,9 @@
#define L1SAP_IS_LINK_SACCH(link_id) \ #define L1SAP_IS_LINK_SACCH(link_id) \
((link_id & 0xC0) == LID_SACCH) ((link_id & 0xC0) == LID_SACCH)
#define L1SAP_IS_CHAN_TCHF(chan_nr) \ #define L1SAP_IS_CHAN_TCHF(chan_nr) \
((chan_nr & 0xf8) == RSL_CHAN_Bm_ACCHs || \ ((chan_nr & 0xf8) == RSL_CHAN_Bm_ACCHs)
(chan_nr & 0xf8) == RSL_CHAN_OSMO_VAMOS_Bm_ACCHs)
#define L1SAP_IS_CHAN_TCHH(chan_nr) \ #define L1SAP_IS_CHAN_TCHH(chan_nr) \
((chan_nr & 0xf0) == RSL_CHAN_Lm_ACCHs || \ ((chan_nr & 0xf0) == RSL_CHAN_Lm_ACCHs)
(chan_nr & 0xf0) == RSL_CHAN_OSMO_VAMOS_Lm_ACCHs)
#define L1SAP_IS_CHAN_SDCCH4(chan_nr) \ #define L1SAP_IS_CHAN_SDCCH4(chan_nr) \
((chan_nr & 0xe0) == RSL_CHAN_SDCCH4_ACCH) ((chan_nr & 0xe0) == RSL_CHAN_SDCCH4_ACCH)
#define L1SAP_IS_CHAN_SDCCH8(chan_nr) \ #define L1SAP_IS_CHAN_SDCCH8(chan_nr) \
@@ -41,9 +37,6 @@
#define L1SAP_IS_CHAN_CBCH(chan_nr) \ #define L1SAP_IS_CHAN_CBCH(chan_nr) \
((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH4) \ ((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH4) \
|| ((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH8) || ((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH8)
#define L1SAP_IS_CHAN_VAMOS(chan_nr) \
((chan_nr & 0xf8) == RSL_CHAN_OSMO_VAMOS_Bm_ACCHs || \
(chan_nr & 0xf0) == RSL_CHAN_OSMO_VAMOS_Lm_ACCHs)
/* rach type from ra */ /* rach type from ra */
#define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f) #define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f)
@@ -98,11 +91,10 @@ void l1sap_rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl,
uint32_t timestamp, bool marker); uint32_t timestamp, bool marker);
/* channel control */ /* channel control */
int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr); int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed *tp);
int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr); int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr);
int l1sap_chan_deact_sacch(struct gsm_bts_trx *trx, uint8_t chan_nr); int l1sap_chan_deact_sacch(struct gsm_bts_trx *trx, uint8_t chan_nr);
int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr); int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr);
int l1sap_uplink_access(struct gsm_lchan *lchan, bool active);
enum l1sap_common_sapi { enum l1sap_common_sapi {
L1SAP_COMMON_SAPI_UNKNOWN, L1SAP_COMMON_SAPI_UNKNOWN,
@@ -135,18 +127,20 @@ enum l1sap_common_sapi {
extern uint16_t l1sap_log_ctx_sapi; extern uint16_t l1sap_log_ctx_sapi;
extern const struct value_string l1sap_common_sapi_names[]; extern const struct value_string l1sap_common_sapi_names[];
extern const struct value_string gsmtap_sapi_names[];
extern struct gsmtap_inst *gsmtap;
extern uint32_t gsmtap_sapi_mask;
extern uint8_t gsmtap_sapi_acch;
int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg,
struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn,
uint16_t ber10k, int16_t lqual_cb, int8_t rssi, uint16_t ber10k, int16_t lqual_cb);
int16_t ta_offs, uint8_t is_sub);
#define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h) #define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h)
void radio_link_timeout_reset(struct gsm_lchan *lchan);
int bts_check_for_first_ciphrd(struct gsm_lchan *lchan, int bts_check_for_first_ciphrd(struct gsm_lchan *lchan,
uint8_t *data, int len); uint8_t *data, int len);
enum ccch_msgt get_ccch_msgt(struct gsm_bts_trx *trx, uint32_t fn); int is_ccch_for_agch(struct gsm_bts_trx *trx, uint32_t fn);
#endif /* L1SAP_H */ #endif /* L1SAP_H */

View File

@@ -1,444 +0,0 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <netinet/in.h>
#include <osmocom/core/bits.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/logging.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/codec/codec.h>
#include <osmocom/codec/ecu.h>
#include <osmocom/gsm/lapdm.h>
#include <osmocom/gsm/sysinfo.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/gsm/gsm48_rest_octets.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/meas_rep.h>
#include <osmocom/netif/osmux.h>
#include <osmo-bts/power_control.h>
#define LOGPLCHAN(lchan, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_lchan_name(lchan), ## args)
enum lchan_ciph_state {
LCHAN_CIPH_NONE,
LCHAN_CIPH_RX_REQ,
LCHAN_CIPH_RX_CONF,
LCHAN_CIPH_RXTX_REQ,
LCHAN_CIPH_RX_CONF_TX_REQ,
LCHAN_CIPH_RXTX_CONF,
};
/* state of a logical channel */
enum gsm_lchan_state {
LCHAN_S_NONE, /* channel is not active */
LCHAN_S_ACT_REQ, /* channel activation requested */
LCHAN_S_ACTIVE, /* channel is active and operational */
LCHAN_S_REL_REQ, /* channel release has been requested */
LCHAN_S_REL_ERR, /* channel is in an error state */
LCHAN_S_BROKEN, /* channel is somehow unusable */
};
#define MAX_NUM_UL_MEAS 104
#define LC_UL_M_F_L1_VALID (1 << 0)
#define LC_UL_M_F_RES_VALID (1 << 1)
#define LC_UL_M_F_OSMO_EXT_VALID (1 << 2)
#define MAX_A5_KEY_LEN (128/8)
#define RSL_ENC_ALG_A5(x) (x+1)
struct bts_ul_meas {
/* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */
uint16_t ber10k;
/* timing advance offset (in 1/256 bits) */
int16_t ta_offs_256bits;
/* C/I ratio in cB */
int16_t ci_cb;
/* flags */
uint8_t is_sub:1;
/* RSSI in dBm * -1 */
uint8_t inv_rssi;
};
struct amr_mode {
uint8_t mode;
uint8_t threshold;
uint8_t hysteresis;
};
struct amr_multirate_conf {
uint8_t gsm48_ie[2];
struct amr_mode mode[4];
uint8_t num_modes;
};
enum lchan_csd_mode {
LCHAN_CSD_M_NT = 0,
LCHAN_CSD_M_T_1200_75,
LCHAN_CSD_M_T_600,
LCHAN_CSD_M_T_1200,
LCHAN_CSD_M_T_2400,
LCHAN_CSD_M_T_4800,
LCHAN_CSD_M_T_9600,
LCHAN_CSD_M_T_14400,
LCHAN_CSD_M_T_29000,
LCHAN_CSD_M_T_32000,
_LCHAN_CSD_M_NUM,
};
extern const struct value_string lchan_csd_mode_descs[];
static inline const char *lchan_csd_mode_desc(enum lchan_csd_mode mode)
{
return get_value_string(lchan_csd_mode_descs, mode);
}
/* State of the SAPIs in the lchan */
enum lchan_sapi_state {
LCHAN_SAPI_S_NONE,
LCHAN_SAPI_S_REQ,
LCHAN_SAPI_S_ASSIGNED,
LCHAN_SAPI_S_REL,
LCHAN_SAPI_S_ERROR,
};
/* What kind of release/activation is done? A silent one for
* the PDCH or one triggered through RSL? */
enum lchan_rel_act_kind {
LCHAN_REL_ACT_RSL,
LCHAN_REL_ACT_PCU,
LCHAN_REL_ACT_OML,
LCHAN_REL_ACT_REACT, /* FIXME: remove once auto-activation hack is removed from opstart_compl() (OS#1575) */
};
struct gsm_rep_facch {
struct msgb *msg;
uint32_t fn;
};
struct lchan_power_ctrl_state {
/* Dynamic Power Control parameters (NULL in static mode) */
const struct gsm_power_ctrl_params *dpc_params;
/* Measurement pre-processing state (for dynamic mode) */
struct gsm_power_ctrl_meas_proc_state rxlev_meas_proc;
struct gsm_power_ctrl_meas_proc_state rxqual_meas_proc;
struct gsm_power_ctrl_meas_proc_state ci_meas_proc;
/* Number of SACCH blocks to skip (for dynamic mode) */
int skip_block_num;
/* Depending on the context (MS or BS power control), fields 'current' and 'max'
* reflect either the MS power level (magic numbers), or BS Power reduction level
* (attenuation, in dB). */
uint8_t current;
uint8_t max;
};
struct lchan_ta_ctrl_state {
/* Number of SACCH blocks to skip */
int skip_block_num;
/* Currently requested TA */
uint8_t current;
};
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
/* The logical subslot number in the TS */
uint8_t nr;
/* The logical channel type */
enum gsm_chan_t type;
/* RSL channel rate and type */
enum rsl_cmod_crt rsl_chan_rt;
/* RSL channel mode */
enum rsl_cmod_spd rsl_cmode;
/* If TCH, traffic channel mode */
enum gsm48_chan_mode tch_mode;
enum lchan_csd_mode csd_mode;
/* State */
enum gsm_lchan_state state;
const char *broken_reason;
/* Encryption information */
struct {
uint8_t alg_id;
uint8_t key_len;
uint8_t key[MAX_A5_KEY_LEN];
} encr;
struct {
uint32_t bound_ip;
uint32_t connect_ip;
uint16_t bound_port;
uint16_t connect_port;
uint16_t conn_id;
uint8_t rtp_payload;
uint8_t rtp_payload2;
uint8_t rtp_extensions;
uint8_t speech_mode;
struct {
bool use;
uint8_t local_cid;
uint8_t remote_cid;
/* Rx Osmux -> RTP, one allocated & owned per lchan */
struct osmux_out_handle *out;
/* Tx RTP -> Osmux, shared by all lchans sharing a
* remote endp (addr+port), see "struct osmux_handle" */
struct osmux_in_handle *in;
/* Used to build rtp messages we send to osmux */
struct osmo_rtp_handle *rtpst;
} osmux;
struct osmo_rtp_socket *rtp_socket;
} abis_ip;
char *name;
/* For handover, activation is described in 3GPP TS 48.058 4.1.3 and 4.1.4:
*
* | | Access || transmit | activate
* | MS Power | Delay || on main channel | dl SACCH
* ----------------------------------------------------------------------
* async ho no * --> yes no
* async ho yes * --> yes may be started
* sync ho no no --> yes no
* sync ho yes no --> yes may be started
* sync ho yes yes --> yes shall be started
*
* Always start the main channel immediately.
* want_dl_sacch_active indicates whether dl SACCH should be activated on CHAN ACT.
*/
bool want_dl_sacch_active;
/* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23.
* Currently we don't share these headers so this is a magic number. */
struct llist_head sapi_cmds;
uint8_t sapis_dl[23];
uint8_t sapis_ul[23];
struct lapdm_channel lapdm_ch;
/* It is required to have L3 info with DL establishment. */
bool l3_info_estab;
struct llist_head dl_tch_queue;
unsigned int dl_tch_queue_len;
struct {
/* bitmask of all SI that are present/valid in si_buf */
uint32_t valid;
/* bitmask of all SI that do not mirror the BTS-global SI values */
uint32_t overridden;
uint32_t last;
/* buffers where we put the pre-computed SI:
SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */
sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM];
} si;
struct {
uint8_t flags;
/* RSL measurement result number, 0 at lchan_act */
uint8_t res_nr;
/* number of measurements stored in array below */
uint8_t num_ul_meas;
struct bts_ul_meas uplink[MAX_NUM_UL_MEAS];
/* last L1 header from the MS */
struct rsl_l1_info l1_info;
struct gsm_meas_rep_unidir ul_res;
int16_t ms_toa256;
int16_t ul_ci_cb_full;
int16_t ul_ci_cb_sub;
/* Frame number of the last measurement indication receceived */
uint32_t last_fn;
/* Osmocom extended measurement results, see LC_UL_M_F_EXTD_VALID */
struct {
/* minimum value of toa256 during measurement period */
int16_t toa256_min;
/* maximum value of toa256 during measurement period */
int16_t toa256_max;
/* standard deviation of toa256 value during measurement period */
uint16_t toa256_std_dev;
} ext;
/* Interference levels reported by PHY (in dBm) */
int16_t interf_meas_avg_dbm; /* Average value */
int16_t interf_meas_dbm[31]; /* Intave max is 31 */
uint8_t interf_meas_num;
uint8_t interf_band;
} meas;
struct {
struct amr_multirate_conf amr_mr;
struct {
struct osmo_fsm_inst *dl_amr_fsm;
/* TCH cache */
uint8_t cache[20];
/* FACCH cache */
uint8_t facch[GSM_MACBLOCK_LEN];
uint8_t len;
uint32_t fn;
bool is_update;
/* set for each SID frame to detect talkspurt for codecs
without explicit ONSET event */
bool ul_sid;
/* indicates if DTXd was active during DL measurement
period */
bool dl_active;
/* last UL SPEECH resume flag */
bool is_speech_resume;
} dtx;
struct {
bool last_rtp_input_was_sid;
uint8_t last_sid[GSM_FR_BYTES];
uint8_t last_sid_len;
uint8_t last_sid_age;
/* A SID was transmitted on the DL in the period
* beginning with the last transmitted speech frame
* or the last mandatory-Tx position, whichever was
* more recent. */
bool dl_sid_transmitted;
/* The current frame in the DL is taken up by FACCH */
bool dl_facch_stealing;
/* UL SID filter to catch DTXu half-blocks,
* see tch_ul_fr_hr_efr() function. */
bool ul_sid_filter;
} dtx_fr_hr_efr;
uint8_t last_cmr;
uint32_t last_fn;
struct {
/* RLP GSMTAP mechanism */
uint8_t rlp_buf_ul[576/8]; /* maximum size of RLP frame */
uint8_t rlp_buf_dl[576/8]; /* maximum size of RLP frame */
/* alignment of RLP frames in DL for NT modes */
ubit_t rlpdl_data_bits[60 * 7];
uint16_t rlpdl_align_bits;
uint8_t rlpdl_fill_level;
ubit_t tchf48_nt_2ndhalf[120];
} csd;
} tch;
/* 3GPP TS 48.058 § 9.3.37: [0; 255] ok, -1 means invalid*/
int16_t ms_t_offs;
/* 3GPP TS 45.010 § 1.2 round trip propagation delay (in symbols) or -1 */
int16_t p_offs;
/* BTS-side ciphering state (rx only, bi-directional, ...) */
uint8_t ciph_state;
uint8_t ciph_ns;
uint8_t loopback;
struct {
uint8_t active;
uint8_t ref;
/* T3105: PHYS INF retransmission */
struct osmo_timer_list t3105;
/* counts up to Ny1 */
unsigned int phys_info_count;
} ho;
struct {
bool listener_detected;
uint8_t talker_active;
uint8_t ref;
uint32_t fn;
/* T3115: VGCS UPLINK GRANT retransmission */
struct osmo_timer_list t3115;
/* counts up to Ny2 */
unsigned int vgcs_ul_grant_count;
/* uplink free message */
bool uplink_free;
uint8_t uplink_free_msg[GSM_MACBLOCK_LEN];
} asci;
/* S counter for link loss */
int s;
/* Kind of the release/activation. E.g. RSL or PCU */
enum lchan_rel_act_kind rel_act_kind;
/* Pending RSL CHANnel ACTIVation message */
struct msgb *pending_chan_activ;
/* RTP header Marker bit to indicate beginning of speech after pause */
bool rtp_tx_marker;
/* TA Control Loop */
struct lchan_ta_ctrl_state ta_ctrl;
/* MS/BS power control state */
struct lchan_power_ctrl_state ms_power_ctrl;
struct lchan_power_ctrl_state bs_power_ctrl;
/* MS/BS Dynamic Power Control parameters */
struct gsm_power_ctrl_params ms_dpc_params;
struct gsm_power_ctrl_params bs_dpc_params;
/* Temporary ACCH overpower capabilities and state */
struct abis_rsl_osmo_temp_ovp_acch_cap top_acch_cap;
bool top_acch_active;
struct msgb *pending_rel_ind_msg;
/* ECU (Error Concealment Unit) state */
struct osmo_ecu_state *ecu_state;
/* Repeated ACCH capabilities and current state */
struct abis_rsl_osmo_rep_acch_cap rep_acch_cap;
struct {
bool dl_facch_active;
bool ul_sacch_active;
bool dl_sacch_active;
/* Message buffers to store repeation candidates */
struct gsm_rep_facch dl_facch[2];
struct msgb *dl_sacch_msg;
} rep_acch;
/* Cached early Immediate Assignment message: if the Immediate Assignment arrives before the channel is
* confirmed active, then cache it here and send it once the channel is confirmed to be active. This is related
* to the Early IA feature, see OsmoBSC config option 'immediate-assignment pre-chan-ack'. */
struct msgb *early_rr_ia;
struct osmo_timer_list early_rr_ia_delay;
};
extern const struct value_string lchan_ciph_state_names[];
static inline const char *lchan_ciph_state_name(uint8_t state)
{
return get_value_string(lchan_ciph_state_names, state);
}
#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0])
void gsm_lchan_init(struct gsm_lchan *lchan, struct gsm_bts_trx_ts *ts, unsigned int lchan_nr);
void gsm_lchan_name_update(struct gsm_lchan *lchan);
int lchan_init_lapdm(struct gsm_lchan *lchan);
void gsm_lchan_release(struct gsm_lchan *lchan, enum lchan_rel_act_kind rel_kind);
int lchan_deactivate(struct gsm_lchan *lchan);
const char *gsm_lchans_name(enum gsm_lchan_state s);
static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
{
return lchan->name;
}
uint8_t *lchan_sacch_get(struct gsm_lchan *lchan);
uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
uint8_t gsm_lchan2chan_nr_rsl(const struct gsm_lchan *lchan);
uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
enum gsm_phys_chan_config as_pchan);
void gsm_lchan_interf_meas_push(struct gsm_lchan *lchan, int dbm);
void gsm_lchan_interf_meas_calc_avg(struct gsm_lchan *lchan);
int lchan2ecu_codec(const struct gsm_lchan *lchan);
void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state);
int lchan_rtp_socket_create(struct gsm_lchan *lchan, const char *bind_ip);
int lchan_rtp_socket_connect(struct gsm_lchan *lchan, const struct in_addr *ia, uint16_t connect_port);
void lchan_rtp_socket_free(struct gsm_lchan *lchan);
void lchan_dl_tch_queue_enqueue(struct gsm_lchan *lchan, struct msgb *msg, unsigned int limit);
static inline bool lchan_is_dcch(const struct gsm_lchan *lchan)
{
switch (lchan->type) {
case GSM_LCHAN_SDCCH:
case GSM_LCHAN_TCH_F:
case GSM_LCHAN_TCH_H:
return true;
default:
return false;
}
}
#define lchan_is_tch(lchan) \
((lchan)->type == GSM_LCHAN_TCH_F || (lchan)->type == GSM_LCHAN_TCH_H)

View File

@@ -20,8 +20,7 @@ enum {
DLOOP, DLOOP,
DABIS, DABIS,
DRTP, DRTP,
DOSMUX, DSUM,
DASCI,
}; };
extern const struct log_info bts_log_info; extern const struct log_info bts_log_info;
@@ -38,12 +37,4 @@ extern const struct log_info bts_log_info;
#define DEBUGPFN(ss, fn, fmt, args...) \ #define DEBUGPFN(ss, fn, fmt, args...) \
LOGP(ss, LOGL_DEBUG, "%s " fmt, gsm_fn_as_gsmtime_str(fn), ## args) LOGP(ss, LOGL_DEBUG, "%s " fmt, gsm_fn_as_gsmtime_str(fn), ## args)
/* LOGP with lchan + frame number prefix */
#define LOGPLCFN(lchan, fn, ss, lvl, fmt, args...) \
LOGP(ss, lvl, "%s %s " fmt, gsm_lchan_name(lchan), gsm_fn_as_gsmtime_str(fn), ## args)
/* LOGP with lchan + gsm_time prefix */
#define LOGPLCGT(lchan, gt, ss, lvl, fmt, args...) \
LOGP(ss, lvl, "%s %s " fmt, gsm_lchan_name(lchan), osmo_dump_gsmtime(gt), ## args)
#endif /* _LOGGING_H */ #endif /* _LOGGING_H */

View File

@@ -4,22 +4,16 @@
#define MEAS_MAX_TIMING_ADVANCE 63 #define MEAS_MAX_TIMING_ADVANCE 63
#define MEAS_MIN_TIMING_ADVANCE 0 #define MEAS_MIN_TIMING_ADVANCE 0
int lchan_new_ul_meas(struct gsm_lchan *lchan, int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn);
const struct bts_ul_meas *ulm,
uint32_t fn);
int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn); int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn);
int lchan_meas_process_measurement(struct gsm_lchan *lchan, int lchan_meas_process_measurement(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn);
const struct bts_ul_meas *ulm,
uint32_t fn);
void lchan_meas_reset(struct gsm_lchan *lchan); void lchan_meas_reset(struct gsm_lchan *lchan);
bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn); bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn, bool is_amr_sid_update);
int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn); int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn);
void lchan_meas_handle_sacch(struct gsm_lchan *lchan, struct msgb *msg);
#endif #endif

View File

@@ -13,49 +13,14 @@
struct msgb; struct msgb;
/**************************************************************** /* Access 1st part of msgb control buffer */
* Accessor macros for control buffer words in RTP input path (DL)
*****************************************************************/
/* Storing RTP header fields in the path from RTP and Osmux
* Rx callback functions to TCH-RTS.ind handling.
* FIXME: do we really need this RTP header info downstream
* of the jitter buffer mechanism in the RTP endpoint library?
*/
#define rtpmsg_marker_bit(x) ((x)->cb[0]) #define rtpmsg_marker_bit(x) ((x)->cb[0])
#define rtpmsg_seq(x) ((x)->cb[1])
#define rtpmsg_ts(x) ((x)->cb[2])
/* l1sap_rtp_rx_cb() does some preening or preparsing on some /* Access 2nd part of msgb control buffer */
* RTP payloads, and in two cases (HR with RFC 5993 input and #define rtpmsg_seq(x) ((x)->cb[1])
* CSD NT modes) this preparsing step produces some metadata
* that need to be passed to TCH-RTS.ind handling.
*/
#define rtpmsg_is_rfc5993_sid(x) ((x)->cb[3])
#define rtpmsg_csd_align_bits(x) ((x)->cb[4])
/******************************************************** /* Access 3rd part of msgb control buffer */
* Accessor macros for control buffer words in TCH UL path #define rtpmsg_ts(x) ((x)->cb[2])
*********************************************************/
/* We provide an ability for BTS models to indicate BFI along with payload
* bits just like in GSM 08.60 TRAU-UL frames, and the same BFI flag can
* then be set by model-independent functions for higher-level BFI
* conditions. This cb word shall act as a Boolean flag.
*/
#define tch_ul_msg_bfi(x) ((x)->cb[0])
/* For HRv1 codec, we have to pass SID classification from the function
* that makes the initial determination to TS 101 318, RFC 5993 and
* TW-TS-002 output functions. Per classic GSM specs, common across
* FR/HR/EFR, SID classification code is an integer equal to 0, 1 or 2;
* in Osmocom it is enum osmo_gsm631_sid_class.
*
* NOTE: while the actual SID ternary classification exists in exactly
* the same form across all 3 of FR/HR/EFR, we store it in a cb word
* only for HR codec where we need it for RTP output functions.
*/
#define tch_ul_msg_hr_sid(x) ((x)->cb[1])
/** /**
* Classification of OML message. ETSI for plain GSM 12.21 * Classification of OML message. ETSI for plain GSM 12.21

View File

@@ -1,123 +0,0 @@
/* Header for all NM FSM. Following 3GPP TS 12.21 Figure 2/GSM 12.21:
GSM 12.21 Objects' Operational state and availability status behaviour during initialization */
/* (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
* Author: Pau Espin Pedrol <pespin@sysmocom.de>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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/>.
*
*/
#pragma once
#include <osmocom/core/fsm.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/msgb.h>
/* Common */
enum nm_fsm_events {
NM_EV_SW_ACT,
NM_EV_RX_SETATTR, /* data: struct nm_fsm_ev_setattr_data */
NM_EV_RX_OPSTART,
NM_EV_OPSTART_ACK,
NM_EV_OPSTART_NACK,
NM_EV_SHUTDOWN_START,
NM_EV_SHUTDOWN_FINISH,
NM_EV_OML_UP,
NM_EV_RSL_UP, /* RadioCarrier and BaseBand Transceiver only */
NM_EV_RSL_DOWN, /* RadioCarrier and BaseBand Transceiver only */
NM_EV_PHYLINK_UP, /* RadioCarrier and BaseBand Transceiver only */
NM_EV_PHYLINK_DOWN, /* RadioCarrier and BaseBand Transceiver only */
NM_EV_DISABLE, /* RadioCarrier and BaseBand Transceiver only */
NM_EV_BBTRANSC_ENABLED, /* Radio Channel only */
NM_EV_BBTRANSC_DISABLED, /* Radio Channel only */
NM_EV_RCARRIER_ENABLED, /* Radio Channel only */
NM_EV_RCARRIER_DISABLED, /* Radio Channel only */
};
extern const struct value_string nm_fsm_event_names[];
struct nm_fsm_ev_setattr_data {
const struct msgb *msg;
};
/* BTS SiteManager */
enum nm_bts_sm_op_fsm_states {
NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED,
NM_BTS_SM_ST_OP_DISABLED_OFFLINE,
NM_BTS_SM_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_bts_sm_fsm;
/* BTS */
enum nm_bts_op_fsm_states {
NM_BTS_ST_OP_DISABLED_NOTINSTALLED,
NM_BTS_ST_OP_DISABLED_OFFLINE,
NM_BTS_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_bts_fsm;
/* BaseBand Transceiver */
enum nm_bb_transc_op_fsm_states {
NM_BBTRANSC_ST_OP_DISABLED_NOTINSTALLED,
NM_BBTRANSC_ST_OP_DISABLED_OFFLINE,
NM_BBTRANSC_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_bb_transc_fsm;
/* Radio Carrier */
enum nm_rcarrier_op_fsm_states {
NM_RCARRIER_ST_OP_DISABLED_NOTINSTALLED,
NM_RCARRIER_ST_OP_DISABLED_OFFLINE,
NM_RCARRIER_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_rcarrier_fsm;
/* Radio channel */
enum nm_chan_op_fsm_states {
NM_CHAN_ST_OP_DISABLED_NOTINSTALLED,
NM_CHAN_ST_OP_DISABLED_DEPENDENCY,
NM_CHAN_ST_OP_DISABLED_OFFLINE,
NM_CHAN_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_chan_fsm;
/* GPRS NSE */
enum nm_gprs_nse_op_fsm_states {
NM_GPRS_NSE_ST_OP_DISABLED_NOTINSTALLED,
NM_GPRS_NSE_ST_OP_DISABLED_DEPENDENCY,
NM_GPRS_NSE_ST_OP_DISABLED_OFFLINE,
NM_GPRS_NSE_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_gprs_nse_fsm;
/* GPRS NSVC */
enum nm_gprs_nsvc_op_fsm_states {
NM_GPRS_NSVC_ST_OP_DISABLED_NOTINSTALLED,
NM_GPRS_NSVC_ST_OP_DISABLED_DEPENDENCY,
NM_GPRS_NSVC_ST_OP_DISABLED_OFFLINE,
NM_GPRS_NSVC_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_gprs_nsvc_fsm;
/* GPRS CELL */
enum nm_gprs_cell_op_fsm_states {
NM_GPRS_CELL_ST_OP_DISABLED_NOTINSTALLED,
NM_GPRS_CELL_ST_OP_DISABLED_DEPENDENCY,
NM_GPRS_CELL_ST_OP_DISABLED_OFFLINE,
NM_GPRS_CELL_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_gprs_cell_fsm;

View File

@@ -1,61 +0,0 @@
/* Maintain and generate ASCI notifications */
/*
* (C) 2023 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
* All Rights Reserved
*
* SPDX-License-Identifier: AGPL-3.0+
*
* Author: Harald Welte
*
* 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/>.
*/
#pragma once
/* one [concurrent] ASCI (VBS/VGCS) notification */
struct asci_notification {
struct llist_head list; /* linked to bts->asci.notifications */
/* Group call reference (TS 24.008 10.5.1.9 "Descriptive group or broadcast call reference") */
uint8_t group_call_ref[5];
/* Group Channel Description (TS 44.018 10.5.2.14b) */
struct {
bool present;
uint8_t value[255];
uint8_t len;
} chan_desc;
/* NCH DRX Information (TS 48.058 9.3.47) */
struct {
bool present;
struct rsl_ie_nch_drx_info value;
} nch_drx_info;
};
int bts_asci_notification_add(struct gsm_bts *bts, const uint8_t *group_call_ref, const uint8_t *chan_desc,
uint8_t chan_desc_len, const struct rsl_ie_nch_drx_info *nch_drx_info);
int bts_asci_notification_del(struct gsm_bts *bts, const uint8_t *group_call_ref);
int bts_asci_notification_reset(struct gsm_bts *bts);
const struct asci_notification *bts_asci_notification_get_next(struct gsm_bts *bts);
void append_group_call_information(struct bitvec *bv, const uint8_t *gcr, const uint8_t *ch_desc, uint8_t ch_desc_len);
int bts_asci_notify_nch_gen_msg(struct gsm_bts *bts, uint8_t *out_buf);
int bts_asci_notify_facch_gen_msg(struct gsm_bts *bts, uint8_t *out_buf, const uint8_t *group_call_ref,
const uint8_t *chan_desc, uint8_t chan_desc_len);

View File

@@ -8,35 +8,8 @@ struct gsm_abis_mo;
struct msgb; struct msgb;
struct gsm_lchan; struct gsm_lchan;
/* Network Management State */
struct gsm_nm_state {
enum abis_nm_op_state operational;
enum abis_nm_adm_state administrative;
enum abis_nm_avail_state availability;
};
struct gsm_abis_mo { int oml_init(struct gsm_abis_mo *mo);
/* A-bis OML Object Class */
uint8_t obj_class;
/* is there still some procedure pending? */
uint8_t procedure_pending;
/* A-bis OML Object Instance */
struct abis_om_obj_inst obj_inst;
/* human-readable name */
const char *name;
/* NM State */
struct gsm_nm_state nm_state;
/* Attributes configured in this MO */
struct tlv_parsed *nm_attr;
/* BTS to which this MO belongs */
struct gsm_bts *bts;
/* NM BTS Site Manager FSM */
struct osmo_fsm_inst *fi;
bool setattr_success;
bool opstart_success;
};
int oml_init(void);
int down_oml(struct gsm_bts *bts, struct msgb *msg); int down_oml(struct gsm_bts *bts, struct msgb *msg);
struct msgb *oml_msgb_alloc(void); struct msgb *oml_msgb_alloc(void);
@@ -48,7 +21,7 @@ int oml_mo_statechg_ack(const struct gsm_abis_mo *mo);
int oml_mo_statechg_nack(const struct gsm_abis_mo *mo, uint8_t nack_cause); int oml_mo_statechg_nack(const struct gsm_abis_mo *mo, uint8_t nack_cause);
/* Change the state and send STATE CHG REP */ /* Change the state and send STATE CHG REP */
int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state, int adm_state); int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state);
/* First initialization of MO, does _not_ generate state changes */ /* First initialization of MO, does _not_ generate state changes */
void oml_mo_state_init(struct gsm_abis_mo *mo, int op_state, int avail_state); void oml_mo_state_init(struct gsm_abis_mo *mo, int op_state, int avail_state);
@@ -63,26 +36,14 @@ int oml_tx_state_changed(const struct gsm_abis_mo *mo);
int oml_mo_tx_sw_act_rep(const struct gsm_abis_mo *mo); int oml_mo_tx_sw_act_rep(const struct gsm_abis_mo *mo);
int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause); int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause);
int oml_fom_ack_nack_copy_msg(const struct msgb *old_msg, uint8_t cause);
int oml_mo_fom_ack_nack(const struct gsm_abis_mo *mo, uint8_t orig_msg_type, int oml_mo_fom_ack_nack(const struct gsm_abis_mo *mo, uint8_t orig_msg_type,
uint8_t cause); uint8_t cause);
extern const uint32_t oml_default_t200_fn[7]; extern const unsigned int oml_default_t200_ms[7];
/* Transmit failure event report */ /* Transmit failure event report */
int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, enum abis_nm_severity severity, int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, enum abis_nm_severity severity,
uint16_t cause_value, const char *fmt, ...); uint16_t cause_value, const char *fmt, ...);
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,
enum abis_nm_nack_cause *c);
void *gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
const struct abis_om_obj_inst *obj_inst,
enum abis_nm_nack_cause *c);
#endif // _OML_H */ #endif // _OML_H */

View File

@@ -1,48 +0,0 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <osmocom/core/select.h>
#include <osmocom/netif/osmux.h>
struct gsm_bts;
struct gsm_lchan;
enum osmux_usage {
OSMUX_USAGE_OFF = 0,
OSMUX_USAGE_ON = 1,
OSMUX_USAGE_ONLY = 2,
};
struct osmux_state {
enum osmux_usage use;
char *local_addr;
uint16_t local_port;
struct osmo_fd fd;
uint8_t batch_factor;
unsigned int batch_size;
bool dummy_padding;
struct llist_head osmux_handle_list;
};
/* Contains a "struct osmux_in_handle" towards a specific peer (remote IPaddr+port) */
struct osmux_handle {
struct llist_head head;
struct gsm_bts *bts;
struct osmux_in_handle *in;
struct osmo_sockaddr rem_addr;
int refcnt;
};
int bts_osmux_init(struct gsm_bts *bts);
void bts_osmux_release(struct gsm_bts *bts);
int bts_osmux_open(struct gsm_bts *bts);
int lchan_osmux_init(struct gsm_lchan *lchan, uint8_t rtp_payload);
void lchan_osmux_release(struct gsm_lchan *lchan);
int lchan_osmux_connect(struct gsm_lchan *lchan);
bool lchan_osmux_connected(const struct gsm_lchan *lchan);
int lchan_osmux_send_frame(struct gsm_lchan *lchan, const uint8_t *payload,
unsigned int payload_len, unsigned int duration, bool marker);
int lchan_osmux_skipped_frame(struct gsm_lchan *lchan, unsigned int duration);

View File

@@ -7,55 +7,6 @@
struct paging_state; struct paging_state;
struct gsm_bts; struct gsm_bts;
struct asci_notification;
/* abstract representation of P1 rest octets; we only implement those parts we need for now */
struct p1_rest_octets {
struct {
bool present;
uint8_t nln;
uint8_t nln_status;
} nln_pch;
bool packet_page_ind[2];
bool r8_present;
struct {
bool prio_ul_access;
bool etws_present;
struct {
bool is_first;
uint8_t page_nr;
const uint8_t *page;
size_t page_bytes;
} etws;
} r8;
};
/* abstract representation of P2 rest octets; we only implement those parts we need for now */
struct p2_rest_octets {
struct {
bool present;
uint8_t cn3;
} cneed;
struct {
bool present;
uint8_t nln;
uint8_t nln_status;
} nln_pch;
};
/* abstract representation of P3 rest octets; we only implement those parts we need for now */
struct p3_rest_octets {
struct {
bool present;
uint8_t cn3;
uint8_t cn4;
} cneed;
struct {
bool present;
uint8_t nln;
uint8_t nln_status;
} nln_pch;
};
/* initialize paging code */ /* initialize paging code */
struct paging_state *paging_init(struct gsm_bts *bts, struct paging_state *paging_init(struct gsm_bts *bts,
@@ -84,15 +35,9 @@ int paging_si_update(struct paging_state *ps, struct gsm48_control_channel_descr
int paging_add_identity(struct paging_state *ps, uint8_t paging_group, int paging_add_identity(struct paging_state *ps, uint8_t paging_group,
const uint8_t *identity_lv, uint8_t chan_needed); const uint8_t *identity_lv, uint8_t chan_needed);
/* Add a ready formatted MAC block message to the paging queue, this can be an IMMEDIATE ASSIGNMENT, or a /* Add an IMM.ASS message to the paging queue */
* PAGING COMMAND (from the PCU) */ int paging_add_imm_ass(struct paging_state *ps, const uint8_t *data,
int paging_add_macblock(struct paging_state *ps, uint32_t msg_id, const char *imsi, bool confirm, const uint8_t *macblock); uint8_t len);
/* Paging rest octests */
void append_p1_rest_octets(struct bitvec *bv, const struct p1_rest_octets *p1ro,
const struct asci_notification *notif);
void append_p2_rest_octets(struct bitvec *bv, const struct p2_rest_octets *p2ro);
void append_p3_rest_octets(struct bitvec *bv, const struct p3_rest_octets *p3ro);
/* generate paging message for given gsm time */ /* generate paging message for given gsm time */
int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *gt, int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *gt,

View File

@@ -1,16 +1,10 @@
#ifndef _PCU_IF_H #ifndef _PCU_IF_H
#define _PCU_IF_H #define _PCU_IF_H
#include <osmo-bts/pcuif_proto.h>
struct gsm_bts_sm;
extern int pcu_direct; extern int pcu_direct;
#define PCUIF_HDR_SIZE (sizeof(struct gsm_pcu_if) - sizeof(((struct gsm_pcu_if *)0)->u))
int pcu_tx_info_ind(void); int pcu_tx_info_ind(void);
int pcu_tx_si(const struct gsm_bts *bts, enum osmo_sysinfo_type si_type, bool enable); int pcu_tx_si13(const struct gsm_bts *bts, bool enable);
int pcu_tx_app_info_req(struct gsm_bts *bts, uint8_t app_type, uint8_t len, const uint8_t *app_data); int pcu_tx_app_info_req(struct gsm_bts *bts, uint8_t app_type, uint8_t len, const uint8_t *app_data);
int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
uint16_t arfcn, uint8_t block_nr); uint16_t arfcn, uint8_t block_nr);
@@ -21,13 +15,11 @@ int pcu_tx_rach_ind(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
int16_t qta, uint16_t ra, uint32_t fn, uint8_t is_11bit, int16_t qta, uint16_t ra, uint32_t fn, uint8_t is_11bit,
enum ph_burst_type burst_type, uint8_t sapi); enum ph_burst_type burst_type, uint8_t sapi);
int pcu_tx_time_ind(uint32_t fn); int pcu_tx_time_ind(uint32_t fn);
int pcu_tx_interf_ind(const struct gsm_bts_trx *trx, uint32_t fn);
int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed); int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed);
int pcu_tx_data_cnf(uint32_t msg_id, uint8_t sapi); int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len);
int pcu_tx_susp_req(struct gsm_lchan *lchan, uint32_t tlli, const uint8_t *ra_id, uint8_t cause); int pcu_tx_susp_req(struct gsm_lchan *lchan, uint32_t tlli, const uint8_t *ra_id, uint8_t cause);
int pcu_sock_send(struct msgb *msg);
int pcu_sock_init(const char *path, int qlength_max); int pcu_sock_init(const char *path);
void pcu_sock_exit(void); void pcu_sock_exit(void);
bool pcu_connected(void); bool pcu_connected(void);

View File

@@ -2,42 +2,40 @@
#define _PCUIF_PROTO_H #define _PCUIF_PROTO_H
#include <osmocom/gsm/l1sap.h> #include <osmocom/gsm/l1sap.h>
#include <arpa/inet.h>
#include <osmocom/gsm/protocol/gsm_23_003.h>
#define PCU_SOCK_DEFAULT "/tmp/pcu_bts" #define PCU_SOCK_DEFAULT "/tmp/pcu_bts"
#define PCU_IF_VERSION 0x0c #define PCU_IF_VERSION 0x09
#define TXT_MAX_LEN 128 #define TXT_MAX_LEN 128
/* msg_type */ /* msg_type */
#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */
#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */
#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ #define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */
#define PCU_IF_MSG_SUSP_REQ 0x03 /* BTS forwards GPRS SUSP REQ to PCU */ #define PCU_IF_MSG_SUSP_REQ 0x03 /* BTS forwards GPRS SUSP REQ to PCU */
#define PCU_IF_MSG_APP_INFO_REQ 0x04 /* BTS asks PCU to transmit APP INFO via PACCH */ #define PCU_IF_MSG_APP_INFO_REQ 0x04 /* BTS asks PCU to tranmit APP INFO via PACCH */
#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ #define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */
#define PCU_IF_MSG_DATA_CNF_2 0x11 /* confirm (using message id) */ #define PCU_IF_MSG_DATA_CNF_DT 0x11 /* confirm (with direct tlli) */
#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ #define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */
#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ #define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */
#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ #define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */
#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ #define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */
#define PCU_IF_MSG_INTERF_IND 0x53 /* interference report */
#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ #define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */
#define PCU_IF_MSG_TXT_IND 0x70 /* Text indication for BTS */ #define PCU_IF_MSG_TXT_IND 0x70 /* Text indication for BTS */
#define PCU_IF_MSG_CONTAINER 0x80 /* Transparent container message */
/* sapi */ /* sapi */
#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ #define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */
#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */
#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */
#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ #define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */
#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ #define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */
#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ #define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */
#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ #define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */
#define PCU_IF_SAPI_PCH_2 0x08 /* assignment on PCH (confirmed using message id) */ #define PCU_IF_SAPI_AGCH_DT 0x08 /* assignment on AGCH but with additional TLLI */
#define PCU_IF_SAPI_AGCH_2 0x09 /* assignment on AGCH (confirmed using message id) */
/* flags */ /* flags */
#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ #define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */
#define PCU_IF_FLAG_DIRECT_PHY (1 << 1)/* access PHY directly via dedicated hardware support */ #define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */
#define PCU_IF_FLAG_CS1 (1 << 16) #define PCU_IF_FLAG_CS1 (1 << 16)
#define PCU_IF_FLAG_CS2 (1 << 17) #define PCU_IF_FLAG_CS2 (1 << 17)
#define PCU_IF_FLAG_CS3 (1 << 18) #define PCU_IF_FLAG_CS3 (1 << 18)
@@ -52,25 +50,6 @@
#define PCU_IF_FLAG_MCS8 (1 << 27) #define PCU_IF_FLAG_MCS8 (1 << 27)
#define PCU_IF_FLAG_MCS9 (1 << 28) #define PCU_IF_FLAG_MCS9 (1 << 28)
/* NSVC address type */
#define PCU_IF_ADDR_TYPE_UNSPEC 0x00 /* No address - empty entry */
#define PCU_IF_ADDR_TYPE_IPV4 0x04 /* IPv4 address */
#define PCU_IF_ADDR_TYPE_IPV6 0x29 /* IPv6 address */
/* BTS model */
enum gsm_pcuif_bts_model {
PCU_IF_BTS_MODEL_UNSPEC,
PCU_IF_BTS_MODEL_LC15,
PCU_IF_BTS_MODEL_OC2G,
PCU_IF_BTS_MODEL_OCTPHY,
PCU_IF_BTS_MODEL_SYSMO,
PCU_IF_BTS_MODEL_TRX,
PCU_IF_BTS_MODEL_RBS,
};
#define PCU_IF_NUM_NSVC 2
#define PCU_IF_NUM_TRX 8
enum gsm_pcu_if_text_type { enum gsm_pcu_if_text_type {
PCU_VERSION, PCU_VERSION,
PCU_OML_ALERT, PCU_OML_ALERT,
@@ -96,10 +75,19 @@ struct gsm_pcu_if_data {
int16_t lqual_cb; /* !< \brief Link quality in centiBel */ int16_t lqual_cb; /* !< \brief Link quality in centiBel */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* data confirmation with message id (instead of raw mac block) */ /* data confirmation with direct tlli (instead of raw mac block with tlli) */
struct gsm_pcu_if_data_cnf { struct gsm_pcu_if_data_cnf_dt {
uint8_t sapi; uint8_t sapi;
uint32_t msg_id; uint32_t tlli;
uint32_t fn;
uint16_t arfcn;
uint8_t trx_nr;
uint8_t ts_nr;
uint8_t block_nr;
int8_t rssi;
uint16_t ber10k; /* !< \brief BER in units of 0.01% */
int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */
int16_t lqual_cb; /* !< \brief Link quality in centiBel */
} __attribute__ ((packed)); } __attribute__ ((packed));
struct gsm_pcu_if_rts_req { struct gsm_pcu_if_rts_req {
@@ -124,27 +112,18 @@ struct gsm_pcu_if_rach_ind {
uint8_t ts_nr; uint8_t ts_nr;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct gsm_pcu_if_info_trx_ts {
uint8_t tsc;
uint8_t hopping;
uint8_t hsn;
uint8_t maio;
uint8_t ma_bit_len;
uint8_t ma[8];
} __attribute__ ((packed));
struct gsm_pcu_if_info_trx { struct gsm_pcu_if_info_trx {
uint16_t arfcn; uint16_t arfcn;
uint8_t pdch_mask; /* PDCH timeslot mask */ uint8_t pdch_mask; /* PDCH channels per TS */
uint8_t spare; uint8_t spare;
uint8_t tsc[8]; /* TSC per channel */
uint32_t hlayer1; uint32_t hlayer1;
struct gsm_pcu_if_info_trx_ts ts[8];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct gsm_pcu_if_info_ind { struct gsm_pcu_if_info_ind {
uint32_t version; uint32_t version;
uint32_t flags; uint32_t flags;
struct gsm_pcu_if_info_trx trx[PCU_IF_NUM_TRX]; /* TRX infos per BTS */ struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */
uint8_t bsic; uint8_t bsic;
/* RAI */ /* RAI */
uint16_t mcc, mnc; uint16_t mcc, mnc;
@@ -173,15 +152,10 @@ struct gsm_pcu_if_info_ind {
uint8_t initial_cs; uint8_t initial_cs;
uint8_t initial_mcs; uint8_t initial_mcs;
/* NSVC */ /* NSVC */
uint16_t nsvci[PCU_IF_NUM_NSVC]; uint16_t nsvci[2];
uint16_t local_port[PCU_IF_NUM_NSVC]; uint16_t local_port[2];
uint16_t remote_port[PCU_IF_NUM_NSVC]; uint16_t remote_port[2];
uint8_t address_type[PCU_IF_NUM_NSVC]; uint32_t remote_ip[2];
union {
struct in_addr v4;
struct in6_addr v6;
} remote_ip[PCU_IF_NUM_NSVC];
uint8_t bts_model; /* enum gsm_pcuif_bts_model */
} __attribute__ ((packed)); } __attribute__ ((packed));
struct gsm_pcu_if_act_req { struct gsm_pcu_if_act_req {
@@ -215,48 +189,6 @@ struct gsm_pcu_if_susp_req {
uint8_t cause; uint8_t cause;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Interference measurements on PDCH timeslots */
struct gsm_pcu_if_interf_ind {
uint8_t trx_nr;
uint8_t spare[3];
uint32_t fn;
uint8_t interf[8];
} __attribute__ ((packed));
/* Contains messages transmitted BSC<->PCU, potentially forwarded by BTS via IPA/PCU */
struct gsm_pcu_if_container {
uint8_t msg_type;
uint8_t spare;
uint16_t length; /* network byte order */
uint8_t data[0];
} __attribute__ ((packed));
/* Struct to send a (confirmed) IMMEDIATE ASSIGNMENT message via PCH. The struct is sent as a data request
* (data_req) under SAPI PCU_IF_SAPI_PCH_2. */
struct gsm_pcu_if_pch {
/* message id as reference for confirmation */
uint32_t msg_id;
/* IMSI (to derive paging group) */
char imsi[OSMO_IMSI_BUF_SIZE];
/* GSM mac-block (with immediate assignment message) */
uint8_t data[GSM_MACBLOCK_LEN];
/* Set to true in case the receiving end must send a confirmation
* when the MAC block (data) has been sent. */
bool confirm;
} __attribute__((packed));
/* Struct to send a (confirmed) IMMEDIATE ASSIGNMENT message via AGCH. The struct is sent as a data request
* (data_req) under SAPI PCU_IF_SAPI_AGCH_2. */
struct gsm_pcu_if_agch {
/* message id as reference for confirmation */
uint32_t msg_id;
/* GSM mac-block (with immediate assignment message) */
uint8_t data[GSM_MACBLOCK_LEN];
/* Set to true in case the receiving end must send a confirmation
* when the MAC block (data) has been sent. */
bool confirm;
} __attribute__((packed));
struct gsm_pcu_if { struct gsm_pcu_if {
/* context based information */ /* context based information */
uint8_t msg_type; /* message type */ uint8_t msg_type; /* message type */
@@ -265,7 +197,8 @@ struct gsm_pcu_if {
union { union {
struct gsm_pcu_if_data data_req; struct gsm_pcu_if_data data_req;
struct gsm_pcu_if_data_cnf data_cnf2; struct gsm_pcu_if_data data_cnf;
struct gsm_pcu_if_data_cnf_dt data_cnf_dt;
struct gsm_pcu_if_data data_ind; struct gsm_pcu_if_data data_ind;
struct gsm_pcu_if_susp_req susp_req; struct gsm_pcu_if_susp_req susp_req;
struct gsm_pcu_if_rts_req rts_req; struct gsm_pcu_if_rts_req rts_req;
@@ -276,8 +209,6 @@ struct gsm_pcu_if {
struct gsm_pcu_if_time_ind time_ind; struct gsm_pcu_if_time_ind time_ind;
struct gsm_pcu_if_pag_req pag_req; struct gsm_pcu_if_pag_req pag_req;
struct gsm_pcu_if_app_info_req app_info_req; struct gsm_pcu_if_app_info_req app_info_req;
struct gsm_pcu_if_interf_ind interf_ind;
struct gsm_pcu_if_container container;
} u; } u;
} __attribute__ ((packed)); } __attribute__ ((packed));

View File

@@ -5,12 +5,11 @@
#include <osmocom/core/linuxlist.h> #include <osmocom/core/linuxlist.h>
#include <osmo-bts/scheduler.h> #include <osmo-bts/scheduler.h>
#include <osmo-bts/bts_trx.h>
#include <linux/if_packet.h> #include <linux/if_packet.h>
#include "btsconfig.h" #include "btsconfig.h"
struct gsm_bts_trx;
struct virt_um_inst; struct virt_um_inst;
enum phy_link_type { enum phy_link_type {
@@ -45,17 +44,16 @@ struct phy_link {
uint16_t base_port_local; uint16_t base_port_local;
uint16_t base_port_remote; uint16_t base_port_remote;
struct osmo_fd trx_ofd_clk; struct osmo_fd trx_ofd_clk;
bool trx_ta_loop;
uint32_t clock_advance; uint32_t clock_advance;
uint32_t rts_advance; uint32_t rts_advance;
bool use_legacy_setbsic; bool use_legacy_setbsic;
uint8_t trxd_pdu_ver_max; /* Maximum TRXD PDU version to negotiate */ uint8_t trxd_hdr_ver_max; /* Maximum TRXD header version to negotiate */
bool powered; /* last POWERON (true) or POWEROFF (false) confirmed */ bool powered; /* last POWERON (true) or POWEROFF (false) confirmed */
bool poweron_sent; /* is there a POWERON in transit? */ bool poweronoff_sent; /* is there a POWERON/POWEROFF in transit? (one or the other based on ->powered) */
bool poweroff_sent; /* is there a POWEROFF in transit? */
} osmotrx; } osmotrx;
struct { struct {
char *mcast_dev; /* Network device for multicast */ char *mcast_dev; /* Network device for multicast */
int ttl; /* TTL of transmitted udp multicast */
char *bts_mcast_group; /* BTS are listening to this group */ char *bts_mcast_group; /* BTS are listening to this group */
uint16_t bts_mcast_port; uint16_t bts_mcast_port;
char *ms_mcast_group; /* MS are listening to this group */ char *ms_mcast_group; /* MS are listening to this group */
@@ -98,7 +96,7 @@ struct phy_instance {
struct phy_link *phy_link; struct phy_link *phy_link;
/* back-pointer to the TRX to which we're associated */ /* back-pointer to the TRX to which we're associated */
struct gsm_bts_trx *trx; /* NOTE: may be NULL! */ struct gsm_bts_trx *trx;
union { union {
struct { struct {
@@ -113,8 +111,11 @@ struct phy_instance {
} sysmobts; } sysmobts;
struct { struct {
struct trx_l1h *hdl; struct trx_l1h *hdl;
struct trx_dl_burst_req br[TRX_NR_TS]; bool sw_act_reported;
} osmotrx; } osmotrx;
struct {
struct l1sched_trx sched;
} virt;
struct { struct {
/* logical transceiver number within one PHY */ /* logical transceiver number within one PHY */
uint32_t trx_id; uint32_t trx_id;
@@ -134,7 +135,6 @@ struct phy_instance {
uint8_t dsp_alive_period; /* DSP alive timer period */ uint8_t dsp_alive_period; /* DSP alive timer period */
uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */
uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */
uint8_t tx_c0_idle_pwr_red; /* C0 idle slot Tx power reduction level in dB */
} lc15; } lc15;
struct { struct {
/* configuration */ /* configuration */
@@ -156,26 +156,25 @@ struct phy_instance {
struct phy_link *phy_link_by_num(int num); struct phy_link *phy_link_by_num(int num);
struct phy_link *phy_link_create(void *ctx, int num); struct phy_link *phy_link_create(void *ctx, int num);
void phy_link_destroy(struct phy_link *plink); void phy_link_destroy(struct phy_link *plink);
const char *phy_link_name(const struct phy_link *plink);
void phy_link_state_set(struct phy_link *plink, enum phy_link_state state); void phy_link_state_set(struct phy_link *plink, enum phy_link_state state);
enum phy_link_state phy_link_state_get(struct phy_link *plink); enum phy_link_state phy_link_state_get(struct phy_link *plink);
const char *phy_link_state_name(enum phy_link_state state); const char *phy_link_state_name(enum phy_link_state state);
int phy_links_open(void); int phy_links_open(void);
struct phy_instance *phy_instance_by_num(const struct phy_link *plink, int num); struct phy_instance *phy_instance_by_num(struct phy_link *plink, int num);
struct phy_instance *phy_instance_create(struct phy_link *plink, int num); struct phy_instance *phy_instance_create(struct phy_link *plink, int num);
void phy_instance_link_to_trx(struct phy_instance *pinst, struct gsm_bts_trx *trx); void phy_instance_link_to_trx(struct phy_instance *pinst, struct gsm_bts_trx *trx);
void phy_instance_destroy(struct phy_instance *pinst); void phy_instance_destroy(struct phy_instance *pinst);
const char *phy_instance_name(const struct phy_instance *pinst); const char *phy_instance_name(struct phy_instance *pinst);
void phy_user_statechg_notif(struct phy_instance *pinst, enum phy_link_state link_state);
static inline struct phy_instance *trx_phy_instance(const struct gsm_bts_trx *trx) static inline struct phy_instance *trx_phy_instance(const struct gsm_bts_trx *trx)
{ {
OSMO_ASSERT(trx); OSMO_ASSERT(trx);
return trx->pinst; return trx->role_bts.l1h;
} }
int bts_model_phy_link_open(struct phy_link *plink); int bts_model_phy_link_open(struct phy_link *plink);
int bts_model_phy_link_close(struct phy_link *plink);
#define LOGPPHL(plink, section, lvl, fmt, args...) LOGP(section, lvl, "%s: " fmt, phy_link_name(plink), ##args)
#define LOGPPHI(pinst, section, lvl, fmt, args...) LOGP(section, lvl, "%s: " fmt, phy_instance_name(pinst), ##args) #define LOGPPHI(pinst, section, lvl, fmt, args...) LOGP(section, lvl, "%s: " fmt, phy_instance_name(pinst), ##args)

View File

@@ -1,90 +1,7 @@
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <osmo-bts/gsm_data.h>
/* MS/BS Power related measurement averaging algo */
enum gsm_power_ctrl_meas_avg_algo {
GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE = 0x00,
GSM_PWR_CTRL_MEAS_AVG_ALGO_UNWEIGHTED = 0x01,
GSM_PWR_CTRL_MEAS_AVG_ALGO_WEIGHTED = 0x02,
GSM_PWR_CTRL_MEAS_AVG_ALGO_MOD_MEDIAN = 0x03,
/* EWMA is an Osmocom specific algo */
GSM_PWR_CTRL_MEAS_AVG_ALGO_OSMO_EWMA = 0x04,
};
/* MS/BS Power related measurement parameters */
struct gsm_power_ctrl_meas_params {
/* Thresholds (see 3GPP TS 45.008, section A.3.2.1) */
uint8_t lower_thresh; /* lower (decreasing) direction */
uint8_t upper_thresh; /* upper (increasing) direction */
/* Threshold Comparators for lower (decreasing) direction */
uint8_t lower_cmp_p; /* P1 for RxLev, P3 for RxQual */
uint8_t lower_cmp_n; /* N1 for RxLev, N3 for RxQual */
/* Threshold Comparators for upper (increasing) direction */
uint8_t upper_cmp_p; /* P2 for RxLev, P4 for RxQual */
uint8_t upper_cmp_n; /* N2 for RxLev, N4 for RxQual */
/* Hreqave and Hreqt (see 3GPP TS 45.008, Annex A) */
uint8_t h_reqave;
uint8_t h_reqt;
/* AVG algorithm and its specific parameters */
enum gsm_power_ctrl_meas_avg_algo algo;
union {
/* Exponentially Weighted Moving Average */
struct {
/* Smoothing factor: higher the value - less smoothing */
uint8_t alpha; /* 1 .. 99 (in %) */
} ewma;
};
};
/* MS/BS Power Control parameters */
struct gsm_power_ctrl_params {
/* Minimum interval between power level changes */
uint8_t ctrl_interval; /* 1 step is 2 SACCH periods */
/* Power change step size (maximum) */
uint8_t inc_step_size_db; /* increasing direction */
uint8_t red_step_size_db; /* reducing direction */
/* Measurement averaging parameters for RxLev & RxQual */
struct gsm_power_ctrl_meas_params rxqual_meas;
struct gsm_power_ctrl_meas_params rxlev_meas;
/* Measurement averaging parameters for C/I, per chan type */
struct gsm_power_ctrl_meas_params ci_fr_meas;
struct gsm_power_ctrl_meas_params ci_hr_meas;
struct gsm_power_ctrl_meas_params ci_amr_fr_meas;
struct gsm_power_ctrl_meas_params ci_amr_hr_meas;
struct gsm_power_ctrl_meas_params ci_sdcch_meas;
struct gsm_power_ctrl_meas_params ci_gprs_meas;
};
/* Measurement pre-processing state */
struct gsm_power_ctrl_meas_proc_state {
/* Number of measurements processed */
unsigned int meas_num;
/* Algorithm specific data */
union {
struct {
/* Scaled up 100 times average value */
int Avg100;
} ewma;
};
};
/* Default MS/BS Power Control parameters */
extern const struct gsm_power_ctrl_params power_ctrl_params_def;
void power_ctrl_params_def_reset(struct gsm_power_ctrl_params *params, bool is_bs_pwr);
struct gsm_lchan;
int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan, int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan,
const uint8_t ms_power_lvl, const uint8_t ms_power, const int rxLevel);
const int8_t ul_rssi_dbm,
const int16_t ul_lqual_cb);
int lchan_bs_pwr_ctrl(struct gsm_lchan *lchan,
const struct gsm48_meas_res *mr);

View File

@@ -1,11 +1,21 @@
#ifndef _RSL_H #ifndef _RSL_H
#define _RSL_H #define _RSL_H
/**
* What kind of release/activation is done? A silent one for
* the PDCH or one triggered through RSL?
*/
enum {
LCHAN_REL_ACT_RSL,
LCHAN_REL_ACT_PCU,
LCHAN_REL_ACT_OML,
LCHAN_REL_ACT_REACT, /* remove once auto-activation hack is removed from opstart_compl() */
};
#define LCHAN_FN_DUMMY 0xFFFFFFFF #define LCHAN_FN_DUMMY 0xFFFFFFFF
#define LCHAN_FN_WAIT 0xFFFFFFFE #define LCHAN_FN_WAIT 0xFFFFFFFE
bool rsl_chan_rt_is_asci(enum rsl_cmod_crt chan_rt); int msgb_queue_flush(struct llist_head *list);
bool rsl_chan_rt_is_vgcs(enum rsl_cmod_crt chan_rt);
int down_rsl(struct gsm_bts_trx *trx, struct msgb *msg); int down_rsl(struct gsm_bts_trx *trx, struct msgb *msg);
int rsl_tx_rf_res(struct gsm_bts_trx *trx); int rsl_tx_rf_res(struct gsm_bts_trx *trx);
@@ -14,11 +24,11 @@ int rsl_tx_chan_rqd(struct gsm_bts_trx *trx, struct gsm_time *gtime,
int rsl_tx_est_ind(struct gsm_lchan *lchan, uint8_t link_id, uint8_t *data, int len); int rsl_tx_est_ind(struct gsm_lchan *lchan, uint8_t link_id, uint8_t *data, int len);
int rsl_tx_chan_act_acknack(struct gsm_lchan *lchan, uint8_t cause); int rsl_tx_chan_act_acknack(struct gsm_lchan *lchan, uint8_t cause);
int rsl_tx_conn_fail(const struct gsm_lchan *lchan, uint8_t cause); int rsl_tx_conn_fail(struct gsm_lchan *lchan, uint8_t cause);
int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan); int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan);
int rsl_tx_hando_det(struct gsm_lchan *lchan, uint8_t *ho_delay); int rsl_tx_hando_det(struct gsm_lchan *lchan, uint8_t *ho_delay);
int rsl_tx_listener_det(struct gsm_lchan *lchan, uint8_t *acc_delay);
int rsl_tx_talker_det(struct gsm_lchan *lchan, uint8_t *acc_delay); int lchan_deactivate(struct gsm_lchan *lchan);
/* call-back for LAPDm code, called when it wants to send msgs UP */ /* call-back for LAPDm code, called when it wants to send msgs UP */
int lapdm_rll_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx); int lapdm_rll_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx);
@@ -35,6 +45,6 @@ void ipacc_dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc);
int rsl_tx_cbch_load_indication(struct gsm_bts *bts, bool ext_cbch, bool overflow, uint8_t amount); int rsl_tx_cbch_load_indication(struct gsm_bts *bts, bool ext_cbch, bool overflow, uint8_t amount);
int rsl_tx_meas_res(struct gsm_lchan *lchan, const uint8_t *l3, unsigned int l3_len, int timing_offset); int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, const struct lapdm_entity *le);
#endif // _RSL_H */ #endif // _RSL_H */

View File

@@ -1,20 +0,0 @@
/*
* RTP input validation function: makes the accept-or-drop decision,
* and for some codecs signals additional required actions such as
* dropping one header octet.
*/
#pragma once
#include <stdint.h>
#include <osmo-bts/lchan.h>
enum pl_input_decision {
PL_DECISION_DROP,
PL_DECISION_ACCEPT,
PL_DECISION_STRIP_HDR_OCTET,
};
enum pl_input_decision
rtp_payload_input_preen(struct gsm_lchan *lchan, const uint8_t *rtp_pl,
unsigned rtp_pl_len, bool *rfc5993_sid_flag);

View File

@@ -1,18 +1,18 @@
#pragma once #ifndef TRX_SCHEDULER_H
#define TRX_SCHEDULER_H
#include <osmocom/core/utils.h> #include <osmocom/core/utils.h>
#include <osmocom/core/rate_ctr.h>
#include <osmo-bts/gsm_data.h> #include <osmo-bts/gsm_data.h>
#define TRX_GMSK_NB_TSC(br) \ /* Whether a logical channel must be activated automatically */
_sched_train_seq_gmsk_nb[(br)->tsc_set][(br)->tsc] #define TRX_CHAN_FLAG_AUTO_ACTIVE (1 << 0)
/* Whether a logical channel belongs to PDCH (packet switched data) */
#define TRX_CHAN_FLAG_PDCH (1 << 1)
#define TRX_8PSK_NB_TSC(br) \ /* FIXME: we should actually activate 'auto-active' channels */
_sched_train_seq_8psk_nb[(br)->tsc] #define TRX_CHAN_IS_ACTIVE(state, chan) \
(trx_chan_desc[chan].flags & TRX_CHAN_FLAG_AUTO_ACTIVE || (state)->active)
#define TRX_CHAN_IS_DEDIC(chan) \
(chan >= TRXC_TCHF)
/* These types define the different channels on a multiframe. /* These types define the different channels on a multiframe.
* Each channel has queues and can be activated individually. * Each channel has queues and can be activated individually.
@@ -24,10 +24,6 @@ enum trx_chan_type {
TRXC_BCCH, TRXC_BCCH,
TRXC_RACH, TRXC_RACH,
TRXC_CCCH, TRXC_CCCH,
TRXC_CBCH,
TRXC_PDTCH,
TRXC_PTCCH,
/* Dedicated channels start here */
TRXC_TCHF, TRXC_TCHF,
TRXC_TCHH_0, TRXC_TCHH_0,
TRXC_TCHH_1, TRXC_TCHH_1,
@@ -58,6 +54,9 @@ enum trx_chan_type {
TRXC_SACCH8_5, TRXC_SACCH8_5,
TRXC_SACCH8_6, TRXC_SACCH8_6,
TRXC_SACCH8_7, TRXC_SACCH8_7,
TRXC_PDTCH,
TRXC_PTCCH,
TRXC_CBCH,
_TRX_CHAN_MAX _TRX_CHAN_MAX
}; };
@@ -65,37 +64,31 @@ enum trx_chan_type {
#define GPRS_BURST_LEN GSM_BURST_LEN #define GPRS_BURST_LEN GSM_BURST_LEN
#define EGPRS_BURST_LEN 444 #define EGPRS_BURST_LEN 444
enum trx_mod_type { enum trx_burst_type {
TRX_MOD_T_GMSK, TRX_BURST_GMSK,
TRX_MOD_T_8PSK, TRX_BURST_8PSK,
TRX_MOD_T_AQPSK,
};
/* A set of measurements belonging to one Uplink burst */
struct l1sched_meas_set {
uint32_t fn; /* TDMA frame number */
int16_t toa256; /* Timing of Arrival (1/256 of a symbol) */
int16_t ci_cb; /* Carrier-to-Interference (cB) */
float rssi; /* RSSI (dBm) */
}; };
/* States each channel on a multiframe */ /* States each channel on a multiframe */
struct l1sched_chan_state { struct l1sched_chan_state {
/* Pointer to the associated logical channel state from gsm_data_shared.
* Initialized during channel activation, thus may be NULL for inactive
* or auto-active channels. Always check before dereferencing! */
struct gsm_lchan *lchan;
/* scheduler */ /* scheduler */
bool active; /* Channel is active */ uint8_t active; /* Channel is active */
ubit_t *dl_bursts; /* burst buffer for TX */ ubit_t *dl_bursts; /* burst buffer for TX */
enum trx_mod_type dl_mod_type; /* Downlink modulation type */ enum trx_burst_type dl_burst_type; /* GMSK or 8PSK burst type */
uint8_t dl_mask; /* mask of transmitted bursts */
sbit_t *ul_bursts; /* burst buffer for RX */ sbit_t *ul_bursts; /* burst buffer for RX */
uint32_t ul_first_fn; /* fn of first burst */ uint32_t ul_first_fn; /* fn of first burst */
uint32_t ul_mask; /* mask of received bursts */ uint8_t ul_mask; /* mask of received bursts */
/* measurements */
uint8_t rssi_num; /* number of RSSI values */
float rssi_sum; /* sum of RSSI values */
uint8_t toa_num; /* number of TOA values */
int32_t toa256_sum; /* sum of TOA values (1/256 symbol) */
uint8_t ci_cb_num; /* number of C/I values */
int32_t ci_cb_sum; /* sum of C/I values (in centiBels) */
/* loss detection */ /* loss detection */
uint8_t lost_frames; /* how many L2 frames were lost */
uint32_t last_tdma_fn; /* last processed TDMA frame number */ uint32_t last_tdma_fn; /* last processed TDMA frame number */
uint32_t proc_tdma_fs; /* how many TDMA frames were processed */ uint32_t proc_tdma_fs; /* how many TDMA frames were processed */
uint32_t lost_tdma_fs; /* how many TDMA frames were lost */ uint32_t lost_tdma_fs; /* how many TDMA frames were lost */
@@ -106,20 +99,18 @@ struct l1sched_chan_state {
/* AMR */ /* AMR */
uint8_t codec[4]; /* 4 possible codecs for amr */ uint8_t codec[4]; /* 4 possible codecs for amr */
int codecs; /* number of possible codecs */ int codecs; /* number of possible codecs */
int lqual_cb_sum; /* sum of link quality samples (in cB) */ float ber_sum; /* sum of bit error rates */
int lqual_cb_num; /* number of link quality samples */ int ber_num; /* number of bit error rates */
uint8_t ul_ft; /* current uplink FT index */ uint8_t ul_ft; /* current uplink FT index */
uint8_t dl_ft; /* current downlink FT index */ uint8_t dl_ft; /* current downlink FT index */
uint8_t ul_cmr; /* current uplink CMR index */ uint8_t ul_cmr; /* current uplink CMR index */
uint8_t dl_cmr; /* current downlink CMR index */ uint8_t dl_cmr; /* current downlink CMR index */
uint8_t amr_last_dtx; /* last received dtx frame type */ uint8_t amr_loop; /* if AMR loop is enabled */
/* TCH/H */ /* TCH/H */
uint8_t dl_ongoing_facch; /* FACCH/H on downlink */ uint8_t dl_ongoing_facch; /* FACCH/H on downlink */
uint8_t ul_ongoing_facch; /* FACCH/H on uplink */ uint8_t ul_ongoing_facch; /* FACCH/H on uplink */
uint8_t dl_facch_bursts; /* number of remaining DL FACCH bursts */
/* encryption */ /* encryption */
int ul_encr_algo; /* A5/x encry algo downlink */ int ul_encr_algo; /* A5/x encry algo downlink */
int dl_encr_algo; /* A5/x encry algo uplink */ int dl_encr_algo; /* A5/x encry algo uplink */
@@ -128,14 +119,10 @@ struct l1sched_chan_state {
uint8_t ul_encr_key[MAX_A5_KEY_LEN]; uint8_t ul_encr_key[MAX_A5_KEY_LEN];
uint8_t dl_encr_key[MAX_A5_KEY_LEN]; uint8_t dl_encr_key[MAX_A5_KEY_LEN];
/* Uplink measurements */ /* measurements */
struct { struct {
/* Active channel measurements (simple ring buffer) */ int32_t toa256_sum; /* sum of TOA values (1/256 symbol) */
struct l1sched_meas_set buf[24]; /* up to 24 (BUFMAX) entries */ int toa_num; /* number of TOA value */
unsigned int current; /* current position */
/* Interference measurements */
int interf_avg; /* sliding average */
} meas; } meas;
/* handover */ /* handover */
@@ -143,32 +130,42 @@ struct l1sched_chan_state {
}; };
struct l1sched_ts { struct l1sched_ts {
struct gsm_bts_trx_ts *ts; /* timeslot we belong to */
uint8_t mf_index; /* selected multiframe index */ uint8_t mf_index; /* selected multiframe index */
uint8_t mf_period; /* period of multiframe */ uint8_t mf_period; /* period of multiframe */
const struct trx_sched_frame *mf_frames; /* pointer to frame layout */ const struct trx_sched_frame *mf_frames; /* pointer to frame layout */
struct llist_head dl_prims; /* Queue primitives for TX */ struct llist_head dl_prims; /* Queue primitives for TX */
struct rate_ctr_group *ctrs; /* rate counters */
/* Channel states for all logical channels */ /* Channel states for all logical channels */
struct l1sched_chan_state chan_state[_TRX_CHAN_MAX]; struct l1sched_chan_state chan_state[_TRX_CHAN_MAX];
}; };
struct l1sched_trx {
struct gsm_bts_trx *trx;
struct l1sched_ts ts[TRX_NR_TS];
};
struct l1sched_ts *l1sched_trx_get_ts(struct l1sched_trx *l1t, uint8_t tn);
/*! \brief how many frame numbers in advance we should send bursts to PHY */
extern uint32_t trx_clock_advance;
/*! \brief advance RTS.ind to L2 by that many clocks */
extern uint32_t trx_rts_advance;
/*! \brief last frame number as received from PHY */
extern uint32_t transceiver_last_fn;
/*! \brief Initialize the scheduler data structures */ /*! \brief Initialize the scheduler data structures */
void trx_sched_init(struct gsm_bts_trx *trx); int trx_sched_init(struct l1sched_trx *l1t, struct gsm_bts_trx *trx);
/*! \brief De-initialize the scheduler data structures */ /*! \brief De-initialize the scheduler data structures */
void trx_sched_clean(struct gsm_bts_trx *trx); void trx_sched_exit(struct l1sched_trx *l1t);
/*! \brief Handle a PH-DATA.req from L2 down to L1 */ /*! \brief Handle a PH-DATA.req from L2 down to L1 */
int trx_sched_ph_data_req(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); int trx_sched_ph_data_req(struct l1sched_trx *l1t, struct osmo_phsap_prim *l1sap);
/*! \brief Handle a PH-TCH.req from L2 down to L1 */ /*! \brief Handle a PH-TCH.req from L2 down to L1 */
int trx_sched_tch_req(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); int trx_sched_tch_req(struct l1sched_trx *l1t, struct osmo_phsap_prim *l1sap);
/*! \brief PHY informs us of new (current) GSM frame number */ /*! \brief PHY informs us of new (current) GSM frame number */
int trx_sched_clock(struct gsm_bts *bts, uint32_t fn); int trx_sched_clock(struct gsm_bts *bts, uint32_t fn);
@@ -180,25 +177,26 @@ int trx_sched_clock_started(struct gsm_bts *bts);
int trx_sched_clock_stopped(struct gsm_bts *bts); int trx_sched_clock_stopped(struct gsm_bts *bts);
/*! \brief set multiframe scheduler to given physical channel config */ /*! \brief set multiframe scheduler to given physical channel config */
int trx_sched_set_pchan(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config pchan); int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
enum gsm_phys_chan_config pchan);
/*! \brief set all matching logical channels active/inactive */ /*! \brief set all matching logical channels active/inactive */
int trx_sched_set_lchan(struct gsm_lchan *lchan, uint8_t chan_nr, uint8_t link_id, bool active); int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_id,
int active);
/*! \brief set uplink access on given logical channels active/inactive */
int trx_sched_set_ul_access(struct gsm_lchan *lchan, uint8_t chan_nr, bool active);
/*! \brief set all logical channels of BCCH/CCCH active/inactive */
int trx_sched_set_bcch_ccch(struct gsm_lchan *lchan, bool active);
/*! \brief set mode of all matching logical channels to given mode(s) */ /*! \brief set mode of all matching logical channels to given mode(s) */
int trx_sched_set_mode(struct gsm_bts_trx_ts *ts, uint8_t chan_nr, uint8_t rsl_cmode, int trx_sched_set_mode(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t rsl_cmode,
uint8_t tch_mode, int codecs, uint8_t codec0, uint8_t codec1, uint8_t tch_mode, int codecs, uint8_t codec0, uint8_t codec1,
uint8_t codec2, uint8_t codec3, uint8_t initial_codec, uint8_t codec2, uint8_t codec3, uint8_t initial_codec,
uint8_t handover); uint8_t handover);
/*! \brief set ciphering on given logical channels */ /*! \brief set ciphering on given logical channels */
int trx_sched_set_cipher(struct gsm_lchan *lchan, uint8_t chan_nr, bool downlink); int trx_sched_set_cipher(struct l1sched_trx *l1t, uint8_t chan_nr, int downlink,
int algo, uint8_t *key, int key_len);
/* \brief close all logical channels and reset timeslots */
void trx_sched_reset(struct l1sched_trx *l1t);
/* frame structures */ /* frame structures */
struct trx_sched_frame { struct trx_sched_frame {
@@ -229,17 +227,13 @@ struct trx_sched_multiframe {
int find_sched_mframe_idx(enum gsm_phys_chan_config pchan, uint8_t tn); int find_sched_mframe_idx(enum gsm_phys_chan_config pchan, uint8_t tn);
/*! Determine if given frame number contains SACCH (true) or other (false) burst */ /*! Determine if given frame number contains SACCH (true) or other (false) burst */
bool trx_sched_is_sacch_fn(const struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink); bool trx_sched_is_sacch_fn(struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink);
extern const struct trx_sched_multiframe trx_sched_multiframes[]; extern const struct trx_sched_multiframe trx_sched_multiframes[];
#define TRX_BI_F_NOPE_IND (1 << 0) #define TRX_BI_F_NOPE_IND (1 << 0)
#define TRX_BI_F_MOD_TYPE (1 << 1) #define TRX_BI_F_MOD_TYPE (1 << 1)
#define TRX_BI_F_TS_INFO (1 << 2) #define TRX_BI_F_TS_INFO (1 << 2)
#define TRX_BI_F_CI_CB (1 << 3) #define TRX_BI_F_CI_CB (1 << 3)
#define TRX_BI_F_TRX_NUM (1 << 4)
#define TRX_BI_F_BATCH_IND (1 << 5)
#define TRX_BI_F_SHADOW_IND (1 << 6)
#define TRX_BI_F_ACCESS_BURST (1 << 7)
/*! UL burst indication with the corresponding meta info */ /*! UL burst indication with the corresponding meta info */
struct trx_ul_burst_ind { struct trx_ul_burst_ind {
@@ -253,80 +247,17 @@ struct trx_ul_burst_ind {
int8_t rssi; /*!< Received Signal Strength Indication */ int8_t rssi; /*!< Received Signal Strength Indication */
/* Optional fields (defined by flags) */ /* Optional fields (defined by flags) */
enum trx_mod_type mod; /*!< Modulation type */ enum trx_burst_type bt; /*!< Modulation type */
uint8_t tsc_set; /*!< Training Sequence Set */ uint8_t tsc_set; /*!< Training Sequence Set */
uint8_t tsc; /*!< Training Sequence Code */ uint8_t tsc; /*!< Training Sequence Code */
int16_t ci_cb; /*!< Carrier-to-Interference ratio (in centiBels) */ int16_t ci_cb; /*!< Carrier-to-Interference ratio (in centiBels) */
uint8_t trx_num; /*!< TRX (RF channel) number */
/* Used internally by the PDU parser */
uint8_t _num_pdus; /*!< Number of processed PDUs */
/* Internally used by the scheduler */
enum trx_chan_type chan;
uint8_t bid;
/*! Burst soft-bits buffer */ /*! Burst soft-bits buffer */
sbit_t burst[EGPRS_BURST_LEN]; sbit_t burst[EGPRS_BURST_LEN];
size_t burst_len; size_t burst_len;
}; };
#define TRX_BR_F_FACCH (1 << 0)
/*! DL burst request with the corresponding meta info */
struct trx_dl_burst_req {
uint8_t flags; /*!< see TRX_BR_F_* */
/* Mandatory fields */
uint32_t fn; /*!< TDMA frame number */
uint8_t tn; /*!< TDMA timeslot number */
uint8_t att; /*!< Tx power attenuation */
int8_t scpir; /*!< SCPIR (for AQPSK only) */
uint8_t trx_num; /*!< TRX (RF channel) number */
enum trx_mod_type mod; /*!< Modulation type */
uint8_t tsc_set; /*!< Training Sequence Set */
uint8_t tsc; /*!< Training Sequence Code */
/* Internally used by the scheduler */
enum trx_chan_type chan;
uint8_t bid;
/*! Burst hard-bits buffer */
ubit_t burst[EGPRS_BURST_LEN];
size_t burst_len;
};
/*! Handle an UL burst received by PHY */ /*! Handle an UL burst received by PHY */
int trx_sched_route_burst_ind(const struct gsm_bts_trx *trx, struct trx_ul_burst_ind *bi); int trx_sched_ul_burst(struct l1sched_trx *l1t, struct trx_ul_burst_ind *bi);
int trx_sched_ul_burst(struct l1sched_ts *l1ts, struct trx_ul_burst_ind *bi);
/* Averaging mode for trx_sched_meas_avg() */ #endif /* TRX_SCHEDULER_H */
enum sched_meas_avg_mode {
/* first 22 of last 24 bursts (for TCH/F14.4, TCH/F9.6, TCH/F4.8) */
SCHED_MEAS_AVG_M_S24N22,
/* last 22 bursts (for TCH/H4.8, TCH/H2.4) */
SCHED_MEAS_AVG_M_S22N22,
/* last 4 bursts (default for xCCH, PTCCH and PDTCH) */
SCHED_MEAS_AVG_M_S4N4,
/* last 8 bursts (default for TCH/F and FACCH/F) */
SCHED_MEAS_AVG_M_S8N8,
/* first 4 of last 6 bursts (default for TCH/H) */
SCHED_MEAS_AVG_M_S6N4,
/* last 6 bursts (default for FACCH/H) */
SCHED_MEAS_AVG_M_S6N6,
/* first 4 of last 8 bursts */
SCHED_MEAS_AVG_M_S8N4,
/* first 2 of last 6 bursts */
SCHED_MEAS_AVG_M_S6N2,
/* middle 2 of last 6 bursts */
SCHED_MEAS_AVG_M_S4N2,
};
void trx_sched_meas_push(struct l1sched_chan_state *chan_state,
const struct trx_ul_burst_ind *bi);
void trx_sched_meas_avg(const struct l1sched_chan_state *chan_state,
struct l1sched_meas_set *avg,
enum sched_meas_avg_mode mode);
uint32_t trx_sched_lookup_fn(const struct l1sched_chan_state *chan_state,
const unsigned int shift);

View File

@@ -1,18 +1,20 @@
#pragma once #pragma once
#define LOGL1S(subsys, level, l1ts, chan, fn, fmt, args ...) \ #define LOGL1S(subsys, level, l1t, tn, chan, fn, fmt, args ...) \
LOGP(subsys, level, "%s %s %s: " fmt, \ LOGP(subsys, level, "%s %s %s: " fmt, \
gsm_fn_as_gsmtime_str(fn), \ gsm_fn_as_gsmtime_str(fn), \
gsm_ts_name((l1ts)->ts), \ gsm_ts_name(&(l1t)->trx->ts[tn]), \
chan >=0 ? trx_chan_desc[chan].name : "", ## args) chan >=0 ? trx_chan_desc[chan].name : "", ## args)
/* Logging helper adding context from trx_{ul,dl}_burst_{ind,req} */ typedef int trx_sched_rts_func(struct l1sched_trx *l1t, uint8_t tn,
#define LOGL1SB(subsys, level, l1ts, b, fmt, args ...) \ uint32_t fn, enum trx_chan_type chan);
LOGL1S(subsys, level, l1ts, (b)->chan, (b)->fn, fmt, ## args)
typedef int trx_sched_rts_func(const struct l1sched_ts *l1ts, const struct trx_dl_burst_req *br); typedef ubit_t *trx_sched_dl_func(struct l1sched_trx *l1t, uint8_t tn,
typedef int trx_sched_dl_func(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br); uint32_t fn, enum trx_chan_type chan,
typedef int trx_sched_ul_func(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi); uint8_t bid, uint16_t *nbits);
typedef int trx_sched_ul_func(struct l1sched_trx *l1t, enum trx_chan_type chan,
uint8_t bid, const struct trx_ul_burst_ind *bi);
struct trx_chan_desc { struct trx_chan_desc {
/*! \brief Human-readable name */ /*! \brief Human-readable name */
@@ -29,45 +31,57 @@ struct trx_chan_desc {
trx_sched_dl_func *dl_fn; trx_sched_dl_func *dl_fn;
/*! \brief function to call when burst received from PHY */ /*! \brief function to call when burst received from PHY */
trx_sched_ul_func *ul_fn; trx_sched_ul_func *ul_fn;
/*! \brief function to call when NOPE.ind received from PHY */
trx_sched_ul_func *nope_fn;
/*! \brief channel flags, see TRX_CHAN_FLAG_* */ /*! \brief channel flags, see TRX_CHAN_FLAG_* */
uint8_t flags; uint8_t flags;
}; };
extern const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX]; extern const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX];
extern const ubit_t _sched_dummy_burst[]; extern const ubit_t _sched_tsc[8][26];
extern const ubit_t _sched_train_seq_gmsk_nb[4][8][26]; extern const ubit_t _sched_egprs_tsc[8][78];
extern const ubit_t _sched_train_seq_8psk_nb[8][78]; extern const ubit_t _sched_fcch_burst[148];
extern const ubit_t _sched_train_seq_gmsk_sb[64]; extern const ubit_t _sched_sch_train[64];
struct msgb *_sched_dequeue_prim(struct l1sched_ts *l1ts, const struct trx_dl_burst_req *br); struct msgb *_sched_dequeue_prim(struct l1sched_trx *l1t, int8_t tn, uint32_t fn,
enum trx_chan_type chan);
int _sched_compose_ph_data_ind(struct l1sched_ts *l1ts, uint32_t fn, int _sched_compose_ph_data_ind(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, enum trx_chan_type chan, uint8_t *l2,
const uint8_t *data, size_t data_len, uint8_t l2_len, float rssi,
uint16_t ber10k, float rssi,
int16_t ta_offs_256bits, int16_t link_qual_cb, int16_t ta_offs_256bits, int16_t link_qual_cb,
uint16_t ber10k,
enum osmo_ph_pres_info_type presence_info); enum osmo_ph_pres_info_type presence_info);
int _sched_compose_tch_ind(struct l1sched_ts *l1ts, uint32_t fn, int _sched_compose_tch_ind(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, enum trx_chan_type chan, uint8_t *tch, uint8_t tch_len);
const uint8_t *data, size_t data_len,
uint16_t ber10k, float rssi,
int16_t ta_offs_256bits, int16_t link_qual_cb,
uint8_t is_sub);
int tx_fcch_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br); ubit_t *tx_idle_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
int tx_sch_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br); enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
int tx_data_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br); ubit_t *tx_fcch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
int tx_pdtch_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br); enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
int tx_tchf_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br); ubit_t *tx_sch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
int tx_tchh_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br); enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
ubit_t *tx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
ubit_t *tx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
ubit_t *tx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
ubit_t *tx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
int rx_rach_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
uint8_t bid, const struct trx_ul_burst_ind *bi);
int rx_data_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
uint8_t bid, const struct trx_ul_burst_ind *bi);
int rx_pdtch_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
uint8_t bid, const struct trx_ul_burst_ind *bi);
int rx_tchf_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
uint8_t bid, const struct trx_ul_burst_ind *bi);
int rx_tchh_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
uint8_t bid, const struct trx_ul_burst_ind *bi);
int rx_rach_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi); const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn,
int rx_data_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi); uint32_t fn, uint16_t *nbits);
int rx_pdtch_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi); int _sched_rts(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn);
int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi); void _sched_act_rach_det(struct l1sched_trx *l1t, uint8_t tn, uint8_t ss, int activate);
int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi);
void _sched_dl_burst(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br);
int _sched_rts(const struct l1sched_ts *l1ts, uint32_t fn);
void _sched_act_rach_det(struct gsm_bts_trx *trx, uint8_t tn, uint8_t ss, int activate);

Some files were not shown because too many files have changed in this diff Show More