aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs
AgeCommit message (Collapse)AuthorFilesLines
2020-12-08vty: fix swapped documentation for 'filler type' commandVadim Yanitskiy1-1/+1
vty_cmd_string_from_valstr() expands the given 'struct value_string' sequentionally, so the order of entries in both filler_{types,docs} shall match (regardless of the value assigned). Change-Id: Ieb3bbc4fb30f303c47555ca77d03a9e965bc72b5
2020-11-04vty: fix documentation for 'ext-rach (disable|enable)'Vadim Yanitskiy1-1/+3
Do not use 'extended' because it's not the same 11-bit Access Burst, as it was assumed before. Add missing docs for 'enable'/'disable'. Change-Id: I80b5a584e554eb7cc2416017b10fee032202b372
2020-11-02vty: auto-generate cmd and doc strings for cfg_filler_type_cmdVadim Yanitskiy1-14/+21
Change-Id: I7fb228c63f3246f443ece67106abba0432b1659e
2020-11-02vty: remove groundless statement about filler type 'dummy'Vadim Yanitskiy1-2/+1
Dummy bursts have nothing to do with A5/x encryption, and I see no reason why (and how?!?) would using that filler type break encryption in osmo-bts-trx. I asked the author of this code back in August 2020 [1], and so far didn't get any response. [1] https://lists.osmocom.org/pipermail/openbsc/2020-August/013208.html Change-Id: Iae513d7acbb8ef682e1744ac8726cbd6ece8bd87
2020-11-02vty: fix documentation for 'multi-arfcn (disable|enable)'Vadim Yanitskiy1-1/+2
Change-Id: Id653ee058b208ddc105947319adad8da667be11f
2020-11-02vty: cosmetic: use VTY_IPV4_CMD in 'bind-ip' / 'remote-ip'Vadim Yanitskiy1-2/+2
Change-Id: I8e44f771cbd03629c066bc24c3186997761f93f1
2020-11-02vty: fix documentation for 'rx-sps (1|4)' and 'tx-sps (1|4)'Vadim Yanitskiy1-2/+6
Change-Id: I70d9b16fd2b1c2cbaafc978724369cd2c9679cbd
2020-10-30vty: fix documentation for 'egprs (disable|enable)'Vadim Yanitskiy1-1/+3
Change-Id: I7a28bede8fd7d68b3afe9deec381fc93e46d65a9
2020-10-30vty: fix documentation for 'swap-channels (disable|enable)'Vadim Yanitskiy1-1/+3
Change-Id: Idca1a2beab07ef4df9ae5c55658cab80f7cc7565
2020-10-14Calculate RSSI offset based on RxGain configurationPau Espin Pedrol2-4/+9
Prior to this patch, osmo-trx relied totally on proper VTY configuration being set in "rssi-offset" together with the RxGain set through TRXC in order to provide correct Uplink RSSI measurements to bts-trx. With this patch, RSSI is now by default calculated (in LMS and UHD backends) based on the currently set RxGain, by providing empirically discovered values. Still, for backward compatibility, the old "rssi-offset" command will overwrite completely the per-default calculated rssi offset. A new optional parameter "relative" is added at the end of the "rssi-offset" VTY command to flag the value as relative to the newly per-default calculated value. This way specific setups (like adding a LNA / RF fronted) can still be expressed while still keeping the automatic per-default offset. Related: OS#4468 Change-Id: I8ef78fd20c22c60d61bfb18d80a4a36df4fd6c20
2020-10-14Transceiver: Pass config struct instead of large list of paramsPau Espin Pedrol2-33/+38
Change-Id: Ifb43cb11f3e7a69b0a88f632f0a0c90ada7f939e
2020-10-08vty: add attributes to VTY commands indicating when they applyPhilipp Maier1-12/+14
Change-Id: I6dfdedc081eb8c3d53913f6fa38591920c8b3b43 Related: SYS#4937, OS#1601
2020-09-12vty: add multi-ARFCN specific warning for chan N > 0Vadim Yanitskiy1-0/+12
Change-Id: I12d7c466a9a428a384233c4377627e262f165401 Related: OS#4636
2020-08-25transceiver: optimize code if optimizations are enabledEric1-14/+19
There is no point in checking basic stuff ten thousand times per second since the sizes never change, so it's enough to enable the checks/assertions for unoptimized (debug) builds. This significantly decreases branch mispredictions. Change-Id: Iebd9e91b3c7f37f2dc646d3017c45139977e4d15
2020-07-31Use new libosmovty cpu sched config featuresPau Espin Pedrol1-1/+3
Using the new libosmovty features allow for: * Setting different cpu-affinity masks for each thread in the process, both at startup through .cfg file as well as changing it at runtime. * Unified VTY interface to change the scheduling policy of the process inherited by all osmocom processes enabling the feature. Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c Related: SYS#4986 Change-Id: I3798603779b88ea37da03033cf7737a6e4751d6e
2020-07-27Transceiver: Add several rate_ctr for rx error conditionsPau Espin Pedrol3-0/+18
Since there's now a rate counter, we can drop log level for those events which can be bursty and hence print lots of output in short periods of time, which may affect performance. This way setting them to INFO it's enough to avoid getting them in stderr unless explicitly configured by the user (for instance to debug stuff), while still allowing a good enough level to be enabled for other targets such as gsmtap. Related: OS#4679 Change-Id: I000f7112e35ac68d3d922444f78468b1ea74cbba
2020-07-17Introduce CTR log categoryPau Espin Pedrol3-19/+26
This way i most usual rate_ctr related internal logging is disabled by default (notice), and it can b eeasily enabled by switching the category to info or debug. Change-Id: Id6c36432da7e7ce673c585bcae6772a695028ec5
2020-07-17trx_rate_ctr: Lower some log levelsPau Espin Pedrol1-6/+6
Change-Id: I1b5a63e6cc09ac02305c31ea7e94aff53ac0e5c2
2020-07-10Add rate counter for missing Txbursts when scheduled towards the radioInterfacePau Espin Pedrol4-2/+9
Related: OS#4487 Change-Id: Ibb2c492b3c67cbab11fbb936ae3a090fb5756aa8
2020-07-10Introduce rate counters to detect issues in received Dl bursts from TRXDPau Espin Pedrol4-2/+24
This ones together with rate counters already available in lower layers allows to understand better the source of the problem with stalled tx bursts. Change-Id: Ia34f7e7d780ad1e12f24638a07f05fe91f2afea5
2020-07-10trx_rate_ctr: Fix locking wrong mutexPau Espin Pedrol1-1/+1
It was notcied due to sometimes causing deadlock at shutdown time. Fixes: 92ba59dacffe79f4c987154bc63c6eacd8c3605f Change-Id: I49bea4b0ae469794b5c80ee8fa4f275914a5194c
2020-06-29Introduce rate counter tx_stale_burstsPau Espin Pedrol4-7/+59
This allows checking if there's timing issues on the downlink side between osmo-bts-trx and osmo-trx. This counter is useful to find information about osmo-bts-trx 'fn-advance' setting, since this counter basically counts if burstrs from it arrived too late to osmo-trx. Change-Id: Id6df00da81f6d6884f4dddc5a2c4b354dca3af97
2020-06-29Rename device specific rate counter multi-thread helpersPau Espin Pedrol2-49/+49
RadioInterface ones will be added in next commit, so let's differentiate the structs required for each one. Change-Id: Ib0e142a1dd4bedefdb4c5f15c34132da872c0975
2020-06-29trx_rate_ctr: Fix immediate rescheduling on per-sec thresholdsPau Espin Pedrol1-2/+2
For instance, use in VTY: "ctr-error-threshold tx_underruns 5 per-second" If the condition becomes true (eg 5 underruns happened in one sec), the statement inside OSMO_MAX would become -1, but it was being handled as an unsigned when doing the OSMO_MAX internal comparison. As a result, OSMO_MAX((unsigned)-1, 1) was returning -1 (unsigned) stored in threshold_timer_sched_secs which then became and int -1, which was handled by osmo_timer_schedule as a 0, hence having an immediate trigerring all the time. While at it, make threshold_timer_sched_secs unsigned since it doesn't make sense to have it as signed anyway. Change-Id: I6ea3d64dff189a5bc924e72d846e02d50536a8ea
2020-06-29cosmetic: trx_rate_ctr: Fix whitespacePau Espin Pedrol1-1/+1
Change-Id: I4dc8220a6813d6ff30f1b241cc46b801adec4057
2020-03-25debug: use LOGL_NOTICE for log category DDEVPhilipp Maier1-1/+1
The log category DDEV ueses LOGL_INFO as debug level. This is too verbose, lets use LOGL_NOTICE instead Change-Id: I56d45ce5c3f55574491ffa6e4d902d6ba7499d46 Related: OS#2577
2020-02-25cosmetic: fix several typos found by codespellPau Espin Pedrol1-1/+1
Change-Id: Id1f6766572fd313463201e6d03964965f227db25
2020-02-19debug.h: Fix print format of chan in CLOGCHANPau Espin Pedrol1-1/+1
Under armv7l arch, size_t is actually an unsigned int and not a long unsigned int, and compiler errors: CommonLibs/debug.h:28:24: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘size_t {aka unsigned int}’ [-Werror=format=] Change-Id: I7f6ded5a984570b5267916d6c84eb7d019db73a8
2020-02-19debug.h: Avoid printing pthread_t typePau Espin Pedrol2-4/+28
Using %lu for pthread_t was wrong on armv7l arch. Even worse, according to pthread_self() man page, pthread_t cannot be assumed to be of a simple type and hence printable: """ POSIX.1 allows an implementation wide freedom in choosing the type used to represent a thread ID; for example, representation using either an arithmetic type or a structure is permitted. """ Let's use gettid() instead. According to glibc documentation: """ The pid_t data type is a signed integer type which is capable of representing a process ID. In the GNU C Library, this is an int. """ It may not be the same on other libc's though, so let's better cast to a long int just in case. Accordign to gettid() man, the libc function was only added recently during glibc 2.30, however the system call has been around for quite some time (linux 2.4.11). Let's accomodate use udner non-glibc or older versions of it by having a direct syscall fallback. Change-Id: I40265fd4c62e550014ba3ff3335ca053c5bc01f2
2020-01-15lms: Store device type specific parameters in one placePau Espin Pedrol2-1/+2
Add an enum containing each supported device type (LimeSDR-USB, LimeSDR-Mini and LimeNet-Micro) plus "unknown", to leave some room for yet-to-come devices to run with some generic parameters without rebuilding osmo-trx. Each device type is assigned a dev_desc structure, and all of them are put in HashMap, similar to what's already done in UHDDevice.cpp. Device type is infered from string provided by LMS_GetDeviceInfo(), as it was already done before in several places. From now on, we only need to parse the string once since we store the device type after first during open time. Later on, more fields will be moved to device-type specific structure, such as Tx timing offset, clock rate, etc. Change-Id: I7658615787c5bc41c365bab9c11733b701ac2ae5
2020-01-07uhd: Use DEVDRV log category and support UHD >=3.11 logging frameworkPau Espin Pedrol1-0/+3
Change-Id: I36f1ff7d425a2144fb512ff393af02741eb4a3d4
2020-01-07Make logging category DLMS generic and reusable for other backendsPau Espin Pedrol3-4/+7
Make sure old configs using "logging level lms <level>" are still accepted. Initialization order of VTY componenets need to be resorted since newly introduced command requires logging VTY node to be already setup beforehand. Change-Id: Ia195a74a62a8a3dd6267fb1359acaa5628208d8e
2019-12-20Transceiver.cpp: Introduce and use new logging categoriesPau Espin Pedrol2-0/+21
Take the chance to clean up logging lines in this file: * Use LOGCHAN in more places where chan is useful * Replace inherited (old osmo-trx) categories such as WARNING with osmocom ones. Change-Id: Ic8c218f050f35d48046ccf1561fb0bfc505d4f63
2019-10-21vty: Simplify filler burst settings and improve help and readability.Alexander Chemeris2-72/+78
In the command line options time, filler table/filer burts settings were a bit difficult to undertand because the number of one-letter settings was limited. Now, with VTY configuration, there is no reason to keep it so difficult. Also, after the previous commit it was no longer posible to enable random 8-PSK filler bursts. With this patch you can configure all supported filler bursts in a simple and logical way. Change-Id: I752eb2c1162d084e8769181f2fcd6c0877663448
2019-10-17Fix common misspellings and typosMartin Hauke8-8/+8
Change-Id: I4ec7accb1912c052b446be7c399bed32a8c62253
2019-10-15vty: Don't enable random filler bursts automatically with EDGE.Alexander Chemeris1-1/+0
The EGPRS switch in the VTY config enables 8-PSK burst detection on uplink. Enabling it shouldn't turn on filler bursts. Change-Id: I2786c768e038b769a80c8b78fe58cfa09eb322a9
2019-10-09Use new libosmocore logging lock APIPau Espin Pedrol3-59/+4
Since libosmocore Id7711893b34263baacac6caf4d489467053131bb, a new API log_enable_multithread() is available which takes care of protecting logging infrastructure from us (and actually does it correctly since we cannot protect internal libosmocore structures from osmo-trx). Let's drop all mutex related code from osmo-trx logging infra and simply rely on libosmocore's. Related: OS#4088 Change-Id: I519d0f30bce871005ca26b90177ea4aa4839360a
2019-09-20radioInterface: Atomically fetch and change underrun variablePau Espin Pedrol2-3/+29
Otherwise, it could happen that underrun events are lost: TxLower (isUnderrun): RxLower (pullBuffer): read(underrun) read(underrun) write(underrun, |val) [maybe underrun becomes TRUE] write(underrun, false) Similary, it could happen the other direction if atomic was only applied to isUnderrun: TxLower (isUnderrun): RxLower (pullBuffer): read(underrun) -> true read(underrun)-> true write(underrun, false) write(underrun, true|val) where val=false So in here isUnderrun would return true twice while it should only return one. Change-Id: I684e0a5d2a9583a161d5a6593559b3a9e7cd57e3
2019-08-01lms: Drop rx_underruns rate ctr, add tx_drop_* rate ctrPau Espin Pedrol4-11/+18
After discussion in [1] and further look at the code, it became obvios rx_underrun events are not happening in general for any SDR (don't exist), so let's drop that counter. Instead, add Tx Dropped Packet counters, which were not accounted prior to this commit. [1] https://github.com/osmocom/osmo-trx/commit/bde55afd29fc9aae10eb11f6515821afa39b772d Change-Id: Iff1535c219a4695a511d383d7c4b06ef6eff959d
2019-07-22Add SPDX annotationPau Espin Pedrol17-1/+52
Related: OS#3515 Change-Id: I3719bd8dc015569ecd81928fc079e27593cdca09
2019-07-22cosmetic: Fix trailing whitespace in several filesPau Espin Pedrol2-5/+5
Change-Id: Ifafb68353960fc5046661854ccfb8d783b0efb14
2019-07-21Timeval: Restore output stream flags after changing themHarald Welte1-1/+2
Change-Id: I866505f29ed56d8f3ba3aaba70c0d82479987c64 Closes: CID#149361
2019-07-19Logger: global Log mutex is now available from C codePau Espin Pedrol3-7/+75
This way the C++ logging API can still be used while allowing for C files to use the same mutex. Change-Id: I473e57479f8ae98a84ad00b76ff338f79f732236
2019-07-02Transceiver: replace UDPSocket with libosmocore socket APIPau Espin Pedrol3-462/+0
We have a good socket API in libosmocore, let's drop osmo-trx socket API and use libosmocore's one instead of maintaining the two of them. Change-Id: Ib19856a3e0a7607f63436c4a80b1381a3f318764
2019-06-25trx_{vty,rate_ctr}: Set proper license AGPLv3+Pau Espin Pedrol2-13/+19
Take the chance to improve text with author, SPDX tag and fix incorrect copyright dates. Related: OS#3515 Change-Id: Ic745312ed07db205b1cdc0f2fa130000319354c5
2019-06-17Add option to set stack size in config file, default == 0 == OS defaultEric Wild4-3/+22
Change-Id: Id752f6b5ce9a96a67cd1ff835687ce0e03d3a50d
2019-06-11Add VTY commands to set error ctr thresholdsPau Espin Pedrol3-7/+287
osmo-trx will validate over time that those thresholds are not reached. If they are reached, osmo-trx will die. As a result, osmo-bts-trx will notice and will end up notifying the BSC about it (for instance because it will also restart its process). For instance: """ ctr-error-threshold rx_drop_events 2 minute ctr-error-threshold rx_underruns 10 second """ In those cases above, osmo-trx will die if rate_ctr rx_drop_events went to a value higher than 2 per minute, or it will die to if rx_underruns went higher than 10 per second. Change-Id: I4bcf44dbf064e2e86dfc3b8a2ad18fea76fbd51a
2019-06-05Rename and move STOP signal from Transceiver to mainPau Espin Pedrol1-4/+4
The callback actually belongs there, since it's the code/thread in main the one actually in charge of stopping everything. It simplifies current code, and more important, allows for new clients of this signal to use it. This callback will also be used in forthcoming commits by code controlling rate_ctr thresholds to stop the process if the VTY configured threshold is used. Change-Id: Id4159e64225c6606fef34a74b24f37c3a071aceb
2019-06-05Add rate_ctr support to store/retrieve SDR errors through VTYPau Espin Pedrol4-0/+205
Introduce a unified implementation-agnostic interface for radioDevice to signal SDR error counters to upper layers and manage them. This patch only implements counters for osmo-trx-lms (other devices will show all counters unchanged during time). Sample use through VTY: """ OsmoTRX> show rate-counters osmo-trx statistics 0: device:rx_underruns: 0 (0/s 0/m 0/h 0/d) Number of Rx underruns device:rx_overruns: 0 (0/s 0/m 0/h 0/d) Number of Rx overruns device:tx_underruns: 0 (0/s 0/m 0/h 0/d) Number of Tx underruns device:rx_drop_events: 4 (0/s 2/m 3/h 0/d) Number of times Rx samples were dropped by HW device:rx_drop_samples: 513 (0/s 196/m 425/h 0/d) Number of Rx samples dropped by HW """ Change-Id: I78b158141697e5714d04db8b9ccc96f31f34f439
2019-05-06Introduce LOGCHAN macro to standarize logging channel infoPau Espin Pedrol1-0/+3
Change-Id: I67d869499aa16af58c863ca7b74c356bcd979936