aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-03-12 18:55:57 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2019-03-12 18:57:54 +0100
commit8b0f28e629fd91a07d1c093bb04eb14145dd4f6b (patch)
tree6cc14483efe699345b19cc99110598708a60a957
parent06b8b01c551a23e5b8ae1c0906ebacd722676665 (diff)
Move msc related code from gsm_data to bsc_msc
This way ipaccess utils can be built without requiring libosmo-sigtran. Change-Id: I508188896be58ddc3bd4e9c3c661c258c06866f4
-rw-r--r--include/osmocom/bsc/bsc_msc_data.h3
-rw-r--r--include/osmocom/bsc/gsm_data.h2
-rw-r--r--src/osmo-bsc/gsm_data.c17
-rw-r--r--src/osmo-bsc/osmo_bsc_msc.c15
-rw-r--r--tests/handover/Makefile.am1
5 files changed, 19 insertions, 19 deletions
diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index 9f2d7d8a3..520217404 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -161,6 +161,9 @@ int osmo_bsc_audio_init(struct gsm_network *network);
struct bsc_msc_data *osmo_msc_data_find(struct gsm_network *, int);
struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *, int);
+
+struct osmo_cell_global_id *cgi_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts);
+
/* Helper function to calculate the port number for a given
* timeslot/multiplex. This functionality is needed to support
* the sccp-lite scenario where the MGW is handled externally */
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index c4315c07f..47ca5e839 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1687,6 +1687,4 @@ 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_data.c b/src/osmo-bsc/gsm_data.c
index 0198fcfe1..a12821699 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -38,7 +38,6 @@
#include <osmocom/bsc/gsm_data.h>
#include <osmocom/bsc/osmo_bsc_lcls.h>
-#include <osmocom/bsc/bsc_msc_data.h>
#include <osmocom/bsc/abis_nm.h>
#include <osmocom/bsc/handover_cfg.h>
#include <osmocom/bsc/gsm_timers.h>
@@ -1694,19 +1693,3 @@ 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;
-}
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 71931e615..4df1ce4f8 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -119,3 +119,18 @@ struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr)
return msc_data;
}
+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;
+}
diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am
index 5e9af0452..5e4440c7b 100644
--- a/tests/handover/Makefile.am
+++ b/tests/handover/Makefile.am
@@ -69,6 +69,7 @@ handover_test_LDADD = \
$(top_builddir)/src/osmo-bsc/neighbor_ident.o \
$(top_builddir)/src/osmo-bsc/net_init.o \
$(top_builddir)/src/osmo-bsc/osmo_bsc_lcls.o \
+ $(top_builddir)/src/osmo-bsc/osmo_bsc_msc.o \
$(top_builddir)/src/osmo-bsc/paging.o \
$(top_builddir)/src/osmo-bsc/pcu_sock.o \
$(top_builddir)/src/osmo-bsc/penalty_timers.o \