Change in osmo-pcu[master]: Rename 'bts_data' leftovers to 'bts'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Jan 19 16:40:07 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/22276 )

Change subject: Rename 'bts_data' leftovers to 'bts'
......................................................................

Rename 'bts_data' leftovers to 'bts'

Before, we used tho have a BTs object split into 2 parts, a C
gprs_rlcmac_bts struct and a C++ BTS struct, and "bts_data" naming was
used to distinguish them in variable names. Nowadays the struct is
finally combined into one, so there's no point in using this "bts_data"
terminology, we use always "bts".

Change-Id: I9852bf439292d1abc70711bea65698b21bde0ee8
---
M src/gprs_rlcmac_sched.cpp
M src/gprs_rlcmac_ts_alloc.cpp
M src/pcu_l1_if.cpp
M src/pcu_vty_functions.cpp
M src/pcu_vty_functions.h
M src/pdch.cpp
M src/pdch.h
M src/tbf.cpp
M src/tbf.h
9 files changed, 40 insertions(+), 55 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index 39e22c0..40c194c 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -130,29 +130,29 @@
 }
 
 struct msgb *sched_app_info(struct gprs_rlcmac_tbf *tbf) {
-	struct gprs_rlcmac_bts *bts_data;
+	struct gprs_rlcmac_bts *bts;
 	struct msgb *msg = NULL;
 
 	if (!tbf || !tbf->ms()->app_info_pending)
 		return NULL;
 
-	bts_data = the_pcu->bts;
+	bts = the_pcu->bts;
 
-	if (bts_data->app_info) {
+	if (bts->app_info) {
 		LOGP(DRLCMACSCHED, LOGL_DEBUG, "Sending Packet Application Information message\n");
-		msg = msgb_copy(bts_data->app_info, "app_info_msg_sched");
+		msg = msgb_copy(bts->app_info, "app_info_msg_sched");
 	} else
 		LOGP(DRLCMACSCHED, LOGL_ERROR, "MS has app_info_pending flag set, but no Packet Application Information"
 		     " message stored in BTS!\n");
 
 	tbf->ms()->app_info_pending = false;
-	bts_data->app_info_pending--;
+	bts->app_info_pending--;
 
-	if (!bts_data->app_info_pending) {
+	if (!bts->app_info_pending) {
 		LOGP(DRLCMACSCHED, LOGL_DEBUG, "Packet Application Information successfully sent to all MS with active"
 		     " TBF\n");
-		msgb_free(bts_data->app_info);
-		bts_data->app_info = NULL;
+		msgb_free(bts->app_info);
+		bts->app_info = NULL;
 	}
 	return msg;
 }
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index f8b1c1f..4c68a87 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -239,7 +239,7 @@
 	attach_tbf_to_pdch(pdch, tbf);
 }
 
-static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx)
+static int find_trx(const struct gprs_rlcmac_bts *bts, const GprsMs *ms, int8_t use_trx)
 {
 	unsigned trx_no;
 	unsigned ts;
@@ -252,8 +252,8 @@
 		return use_trx;
 
 	/* Find the first TRX that has a PDCH with a free UL and DL TFI */
-	for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) {
-		const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no];
+	for (trx_no = 0; trx_no < ARRAY_SIZE(bts->trx); trx_no += 1) {
+		const struct gprs_rlcmac_trx *trx = &bts->trx[trx_no];
 		for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) {
 			const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts];
 			if (!pdch->is_enabled())
@@ -272,14 +272,14 @@
 	return -EBUSY;
 }
 
-static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data)
+static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts)
 {
 	unsigned trx_no;
 	unsigned ts;
 
 	/* Find the first PDCH with an unused DL TS */
-	for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) {
-		const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no];
+	for (trx_no = 0; trx_no < ARRAY_SIZE(bts->trx); trx_no += 1) {
+		const struct gprs_rlcmac_trx *trx = &bts->trx[trx_no];
 		for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) {
 			const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts];
 			if (!pdch->is_enabled())
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index ce0f55e..e5ad1de 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -814,36 +814,35 @@
 static int pcu_rx_app_info_req(struct gsm_pcu_if_app_info_req *app_info_req)
 {
 	struct gprs_rlcmac_bts *bts = the_pcu->bts;
-	struct gprs_rlcmac_bts *bts_data = bts;
 	struct llist_head *tmp;
 
 	LOGP(DL1IF, LOGL_DEBUG, "Application Information Request received: type=0x%08x len=%i\n",
 	     app_info_req->application_type, app_info_req->len);
 
-	bts_data->app_info_pending = 0;
+	bts->app_info_pending = 0;
 	llist_for_each(tmp, bts_ms_store(bts)->ms_list()) {
 		GprsMs *ms = llist_entry(tmp, typeof(*ms), list);
 		if (!ms_dl_tbf(ms))
 			continue;
-		bts_data->app_info_pending++;
+		bts->app_info_pending++;
 		ms->app_info_pending = true;
 	}
 
-	if (!bts_data->app_info_pending) {
+	if (!bts->app_info_pending) {
 		LOGP(DL1IF, LOGL_NOTICE, "Packet Application Information will not be sent, no subscribers with active"
 		     " TBF\n");
 		return -1;
 	}
 
-	if (bts_data->app_info) {
+	if (bts->app_info) {
 		LOGP(DL1IF, LOGL_NOTICE, "Previous Packet Application Information was not sent to all subscribers,"
 		     " overwriting with new one\n");
-		msgb_free(bts_data->app_info);
+		msgb_free(bts->app_info);
 	}
 
 	LOGP(DL1IF, LOGL_INFO, "Sending Packet Application Information to %i subscribers with active TBF\n",
-	     bts_data->app_info_pending);
-	bts_data->app_info = gprs_rlcmac_app_info_msg(app_info_req);
+	     bts->app_info_pending);
+	bts->app_info = gprs_rlcmac_app_info_msg(app_info_req);
 	return 0;
 }
 
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index 0e9cc00..231bce7 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -242,13 +242,13 @@
 	return show_ms(vty, ms);
 }
 
-int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts_data)
+int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts)
 {
 	unsigned int trx_nr, ts_nr;
 
-	vty_out(vty, "BTS (%s)%s", bts_data->active ? "active" : "disabled", VTY_NEWLINE);
-	for (trx_nr = 0; trx_nr < ARRAY_SIZE(bts_data->trx); trx_nr++) {
-		const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_nr];
+	vty_out(vty, "BTS (%s)%s", bts->active ? "active" : "disabled", VTY_NEWLINE);
+	for (trx_nr = 0; trx_nr < ARRAY_SIZE(bts->trx); trx_nr++) {
+		const struct gprs_rlcmac_trx *trx = &bts->trx[trx_nr];
 
 		for (ts_nr = 0; ts_nr < ARRAY_SIZE(trx->pdch); ts_nr++) {
 			if (trx->pdch[ts_nr].is_enabled())
diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h
index 4528fb2..a68df27 100644
--- a/src/pcu_vty_functions.h
+++ b/src/pcu_vty_functions.h
@@ -27,13 +27,13 @@
 struct vty;
 struct gprs_rlcmac_bts;
 
-int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data, uint32_t flags);
-int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
-int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data,
+int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts, uint32_t flags);
+int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts);
+int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts,
 	uint32_t tlli);
-int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts_data,
+int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts,
 	const char *imsi);
-int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts_data);
+int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/pdch.cpp b/src/pdch.cpp
index 49f0b85..9dd4072 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -113,12 +113,12 @@
 	}
 }
 
-static inline void sched_ul_ass_or_rej(struct gprs_rlcmac_bts *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf)
+static inline void sched_ul_ass_or_rej(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_dl_tbf *tbf)
 {
 	bts_do_rate_ctr_inc(bts, CTR_CHANNEL_REQUEST_DESCRIPTION);
 
 	/* This call will register the new TBF with the MS on success */
-	gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->ms(), tbf->trx->trx_no, tbf->tlli());
+	gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts, tbf->ms(), tbf->trx->trx_no, tbf->tlli());
 
 	/* schedule uplink assignment or reject */
 	if (ul_tbf) {
@@ -455,7 +455,7 @@
 	}
 	/* check for channel request */
 	if (ack_nack->Exist_Channel_Request_Description)
-		sched_ul_ass_or_rej(bts(), bts_data(), tbf);
+		sched_ul_ass_or_rej(bts(), tbf);
 
 	/* get measurements */
 	if (tbf->ms()) {
@@ -545,7 +545,7 @@
 
 	/* check for channel request */
 	if (ack_nack->Exist_ChannelRequestDescription)
-		sched_ul_ass_or_rej(bts(), bts_data(), tbf);
+		sched_ul_ass_or_rej(bts(), tbf);
 
 	/* get measurements */
 	if (tbf->ms()) {
@@ -612,9 +612,9 @@
 			tbf_free(ul_tbf);
 		}
 
-		ul_tbf = tbf_alloc_ul(bts_data(), ms, trx_no(), tlli);
+		ul_tbf = tbf_alloc_ul(bts(), ms, trx_no(), tlli);
 		if (!ul_tbf) {
-			handle_tbf_reject(bts_data(), ms, tlli,
+			handle_tbf_reject(bts(), ms, tlli,
 				trx_no(), ts_no);
 			goto return_unref;
 		}
@@ -984,11 +984,6 @@
 	return trx->trx_no;
 }
 
-inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const
-{
-	return trx->bts;
-}
-
 /* PTCCH (Packet Timing Advance Control Channel) */
 void gprs_rlcmac_pdch::init_ptcch_msg(void)
 {
diff --git a/src/pdch.h b/src/pdch.h
index 7a544fe..2413ef7 100644
--- a/src/pdch.h
+++ b/src/pdch.h
@@ -69,7 +69,6 @@
 	int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn,
 		struct pcu_l1_meas *meas, enum CodingScheme cs);
 
-	gprs_rlcmac_bts *bts_data() const;
 	struct gprs_rlcmac_bts *bts() const;
 	uint8_t trx_no() const;
 
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 05f4e2c..3464242 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -168,11 +168,6 @@
 	m_name_buf[0] = '\0';
 }
 
-gprs_rlcmac_bts *gprs_rlcmac_tbf::bts_data() const
-{
-	return bts;
-}
-
 uint32_t gprs_rlcmac_tbf::tlli() const
 {
 	return m_ms ? ms_tlli(m_ms) : GSM_RESERVED_TMSI;
@@ -318,7 +313,7 @@
 	talloc_free(tbf);
 }
 
-uint16_t egprs_window_size(const struct gprs_rlcmac_bts *bts_data, uint8_t slots)
+uint16_t egprs_window_size(const struct gprs_rlcmac_bts *bts, uint8_t slots)
 {
 	uint8_t num_pdch = pcu_bitcount(slots);
 
@@ -328,7 +323,6 @@
 
 int gprs_rlcmac_tbf::update()
 {
-	struct gprs_rlcmac_bts *bts_data = bts;
 	int rc;
 
 	if (direction != GPRS_RLCMAC_DL_TBF)
@@ -337,7 +331,7 @@
 	LOGP(DTBF, LOGL_DEBUG, "********** DL-TBF update **********\n");
 
 	tbf_unlink_pdch(this);
-	rc = the_pcu->alloc_algorithm(bts_data, ms(), this, false, -1);
+	rc = the_pcu->alloc_algorithm(bts, ms(), this, false, -1);
 	/* if no resource */
 	if (rc < 0) {
 		LOGPTBF(this, LOGL_ERROR, "No resource after update???\n");
@@ -738,7 +732,6 @@
 
 int gprs_rlcmac_tbf::setup(int8_t use_trx, bool single_slot)
 {
-	struct gprs_rlcmac_bts *bts_data = bts;
 	int rc;
 
 	if (ms_mode(m_ms) != GPRS)
@@ -746,7 +739,7 @@
 
 	m_created_ts = time(NULL);
 	/* select algorithm */
-	rc = the_pcu->alloc_algorithm(bts_data, m_ms, this, single_slot, use_trx);
+	rc = the_pcu->alloc_algorithm(bts, m_ms, this, single_slot, use_trx);
 	/* if no resource */
 	if (rc < 0) {
 		return -1;
diff --git a/src/tbf.h b/src/tbf.h
index cb4c9b9..73266bf 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -348,7 +348,6 @@
 	struct llist_item m_bts_list;
 
 protected:
-	gprs_rlcmac_bts *bts_data() const;
 	void merge_and_clear_ms(GprsMs *old_ms);
 
 	gprs_llc_queue *llc_queue();
@@ -567,6 +566,6 @@
 		((int)GPRS_RLCMAC_UL_TBF - (int)dir + (int)GPRS_RLCMAC_DL_TBF);
 }
 
-uint16_t egprs_window_size(const struct gprs_rlcmac_bts *bts_data, uint8_t slots);
+uint16_t egprs_window_size(const struct gprs_rlcmac_bts *bts, uint8_t slots);
 
 #endif

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/22276
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I9852bf439292d1abc70711bea65698b21bde0ee8
Gerrit-Change-Number: 22276
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210119/6b831da7/attachment.htm>


More information about the gerrit-log mailing list