aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/handover_logic.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-12-26 10:17:42 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-12-26 10:32:02 +0100
commitc121bb3188445dfc23a6daef3444031f447395bb (patch)
treeffc105ad751a96d11816414bba8d0f60dea7acb8 /openbsc/src/libbsc/handover_logic.c
parent006e3d87e019b202a38c5393ab8f5b6df763e664 (diff)
handover: Fix the handover signalling for IP based BTSes
This was reported by Kevin when he was testing handover. The problem is the order of the signal handlers for S_ABISIP_CRCX_ACK. Right now the handover signal handler is called before the one inside the libmsc gsm_04_08.c. This means S_HANDOVER_ACK is signalled _before_ there is a rtp socket created for the channel. The result is that the MDCX will never be sent and the called will not be properly switched _after_ the handover detection. I do not want to play with the order of signal handlers, remove the CRCX ack handling from the handover_logic.c and force the NITB (and later the BSC) to check if the lchan is involved with a handover and do the switching in there. This means right now we do what two signal handlers did in one. Reproduced and tested with the FakeBTS Handover test. Log message: <0004> abis_rsl.c:1954 (bts=1,trx=0,ts=3,ss=0) IPAC_CRCX_ACK ... <000c> gsm_04_08.c:1400 no RTP socket for new_lchan <001a> rtp_proxy.c:533 rtp_socket_create(): success <001a> rtp_proxy.c:615 rtp_socket_bind(rs=0x48703c8, IP=0.0.0.0): ...
Diffstat (limited to 'openbsc/src/libbsc/handover_logic.c')
-rw-r--r--openbsc/src/libbsc/handover_logic.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c
index d2cd5efd9..9cf26af9d 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -329,23 +329,6 @@ static int ho_rsl_detect(struct gsm_lchan *new_lchan)
return 0;
}
-static int ho_ipac_crcx_ack(struct gsm_lchan *new_lchan)
-{
- struct bsc_handover *ho;
- struct ho_signal_data sig_ho;
-
- ho = bsc_ho_by_new_lchan(new_lchan);
- if (!ho) {
- /* it is perfectly normal, we have CRCX even in non-HO cases */
- return 0;
- }
-
- sig_ho.old_lchan = ho->old_lchan;
- sig_ho.new_lchan = new_lchan;
- osmo_signal_dispatch(SS_HO, S_HANDOVER_ACK, &sig_ho);
- return 0;
-}
-
static int ho_logic_sig_cb(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
{
@@ -369,14 +352,6 @@ static int ho_logic_sig_cb(unsigned int subsys, unsigned int signal,
return ho_gsm48_ho_fail(lchan);
}
break;
- case SS_ABISIP:
- lchan = signal_data;
- switch (signal) {
- case S_ABISIP_CRCX_ACK:
- return ho_ipac_crcx_ack(lchan);
- break;
- }
- break;
default:
break;
}
@@ -384,8 +359,16 @@ static int ho_logic_sig_cb(unsigned int subsys, unsigned int signal,
return 0;
}
+struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan)
+{
+ struct bsc_handover *ho;
+ ho = bsc_ho_by_new_lchan(new_lchan);
+ if (!ho)
+ return NULL;
+ return ho->old_lchan;
+}
+
static __attribute__((constructor)) void on_dso_load_ho_logic(void)
{
osmo_signal_register_handler(SS_LCHAN, ho_logic_sig_cb, NULL);
- osmo_signal_register_handler(SS_ABISIP, ho_logic_sig_cb, NULL);
}