pespin submitted this change.

View Change


Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
Move bsc_conn_by_bsub() and make it static

The function was currently in osmo_bsc_sigtran.c but was never used
there, and it really doesn't have any relation to that file.
Let's move it to the only place where it's used so far, and mark it as
static.

Change-Id: I8a8cef45aa378421e0ac328d3b29b9d194698a55
---
M include/osmocom/bsc/osmo_bsc_sigtran.h
M src/osmo-bsc/gsm_08_08.c
M src/osmo-bsc/osmo_bsc_sigtran.c
3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/include/osmocom/bsc/osmo_bsc_sigtran.h b/include/osmocom/bsc/osmo_bsc_sigtran.h
index 9cc2cfc..2ee35e5 100644
--- a/include/osmocom/bsc/osmo_bsc_sigtran.h
+++ b/include/osmocom/bsc/osmo_bsc_sigtran.h
@@ -26,7 +26,6 @@
/* Allocate resources to make a new connection oriented sigtran connection
* (not the connection ittself!) */
enum bsc_con osmo_bsc_sigtran_new_conn(struct gsm_subscriber_connection *conn, struct bsc_msc_data *msc);
-struct gsm_subscriber_connection *bsc_conn_by_bsub(const struct bsc_subscr *bsub);

/* Open a new connection oriented sigtran connection */
int osmo_bsc_sigtran_open_conn(struct gsm_subscriber_connection *conn, struct msgb *msg);
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index dff6093..769cec4 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -351,6 +351,19 @@
conn_update_ms_power_class(conn, rc8);
}

+static struct gsm_subscriber_connection *bsc_conn_by_bsub(const struct bsc_subscr *bsub)
+{
+ struct gsm_subscriber_connection *conn;
+ if (!bsub)
+ return NULL;
+
+ llist_for_each_entry(conn, &bsc_gsmnet->subscr_conns, entry) {
+ if (conn->bsub == bsub)
+ return conn;
+ }
+ return NULL;
+}
+
/*! MS->MSC: New MM context with L3 payload. */
int bsc_compl_l3(struct gsm_lchan *lchan, struct msgb *msg, uint16_t chosen_channel)
{
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 830b72e..1642059 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -45,19 +45,6 @@
#define DEFAULT_ASP_LOCAL_IP "localhost"
#define DEFAULT_ASP_REMOTE_IP "localhost"

-struct gsm_subscriber_connection *bsc_conn_by_bsub(const struct bsc_subscr *bsub)
-{
- struct gsm_subscriber_connection *conn;
- if (!bsub)
- return NULL;
-
- llist_for_each_entry(conn, &bsc_gsmnet->subscr_conns, entry) {
- if (conn->bsub == bsub)
- return conn;
- }
- return NULL;
-}
-
/* Patch regular BSSMAP RESET to add extra T to announce Osmux support (osmocom extension) */
static void _gsm0808_extend_announce_osmux(struct msgb *msg)
{

To view, visit change 31867. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8a8cef45aa378421e0ac328d3b29b9d194698a55
Gerrit-Change-Number: 31867
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged