aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo
AgeCommit message (Collapse)AuthorFilesLines
2020-10-03Introduce NM Channel FSMpespin/masterPau Espin Pedrol2-30/+33
Change-Id: I288cbfb4730b25a334ef1c3d6b9679d6f1d4cfc5
2020-10-02Introduce NM Radio Carrier and Baseband Transceiver FSMsPau Espin Pedrol2-28/+34
All the Operative State logic to manage a RadioCarrier//BBTransc NM objects is centralized in these FSM, where other parts of the code simply send events to it. This allows keeping state consistent and offloading logic from each bts backend, since they are only required to submit events now. The idea in the long run is to also replace other NM objects with similar FSMs. This improved logic fixes bug where PHY + RSL link became available before OPSTART and hence op state changed to Enabled before receiving any OPSTART message. Change-Id: Ifb249a821c4270918699b6375a72b3a618e8cfbe
2020-10-02Introduce NM BTS FSMPau Espin Pedrol1-7/+8
Change-Id: Iae631bcc7acdf955296b124707e42d5e565af186
2020-10-02Introduce NM BTS Site Manager FSMPau Espin Pedrol1-1/+4
This fixes old behavior mimicing broken behavior in nanoBTS (according to TS 12.21) where BTS Site Mgr NM object was announced as Enabled despite no OPSTART was sent by the BSC. With this new FSM, BTS SiteManager will be announced as Disabled Offline during OML startup conversation, instead of Enabled. The new osmo-bsc OML management FSMs use this change in behavior to find out whether it should use the old broken management states (without Offline state, as per nanoBTS) or use the new state transitions (which allow fixing several race conditions). Change-Id: Iab2d17c45c9642860cd2d5d523c1baae24502243
2020-10-02Change NM Channel availability Dependency->Offline when RadioCarrier becomes ↵Pau Espin Pedrol1-0/+12
enabled This fix allows osmo-bts to play fine with newer osmo-bsc NM OML FSMs, which expectes for non-nanoBTS types to follow TS 12.21 guidelines. Until now, BSC simply waited to received State Event Change Dependency for each TS and then sent all required commands (Set Chan Attr, Adm Unlock and Opstart). In newer osmo-bsc FSMs, Opstart is only sent when in Offline state, so we need to transit to that state. For the above mentioned reason, since we pass through the Dependency state anyway after this patch, older osmo-bscs will work correctly too. Change-Id: Id9e61f8d773e6e6170c68b5b836d276c747d8d69
2020-09-28vty: make most struct pointers const in show/write commandsVadim Yanitskiy1-4/+4
Change-Id: Iacc32f7982c150d84ea4df7affa1f9e07806928f
2020-08-03Constify the 'trx' argument of trx_get_hlayer1() everywhereVadim Yanitskiy2-4/+4
Change-Id: I44523d26f2f564932ea95c17b1041d0ca9cc2828
2020-07-05Move gsm_bts code gsm-data.* => bts.*Pau Espin Pedrol1-0/+1
bts.h refers to struct gsm_bts object, but we still had a bunch of stuff in bulky gsm_data.* from old days. Let's move stuff where it belongs to start clean up of gsm_data. Change-Id: I0a4219e3f64f625ee8b364bf408b8d2bcc8085c5
2020-06-23bts_model: Convert bts_model_trx_close() to return asynchronouslyPau Espin Pedrol1-2/+6
Some backends like osmo-bts-trx require exchanging messages like POWEROFF to close the TRX, and hence need some time. Switch the function to expect result asynchronously by calling a callback. This will be used later to wait until all TRX are really powered off before exiting the process. Change-Id: I7d76b600fc06e1114b35bf0c2d08eff5bbd1b69a
2020-06-18power_ramp: Add support to get callback when ramping process completesPau Espin Pedrol2-3/+3
It will be used in forthcoming commits to feed FSM events once the ramping process completes. Change-Id: I778dc215cf6055b93658670cc12e78ad2e51f85e
2020-06-11Do not mix public and private BTS features, use libosmocore's APIVadim Yanitskiy1-12/+13
It was a very bad idea to mix "public" BTS features, that are reported to the BSC via OML, and those features, that are used locally (and exclusively) in osmo-bts. Why? At least because we already have the BTS feature manipulation API in libosmocore, that is used by osmo-bsc, but for some reason not by osmo-bts. New features added to libosmocore would clash with the existing "internal" ones like BTS_FEAT_MS_PWR_CTRL_DSP. So what this change does can be described as follows: - remove duplicate definition of the "public" features, - use libosmocore's API for the "public" features, - separate both "internal" and "public" features: - the "public" features continue to live in bitvec, - the "internal" features become flags, - s/BTS_FEAT/BTS_INTERNAL_FLAG/g. Change-Id: Icf792d02323bb73e3b8d46384c7890cb1eb4731e
2020-05-09Use OSMO_FD_* instead of deprecated BSC_FD_*Pau Espin Pedrol5-14/+14
New define is available since libosmocore 1.1.0, and we already require 1.3.0, so no need to update dependenices. Let's change it to avoid people re-using old BSC_FD_READ symbol when copy-pasting somewhere else. Change-Id: Id51ccb2c273c5f0fa4986f28bbd69a72d2dbaa0e
2020-04-26osmo-bts-{sysmo,oc2g,lc15}: fix segfault on 'dsp-trace-flag'Vadim Yanitskiy1-2/+2
== How to reproduce? phy 0 instance 0 dsp-trace-flag error dsp-trace-flag debug == What happens? Program received signal SIGSEGV, Segmentation fault. 0x432dbe64 in strcasecmp () from /lib/libc.so.6 (gdb) (gdb) bt #00x432dbe64 in strcasecmp () from /lib/libc.so.6 #10xb6ed69ec in get_string_value () from /usr/lib/libosmocore.so.12 #20x0001bcf0 in cfg_phy_dsp_trace_f () #30xb6fc1080 in ?? () from /usr/lib/libosmovty.so.4 Backtrace stopped: previous frame identical to this frame (corrupt stack?) Change-Id: I23137930f81bfa8adbb62828f341470c11202b5e
2020-04-20fix compilation with gcc-10Harald Welte1-15/+15
/usr/bin/ld: /home/laforge/projects/git/osmo-bts/tests/sysmobts/../../src/osmo-bts-sysmo/tch.c:584: undefined reference to `femtobts_tch_pl_names' /usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: multiple definition of `pdch_msu_size'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: first defined here /usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: multiple definition of `femtobts_l1prim_type'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: first defined here see also: https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000651.html Change-Id: I4a9896153876fcda496365776883827746205f00
2020-04-14logging: use only LOGL_NOTICE as defualt loglevelPhilipp Maier1-4/+4
some of the log categories in logging.c are set to LOGL_INFO or even to LOGL_DEBUG. This is too verbose. Lets set those categories to LOGL_NOTICE. Also the BTS manager programs (...bts_mgr.c) use LOGL_INFO by default. This should be set to LOGL_NOTICE as well Related: OS#2577 Change-Id: I6e7a635f9b4a93529661dafc591d512d7b7e8c75
2020-02-17osmo-bts-sysmo: merge measurement data and payloadPhilipp Maier3-23/+9
For osmo-bts-sysmo the MPH INFO MEAS IND indication is still sent separately. Lets merge the measurement information into the PH DATA Change-Id: Iffe7865727fbf9bca8eb32a96e8ea05cf718a948 Related: OS#2977
2020-02-17Do not depend on pcu_direct flag when populating ph_data_indPhilipp Maier1-5/+4
The struct members ber10k, ta_offs_256bits and lqual_cb in ph_data_ind are only populated when the pcu_direct flag is not set. The pcu_direct flag is set when the pcu is directly attached to the phy and all pcu related traffic (pdtch) is handled without sending it through osmo-bts-sysmo. For those cases osmo_bts_sysmo will not make use of those struct members, even if they were populated. When the PCU is not directly attached the data is needed because it is sent through the pcu_sock to the PCU. Lets remove the check because it is not required. Also in future patches where measurement indications and data / tch indicatins are merged the struct members are also needed to carry the measurement information for SACCH as well. Change-Id: Iaa37bb62af4f5eb4b6e684cb754e68d11e6fd676
2020-02-12l1_if: Fix strange formatting of Meas info loggingPau Espin Pedrol1-11/+7
Some use LOGPC, but were used after a LOGP with a trailing newline. Let's simply add some defines/macros to be able to include it into a normal LOGP easily insted of having a function. Change-Id: Ie082b11c9d6d00ff2206184f03f6e3647c3da18c
2020-01-21osmo-bts-sysmo/Makefile.am: fix: do not overwrite bin_PROGRAMSVadim Yanitskiy1-1/+1
src/osmo-bts-sysmo/Makefile.am:25: warning: bin_PROGRAMS was already defined in condition TRUE, which includes condition ENABLE_SYSMOBTS_CALIB src/osmo-bts-sysmo/Makefile.am:10: ... 'bin_PROGRAMS' previously defined here Change-Id: Ib2334dccefd507eaaa6d33e58d4c1e029d7fd540
2019-11-14Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSPPau Espin Pedrol1-0/+1
It indicates whether BTS model supports managing an MS Power Control Loop over HW/DSP instead of using the software based osmocom algorithm present in osmo-bts. osmo-bts-trx own loop implementation is considered to be a "DSP/HW" one since it acts on lower layers and interferes with osmocom algorithm since it controls the same end variable "lchan->ms_power_ctrl.current", this way we make sure both aren't enabled at the same time. Old behavior in kept: if common upper-layer algo is not enabled explicitly in VTY (ms-power-control osmo) and bts-trx specific lower layer algo is neither enabled (osmotrx ms-power-loop <xyz>), then no power control is done at all. Related: OS#1851 Change-Id: I49706926b1e962b18791174627bc3cc0cd0cd9d5
2019-10-17Rename variable: CALIB_SUCESS -> CALIB_SUCCESSMartin Hauke1-3/+3
Correct the name of this variable. Change-Id: I75cb6404d772b79933d1d9d694abf8eff1fad020
2019-10-17Fix common misspellings and typosMartin Hauke7-25/+25
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-11log: set L1 SAPI log contextOliver Smith1-0/+45
Add a new common L1 SAPI enum, to unify all the BTS specific SAPIs. Translate to this enum, and set the context for uplink messages in each BTS specific implementation. Set the context for downlink messages in the common l1sap code, by converting the osmo_phsap_prim back to the SAPI value (mostly looking at chan_nr). The new functions for doing this conversion, get_common_sapi_by_trx_prim() and get_common_sapi_ph_data(), are based on the existing to_gsmtap() and gsmtap_ph_data() functions. Note that we can't set the uplink SAPI context in the common code, because then we can't set it as early as possible. In this patch, the SAPI context is set for the PHYs where the SAPI is readily available. With additional conversion from the RSL channel, the SAPI context could be set for osmo-bts-trx in a follow up patch. Related: OS#2356 Depends: (libosmocore) I814cb3328d99faca9220adb5a80ffb934f219d7d Change-Id: I6b7bb2e1d61502b61214f854a4ec5cbb7267545b
2019-08-05Remove undefined param passed to {logging,osmo_stats}_vty_add_cmdsPau Espin Pedrol1-1/+1
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However, definition in C file doesn't contain "(void)", which means number of parameters is undefined and thus compiler doesn't complain. Let's remove parameters from all callers before enforcing "(void)" on it. API osmo_stats_vty_add_cmds never had a param list but has seem problem (no "void"), so some users decided to pass a parameter to it. Change-Id: Ia4d1a7914308d1481fe31fe0986265ead339e61e Related: OS#4138
2019-07-21Move Access Burst link quality handling to L1SAPVadim Yanitskiy1-7/+1
Change-Id: I893ec9c6c2ebad71ea68b2dc5f9f5094dfc43b78 Depends: (libosmocore) Ie2a66ebd040b61d6daf49e04bf8a84d3d64764ee
2019-07-21Clarify and refactor link quality (C/I) handlingVadim Yanitskiy1-1/+1
The radio link quality is defined by C/I (Carrier-to-Interference ratio), which is computed from the training sequence of each received burst, by comparing the "ideal" training sequence with the actual (received) one. Link quality measurements are used by L1SAP to filter out "ghost" Access Bursts, and by the link quality adaptation algorithms. One can define minimum link quality values using the VTY interface. On the VTY interface we expect integer C/I values in centiBels (cB, 10e-2 B), while the internal structures are using float values in deciBels (dB, 10e-1 B). Some PHYs (sysmo, octphy, oc2g, and litecell15) expose C/I measurements in deciBels, while on the L1SAP interface we finally send then in centiBels. Let's avoid this confusion and stick to a single format, that will be used by the internal logic of OsmoBTS - integer values (int16_t) in centiBels. This will give us the range of: -32768 .. 32767 centiBels, or -3276.8 .. 3276.7 deciBels, which is certainly sufficient. Change-Id: If624d6fdc0270e6813af8700d95f1345903c8a01
2019-07-21sysmo/l1_if.c: Annotate fall-through in switch statementHarald Welte1-0/+1
Change-Id: I72937e087288fe7681fafe4099e49849657924bd Closes: CID#162019
2019-06-05Use #define RSL_CHAN_RACH for RSL Channel Number of RACHVadim Yanitskiy1-1/+1
Change-Id: I7f54fccdae6799e5f4d956a101e11c2d6f998546
2019-05-28lc15,sysmo,oc2g: fix dsp-trace-flag commandNeels Hofmeyr1-1/+1
Remove the '~' from '|= flag', it is plain wrong. This affects the correct parsing of DSP trace flags from the config file only. The bug is not present in the interactive VTY command at runtime. Change-Id: I915971f49642967c969f5dd475e8faa960ef3960
2019-05-22sysmo: Fix "nominal power" / BS power display in VTYHarald Welte1-1/+1
The function get_p_max_out_mdBm() returns a value in 1/1000th of dBm, "milli-dBm", while trx->nominal_power is only whole dBm. We were missing the required divider of 1000 ever since Change-Id Ieff75d5becaa80a2097b6e744c75c2d16259c9a4 was merged in February 2017. The good news is that this really only affected the VTY output and not any actual operational aspect of the system. Change-Id: If92d0b15c48dafc63776b82c7ff5f3c2b3505f68 Closes: SYS#4570
2019-05-10osmo-bts-sysmo: fix: indicate BTS_FEAT_CBCH support on OMLVadim Yanitskiy1-0/+1
It seems osmo-bts-sysmo does support CBCH (Cell Broadcast), but for some reason it doesn't report BTS_FEAT_CBCH to the BSC. Change-Id: I42dd3f84c44c210d9255e17153372bf252f897a1
2018-12-18sysmobts_mgr: Add support for gpsd < 2.96Pau Espin Pedrol2-2/+21
This allows running sysmobts-mgr on systems with old gpsd releases (which may have other software depending on such old release). GPSD_API_MAJOR_VERSION define was first added in gpsd 2.39, before that it didn't exist (but this code is known to work against 2.38). GPSD_API_MAJOR_VERSION == 5 was set in version 2.96. Related gpsd commits: 3771dba081bd1175adab6096d7b6270d3822aaa1 e69bcb6b01af6b25c6a525fb1961b92ac04f5213 Related: SYS#4290 Change-Id: If3c35021a020a61d5fa3cde5eebcd09908db822b
2018-12-18sysmobts_mgr: Prepare code for gpsd < 2.96 supportPau Espin Pedrol2-8/+10
API prior to that version allocates the pointer internally. Let's change current code to always use a pointer and in current supported code (gpsd >= 2.96) point it to a user-allocated struct. Follow-up patch will introduce necessary ifdefs to support older gpsd. Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f
2018-11-26bts_model: Allow TS connect to be processed asynchronouslyPau Espin Pedrol1-3/+7
This commit doesn't change internal logic of any model, only the API to be able to return result of connect TS asyncrhonously since some models (like osmo-bts-trx) require some time to process the result. This way PDCH ACT/DEACT (N)ACK can be sent once the result of this long process is known. For instance, nowadays in osmo-bts-trx we PDCH (DE)ACT ACK before getting the result from SETSLOT on the TRX iface. With this new API, bts_model_ts_connect doesn't return any value synchronously. Instead, it is expected to always end up calling cb_ts_connected with the return code from the TS activation process. 0 is considered a successs, while any other value is considered an error. Change-Id: Ie073a4397dd2f1a691968d12b15b8b42f1e1b0cf
2018-11-22Fix deprecated gsm_arfcn2band(), use gsm_arfcn2band_rc()Vadim Yanitskiy1-1/+4
Change-Id: I45aae70f4bc3f4f85d267dafb757debdef1bb7d7
2018-11-19add missing check of osmo_wqueue_enqueue() return valueStefan Sperling1-1/+5
The return value of osmo_wqueue_enqueue() isn't checked. This can result in a memory leak if the message cannot be enqueued. Log an error an free the message upon failure, as done elsewhere. Change-Id: I5671ca364f31d98f2b28d028e7bf1797386de2ec Related: CID#57662
2018-11-18bts: Allocate TRX for BTS dynamically, deprecate -tPau Espin Pedrol1-0/+5
No need to pass -t num_trx anymore to specify number of TRX to use. It is calculated based on dynamic allocation from VTY config. Using parameter -t is flagged as deprecated and is transformed into a NOOP por backward compatibility. As a result, TRX now are allocated after the BTS is allocated and initial config (pre-VTY) is applied. A new function bts_trx_init() is added, to set default config on each TRX during allocation and before setting VTY config on it. A new per BTS model function bts_model_trx_init() is added, to allow per model specific default configuration of each TRX. Change-Id: Iab1a754ab12a626759f9f90aa66f87bdce65ac9c
2018-10-29{oc2g,sysmo}-mgr-calib: Fix build against gpsd >= 3.18Pau Espin Pedrol1-2/+11
Change-Id: I1f9176432b3a01bd5e8c179dc269e391df2d446f
2018-09-30sysmo, virtual: properly handle BS-AG-BLKS-RES as received from BSCHarald Welte1-1/+1
Change-Id: Ifd9a3be6189b3288526e12260d68a982b089404e
2018-09-30Fix computing CCCH block number from frame numberHarald Welte1-1/+1
The existing implementation used a simplistic macro, which was wrong in many ways: 1) it returned a negative value for "fn % 51 < 5" conditions without raising any error message or asserting 2) it returned a wrong block number for many different input frame numbers, as it didn't account properly for the FCCH/SCH gaps between the blocks Let's replace the simplistic macro with a proper lookup table based on TS 05.02, and let's OSMO_ASSERT() if this is ever called with non-CCCH frame numbers. Change-Id: I11fd6cc558bb61c40c2019e46f56c1fe78ef39f5 Closes: OS#3024
2018-09-17CBCH: Fix CBCH via L1SAP for osmo-bts-{sysmo,octphy,litecell15}Harald Welte1-1/+3
This fixes a bug introduced in "CBCH: Move processing via L1SAP" commit 02d99db08b13589e1417c3448a07747f8805ba88 Author: Harald Welte <laforge@gnumonks.org> Date: Fri Aug 24 23:37:45 2018 +0200 where the full channel number 0xc8 was used instead of the (right-shifted) C-bits only. Change-Id: I0fd8d7762e9cc3319a534f261e8857a1aa2220e0
2018-09-09CBCH: Move processing via L1SAPHarald Welte1-5/+3
for some historical reason, CBCH handling was not using the normal L1SAP boundary. Let's change that and traverse L1SAP just like for e.g. BCCH which is quite similar to CBCH handling. This also has the added benefit of logging CBCH via GSMTAP. Change-Id: Ibdba4c5e808330f8406f441a97fe0e81170fce97 Closes: OS#3534
2018-09-09[sysmo,lc15]: Consider CBCH channel combinations in chan_nr_by_sapi()Harald Welte1-0/+4
Whenever a CBCH is used, this results in a new physical channel combination on the relevant timeslot. The chan_nr_by_sapi() function must handle those cbch-enabled PCHAN types. Change-Id: I963909bcec8392ec445d0bcf53a2a8d7d9535444
2018-07-02Remove unneeded direct libortp dependencyPau Espin Pedrol2-3/+2
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-06-22sysmo: calib_file.c: Avoid decl of unused vars and funcs with femtobts_v2.7 ↵Pau Espin Pedrol1-19/+19
build Change-Id: I853ff6d3562c5852bff58a07e7c23d49329d9a4f
2018-06-22sysmo: l1_if.c: Avoid decl of unused vars and funcs with femtobts_v2.7 buildPau Espin Pedrol1-3/+4
Change-Id: I4e6d97114289027fbcff00f77cd42db5277a54ab
2018-06-22sysmo: l1if_mute_rf: Declare vars inside ifdef sectionPau Espin Pedrol1-3/+2
Otherwise sysp variable is unused and compiler triggers a warn. Change-Id: Ie3a3529442a36bb885ef634b8b49ac801bd263da
2018-06-22sysmo: Fix memcmp in RF-MUTE.req for superfemto < 3.6.0Pau Espin Pedrol1-2/+2
Fixes following compilation warning: In file included from l1_if.c:32:0: l1_if.c: In function ‘l1if_mute_rf’: /include/osmocom/core/utils.h:13:30: error: ‘sizeof’ on array function parameter ‘mute’ will return size of ‘uint8_t * {aka unsigned char *}’ [-Werror=sizeof-array-argument] #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) ^ l1_if.c:1405:29: note: in expansion of macro ‘ARRAY_SIZE’ if (!memcmp(mute, unmuted, ARRAY_SIZE(mute))) { ^~~~~~~~~~ l1_if.c:1388:51: note: declared here int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb) ^~~~ In file included from l1_if.c:32:0: /include/osmocom/core/utils.h:13:30: error: ‘sizeof’ on array function parameter ‘mute’ will return size of ‘uint8_t * {aka unsigned char *}’ [-Werror=sizeof-array-argument] #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) ^ l1_if.c:1408:19: note: in expansion of macro ‘ARRAY_SIZE’ for (i = 0; i < ARRAY_SIZE(mute); ++i) ^~~~~~~~~~ l1_if.c:1388:51: note: declared here int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb) ^~~~ Change-Id: Id040aeb35549ddb75072942be0093064a89092a6
2018-06-20sysmo: vty: Add missing include for lchan_deactivatePau Espin Pedrol1-0/+1
Fixes following compilation warning: osmo-bts/src/osmo-bts-sysmo/sysmobts_vty.c:349:3: warning: implicit declaration of function ‘lchan_deactivate’ Change-Id: I1dba0b08fdb2af199f009842c9abf32e25f74be1
2018-06-20l1_if.c: Move decl of vars used in conditional macroPau Espin Pedrol1-3/+3
Nowadays, with latest versions of superfemto, those variables are unused. Change-Id: Iec6c28840745e1bd99406b777ea5db66ca1d6fd9