Change in osmo-pcu[master]: tbf: Implement enable_egprs() once

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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Oct 26 07:20:12 UTC 2020


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

Change subject: tbf: Implement enable_egprs() once
......................................................................

tbf: Implement enable_egprs() once

There's no real need for having different copies of this method in each
children. Furthermore, having the method implemented in the base class
made me shoot my foot while trying to move this to the tbf constructor
(see next commit), so let's simplify this and avoid other people
following into the same issue.

enable_egprs() in tbf.h is moved to be public since it needed (as it was
for the duplicated children mehtods with same name), but anyway it will
be moved to private in next commit.

Change-Id: Id7de060318201a42e51f277f898463f4b9a84eba
---
M src/tbf.h
M src/tbf_dl.h
M src/tbf_ul.h
3 files changed, 2 insertions(+), 15 deletions(-)

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



diff --git a/src/tbf.h b/src/tbf.h
index bf51a8d..ac6c63c 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -263,6 +263,7 @@
 	/* EGPRS */
 	bool is_egprs_enabled() const;
 	void disable_egprs();
+	void enable_egprs();
 
 	/* attempt to make things a bit more fair */
 	void rotate_in_list();
@@ -322,7 +323,6 @@
 
 protected:
 	gprs_rlcmac_bts *bts_data() const;
-	void enable_egprs();
 	void merge_and_clear_ms(GprsMs *old_ms);
 
 	gprs_llc_queue *llc_queue();
@@ -581,6 +581,7 @@
 inline void gprs_rlcmac_tbf::enable_egprs()
 {
 	m_egprs_enabled = true;
+	window()->set_sns(RLC_EGPRS_SNS);
 }
 
 inline void gprs_rlcmac_tbf::disable_egprs()
diff --git a/src/tbf_dl.h b/src/tbf_dl.h
index 51e170a..55306fd 100644
--- a/src/tbf_dl.h
+++ b/src/tbf_dl.h
@@ -42,7 +42,6 @@
 	gprs_rlcmac_dl_tbf(BTS *bts);
 	gprs_rlc_window *window();
 	void cleanup();
-	void enable_egprs();
 	/* dispatch Unitdata.DL messages */
 	static int handle(struct gprs_rlcmac_bts *bts,
 		const uint32_t tlli, const uint32_t old_tlli,
@@ -143,12 +142,6 @@
 	return m_window.ws();
 }
 
-inline void gprs_rlcmac_dl_tbf::enable_egprs()
-{
-	m_window.set_sns(RLC_EGPRS_SNS);
-	gprs_rlcmac_tbf::enable_egprs();
-}
-
 inline gprs_rlcmac_dl_tbf *as_dl_tbf(gprs_rlcmac_tbf *tbf)
 {
 	if (tbf && tbf->direction == GPRS_RLCMAC_DL_TBF)
diff --git a/src/tbf_ul.h b/src/tbf_ul.h
index cbaffa5..a581f27 100644
--- a/src/tbf_ul.h
+++ b/src/tbf_ul.h
@@ -55,7 +55,6 @@
 	struct msgb *create_ul_ack(uint32_t fn, uint8_t ts);
 	bool ctrl_ack_to_toggle();
 	bool handle_ctrl_ack();
-	void enable_egprs();
 	/* blocks were acked */
 	int rcv_data_block_acknowledged(
 		const struct gprs_rlc_data_info *rlc,
@@ -123,12 +122,6 @@
 	return m_window.ws();
 }
 
-inline void gprs_rlcmac_ul_tbf::enable_egprs()
-{
-	m_window.set_sns(RLC_EGPRS_SNS);
-	gprs_rlcmac_tbf::enable_egprs();
-}
-
 inline gprs_rlcmac_ul_tbf *as_ul_tbf(gprs_rlcmac_tbf *tbf)
 {
 	if (tbf && tbf->direction == GPRS_RLCMAC_UL_TBF)

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Id7de060318201a42e51f277f898463f4b9a84eba
Gerrit-Change-Number: 20857
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201026/deef31d5/attachment.htm>


More information about the gerrit-log mailing list