From 05f9f59a6728a46738c3b41f74336059fcae77af Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 14 Jan 2021 12:56:58 +0100 Subject: [PATCH] Move dl_tbf_preemptive_retransmission field from BTS to PCU Change-Id: I3ab32fcafe83f3ecb116a5b8a05f58f3fddc5451 --- src/bts.cpp | 1 - src/bts.h | 1 - src/gprs_pcu.c | 1 + src/gprs_pcu.h | 1 + src/pcu_vty.c | 12 +++--------- src/tbf_dl.cpp | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/bts.cpp b/src/bts.cpp index 3200b40a..46f00335 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -253,7 +253,6 @@ static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj) bts->app_info = NULL; bts->bts = bts_obj; - bts->dl_tbf_preemptive_retransmission = true; bts->T_defs_bts = T_defs_bts; osmo_tdefs_reset(bts->T_defs_bts); diff --git a/src/bts.h b/src/bts.h index 81f7327e..1394bfe2 100644 --- a/src/bts.h +++ b/src/bts.h @@ -106,7 +106,6 @@ struct gprs_rlcmac_bts { uint8_t n3105; struct gprs_rlcmac_trx trx[8]; - bool dl_tbf_preemptive_retransmission; uint8_t si13[GSM_MACBLOCK_LEN]; bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c index f791e431..3b44d363 100644 --- a/src/gprs_pcu.c +++ b/src/gprs_pcu.c @@ -51,6 +51,7 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx) pcu->vty.max_mcs_ul = MAX_EDGE_MCS; pcu->vty.max_mcs_dl = MAX_EDGE_MCS; pcu->vty.alpha = 0; /* a = 0.0 */ + pcu->vty.dl_tbf_preemptive_retransmission = true; pcu->T_defs = T_defs_pcu; osmo_tdefs_reset(pcu->T_defs); diff --git a/src/gprs_pcu.h b/src/gprs_pcu.h index d6d2dcad..2f2fdc7d 100644 --- a/src/gprs_pcu.h +++ b/src/gprs_pcu.h @@ -76,6 +76,7 @@ struct gprs_pcu { uint8_t max_mcs_dl, max_mcs_ul; uint8_t force_two_phase; uint8_t alpha, gamma; + bool dl_tbf_preemptive_retransmission; } vty; struct gsmtap_inst *gsmtap; diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 06e16749..727712df 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -231,7 +231,7 @@ static int config_write_pcu(struct vty *vty) vty_out(vty, " two-phase-access%s", VTY_NEWLINE); vty_out(vty, " alpha %d%s", the_pcu->vty.alpha, VTY_NEWLINE); vty_out(vty, " gamma %d%s", the_pcu->vty.gamma * 2, VTY_NEWLINE); - if (!bts->dl_tbf_preemptive_retransmission) + if (!the_pcu->vty.dl_tbf_preemptive_retransmission) vty_out(vty, " no dl-tbf-preemptive-retransmission%s", VTY_NEWLINE); if (strcmp(the_pcu->pcu_sock_path, PCU_SOCK_DEFAULT)) vty_out(vty, " pcu-socket %s%s", the_pcu->pcu_sock_path, VTY_NEWLINE); @@ -869,10 +869,7 @@ DEFUN_ATTR(cfg_pcu_dl_tbf_preemptive_retransmission, RETRANSMISSION_STR " (enabled by default)", CMD_ATTR_IMMEDIATE) { - struct gprs_rlcmac_bts *bts = bts_main_data(); - - bts->dl_tbf_preemptive_retransmission = true; - + the_pcu->vty.dl_tbf_preemptive_retransmission = true; return CMD_SUCCESS; } @@ -882,10 +879,7 @@ DEFUN_ATTR(cfg_pcu_no_dl_tbf_preemptive_retransmission, NO_STR RETRANSMISSION_STR, CMD_ATTR_IMMEDIATE) { - struct gprs_rlcmac_bts *bts = bts_main_data(); - - bts->dl_tbf_preemptive_retransmission = false; - + the_pcu->vty.dl_tbf_preemptive_retransmission = false; return CMD_SUCCESS; } diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 280e057b..6f57e7d8 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -545,7 +545,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn, force_cs ? " (forced)" : ""); bsn = create_new_bsn(fn, new_cs); - } else if (bts->bts_data()->dl_tbf_preemptive_retransmission && !m_window.window_empty()) { + } else if (bts->pcu->vty.dl_tbf_preemptive_retransmission && !m_window.window_empty()) { /* The window contains unacked packages, but not acked. * Mark unacked bsns as RESEND */ LOGPTBFDL(this, LOGL_DEBUG,