Commit Graph

1385 Commits

Author SHA1 Message Date
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
Max 8a89c7d3c3 vty: print version and description for each phy
When printing BTS via 'show bts ..' let's also print each TRX, which phy
number and version it uses and its description. It's helpful in
troubleshooting low-level issues as it allows vendor-specific code to
easily expose firmware version.

Related: SYS#3884
Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd
2017-09-27 14:07:55 +02:00
Max ab4696bb2f Replace dead code
* remove leftover from copy-paste of corresponding OpenBSC code
* print OML link state
* print paging load

Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2
2017-09-27 14:03:10 +02:00
Neels Hofmeyr 9605b695fa vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE
Change-Id: Ia1b3d5e010c5b6ea8e655b79d9b36b08cd1ef4c4
2017-09-19 03:27:29 +02:00
Max ae134f896a OML: print actual type of report sent to BSC
We re-use the same facility to send different data so it's better to
print actual cause value to avoid confusion.

Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b
2017-09-11 07:50:18 +00:00
Max cb9f608094 Check readv() return value to prevent crash
Previously result of readv() was used unconditionally so when it failed
and returned negative value it was treated like very large positive
which lead to memory corruption. Fix this and add proper error log.

Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647
Related: SYS#3865
2017-09-08 13:27:06 +02:00
Max 9e36dca82a trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT
* do not deactivate lchan when called with LCHAN_REL_ACT_REACT
* add fixme comment

It's unclear yet if any special steps are required for osmo-bts-trx so
let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1
for now.

Background: CCCH is auto activated by some OsmoBTS - before we receive
SI3, see 4a85828462. To accommodate for
that we deactivate CCCH in common/rsl.c, which triggers BTS-model
specific callback sapi_deactivate_cb() which updates parameters and
activates it again.

In case of osmo-bts-trx there is no auto-activation and (seems to be) no
need in special interaction with hw to activate channel (no
lchan_activate()) hence we can just skip entire
deactivate/setup/activate again routine.

[1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file.

Related: OS#1575
Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513
2017-09-02 19:44:54 +00:00
Max bbf6c435f6 Support removing SI13 from PCU
If SI13 becomes unavailable in runtime than send 0-length message with
BCCH SAPI to PCU to indicate that SI13 have to be removed.

Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b
Related: OS#2400
2017-09-01 16:13:02 +02:00
Max 6384c73fbf Support sending SI13 to PCU
* explicitly set SAPI when sending data_ind to PCU
* drop unused receiving code for BCCH SAPI
* send SI13 when PCU is connected
* send SI13 when new SI is received

Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf
Related: OS#2400
2017-08-31 14:44:45 +02:00
Max fab4efdaf5 Use value string check from osmo-ci
Change-Id: I5bce234a5b8133c81b3ea8757e05de56d3aa15d8
2017-08-26 06:10:35 +00:00
Max 1283e3d543 Bump version: 0.5.0 → 0.6.0
Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd
2017-08-25 15:51:56 +02:00
Max b026d38703 Add git-version-gen snippet
Change-Id: Id1732921ecb768b3c3c4872b82b74ccc3d26cf77
Related: OS#1861
2017-08-25 15:41:43 +02:00
Pau Espin 8876a507ff osmo-bts-trx: Relax validation to allow TRX data bursts without padding
Original OpenBTS transcievers add 2 bytes of padding to the end of data
bursts, having in total 158 bytes. As those two extra bytes are being
ignored after the initial validation, let's relax this validation a bit
in order to accept transcievers that decide no to send these two extra
bytes.

Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07
2017-08-25 09:34:51 +00:00
Max aa11997480 osmo-bts-trx: remove global variables from loops
* move TA related globals into phy_link
* move power loop related globals into phy_link
* prefix corresponding vty vars with osmotrx

Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27
Related: OS#1848
2017-08-24 19:06:48 +00:00
Max 9a30b77813 osmo-bts-trx: fix 'osmotrx legacy-setbsic'
It was introduced in fe6c75d24a1751341bcee91cb45c7ac7f5d07da3:

* fix typo in config write
* add missing vty help string

Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181
2017-08-24 19:06:48 +00:00
Max 01e84be54f OML: use fom_hdr while handling attr. request
Use Obj. Class and TRX# from abis_om_fom_hdr of incoming request instead
of BTS' MO to properly distinguish between BTS-level and TRX-level
attributes.

Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852
Related: OS#2317
2017-08-22 13:29:25 +00: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 4d5df2ebd1 Treat SIGTERM just like SIGINT in our programs
When somebody kills the process, it's best to handle the signal
and to use the opportunity for some cleanup.  We always did this
in the BTS on SIGINT, but never on SIGTERM. Let's change it.

Change-Id: I10009c08b7178988f646e2b6035197b9640ac9b5
2017-08-20 19:23:34 +00:00
Alexander Chemeris ed662e0799 osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB.
We tend to start MS with high power to make sure distant phones get good QoS,
but this also means that we need to reduce their power rather quickly. OTOH
we can't make this step too high because this may lead to power output
oscillation. From my (manual, limited) testing 4dB looks like a reasonable
compromise.

Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
2017-08-20 01:45:29 +03:00
Alexander Chemeris b0578dda95 osmo-bts-trx: Remove an unused variable. Resolves a compiler warning.
Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70
2017-08-19 22:38:20 +00:00
Alexander Chemeris d4450051fc osmo-bts-trx: Fix MS power control loop.
The following two commits from 2014-12-06 introduced a new variable to control
MS power - ms_power_ctrl, but kept the old ms_power variable in place. They
have also changed the meaning of the ms_power variable - it now keeps original
RSL configured value. So when much later osmo-trx-bts code was merged to master
the code was compiling fine and this change in the meaning was overlooked.

In osmo-bts:
579651bf30 power/sysmobts: Add a manual ms power level control
In OpenBSC:
f6f86b0eec18da165db136b14bf2db87fde4b4ac osmo-bts: Introduce new struct for a power loop in the BTS code

Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
2017-08-19 22:35:10 +00:00
Max b78fc1eeee Simplify jenkins build scripts
* move duplicated code into separate functions in jenkins_common.sh
* use that function in individual builds

Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf
2017-08-18 18:08:31 +00:00
Philipp Maier 69ec4a419e octphy: implement support for dynamic timeslots
Implement API functions bts_model_ts_connect() and
bts_model_ts_disconnect() in order to support dynamic timeslot
allocation.

Change-Id: Ia109d4bfade7bc28442127581f4bb0289146ea71
2017-08-15 18:29:21 +00:00
Pau Espin 506a7f98b2 osmo-bts-trx: Enable osmotrx tx-attenuation oml by default
There are currently two ways to specify power reductions to be sent to
osmo-trx from osmo-bts-trx:
* osmotrx tx-attenuation oml
* osmotrx tx-attenuation <0-50>

None of them is enabled by default, which means if none of them is
specified in the config file of osmo-bts-trx, SETPOWER cmd won't be sent
to osmo-trx, which in turn won't turn on the transciever.

Let's enable osmo tx-attenuation oml by default and leave it up to the
bsc to decide which power reduction to use. If the user wants to
configure a specific tx-attentuation, it can still do so in exactly the
same way he used to do it.

Change-Id: Ia8640751630ee37e5f5d1f470bad892a08e80654
2017-08-15 14:59:04 +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
Harald Welte fe6c75d24a TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link
Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX
(SETTSC) transceiver is a property of the phy_link, and not a property
of the BTS.  Also, we *really, really* should never use global
variables. I'm very happy this is being cleaned up, finally.

Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c
2017-08-09 13:03:33 +00:00
Harald Welte bd65b72f91 l1sap/osmo-bts-sysmo: Improve logging
Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af
2017-08-09 13:02:56 +00:00
Harald Welte cd1b08b14f TRX: Remove bogus extern global variable declarations
Those global variable declarations for non-existing variables were
introduced in 8a8d73a691, let's remove
them again.  The source / destination IP address is a parameter of the
phy_link, and not a global variable.

Related: OS#1848
Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186
2017-08-09 11:18:46 +00:00
Harald Welte bc56094cac GSMTAP: Don't log fill frames via GSMTAP
There's very little point in sending fill frames (such as empty PAGING)
or dummy UI frames via GSMTAP all the time.  They serve no purpose other
than to bloat the log files and make it more difficult for users to find
the interesting bits among all this noise.

Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac
2017-08-09 10:03:30 +00:00
Harald Welte de99be4afb L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP
So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific
code below L1SAP.  This is some kind of a hack/workaround, making code
and debug output / logs more difficult to understand.

So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and
remove the "hiding" code from the common l1sap.c code.

Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19
2017-08-09 10:03:14 +00:00
Harald Welte d1f8001cdf VIRT-BTS: Support for GPRS
Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc
2017-08-09 10:02:33 +00:00
Pau Espin 6fe823a7e1 lc15bts-mgr.service: Prepare dirs and sysctls for the process
Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6
2017-08-07 11:56:11 +02:00
Pau Espin d208132ab9 lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi
Change-Id: I007e5f0ce9709026331817e55148749e21d8b015
2017-08-01 10:22:55 +00:00
Pau Espin dc469994f3 lc15: Tweak led colors used in service file
service sets led to orange before/while osmo-bts is being started.
osmo-bts-lc15 sets led to green while operating. (unchanged in here)
service sets led to red when osmo-bts stops running.

Change-Id: If351f49d1ead359192d0d80bbc381afd3459c940
2017-07-31 11:55:12 +00:00
Harald Welte 82987f7a7d L1SAP: Print chan_nr and link_id always as hex
The RSL Channel ID is best read / interpreted as hex value, not as
decimal, primarily due to the fact that it is a bit-mask of various
fields.

Change-Id: I9b72a67407870b485e7f7e8a72fa1ad30fc8ed4d
2017-07-30 17:38:37 +02: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
Pau Espin bbd4d54e46 cosmetic: lc15bts_mgr_vty.c: Fix typos in comments
Change-Id: I46b1cc6e5502829e0c1dc84a184cd2002fbd2b18
2017-07-25 19:21:27 +02:00
Pau Espin 8edfe03595 litecell15: Register in vty limits for paX_pwr
Otherwise it fails to read the default config file.

Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010
2017-07-25 17:17:25 +00:00
Pau Espin cbb64cffa5 cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c
Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d
2017-07-25 17:17:25 +00:00
Pau Espin 824764fa6b lc15bts-mgr.cfg: Set default vswr to a value inside valid range
Valid range is currently set to 1000-200000.

Change-Id: Ibf60ab290acf0423c7617591a86403d63266e5d3
2017-07-25 17:17:24 +00:00