Commit Graph

72 Commits

Author SHA1 Message Date
Harald Welte 6381900677 split scheduler_mframe.c from scheduler.c
There are use cases for the multiframe scheduler tables outside the
context of the entire scheduler. Let's prepare for that.

Related: OS#2978
Change-Id: I6a501e66c47809ae3cdc55bef2cb6390ee0096b1
2018-02-26 15:01:08 +01:00
Harald Welte 232f53adf0 osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame number
Measurement reports fed into L1SAP so far had their frame number always
set to zero, resulting in higher-layer common code above L1SAP to never
detect the end of the measurement period, which in turn caused no RSL
MEAS REP to be sent.

Related: OS#2978
Change-Id: I67837d19515ea335614928570c12dd5027104c6b
2018-02-23 14:05:51 +00:00
Harald Welte ac0254c000 osmo-bts-virtual: Make use of LOGL1S() macro for context
In Change-Id I5703b46c8a59fe00a3cdc063bcf72872980ec5e5 we introduced
LOGL1S and starte to use in in common/scheduler.c as well as
osmo-bts-trx but somehow we didn't introduce it in osmo-bts-virtual
at the time.  Let's catch up.

Change-Id: I0b5fd3b7982b9119becda844531108f64c68d19f
2018-02-22 12:31:51 +01:00
Harald Welte 6eb3752511 Introduce + use LOG/DEBUGP with frame number prefixing/printing
Let's make sure whenever we do have a frame number, we print it as
context in the related log line

Change-Id: I751d5ddb3322fce489bc241459738cbcc55c890b
2018-02-22 12:31:48 +01:00
Harald Welte 22c07d1f1f osmo-bts-virtual: Generate PRIM_INFO_MEAS (with bogus values)
The problem is that measurement processing above L1SAP requires/expects
those PRIM_INFO_MEAS indications from the bts specific parts.  Otherwise
it will never generate even uplink-only measurement reports to the BSC,
which is a violation of Abis protocol specs.

Change-Id: I48f73293cb4f0ab4c657dfd00e7ddd032a3c030f
2018-02-22 12:11:28 +01:00
Harald Welte 04719d19b9 osmo-bts-virtual: Shut down gracefully on socket creation failure
Don't simply crash if creation of the multicast socket fails

Change-Id: Ie87b6684b3aa7f21742e4cf21533e980485c1230
2018-02-22 12:11:28 +01:00
Philipp Maier bfe9af4ae1 octphy: ensure all BTS models set features
Most of the BTS models do not or do register not all of thier
features to the the feature list.

- Update/extend the feature lists for all BTS-Models

Change-Id: I26765a64153368016921c2ac115b1c4aec9bc5e4
2018-02-22 07:58:26 +00:00
Pau Espin f9d19ee85c virtual: l1_if.c: Remove unneeded warning message
Commit 5eb17e28ac added this warning when
implementing the full function. However, other backends seem to be also
passing the primitive from the stack to l1sap_up without any visible issues.
Furthermore, according to the documentation of l1sap_up, it takes ownership of the
msgb, but doesn't take ownserhip of the prim itself.

Change-Id: I45fe40e3377eac999d1dac5356678195381d94ca
2018-02-05 12:36:41 +01:00
Harald Welte cbcd3c5034 scheduler_trx: L1P is for PH (data), L1M for MPH (control)
Almost all log statements in scheduler_trx.c were using the wrong
logging subsystem.  Let's fix this.  Also, make it more obvious from
the log subsystem help text

Change-Id: I4312f8ab0414eb38db0d62f05c95ab961f500c14
2017-12-02 21:05:34 +01:00
Max ec33b0397f Remove build dependency on legacy OpenBSC
* copy-paste gsm_data_shared.* from OpenBSC master
* remove corresponding configure check and option
* remove .deb dependency

Actual refactoring with removal of unnecessary structures/parts, moving
common OpenBSC/OsmoBSC parts into libraries etc. are left for further
patches.

Current patch will make coexistence with *BSC easier and will simplify
our build infrastructure.

Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13
Related: OS#1923
2017-10-08 18:40:09 +02:00
Alexander Chemeris 2bbf98afa3 Fix static build of osmo-bts-trx and osmo-bts-virtual.
New libosmocore has some plugin system which requires dlopen(). So we need
to make sure we always link with libdl, even when building statically.

Note that this doesn't fix static build of tests - they are still failing
with some errors.

Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e
2017-08-20 19:29:30 +00:00
Harald Welte d1f8001cdf VIRT-BTS: Support for GPRS
Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc
2017-08-09 10:02:33 +00:00
Harald Welte d6da809d2f TRX / VIRT-PHY: Make check for BCCH/CCCH more specific
In bts_model_l1sap_down() we want to identify BCCH/CCCH channel numbers,
but our check is a bit non-specific.  Let's make the check more specific
to only cover the BCCH, Uplink CCCH and Downlink CCCH C-bits as defined
n 3GPP TS 08.58 Section 9.3.1

Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67
2017-07-30 17:38:37 +02:00
Harald Welte 69e0461674 VIRT-PHY: Print NOTICE log message from unimplemented stubs
There are plenty of functions stubbed out in osmo-bts-virtual, let's
print a NOTICE level log message to be able to correlate any kind of
erroneous behavior with the fact that a given function has no actual
implementation.

Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa
2017-07-30 17:38:33 +02:00
Harald Welte d7546ed090 VIRT-PHY: Report virtual RACH bursts with plausible burst type
Change-Id: I35b103c512993fc52d4e608f07115a4bb4b21022
2017-07-19 16:02:25 +02:00
Harald Welte f66d2fc1e6 virt: Don't print NOTICE log message if ARFCN doesn't match
In a larger simulated network with multiple BTSs it is normal that one
BTS will see GSMTAP frames for an ARFCN that is not an ARFCN used by the
local BTS.  This is just normal operation.

Change-Id: Ic68cace9648ccb17500c94b6ede8814674aa9c29
2017-07-19 16:02:25 +02:00
Harald Welte 576408b651 VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0
It is important that we reliably terminate the BTS in case any of the
VirtPHY multicast sockets dies for whatever reason.

Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13
2017-07-13 21:35:33 +02:00
Harald Welte e3b8279f26 VIRT-PHY: Use IPv4 multicast groups for private / local scope
The addresses in the original code make little sense:
* 224.0.0.1 is "All systems on this subnet" and not routed
  outside the local ethernet segment
* 225.0.0.1 is in a RESERVED range that shouldn't be used

Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f
2017-07-13 21:35:33 +02:00
Sebastian Stumpf 6feae225eb VIRT-PHY: Added test option for fast hyperframe repeat.
Frame number will restart at 0 after each superframe (approx. 6.1 sec)
if enabled. Can be enabled by preprocessor define.

Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9
2017-07-13 21:35:33 +02:00
Harald Welte 3cda4ff532 VIRT-PHY: Fix handling of default values for vty configuration
The defaults must be set during bts_model_phy_link_set_defaults()
and can then later be overridden by the vty (from the config file).

They should only be written back to the file if they differ from
the default settings.

Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96
2017-07-13 21:35:33 +02:00
Sebastian Stumpf 1f45db0ff5 VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0.
Timeslot is not encoded in the chan_nr accessible in the channel
description but was taken from there and so it was always 0.

Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82
2017-07-13 21:35:33 +02:00
Harald Welte 5eb17e28ac VIRT-PHY: Initial check-in of a new virtual BTS
This patch adds a virtual physical layer designed to simulate the
Um air interface between BTS and MS.  It does so by encapsulating MAC
blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP
streams, both in uplink and in downlink.

The purpose of this is enable testing without any radio hardware or
related licenses.

OsmocomBB has recently received as similar patch-set, adding a virty_phy
executable that can be run on a PC instead of the classic 'layer1'
firmware on a real phone.

Using GSMTAP means that one can use unmodified wireshark to decode the
messages exchanged on the virtual Um layer.

This code was originally started by Harald in January 2016, continued
by Sebastian Stumpf in late 2016 and early 2017, and finally completed
by Harald in July 2017.

Change-Id: I1bf7670975b1e367c1c62983020865a043542622
2017-07-13 19:34:17 +00:00