Change in osmo-bsc[master]: fix / clarify rsl dtap cache

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Jun 18 07:13:16 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9668


Change subject: fix / clarify rsl dtap cache
......................................................................

fix / clarify rsl dtap cache

In certain situations like handover or assignment, DTAP must not go out via RSL
directly but is cached to be submitted later. Make sure that all RSL DTAP
sending adheres to this:

gscon_submit_rsl_dtap() is the new "public" API to request an RSL DTAP to be
sent. Depending on the gscon's state, this ends up in the cache or is sent
directly. When caching, there is no way to tell whether sending will succeed or
not, so semantically it does not make sense to even return a result code. Just
return void. Change all "public" callers to gscon_submit_rsl_dtap().

Merge gsm0808_submit_dtap() and submit_dtap() guts to gsm0808_send_rsl_dtap(),
static in bsc_subscr_conn_fsm.c: directly send DTAP, assume a conn->lchan to be
present, or otherwise trigger a BSSMAP Clear Request.

The static submit_dtap() becomes a thin convenience wrapper.

Move ho_dtap_cache* functions to bsc_subscr_conn_fsm.c and rename to
gscon_dtap_cache_* -- they are not only for handover, also for assignment.

Function gsm0808_submit_dtap() m
Introduce function gscon_submit_rsl_dtap()

Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585
---
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/bsc_api.c
M src/osmo-bsc/bsc_init.c
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/gsm_04_08_utils.c
M src/osmo-bsc/gsm_04_80_utils.c
M src/osmo-bsc/osmo_bsc_api.c
M tests/bsc/bsc_test.c
9 files changed, 185 insertions(+), 160 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/68/9668/1

diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
index e8226f4..0d373eb 100644
--- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h
+++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
@@ -66,6 +66,11 @@
 
 struct gsm_subscriber_connection;
 struct gsm_network;
+struct msgb;
 
 /* Allocate a subscriber connection and its associated FSM */
 struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net);
+
+void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn,
+			   struct msgb *msg, int link_id, int allow_sacch);
+void gscon_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 76a1b30..6ee95f7 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -120,8 +120,8 @@
 	struct gsm_classmark classmark;
 
 	/* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/
-	struct llist_head ho_dtap_cache;
-	unsigned int ho_dtap_cache_len;
+	struct llist_head dtap_cache;
+	unsigned int dtap_cache_len;
 
 	struct {
 		int failures;
diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c
index 4cf11a4..2c799e3 100644
--- a/src/osmo-bsc/bsc_api.c
+++ b/src/osmo-bsc/bsc_api.c
@@ -33,6 +33,7 @@
 #include <osmocom/bsc/bsc_subscriber.h>
 #include <osmocom/bsc/penalty_timers.h>
 #include <osmocom/bsc/osmo_bsc_sigtran.h>
+#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
 
 #include <osmocom/gsm/protocol/gsm_08_08.h>
 #include <osmocom/gsm/gsm48.h>
@@ -41,10 +42,6 @@
 
 #define GSM0808_T10_VALUE    6, 0
 
-#define HO_DTAP_CACHE_MSGB_CB_LINK_ID 0
-#define HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH 1
-
-static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind);
 static void handle_release(struct gsm_subscriber_connection *conn, struct  gsm_lchan *lchan);
 static void handle_chan_ack(struct gsm_subscriber_connection *conn, struct  gsm_lchan *lchan);
 static void handle_chan_nack(struct gsm_subscriber_connection *conn, struct  gsm_lchan *lchan);
@@ -116,97 +113,6 @@
 	return 0;
 }
 
-static void ho_dtap_cache_add(struct gsm_subscriber_connection *conn, struct msgb *msg,
-			      int link_id, bool allow_sacch)
-{
-	if (conn->ho_dtap_cache_len >= 23) {
-		LOGP(DHO, LOGL_ERROR, "%s: Cannot cache more DTAP messages,"
-		     " already reached sane maximum of %u cached messages\n",
-		     bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len);
-		msgb_free(msg);
-		return;
-	}
-	conn->ho_dtap_cache_len ++;
-	LOGP(DHO, LOGL_DEBUG, "%s: Caching DTAP message during ho/ass (%u)\n",
-	     bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len);
-	msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID] = (unsigned long)link_id;
-	msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0;
-	msgb_enqueue(&conn->ho_dtap_cache, msg);
-}
-
-void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send)
-{
-	struct msgb *msg;
-	unsigned int flushed_count = 0;
-
-	if (conn->secondary_lchan || conn->ho) {
-		LOGP(DHO, LOGL_ERROR, "%s: Cannot send cached DTAP messages, handover/assignment is still ongoing\n",
-		     bsc_subscr_name(conn->bsub));
-		send = 0;
-	}
-
-	while ((msg = msgb_dequeue(&conn->ho_dtap_cache))) {
-		conn->ho_dtap_cache_len --;
-		flushed_count ++;
-		if (send) {
-			int link_id = (int)msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID];
-			bool allow_sacch = !!msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH];
-			LOGP(DHO, LOGL_DEBUG, "%s: Sending cached DTAP message after handover/assignment (%u/%u)\n",
-			     bsc_subscr_name(conn->bsub), flushed_count, conn->ho_dtap_cache_len);
-			gsm0808_submit_dtap(conn, msg, link_id, allow_sacch);
-		} else
-			msgb_free(msg);
-	}
-}
-
-/*! \brief process incoming 08.08 DTAP from MSC (send via BTS to MS) */
-int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn,
-			struct msgb *msg, int link_id, int allow_sacch)
-{
-	uint8_t sapi;
-
-
-	if (!conn->lchan) {
-		LOGP(DMSC, LOGL_ERROR,
-		     "%s Called submit dtap without an lchan.\n",
-		     bsc_subscr_name(conn->bsub));
-		msgb_free(msg);
-		return -1;
-	}
-
-	/* buffer message during assignment / handover */
-	if (conn->secondary_lchan || conn->ho) {
-		ho_dtap_cache_add(conn, msg, link_id, !! allow_sacch);
-		return 0;
-	}
-
-	sapi = link_id & 0x7;
-	msg->lchan = conn->lchan;
-	msg->dst = msg->lchan->ts->trx->rsl_link;
-
-	/* If we are on a TCH and need to submit a SMS (on SAPI=3) we need to use the SACH */
-	if (allow_sacch && sapi != 0) {
-		if (conn->lchan->type == GSM_LCHAN_TCH_F || conn->lchan->type == GSM_LCHAN_TCH_H)
-			link_id |= 0x40;
-	}
-
-	msg->l3h = msg->data;
-	/* is requested SAPI already up? */
-	if (conn->lchan->sapis[sapi] == LCHAN_SAPI_UNUSED) {
-		/* Establish L2 for additional SAPI */
-		OBSC_LINKID_CB(msg) = link_id;
-		if (rll_establish(msg->lchan, sapi, rll_ind_cb, msg) != 0) {
-			msgb_free(msg);
-			bsc_sapi_n_reject(conn, link_id);
-			return -1;
-		}
-		return 0;
-	} else {
-		/* Directly forward via RLL/RSL to BTS */
-		return rsl_data_request(msg, link_id);
-	}
-}
-
 /*
  * \brief Check if the given channel is compatible with the mode/fullrate
  */
@@ -316,7 +222,7 @@
 		/* FIXME: release old channel */
 
 		/* send pending messages, if any */
-		ho_dtap_cache_flush(conn, 1);
+		gscon_dtap_cache_flush(conn, 1);
 
 		return;
 	}
@@ -332,7 +238,7 @@
 	conn->secondary_lchan = NULL;
 
 	/* send pending messages, if any */
-	ho_dtap_cache_flush(conn, 1);
+	gscon_dtap_cache_flush(conn, 1);
 
 	if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != GSM48_CMODE_SIGN)
 		rsl_ipacc_crcx(conn->lchan);
@@ -359,7 +265,7 @@
 		/* FIXME: release allocated new channel */
 
 		/* send pending messages, if any */
-		ho_dtap_cache_flush(conn, 1);
+		gscon_dtap_cache_flush(conn, 1);
 
 		return;
 	}
@@ -377,7 +283,7 @@
 	}
 
 	/* send pending messages, if any */
-	ho_dtap_cache_flush(conn, 1);
+	gscon_dtap_cache_flush(conn, 1);
 
 	gh = msgb_l3(msg);
 	if (msgb_l3len(msg) - sizeof(*gh) != 1) {
@@ -443,7 +349,7 @@
 	/* FIXME: release old channel */
 
 	/* send pending messages, if any */
-	ho_dtap_cache_flush(msg->lchan->conn, 1);
+	gscon_dtap_cache_flush(msg->lchan->conn, 1);
 }
 
 /* Chapter 9.1.17 Handover Failure */
@@ -465,7 +371,7 @@
 	/* FIXME: release allocated new channel */
 
 	/* send pending messages, if any */
-	ho_dtap_cache_flush(msg->lchan->conn, 1);
+	gscon_dtap_cache_flush(msg->lchan->conn, 1);
 }
 
 
@@ -643,31 +549,6 @@
 	return 0;
 }
 
-static void rll_ind_cb(struct gsm_lchan *lchan, uint8_t link_id, void *_data, enum bsc_rllr_ind rllr_ind)
-{
-	struct msgb *msg = _data;
-
-	/*
-	 * There seems to be a small window that the RLL timer can
-	 * fire after a lchan_release call and before the S_CHALLOC_FREED
-	 * is called. Check if a conn is set before proceeding.
-	 */
-	if (!lchan->conn)
-		return;
-
-	switch (rllr_ind) {
-	case BSC_RLLR_IND_EST_CONF:
-		rsl_data_request(msg, OBSC_LINKID_CB(msg));
-		break;
-	case BSC_RLLR_IND_REL_IND:
-	case BSC_RLLR_IND_ERR_IND:
-	case BSC_RLLR_IND_TIMEOUT:
-		bsc_sapi_n_reject(lchan->conn, OBSC_LINKID_CB(msg));
-		msgb_free(msg);
-		break;
-	}
-}
-
 static int bsc_handle_lchan_signal(unsigned int subsys, unsigned int signal,
 				   void *handler_data, void *signal_data)
 {
diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c
index 1fe4847..641b6db 100644
--- a/src/osmo-bsc/bsc_init.c
+++ b/src/osmo-bsc/bsc_init.c
@@ -35,6 +35,7 @@
 #include <osmocom/bsc/bsc_msc_data.h>
 #include <osmocom/bsc/handover_cfg.h>
 #include <osmocom/bsc/gsm_04_08_utils.h>
+#include <osmocom/bsc/neighbor_ident.h>
 
 #include <time.h>
 #include <limits.h>
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 4f09ae6..e8fb6ed 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -34,6 +34,8 @@
 #include <osmocom/bsc/bsc_subscr_conn_fsm.h>
 #include <osmocom/bsc/osmo_bsc.h>
 #include <osmocom/bsc/penalty_timers.h>
+#include <osmocom/bsc/bsc_rll.h>
+#include <osmocom/bsc/abis_rsl.h>
 #include <osmocom/mgcp_client/mgcp_client_fsm.h>
 #include <osmocom/core/byteswap.h>
 
@@ -120,6 +122,16 @@
 	{0, NULL}
 };
 
+/* forward MT DTAP from BSSAP side to RSL side */
+static inline void submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg,
+			       struct osmo_fsm_inst *fi)
+{
+	OSMO_ASSERT(fi);
+	OSMO_ASSERT(msg);
+	OSMO_ASSERT(conn);
+	gscon_submit_rsl_dtap(conn, msg, OBSC_LINKID_CB(msg), 1);
+}
+
 /* Send data SCCP message through SCCP connection. All sigtran messages
  * that are send from this FSM must use this function. Never use
  * osmo_bsc_sigtran_send() directly since this would defeat the checks
@@ -231,26 +243,6 @@
 	sigtran_send(conn, resp, fi);
 }
 
-/* forward MT DTAP from BSSAP side to RSL side */
-static void submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, struct osmo_fsm_inst *fi)
-{
-	int rc;
-	struct msgb *resp = NULL;
-
-	OSMO_ASSERT(fi);
-	OSMO_ASSERT(msg);
-	OSMO_ASSERT(conn);
-
-	rc = gsm0808_submit_dtap(conn, msg, OBSC_LINKID_CB(msg), 1);
-	if (rc != 0) {
-		LOGPFSML(fi, LOGL_ERROR, "Tx BSSMAP CLEAR REQUEST to MSC\n");
-		resp = gsm0808_create_clear_rqst(GSM0808_CAUSE_EQUIPMENT_FAILURE);
-		sigtran_send(conn, resp, fi);
-		osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0);
-		return;
-	}
-}
-
 /* forward MO DTAP from RSL side to BSSAP side */
 static void forward_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, struct osmo_fsm_inst *fi)
 {
@@ -972,8 +964,6 @@
 	}
 }
 
-void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send);
-
 static void gscon_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
 {
 	struct gsm_subscriber_connection *conn = fi->priv;
@@ -1004,7 +994,7 @@
 	}
 
 	/* drop pending messages */
-	ho_dtap_cache_flush(conn, 0);
+	gscon_dtap_cache_flush(conn, 0);
 
 	penalty_timers_free(&conn->hodec2.penalty_timers);
 
@@ -1097,7 +1087,7 @@
 		return NULL;
 
 	conn->network = net;
-	INIT_LLIST_HEAD(&conn->ho_dtap_cache);
+	INIT_LLIST_HEAD(&conn->dtap_cache);
 	/* BTW, penalty timers will be initialized on-demand. */
 	conn->sccp.conn_id = -1;
 
@@ -1122,3 +1112,143 @@
 	llist_add_tail(&conn->entry, &net->subscr_conns);
 	return conn;
 }
+
+static void gsm0808_send_rsl_dtap(struct gsm_subscriber_connection *conn,
+				  struct msgb *msg, int link_id, int allow_sacch);
+
+#define GSCON_DTAP_CACHE_MSGB_CB_LINK_ID 0
+#define GSCON_DTAP_CACHE_MSGB_CB_ALLOW_SACCH 1
+
+static void gscon_dtap_cache_add(struct gsm_subscriber_connection *conn, struct msgb *msg,
+				 int link_id, bool allow_sacch)
+{
+	if (conn->dtap_cache_len >= 23) {
+		LOGP(DHO, LOGL_ERROR, "%s: Cannot cache more DTAP messages,"
+		     " already reached sane maximum of %u cached messages\n",
+		     bsc_subscr_name(conn->bsub), conn->dtap_cache_len);
+		msgb_free(msg);
+		return;
+	}
+	conn->dtap_cache_len ++;
+	LOGP(DHO, LOGL_DEBUG, "%s: Caching DTAP message during ho/ass (%u)\n",
+	     bsc_subscr_name(conn->bsub), conn->dtap_cache_len);
+	msg->cb[GSCON_DTAP_CACHE_MSGB_CB_LINK_ID] = (unsigned long)link_id;
+	msg->cb[GSCON_DTAP_CACHE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0;
+	msgb_enqueue(&conn->dtap_cache, msg);
+}
+
+void gscon_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send)
+{
+	struct msgb *msg;
+	unsigned int flushed_count = 0;
+
+	if (conn->secondary_lchan || conn->ho) {
+		LOGP(DHO, LOGL_ERROR, "%s: Cannot send cached DTAP messages, handover/assignment is still ongoing\n",
+		     bsc_subscr_name(conn->bsub));
+		send = 0;
+	}
+
+	while ((msg = msgb_dequeue(&conn->dtap_cache))) {
+		conn->dtap_cache_len --;
+		flushed_count ++;
+		if (send) {
+			int link_id = (int)msg->cb[GSCON_DTAP_CACHE_MSGB_CB_LINK_ID];
+			bool allow_sacch = !!msg->cb[GSCON_DTAP_CACHE_MSGB_CB_ALLOW_SACCH];
+			LOGP(DHO, LOGL_DEBUG, "%s: Sending cached DTAP message after handover/assignment (%u/%u)\n",
+			     bsc_subscr_name(conn->bsub), flushed_count, conn->dtap_cache_len);
+			gsm0808_send_rsl_dtap(conn, msg, link_id, allow_sacch);
+		} else
+			msgb_free(msg);
+	}
+}
+
+static void rll_ind_cb(struct gsm_lchan *lchan, uint8_t link_id, void *_data, enum bsc_rllr_ind rllr_ind)
+{
+	struct msgb *msg = _data;
+
+	/*
+	 * There seems to be a small window that the RLL timer can
+	 * fire after a lchan_release call and before the S_CHALLOC_FREED
+	 * is called. Check if a conn is set before proceeding.
+	 */
+	if (!lchan->conn)
+		return;
+
+	switch (rllr_ind) {
+	case BSC_RLLR_IND_EST_CONF:
+		rsl_data_request(msg, OBSC_LINKID_CB(msg));
+		break;
+	case BSC_RLLR_IND_REL_IND:
+	case BSC_RLLR_IND_ERR_IND:
+	case BSC_RLLR_IND_TIMEOUT:
+		bsc_sapi_n_reject(lchan->conn, OBSC_LINKID_CB(msg));
+		msgb_free(msg);
+		break;
+	}
+}
+
+/*! \brief process incoming 08.08 DTAP from MSC (send via BTS to MS) */
+static void gsm0808_send_rsl_dtap(struct gsm_subscriber_connection *conn,
+				  struct msgb *msg, int link_id, int allow_sacch)
+{
+	uint8_t sapi;
+	int rc;
+	struct msgb *resp = NULL;
+
+	if (!conn->lchan) {
+		LOGP(DMSC, LOGL_ERROR,
+		     "%s Called submit dtap without an lchan.\n",
+		     bsc_subscr_name(conn->bsub));
+		msgb_free(msg);
+		rc = -EINVAL;
+		goto failed_to_send;
+	}
+
+	sapi = link_id & 0x7;
+	msg->lchan = conn->lchan;
+	msg->dst = msg->lchan->ts->trx->rsl_link;
+
+	/* If we are on a TCH and need to submit a SMS (on SAPI=3) we need to use the SACH */
+	if (allow_sacch && sapi != 0) {
+		if (conn->lchan->type == GSM_LCHAN_TCH_F || conn->lchan->type == GSM_LCHAN_TCH_H)
+			link_id |= 0x40;
+	}
+
+	msg->l3h = msg->data;
+	/* is requested SAPI already up? */
+	if (conn->lchan->sapis[sapi] == LCHAN_SAPI_UNUSED) {
+		/* Establish L2 for additional SAPI */
+		OBSC_LINKID_CB(msg) = link_id;
+		rc = rll_establish(msg->lchan, sapi, rll_ind_cb, msg);
+		if (rc) {
+			msgb_free(msg);
+			bsc_sapi_n_reject(conn, link_id);
+			goto failed_to_send;
+		}
+		return;
+	} else {
+		/* Directly forward via RLL/RSL to BTS */
+		rc = rsl_data_request(msg, link_id);
+		if (rc)
+			goto failed_to_send;
+	}
+	return;
+
+failed_to_send:
+	LOGPFSML(conn->fi, LOGL_ERROR, "Tx BSSMAP CLEAR REQUEST to MSC\n");
+	resp = gsm0808_create_clear_rqst(GSM0808_CAUSE_EQUIPMENT_FAILURE);
+	sigtran_send(conn, resp, conn->fi);
+	osmo_fsm_inst_state_chg(conn->fi, ST_ACTIVE, 0, 0);
+}
+
+void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn,
+			   struct msgb *msg, int link_id, int allow_sacch)
+{
+	/* buffer message during assignment / handover */
+	if (conn->secondary_lchan || conn->ho) {
+		gscon_dtap_cache_add(conn, msg, link_id, !! allow_sacch);
+		return;
+	}
+
+	gsm0808_send_rsl_dtap(conn, msg, link_id, allow_sacch);
+}
diff --git a/src/osmo-bsc/gsm_04_08_utils.c b/src/osmo-bsc/gsm_04_08_utils.c
index e9aeb55..c548500 100644
--- a/src/osmo-bsc/gsm_04_08_utils.c
+++ b/src/osmo-bsc/gsm_04_08_utils.c
@@ -34,7 +34,7 @@
 #include <osmocom/bsc/debug.h>
 #include <osmocom/bsc/paging.h>
 #include <osmocom/bsc/signal.h>
-#include <osmocom/bsc/bsc_api.h>
+#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
 #include <osmocom/bsc/gsm_04_08_utils.h>
 
 /* should ip.access BTS use direct RTP streams between each other (1),
@@ -600,7 +600,8 @@
 
 	DEBUGP(DMM, "-> CM SERVICE ACK\n");
 
-	return gsm0808_submit_dtap(conn, msg, 0, 0);
+	gscon_submit_rsl_dtap(conn, msg, 0, 0);
+	return 0;
 }
 
 /* 9.2.6 CM service reject */
@@ -617,7 +618,8 @@
 
 	DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value);
 
-	return gsm0808_submit_dtap(conn, msg, 0, 0);
+	gscon_submit_rsl_dtap(conn, msg, 0, 0);
+	return 0;
 }
 
 /* 9.1.29 RR Status */
@@ -644,7 +646,8 @@
 	struct msgb *msg = gsm48_create_rr_status(cause);
 	if (!msg)
 		return -1;
-	return gsm0808_submit_dtap(conn, msg, 0, 0);
+	gscon_submit_rsl_dtap(conn, msg, 0, 0);
+	return 0;
 }
 
 struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
diff --git a/src/osmo-bsc/gsm_04_80_utils.c b/src/osmo-bsc/gsm_04_80_utils.c
index d67f3c5..8de1262 100644
--- a/src/osmo-bsc/gsm_04_80_utils.c
+++ b/src/osmo-bsc/gsm_04_80_utils.c
@@ -20,7 +20,7 @@
  */
 
 #include <osmocom/gsm/gsm0480.h>
-#include <osmocom/bsc/bsc_api.h>
+#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
 
 int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
 			 const char *text)
@@ -28,7 +28,8 @@
 	struct msgb *msg = gsm0480_create_ussd_notify(level, text);
 	if (!msg)
 		return -1;
-	return gsm0808_submit_dtap(conn, msg, 0, 0);
+	gscon_submit_rsl_dtap(conn, msg, 0, 0);
+	return 0;
 }
 
 int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn)
@@ -36,5 +37,6 @@
 	struct msgb *msg = gsm0480_create_ussd_release_complete();
 	if (!msg)
 		return -1;
-	return gsm0808_submit_dtap(conn, msg, 0, 0);
+	gscon_submit_rsl_dtap(conn, msg, 0, 0);
+	return 0;
 }
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index a86b4f9..d409c93 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -86,7 +86,7 @@
 	}
 
 	msg->lchan = conn->lchan;
-	gsm0808_submit_dtap(conn, msg, 0, 0);
+	gscon_submit_rsl_dtap(conn, msg, 0, 0);
 }
 
 static int bsc_filter_initial(struct osmo_bsc_data *bsc,
diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 950eaf5..b05ca54 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -249,3 +249,6 @@
 		   const uint8_t *cm2, uint8_t cm2_len,
 		   const uint8_t *cm3, uint8_t cm3_len) {}
 void bsc_mr_config(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan, int full_rate) {}
+void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn,
+			   struct msgb *msg, int link_id, int allow_sacch) {}
+void gscon_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send) {}

-- 
To view, visit https://gerrit.osmocom.org/9668
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585
Gerrit-Change-Number: 9668
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180618/24b45a10/attachment.htm>


More information about the gerrit-log mailing list