path: root/openbsc/include
diff options
authorHarald Welte <>2016-06-19 18:06:02 +0200
committerNeels Hofmeyr <>2017-03-16 15:32:29 +0100
commite005619dc6cbfcbd260cab6b2535d10eb0e75c6d (patch)
tree07075bb26ade2ef8e866ed2b2b818014b363cd81 /openbsc/include
parent7564acac242e6112b70b493b314a74baaca1f6e8 (diff)
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
Diffstat (limited to 'openbsc/include')
2 files changed, 7 insertions, 1 deletions
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);