aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/iu_cs.h5
-rw-r--r--openbsc/src/libbsc/bsc_api.c2
-rw-r--r--openbsc/src/libmsc/Makefile.am3
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c4
-rw-r--r--openbsc/src/libmsc/msc_api.h4
-rw-r--r--openbsc/src/osmo-cscn/iu_cs.c9
-rw-r--r--openbsc/src/osmo-cscn/iu_cs.h5
7 files changed, 23 insertions, 9 deletions
diff --git a/openbsc/include/openbsc/iu_cs.h b/openbsc/include/openbsc/iu_cs.h
index 2169c1ab1..9c2be4176 100644
--- a/openbsc/include/openbsc/iu_cs.h
+++ b/openbsc/include/openbsc/iu_cs.h
@@ -4,4 +4,7 @@ int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint8_t l
struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network,
uint8_t link_id,
- uint32_t conn_id)
+ uint32_t conn_id);
+
+int iucs_submit_dtap(struct gsm_subscriber_connection *conn,
+ struct msgb *msg);
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index f7e3c6428..cd6b87e15 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -253,9 +253,9 @@ struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
/* Configure the time and start it so it will be closed */
/* FIXME: above comment is weird in at least two ways */
+ conn->network = network;
conn->via_iface = IFACE_A;
conn->lchan = lchan;
- conn->network = network;
lchan->conn = conn;
llist_add_tail(&conn->entry, &network->subscr_conns);
return conn;
diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am
index ffa0c8623..c0a09a356 100644
--- a/openbsc/src/libmsc/Makefile.am
+++ b/openbsc/src/libmsc/Makefile.am
@@ -20,7 +20,8 @@ libmsc_a_SOURCES = auth.c \
ussd.c \
vty_interface_layer3.c \
transaction.c \
- osmo_msc.c ctrl_commands.c meas_feed.c
+ osmo_msc.c ctrl_commands.c meas_feed.c \
+ msc_api.c
if BUILD_SMPP
noinst_HEADERS += smpp_smsc.h
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 17c53e044..8c4ae063c 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -65,6 +65,8 @@
#include <assert.h>
+#include "msc_api.h"
+
/* These debug statements were removed during the BSC/MSC split. It may make
* sense to replace them with debug statements that do not access BTS data. */
#define BEFORE_MSCSPLIT 0
@@ -102,7 +104,7 @@ static int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection
gh->proto_discr = trans->protocol | (trans->transaction_id << 4);
}
- return gsm0808_submit_dtap(conn, msg, 0, 0);
+ return msc_submit_dtap(conn, msg);
}
int gsm48_cc_tx_notify_ss(struct gsm_trans *trans, const char *message)
diff --git a/openbsc/src/libmsc/msc_api.h b/openbsc/src/libmsc/msc_api.h
index d736b4d98..2da2e9fce 100644
--- a/openbsc/src/libmsc/msc_api.h
+++ b/openbsc/src/libmsc/msc_api.h
@@ -6,3 +6,7 @@
/* 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);
+
+/* Depending on conn->via_iface (A or IuCS), submit msg to the proper link api. */
+extern int msc_submit_dtap(struct gsm_subscriber_connection *conn,
+ struct msgb *msg);
diff --git a/openbsc/src/osmo-cscn/iu_cs.c b/openbsc/src/osmo-cscn/iu_cs.c
index e6c2818e7..e321c15a1 100644
--- a/openbsc/src/osmo-cscn/iu_cs.c
+++ b/openbsc/src/osmo-cscn/iu_cs.c
@@ -108,3 +108,12 @@ int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg)
return rc;
}
+
+int iucs_submit_dtap(struct gsm_subscriber_connection *conn,
+ struct msgb *msg)
+{
+ OSMO_ASSERT(conn->via_iface == IFACE_IUCS);
+ msg->dst = conn->iu.ue_ctx;
+ return iu_tx(msg, 0);
+}
+
diff --git a/openbsc/src/osmo-cscn/iu_cs.h b/openbsc/src/osmo-cscn/iu_cs.h
deleted file mode 100644
index 01d3d2f2a..000000000
--- a/openbsc/src/osmo-cscn/iu_cs.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-#include <openbsc/iu.h>
-
-int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint8_t link_id);