aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-cscn
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-01-28 14:20:27 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-03 16:19:09 +0100
commit71d1e17e5e0c420cf00ea759743b81aaff72136e (patch)
treea5bad1c6def4bca6f23aee526f29f869c71cf9f7 /openbsc/src/osmo-cscn
parent2c9e65051c598a42d6a59490b67adb366929ac03 (diff)
cscn: call msc_compl_l3() from subscr_conn_allocate_iu()
Pubish msc_compl_l3() decl in new file libmsc/msc_api.h (but see comment). Call msc_compl_l3() when establishing a subscriber connection for IuCS. Remove bts from subscr_conn_allocate_iu() signature, use network, link_id and conn_id instead. Move subscr_conn_allocate_iu() to the top of the file, because it semantically belongs before subscr_conn_lookup_iu().
Diffstat (limited to 'openbsc/src/osmo-cscn')
-rw-r--r--openbsc/src/osmo-cscn/iu_cs.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/openbsc/src/osmo-cscn/iu_cs.c b/openbsc/src/osmo-cscn/iu_cs.c
index c8a36f47b..db9cc1bb1 100644
--- a/openbsc/src/osmo-cscn/iu_cs.c
+++ b/openbsc/src/osmo-cscn/iu_cs.c
@@ -1,6 +1,29 @@
#include <openbsc/gsm_data.h>
#include <openbsc/iu.h>
+#include <openbsc/bsc_api.h> /* for BSC_API_CONN_POL_ACCEPT, TODO move that to libmsc */
+
+#include "../libmsc/msc_api.h"
+
+/* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */
+struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network,
+ uint8_t link_id,
+ uint32_t conn_id)
+{
+ struct gsm_subscriber_connection *conn;
+
+ conn = talloc_zero(network, struct gsm_subscriber_connection);
+ if (!conn)
+ return NULL;
+
+ conn->via_iface = IFACE_IUCS;
+ conn->iu.link_id = link_id;
+ conn->iu.conn_id = conn_id;
+
+ llist_add_tail(&conn->entry, &network->subscr_conns);
+ return conn;
+}
+
/* Return an existing Iu-CS subscriber connection record for the given link and
* connection IDs, or return NULL if not found. */
static struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network,
@@ -76,18 +99,3 @@ int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint8_t l
return 0;
}
-/* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */
-struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_bts *bts)
- /* TODO "bts"? this is an hNodeB, really. */
-{
- struct gsm_subscriber_connection *conn;
-
- conn = talloc_zero(bts->network, struct gsm_subscriber_connection);
- if (!conn)
- return NULL;
-
- conn->via_iface = IFACE_IUCS;
- conn->bts = bts;
- llist_add_tail(&conn->entry, &bts->network->subscr_conns);
- return conn;
-}