Commit Graph

1435 Commits

Author SHA1 Message Date
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
Max e81347f216 Allow specifying sysmocom headers explicitly
Add configure option --with-sysmobts=$INCDIR (like for LC1.5).

Use to fix the jenkins build to fix the build after migration to stow, where we
can no longer use a commin -I to include the sysmobts headers as well.

Tweaked-by: neels
Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a
2018-01-19 15:06:15 +01:00
Neels Hofmeyr d1f0a7e927 jenkins_common.sh: fix build_bts distcheck for more than one conf_flag
Passing configure flags in DISTCHECK_CONFIGURE_FLAGS requires enclosing all
flags in quotes. Currently we seem to have no callers with more than one
configure flag, so we were lucky not to break there.

Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb
2018-01-18 00:18:57 +01:00
Max bef6eae05b Move sysmobts-calib into osmo-bts-sysmo
It's prerequisite for jenkins tests fix after migration to stow. The
sysmobts-calib uses hand-coded Makefile instead of automake which makes
it hard to properly propagate build flags. Also, make it optional to
enable excluding it from certain jenkins tests.

Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18
2018-01-16 15:53:00 +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
Pau Espin ef8cdfbacb oml.c: Fix use of htons instead of ntohs
In oml_ipa_mo_set_attr_cell, as well as we do in other set functions in
the same file, we want to store a parsed value from a TLV received on
the network into a host local structure. We hence need to use ntohs
instead of htons.

Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b
2018-01-08 15:45:49 +00:00
Max f28b660666 Print FN delta on L1 errors
Change-Id: Ieb99c970eafb25b504c2b85221fb12d5a3c39789
2018-01-08 13:48:01 +01:00
Max 1adfc52a72 Remove BSC-specific parts
The dead code is from before repo-split time.

Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e
2018-01-05 10:06:44 +00:00
Max 667b0f1fe5 Use existing function to obtain TSC
Change-Id: I209f26b527a41b3b6f8e405f2a21b3d4bc4746fb
2018-01-04 11:47:33 +01:00
Max a11d8e95ee Add --enable-sanitize configure option
Change-Id: I4e31e20ef2361c8f251f3ab04a0ac86e23d2e8a1
2017-12-21 17:29:53 +01:00
Philipp Maier 0bac3efc17 octphy: l1_oml: check returncode of trx_by_l1h()
The function trx_by_l1h() is used to fetch the pointer to a an
osmo_bts_trx from a list. The ID that is used to reference the
transceiver comes from the incoming message. If the firmware
sends odd identifiers (firmware bugs, damaged packets) the
transceiver can not be found in the list and a nullpointer is
returned, which then leads into a nullpointer derefernece
problem.

Check the returncode, and depending on the situation either
return with -EINVAL or exit osmo-bts immediately.

Change-Id: I04ef3b4896e1322c2a6d29ea86a88994c7748bf7
2017-12-20 15:54:25 +01:00
Pau Espin 3c96db29fa jenkins.sh: Disable building doxygen for deps
Change-Id: I2ed207a5febe8017a20a0e7de0ba575fd7966af6
2017-12-14 16:02:29 +01:00
Pau Espin 035fc9a134 debian/control: Remove uneeded dep libosmo-netif-dev
I didn't see any related libosmo-netif code dependency in the project.

Change-Id: I2da1935bcc3ce507cfb21419a1e340aa3361cd65
2017-12-14 16:01:13 +01: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
Pau Espin 4848c2c445 Fix malformed Resource Indication packet
Wireshark was showing a Malformed packet alert, and further
ivnestigation showed that "Resource Information" TLV was missing in the
packet. See GSM 08.58 sections 8.6.1 and 9.3.21 for more information.

Indicating interference level is not yet implemented, but at least now
we avoid sending a malformed packet.

Patch has been validated against a running setup with wireshark in my local PC.

Related: OS#2735

Change-Id: Ie97170811aaf8a089febfa20380ab48ea174056a
2017-12-11 13:28:34 +01:00
Philipp Maier 33942ed156 cosmetic: tests/Makefile.am: remove excess whitespace
Change-Id: I7090d46ae72183014e6c74d6ddb240af8d66e0b4
2017-12-10 22:12:35 +01:00
Pau Espin 4b4c2ec4b3 bts-trx: Avoid enqueueing consecutive duplicate messages to TRX
While debugging other protocol/timing issues between osmobts-trx and osmo-trx,
I found that sometimes two consecutives "POWER OFF" commands are
enqueued and sent to osmo-trx.
There's no point in doing so, as the write queue already maintains state
and retries the command until a RSP is received, then goes for the next
one.

With this change we hence improve timing response as we don't need to
wait for the second command to be processed, and on top we get cleaner
logs and simplified states which are easier to debug.

Change-Id: Ib6a5e7bfac8bc5e1b372da6a1f801c07a3d5ebb7
2017-12-10 14:05:57 +00:00
Pau Espin 62b575db67 bts-trx: trx_ctrl_cmd: Simplify var assignment logic
Change-Id: I9250e3003cff24035440bbba3e1171650dc83209
2017-12-10 14:05:36 +00:00
Philipp Maier 28cb32a74b cosmetic: meas_test: fix section comment
Change-Id: Id228620ccf5a40c8089ae1914d59b19e808ea151
2017-12-07 12:59:17 +00:00
Max 6f9d76e66c Log filenames on L1 errors
Change-Id: I7e73374f3f1da662ebed52548d29b6b76443c81b
2017-12-05 16:40:36 +00:00
Harald Welte 5b70bb673d DTX: avoid illegal character contained in DTX FSM allocation which causes BTS crash
Problem:

 lchan->tch.dtx.dl_amr_fsm struct failed to allocate in l1sap_chan_act routine
 in l1sap.c due to illegal characters contained in lchan->name which are passed to
 osmo_fsm_inst_alloc routine. As a result, lchan->tch.dtx.dl_amr_fsm is NULL
 causing BTS crashed (SEG FAULT) when trying to access this struct.

 Below is snapshot of crash log obtained by GDB:
 ...
 Fri Nov 24 18:13:55 2017 <0000> rsl.c:1653 payload type: 98
 Fri Nov 24 18:13:55 2017 <0000> rsl.c:1463 (bts=0,trx=0,ts=2,ss=0)
 RSL Tx IPAC_MDCX_ACK (local 127.0.0.1:11538, remote 127.0.0.1:30012)
 Program received signal SIGSEGV, Segmentation fault.
 0x00031930 in dtx_dl_amr_fsm_step (lchan=lchan@entry=0xb69592a8,
 rtp_pl=rtp_pl@entry=0x87ae8 " \024\351Y\363_\337\345\351f\177\373\300\210\201\200\210",
    rtp_pl_len=17, fn=1728481, l1_payload=0x10dd25 "", marker=marker@entry=true,
    len=len@entry=0x10ddc4 "\024", ft_out=0xbefff7d7 "\002",
    ft_out@entry=0xbefff7cf "\276\341_\032") at msg_utils.c:233
 233     msg_utils.c: No such file or directory.
 ...

Fix:
* Use different formatting for lchan name passed to osmo_fsm_inst_alloc routine
* Refuse channel activation if FSM could not be generated (as opposed to crash)

Related: OS#2606
Reported-by: Minh-Quang Nguyen <minh-quang.nguyen@nutaq.com>
Change-Id: I929ce3703dc57acf8db569ae0e346265644d0b3c
2017-12-05 14:54:59 +00:00
Harald Welte 70c4dc8d70 osmo-bts-trx: Fix reported frame number during PRIM_INFO_MEAS
The upper layers (L1SAP, the common part of L1) *always* require frame
numbers in the uplink direction to be reported as the frame number of
the *first* burst, not the last burst of a given block.

This is particularly important in the case of passing up measurement
information, as we use this frame number to detect if the measurement
interval for that specific timeslot has just ended (and hence we must
process the measurements and send an uplink measurement report to the
BSC.

Before this patch, the measurement results were reported with the *last*
frame number, which caused the common/measurement.c code never detect
the end of a measurement window.

On TS2, tons of the following log messages were observed:
<0004> measurement.c:199 (bts=0,trx=0,ts=2,ss=0) no space for uplink measurement, num_ul_meas=104

With this patch, it behves as expected:  the measurements of 25 blocks
(= 100 bursts) are aggregated, after which point the report is computed
and sent.  Subsequently, num_ul_meas is reset to 0 and the cycle
restarts.

Related: OS#2329
Change-Id: I1065ae9c400bb5240a63ab8213aee59aeb9ceeff
2017-12-04 13:25:34 +00:00
Harald Welte be4a208809 Put useful information in RTCP SDES.
The RTCP Sender Description is supposed to contain useful information
to identify the source of the RTP stream.  So far, it only contained
compile-time default data of libortp.  Let's put the BTS UnitID, the
lchan number and the OsmoBTS version in there.

This change requires libosmo-abis Change-Id Ice794f9e0c6caeea1c67520c12efbfa375d1fb82

Change-Id: Id6ce7188354d3a0517661c9648854ec829ef1cac
Related: OS#2701
2017-12-03 21:22:25 +00:00
Harald Welte 5112c45d22 rsl.c: Log RTP socket related errors as DRTP, not DRSL
The respective errors/events occur as a result of calling osmo_rtp_*
API, and are clearly more fitting into the DRTP category than the DRSL,
even though the respective actions are triggered by RSL.

Change-Id: I52e6f9865492a2f757a37860eb92a3dc49e174ef
2017-12-03 21:13:24 +00:00
Harald Welte a7bfb6c8da osmo-bts-octphy: Remove bogus warning about BS_AG_BLKS_RES
Contrary to osmo-bts-sysmo, the OCTPHY-2G does not have different L1
SAPI for AGCH and PCH.  It uses cOCTVC1_GSM_SAPI_ENUM_PCH_AGCH for both,
and we convert that to the cbits=0x12 (Downlink CCCH) on the L1SAP.

The code above L1SAP can hence freely decide if it wants to respond with
an AGCH or PCH message, based on its knowledge of BS_AG_BLKS_RES,
without the OCTPHY specific code having to do anything about it.

Hence, there's nothing to do, and the warning can be removed

Change-Id: Ic1038b8dc57bdaf05493cd8479355b960275ea41
Related: OS#1575
2017-12-03 10:01:54 +00:00
Harald Welte 57ce53d8aa measurment.c: Introduce INFO category for DMEAS logging
There's no point in either having full verbosity in DEBUG level
and not logging any measurement related information in INFO.  Let's
at least print the results at the end of each measurement period in INFO
level.

Change-Id: I2c870531478c05ce31cc1015597a068a4a76cf99
2017-12-02 21:06:06 +00:00
Harald Welte 6b264c5344 l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C for MPH
Change-Id: Icc0325f41a1d80535d33e123083e220ee47df129
2017-12-02 21:05:34 +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
Harald Welte 62a6a2680f scheduler: Harmonize log line format; Always print TS name + decoded FN
Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
2017-12-02 21:05:34 +01:00
Harald Welte 41d471351f Comments on individual members of struct gsm_abis_mo
Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
2017-12-02 21:05:34 +01:00
Harald Welte 478f2f7696 measurement.c: Fix various typos in comments
Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
2017-12-02 21:05:34 +01:00
Vadim Yanitskiy 536ebeed08 doc/examples: add CalypsoBTS configuration example
Despite the CalypsoBTS transceiver is similar to OsmoTRX, there
are some changes required to make it work with OsmoBTS. Let's
add a new configuration example for that.

Change-Id: Ia4b1797de576ab987b05046aa9a9828858023ed3
2017-11-27 22:59:20 +00:00
Max f78caac25c Remove leftover comments and checks
It seems like rx previously had 'float' type. Remove the comments and
checks which are not relevant since rx is 'int'.

Change-Id: Idb4aad53667f88f9656c5bb1c52e7e75b385f446
Fixes: OS#2223
2017-11-27 16:17:16 +01:00
Pau Espin 2564756296 l1sap: Fix abort on big RTP packet received
Recently while testing new osmo-mgw, big RTP packets (around 4K bytes,
see OS#2625 for more info), were being received on the BTS, which was
aborting with the following message:
"msgb(0xff208): Not enough tailroom msgb_put (348 < 1488)"

The crash can be reproduced in a sysmobts as well as on my PC locally
with osmo-bts-trx. I used osmo-bts-trx to test that the patch solved the
abort.

Fixes: OS#2624

Change-Id: Idfde1dacc3dc3d3d5e239cf1f7e39ade7fc25975
2017-11-08 16:45:01 +01:00
Philipp Maier 80117acba6 octphy: override firmware version check
When osmo-bts detects a mismatch between the firmware of the DSP
and the header version which it was compile with, a hard exit
is performed. In some cases this may hinder debugging/testing things.

Implement a commandline option to intentinally override the check.

Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59
2017-11-08 04:43:55 +00:00
Harald Welte 14566e3ced l1sap: fix wrong return value of is_fill_frame()
When determining if a frame is a fill frame or not, the case
statement only conditionally handled AGCH and PCH cases.  In
case a non-fill-frame was observed, the return value was uninitialized,
resulting in some non-fill-frames to be missed from GMSTAP

Change-Id: I7b46c720e34cb8ef9a91ae5da28a050439a1937d
Closes: Coverity CID#174175
2017-11-06 03:46:24 +09:00
Harald Welte bb8037b7eb trx: Don't assume phy_instance_by_num() returns non-NULL
In trx_clk_read_cb(), when calling phy_instance_by_num(), that
function might in error cases return a NULL phy-instance. Let's
put an OSMO_ASSERT() there as safeguard to avoid NULL dereference
when dereferencing pinst->trx->bts.

Fixes: Coverity CID#178657
Change-Id: If6b6b45380368e9ee9e03ca1eb7ac56c21e72b03
2017-11-06 03:00:08 +09:00
Harald Welte 8e202b595c trx: Don't call osmo_fr_check_sid with negative 'rc'
In rx_tchf_fn(), if gsm0503_tch_fr_decode() returns a negative
result, we cannot use that result as length argument to
osmo_fr_check_sid()

Change-Id: Ic4080b5bf6c865be3333f923f19a2340e1e272c8
Fixes: Coverity CID#178659
2017-11-06 02:56:41 +09:00
Harald Welte d8d402099f trx: Avoid NULL+1 dereference in trx_ctrl_read_cb()
We unconditionally pass "p+1" into sscanf() despite not knowing
if 'p' is NULL or not.

Change-Id: I40a49c3feb3b55ef577eebd7d567afdbcfe0d624
Fixes: Coverity CID#178661
2017-11-06 02:54:36 +09:00
Harald Welte 6733906f62 trx: Better be safe than sorry before calling strlen
There's a lot of pointer arithmetic in trx_ctrl_read_cb which is
not so nice.  While I believe the current code is safe, Coverity
raises "CID 178665:  Insecure data handling  (INTEGER_OVERFLOW)"
regardin the use of rsp_len in the strcmp().

Let's put some OSMO_ASSERT() in front and hope that makes Coverity
happy.

Change-Id: I5a9b3307f83cdde7c8e9f66932446604f5623b05
2017-11-06 02:50:21 +09:00
Pau Espin a73177b190 lc15: Fix cfg indentation
I was unable to start osmo-bts-lc15 with this config file until this
change was made, it said this command didn't exist.

Change-Id: Iae80e2ed504b5e26d748d57be7558ce470555f97
2017-11-01 12:06:35 +00:00
Neels Hofmeyr b1f5c71da6 vty: skip installing cmds now always installed by default
vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I5e8e9d7989ee20fe722bdd3109965d5bce9519fb
2017-11-01 00:49:19 +01:00
Harald Welte a5ed03fe5c Tag/Release 0.7.0
This marks a new release that's compatible with libosmocore >= 0.10.0,
and which no longer depends on openbsc-dev.

Change-Id: I67405cb5f0f4dea85c67febfdef80f49ae1d41a6
2017-10-28 20:54:17 +02:00
Harald Welte 6bf97927f1 configure.ac: Fix Mailing list address
We've had openbsc.org ages ago but have moved everything to osmocom.org
at some point in 2010/2011.  This should have been updated back then

Change-Id: I5da8e9fba8f15719414fa81e2a6211f906329c2e
2017-10-28 20:52:58 +02:00
Neels Hofmeyr a39dab4b7c jenkins: use osmo-clean-workspace.sh before and after build
See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale.

Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93
Change-Id: I830b17462b636e0bf03f4d88000660409503c3e5
2017-10-28 15:08:36 +00:00
Harald Welte 2757cbc2a8 update dependencies to latest libosmo-*
We can either try to really build with those old versions or find the
minimum version, or we can simply require latest version of all
libosmo*, which is the safeest choice for now.

Change-Id: I08915540b92d5135b0c325e30b5b6e24f88e6282
2017-10-27 22:53:43 +02:00
Harald Welte 9982b95069 Fix Downlink AMR FSM name to avoid illegal space character
Since libosmocore Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2
we enforce that FSM names do not contain illegal characteers such as
spaces.  Let's change the DL TX FSM for AMR to comply to this.  Also,
actually do check the result of the FSM registration.

Change-Id: Ieccd1dc32c0faf5e544d17daca4a417d1d168c21
2017-10-24 18:43:45 +02: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