Commit Graph

1425 Commits

Author SHA1 Message Date
Harald Welte 8f5c405e19 omldummy: Allow OML dummies with multiple TRX
So far we always assumed that every oml-dummy BTS has only a single TRX.
Let's fix that.

Change-Id: I27c08c6c2da248366980f081cdfdd838b166e7a6
2018-02-05 19:22:38 +01:00
Harald Welte e990d6d49a HACK: Add 'osmo-bts-omldummy' to bring up only OML without RSL
This is used only in integration testing, where in the TTCN-3 testsuite
we currently have no A-bis OML implementation, but only a RSL one.

Change-Id: Id8e5f34091e6e32621d8c8673de7ea848dfd252f
2017-12-17 13:38:15 +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
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 36fa0bd079 Fix race condition in attribute reporting
Previously it could be possible that the attribute request comes from
BSC before the TRX is properly initialized which would lead to SIGABRT
caused by OSMO_ASSERT() in PHY instantiation. Workaround this by
explicitly checking for TRX availability before handling TRX-specific
attributes.

This only happens with osmo-bts-trx and is hard to reproduce. Ideal fix
would be to defer attribute response until we have TRX connected but
that would make corresponding code more complex because we'll need to
save the attribute request and properly hook response routine into TRX
connection handler. Alternatively we can postpone osmo-bts-trx
connection to BSC until TRX is available: it's not very useful without
it anyway.

Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82
Fixes: OS#2560
2017-10-23 18:12:45 +00:00
Pau Espin 0a21b7a5f8 vty: Print string for Administrative state
Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527
2017-10-23 18:49:49 +02:00
Neels Hofmeyr 0c9bc5422a osmo-bts-trx: vty: various fixes of 'write file' and doc
On 'write file':
- Write 'osmotrx' before 'maxdly' and 'maxdlynb' (broken since "Introduce new
  phy_link and phy_instance abstraction"
  d784e50747)
- Fix indenting of 'write file' output, command 'osmotrx timing-advance-loop',
  had a stray space in case there is not a 'no' preceding it.

Add some missing instances of OSMOTRX_STR doc strings.

examples/osmo-bts.cfg:
- Drop 'settsc', the command no longer exists.
- Fix indenting of 'osmotrx rx-gain' command.

osmo-bts does not feature VTY tests, so it is pointless to add example files to
test these fixes. We should probably add VTY tests separately.  However, I have
briefly tested manually (and hence found all of these issues).

Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000
2017-10-18 14:02:30 +00:00
Max 8c9bc5c6c7 sysmo: don't override clock source with defaults
Previously clock source configured via vty was ignored. Check that it
wasn't configured and only apply default value in that case.

Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7
Fixes: OS#1944
2017-10-11 18:06:55 +02:00
Max 3552247ae8 sysmo: use clock calibration source wrapper
Make get_clk_cal() public and use it for ctrl commands handling. This
ensures that the calibration is properly selected depending on the clock
source.

Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9
Related: OS#1944
2017-10-11 17:53:46 +02:00
Max 2d3aa02ba3 jenkins: remove openbsc dependency
The dependency on OpenBSC has been removed in
ec33b0397f so we can drop it from jenkins
scripts too.

Change-Id: Ie28d444f2154f5b4bbbd9a1cb45b74ebca890cb1
2017-10-10 12:30:16 +00:00
Max 236269397e Fix multiple SI2q reception
Previously the received SI was copied to si_buf unconditionally which
means that the first SI2q message is always overwritten be the last one.

Fix it moving check for SI2q ahead of generic code and moving generic
copy into else branch of SI2q check.

Change-Id: Ib8031d2f0e00368283a40b4aadb3eea616038d04
Related: OS#2357
2017-10-10 14:09:44 +02:00
Pau Espin d49915eccf l1sap: Improve log msg when frame diff >1
Print the two fn values to understand better the wrong behaviour.

Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f
2017-10-10 08:21:00 +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