Commit Graph

214 Commits

Author SHA1 Message Date
Philipp Maier bf87717cc8 measurement: add SUB measurements in test_lchan_meas_process_measurement
The unit-test function test_lchan_meas_process_measurement() does not
tag measurements as SUB. Lets make the test function more realistic by
setting the is_sub flag at the correct positions.

- Add SUB-Measurements in the correct position
- Print log lines when adding measurements for sub, also fix
  minor bugs in the log printing.

Change-Id: I25c361b21a406c0017ee586f0492c38f2e737e57
Related: OS#3502
Related: OS#2975
2018-08-30 12:45:53 +00:00
Philipp Maier 9680a4746f measurement: substitue missing measurements
At the moment the measurement calculation of osmo-bts works by
collecting the measurement reports the phy emits during a measurement
interval. Normally one would expect a well defind fixed number here, but
some phys will not emit a measurement report for lost blocks. Also
blocks and their reports may get lost because of cpu overload etc.

The computation that is executed at the end of the measurement interval
computes over all received measurement. This evenutally means that
missing measurements will not taken into account and the result will
look better than it is in reality.

To fix this, the interval must be of a defined size and in cases where
less measurements as expected were collected, the algorithm must assume
they have been received with a 100%BER and take that into account.
However, all RSSI and TA/TOA related computations should continue to
rely on actual measurement data.

- make sure the algorithm works over a fixed interval
- replace missing measurements with 100%BER
- fix and extend unit-tests

Change-Id: Idd30fc07603ad7d042c1fb416e247c3bf7d35c8b
Related: OS#2987
2018-08-30 09:12:59 +02:00
Philipp Maier fb70a2edda cosmetic: test_is_meas_overdue() does not test is_meas_complete()
The function is_meas_overdue() does not use is_meas_complete() anymore
and therefore the related log output is wrong. Lets correct this.

Change-Id: I9b7aa2f7a7c75bc3eed0c94b6ef9d17e7e36ce96
Related: OS#2975
2018-08-29 17:04:59 +00:00
Philipp Maier 324a3cd66e measurement: fix is_meas_overdue() and increase testcoverage
The tests TC_meas_res_sign_sdcch4 and TC_meas_res_sign_sdcch8 are
failing mainly because lchan->ts->nr is confused with lchan->nr.
There is also a small problem with one of the formulas that compute
fn_missed_end.

- Add explainatory comment to the lookup tables on what the index
  is refering to
- use lchan-nr instead of lchan->ts->nr when dealing with SDCCH/4/8
- simplfy and fix the formula
- increase the testcoverage of the unit tests, give SDCCH/4/8 also
  a thorough check.

Change-Id: I5d555a21003943bf720c53f3a611029ba45339a9
Related: OS#2975
2018-08-29 17:04:59 +00:00
Philipp Maier 9b41b36e97 measurement: add unit tests for ts45008_83_is_sub()
The function ts45008_83_is_sub() is an integral part of the measurement
calculation as it automatically tags incoming measurements as SUB
measurements. This is important in the context of DTX. Unfortunately
there is no unit test for this function yet.

- Add unit test for ts45008_83_is_sub()

Change-Id: Ia26774859f4bf31baee075896905079368bddd42
Related: OS#3502
2018-08-29 17:34:49 +02:00
Philipp Maier 510158256b measurement: add unit tests for is_meas_complete()
We do not test is_meas_complete() individually yet, but it is an
integral part of the measurement processings since this function decides
where a measurement interval ends.

- Add unit tests that test TCH/F, TCH/H, SDCCH/4 and STDCH/8

Change-Id: I8f89d9e7092cd65ba4d5c5649140692dcc20bdd6
Related: OS#2987
2018-08-29 07:35:57 +00:00
Philipp Maier 9f5203d243 cosmetic: remove wrong comment
is_meas_overdue() does not use is_meas_complete() anymore.

Change-Id: I5925fad161843c06e76543d9098c598fe9e72d68
Related: OS#2975
2018-08-28 16:55:22 +02:00
Philipp Maier 02c79f12a4 cosmetic: fix sourcecode formatting
Change-Id: Ia112af0b63478bdcf3cfab2537dc1ba08e03dfb1
Related: OS#2975
2018-08-28 16:54:59 +02:00
Philipp Maier 4553890d70 measurement: make sure measurement interval end is detected
the measurement interval end is detected by using the measurement
indication that is related to the SACCH block as a trigger to start the
computation. If the measurement indication for the SACCH gets lost
because the block could not be received then the processing is not
executed. This may cause wrong results or when it happens condecutively
an overflow of the measurement sample buffer.

- Store the frame number of the last received measurement indication
- Use the stored frame number to check if an interval was crossed when
  the next measurement indication is received. If we detect that we
  missed the interval, catch up by running the computation and
  start the next interval.

Change-Id: I3a86cd8185cc6b94258373fe929f0c2f1cf27cfa
Related: OS#2975
2018-08-20 18:27:28 +02:00
Philipp Maier 1c3240c2f1 cosmetic: separate measurement testcase definitions
the testcase definitions in meas_test.c that define different test
situations for uplink measurement are quite large. Lets have them in a
separate file so that the code meas_test.c is easier to maintain.

- Move all mtc* and ulm* structs as well as the struct definitions
  to meas_testcase.h.

Change-Id: I90139ec535056d2cea6de10e77f435d807ce496e
Related: OS#2987
2018-08-16 18:14:10 +02:00
Pau Espin 500b7945f0 Remove unneeded direct libortp dependency
All code in osmo-bts goes through APIs in libosmotrau (osmo_ortp.h),
hence direct dependency is not needed. Fixes OBS warnings:

dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-trx/usr/bin/osmo-bts-trx was not linked against libortp.so.9 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-virtual/usr/bin/osmo-bts-omldummy debian/osmo-bts-virtual/usr/bin/osmo-bts-virtual were not linked against libortp.so.9 (they use none of the library's symbols)

Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de
2018-07-02 16:36:14 +02:00
Harald Welte b7b5c4219c Add min/max/std-dev measurement reporting for TOA256
This patch adds extended processing of the high-resolution TOA256
measurement values.  It adds reporting of the following values
for each RSL MEAS REP for uplink measurements:
* minimum TOA256 value during reporting period
* maximum TOA256 value during reporting period
* standard deviation of  TOA256 value during reporting period

Change-Id: Iea4a4781481f77c6163d82dcd71a844a5be87bf2
2018-06-29 17:53:20 +00:00
Pau Espin 868c67fed3 compact AGCH queue: Drop too msg diff than IMM_ASS_REJ
We saw in a recent prod setup a BSC with saturated channels. Further
investigation lead to a AGCH queue of 1000 (previous hard_limit)
messages, most of them being regular IMM ASSIGN (non REJ). Hence, we
also want to get rid of other messages in the AGCH queue (like regular
IMM ASSIGN).

Furthermore, In this scenario, sending IMM ASS REJ is as important as other
messages given than nowadays we support dynamic wait indicatior
(calculated based on chan load), which means if we reach the MS, we can
tell it to wait for a long time to reach us again, which is desirable.

Change-Id: I022b8948da8be13fb8f4bc36e7c9dab11c35fddb
2018-06-08 17:03:06 +02:00
Pau Espin a1a2556c2a bts_agch_enqueue: Decrease queue len hard_limit from 1000 to 100
In a prod setup, complete channel saturation at the bsc was detected,
and Immediate Assignments were not being answered by the MS once sent by
the BTS.
Further investigation showed that the BTS was all the time printing
messages like this:
"bts.c:540 AGCH: too many messages in queue, refusing message type 0x3f, length = 1001/10"

So it seems the AGCH queue was becoming incredibly full (1000, hard
limit triggered the log), while acgch_queue.max_length was set to 10.

As a result, most probably the Immediate Assignments being sent to the
MS are super old in time, and the MS doesn't known about them anymore
once they are receivied, so no answer is sent back.

Let's try to avoid that by decreasing the hard limit so we never reach
that big queue_len scenario.

The number 100 is selected from data gatherered in agch_test.c which
prints a table of max_length values based on different setups. Some
values can reach around 80 messages, so let's use a slightly bigger hard
limit.

Related: SYS#2695
Change-Id: I272798c959abec123776d2fa8dad5685ec512fbd
2018-06-08 17:00:53 +02:00
Pau Espin 261b6fdc8f Include missing headers for osmo_init_logging2
Fixes implicit declaration warning messages at compile time.

Change-Id: I753ed49cdcbd1301ba7ea38dcea9113d99fecb06
2018-04-17 19:36:51 +00:00
Neels Hofmeyr 113e30cb06 use osmo_init_logging2() with proper talloc ctx
Completely drop bts_log_init(), call osmo_init_logging2() directly instead: all
callers of bts_log_init() passed NULL as category string, so all it ever did
was call osmo_init_logging(). The bts_log_info is already declared in the .h.

Here and there also define a proper talloc root context instead of using NULL.

Change-Id: Ic049f77bef74123b95350bcae182a468e0086b9c
2018-04-04 17:54:37 +02:00
Harald Welte d8cd756da4 Get rid of 'struct gsm_bts_role_bts'
gsm_bts_role_bts was introduced at a time when we still shared
gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently
needed a BTS-private structure.  Since that sharing was abandoned quite
some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away
with the bts/btsb dualism in a lot of the code.

Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
2018-03-17 13:40:03 +01:00
Harald Welte 7c4a22dbc4 cosmetic: Move agch_queue to sub-structure of gsm_bts_role_bts
Rathert han have 11 direct members of gsm_bts_role_bts, group them
into a sub-struct as ew do for other parts like interference, laod, ...

Change-Id: Iefecf4b70c1b11c650913f2ae3783718ffb8a36c
2018-03-17 12:24:29 +01:00
Philipp Maier a4bca11555 bts: use feature list instead of speech codec table
osmo-bts has a table of pchan/channel mode combinations for every
bts. This table models the codec capabilitys of the BTS hardware.
However, having the speech codec apabilities modeled inside the
BTS feature list would be much more comfortable and since the
feature list is communicated back to the BSC we would get the
codec capabilities inside the BSC domain as well.

- remove the pchan/channel mode tables
- set speech codec variants for each BTS type
- fix bts_supports_cm so that it queries the feature list

Change-Id: I977dc729ba856631245aedf76afd48eac92166f7
2018-02-22 07:58:26 +00:00
Philipp Maier bf1fea0928 rsl: do not allow MODE MODIFY request with unsupp. codec/rate
When the BSC sends a MODE MODIFY request with an unsupported
codec, the BTS must respond with a negative acknowledge.
Currently the codec parameter is not checked at all, which may
lead into malfunction or crash of the BTS.

- Introduce a mechanism to check the codec/rate against a
  table that is set up in the phy specific code.

- Add tables with supported codec/rate combinations for
  octphy, sysmobts, and trx.

Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023
Related: SYS#3212
2018-02-19 08:38:21 +00:00
Alexander Huemer 0e176264f4 various Makefile.am: add missing CFLAGS
Change-Id: I0717aaaf062a7c3c8b35520fa837b51fd6aed47f
2018-01-25 01:44:51 +01:00
Alexander Huemer d6d4b50911 cosmetic: Makefile.am whitespace
Change-Id: I480fbf85912de2ea3518a906b9edf23b1485e936
2018-01-25 01:39:06 +01:00
Max 71506d70d7 Move -I inside *INCDIR variable
Previouslywe could end-up passing empty '-I' to compilerif corresponding
_INCDIR variable was not defined during the ./configure step. This is
apparently tolerated by gcc but still seems like a wrong thingto
do. Let's fix this by moving -I inside of *_INCDIR.

Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9
2018-01-21 23:16:17 +01:00
Neels Hofmeyr f37fcc9c7b fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR)
Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66
2018-01-19 15:24:09 +01:00
Max e91723a967 fix build: tests/misc: missing libosmo-abis and -trau flags
Add missing LIBOSMOABIS_CFLAGS and LIBOSMOTRAU_CFLAGS.
Pair the _LIBS below the _CFLAGS in LDADD above (cosmetic).

Fixes the stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
                 from ../../include/osmo-bts/bts.h:4,
                 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory
 #include <osmocom/abis/e1_input.h>

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
2018-01-19 15:22:57 +01:00
Philipp Maier 5df57cb84c meas_test: fix header file references
The unittest module meas_test.c contains a lot of unused header
files as the result of a cut and paste error made earlier. Also
the reference to stdio.h is missing.

remove all header file references that are not needed.

add missing header reference to stdio.h

Change-Id: I167be096ed25a86b1114de1ada955822a0b42856
2018-01-10 11:10:28 +00:00
Philipp Maier 8f12047157 cosmetic: tests/agch: remove unused var "static_ilv"
remove unused const variable "static_ilv" from unit test "agch"

Change-Id: Ie724e2e5875020aa835b4cd57ab96966aee283e1
2017-12-11 12:57:17 +00:00
Philipp Maier 4a43618332 cosmetic: tests/power: remove unused var "ret"
remove unused variable "ret" in unit test "power"

Change-Id: Ied484e3e2d3006eb0f03516ceaed3e0e802d51e4
2017-12-11 12:57:17 +00:00
Philipp Maier 33942ed156 cosmetic: tests/Makefile.am: remove excess whitespace
Change-Id: I7090d46ae72183014e6c74d6ddb240af8d66e0b4
2017-12-10 22:12:35 +01:00
Philipp Maier 28cb32a74b cosmetic: meas_test: fix section comment
Change-Id: Id228620ccf5a40c8089ae1914d59b19e808ea151
2017-12-07 12:59:17 +00:00
Max bf9298eb0f Make power test more verbose
Power control loop test outputs next to nothing which is not very
helpful. Make it more verbose. While at it, also move duplicated code
into static function to make test cases less cluttered.

Change-Id: I0a5e65e23e62442ef8758ecbcf8e7820b4f15d7b
Related: OS#2223
2017-10-24 10:04:09 +00:00
Max fe291a97c2 Move power loop to generic tests
There's nothing sysmobts specific in this test so let's move it into
separate directory and run unconditionally. The test itself is unaltered
except for intro text.

Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397
Related: OS#2223
2017-10-23 18:13:13 +00: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
Harald Welte fb78397cbd Fix build after recent gsm_bts_alloc() change
In openbsc.git Change-Id I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
we changed the gsm_bts_alloc() function signature to include
a second argument (the BTS number).  This broke omso-bts, and this
commit is intended to make it build again.

Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf
2017-08-14 01:22:12 +02:00
Philipp Maier 65db0f5c41 measurement: fix measurment report
The end of the measurement reporting period is not aligned with the
SACCH block where the results are reported. The tables that are
used to detect the end of the measurement period are therefore
wrong. The frame number of the SACCH block must be used and not the
TDMA frame number (modulo 104) of the measurement reporing interval.

The tables are oriented to the frame number of the first SACCH block,
at the beginning of an interval. However, when a SACCH block is received
it will always contain the result of the recently passed measurement
reporting period.

To match the tables, introduce another lookup table to remap each
SACCH block that ends to the matching beginning block number.

Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924
2017-07-10 15:30:59 +00:00
Max 3aeb9301f4 Remove redundant test
After switching to libosmocoding there's no need in low-level bursts
test which is part of libosmocoding anyway.

Change-Id: Icb8caf62ac653a39a7a82f2225e8edeab7f5afb5
2017-05-22 09:37:27 +00:00
Max efbef50efc osmo-bts-trx: use libosmocoding
Remove built-in functions and use libosmocoding instead.

Change-Id: I1b41bb1a8de655639107ec1f3b75afc240fd316f
2017-05-22 09:37:26 +00:00
Max 9563039a2a Prepare for extended SI2quater support
SI2quater support as per 3GPP TS 44.018 will require chnages to the way
System Information is stored because it uses 1:n instead of 1:1 mapping
between SI type and generated SI content. This should not affect other
SI types though. To facilitate this transition:

* convert the code to always use GSM_LCHAN_SI helper instead of
  accessing buffer directly
* move duplicated code to inline function
* add logging for buffer truncation and corresponding length values

Requires I74e4e3cb86364cec869a1472a41b4a95af0d50dd in OpenBSC.

Change-Id: Ie97be6ead6ce6d2d425fbfac8429bb90afb95acc
Related: RT#8792
2017-05-09 09:10:45 +00:00
Harald Welte bbe90fd651 sysmobts: Don't start with 0dBm TRX output power before ramping
In case a system has a high-gain external PA (like a 40dB PA) connected
externally, we cannot simply switch the transceiver to 0 dBm in
trx_init() only to then start the ramping at much lower levels once the
PHJ completes in trx_init_compl_cb().  The result would be a short
0 + 40 dBm spike followed by later ramping.  We want to avoid that
spike, particularly its associated inrush current, so let's bring up the
board with smething very conservative like -50 dBm, and then ramp from
there.

Change-Id: I0ad91fce64f65e0213c9fcfde3390ace519055db
Fixes: SYS#3259
2017-04-06 18:41:01 +02:00
Max 9dfdf54d30 Check for suitable lchan type when detecting HO
Log error when handover RACH is detected on wrong channel: according to
3GPP TS 44.018 it can only be seen on SACCH and DCCH.

Change-Id: Iacbcc8441d6cfbb8f808948a8baddde1ebca488a
Related: OS#1898
2017-03-14 14:17:44 +00:00
Max b390dfb90d Fix typo in TCH/H interleaving table
According to Table 4 in 3GPP TS 45.003 j=11, b=3 case corresponds to
k=91 and not j=12 as was previously used.

Change-Id: Iad3cf545b2f7e16276466cc37dd7a1e7858467e5
2017-02-10 16:43:44 +01:00
Harald Welte 69d297ce75 Add new unit-test for transmit power computation code
This tests the computations of the tx_power.c code using sysmoBTS 1002,
1020, 1100 and 2050 values, as well as the power ramping code.

Change-Id: I1cc88d4c6edff326e2e67d4f869aa02c9b2b1ac5
2017-02-07 20:33:18 +00:00
Neels Hofmeyr 20363d165e bursts test: test_pdtch: pre-init result mem
Fixes: CID#57943
Change-Id: I4547f47c4150759d5c4ab790e34e91b784b03b39
2016-12-02 12:10:03 +00:00
Max 36153239bf Remove duplicated code
Remove lchan deactivation related code duplication to facilitate future
use for dynamic CCCH re-activation.

Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01 15:20:42 +00:00
Max 57b5fb8819 Fix tests linking with libosmocodec
Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459
2016-11-08 10:26:40 +00:00
Neels Hofmeyr 21142f7898 msgb ctx: use new msgb_talloc_ctx_init() in various main()s
Change-Id: I31d62d5e1f0b272985fdef5013270d385c4b988a
2016-10-14 01:23:28 +02:00
Max 7dffd553df DTX: move scheduling check inside repeat_last_sid
Note: this also require changes to properly link against libosmocodec -
see 2bb65be159dfdabf664fec569b343320301701b0 in libosmocore.

Change-Id: I96594cf3aa1013d505bd20069d5bf261d9a2aefb
2016-09-30 16:50:47 +02:00
Neels Hofmeyr 9375aa9a68 dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs
Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used
to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH.

All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT
or DEACT *NACK* to be sent to the BSC as soon as these messages are handled.

Also add stubs in tests.

Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d
2016-06-17 15:50:47 +00:00
Neels Hofmeyr bfc9ff3118 fix two compiler warnings: add two opaque struct declarations
Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025
2016-06-17 15:34:57 +00:00
Neels Hofmeyr 213db32e30 tests/stubs.c: remove unused stubs
Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b
2016-06-17 01:30:00 +00:00
Max 4582222757 Use libosmocodec for AMR RTP
Use libosmocodec function to parse RTP with AMR payload in sysmoBTS and
LC15. This replaces "manual" parsing of AMR frame with function covered
by test suite and makes adding DTXd support easier.

Related: OS#1563
Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9
Reviewed-on: https://gerrit.osmocom.org/204
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-12 15:43:19 +00:00
Harald Welte a02bf125ac port sysmobts to phy_link/phy_instance abstraction 2016-02-15 14:18:59 +01:00
Harald Welte 611ef23700 merge bts-specific main function into common/main.c:bts_main()
This removes a lot of copy+paste duplication between different BTS
models.
2016-01-22 09:09:09 +01:00
Harald Welte 6323d2e617 use existing #define for FR/EFR frame length (33/31) 2016-01-16 17:48:26 +01:00
Alexander Huemer 056c267b89 fix some format specifiers 2016-01-15 15:33:46 +01:00
Harald Welte 3c161bb7df tests/Makefile.am: Don't use sysmobts SUBDIRS twice
probably a git merge artefact of some sort...
2015-11-05 23:05:20 +01:00
Harald Welte 94da045be5 Don't blindly link against '-lortp' but use pkg-config for that
This also ensures that a missing ortp library dependency is discovered
at configure time already
2015-11-05 22:52:50 +01:00
Harald Welte 307bfc81c1 fixup tests after bts_model_adjst_ms_pwr 2015-09-22 16:41:32 +02:00
Alexander Chemeris 5becc4613a tests: Update busrsts_test build.
We've added logging calls to the bursts processing. Add logging facility
initializatoin to the test code.
2015-09-22 16:41:31 +02:00
Alexander Chemeris cf18dcd5fd tests: Update bursts_test to accommodate BER calculations. 2015-09-22 16:41:31 +02:00
Martin Hauke c9ddb2ba22 build: Use AM_CPPFLAGS in Makefile.am
Since automake 1.13 INCLUDES is depricated and causes a warning
Inspired from similar patches by Alexander Huemer for other osmocom
projects.
2015-09-22 16:41:30 +02:00
Martin Hauke 73d3f46994 tests: make tests for sysmobts conditional 2015-09-22 16:41:30 +02:00
Andreas Eversberg da0c44a9db Add test case for successful handover and unsuccessful handover 2015-09-22 16:41:29 +02:00
Andreas Eversberg c910a332b2 TRX: Support for TCH/H and GSM half rate transcoding 2015-09-22 16:41:27 +02:00
Andreas Eversberg 917cf7018b TRX: Add support for EFR transcoding 2015-09-22 16:41:27 +02:00
Andreas Eversberg d692b6e054 TRX: Replaced GSM 06.10 ordering table by table in libosmocodec 2015-09-22 16:41:26 +02:00
Andreas Eversberg 89e36c0e64 TRX: Cleanup of channel transcoding 2015-09-22 16:41:26 +02:00
Andreas Eversberg 450d32919a TRX: Add test code for PDTCH transcoding 2015-09-22 16:41:26 +02:00
Andreas Eversberg b9880bc812 TRX: Allow transcoding of TCH FR with MSB first (RTP) or LSB first (E1) 2015-09-22 16:41:26 +02:00
Andreas Eversberg 2c8787224f Fix: Check right result on bursts_test 2015-09-22 16:41:25 +02:00
Andreas Eversberg 74d63b7212 Add test routing to test transcoding of TCH FR / FACCH frames 2015-09-22 16:41:25 +02:00
Andreas Eversberg 7a0d11dd68 ABIS: Introduce bts_model_abis_close to indicate ABIS link failure.
sysmocom-bts model shuts down on link loss, but other models may not want
this, so shutdown is moved tor bts_model_abis_close of osmo-bts-sysmo.
2015-09-22 16:41:25 +02:00
Andreas Eversberg 1de7085d31 Add test code for testing GSM burst transcoding 2015-09-22 16:41:24 +02:00
Ivan Kluchnikov 2340b88ede fix: make sysmobts tests only when sysmobts is enabled 2015-09-22 16:41:24 +02:00
Harald Welte 819b50e1a7 move MS power control handling from sysmobts to common part
MS uplink power control is required in pretty much any BTS, and we
cannot assume that they PHY / L1 will always take care of it by
itself.   So the correspondign code is moved to common/power_control.c
and called from the generic part of L1SAP.

The corresponding VTY paramter has been moved from the sysmobts-specific
trx VTY node to the common BTS VTY node.
2015-09-22 16:39:05 +02:00
Harald Welte a313bb0a47 l1sap: Port code to new ciphering handling
... introduced in 2cc37035d7
2015-09-22 16:39:04 +02:00
Andreas Eversberg 5e90f2a809 Add BCCH message to PH-/MPH-/TCH-SAP interface
This first part moves BCCH message primitives from osmo-bts-sysmo to common
part. A new file "common/l1sap.c" is introduced to implement handling of
layer 1 messages from/to BTS model.
2015-09-22 16:39:02 +02:00
Holger Hans Peter Freyther b631bd21d2 power: Make it possible to force a power level
Use the standard RSL commands to order a logical channel
to use a fixed power level.

The code is not fully verified and there was a last minute
change to invoke bts_model_adjst_ms_pwr.
2015-02-05 22:32:53 +01:00
Holger Hans Peter Freyther 579651bf30 power/sysmobts: Add a manual ms power level control
Currently the DSP is instructed to achieve a given uplink
power target but there are circumstances (e.g. EMV testing)
where we need more control over it. The "manual/software/osmo"
power control can only be implemented per TRX and not per
lchan. Add a very very basic control that checks the MS Power
used by the phone, the actual receive level and then adjust
the power.

The code doesn't take the history into account, if the phone
can not reach the requested power level the code will be stuck
(e.g. no timeout based on multiframes). It has a mode for a
fixed power control but no way to set it yet.

The change of the mode requires a restart of the software.
2015-02-05 22:32:47 +01:00
Holger Hans Peter Freyther 7e10bd6401 misc: Fix up testcase after 5a03e129a6
In 5a03e129a6 we generalized the
structural parser so we need to update the expected behavior of
that routine.
2015-01-10 13:07:49 +01:00
Holger Hans Peter Freyther 8968b48643 sysmobts: Remove unused global variables
We do not need to have these variables anymore. Just remove them.
2014-12-16 15:12:56 +01:00
Holger Hans Peter Freyther 88d60a1f86 sysmobts: Add a unit test that checks of the behavior
We need to build a lot more code to be able to test these two
new routines. I didn't want to move the code to a utils file
as the check is called from a hot path. Add accessors to the
inlined variant to be used by the unit test.

While writing the unit tests I noticed that a re-transmission
of the ciphering command would lead to an attempt to enable
ciphering again. I am not sure that this MphConfig is idempotent.
2014-08-09 09:42:56 +02:00
Holger Hans Peter Freyther fcdfb690ca sysmobts: Add testcase for ETSI/12.21 message 2014-07-31 16:59:06 +02:00
Holger Hans Peter Freyther dbc2731887 sysmobts: Extend the testcase for a Osmo message as well 2014-07-31 16:58:48 +02:00
Holger Hans Peter Freyther 0655cac6f1 sysmobts: Verify the structure of IPA and OML messages
Extend the router to verify that the message received is
properly encoded. The code can deal with the basic structure
of ETSI OML and vendor specific messages for ip.access and
the osmocom project.
2014-07-31 16:58:26 +02:00
Holger Hans Peter Freyther b3d1779b96 tests: Move the "pcu_direct" symbol into the stubs to be shared 2014-07-31 14:55:03 +02:00
Holger Hans Peter Freyther eececf5fa9 sysmobts: Make it possible to slowly ramp up the output power
For systems with a bigger PA enabling the full output power at
once might draw more current than a power supply can provide. This
code will step up the output power in smaller steps to avoid this
situation.
2014-07-30 18:22:12 +02:00
Holger Hans Peter Freyther 7996134d2a common: Ignore "si.valid" outside of _MAX_SYSINFO_TYPE
Limit the range from 0 to (_MAX_SYSINFO_TYPE - 1) instead of
0 to 31. This way we will never access the lchan->si.buf[] out
of bounds. This is only a theoretical issue though as the code
filling the lchan->si.buf for the SACCH will not have valid
>= _MAX_SYSINFO_TYPE. Add a small regression test to check we
still schedule all SIs.

Fixes: CID 1040765
2014-05-22 21:17:49 +02:00
Holger Hans Peter Freyther a276b98236 oml: Indicate the kind of object passed as the void*
These routines do not pass the gsm_abis_mo and parsing the FOM
header of the msg does not seem to be a good idea either. Pass
in the OML object so that the model code can determine what the
void pointer is.
2014-03-26 18:01:55 +01:00
Andreas Eversberg 00b4e064ff handover: Add generic handling for handover
The BTS layer needs to inform the handover code when an access
burst has been received. In turn the handover layer will ask the
bts to modify the channel, it will schedule the physical information
inform the BSC with the HANDOVER DETECTION and waits for the BTS
layer to inform it about the first received frame to stop a timer.
2014-03-10 13:38:07 +01:00
Jacob Erlbeck 4fcda92d7b agch: Merge IMM.ASS.REJ if possible when enqueueing
This patch implements merging of IMMEDIATE ASSIGN REJECT messages as
suggested in GSM 08.58, 5.7. When a new IMM.ASS.REJ is to be appended
to the AGCH queue and the last message in that queue is of the same
type, the individual entries (up to 4 per message) of both messages
are extracted, combined and stored back. If there are less than 5
entries, all entries fit into the old message and the new one is
discarded. Otherwise, the old message will contain 4 entries and the
remaining ones are stored into the new one which is then appended to
the queue.

Ticket: SYS#224
Sponsored-by: On-Waves ehf
2014-03-10 13:07:35 +01:00
Jacob Erlbeck fae0149260 agch: Manage AGCH queue length
Currently, the AGCH queue length is not limited. This can lead to
large delays and network malfunction if there are many IMM.ASS.REJ
messages.

This patch adds two features:
- Don't accept msgs from the RSL layer when the queue is way too
  full (safety measure, mainly if bts_ccch_copy_msg() is not being
  called by the L1 layer, currently hard coded to 1000 messages)
- Selectively drop IMM.ASS.REJ from the queue output depending on the
  queue length

Ticket: SYS#224
Sponsored-by: On-Waves ehf
2014-03-10 09:40:04 +01:00
Jacob Erlbeck 7503540959 agch/pch: Use PCH for AGCH msgs
This patch extends paging_gen_msg() by adding an output parameter
is_empty that is true, if only a paging message with dummy entries
has been placed into buffer. This feature is then used by
bts_ccch_copy_msg() to insert an AGCH message if is_empty is true.

Ticket: SYS#224
Sponsored-by: On-Waves ehf
2014-03-10 09:22:24 +01:00
Jacob Erlbeck 2d725e77f7 agch/test: Add test for AGCH queue handling
The first test checks the AGCH may queue length computation.

The second test fills the queue by calling bts_agch_enqueue() with a
mix of IMM.ASS and IMM.ASS.REJ. Then it drains the queue by calling
bts_ccch_copy_msg(). After each of both steps, statistics are printed
out.

Sponsored-by: On-Waves ehf
2014-03-10 08:57:38 +01:00
Holger Hans Peter Freyther 3e110ae141 misc: Allow to cross-execute the testsuite using qemu
When cross-compiling osmo-bts/osmo-pcu one can not easily
execute the testsuite. By adding the OSMO_QEMU variable in
front of the normal execution we can execute the tests. This
should work for native and cross builds.

$ OSMO_QEMU="qemu-arm -L /opt/poky/1.1.2/sysroots/armv5te-poky-linux-gnueabi/" make check
2014-01-15 11:59:28 +01:00
Holger Hans Peter Freyther e968c4224d bts: Fix typos in the log messages 2013-11-27 10:43:01 +01:00
Holger Hans Peter Freyther d57e67e8da sysmobts: Fix the unit test after the internal band changes 2013-10-10 21:28:35 +02:00
Harald Welte d92774b4ac abis: delay l1if_reset() until OML link is established 2013-10-06 15:50:36 +02:00
Harald Welte 6d5dc060ea migrate away from our own abis.c code to libosmoabis
libosmoabis has a BTS-side implementation of the IPA protocol for years,
and osmo-bts should have used that all the time.  Unfortunately it had
its own local hack, this patch is migrating to the libosmocore
implementation.
2013-10-06 15:50:36 +02:00
Holger Hans Peter Freyther f169a75fc4 sysmobts: Introduce an auto-band config to ease DCS/DCS, PCS/PCS changes
During development one switches from GSM900 to GSM1800 and GSM850 to
GSM1900. This commit attempts to make this switch more easy.

GSM1800 and GSM1900 have overlapping ARFCNs. This means that the
mapping from bands to arfcn is not injective. Because of that I
removed the code to deduce the band from the ARFCN. This was done
in commit 8c3d807b3f. The auto-band
option allows to move between GSM900/GSM1800 and GSM850/GSM1900.

Add a simple testcase with these auto-band configurations.
2013-06-24 08:17:12 +02:00
Alexander Huemer d07ee75fc6 Makefile.am: Use AM_CPPFLAGS
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-06-12 08:01:00 +02:00
Holger Hans Peter Freyther dd2a51ed32 tests: Share the stub between the paging and ciphering tests 2013-02-27 10:44:43 +01:00
Holger Hans Peter Freyther faba73a812 sysmobts: Improve the shutdown of the DSP on exit
Issue the RfDeactivate.REQ before sending the MphClose.REQ. Ideally
we would issue MphClose.REQ after the RfDeactivate.CNF but this is
not possible right now.

The current approach makes the following warning of the DSP go away
on shutdown. This was tested with my E71 and an active silent-call
using a SDCCH.

DSP Warning:
[ERROR] : DeviceMng_ValidateL1Handle() => Invalid layer 1 handle
2013-02-27 10:44:01 +01:00
Holger Hans Peter Freyther 19cf0e81b3 ciphering: Handle ciphering support for A5/3 correctly
This was found and debugged by Sylvain. The BTS will always support
A5/0 so we do not keep track of that, the first bit of the flags is
used for A5/1, second for A5/2... but for RSL there is an offset to
go from RSL to A5(x). Add a testcase and change the code.
2012-12-26 18:55:54 +01:00
Daniel Willmann 5f408f934c tests: Don't delete atconfig in clean
This file is created in ./configure so we shouldn't remove it with make.

Otherwise ./configure && make clean && make check fails
with:

make[3]: *** No rule to make target `atconfig', needed by `check-local'.
Stop.
2012-12-26 11:31:30 +01:00
Holger Hans Peter Freyther 20c5702e0f paging: Update the test output to make the test pass 2012-12-22 14:44:00 +01:00
Holger Hans Peter Freyther bcae2abff8 openbsc: Prepare to allow to have the OpenBSC directory somewhere else
Right now osmo-bts requires access to one OpenBSC header file and
this requires that openbsc and osmo-bts git are in the same directory.
Begin with making the location of the OpenBSC sourcecode configurable.

This approach will allow to build osmo-bts on our Jenkins installation
but now has the risk of more code including the openbsc/*.h header files.
2012-12-20 19:02:37 +01:00
Andreas Eversberg 7daa093df7 PCU: Removed -P option, so GPRS support is always enabled 2012-07-26 21:14:02 +02:00
Holger Hans Peter Freyther 93c087892c tests: Use the right name for the struct (not that it matters) 2012-07-25 12:03:52 +02:00
Harald Welte e729a3d595 add missing stub functions to ensure paging_test compiles
FIXME: hlayer1 and l1if function calls are not acceptable in src/common !
2012-07-22 22:19:56 +02:00
Andreas Eversberg 1195148fc6 Send RR paging requests to PCU, in order to page on PACCH 2012-07-21 13:19:43 +02:00
Andreas Eversberg 744f745d7a PCU: Add PCU socket interface to BTS.
A special command line option "-P" is used to enable socket interface
and signal available GPRS MO object to BSC.
2012-07-08 20:50:02 +02:00
Holger Hans Peter Freyther b19592f713 paging: Update the unit test that would have caused the previous
The unit test created and used the paging request in the same
second and was passing because of that. Add a second test with
a delay to force now to not be equal to the expiration time.
2012-07-05 23:31:18 +02:00
Holger Hans Peter Freyther b0985e3fa5 test: Introduce a very simple test for the paging subsystem
Check that adding a paging command works, check that it is expired
after the first call to paging_gen_msg. The test will be extended
to test the scheduling and selection of the various paging messages.
2011-12-01 09:14:32 +01:00