aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-oc2g
AgeCommit message (Collapse)AuthorFilesLines
2020-10-02Introduce NM Radio Carrier and Baseband Transceiver FSMsPau Espin Pedrol3-32/+38
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 Pedrol2-9/+10
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-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-18cosmetic: {oc2g,lc15}bts_bty.c: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: I1a9cf84ae0120c6ce9068efeb0e9824e4726564e
2020-06-11Do not mix public and private BTS features, use libosmocore's APIVadim Yanitskiy1-10/+11
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 Pedrol3-12/+12
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-25oc2g: Fix mismatching signature in callback providedPau Espin Pedrol1-1/+2
Similar to what's done for lc15 in Id80d5a52cbccce54456205dec230a0b546b8b310. Change-Id: I06747d5992d09a506d26089391ef130418506333
2020-04-25oc2g: Fix returning values on void functionPau Espin Pedrol1-6/+5
Similar to what's done in I7a944c0636933c0389db9aabd8b5e6c173052f12 for lc15. Change-Id: I6f5e976969af994011bc9282ede115606f0f0d20
2020-04-20fix compilation with gcc-10Harald Welte1-11/+11
/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-5/+5
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-25cosmetic: Fix some typos with codespellPau Espin Pedrol1-1/+1
Change-Id: I1bbb4871f764816dcbba86d833194be601fa9228
2020-02-17osmo-bts-sysmo: merge measurement data and payloadPhilipp Maier1-2/+2
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-10/+8
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
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-11-14cosmetic: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: I7b9a091226e3c7dd60b3921ab0d53688f42d1a4d
2019-10-17Fix common misspellings and typosMartin Hauke5-11/+11
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-11log: set L1 SAPI log contextOliver Smith1-0/+44
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-10-05struct gsm_bts: Add model_priv pointer handing bts_model specific dataPau Espin Pedrol2-2/+11
Currently there's bts-virtual specific fields in gsm_bts which is not used by other models and are always allocated. An alternative would be having a union with different structs inside, one per model, but since we already have the bts_model abstraction, in this case it makes more sense to use that abstraction instead of filling code with preprocessor ifdefs to guard against non-defined types, etc. Existing model specific data is moved there. This new infra will be user further in forthcoming commits. Related: OS#4215 Change-Id: Ib17a752cdbaa7d5eb8c5dfa0b197f80a4f38b38e
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-06-05Use #define RSL_CHAN_RACH for RSL Channel Number of RACHVadim Yanitskiy1-1/+1
Change-Id: I7f54fccdae6799e5f4d956a101e11c2d6f998546
2019-05-29osmo-bts-oc2g: Fix status LED responsibilitiesDaniel Willmann1-10/+2
osmo-bts-oc2g no longer modifies the status LED and instead leaves that to the bts manager. The service file now also creates a directory in /var/run needed for osmo-bts to communicate with oc2gbts-mgr. This status file is used by oc2gbts-mgr to figure out when the bts is operational. Related: SYS#4493 Change-Id: Ifae634c6c2ecec7d32298c0f266f91f3e81308f5
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-25Add severity to OML FAILURE EVENT REPORTHarald Welte1-3/+3
Example: The fact that the PCU has connected with a given version is not a *failure* in the first place, particularly not a MAJOR one. Let's allow callers of oml_tx_failure_event_rep() specify the serverity of the event that they're reporting to the BSC. Change-Id: I49af04212568892648e0e8704ba1cc6de8c8ae89
2019-04-15oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging()Philipp Maier1-3/+3
The function osmo_init_logging() is deprecated, lets use osmo_init_logging2() as suggested. Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f
2019-04-08oc2gbts_mgr_calib: do not return NULL on integer functionPhilipp Maier1-2/+2
The functions oc2gbts_par_get_uptime() and oc2gbts_par_set_uptime() try to return with NULL, but both functions are declared as int. Lets return -EINVAL instead. Change-Id: I63b61be2940c59b221089d3d1501371b0116d89a
2019-04-08oc2gbts_mgr_calib: don't use fsync() on *FILE pointerPhilipp Maier1-1/+1
fsync() takes an integer file descriptor but we have a *FILE pointer here. Lets use fileno() first to convert the integer file descriptor to a FILE pointer. Change-Id: I46ffd8c680ba0b445cbbd133d5ce92b79e3d8d87
2019-04-08l1_if: add include for missing header filePhilipp Maier1-0/+1
the function bts_cbch_get() is used in l1_if.c. The function is declared in cbch.h. Lets include this header file in order to be complete. Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d
2019-03-27oc2g: change log level for calibration file errors to FATALPhilipp Maier1-3/+3
The log level of the messages that notify calibration file loading problems is NOTICE, but since it is a severe problem when calibration can not be loaded lets change it to FATAL Change-Id: I32aed25ca7925f1c776f00b37f404a58a85ddbc7 Related: OS#3823
2019-03-27oc2g: generate failure event report in case of bad calibrationPhilipp Maier1-30/+7
When the TX/RX calibration files can not be loaded a failure event report should be sent to the BSC. Lets send a failure event report when calbration data is either bad or can not be loaded (see also remvoed TODOs). Change-Id: I3318470518b34807a443f7cb78c7091b4a3d4481 Related OS#3823
2019-03-20oc2gbts_mgr: use msgb_talloc_ctx_init() instead of msgb_set_talloc_ctx()Philipp Maier1-1/+1
The function msgb_set_talloc_ctx() is deprecated. Lets use msgb_talloc_ctx_init() as suggested. Change-Id: I61f80a7b11e9117e8b71c49b7d81d2f959f3150d
2019-03-19oc2g: l1if: delay trx initialization to avoid race conditionPhilipp Maier1-2/+14
On links with high latency it can happen that RADIO CARRIER OPSTART is carried out to early, even before SET BTS ATTRIBUTES is carried out. This means that important parameters for the initalization are not yet set and the TRX initalization failed. Lets delay the TRX initalization a bit in order to be sure that all BTS attributes are set before the initalization is carried out. Change-Id: Id3bdc88d28417e422d2c0c33b03be06f1a4706c2 Related: OS#3782
2019-03-18oc2gbts_mgr_vty: remove calls to vty_install_default()Philipp Maier1-15/+0
The function vty_install_default() is deprecated and throws a compiler warning that suggests to remove it, so lets remove it. Change-Id: I1a4afb6e352bed9a5af794b39b984a7ddef36e08
2019-03-18oc2g: remove unused define constant FACTORY_ROM_PATHPhilipp Maier1-1/+0
Change-Id: I5eb12332568c85bfd2dd83eb5ef1d9c1c9bbfd27 Related: OS#3823
2019-03-05OC-2G: Nominal transmit power is 25 dBm, not 40Harald Welte2-4/+4
According to the OC-2G product specifiacation, the maximum output power is 25 dBm. This should be reflected in the code, there's no point in claiming to be able to trnasmit 40 dBm - which just creates confusion on all levels (such as the logs, where Tx power is claimed to be ramped up to 40 dBm right now). Closes: OS#3823 Change-Id: Ia6b3476ab2f9279f8905b8c7cfd07ef7b0a939ed
2019-02-20oc2g: vty: Compilation error fixes due to commented codePau Espin Pedrol1-2/+5
Change-Id: Id2b16b9acd15d0c80085fac0fdc2a57173ebb0a0
2019-02-20oc2g: Remove unused static functionPau Espin Pedrol1-12/+0
Change-Id: I4d0a476f84bc9e92e02f94c3990daddeeaa3c5d5
2019-02-20oc2g: Remove unused variablesPau Espin Pedrol4-5/+0
Change-Id: I6738adb6b0ae50905351c67c259d7a77cb250624
2019-02-19oc2g: fsync requires fd instead of file streamPau Espin Pedrol1-3/+3
Similar fix was done for lc15 in a8041edb. Change-Id: Idcd9dc48ea2e1f80bfdf5cf8b6bf55d8150fe0d2
2019-02-19oc2g: led_sleep_cb: pass correct ptr to llist_move_tailPau Espin Pedrol1-1/+1
Fix compilation warning. At runtime it's not a big issue because the "list" field is the first field of the led_list (struct lc15bts_led_timer_list) variable. Hence, the address passed is the same. Similar to commit fixing same issue in lc15 in 080302f8. Change-Id: Ie393a21bc3a725520343c70941cb4f591b313420
2019-02-19oc2g: Cleanup of get_hwversion_descPau Espin Pedrol1-8/+3
Remove unused variables, wrong return type values, etc. Change-Id: I5565b904c72a9ac1775818416f05c64722d366b2
2019-02-19oc2g: Add get_hwversion_desc to header filePau Espin Pedrol1-0/+1
it's used in oc2g/main.c and it needs to be in a header file. Similar as previously done for lc15 in 19795c5a. Change-Id: Ic6826d8c8ff5c648158493454a80704bb956b51d