aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-oc2g
AgeCommit message (Collapse)AuthorFilesLines
2021-04-20lchan2lch_par(): fix missing default branch in switchVadim Yanitskiy1-6/+17
New channel mode values have recently been added with change [1] to 'enum gsm48_chan_mode'. The lack of default branch in lchan2lch_par() caused build failures on Jenkins: oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V2_VAMOS’ not handled in switch [-Werror=switch] oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V3_VAMOS’ not handled in switch [-Werror=switch] oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V5_VAMOS’ not handled in switch [-Werror=switch] This function is duplicated in osmo-bts-{lc15,oc2g,octphy,sysmo}, so we unfortunately need to apply the same fix to all copy-pasted files. Change-Id: I557ff8cac6564d22485c101fba9212f5f0e95bb7 Related: [1] Ie0ea592da5610ae70290106d004e549cf3212a89
2021-02-03Use osmo_fd_*_{disable,enable}Harald Welte2-5/+5
Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d Change-Id: I0da17d851ccb83c28a70c9039d0a4d1fe63da0ec
2021-01-08power_control: migrate MS/BS control loops to the new paramsVadim Yanitskiy1-2/+9
In change [1] the new power control structures and default params were introduced. In change [2], the existing VTY commands for MS power control in the BTS were deprecated and changed to use the new structures as storage. Finally, in change [3], handling of the power control parameters on the A-bis/RSL was implemented. This change is the final logical step in the mentioned chain: it makes both MS/BS power control loops use the new parameters, and removes the old structures. The actual implementation of both power control loops remains the same, however the expected output of some unit tests for the Downlink loop needs to be changed: - TC_fixed_mode: disabling dynamic power control becomes a separate step of the test script since the field 'fixed' is removed; - TC_rxlev_target: RxLev thresholds are printed 'as-is'. Not all of the new parameters are used by the power control loops yet. Further improvements to be done in the follow up commits. [1] I6d41eb238aa6d4f5b77596c5477c2ecbe86de2a8 [2] Icbd9a7d31ce6723294130a31a179a002fccb4612 [3] I5a901eca5a78a0335a6954064e602e65cda85390 Change-Id: Ib18f84c40227841d95a36063a6789bf63054fc2e Related: SYS#4918
2020-12-06power_control: clarify units in 'struct bts_power_ctrl_params'Vadim Yanitskiy1-1/+1
Change-Id: Icb059ca1f555397be116a424800e4536883b9106 Related: SYS#4918
2020-12-02struct gsm_bts: move ul_power_{target,hysteresis} to ul_power_ctrlVadim Yanitskiy1-1/+1
Change-Id: I3886c7aedf3870536f1750f864cf698302ddf2df Related: SYS#4918
2020-11-26part 5 of: fix SAPIs for handover, osmo-bts-oc2gNeels Hofmeyr1-18/+12
Change-Id: I2f1fd6e4620eec198912148cdc59fb4f02786c4d
2020-11-26rename to release_sapi_ul_rach(), simplifyNeels Hofmeyr1-12/+4
The sapis_for_ho have only one member, so it's silly to iterate. A subsequent commit will drop sapis_for_ho. Change-Id: I896fbca9876fd274ff9c426250b18b50faebfa89
2020-11-25oc2g-mgr: generate coredump and exit upon SIGABRT receivedPau Espin Pedrol1-4/+15
Previous code relied on abort() switching sigaction to SIG_FDL + retriggering SIGABRT in case the signal handler returns, which would then generate the coredump + terminate the process. However, if a SIGABRT is received from somewhere else (kill -SIGABRT), then the process would print the talloc report and continue running, which is not desired. Change-Id: I7a5756e106ac1061d37b42c22cc127fdacd87ce7 Fixes: OS#4865
2020-11-03fixup: vty: call bts_model_vty_init() from bts_vty_init()Vadim Yanitskiy1-2/+0
Now bts_model_vty_init() must be called only once, otherwise the process would crash when bts_model_init() is called from main(). Change-Id: I262c39896b5db86c54ad9aa7042c7ca6657815d9 Related: SYS#4937, OS#3036
2020-11-02vty: call bts_model_vty_init() from bts_vty_init()Vadim Yanitskiy1-19/+15
Similar to bts_vty_init(), BTS specific bts_model_vty_init() requires a pointer to 'struct gsm_bts'. Not only it's used as a parent talloc context, but also stored locally, so then it can be used by some VTY commands. Let's expose the global 'struct gsm_bts' from main, and pass the application's talloc context like was done in [1]. This finally makes the BTS model specific options appear in the automatically generated VTY reference (--vty-ref-xml). [1] Ic356a950da85de02c82e9882a5fbadaaa6929680 Change-Id: Iee7fee6747dd1e7c0af36f9b27326f651ae37aaf Related: SYS#4937, OS#3036
2020-10-24main: separate model-specific arguments in helpVadim Yanitskiy1-1/+2
Change-Id: I9646a45d61153499ad3d580a03d930ed20e23cda
2020-10-24main: increase spacing between commands and descriptionVadim Yanitskiy1-3/+4
Otherwise it's hard to fit new options with long names. Change-Id: If9a418545abff6d22602ba07cfd4447f5ace7742 Related: SYS#4910
2020-10-20Introduce NM Channel FSMPau Espin Pedrol2-27/+29
Change-Id: I288cbfb4730b25a334ef1c3d6b9679d6f1d4cfc5
2020-10-20Introduce NM Radio Carrier and Baseband Transceiver FSMsPau Espin Pedrol2-20/+24
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-20Introduce NM BTS FSMPau Espin Pedrol1-7/+7
Change-Id: Iae631bcc7acdf955296b124707e42d5e565af186
2020-10-20Introduce 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-20Change 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-10-19remove dead oml_router codeHarald Welte4-157/+2
We originally wanted to intrdouce an OML router which would permit external proceses to implement certain OML MOs. However, that code was never completed, and all the existing implementation (in three copies) does is to create a unix domain socket and discard what is received there. Change-Id: I7fcbbd5d6b64ddc666ca836dc49abb430be0d5cb
2020-10-19use osmo_fd_setup() everywhereHarald Welte2-14/+4
Change-Id: I9be55f791a15fae2362dc431dc778b9b9d8db349
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