bts: Rename bts_ms_by_{tlli,imsi} -> bts_get_ms_by_{tlli,imsi}

While at it, put them together and mark bts param as const.
This is a preparation for next patch.

Change-Id: Iad8aec4424f1f23cd4d02a14c4f9ec1b9fdb1f75
diff --git a/src/bts.cpp b/src/bts.cpp
index 30450bc..e3a5eeb 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -724,7 +724,7 @@
 	}
 
 	/* Find related TBF and send confirmation signal to FSM */
-	ms = bts_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI);
+	ms = bts_get_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI);
 	if (!ms) {
 		LOGP(DTBFDL, LOGL_ERROR, "FN=%u Got IMM.ASS confirm for unknown MS with TLLI=%08x\n", fn, tlli);
 		return -EINVAL;
@@ -1212,11 +1212,16 @@
 	return bts->ms_store;
 }
 
-struct GprsMs *bts_ms_by_tlli(struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t old_tlli)
+struct GprsMs *bts_get_ms_by_tlli(const struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t old_tlli)
 {
 	return bts_ms_store(bts)->get_ms(tlli, old_tlli);
 }
 
+struct GprsMs *bts_get_ms_by_imsi(const struct gprs_rlcmac_bts *bts, const char *imsi)
+{
+	return bts_ms_store(bts)->get_ms(GSM_RESERVED_TMSI, GSM_RESERVED_TMSI, imsi);
+}
+
 /* update TA based on TA provided by PH-DATA-IND */
 void update_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, int8_t ta_delta)
 {
@@ -1422,11 +1427,6 @@
 	bts_set_max_mcs_ul(bts, mcs_ul);
 }
 
-struct GprsMs *bts_ms_by_imsi(struct gprs_rlcmac_bts *bts, const char *imsi)
-{
-	return bts_ms_store(bts)->get_ms(GSM_RESERVED_TMSI, GSM_RESERVED_TMSI, imsi);
-}
-
 const struct llist_head* bts_ms_list(struct gprs_rlcmac_bts *bts)
 {
 	return bts_ms_store(bts)->ms_list();
diff --git a/src/bts.h b/src/bts.h
index a1ea796..7f6be73 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -331,7 +331,8 @@
 
 struct GprsMsStorage *bts_ms_store(const struct gprs_rlcmac_bts *bts);
 
-struct GprsMs *bts_ms_by_tlli(struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t old_tlli);
+struct GprsMs *bts_get_ms_by_tlli(const struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t old_tlli);
+struct GprsMs *bts_get_ms_by_imsi(const struct gprs_rlcmac_bts *bts, const char *imsi);
 
 static inline struct rate_ctr_group *bts_rate_counters(struct gprs_rlcmac_bts *bts)
 {
@@ -369,7 +370,6 @@
 void bts_recalc_initial_mcs(struct gprs_rlcmac_bts *bts);
 void bts_recalc_max_cs(struct gprs_rlcmac_bts *bts);
 void bts_recalc_max_mcs(struct gprs_rlcmac_bts *bts);
-struct GprsMs *bts_ms_by_imsi(struct gprs_rlcmac_bts *bts, const char *imsi);
 uint8_t bts_max_cs_dl(const struct gprs_rlcmac_bts *bts);
 uint8_t bts_max_cs_ul(const struct gprs_rlcmac_bts *bts);
 uint8_t bts_max_mcs_dl(const struct gprs_rlcmac_bts *bts);
diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c
index 656342e..2c5a97a 100644
--- a/src/gprs_bssgp_pcu.c
+++ b/src/gprs_bssgp_pcu.c
@@ -244,9 +244,9 @@
 	 * target MS is using. */
 	llist_for_each_entry(bts, &the_pcu->bts_list, list) {
 		/* TODO: Match by TMSI before IMSI if present?! */
-		ms = bts_ms_by_tlli(bts, req.tlli, req.tlli);
+		ms = bts_get_ms_by_tlli(bts, req.tlli, req.tlli);
 		if (!ms && req.mi_imsi_present)
-			ms = bts_ms_by_imsi(bts, req.mi_imsi.imsi);
+			ms = bts_get_ms_by_imsi(bts, req.mi_imsi.imsi);
 		bts_add_paging(bts, &req, ms);
 	}
 
diff --git a/src/gprs_ms.c b/src/gprs_ms.c
index 9ce3d82..909e7f8 100644
--- a/src/gprs_ms.c
+++ b/src/gprs_ms.c
@@ -558,7 +558,7 @@
 		"Modifying MS object, TLLI = 0x%08x, IMSI '%s' -> '%s'\n",
 		ms_tlli(ms), ms->imsi, imsi);
 
-	struct GprsMs *old_ms = bts_ms_by_imsi(ms->bts, imsi);
+	struct GprsMs *old_ms = bts_get_ms_by_imsi(ms->bts, imsi);
 	/* Check if we are going to store a different MS object with already
 	   existing IMSI. This is probably a bug in code calling this function,
 	   since it should take care of this explicitly */
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 577ba57..7068083 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -1071,7 +1071,7 @@
 	case GSM_MI_TYPE_IMSI:
 		req.mi_imsi = mi;
 		req.mi_imsi_present = true;
-		ms = bts_ms_by_imsi(bts, req.mi_imsi.imsi);
+		ms = bts_get_ms_by_imsi(bts, req.mi_imsi.imsi);
 		break;
 	default:
 		LOGP(DL1IF, LOGL_ERROR, "Unexpected MI type %u\n", mi.type);
diff --git a/src/pdch.cpp b/src/pdch.cpp
index e397a8f..081c306 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -348,7 +348,7 @@
 		LOGPDCH(this, DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with "
 			"unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n",
 			fn, tlli, trx_no(), ts_no);
-		ms = bts_ms_by_tlli(bts(), tlli, GSM_RESERVED_TMSI);
+		ms = bts_get_ms_by_tlli(bts(), tlli, GSM_RESERVED_TMSI);
 		if (ms)
 			LOGPDCH(this, DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with "
 				"unknown TBF corresponds to MS with IMSI %s, TA %d, "
@@ -664,7 +664,7 @@
 	/* First gather MS from TLLI/DL_TFI/UL_TFI:*/
 	if (request->ID.UnionType) { /* ID_TYPE = TLLI */
 		uint32_t tlli = request->ID.u.TLLI;
-		ms = bts_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI);
+		ms = bts_get_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI);
 		if (!ms) {
 			ms = bts_alloc_ms(bts);
 			ms_set_tlli(ms, tlli);
@@ -854,7 +854,7 @@
 	struct pdch_ulc_node *poll;
 	GprsMs *ms;
 
-	ms = bts_ms_by_tlli(bts(), report->TLLI, GSM_RESERVED_TMSI);
+	ms = bts_get_ms_by_tlli(bts(), report->TLLI, GSM_RESERVED_TMSI);
 	if (!ms) {
 		LOGPDCH(this, DRLCMAC, LOGL_NOTICE, "MS send measurement "
 			"but TLLI 0x%08x is unknown\n", report->TLLI);