Commit Graph

79 Commits

Author SHA1 Message Date
Andreas Eversberg 00b4e064ff handover: Add generic handling for handover
The BTS layer needs to inform the handover code when an access
burst has been received. In turn the handover layer will ask the
bts to modify the channel, it will schedule the physical information
inform the BSC with the HANDOVER DETECTION and waits for the BTS
layer to inform it about the first received frame to stop a timer.
2014-03-10 13:38:07 +01:00
Andreas Eversberg 8ade45e795 handover: Set basic values for handover, remember the activation reason
Introduce the handover.h/handover.c and initialize handover parameters
in OML and remember the activation through RSL.
2014-03-10 13:38:07 +01:00
Andreas Eversberg 3058854535 handover: Implement generating HANDOVER DETECTION in rsl_tx_hando_det 2014-03-10 13:38:07 +01:00
Andreas Eversberg a37e239961 handover: Introduce debug area for handover related items 2014-03-10 13:38:07 +01:00
Jacob Erlbeck fae0149260 agch: Manage AGCH queue length
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-10 09:40:04 +01:00
Jacob Erlbeck 7503540959 agch/pch: Use PCH for AGCH msgs
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-10 09:22:24 +01:00
Jacob Erlbeck 35a8144e41 agch: Add simple counters
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-10 08:55:02 +01:00
Jacob Erlbeck 4fbe06b3f2 agch: Recalculate length limit of AGCH queue
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-03-10 08:54:54 +01:00
Jacob Erlbeck d290ee029a agch/pch: Put CCCH message generation into common
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-22 08:45:56 +01:00
Jacob Erlbeck d242ec2ed9 agch: Keep track of AGCH queue length
This patch adds and updates btsb->agch_queue_length to keep track of
the queue length.

Sponsored-by: On-Waves ehf
2014-02-22 08:44:29 +01:00
Holger Hans Peter Freyther f56d56c439 sysmobts: Activate the BCCH silently have have state set to active
Use the lchan->rel_act_kind field for the BCCH activatiob by OML.
The lchan's should be marked as active but no event should be sent to
the BSC. This is mostly like the PCU. We can now remove the secnd
argument from lchan_activate.
2013-11-27 14:26:39 +01:00
Holger Hans Peter Freyther a82cc5321e rsl: Rename abis_rsl_sendmsg to avoid symbol clash with libosmo-abis
Nicolas ended up with linker issues due abis_rsl_sendmsg being
defined twice. Rename our version of the function and update the
code.

Patched with:
 @i@
 expression E;
 @@

 - abis_rsl_sendmsg(E)
 + abis_bts_rsl_sendmsg(E)
2013-11-14 10:41:18 +01:00
Jacob Erlbeck 5b69ec3e72 sysmobts: Use status flags instead of direct LED access
Currently the LEDs are being accessed directly from within the
l1_if.c file. So the handling of rf mute and activate/deactivate both
access LED_RF_ACTIVE directly. This may lead to an inconsistent LED
status.

This patch replaces these calls to sysmobts_led_set() by an abstract
equivalent bts_update_status(), that uses a set of independant status
ids. The associated values can than be combined into a visible LED
status. Currently LED_RF_ACTIVE is on iff BTS_STATUS_RF_ACTIVE is set
and BTS_STATUS_RF_MUTE is not set.

Sponsored-by: On-Waves ehf
2013-11-05 15:51:19 +01:00
Jacob Erlbeck 08571b1588 sysmobts: Do a RF mute when Radio Carrier is locked
Currently a Change Administrative State Request is just applied
unconditionally to the object's state object and then acknowledged.

This patch implements the special handling of setting the Radio
Carriers state to LOCK or UNLOCK. This is done by passing the
appropriate mute command to the L1 layer. Always all radio channels
are affected, it is not possible to lock single radio channels.
On success, an ACK is sent back to the bsc with the new state (based
on the state passed in the callback by the L1 layer). If something
went wrong or the firmware doesn't support RF mute, a NACK
(REQ_NOT_GRANTED) is sent instead.

Note that a NACK for such a request hasn't been sent by the BTS to
the BSC yet, so (albeit it's spec conformant to do so) the BSC must
be prepared to handle this correctly.

Ticket: OW#976
Sponsored-by: On-Waves ehf
2013-11-05 15:46:30 +01:00
Jacob Erlbeck 9ef742f5e7 sysmobts: Add L1 support for the new RF mute request
This adds a new function

  l1if_mute_rf(femtol1_hdl, ch_mute[8])

to set the mute state for each radio channel. On completion and iff
l1if_mute_rf() returned 0 the callback

  oml_mo_rf_lock_chg(mo, ch_mute_state[8], success)

is invoked when the response from the superfemto DSP is received.

Ticket: OW#976
Sponsored-by: On-Waves ehf
2013-11-05 15:46:22 +01:00
Holger Hans Peter Freyther 6321c72522 rsl/pcu: Do not send a CHAN ACT to the BSC on PCU usage
The PCU is forcing the activation of a PDCH. Currently the BSC
will receive a channel act ack for a channel that was not
activated at all. Use the "release_reason" flag of the lchan
to see if we have requested a normal activation or a silent
one.

It feels a bit odd to do it in the TX function but it is the
most easy solution right now. I have added logging so it will
not be totally silent.
2013-10-25 19:14:44 +02:00
Harald Welte d92774b4ac abis: delay l1if_reset() until OML link is established 2013-10-06 15:50:36 +02:00
Harald Welte 359fb8caf4 abis: Use OML remote (BSC) address if RSL CONNECT contains no IP
This introduces a new get_signlink_remote_ip() function whcih we also
use in the RSL code to determine the RTP remote address if the CRCX/MDCX
contains no remote IP address IE.
2013-10-06 15:50:36 +02:00
Harald Welte 6d5dc060ea migrate away from our own abis.c code to libosmoabis
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-10-06 15:50:36 +02:00
Harald Welte 6404a76661 make oml_mo_state_init() a void function
... so we don't get warnings about not returning anything
2013-06-30 15:29:26 +02:00
Harald Welte 48eca2524c Don't send OML STATE CHANGE before OML is connected
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-06-30 15:09:35 +02:00
Holger Hans Peter Freyther f169a75fc4 sysmobts: Introduce an auto-band config to ease DCS/DCS, PCS/PCS changes
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 8c3d807b3f. The auto-band
option allows to move between GSM900/GSM1800 and GSM850/GSM1900.

Add a simple testcase with these auto-band configurations.
2013-06-24 08:17:12 +02:00
Holger Hans Peter Freyther 9be5f8c9c0 measurement: Mark the internal functions as internal
In terms of assembly code this only removes the ".global FN" from
the code. GCC does not attempt to inline it right now.
2013-05-04 13:12:20 +02:00
Andreas Eversberg 5cbc7e9167 Get RSSI from received uplink data and send to PCU
This bumps the PCU API version and thus requires a new version of the
code on the sysmoBTS side!
2013-03-17 17:43:02 +01:00
Andreas Eversberg 294fd1b650 Added radio link timeout procedure according to TS 05.08 Chapter 5.2
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-03-11 11:47:41 +01:00
Holger Hans Peter Freyther faba73a812 sysmobts: Improve the shutdown of the DSP on exit
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
2013-02-27 10:44:01 +01:00
Harald Welte 550d22be5b Deprecate the "rtp bind-ip" configuration directive
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-02-04 22:16:23 +01:00
Daniel Willmann 91816acfb8 paging: De-duplicate paging lifetime and max queue length variables
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.
2013-01-13 17:24:45 +01:00
Holger Hans Peter Freyther 19cf0e81b3 ciphering: Handle ciphering support for A5/3 correctly
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-26 18:55:54 +01:00
Holger Hans Peter Freyther c559dde69d misc: Package our version of the gsm_data.h to make the code compilable
The sharing with OpenBSC is not complete yet. We will need to include
our version of gsm_data.h instead of the normal OpenBSC version.
2012-12-22 16:02:05 +01:00
Holger Hans Peter Freyther 359b2cf469 misc: Fix the make distcheck of the osmo-bts code
* Comment out the osmo-bts-bb/Makefile as we have removed it from
  the SUBDIRS and are not packaging the code right now
* Add missing include files for the build
2012-12-22 14:59:12 +01:00
Holger Hans Peter Freyther bcae2abff8 openbsc: Prepare to allow to have the OpenBSC directory somewhere else
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-12-20 19:02:37 +01:00
Holger Hans Peter Freyther 4fd0a84cf8 misc: Change the method to return void instead of int and garbage
The method was not returning anything and the callers did not use
the result. Change it to void for now.
2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 9bd5afa014 misc: Include pcu_if.h for pcu_tx_pag_req in rsl.c and make it const
The rsl.c code was calling the paging request with a const pointer,
change the signature to make the code const.
2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 8d8ff80890 misc: Forward declare the load_timer_start to address compiler warning 2012-12-20 19:01:27 +01:00
Harald Welte 2bad1363e9 Add VTY configuration of paging queue size and lifetime of paging records
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-11-24 22:28:44 +01:00
Andreas Eversberg c1ad2ac20f PCU: Add PCH confirm, raise PCU interface version to 4
The confirm is required, so PCU knows when an IMMEDIATE ASSIGN message has
has been sent on PCH. The PCU will start packet flow after that confirm.
2012-09-29 20:31:40 +02:00
Holger Hans Peter Freyther fde8e6dc0c vty: Remove TS_NODE and LCHAN_NODE as they are not used. 2012-07-25 14:34:22 +02:00
Andreas Eversberg 1195148fc6 Send RR paging requests to PCU, in order to page on PACCH 2012-07-21 13:19:43 +02:00
Andreas Eversberg 1ddb183736 Enable direct access to PDTCH queue of DSP by PCU
Use "-P -M" to enable PCU and direct access.
2012-07-21 13:18:45 +02:00
Andreas Eversberg 0390d54ade logging: Fixed order of logging categories in enum list
The enum list must have the same order as the logging description
structure. Otherwiese libosmocore will crash when writing loglevels at
VTY.
2012-07-16 18:50:55 +02:00
Andreas Eversberg 0c470759da PCU: Add verion number of PCU interface to PCU INFO IND message
The client (PCU) can check if it is compiled with a different version.
2012-07-16 18:50:26 +02:00
Andreas Eversberg 744f745d7a PCU: Add PCU socket interface to BTS.
A special command line option "-P" is used to enable socket interface
and signal available GPRS MO object to BSC.
2012-07-08 20:50:02 +02:00
Andreas Eversberg 07b37853a4 PCU: Add PCU socket interface prototype header file 2012-07-08 19:59:41 +02:00
Andreas Eversberg bf2a18e623 debug: Add new debugging class for PCU interface (DPCU) 2012-07-08 19:41:41 +02:00
Andreas Eversberg 66f1fe15e9 signal: Add signals for setting/change of GPRS MO attributes 2012-07-08 19:38:39 +02:00
Andreas Eversberg 07891a0908 paging: Alow to store CCCH messages in paging records
This is required for PCU to send IMMEDIATE ASSIGNMENT messages on PCH.
A message in a paging record is sent only once.
2012-07-08 18:55:45 +02:00
Harald Welte 821bf067e4 RSL: Add CCCH LOAD INDICATION for RACH
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-15 11:07:03 +08:00
Harald Welte 565cf0d8ab attempt to make CCCH Load Indications for PCH work 2012-06-14 11:48:24 +08:00
Harald Welte 2100a2e16f sysinfo: Make our SI scheduling more complete
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-06-03 07:37:52 +02:00