diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-09-09 13:19:06 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-09-17 11:05:45 +0200 |
commit | 63700ead348ef8bf9a9fe64cff0722d197151be2 (patch) | |
tree | 477a41d0f3ad236521f379637fdd2f20e15d2a2f | |
parent | 474dc77894ad550dab225da36c377a6506cad6f7 (diff) |
Use osmo_tdef to implement ms-idle-time
This commit would also remove the option from config_write_pcu() since
it's automatically filled in by osmo_tdef, but there was actually a bug
because that param was never printed when saving the config...
Change-Id: Id8e70b0f44ef2f7e20ecdb3fd8ca93ae2a05b9a3
-rw-r--r-- | src/bts.cpp | 3 | ||||
-rw-r--r-- | src/bts.h | 1 | ||||
-rw-r--r-- | src/pcu_main.cpp | 1 | ||||
-rw-r--r-- | src/pcu_vty.c | 16 | ||||
-rw-r--r-- | tests/tbf/TbfTest.cpp | 4 |
5 files changed, 15 insertions, 10 deletions
diff --git a/src/bts.cpp b/src/bts.cpp index ae6117e1..2423400c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -83,6 +83,7 @@ static struct osmo_tdef T_defs_pcu[] = { { .T=-2000, .default_val=2, .unit=OSMO_TDEF_MS, .desc="Tbf reject for PRR timer (ms)", .val=0 }, { .T=-2001, .default_val=2, .unit=OSMO_TDEF_S, .desc="PACCH assignment timer (s)", .val=0 }, { .T=-2002, .default_val=200, .unit=OSMO_TDEF_MS, .desc="Waiting after IMM.ASS confirm timer (ms)", .val=0 }, + { .T=-2030, .default_val=60, .unit=OSMO_TDEF_S, .desc="Time to keep an idle MS object alive (s)", .val=0 }, /* slightly above T3314 (default 44s, 24.008, 11.2.2) */ { .T=0, .default_val=0, .unit=OSMO_TDEF_S, .desc=NULL, .val=0 } /* empty item at the end */ }; @@ -867,7 +868,7 @@ GprsMs *BTS::ms_alloc(uint8_t ms_class, uint8_t egprs_ms_class) GprsMs *ms; ms = ms_store().create_ms(); - ms->set_timeout(m_bts.ms_idle_sec); + ms->set_timeout(osmo_tdef_get(m_bts.T_defs_pcu, -2030, OSMO_TDEF_S, -1)); ms->set_ms_class(ms_class); ms->set_egprs_ms_class(egprs_ms_class); @@ -140,7 +140,6 @@ struct gprs_rlcmac_bts { /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; - uint32_t ms_idle_sec; uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; uint8_t cs_adj_lower_limit; diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 6f71ca5f..e423718e 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -207,7 +207,6 @@ int main(int argc, char *argv[]) bts->n3105 = 8; bts->alpha = 0; /* a = 0.0 */ bts->si13_is_set = false; - bts->ms_idle_sec = 60; /* slightly above T3314 (default 44s, 24.008, 11.2.2) */ bts->cs_adj_enabled = 1; bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */ bts->cs_adj_lower_limit = 10; /* Increase CS if the error rate is below */ diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 380b173a..477486c0 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -901,27 +901,31 @@ DEFUN(cfg_pcu_no_dl_tbf_preemptive_retransmission, } #define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n" -DEFUN(cfg_pcu_ms_idle_time, +DEFUN_DEPRECATED(cfg_pcu_ms_idle_time, cfg_pcu_ms_idle_time_cmd, "ms-idle-time <1-7200>", MS_IDLE_TIME_STR "idle time in sec") { - struct gprs_rlcmac_bts *bts = bts_main_data(); + vty_out(vty, "%% 'ms-idle-time' is now deprecated: use 'timer X2030 <val>' instead%s", VTY_NEWLINE); - bts->ms_idle_sec = atoi(argv[0]); + struct gprs_rlcmac_bts *bts = bts_main_data(); + if (osmo_tdef_set(bts->T_defs_pcu, -2030, atoi(argv[0]), OSMO_TDEF_S) < 0) + return CMD_WARNING; return CMD_SUCCESS; } -DEFUN(cfg_pcu_no_ms_idle_time, +DEFUN_DEPRECATED(cfg_pcu_no_ms_idle_time, cfg_pcu_no_ms_idle_time_cmd, "no ms-idle-time", NO_STR MS_IDLE_TIME_STR) { - struct gprs_rlcmac_bts *bts = bts_main_data(); + vty_out(vty, "%% 'no ms-idle-time' is now deprecated: use 'timer X2030 0' instead%s", VTY_NEWLINE); - bts->ms_idle_sec = 0; + struct gprs_rlcmac_bts *bts = bts_main_data(); + if (osmo_tdef_set(bts->T_defs_pcu, -2030, 0, OSMO_TDEF_S) < 0) + return CMD_WARNING; return CMD_SUCCESS; } diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 5bf94b51..7241a357 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -155,6 +155,7 @@ static void setup_bts(BTS *the_bts, uint8_t ts_no, uint8_t cs = 1) bts->alloc_algorithm = alloc_algorithm_a; bts->initial_cs_dl = cs; bts->initial_cs_ul = cs; + osmo_tdef_set(bts->T_defs_pcu, -2030, 0, OSMO_TDEF_S); trx = &bts->trx[0]; trx->pdch[ts_no].enable(); @@ -501,7 +502,8 @@ static void test_tbf_dl_llc_loss() bts = the_bts.bts_data(); setup_bts(&the_bts, ts_no); - bts->ms_idle_sec = 10; /* keep the MS object */ + /* keep the MS object 10 seconds */ + OSMO_ASSERT(osmo_tdef_set(bts->T_defs_pcu, -2030, 10, OSMO_TDEF_S) == 0); gprs_bssgp_create_and_connect(bts, 33001, 0, 33001, 2234, 2234, 2234, 1, 1, false, 0, 0, 0); |