From e005619dc6cbfcbd260cab6b2535d10eb0e75c6d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 19 Jun 2016 18:06:02 +0200 Subject: Introduce subscriber_connection ref-counting This introduces a reference count for gsm_subscriber_connection. Every user of the connection needs to hold a reference until done. Once the reference count dorps to zero, the connection is cleared towards the BSC (which subsequently will clear any logical channels associated with it). Related: OS#1592 Change-Id: I8c05e6c81f246ff8b5bf91312f80410b1a85f15e --- openbsc/include/openbsc/gsm_data.h | 5 +++++ openbsc/include/openbsc/osmo_msc.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'openbsc/include') diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e9ba173ce..5194b91f9 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -115,8 +115,13 @@ enum ran_type { /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { + /* global linked list of subscriber_connections */ struct llist_head entry; + /* usage count. If this drops to zero, we start the release + * towards A/Iu */ + uint32_t use_count; + /* To whom we are allocated at the moment */ struct gsm_subscriber *subscr; diff --git a/openbsc/include/openbsc/osmo_msc.h b/openbsc/include/openbsc/osmo_msc.h index beb3f5e4c..8f57ce25f 100644 --- a/openbsc/include/openbsc/osmo_msc.h +++ b/openbsc/include/openbsc/osmo_msc.h @@ -6,6 +6,7 @@ #include "bsc_api.h" struct bsc_api *msc_bsc_api(); -void msc_release_connection(struct gsm_subscriber_connection *conn); +struct gsm_subscriber_connection *subscr_con_get(struct gsm_subscriber_connection *conn); +void subscr_con_put(struct gsm_subscriber_connection *conn); #endif -- cgit v1.2.3