Commit Graph

31 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 08eebd59b7 lchan: Every SS_LCHAN signal now sends a struct lchan_sig_data
The SS_LCHAN signals now always include the lchan_sig_data. For
the measurement report it will optionally include the measurement
report as well. Attempt to update all handlers of this signal as well
2010-12-27 13:32:20 +01:00
Holger Hans Peter Freyther 9d3e2ec698 ho: Access the network after we are known to have an entry. 2010-12-26 21:19:29 +01:00
Holger Hans Peter Freyther c839667324 ho: Set the conn to NULL before calling lchan_release
In case we fail to activate the lchan set the connection to
NULL before calling the lchan release function.
2010-12-26 21:19:28 +01:00
Holger Hans Peter Freyther 2391b4c474 ho: On ho failure clear the subscriber connection
Forget about the ho_lchan inside the gsm_subscriber_connection
in case of a handover failure, also clear the gsm_subscriber_connection
pointer before the lchan is passed to the lchan_free routine.
2010-12-21 13:41:33 +01:00
Holger Hans Peter Freyther 90cdd28e6f ho: Make this allocation a child of the BSC talloc context
Do not use the NULL context for this allocation. It should hang
off the gsm_subscriber_connection but for now at least make it
the child of the BSC so it is showing up in the talloc report.
2010-12-21 13:41:33 +01:00
Holger Hans Peter Freyther 457c2a879c [alloc] Assign a TCH for LU when all SDCCHs are occupied.
When the cell becomes visible we will be bombed with location
updating requests and to reduce the load on the network we should
assign as many channels for it as possible. During load peek it
is even more important than to have a spare voice channel and in
general the LU procedure is pretty fast.
2010-09-06 08:58:42 +08:00
Holger Hans Peter Freyther d9c9f07c2c handover: lchan_free will only free the local resources.
lchan_free only free's the local resource of the BSC but
does not release the channel at the BTS. Use lchan_release
to properly release the channel. This code assumes that the
timeout happens after a CHAN ACT ACK/NACK otherwise we have
some problems. The comment indicates that this is the case.
2010-06-30 13:04:13 +08:00
Holger Hans Peter Freyther f2553a6c3a handover: Call bsc_handover_clear from gsm0808_clear
The bsc_handover_clear will release an in-progress handover
and free the lchana and the data associated with this handover
2010-06-30 13:02:08 +08:00
Holger Hans Peter Freyther e071ab70e9 handover: Attempt to use the same gsm_subscriber_conn for new/old channel
The transaction should not know on which lchan we are operating
as this can change due handover. Add untested code to share the
subscriber connection of the new and old lchan and move the pointer
in case of success/failure. Also on a clear command we will free
any resources allocated...

This code is not tested and needs to be debugged, but it should
have the right structure. I am going to fix a potential memleak
in the next commit.
2010-06-30 12:59:20 +08:00
Holger Hans Peter Freyther 4049455d74 bsc_msc: Remove use_count from the subscriber connection
A channel will be released in case of
    * Errors via the clear_request callback...
    * no more transactions and operations are going on.

This means that if we do something without a transaction
the channel might be closed down right away. The bug fix
will be to create a transaction/operation.
2010-06-28 18:01:47 +08:00
Holger Hans Peter Freyther 2412a07965 bsc_api: Allocate the subscriber_connection dynamically
This is a big change to the way we use the subscriber
connection. From now on it is is dynamically allocated
and we will slowly move from a 1:1 lchan to conn to
having more than one lchan per connection.

This is the first commit, the subscr_con* methods will
move to gsm_data once the use_count is removed from the
connection, the freeing of the connection will also change.
2010-06-28 16:12:39 +08:00
Holger Hans Peter Freyther 5eec9d91d8 [rsl] Set the right state when asking for the activation.
Set the state to activation to avoid a warning about the
getting a CHAN ACK without waiting for it. We set it in
the code to make sure it is set after all error checking
to avoid inconsistent state as the state is only set back
to NONE/ACT due replies from the BTS.
2010-04-10 00:16:04 +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 e95d4825f5 lchan: Change transaction to work on the GSM Subscriber Connection
Change the MSC transaction code to operate on a GSM Subscriber Connection
instead of the lchan. This will help us to separate the two commands properly.
2010-03-25 09:07:28 +01: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 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
Harald Welte 7c639a05a3 [handover] print INFO message when doing handover 2009-12-26 00:29:18 +01:00
Harald Welte e98d4278d0 [handover] CRCX ACK without HO reference is normal, not an error 2009-12-24 13:27:02 +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 ade773f441 handover: set old channel to INACTIVE state
After receiving the HANDOVER COMPLETE on the new channel, we mark the
old channel as INACTIVE and try to release it ASAP.
2009-12-21 13:33:10 +01:00
Harald Welte a037902323 [handover] implement TCH RTP stream handover
This patch takes care of handling the RTP streams / sockets during
an in-call handover from one BTS to another BTS.

It only works in combination with rtp_proxy mode.
2009-12-20 17:04:40 +01:00
Harald Welte 9f16c87106 handover: don't create negative lchan use counts
trans_lchan_change() takes care of use counts for us.
2009-12-20 00:06:53 +01:00
Harald Welte a9fa8dca33 [handover]: make sure the new lchan keeps the subscriber pointer of the old lchan
also, ensure that we don't print debug messages about handover in non-handover
channel activation cases.
2009-12-18 14:50:08 +01:00
Harald Welte 6f7a5a7843 handover: use correct handover lookup function 2009-12-18 11:52:03 +01:00
Harald Welte e47f96b80c fix segfault in case of handover timer expiration 2009-12-18 11:49:03 +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 6670681251 don't try multiple concurrent handovers for 1 channel 2009-12-17 22:23:21 +01:00
Harald Welte fe18d5cba4 call trans_lchan_change() from ho_gsm48_ho_compl() 2009-12-17 17:14:43 +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 798418a068 [handover] Implement handover control logic
Code to implement handover control logic.  A yet-to-be-implemented
handover algorithm will call bsc_handover_start(old_lchan, new_bts)
to start the handover process.
2009-11-29 22:56:14 +01:00