Change in osmo-bsc[master]: gsm_data: make cgi_for_msc available for other modules

dexter gerrit-no-reply at lists.osmocom.org
Fri Nov 9 11:01:19 UTC 2018


dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/11527 )

Change subject: gsm_data: make cgi_for_msc available for other modules
......................................................................

gsm_data: make cgi_for_msc available for other modules

The function cgi_for_msc() provides an easy way to get a cell global id
for an msc/bts combination. This function is currently statically
defined in gsm_08_08.c. Lets move it to gsm_data.c and make it publicly
available.

Change-Id: I301fac6e83a429ae59b5c586aa283ad7ba54053d
Related: OS#3645
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/gsm_08_08.c
M src/osmo-bsc/gsm_data.c
3 files changed, 18 insertions(+), 16 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 7897fea..1be9ae8 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1614,4 +1614,6 @@
 
 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 19c2598..062c878 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -58,22 +58,6 @@
 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 56eb24e..15853fb 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1688,3 +1688,19 @@
 	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;
+}

-- 
To view, visit https://gerrit.osmocom.org/11527
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I301fac6e83a429ae59b5c586aa283ad7ba54053d
Gerrit-Change-Number: 11527
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181109/91031337/attachment.html>


More information about the gerrit-log mailing list