aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-bts
AgeCommit message (Collapse)AuthorFilesLines
2018-04-04use osmo_init_logging2() with proper talloc ctxNeels Hofmeyr1-2/+0
Completely drop bts_log_init(), call osmo_init_logging2() directly instead: all callers of bts_log_init() passed NULL as category string, so all it ever did was call osmo_init_logging(). The bts_log_info is already declared in the .h. Here and there also define a proper talloc root context instead of using NULL. Change-Id: Ic049f77bef74123b95350bcae182a468e0086b9c
2018-03-17Add 'osmo-bts-omldummy' to bring up only OML without RSLHarald Welte1-0/+1
This is used only in integration testing, where in the TTCN-3 testsuite we currently have no A-bis OML implementation, but only a RSL one. Change-Id: Id8e5f34091e6e32621d8c8673de7ea848dfd252f
2018-03-17virtual: Correctly set+report BTS variant in OML attributesHarald Welte1-0/+1
Change-Id: I76dc47427ec26834859fb737bd319dc379ae8697
2018-03-17Get rid of 'struct gsm_bts_role_bts'Harald Welte3-103/+94
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-17cosmetic: Move agch_queue to sub-structure of gsm_bts_role_btsHarald Welte1-14/+16
Rathert han have 11 direct members of gsm_bts_role_bts, group them into a sub-struct as ew do for other parts like interference, laod, ... Change-Id: Iefecf4b70c1b11c650913f2ae3783718ffb8a36c
2018-03-17gsm_data_shared: Remove unused definitions/members/functionsHarald Welte1-197/+0
What we remove here is a legacy from sharing this header file with openbsc/osmo-bsc-sccplite, which we stopped to do quite some time ago and hence can remove those parts that are only relevant to the BSC but not to the BTS. Change-Id: Icac1656da68f6a006a28c779e3b563bbdd905b3d
2018-03-11implement support for 3-digit MNC with leading zerosNeels Hofmeyr2-3/+6
Record the mnc_3_digits flag from SI and pass on via the PCU interface. Instead of changing to e.g. osmo_plmn_id, add the flag separately, and instead of bool use a uint8_t, to not raise any struct packing issues and clarify the flag's size beyond any doubt. Bump the PCU interface version to 9. This is one part of the three identical pcuif_proto.h patches: - I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts) - I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu) - I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc) Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore) Change-Id: I49cd762c3c9d7ee6a82451bdf3ffa2a060767947
2018-03-02pcuif_proto: add version 8 featuresAlexander Couzens1-1/+19
Add PCU_IF_MSG_DATA_CNF_DT and PCU_IF_SAPI_AGCH_DT to bring the pccif_proto into sync. Both commands are required to support the rb11 with an osmo-bsc co-located pcu. Change-Id: I6d330aca26249ee94ece5e415079f0b75c6e8b48
2018-03-02pcu_if: move definition PCU_SOCK_DEFAULT into pcuif_proto.hAlexander Couzens2-2/+2
PCU_SOCK_DEFAULT is defined in the pcu counterpart of the file pcuif_proto.h To be consistent with the pcu move the definition pcuif_proto.h The pcuif_proto.h will be exact the same in the pcu repo and bts repo. Change-Id: I67f8ec036e219994cc296d0ed5409da7f3ec681e
2018-02-28pcuif_proto: correct indention of gsm_pcu_if_dataAlexander Couzens1-5/+5
Change-Id: I39f3bc1f0a1e238f8f00cb00e2d1e5193f118c16
2018-02-27Add high-accuracy ToA value to Uplink Measurement ReportsHarald Welte1-0/+1
Normal Abis RSL MEasurement Results contain only the "MS Timing Offset IE" in units of full symbols. In some use cases it is important to have higher-accuracy timing information exposed to the BSC. We do this by adding the average timing offset value during the last measurement interval in 1/256th symbol accuracy to the "Supplementary MEasuremen Information" part of the TS 48.058 9.3.25 Uplink Measurements IE. In order to avoid any compatibility issues, this feature is only enabled if the new vty config command "supp-meas-info toa256" at the bts node is enabled. Change-Id: Ie85e53b47d4041cc4e6d7b78406ae8b79b2d9397
2018-02-27measurement: Keep average of high-accurate ToA value in lchanHarald Welte1-0/+1
At the end of a measurement processing window, we currently compute the ToA / timing offset at 1/256th symbol accuracy, but we only print it to the log. Let's store the value in the lchan to make it usable by other code in follow-up patches. Change-Id: I5f00a16ac966b627d9452a98b8fa70984bed684a
2018-02-27L1SAP: Increase resolution of reported burst timingHarald Welte1-1/+1
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
2018-02-27measurement.c: higher-precision TA/TOA mathHarald Welte1-2/+2
Change-Id: I0dc8e78545465dfc5c93691a49b86b6b8b56b432
2018-02-27trx/scheduler: Use integer math for TOA (Timing of Arrival)Harald Welte2-9/+9
There's no need to express TOA as a float: * We receive it as signed 16bit integer in units 1/256 symbol periods * We pass it to L1SAP as signed integer in 1/4 symbol periods So turn it into an int16_t with 1/256 symbol period accuracy throughout the code to avoid both float arithmetic as well as loosing any precision. Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
2018-02-27RACH decoding: Use BER threshold for RACH ghost detectionHarald Welte1-0/+1
When decoding RACH bursts, we should use a BER threshold in order to help distinguish 'ghost' RACH bursts from real RACH bursts. The theoretical ideal threshold according to some papers is 7 out of 41 bits qhich aquals to Eb/N0 of 0 dB = 0.1707 (17.07%) We add a new 'ber10k' parameter to the RACH indication l1sap primitive (needs separate change for libosmocore), and then fill this value from osmo-bts-{sysmo,lc15,trx,octphy}. The common part above L1SAP then applies the threshold, which can be changed from vty using the "max-ber10k-rach <0-10000>" command available at the BTS node. The unit is BER in 1/10000, i.e. a value of 100 equals 1% bit error rate. Change-Id: Ic41c11f6312a36baa2738547e8dcec80829457f8
2018-02-26split scheduler_mframe.c from scheduler.cHarald Welte1-0/+30
There are use cases for the multiframe scheduler tables outside the context of the entire scheduler. Let's prepare for that. Related: OS#2978 Change-Id: I6a501e66c47809ae3cdc55bef2cb6390ee0096b1
2018-02-26counters: split rach:sent into rach:drop, rach:ho, rach:cs and rach:psHarald Welte1-1/+4
Change-Id: I51e9938df0e05b8fdb12686b9a9bb6994546deed
2018-02-24BTS: add rate_ctr about CCCH (paging, agch, pch)Harald Welte3-0/+16
Change-Id: Id6c833746150a3c2e32b00ea6604669f16b84bc4
2018-02-23measurement.c: Hand Frame Number into measurement computationHarald Welte1-1/+1
This is currently only used for logging, but will be needed for proper RX{LEV,QUAL}-SUB reporting in upcoming patches. Related: OS#2978 Change-Id: I07fd06e8a379cab7c0c2eb111c3f5600037d3c9e
2018-02-23scheduler: add trx_sched_is_sacch_fn() functionHarald Welte1-0/+3
For proper measurement processing of RX{LEV,QUAL}-SUB, we will need this information. Related: OS#2978 Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
2018-02-22Introduce + use LOG/DEBUGP with frame number prefixing/printingHarald Welte1-0/+12
Let's make sure whenever we do have a frame number, we print it as context in the related log line Change-Id: I751d5ddb3322fce489bc241459738cbcc55c890b
2018-02-22bts: use feature list instead of speech codec tablePhilipp Maier2-8/+2
osmo-bts has a table of pchan/channel mode combinations for every bts. This table models the codec capabilitys of the BTS hardware. However, having the speech codec apabilities modeled inside the BTS feature list would be much more comfortable and since the feature list is communicated back to the BSC we would get the codec capabilities inside the BSC domain as well. - remove the pchan/channel mode tables - set speech codec variants for each BTS type - fix bts_supports_cm so that it queries the feature list Change-Id: I977dc729ba856631245aedf76afd48eac92166f7
2018-02-22gsm_data_shared: extend bts feature list with speech codecsPhilipp Maier1-1/+7
The feature list does not cover any speech codec related information. - Add speech codec related items to feature list. Change-Id: If6d50c6f4e2348b23f31c3415b0f5577a3f5be50
2018-02-19rsl: do not allow MODE MODIFY request with unsupp. codec/ratePhilipp Maier2-0/+11
When the BSC sends a MODE MODIFY request with an unsupported codec, the BTS must respond with a negative acknowledge. Currently the codec parameter is not checked at all, which may lead into malfunction or crash of the BTS. - Introduce a mechanism to check the codec/rate against a table that is set up in the phy specific code. - Add tables with supported codec/rate combinations for octphy, sysmobts, and trx. Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023 Related: SYS#3212
2018-02-07Add helper to get BCC from BSICMax1-0/+2
Change-Id: Ib539a8739d53ab60d8fadffcef38152b82a28498 Related: OS#1854
2018-02-05Print much more information during 'show lchan'Harald Welte1-0/+5
This adds printing of remote RTP IP/Port, LAPDm SAPI information, MS Timing offset, propagation delay, encryption algorithm+state, loopback status and radio link failure counter to the "show lchan" command. It also adds TODO comments fro those bits that are not yet printed but which would make sense to print. Change-Id: Ic4bc47638b7b402aee9344dc912745a9929c37f4
2018-02-05gsm_lchan: remove unused member fieldsHarald Welte1-2/+0
Change-Id: Icfc601e664ccf33078955e54b02315085cff20a8
2018-01-05Remove BSC-specific partsMax1-101/+0
The dead code is from before repo-split time. Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e
2017-12-03Put useful information in RTCP SDES.Harald Welte1-0/+1
The RTCP Sender Description is supposed to contain useful information to identify the source of the RTP stream. So far, it only contained compile-time default data of libortp. Let's put the BTS UnitID, the lchan number and the OsmoBTS version in there. This change requires libosmo-abis Change-Id Ice794f9e0c6caeea1c67520c12efbfa375d1fb82 Change-Id: Id6ce7188354d3a0517661c9648854ec829ef1cac Related: OS#2701
2017-12-02scheduler: Harmonize log line format; Always print TS name + decoded FNHarald Welte1-0/+6
Change-Id: I5703b46c8a59fe00a3cdc063bcf72872980ec5e5
2017-12-02Comments on individual members of struct gsm_abis_moHarald Welte1-0/+7
Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
2017-10-08Remove build dependency on legacy OpenBSCMax3-2/+1001
* copy-paste gsm_data_shared.* from OpenBSC master * remove corresponding configure check and option * remove .deb dependency Actual refactoring with removal of unnecessary structures/parts, moving common OpenBSC/OsmoBSC parts into libraries etc. are left for further patches. Current patch will make coexistence with *BSC easier and will simplify our build infrastructure. Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13 Related: OS#1923
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