Commit Graph

110 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 4b4dd100f8 [rsl] Introduce an error state for the lchan and set it on release
When we issue a RF Channel Release in case of a failure we receive
RLL release indications after the channel was tearn down and we
issue another RF Channel Release as a result. The channel allocator
might have already allocated this channel and we release the channel
again with another MS on it.

Make rsl_rf_chan_release take an error argument and make it set
a new state in case of an error and change the RF Channel Release
ack to not set the state back to none in case of an error but wait
for a timeout that is a bit higher than T3111.

I tested this with removing the battery during a phonecall and
waiting for the channel failure. With this test we only send the
release once.
2010-05-31 21:39:23 +08:00
Holger Hans Peter Freyther f30c0dca0d [rsl] Implement the T3111 timer to delay the RF Channel release 2010-05-31 21:33:15 +08:00
Holger Hans Peter Freyther d7fd30617f [rsl] Check the assumption that RF Channel Release is sent during release
We assume that the lchan_free will initiate the release and
that when we handle the RLL release indication or the release
request as part of the shutdown sequence.
2010-05-31 21:30:37 +08:00
Holger Hans Peter Freyther dbc5fae576 [rsl] Move rf channel release scheduling to a new method
The current channel release has a couple of issues we will
need to fix in a set of upcoming commits.

The issues include:
    1.) sending release twice
    2.) reassigning the channel inbetween the relase..
2010-05-31 21:30:16 +08:00
Harald Welte 38e9c82114 RSL: inmplement ip.access paging load indication 'below threshold'
This is an ip.access specific 08.58 oddity.  It reports 0xffff
available paging buffers if the paging load is below the 12.21
CCCH LOAD INDICATION THRESHOLD.

We use 50, since that is what it reports if the threshold == 0.
2010-04-19 10:29:16 +02:00
Holger Hans Peter Freyther 3ba36d5b57 [statistics] Keep track of rf failures and rll release failures
Add two new counters to count the RF Failures and the RLL Release
failure and make them available via the vty interface.
2010-04-17 06:48:29 +02:00
Sylvain Munaut b54dda4cef ipaccess: Send RTP Payload IE for CRCX & MDCX
For GSM V1 FR, the payload type is fixed to 3 in the RFC.
But for the other codecs, the payload type is dynamically assigned
between 96 and 127. Here, we use a static mapping internal to OpenBSC.

This patch is needed to make a rather old 139 unit (with sw version
120a002_v149b42d0) work with something else than FR codec. I also tested
this patch on a newer 139 (with sw version 120a352_v267b22d0) to make
sure it didn't add a regression. More testing with newer EDGE units
should be done by whoever has some of theses.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-12 19:58:57 +02:00
Holger Hans Peter Freyther 63d18b51a7 [rsl] Set the release state from within the lchan class
Currently our GSM04.11 code is closing the link for SAPI=3
and this would mean that the whole channel would be scheduled
for close... where we only want to close everything when freeing
the lchan or handling an error.
2010-04-10 00:14:55 +02:00
Holger Hans Peter Freyther 74419497fc [rsl] Introduce a method to set the state of the lchan
Setting the state through a dedicated method allows us to
track the state transitions and check if they are done in
a proper way.
2010-04-10 00:13:53 +02:00
Holger Hans Peter Freyther 19bab73d79 [rsl] Speculative crash fix in the RSL rcv message
The theory is that the BTS is almost dead and sends out
a incomplete message and we crash with that. I have not
been able to completely verify that.
2010-04-07 23:09:21 +02:00
Holger Hans Peter Freyther acf8a0c59f [misc] Remove whitespace from the end of the line. 2010-03-29 08:47:44 +02:00
Harald Welte 4563eab30e RSL: keep track of ip.access dynamic TCH/PDCH activation
We use the (currently unusued) flags member of the bts_trx_ts structure
to track if a dynamic TCH/PDCH is currently on PDCH mode or not.
2010-03-28 14:42:09 +08:00
Harald Welte dc5062b185 move log/debug codebase to libosmocore
The logging/debugging code is generic enough to move it into libosmocore
while keeping OpenBSC specific definitions in openbsc itself.

This commit uses the logging support present in libosmocore-0.1.2,
you will have to update your library to this version.
2010-03-26 21:31:43 +08:00
Holger Hans Peter Freyther 68884aa156 lchan: Create a structure for MSC data of the lchan
Prepare to split the BSC and the MSC part by putting the
MSC data for a connection into a "gsm_subscriber_connection"
struct and renaming the macros.
2010-03-25 09:07:28 +01:00
Harald Welte e95daf1925 convert openbsc to use libosmocore-0.1.1 API
the 0.1.1 API is cleaned up and removes all exported global static
arrays (like rlm_cause_strs).  There are now proper accessor functions.
2010-03-25 12:13:02 +08:00
Harald Welte 3c9c5f941d rsl: use the rsl_rll_push_l3() and rsl_rll_simple() functions of libosmocore 2010-03-04 10:33:10 +01:00
Harald Welte 2e411c7b0d value_string functions and some RSL related stuff has moved to libosmocore 2010-03-01 21:59:06 +01:00
Harald Welte dfe6c7d910 split 'libosmocore' from openbsc codebase
This library is intended to collect all generic/common funcitionality
of all Osmocom.org projects, including OpenBSC but also OsmocomBB

The library currently includes the following modules:

bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer,
tlv_parse, linuxlist

msgb allocation error debugging had to be temporarily disabled as it depends on
'debug.c' functionality which at the moment remains in OpenBSC
2010-02-20 16:27:23 +01:00
Holger Hans Peter Freyther 93b6c6555c [rsl] Send the MultiRateConfig in the RSL Channel Activate msg
If the lchan has AMR as speech codec we also need to send the
multirate config IE in the channel activation. This is already
done for the RSL Channel Modify message.
2010-01-28 10:23:34 +01:00
Harald Welte (local) d48f4ebb24 rsl: add new 'gsm_trx_name()' function and use it 2009-12-29 11:00:41 +01:00
Harald Welte 1887f9d153 Introduce gsm_lchans_name() for human readable lchan state name
Also, use this new function to dump lchan state on VTY and to
improve readability of RSL log messages.
2009-12-29 10:53:25 +01:00
Harald Welte 8e93b7908f RSL: Introduce LCHAN_S_REL_REQ state
This state will help us to differentiate between channels where we have
requested the release, and channels that are actually released.
2009-12-29 10:53:25 +01:00
Harald Welte (local) 19ef62a0a5 Introduce and use gsm_lchan_name() in addition to gsm_ts_name()
In many cases we actually want a name / unique ID for the lchan,
not just for the on-air timeslot... especially in SDCCH/8 case,
where 8 SDCCHs share one timeslot...
2009-12-28 13:42:33 +01:00
Harald Welte (local) 9538efc8a7 RLL: print human-readable value of RLM CAUSE in ERROR IND 2009-12-28 13:42:03 +01:00
Harald Welte (local) 3e46031f52 Introduce new ACT_REQ state to prevent race condition during channel allocation
When we allocate a channel, we send the RSL CHAN ACT REQ and wait until we get
a CHAN ACT ACK.  Only the ACK will change the state, so there is a race where
we allocate that same channel to a different channel request before we get
the ACT ACK.

Introducing a new ACT_REQ state resolves this issue.
2009-12-28 13:41:16 +01:00
Harald Welte (local) ccd8845449 rename gsm_lchan_name() to gsm_lchant_name() 2009-12-28 13:41:06 +01:00
Harald Welte (local) 2f5df85c26 fix segfault in CHAN RQD log message 2009-12-28 13:40:39 +01:00
Harald Welte (local) 91b603db57 correctly print chan act nack error 2009-12-28 13:40:32 +01:00
Harald Welte (local) 28f1d37380 print TS name when out of resources during CHAN RQD 2009-12-28 13:40:12 +01:00
Harald Welte (local) b29b57a198 include BTS and TRX number in TRX overload message report 2009-12-28 13:38:18 +01:00
Harald Welte (local) 73b82bbf92 print TS name in RLL ERR IND 2009-12-26 22:48:25 +01:00
Harald Welte (local) fc05750cd8 [rsl] correctly print handover detect and connection fail 2009-12-26 22:48:21 +01:00
Harald Welte (local) 93c6284772 fix missing space in log message 2009-12-26 22:48:12 +01:00
Harald Welte 303e5e0314 [meas rep] print the neighbor index when debugp'ing a neigh cell meas 2009-12-26 00:29:05 +01:00
Harald Welte 844eab1df5 rsl: fix "CONNECTION FAIL: RELEASING" message 2009-12-24 14:49:07 +01:00
Harald Welte 5b8ed4398e [logging] differentiate DEBUG, NOTICE and ERROR log levels in NM and RSL 2009-12-24 12:20:20 +01:00
Holger Hans Peter Freyther b61e3b2158 Import the new logging architecture
This is the new logging architecture, including

* support for multiuple logging targets like stderr and vty
* log levels in addition to categories/subsystems
* filtering based on imsi, i.e. only see events for one subscriber
* dynamically change log level for each category for each vty
2009-12-22 22:32:51 +01:00
Harald Welte ffa55a4e87 statistics: Introduce 'struct counter' instead of using unsigned long
This has the advantage that counters can be added all over the code
very easily, while having only one routine that stores all of the
current counter values to the database.  The counters are synced
every 60 seconds, providing relatively fine grained statistics
about the network usage as time passes by.
2009-12-22 20:42:40 +01:00
Harald Welte 24ff6ee0a3 keep some internal statistics inside OpenBSC
the statistics will give us some idea about the network load and
performance.
2009-12-22 00:41:05 +01:00
Harald Welte b8bfc567b7 RSL: keep track if a channel is active or not
This allows us to block packets that we have received after the channel
is no longer being used.  This is visible during handover, where we still
receive a measurement report after the MS has switched to the new channel.

This leftover measurement report then attempts to trigger another handover,
which si bogus and will fail - and thus only consumes resources.

With the new LCHAN_S_ACTIVE state, we can check for this when processing
the measurement report.
2009-12-21 13:33:10 +01:00
Harald Welte a72273e176 rename ipacc_connect_proxy_bind() to rsl_ipacc_mdcx_to_rtpsock()
Our RTP sockets are no longer just for the proxy mode, so having
"proxy" in the function name is really misleading.
2009-12-20 16:53:53 +01:00
Harald Welte 17f5bf64f1 Move RTP socket handling out of signal handlers into abis_rsl
This is not really nice, but we will soon have multiple users of
the CRCX / MDCX / DLCX signals, and we cannot guarantee the ordering
of them.  So as a workaround, we move the RTP socket creation and
deletion into the core abis_rsl codebase.
2009-12-20 15:42:44 +01:00
Harald Welte 479015bc1f don't print measurement reports that have no cells 2009-12-19 18:35:56 +01:00
Harald Welte 5e3d91bff7 ip.access: Keep a full copy of local and remote IP/PORT in lchan
Keeping all parameters for each RTP connection in the abis_ip member of
lchan will help us with actual TCH handover later on.
2009-12-19 18:35:56 +01:00
Harald Welte b1d4c8ed9d logging: introduce log levels at caller site
This introduces a new LOGP() macro together with LOGL_* definition to
support multiple log levels (severities) throughout the codebase.

Please note that the actual logging system does not use them yet,
in this patch we simply introduce the new macros at the caller site.
2009-12-17 23:10:46 +01:00
Harald Welte 8d77b9540a [handover] first functional handover implementation
With this commit, we can successfully hand over a channel from one cell to
another cell.  We implement asynchronous intra-BSC (but inter-BTS) handover.

Changes:
* introduce new DHO log category
* extend rsl_chan_activate_lchan() with argument for HO reference
* introduce actual minimal handover decision making in handover_decision.c
* various fixes to bsc_handover_start() in  handover_logic.c
2009-12-17 00:31:10 +01:00
Harald Welte 33e6597720 assign measurement report lchan member after memset'ing it 2009-12-16 23:29:34 +01:00
Harald Welte 6739dfb705 print measurement reports more verbosely 2009-12-16 16:52:07 +01:00
Harald Welte d12b0fdf51 introduce cache of 6 last recently received measurement reports for each lchan 2009-12-15 21:36:05 +01:00
Harald Welte 9e2748ed3a [RSL] print human-readable channel type during channel allocation failure 2009-12-12 20:53:23 +01:00