aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-23 21:21:09 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-10-24 22:14:42 +0200
commit7bde60f26021b2f8cd01943e8624866120b1d703 (patch)
tree303fe57d1fe686aa2569e8d75b4f8e548174e28f
parentb3f239785ccba762d8ebbf704a3da21208bc9dca (diff)
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
-rw-r--r--src/tbf.h3
-rw-r--r--src/tbf_dl.h7
-rw-r--r--src/tbf_ul.h7
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)