aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-bts
AgeCommit message (Collapse)AuthorFilesLines
2017-09-02trx: avoid deactivating lchan on LCHAN_REL_ACT_REACTMax1-1/+1
* do not deactivate lchan when called with LCHAN_REL_ACT_REACT * add fixme comment It's unclear yet if any special steps are required for osmo-bts-trx so let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1 for now. Background: CCCH is auto activated by some OsmoBTS - before we receive SI3, see 4a8582846281322e8d7dfc577b18767cf35c24d1. To accommodate for that we deactivate CCCH in common/rsl.c, which triggers BTS-model specific callback sapi_deactivate_cb() which updates parameters and activates it again. In case of osmo-bts-trx there is no auto-activation and (seems to be) no need in special interaction with hw to activate channel (no lchan_activate()) hence we can just skip entire deactivate/setup/activate again routine. [1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file. Related: OS#1575 Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513
2017-09-01Support removing SI13 from PCUMax1-1/+1
If SI13 becomes unavailable in runtime than send 0-length message with BCCH SAPI to PCU to indicate that SI13 have to be removed. Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b Related: OS#2400
2017-08-31Support sending SI13 to PCUMax1-0/+1
* explicitly set SAPI when sending data_ind to PCU * drop unused receiving code for BCCH SAPI * send SI13 when PCU is connected * send SI13 when new SI is received Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf Related: OS#2400
2017-08-24osmo-bts-trx: remove global variables from loopsMax1-1/+3
* move TA related globals into phy_link * move power loop related globals into phy_link * prefix corresponding vty vars with osmotrx Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Related: OS#1848
2017-08-09TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_linkHarald Welte1-0/+1
Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX (SETTSC) transceiver is a property of the phy_link, and not a property of the BTS. Also, we *really, really* should never use global variables. I'm very happy this is being cleaned up, finally. Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c
2017-08-09L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAPHarald Welte1-0/+1
So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific code below L1SAP. This is some kind of a hack/workaround, making code and debug output / logs more difficult to understand. So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and remove the "hiding" code from the common l1sap.c code. Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19
2017-07-19lc15: port lc15bts-mgr changesMax1-0/+6
That's mostly changes related to lc15bts-mgr from https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit. I wanted to incorporate vty and hardcoded paths changes so we can use it from this point without major backward-incompatible changes as a base for future ports. Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858 Related: SYS#3679
2017-07-13VIRT-PHY: Initial check-in of a new virtual BTSHarald Welte2-0/+19
This patch adds a virtual physical layer designed to simulate the Um air interface between BTS and MS. It does so by encapsulating MAC blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP streams, both in uplink and in downlink. The purpose of this is enable testing without any radio hardware or related licenses. OsmocomBB has recently received as similar patch-set, adding a virty_phy executable that can be run on a PC instead of the classic 'layer1' firmware on a real phone. Using GSMTAP means that one can use unmodified wireshark to decode the messages exchanged on the virtual Um layer. This code was originally started by Harald in January 2016, continued by Sebastian Stumpf in late 2016 and early 2017, and finally completed by Harald in July 2017. Change-Id: I1bf7670975b1e367c1c62983020865a043542622
2017-07-10Allow passing low link quality buffers to upper layersPau Espin Pedrol1-1/+2
We want to always call l1if_tch_rx and l1sap_up in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. This patch assumes that we are not lossing data events from the physical layer and that we receive an event every 20ms, even if the MS is not transmitting due to DTX. Depends on libosmocore If4ae20c22b881e94585dad710f17b9e37f77bf82 Change-Id: If5df8940fab833eb4e3ed851880b66987d356031
2017-06-24measurement: Remove dead codeHarald Welte1-2/+0
We used to have trx_meas_check_compute() and call that from the bts-specific code in order to iterate over all timeslots and all lchans in the timeslots if we have to send measurement reports. This was executed once per frame, and created unequal CPU load over time, which in turn might increase different per-ts jitter. Since 2f028c4e2c29f63df9926435466aa35377947767 in April 2017 we have lchan_meas_check_compute(), which performs this on a per-lchan basis, and hence CPU load is distributed over all active timeslots. Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08
2017-06-18OML Add osmocom-specific way to deactivate radio link timeoutHarald Welte1-1/+3
In some situations (e.g. when trying to do measurements/testing on the BTS receiver / uplink) it is useful to have a way to disable the radio link timeout and keep any channel open until deactivated, irrespective of whether (valid) data is received or not. This adds a related feature that can be activated by using an osmocom-specific value of 0xff for the TS 12.21 Connection Failure Criterion (9.4.14). Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5
2017-06-15cosmetic: fix some typosVadim Yanitskiy2-3/+3
Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05
2017-06-15Cleanup SI schedulingMax1-1/+1
* use GSM_BTS_HAS_SI() from OpenBSC instead of local copy * arrange GSM_BTS_HAS_SI() checks to improve readability * constify SI scheduler parameters Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 Related: OS#1660
2017-06-09Re-add version to phy_instanceMax1-1/+1
This is resubmission of 9eeb0b1a136fc8c24a86cb4d832c264674c10db0 with errorneous use of talloc_asprintf() removed which should fix OS#2316. Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Related: OS#1614
2017-06-09measurement: fix measurement computationPhilipp Maier1-0/+3
Timing advance is currently not taken into account when computing the measurement results, this commit fixes that Change-Id: I2e0dfd13b53e8aa2822985f12bf2985e683ab553
2017-06-06trx: Allow BTS and TRX to be on different IPsPau Espin Pedrol1-1/+2
Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9 Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
2017-06-02Revert "Add version to phy_instance"Neels Hofmeyr1-1/+1
This reverts commit 9eeb0b1a136fc8c24a86cb4d832c264674c10db0. This commit caused osmo-gsm-tester test runs for the sysmoBTS to fail with SIGABRT consistently. See below redmine issues. In osmo-bts-sysmo/l1_if.c, it uses talloc_asprintf to write to the char version[MAX_VERSION_LENGTH]; talloc_asprintf() however is intended to work on string buffers allocated by talloc, and attempts to reallocate version[]. Furthermore, it is not clear why the patch passes a 'data' arg to app_info_sys_compl_cb() that is not used. Hence I will revert this instead of trying to fix. Please resolve issues and re-submit. Related: OS#2316 OS#1614 Change-Id: I2c9fd5e6739c1750365c0241476ce4b1aa2df3d4
2017-05-29Add version to phy_instanceMax1-1/+1
Change-Id: I5b2352b8d15e9b0d8616fcd526b4902d247e4693 Related: OS#1614
2017-05-17measurement: make lchan_meas_check_compute() available to l1sap.cPhilipp Maier1-0/+2
lchan_meas_check_compute() is a static function measurement.c. In order to distribute the measurement result calculation events, we need to be able to call lchan_meas_check_compute() from l1sap.c Change-Id: Ideffe896613e0feda443bc13dac59dcdbbc605aa
2017-04-13octphy: set tx/rx antenne IDs via VTYPhilipp Maier1-0/+4
add support for the TX/RX antenna-id feature that has been introduced with release OCTSDR-2G-02.07.00-B1314-BETA. The user can now set individual ID numbers for the TX and for the RX antenna. Change-Id: I872fe3c4d7b593358a4ce2f02cf0726611b9f3aa
2017-04-06sysmobts: Don't start with 0dBm TRX output power before rampingHarald Welte1-0/+2
In case a system has a high-gain external PA (like a 40dB PA) connected externally, we cannot simply switch the transceiver to 0 dBm in trx_init() only to then start the ramping at much lower levels once the PHJ completes in trx_init_compl_cb(). The result would be a short 0 + 40 dBm spike followed by later ramping. We want to avoid that spike, particularly its associated inrush current, so let's bring up the board with smething very conservative like -50 dBm, and then ramp from there. Change-Id: I0ad91fce64f65e0213c9fcfde3390ace519055db Fixes: SYS#3259
2017-03-23Sync protocol with OsmoPCUMax1-4/+19
Copy-paste changes from OsmoPCU commit 0a8fae8d141c2cfa4387ffe9b35402d5b8cc85cd. Change-Id: I15e6cc86604947a173e8675ba4b41a3bda2d3296
2017-03-20l1sap: fix PTCCH detectionPhilipp Maier1-1/+4
The macro L1SAP_IS_PTCCH(fn) only detects a PTCCH channel at fn%52 = 12, the detection logic has been extended in order to detect PTCCH at fn%52 = 38. See also 3GPP TS 05.02, Clause 7, Table 6 of 9 Change-Id: Ia6f3333121e5e920c5e1d562a081d0a1b58a1153
2017-03-15l1sap: fix rach reason (ra) parsingPhilipp Maier1-1/+1
The ra parameter indicates the reason for the received rach request. osmo-bts uses the ra parameter to determine if the received rach request is packet access related. If yes, osmo-bts will forward the request to the PCU. In order to determine if the ra is packet related or not, the higher 4 bits must be equel to 0x7 and at least one of the lower 4 bits must be zero. The current method lacks checking of the lower 4 bits. It would also accept 0b01111111, which is reserved for future use. This commit extends the check to take also the last 4 bits into accound. See also: 3GPP TS 04.08, Table 9.9 Change-Id: I5eb88c42a91e158d9bfa4105ec9636035baf8959
2017-02-10osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second ↵Ivan Klyuchnikov1-9/+0
channel (TRX1) of osmo-trx Move rxgain and tx-attenuation (power) parameters from phy_link layer to phy_inst layer. Rxgain and tx-attenuation parameters should be set for each phy_inst and send for each osmo-trx channel accordingly via control commands. Change-Id: I4861a59d10d1ef91954e0c6ea265e66dec08844f
2017-02-07tx_power: Change PA calibration tables to use delta valesHarald Welte1-1/+1
It seems more user friendly to look at a calibration table in terms of the delta (positive or negative) compared to the nominal gain value, rather than a collection of absolute gain values. It has the added benefit that the (API/data model) user doesn't have to specify a gain value for each ARFCN, but rather can rely on the default nominal gain in absence of a calibration table for this specific unit. Change-Id: I7311815902a88d2fc9d211cf4c62fa6fdc5e86ad
2017-02-01octphy: Improve OML ADM state handlingPhilipp1-0/+2
Improve state handling for for lock/unlock of OC_RADIO_CARRIER obj class. in bts_model_chg_adm_state() Change-Id: I034114beca95210169429d8ac1eb8648df12fc6c
2017-02-01Fix AMR HR DTX FSM logic.Jean-Francois Dionne2-4/+9
Fix SID_FIRST_INH detection during speech and when SID_FIRST is interrupted by FACCH. Fix SID_UPDATE_INH detection during silence and when SID_UPDATE is interrupted by FACCH. Add a delay for SID_FIRST to appear at the right time after FACCH. Fix extra byte sent in downlink for SID_FIRST and SID_UPDATE. Change-Id: Ia811305e15541f2376005df736bd610e8b0d2f69
2017-01-25OML: internalize failure reportingMax2-3/+3
* make oml_tx_failure_event_rep() static and use osmo_signal_dispatch() wrapped into oml_fail_rep() to trigger event reports outside of oml.c instead of directly calling into OML layer * remove unnecessary formatting from text messages Related: OS#1615 Change-Id: I738555c547926e97b325ab53763c0076c42309bc
2017-01-23octphy: set tx attenuation via VTYPhilipp1-0/+1
add code to configure the transmision power via VTY Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
2017-01-10scheduler: log lchan on which prim error occuredMax1-0/+4
Log both lchan and trx_chan_type (using introduced value_string). Change-Id: I80c581b54eeee371ee524a75a400d1e9ece16c68
2017-01-10CTRL: make the CTRL-Interface IP address configurablePhilipp1-1/+2
Currently the IP address where the control interface is bound to is hardcoded to 127.0.0.1. This leads to problems with multiple instances on one and the same machine. This commit integrates the ctrl interface bind option into the VTY, so that we can bind the ctrl interface to any IP address, just like we do it with the VTY already. Change-Id: If51e0c645c0789a4f4a8c51737fb81fb12f80829
2017-01-08Add Abis OML failure event reportingMax1-0/+6
Send 3GPP TS 12.21 § 8.8.2 Abis/OML failure event report. Change-Id: Ib1170edca2207752984a554d7a6a57c224f6d5f5 Related: OS#1615
2017-01-04DTX AMR HR: fix inhibitionMax2-0/+3
* Unlike in AMR FR, in AMR HR incoming ONSET have to be treated differently depending on whether we've recently sent SID UPDATE or EMPTY frame. Split ST_SID_U FSM state into 2 states to accommodate for that and make sure that additional states specific to AMR HR are not used for AMR FR. * Avoid sending E_VOICE and E_SID_U in corresponding states as those do not initiate FSM state transitions anyway. This decrease extra load from FSM signalling which otherwise would be triggered on per-frame basis. * Introduce separate signal for SID First P1 -> P2 transition to avoid confusion with E_COMPL and E_SID_U initiated transitions from P1 state. * Don't init DTX FSM for SDCCH channels. Change-Id: I229ba39a38a223fada4881fc9aca35d3639371f8 Related: OS#1801
2016-12-16Optionally use adaptive RTP jitter bufferingMax1-0/+1
* add vty option to manually enable adaptive RTP jitter buffering (disabled by default) on per-bts level * use this setting on per-lchan level when setting jitter parameters via vty at runtime * check and log result of osmo_rtp_socket_set_param() * note: older libosmo-abis will ignore this setting which will be properly detected via return value * if jitter buffer is disabled by configuring "rtp jitter-buffer 0" than adaptive buffering is disabled as well but it will be used if jitter buffer is set to different value for a givel lchan via vty Change-Id: I489f3c419039f40b57c2ef0641c176478b8d3566
2016-12-09Save RTP metadata in Control BufferMax1-1/+7
Having RTP metadata is useful for debugging - save Sequence Number and Timestamp next to Marker bit from RTP header. Change-Id: I359b3bcb74fbfc071547fe2f9d837829374fe997
2016-12-01Fix AGCH/PCH proportional allocationMax2-1/+2
Do not assume that 1 == BS_AG_BLKS_RES but take that information from SI3. Note: due to current implementation quirks we activate channels before SI3 obtained, than we deactivate channels upon receiving SI3 and activate them again. This might not be necessary once we migrate to proper OML state machines. This affects lc15 and sysmo hw. Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Related: OS#1575
2016-12-01Remove duplicated codeMax2-0/+5
Remove lchan deactivation related code duplication to facilitate future use for dynamic CCCH re-activation. Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01DTX DL AMR: rewrite FSM recursionMax2-1/+6
Add explicit state for recursion (sending the different payload data in response to the RTS request for same FN) and corresponding transition. Remove ST_FACCH_V as with new explicit recursion handling it becomes unreacheable. This makes it easier to maintain preemption (interruption of current procedure due to FACCH or Inhibition). This also reduces the number of possible transitions out of each state thus reducing graph's cyclomatic complexity. Change-Id: If39b68083d23a4a35f468a5d75f54eb733ebfd14
2016-11-11Replace link_id constant with defineMax1-1/+5
Instead of using constant for link_id directly, use shared define value. Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-08DTX: wrap FSM signal dispatchingMax1-0/+2
Make wrapper function which checks that DTX is enabled for lchan before dispatching any events. Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66
2016-11-08DTX DL: tighten check for enabled operationMax1-0/+1
Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled and FSM is allocated and use it for all corresponding checks. Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541
2016-11-03DTX fix ONSET handlingMax1-0/+1
* re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case multiple FACCH occur duriing DTX silence period. * produce ONSET event after both SID FIRST and UPDATE in case of AMR FR. * always dispatch E_SID_F (SID FIRST) signal if in talkspurt. * allow E_SID_* right after ONSET (zero-length talkspurt). * add missing E_ONSET signal description. * fix FSM transitions for AMR HR *Inhibited and First P*. * fix incorrect return from l1if_tch_encode() in ONSET FACCH with incoming SID UPDATE Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf Related: OS#1801
2016-11-02Remove obsolete defineMax1-3/+0
It was moved to OpenBSC in 582e4f627674f46310a90d9061e82fb342051b42 as it's used by both projects. Change-Id: I8aba987e3cdaa840cf3e14913a8455b0ba759889
2016-10-28DTX DL: split ONSET state handlingMax1-1/+0
Handle ONSET cause by Voice and FACCH separately. In case of Voice we have RTP payload which we have to cache and send later on in next response to L1 RTS. FACCH have higher priority so it preempts both voice and silence alike - hence we can send ONSET immediately but still have to track previous state in order to get back to it gracefully. This affects lc15 and sysmo hw as there's no FSM-based DTX implementation for other models yet. Note: this requires patch for OpenBSC which adds FACCH buffer to tch.dtx struct. Change-Id: Idba14dcd0cb12cd7aee86391fcc152c49fcd7052 Related: OS#1802
2016-10-21Extend RTP RX callback parametersMax1-1/+2
Adopt to change in libosmo-abis to accept additional parameters in RTP RX callback function. Change-Id: Icf41e568f041e87b38e6192af0be90c42362bfee
2016-10-18Replace magic number with defineMax1-0/+3
SDCCH occupy lchan 0..3 in combined configuration so for CCCH we've always used lchan[4] - replace it with CCCH_LCHAN define and add comment. Change-Id: Ic5d742c292d638f119c6b4672120c1950adeb7f0
2016-10-13DTX DL: use FSM for AMRMax3-6/+41
Use dedicated FSM to handle all DTX DL related events: - add explicit checks if DTX DL is enabled (fixes regression for non-DTX setup introduced in 654175f33bd412671e3ef8cdd65c0689d10f278c) - fix handling of AMR CMI for SPEECH frames - add FSM for DTX DL - sync with corresponding changes in OpenBSC's - handle FACCH-related DTX ONSET events This affects both lc15 and sysmobts and requires corresponding change in OpenBSC (Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd). Change-Id: I74a0b42cb34d525b8a70d264135e82994ca70d31
2016-10-12Move copy-pasted array into shared headerMax1-0/+8
Change-Id: I377ece2845830e3defab2d515f44b629ce5aed8e
2016-10-11DTX: fix 1st RTP packet dropYves Godin1-0/+2
Use "impossible" dummy value to initialize last_fn to prevent dropping of 1st RTP frame due to timestamp jump. Fixes: OS#1803 Change-Id: I485af21f6761048d12dc7f5552fcdd46daf786ed