aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/bsc/gsm_data.h2
-rw-r--r--src/osmo-bsc/gsm_08_08.c16
-rw-r--r--src/osmo-bsc/gsm_data.c16
3 files changed, 18 insertions, 16 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 7897fea86..1be9ae8fb 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1614,4 +1614,6 @@ void gsm_trx_all_ts_dispatch(struct gsm_bts_trx *trx, uint32_t ts_ev, void *data
int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan);
+struct osmo_cell_global_id *cgi_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts);
+
#endif /* _GSM_DATA_H */
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index 19c259844..062c878d3 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -58,22 +58,6 @@ static bool msc_connected(struct gsm_subscriber_connection *conn)
static bool complete_layer3(struct gsm_subscriber_connection *conn,
struct msgb *msg, struct bsc_msc_data *msc);
-static struct osmo_cell_global_id *cgi_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts)
-{
- static struct osmo_cell_global_id cgi;
- cgi.lai.plmn = msc->network->plmn;
- if (msc->core_plmn.mcc != GSM_MCC_MNC_INVALID)
- cgi.lai.plmn.mcc = msc->core_plmn.mcc;
- if (msc->core_plmn.mnc != GSM_MCC_MNC_INVALID) {
- cgi.lai.plmn.mnc = msc->core_plmn.mnc;
- cgi.lai.plmn.mnc_3_digits = msc->core_plmn.mnc_3_digits;
- }
- cgi.lai.lac = (msc->core_lac != -1) ? msc->core_lac : bts->location_area_code;
- cgi.cell_identity = (msc->core_ci != -1) ? msc->core_ci : bts->cell_identity;
-
- return &cgi;
-}
-
static void bsc_maybe_lu_reject(struct gsm_subscriber_connection *conn, int con_type, int cause)
{
struct msgb *msg;
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 56eb24e0c..15853fbae 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1688,3 +1688,19 @@ const struct value_string lchan_activate_mode_names[] = {
OSMO_VALUE_STRING(FOR_VTY),
{}
};
+
+struct osmo_cell_global_id *cgi_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts)
+{
+ static struct osmo_cell_global_id cgi;
+ cgi.lai.plmn = msc->network->plmn;
+ if (msc->core_plmn.mcc != GSM_MCC_MNC_INVALID)
+ cgi.lai.plmn.mcc = msc->core_plmn.mcc;
+ if (msc->core_plmn.mnc != GSM_MCC_MNC_INVALID) {
+ cgi.lai.plmn.mnc = msc->core_plmn.mnc;
+ cgi.lai.plmn.mnc_3_digits = msc->core_plmn.mnc_3_digits;
+ }
+ cgi.lai.lac = (msc->core_lac != -1) ? msc->core_lac : bts->location_area_code;
+ cgi.cell_identity = (msc->core_ci != -1) ? msc->core_ci : bts->cell_identity;
+
+ return &cgi;
+}