From 7bde60f26021b2f8cd01943e8624866120b1d703 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 23 Oct 2020 21:21:09 +0200 Subject: 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 --- src/tbf.h | 3 ++- src/tbf_dl.h | 7 ------- src/tbf_ul.h | 7 ------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/tbf.h b/src/tbf.h index bf51a8d5..ac6c63c4 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -263,6 +263,7 @@ struct gprs_rlcmac_tbf { /* 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 @@ struct gprs_rlcmac_tbf { 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 bool gprs_rlcmac_tbf::is_egprs_enabled() const 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 51e170a1..55306fd2 100644 --- a/src/tbf_dl.h +++ b/src/tbf_dl.h @@ -42,7 +42,6 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf { 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 @@ inline uint16_t gprs_rlcmac_dl_tbf::window_size() const 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 cbaffa5c..a581f27b 100644 --- a/src/tbf_ul.h +++ b/src/tbf_ul.h @@ -55,7 +55,6 @@ struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf { 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 @@ inline uint16_t gprs_rlcmac_ul_tbf::window_size() const 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) -- cgit v1.2.3