aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy
AgeCommit message (Collapse)AuthorFilesLines
2022-04-25model_init: order features alphabetically, part 2Oliver Smith1-2/+3
Order the ones I've overlooked as well. Related: SYS#5922, OS#5538 Change-Id: I0aa344de9ea4849de0fcd7b44bfaa70274af594b
2021-11-25[lc15,oc2g,octphy] Fix memory leak on write queue overflowHarald Welte1-1/+5
Callers of osmo_wqueue_enqueue must always check the return value and free the message themselves in the error case. Change-Id: Ic67fbef23e419c0c8a7bcfb16d134e1bf649de72 Related: OS#5329
2021-10-14Move lchan_init_lapdm inside lchan_set_state(LCHAN_S_ACTIVE)Pau Espin Pedrol1-3/+0
osmo-bts-trx/l1_if.c lchan_init_lapdm() for CCCH is already done when trx_set_ts_as_pchan() calls: "lchan_set_state(&ts->lchan[CCCH_LCHAN], LCHAN_S_ACTIVE);" Change-Id: I7a9c3660b9aab57ff8765e2f1526349599630cd9
2021-09-22nm_*fsm: Make FSMs aware of object being properly configured or notPau Espin Pedrol1-4/+27
This will allow in the future advertising children objects that the parent object has been configured. It is useful for instance to let TRX know that the BTS is configured. Change-Id: Ie319465fd0e991bab8451ea34ec72ff3702533d2
2021-09-20Allow setting administrative state through oml_mo_state_chg()Pau Espin Pedrol1-1/+1
This way it can be changed together with operative/availability state, and changes announced to the BSC if present. This commit presents no real change in osmo-bts behavior, since the only place where adm_state is passed different than -1 is in st_op_disabled_notinstalled_on_enter(), which is actually never called (yet) since it's the initial state and no other states transition later to it. However, this will change in the future once we support re-connecting to a (possibly different) BSC, which means objects will need to be moved to that state to restart the whole OML install procedure on the new BSC. Change-Id: Ifdc6a1dfb673c0ab915ddf2a9d372928f4f86b4c
2021-09-13lchan: Move TA CTRL param to its own substructPau Espin Pedrol1-1/+1
Field is renamed to look similar to similar fields in power control loop. This is a preparation commit, next one will add functionality to skip SACCH blocksi (P_CON_INTERVAL). Related: SYS#5371 Change-Id: I169ce58ab827e38b64f4b15f935097a9118fa118
2021-07-05Rename osmo dyn ts enums to contain SDCCH8Pau Espin Pedrol2-3/+3
They will gain support to be activated as SDCCH/8 soon too. Related: SYS#5309 Depends: libosmocore.git I56dcfe4d17899630b17f80145c3ced72f1e91e68 Change-Id: Ia617d20fc52f09dbab8f4516c06fa1efac08e898
2021-06-10osmo-bts-octphy: drop talloc_replace(), use osmo_talloc_replace_string()Vadim Yanitskiy1-12/+10
Change-Id: Ied39cc594fedc712d751ab1c7b636bbbff527bd6
2021-05-23[VAMOS] gsm_data.h: introduce and use BTS_TSC macroVadim Yanitskiy1-1/+1
Change-Id: I0cf915d2d3a640aa1442cf6abe9a314261b4a64e Related: SYS#5315, OS#4940
2021-04-20lchan2lch_par(): fix missing default branch in switchVadim Yanitskiy1-7/+12
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
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-5/+1
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-0/+1
Change-Id: I9646a45d61153499ad3d580a03d930ed20e23cda
2020-10-24main: increase spacing between commands and descriptionVadim Yanitskiy1-1/+1
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-24/+19
Change-Id: I288cbfb4730b25a334ef1c3d6b9679d6f1d4cfc5
2020-10-20Introduce NM Radio Carrier and Baseband Transceiver FSMsPau Espin Pedrol2-24/+23
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-1/+3
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-19use osmo_fd_setup() everywhereHarald Welte1-4/+1
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-2/+2
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-3/+4
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 Pedrol1-1/+1
It will be used in forthcoming commits to feed FSM events once the ramping process completes. Change-Id: I778dc215cf6055b93658670cc12e78ad2e51f85e
2020-06-18Introduce LOGPTRX macro and use it in tx_power.cPau Espin Pedrol1-8/+8
Rename OCTPHY specific LOPGTRX macro to avoid redefine conflicts. Change-Id: I02878611501aca51039e2ac7e35784ccb93b1db6
2020-06-11Do not mix public and private BTS features, use libosmocore's APIVadim Yanitskiy1-5/+5
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-19l1_utils.h: Avoid redefinition of global vars defined in l1_utils.cPau Espin Pedrol1-5/+5
Change-Id: Idd40433fee22aeb1e86708c132929bb69e626334
2020-05-09Use OSMO_FD_* instead of deprecated BSC_FD_*Pau Espin Pedrol1-1/+1
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-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-12l1_if: Fix strange formatting of Meas info loggingPau Espin Pedrol1-9/+5
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-10-17Fix common misspellings and typosMartin Hauke4-8/+8
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-11log: set L1 SAPI log contextOliver Smith1-0/+47
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-07-17fix spelling stuff mentioned by lintianThorsten Alteholz1-1/+1
Change-Id: I3d6cb6fc1b182d8520ba60e431ab9b74e71d5e3c
2019-06-05Use #define RSL_CHAN_RACH for RSL Channel Number of RACHVadim Yanitskiy1-1/+1
Change-Id: I7f54fccdae6799e5f4d956a101e11c2d6f998546
2018-11-26bts_model: Allow TS connect to be processed asynchronouslyPau Espin Pedrol1-4/+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-26cosmetic: fix whitespacePau Espin Pedrol1-1/+1
Change-Id: Iaa4552844db33fe69da5ed7028dbfa0100c33900
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-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-07-02Remove unneeded direct libortp dependencyPau Espin Pedrol1-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-28octphy: add support for 16x oversampling modePhilipp Maier3-1/+86
The latest octphy firmware release (octsdr-2g-02.11.00-B1927-alpha), introduces a 16X oversampling option which is not yet supported in osmo-bts. - Add oversampling flag in phy_link.h - Add VTY commands to enable/disable oversampling - Add phy messages to enable/disable oversampling - Add conditional compilation to preserve support for legacy header files and firmware Change-Id: Ib78f92bfe03ff20aa0a257763c90844fb7b87cf0 Related: SYS#4257 Patch-by: Octasic inc.
2018-04-09octphy: integrate octasics latest header releasePhilipp Maier3-13/+104
At the moment osmo-bts does not compile with the latest header file release from OCTSDR-2G-02.10.00-B1837-ALPHA as there are struct members removed and new ones added. The changes do not affect actual functionality in the existing code. The only affected parts are vty functions that query status information about the clock sync manager. - Add detection logic in configure.ac to detect if the affected struct members are present - Add conditional compiling to handle the different combinations of available struct members. Change-Id: Ic38d8dc35522205c4ffab583b4e61b5ef03cdba2 Related: SYS#4139 Patch-by: Octasic inc.
2018-03-23cosmetic: remove unused variablePhilipp Maier1-1/+0
Change-Id: Icbec00ec63950b785dcb71e3b9d70541e70be536
2018-03-23cosmetic: remove dead codePhilipp Maier1-8/+0
Patch by Octasic inc. Change-Id: I40ff0b95349308693bec5f4ae56ec7f2f14202e5
2018-03-17Get rid of 'struct gsm_bts_role_bts'Harald Welte1-5/+1
gsm_bts_role_bts was introduced at a time when we still shared gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently needed a BTS-private structure. Since that sharing was abandoned quite some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away with the bts/btsb dualism in a lot of the code. Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
2018-03-08fix handover: handle_ph_ra_ind(): evaluate ra_ind before msgb_trim()Neels Hofmeyr1-19/+27
Commit c2b4c668f3510b7b0baace749c5a310959010e90 I3b989580cb38082e3fd8fc50a11fedda13991092 introduces evaluation of ra_ind members below the msgb_trim() call that actually invalidates ra_ind. A symptom is that it breaks detection of Handover RACH, wich always ends up with lchan == NULL and interpreting all RACH as chan_nr == 0x88. Fix: do all evaluation of ra_ind before the msgb_trim(), for osmo-bts-sysmo, litecell-15 and octphy. To guard against similar mistakes in the future, set ra_ind = NULL before the msgb_trim() call. Related: OS#3045 Change-Id: I203021ee57f49cb963679ba8bec5943e2abb67fb
2018-03-05l1_tch: remove dead codePhilipp Maier1-64/+0
the file l1_tch.c in the octphy spcific code has its root in the tch.c file of sysmobts. It contains some sysmobts specific ifdefs which enclose dead code. - Remove the sysmobts specif ifdefs and the dead code Change-Id: I33f3e0fd293ca8387fddf5ed20f642621e9680de
2018-03-01octphy: replace #warning with #pragma messagePhilipp Maier2-2/+2
warning causes the compiler to throw an actual warning. Lets change those intentional warnings to messages. Change-Id: I2fc83a1a07db9c569b93f29835bf3a0fd8ef4ef5
2018-02-27L1SAP: Increase resolution of reported burst timingHarald Welte1-3/+3
Before this patch we had: * osmo-bts-trx internally using 1/256th bit/symbol period * osmo-bts-sysmo internally using 1/4 bit/smbol period * PCU interface using 1/4 * L1SAP interface using 1/4 * measurement processing code on top of L1SAP using 1/256 So for sysmo/lc15/octphy we are not loosing resolution, but for osmo-bts-trx we're arbitrarily reducing the resolution via L1SAP only then to compute with higher resolution again. Let's change L1SAP to use 1/256 bits and hence not loose any resolution. This requires a corresponding change in libosmocore for l1sap.h, which is found in Change-Id Ibb58113c2819fe2d6d23ecbcfb8b3fce4055025d Change-Id: If9b0f617845ba6c4aa47969f521734388197c9a7