aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
AgeCommit message (Collapse)AuthorFilesLines
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
2011-07-01fix various compiler warningsHarald Welte1-2/+1
2011-07-01fix BTS initialization orderHarald Welte1-10/+14
The sequence is as follows: 0) start osmo-bts 1) start connection attempts to BTS 2) issue L1-RESET.req 3) receive L1-RESET.conf 4) issue RF-ACTIVATE.req 5) receive RF-ACTIVATE.conf 6) receive attributes for TRX 7) receive opstart for TRX 8) issue MPH-INIT.req [...] The important point here is: We don't want the BSC to set TRX attributes or do TRX opstart before our RF related hardware is initialized.
2011-06-29deactivate RF + exit when the Abis link is goneHarald Welte1-0/+21
The idea is that the BTS process is re-spawned from init/upstart/systemd
2011-06-27re-work original osmo-bts with support for sysmocom femtobtsHarald Welte1-65/+80
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.
2011-05-22[partial] port to new libosmocore-0.3 APIsHarald Welte1-9/+9
2011-03-04Fix include paths and start to make code compileHarald Welte1-8/+10
(still lots of missing references into osmocom-bb code)
2011-03-04Import all C and Header files from jolly/bts branch of osmocom-bb.gitHarald Welte1-0/+376
The BTS code shall reside in a separate git repository, thus I'm importing the C and H files here.