diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-03-13 13:59:39 +0100 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2023-03-15 09:44:22 +0000 |
commit | 1da0fcbbbc1b54e374d03f5a83b2eb613a3c5fc4 (patch) | |
tree | bf8dad4d705803064348d43878ba2097114bb644 | |
parent | 85062ccad31e9fb73e0256a5ee556c6ae0a16449 (diff) |
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
-rw-r--r-- | include/osmocom/bsc/osmo_bsc_sigtran.h | 1 | ||||
-rw-r--r-- | src/osmo-bsc/gsm_08_08.c | 13 | ||||
-rw-r--r-- | src/osmo-bsc/osmo_bsc_sigtran.c | 13 |
3 files changed, 13 insertions, 14 deletions
diff --git a/include/osmocom/bsc/osmo_bsc_sigtran.h b/include/osmocom/bsc/osmo_bsc_sigtran.h index 9cc2cfc71..2ee35e53c 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 dff6093ef..769cec4ce 100644 --- a/src/osmo-bsc/gsm_08_08.c +++ b/src/osmo-bsc/gsm_08_08.c @@ -351,6 +351,19 @@ static void parse_powercap(struct gsm_subscriber_connection *conn, struct msgb * 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 830b72e87..1642059e7 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -45,19 +45,6 @@ static struct llist_head *msc_list; #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) { |