aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
AgeCommit message (Collapse)AuthorFilesLines
2016-02-15make PCU socket and telnet port configurableHarald Welte1-0/+2
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/+5
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-15don't touch OML MO when PHY link is establishedHarald Welte1-8/+8
It seems the right thing to do: Once we know a PHY link is established, the associated OML managed objects should change their state accordingly. However, given all the hackery we do with MO states, this actually breaks things, rather than helping. So I'm disabling that part for now, but this needs to be re-visited at some point.
2016-02-15Introduce new phy_link and phy_instance abstractionHarald Welte1-1/+29
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-17Make T200 default initialization even more robustHarald Welte1-2/+3
There's no need to use memcpy(), which adds the risk that the types of source and destination are not the same (see previous commit). Iterating over the array and assigning each element is more robust.
2016-01-16LAPDm: Use T200 settings from OML rather than libosmocore defaultsHarald Welte1-0/+2
2015-12-06use talloc pool for msgb and ortp libraryHarald Welte1-1/+5
by using a talloc pool, we avoid having to go back to the libc malloc pool all the time. The msgb allocations and libortp allocations happen quite frequently during processing and show up as one of the high priority items in osmo-bts profiles on sysmoBTS with 14 concurrent TCH/H calls (highest load scenario). talloc still consumes significant CPU, this is mostly due to the zero-initialization of all the associated buffers. Strictly speaking we shouldn't need this, but any change there would require lots of testing, as there might be hidden assumptions in the code? In some percentage of cases, talloc still seems to fall back on malloc for msgb allocations, which is currently a bit of a mystery. The pools certainly are large enough, talloc_reprt() rarely reports more than a few tens of kilobytes used by the msgb pool.
2015-09-22ABIS: Introduce bts_model_abis_close to indicate ABIS link failure.Andreas Eversberg1-0/+2
sysmocom-bts model shuts down on link loss, but other models may not want this, so shutdown is moved tor bts_model_abis_close of osmo-bts-sysmo.
2015-09-22move MS power control handling from sysmobts to common partHarald Welte1-0/+1
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-22Relace bts_model_get_time() by get_time() at common partAndreas Eversberg1-0/+7
2015-02-05power/sysmobts: Add a manual ms power level controlHolger Hans Peter Freyther1-0/+5
Currently the DSP is instructed to achieve a given uplink power target but there are circumstances (e.g. EMV testing) where we need more control over it. The "manual/software/osmo" power control can only be implemented per TRX and not per lchan. Add a very very basic control that checks the MS Power used by the phone, the actual receive level and then adjust the power. The code doesn't take the history into account, if the phone can not reach the requested power level the code will be stuck (e.g. no timeout based on multiframes). It has a mode for a fixed power control but no way to set it yet. The change of the mode requires a restart of the software.
2014-12-30CBCH: Implement CBCH block segmentation and RSL_MT_SMS_BC_CMDHarald Welte1-0/+2
* CBCH load indications are not yet sent * The queue length is not yet limited!
2014-11-10bts: Start with the site manager being enabled and availableHolger Hans Peter Freyther1-0/+3
We would never transition the sitemanager to anything. Our SW does not support SW activation's so we are always ready. Related: ONW#1330
2014-11-10bts: Mark NSVC1 as offline. We do not expose a second NSVCHolger Hans Peter Freyther1-1/+1
OsmoBSC> show bts 0 ... GPRS NSVC1: Oper 'Disabled', Admin 'unknown 0x0', Avail 'Off line'
2014-11-10bts: Fix typo in OML commentHolger Hans Peter Freyther1-1/+1
2014-08-24New generic transmit power handlingHarald Welte1-0/+6
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: Remove obsolete commentJacob Erlbeck1-1/+0
Use of configuration variables has already been implemented here, so the TODO comment is removed. Sponsored-by: On-Waves ehf
2014-03-10handover: Set basic values for handover, remember the activation reasonAndreas Eversberg1-0/+2
Introduce the handover.h/handover.c and initialize handover parameters in OML and remember the activation through RSL.
2014-03-10agch: Merge IMM.ASS.REJ if possible when enqueueingJacob Erlbeck1-0/+140
This patch implements merging of IMMEDIATE ASSIGN REJECT messages as suggested in GSM 08.58, 5.7. When a new IMM.ASS.REJ is to be appended to the AGCH queue and the last message in that queue is of the same type, the individual entries (up to 4 per message) of both messages are extracted, combined and stored back. If there are less than 5 entries, all entries fit into the old message and the new one is discarded. Otherwise, the old message will contain 4 entries and the remaining ones are stored into the new one which is then appended to the queue. Ticket: SYS#224 Sponsored-by: On-Waves ehf
2014-03-10agch: Manage AGCH queue lengthJacob Erlbeck1-9/+98
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/pch: Use PCH for AGCH msgsJacob Erlbeck1-3/+12
This patch extends paging_gen_msg() by adding an output parameter is_empty that is true, if only a paging message with dummy entries has been placed into buffer. This feature is then used by bts_ccch_copy_msg() to insert an AGCH message if is_empty is true. Ticket: SYS#224 Sponsored-by: On-Waves ehf
2014-03-10agch: Add simple countersJacob Erlbeck1-0/+1
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-1/+89
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/pch: Put CCCH message generation into commonJacob Erlbeck1-0/+22
This patch adds a common function bts_ccch_copy_msg() that provides and schedules AGCH and PCH messages. It is basically a frontend to paging_gen_msg() and bts_agch_dequeue() and contains refactored code from l1_if.c. Sponsored-by: On-Waves ehf
2014-02-22agch: Keep track of AGCH queue lengthJacob Erlbeck1-1/+7
This patch adds and updates btsb->agch_queue_length to keep track of the queue length. Sponsored-by: On-Waves ehf
2013-10-06abis: delay l1if_reset() until OML link is establishedHarald Welte1-1/+1
2013-10-06migrate away from our own abis.c code to libosmoabisHarald Welte1-4/+4
libosmoabis has a BTS-side implementation of the IPA protocol for years, and osmo-bts should have used that all the time. Unfortunately it had its own local hack, this patch is migrating to the libosmocore implementation.
2013-06-30Don't send OML STATE CHANGE before OML is connectedHarald Welte1-5/+5
Instead of calling oml_mo_state_chg() [which transmits OML STATE CHG] during bts_init(), we use a new oml_mo_state_init() function which simply sets the state.
2013-03-23oml: Only shut the bts down onceHolger Hans Peter Freyther1-0/+6
If the shutdown timer is already running do not deactivate the RF and do not close the trx. This is addressing another instance of the following warning: [ERROR] : DeviceMng_ValidateL1Handle() => Invalid layer 1 handle
2013-03-11Added radio link timeout procedure according to TS 05.08 Chapter 5.2Andreas Eversberg1-0/+3
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-27sysmobts: Improve the shutdown of the DSP on exitHolger Hans Peter Freyther1-1/+3
Issue the RfDeactivate.REQ before sending the MphClose.REQ. Ideally we would issue MphClose.REQ after the RfDeactivate.CNF but this is not possible right now. The current approach makes the following warning of the DSP go away on shutdown. This was tested with my E71 and an active silent-call using a SDCCH. DSP Warning: [ERROR] : DeviceMng_ValidateL1Handle() => Invalid layer 1 handle
2012-12-26ciphering: Handle ciphering support for A5/3 correctlyHolger Hans Peter Freyther1-0/+15
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-20misc: load_ind_period is uint8_t and 60*100 is bigger than that.Holger Hans Peter Freyther1-1/+1
Address the compiler warning and truncate the value by hand.
2012-11-24Add VTY configuration of paging queue size and lifetime of paging recordsHarald Welte1-2/+3
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-26PCU: Removed -P option, so GPRS support is always enabledAndreas Eversberg1-7/+4
2012-07-08PCU: Add PCU socket interface to BTS.Andreas Eversberg1-4/+7
A special command line option "-P" is used to enable socket interface and signal available GPRS MO object to BSC.
2012-07-08Add BTS to list at the beginning of bts_init()Andreas Eversberg1-3/+6
During init process, signals might be sent. PCU receives these signals and requires that BTS instance is already in the list.
2012-06-28Add 12.21 handling for GPRS NSE/NSVC/CELL MOHarald Welte1-0/+10
We now bring the GPRS related MO up in DEPENDENCY state and parse the various NS, BSSGP and RLC parameters as set by the BSC via 12.21/OML.
2012-06-21make sure we don't send CCCH LOAD IND before we have an Abis linkHarald Welte1-1/+1
2012-06-15use default value of 63 for maximum timing advanceHarald Welte1-0/+1
As the careful commitlog reader Andreas points out: When the BSC does not sent NM_ATT_MAX_TA, then it would be zero instead of the specified default value of 63.
2012-06-14attempt to make CCCH Load Indications for PCH workHarald Welte1-0/+2
2012-04-19delete dead codeHarald Welte1-220/+0
2012-01-14bts: Use msgb_dequeue and msgb_enqueue for the AGCH queueHolger Hans Peter Freyther1-11/+4
The TODO item still applies to somehow limit the queue of incoming messages and drop older ones first. A sane limit would be the number of channels (+ or * 2).
2011-11-29LAPDm: Use lapdm_channel_exit() and avoid copy+paste bugHarald Welte1-2/+1
We have to either lapdm_exit() both DCCH and ACCH (not 2x ACCH) or rather call lapdm_channel_exit() which does that for us. Thanks to Holger Freyther for spotting this bug.
2011-09-19fix various compiler warnings across the codeHarald Welte1-30/+0
this deals with unused cocde, unused variables and undeclared symbols in various places.
2011-09-08add commands to configure RTP jitter bufferHarald Welte1-0/+2
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/+17
this config file allows configuration of unit id, oml ip, and local rtp bind IP.
2011-09-03Add new ORTP based libosmo-trau based voice supportHarald Welte1-0/+18
Using osmo-bts-sysmo and this code, it is now possible to do FR and AMR based voice calls on TCH/F. A lot of CPU is wasted in the conversion between the RTP formats and the L1 specific formats for the codec frames. All data needs to be shifted by four bits, and the order of bits needs to be reversed in every byte.
2011-07-01make it clear why we terminateHarald Welte1-1/+4