TBF: move EGPRS enablement into (U|D)L-TBF

This is preparation patch for transition to separate UL/DL window
variables instead of current shared generic window. The setting of
window parameters is performed in functions specific to UL/DL TBFs but
the general EGPRS flag remains the same and is set via the same function
which is now marked as protected since it's only meant to be used by
UL/DL subclasses.

Related: OS#1759
Change-Id: I6056194b28a1eb9d69093d1dfdc65a11bc1fc579
This commit is contained in:
Max 2017-12-13 18:47:52 +01:00
parent ead08aae35
commit 25a3ca4e59
2 changed files with 15 additions and 6 deletions

View File

@ -862,7 +862,6 @@ struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts,
if (egprs_ms_class > 0 && bts->egprs_enabled) {
tbf->enable_egprs();
tbf->m_window.set_sns(RLC_EGPRS_SNS);
setup_egprs_mode(bts, ms);
LOGP(DRLCMAC, LOGL_INFO, "Enabled EGPRS for %s, mode %s\n",
tbf->name(), GprsCodingScheme::modeName(ms->mode()));
@ -956,7 +955,6 @@ struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts,
if (egprs_ms_class > 0 && bts->egprs_enabled) {
tbf->enable_egprs();
tbf->m_window.set_sns(RLC_EGPRS_SNS);
setup_egprs_mode(bts, ms);
LOGP(DRLCMAC, LOGL_INFO, "Enabled EGPRS for %s, mode %s\n",
tbf->name(), GprsCodingScheme::modeName(ms->mode()));

View File

@ -210,7 +210,6 @@ struct gprs_rlcmac_tbf {
/* EGPRS */
bool is_egprs_enabled() const;
void enable_egprs();
void disable_egprs();
/* attempt to make things a bit more fair */
@ -286,7 +285,7 @@ struct gprs_rlcmac_tbf {
protected:
gprs_rlcmac_bts *bts_data() const;
void enable_egprs();
int set_tlli_from_ul(uint32_t new_tlli);
void merge_and_clear_ms(GprsMs *old_ms);
@ -416,7 +415,7 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf {
gprs_rlcmac_dl_tbf(BTS *bts);
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,
@ -513,7 +512,7 @@ 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,
@ -577,6 +576,18 @@ inline enum gprs_rlcmac_tbf_direction reverse(enum gprs_rlcmac_tbf_direction dir
((int)GPRS_RLCMAC_UL_TBF - (int)dir + (int)GPRS_RLCMAC_DL_TBF);
}
inline void gprs_rlcmac_ul_tbf::enable_egprs()
{
m_window.set_sns(RLC_EGPRS_SNS);
gprs_rlcmac_tbf::enable_egprs();
}
inline void gprs_rlcmac_dl_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)