diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-01-28 14:20:27 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-03-03 16:19:09 +0100 |
commit | 71d1e17e5e0c420cf00ea759743b81aaff72136e (patch) | |
tree | a5bad1c6def4bca6f23aee526f29f869c71cf9f7 | |
parent | 2c9e65051c598a42d6a59490b67adb366929ac03 (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().
-rw-r--r-- | openbsc/include/openbsc/iu_cs.h | 6 | ||||
-rw-r--r-- | openbsc/src/libmsc/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/src/libmsc/msc_api.h | 8 | ||||
-rw-r--r-- | openbsc/src/libmsc/osmo_msc.c | 4 | ||||
-rw-r--r-- | openbsc/src/osmo-cscn/iu_cs.c | 38 |
5 files changed, 38 insertions, 20 deletions
diff --git a/openbsc/include/openbsc/iu_cs.h b/openbsc/include/openbsc/iu_cs.h index 4be2ae96a..2169c1ab1 100644 --- a/openbsc/include/openbsc/iu_cs.h +++ b/openbsc/include/openbsc/iu_cs.h @@ -1,5 +1,7 @@ #pragma once int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint8_t link_id); -struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_bts *bts); - /* TODO "bts"? this is an hNodeB, really. */ + +struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, + uint8_t link_id, + uint32_t conn_id) diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index 51958905c..b9efee597 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) $(LIBSMPP34_CFLAGS) -noinst_HEADERS = meas_feed.h +noinst_HEADERS = meas_feed.h msc_api.h noinst_LIBRARIES = libmsc.a diff --git a/openbsc/src/libmsc/msc_api.h b/openbsc/src/libmsc/msc_api.h new file mode 100644 index 000000000..d736b4d98 --- /dev/null +++ b/openbsc/src/libmsc/msc_api.h @@ -0,0 +1,8 @@ +#pragma once + +#include <osmocom/core/msgb.h> +#include <openbsc/gsm_data.h> + +/* TODO does this belong to openbsc/gsm_04_08.h ?? */ +int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, + uint16_t chosen_channel); diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c index ae1a35380..0331de552 100644 --- a/openbsc/src/libmsc/osmo_msc.c +++ b/openbsc/src/libmsc/osmo_msc.c @@ -42,8 +42,8 @@ static int msc_clear_request(struct gsm_subscriber_connection *conn, uint32_t ca return 1; } -static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, - uint16_t chosen_channel) +int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, + uint16_t chosen_channel) { gsm0408_new_conn(conn); gsm0408_dispatch(conn, msg); 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; -} |