From 519c7e1d428bfba728a76885c9c5394185a6497d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 28 Jan 2018 02:45:46 +0100 Subject: Structural reform: Get rid of osmo_bsc_sccp_con There was always a 1:1 correspondence between gsm_subscriber_connection and osmo_bsc_sccp_con, so there's really no point in having two separate dynamically allocated data structures with pointers back and forth and another linked list around. Let's merge osmo_bsc_sccp_con into gsm_subscriber_connection for simplicity. The resulting code might not be elegant in places, but I've tried to do only the most simple changes in this patch, while further simplifications can be done in later subsequent patches. As a side-effect, this patch also fixes lchan clearing if the MSC (or the local SCCP provider) hard-disconnects the SCCP connection. Change-Id: Idd2b733477ee90d24dec369755a00f1c39c93f39 --- src/osmo-bsc/osmo_bsc_filter.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/osmo-bsc/osmo_bsc_filter.c') diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c index 5399b7aee..c1f3e80a6 100644 --- a/src/osmo-bsc/osmo_bsc_filter.c +++ b/src/osmo-bsc/osmo_bsc_filter.c @@ -54,7 +54,7 @@ static void handle_lu_request(struct gsm_subscriber_connection *conn, if (memcmp(&lai, &lu->lai, sizeof(lai)) != 0) { LOGP(DMSC, LOGL_DEBUG, "Marking con for welcome USSD.\n"); - conn->sccp_con->new_subscriber = 1; + conn->new_subscriber = 1; } } @@ -234,15 +234,7 @@ int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg) static int send_welcome_ussd(struct gsm_subscriber_connection *conn) { - struct osmo_bsc_sccp_con *bsc_con; - - bsc_con = conn->sccp_con; - if (!bsc_con) { - LOGP(DMSC, LOGL_DEBUG, "No SCCP connection associated.\n"); - return 0; - } - - if (!bsc_con->msc->ussd_welcome_txt) { + if (!conn->sccp.msc->ussd_welcome_txt) { LOGP(DMSC, LOGL_DEBUG, "No USSD Welcome text defined.\n"); return 0; } @@ -252,7 +244,7 @@ static int send_welcome_ussd(struct gsm_subscriber_connection *conn) int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn) { - bsc_send_ussd_notify(conn, 1, conn->sccp_con->msc->ussd_welcome_txt); + bsc_send_ussd_notify(conn, 1, conn->sccp.msc->ussd_welcome_txt); bsc_send_ussd_release_complete(conn); return 0; @@ -362,7 +354,7 @@ int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg) mtype = gsm48_hdr_msg_type(gh); net = bts->network; - msc = conn->sccp_con->msc; + msc = conn->sccp.msc; if (mtype == GSM48_MT_MM_LOC_UPD_ACCEPT) { if (has_core_identity(msc)) { @@ -375,7 +367,7 @@ int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg) } } - if (conn->sccp_con->new_subscriber) + if (conn->new_subscriber) return send_welcome_ussd(conn); return 0; } else if (mtype == GSM48_MT_MM_INFO) { -- cgit v1.2.3