aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-bts/gsm_data.h
AgeCommit message (Collapse)AuthorFilesLines
2018-03-17Get rid of 'struct gsm_bts_role_bts'Harald Welte1-100/+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-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-11implement support for 3-digit MNC with leading zerosNeels Hofmeyr1-1/+2
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-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-24BTS: add rate_ctr about CCCH (paging, agch, pch)Harald Welte1-0/+2
Change-Id: Id6c833746150a3c2e32b00ea6604669f16b84bc4
2018-02-22bts: use feature list instead of speech codec tablePhilipp Maier1-6/+0
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-19rsl: do not allow MODE MODIFY request with unsupp. codec/ratePhilipp Maier1-0/+8
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
2017-10-08Remove build dependency on legacy OpenBSCMax1-1/+1
* 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-07-13VIRT-PHY: Initial check-in of a new virtual BTSHarald Welte1-0/+6
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-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
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-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-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-08-30cosmetic: common ts_is_pdch()Neels Hofmeyr1-0/+1
Have one common ts_is_pdch(), placed in lchan.c, since this file is pretty empty and pretty close to ts. Publish in gsm_data.h. Remove the if-style implementation from l1sap.c, and instead implement in a switch statement. This prepares for upcoming ts_is_pdch() usage in ph_data_req() for sysmo and lc15. Change-Id: Ib78d663fdbac5a1d7053f1b9d543649b66da00e2
2016-07-25prepare dyn TS: split/replace conf_lchans_for_pchan()Neels Hofmeyr1-0/+2
Move the actual switch from static conf_lchans_for_pchan() into new 'public' function conf_lchans_as_pchan(), adding an explicit pchan argument. This allows passing a non-trivial pchan, for dynamic TS. conf_lchans_as_pchan() now takes a pchan argument, so distinguish the naming and drop the 'for_pchan' from conf_lchans_for_pchan(), which takes only a ts argument. Change-Id: I8e458501fff5503c243512aeb3469c12b1f2bbc4
2016-02-15make PCU socket and telnet port configurableHarald Welte1-0/+4
In some cases we'd like to run multiple instances of osmo-bts on a single machine. This is the case where we a multi-TRX PHY is to be used for several BTSs, or in case osmo-bts-trx has multple SDRs attached. This wa currently prevented by having a hard-coded PCU socket path and telnet port, which are now configurable via VTY / config file itself.
2016-02-15LC15/sysmobts: Don't try to refer to fl1h from PHY configHarald Welte1-0/+3
At the time the phy link / phy instance level VTY configuration commands are parsed, we did not yet call l1if_open() and thus pinst->u.{lc15,sysmobts}.hdl == NULL. PHY or PHY instance specific configuration must thus be stored inside the phy_link or phy_instance itself, and not inside the (not yet existing) handle. We solve this by moving around some parameters: * clk_use_eeprom/clk_cal/clk_src/calib_path get replicated in phy_instance * min_qual_{rach,norm} are moved into the generic part (which means that osmo-bts-octphy and osmo-bts-trx should also implement them)
2016-02-15Introduce new phy_link and phy_instance abstractionHarald Welte1-15/+0
This way we can model a flexible mapping between any number of PHYs, each having multiple instances, and then map BTSs with TRXx on top of those PHYs.
2016-02-03abis: Add a queue of OML messagesHarald Welte1-0/+1
When the oml_link is down or not yet established, we currently lost any OML messages that were scheduled for transmission to the BSC. Let's prevent that by keeping a queue of OML messages, which is drained at the time the OML link comes up again.
2016-01-16TRX: replace some more 2715648 magic numbers with GSM_HYPERFRAMEHarald Welte1-0/+3
2016-01-16move 'GSM_FR_BYTES' and related definitiions to common partHarald Welte1-0/+7
2015-09-22TRX: Introduce osmobts-trx, a layer 1 implementation for OpenBTS tranceiversAndreas Eversberg1-0/+7
The code is quite complete, TCH and PDCH channels are not yet tested.
2015-09-22move MS power control handling from sysmobts to common partHarald Welte1-0/+2
MS uplink power control is required in pretty much any BTS, and we cannot assume that they PHY / L1 will always take care of it by itself. So the correspondign code is moved to common/power_control.c and called from the generic part of L1SAP. The corresponding VTY paramter has been moved from the sysmobts-specific trx VTY node to the common BTS VTY node.
2015-09-22sysmobts: Clean up transitions for lchan cipher stateAndreas Eversberg1-2/+3
There are three transitions: 1. LCHAN_CIPH_NONE -> LCHAN_CIPH_RX_REQ -> LCHAN_CIPH_RX_CONF It is used to enable ciphering in RX (uplink) direction only. 2. LCHAN_CIPH_RX_CONF -> LCHAN_CIPH_RX_CONF_TX_REQ -> LCHAN_CIPH_RXTX_CONF It is used to additionally enable ciphering in TX (downlink) direction. 3. LCHAN_CIPH_NONE -> LCHAN_CIPH_RXTX_REQ -> LCHAN_CIPH_RX_CONF_TX_REQ -> LCHAN_CIPH_RXTX_CONF It is used to enable ciphering in both TX and RX directions. This is used when the channel is activated with encryption already enabled. (assignment or handover) In order to follow the order of these transitions, the RX direction must always be set before the TX direction. If no cipher key is set (A5/0), ciphering is set to ALG 0, but lchan cipher state remains at LCHAN_CIPH_NONE.
2015-09-22Add TIME (MPH_INFO) IND messages to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+1
This part moves GSM time handling from osmo-bts-sysmo part to common part.
2014-12-30CBCH: Implement CBCH block segmentation and RSL_MT_SMS_BC_CMDHarald Welte1-0/+6
* CBCH load indications are not yet sent * The queue length is not yet limited!
2014-08-24New generic transmit power handlingHarald Welte1-0/+1
In order to support transmit power reduction by thermal management as well as the variety of new internal / external PA configurations of BTSs, we need a slightly more complex system. Also, as at high power a single dB can be quite a big difference, we are now doing all computations in milli-dB(m), i.e. 1/10000 bel. Ramping is now used both for up and down ramping, as that is useful in cases where you want to gracefully shut down a cell by shrinking its radius, gradually handing over subscribers to neighboring cells. Furthermore, this code is becoming part of the 'common' codebase, as it is not really specific to how sysmobts is working. The user can specify a single aggregate value for external system gain/attenuation. Let's say you have 1dB loss of antenna cable, so you can put that as 'user-gain -1' into the config, which means that a 'transmit power of 20dBm' will be compensatet for that and the TRX is instructed to output 21dBm to compensate the cable loss. Similarly, external PAs can be described by a positive user-gain. One of the next steps will be to communicate those values and the nominal power capability of the specific BTS to the BSC, so the BSC will automatically show correct signal levels in the VTY and log files. The code includes provisions for future extensions regarding * an external and an internal PA with calibration tables * a thermal attenuation setting to be controlled by the site manager
2014-03-10agch: Manage AGCH queue lengthJacob Erlbeck1-0/+9
Currently, the AGCH queue length is not limited. This can lead to large delays and network malfunction if there are many IMM.ASS.REJ messages. This patch adds two features: - Don't accept msgs from the RSL layer when the queue is way too full (safety measure, mainly if bts_ccch_copy_msg() is not being called by the L1 layer, currently hard coded to 1000 messages) - Selectively drop IMM.ASS.REJ from the queue output depending on the queue length Ticket: SYS#224 Sponsored-by: On-Waves ehf
2014-03-10agch: Add simple countersJacob Erlbeck1-0/+10
Counters are added for the following events (use VTY show to query): - Dropped IMMEDIATE ASSIGN REJECT messages - Merged IMMEDIATE ASSIGN REJECT messages - Rejected AGCH messages - Use of PCH (non-reserved) for AGCH messages - Use of AGCH (reserved) for AGCH messages Sponsored-by: On-Waves ehf
2014-03-10agch: Recalculate length limit of AGCH queueJacob Erlbeck1-0/+1
This patch adds a function bts_update_agch_max_queue_length() to compute a limit of the AGCH queue. This is based on the idea, that the AGCH queue has a limited drain rate and that CHANNEL REQUESTs must be answered within a certain time frame, given by the minimum value of T3126 (see GSM 04.08). When the AGCH queue reaches that limit, the last message would be delivered in time if there were no other delays involved (which is not the case). The calculation is based on the ratio of the number RACH slots and CCCH blocks per time: Lmax = (T + 2*S) / R_RACH * R_CCCH where T3126_min = (T + 2*S) / R_RACH R_RACH is the RACH slot rate (e.g. RACHs per multiframe) R_CCCH is the CCCH block rate (same time base like R_RACH) The value depends control_channel_desc.ccch_conf and rach_control.tx_integer (both from SYSINFO_TYPE_3) and should therefore by called at least each time after one of these is changed. For this reason, a signal callback is registered under SS_GLOBAL/S_NEW_SYSINFO which invokes bts_update_agch_max_queue_length(). Sponsored-by: On-Waves ehf Based-On: "bts: Calculate length of agch queue" by Ivan Kluchnikov <kluchnikovi@gmail.com>
2014-02-22agch: Keep track of AGCH queue lengthJacob Erlbeck1-0/+1
This patch adds and updates btsb->agch_queue_length to keep track of the queue length. Sponsored-by: On-Waves ehf
2013-06-24sysmobts: Introduce an auto-band config to ease DCS/DCS, PCS/PCS changesHolger Hans Peter Freyther1-0/+3
During development one switches from GSM900 to GSM1800 and GSM850 to GSM1900. This commit attempts to make this switch more easy. GSM1800 and GSM1900 have overlapping ARFCNs. This means that the mapping from bands to arfcn is not injective. Because of that I removed the code to deduce the band from the ARFCN. This was done in commit 8c3d807b3fc785ffb18aeb97355150c92221e8a0. The auto-band option allows to move between GSM900/GSM1800 and GSM850/GSM1900. Add a simple testcase with these auto-band configurations.
2013-03-11Added radio link timeout procedure according to TS 05.08 Chapter 5.2Andreas Eversberg1-0/+1
Chapter 5.2 applies to MS procedure, but 5.3 (BSS procedure) defines no exact criterion, so I decided to use the procedure equivalent to MS. The criterion is based on a counter S, which is initialized to a preset RADIO_LINK_TIMEOUT, which can be configured via VTY. Whenever a received SACCH block is bad, S is counted down by one. If SACCH block is successfully decoded, S is counted up by two, but never above initial RADIO_LINK_TIMEOUT value. If S reaches 0, an RSL Connection Failure Indication with cause RF Radio Link Failure is sent to BSC, which then aborts channel. Use link timeout value from BSC via OML attribute. How to test: - Set "debug" for "meas" logging. - Start silent call to an attached mobile. - Remove battery from mobile or shield mobile. - Watch S count down.
2013-02-04Deprecate the "rtp bind-ip" configuration directiveHarald Welte1-1/+0
Instead of explicitly having to specify the local IP address for RTP sockets in the BTS, we just use "0.0.0.0" instead, which gets translated to INADDR_ANY. We still accept the configuration directive in old config files, but when we write, the line will no longer be re-written to the file. TODO: IMHO, the IPA RSL CRCX/MDCX actually permit the BSC to specify the IP address on the BTS side, and we probably simply ignore this at this point.
2013-01-13paging: De-duplicate paging lifetime and max queue length variablesDaniel Willmann1-2/+0
These attributes are saved in paging_state, we don't need to save them a second time in struct gsm_bts_role_bts. Add get and set methods for these attributes and use them consitently in the VTY code.
2012-12-26ciphering: Handle ciphering support for A5/3 correctlyHolger Hans Peter Freyther1-1/+7
This was found and debugged by Sylvain. The BTS will always support A5/0 so we do not keep track of that, the first bit of the flags is used for A5/1, second for A5/2... but for RSL there is an offset to go from RSL to A5(x). Add a testcase and change the code.
2012-12-20openbsc: Prepare to allow to have the OpenBSC directory somewhere elseHolger Hans Peter Freyther1-1/+1
Right now osmo-bts requires access to one OpenBSC header file and this requires that openbsc and osmo-bts git are in the same directory. Begin with making the location of the OpenBSC sourcecode configurable. This approach will allow to build osmo-bts on our Jenkins installation but now has the risk of more code including the openbsc/*.h header files.
2012-11-24Add VTY configuration of paging queue size and lifetime of paging recordsHarald Welte1-0/+2
This may be adding bells and whistles that nobody wants to touch, but at least for current analysis/optimiziation they are useful to have. Later on they should probably be removed again and/or obsoleted by OML messages for configuration of paging behaviour by the BSC.
2012-07-08PCU: Add PCU socket interface to BTS.Andreas Eversberg1-0/+4
A special command line option "-P" is used to enable socket interface and signal available GPRS MO object to BSC.
2012-06-15RSL: Add CCCH LOAD INDICATION for RACHHarald Welte1-0/+4
We now count the total number of RACH slots, the number with rx level above the busy threshold, and the number of valid access bursts. This data is used to generate RSL CCCH LOAD INDICATION for the RACH.
2012-06-03sysinfo: Make our SI scheduling more completeHarald Welte1-0/+3
We now implement the fairly complex rules for schedulign of SI 2bis/2ter/2quater, 13 and 9 on TC=4 and TC=5 of the BCCH Norm. The patch is currently untested.
2012-04-19lchan: Similar to OpenBSC use a set method to change the stateHolger Hans Peter Freyther1-0/+3
By making all modifications through lchan_set_state we can easily add code to verify the state transition.
2012-04-19ciphering: Better state tracking and HACK around L1 race conditionHarald Welte1-0/+8
We now check if the received message is an LAPDm I frame in order to determine if we have received the first valid encrypted message on the radio link. This relates to the fact that we often see 'old' UI frames coming up from L1, even after it has confirmed decryption has been enabled.
2011-11-24RSL: Actually check if BSC-requested cipher is supportedHarald Welte1-0/+3
2011-09-08add commands to configure RTP jitter bufferHarald Welte1-0/+1
there's one global setting for the BTS default value, plus an interactive command to change the buffer of an active lchan on the fly
2011-09-04add minimal configuration file supportHarald Welte1-1/+4
this config file allows configuration of unit id, oml ip, and local rtp bind IP.
2011-06-27re-work original osmo-bts with support for sysmocom femtobtsHarald Welte1-0/+57
This code re-works osmo-bts to add support for the upcoming sysmocom BTS. It also tries to add some level of abstraction between the generic part of a BTS (A-bis, RSL, OML, data structures, paging scheduling, BCCH/AGCH scheduling, etc.) and the actual hardware-specific bits. The hardware-specific bits are currently only implemented for the sysmocom femtobts, but should be (re-)added for osmocom-bb, as well as a virtual BTS for simulation purpose later. The sysmocom bts specific parts require hardware-specific header files which are (at least currently) not publicly distributed.