Move llc_* fields from BTS to PCU
Change-Id: Iffb916e53fdf99164ad07cd19e4b35a64136307e
diff --git a/src/bts.cpp b/src/bts.cpp
index 450c04e..92abdbf 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -201,9 +201,6 @@
bts->n3105 = 8;
bts->si13_is_set = false;
- bts->llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
- bts->llc_idle_ack_csec = 10;
-
bts->app_info = NULL;
bts->bts = bts_obj;
bts->T_defs_bts = T_defs_bts;
diff --git a/src/bts.h b/src/bts.h
index 635c3c7..bf6e681 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -89,10 +89,6 @@
uint16_t mcs_mask; /* Allowed MCS mask from BTS */
uint8_t initial_cs_dl, initial_cs_ul;
uint8_t initial_mcs_dl, initial_mcs_ul;
- uint16_t force_llc_lifetime; /* overrides lifetime from SGSN */
- uint32_t llc_discard_csec;
- uint32_t llc_idle_ack_csec;
- uint32_t llc_codel_interval_msec; /* 0=disabled, -1=use default interval */
/* Timer defintions */
struct osmo_tdef *T_defs_bts; /* timers controlled by BTS, received through PCUIF */
uint8_t n3101;
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index c1a7a7d..1596d67 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -676,7 +676,7 @@
uint16_t bucket_time = the_pcu->vty.fc_bucket_time;
if (bucket_time == 0)
- bucket_time = bts->force_llc_lifetime;
+ bucket_time = the_pcu->vty.force_llc_lifetime;
if (bucket_time == 0xffff)
bucket_size = FC_MAX_BUCKET_SIZE;
diff --git a/src/gprs_ms.c b/src/gprs_ms.c
index 291f0e8..9d303d6 100644
--- a/src/gprs_ms.c
+++ b/src/gprs_ms.c
@@ -121,7 +121,7 @@
ms_set_mode(ms, GPRS);
if (ms->bts)
- codel_interval = bts_data(ms->bts)->llc_codel_interval_msec;
+ codel_interval = the_pcu->vty.llc_codel_interval_msec;
if (codel_interval) {
if (codel_interval == LLC_CODEL_USE_DEFAULT)
diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c
index 18c5568..013c026 100644
--- a/src/gprs_pcu.c
+++ b/src/gprs_pcu.c
@@ -94,6 +94,8 @@
/* TODO: increase them when CRBB decoding is implemented */
pcu->vty.ws_base = 64;
pcu->vty.ws_pdch = 0;
+ pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
+ pcu->vty.llc_idle_ack_csec = 10;
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 b4e7c13..8fc15dc 100644
--- a/src/gprs_pcu.h
+++ b/src/gprs_pcu.h
@@ -97,6 +97,10 @@
enum gprs_ns2_dialect ns_dialect; /* Are we talking Gb with IP-SNS (true) or classic Gb? */
uint16_t ws_base;
uint16_t ws_pdch; /* increase WS by this value per PDCH */
+ uint16_t force_llc_lifetime; /* overrides lifetime from SGSN */
+ uint32_t llc_discard_csec;
+ uint32_t llc_idle_ack_csec;
+ uint32_t llc_codel_interval_msec; /* 0=disabled, -1=use default interval */
} vty;
struct gsmtap_inst *gsmtap;
diff --git a/src/llc.cpp b/src/llc.cpp
index d1122f5..51cb15a 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -224,8 +224,8 @@
void gprs_llc_queue::calc_pdu_lifetime(BTS *bts, const uint16_t pdu_delay_csec, struct timespec *tv)
{
uint16_t delay_csec;
- if (bts->bts_data()->force_llc_lifetime)
- delay_csec = bts->bts_data()->force_llc_lifetime;
+ if (bts->pcu->vty.force_llc_lifetime)
+ delay_csec = bts->pcu->vty.force_llc_lifetime;
else
delay_csec = pdu_delay_csec;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 5e9da45..0be914b 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -201,24 +201,24 @@
if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2)
vty_out(vty, " egprs dl arq-type arq2%s", VTY_NEWLINE);
- if (bts->force_llc_lifetime == 0xffff)
+ if (the_pcu->vty.force_llc_lifetime == 0xffff)
vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE);
- else if (bts->force_llc_lifetime)
- vty_out(vty, " queue lifetime %d%s", bts->force_llc_lifetime,
+ else if (the_pcu->vty.force_llc_lifetime)
+ vty_out(vty, " queue lifetime %d%s", the_pcu->vty.force_llc_lifetime,
VTY_NEWLINE);
- if (bts->llc_discard_csec)
- vty_out(vty, " queue hysteresis %d%s", bts->llc_discard_csec,
+ if (the_pcu->vty.llc_discard_csec)
+ vty_out(vty, " queue hysteresis %d%s", the_pcu->vty.llc_discard_csec,
VTY_NEWLINE);
- if (bts->llc_idle_ack_csec)
- vty_out(vty, " queue idle-ack-delay %d%s", bts->llc_idle_ack_csec,
+ if (the_pcu->vty.llc_idle_ack_csec)
+ vty_out(vty, " queue idle-ack-delay %d%s", the_pcu->vty.llc_idle_ack_csec,
VTY_NEWLINE);
- if (bts->llc_codel_interval_msec == LLC_CODEL_USE_DEFAULT)
+ if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_USE_DEFAULT)
vty_out(vty, " queue codel%s", VTY_NEWLINE);
- else if (bts->llc_codel_interval_msec == LLC_CODEL_DISABLE)
+ else if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_DISABLE)
vty_out(vty, " no queue codel%s", VTY_NEWLINE);
else
vty_out(vty, " queue codel interval %d%s",
- bts->llc_codel_interval_msec/10, VTY_NEWLINE);
+ the_pcu->vty.llc_codel_interval_msec/10, VTY_NEWLINE);
if (the_pcu->alloc_algorithm == alloc_algorithm_a)
vty_out(vty, " alloc-algorithm a%s", VTY_NEWLINE);
@@ -579,11 +579,8 @@
"queue lifetime <1-65534>",
QUEUE_STR LIFETIME_STR "Lifetime in centi-seconds")
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
uint16_t csec = atoi(argv[0]);
-
- bts->force_llc_lifetime = csec;
-
+ the_pcu->vty.force_llc_lifetime = csec;
return CMD_SUCCESS;
}
@@ -593,10 +590,7 @@
"queue lifetime infinite",
QUEUE_STR LIFETIME_STR "Infinite lifetime")
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
- bts->force_llc_lifetime = 0xffff;
-
+ the_pcu->vty.force_llc_lifetime = 0xffff;
return CMD_SUCCESS;
}
@@ -607,10 +601,7 @@
NO_STR QUEUE_STR "Disable lifetime limit of LLC frame (use value given "
"by SGSN)\n")
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
- bts->force_llc_lifetime = 0;
-
+ the_pcu->vty.force_llc_lifetime = 0;
return CMD_SUCCESS;
}
@@ -623,11 +614,8 @@
"queue hysteresis <1-65535>",
QUEUE_STR QUEUE_HYSTERESIS_STR "Hysteresis in centi-seconds")
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
uint16_t csec = atoi(argv[0]);
-
- bts->llc_discard_csec = csec;
-
+ the_pcu->vty.llc_discard_csec = csec;
return CMD_SUCCESS;
}
@@ -637,10 +625,7 @@
"no queue hysteresis",
NO_STR QUEUE_STR QUEUE_HYSTERESIS_STR)
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
- bts->llc_discard_csec = 0;
-
+ the_pcu->vty.llc_discard_csec = 0;
return CMD_SUCCESS;
}
@@ -651,10 +636,7 @@
"queue codel",
QUEUE_STR QUEUE_CODEL_STR)
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
- bts->llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
-
+ the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
return CMD_SUCCESS;
}
@@ -664,11 +646,8 @@
"queue codel interval <1-1000>",
QUEUE_STR QUEUE_CODEL_STR "Specify interval\n" "Interval in centi-seconds")
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
uint16_t csec = atoi(argv[0]);
-
- bts->llc_codel_interval_msec = 10*csec;
-
+ the_pcu->vty.llc_codel_interval_msec = 10*csec;
return CMD_SUCCESS;
}
@@ -678,10 +657,7 @@
"no queue codel",
NO_STR QUEUE_STR QUEUE_CODEL_STR)
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
- bts->llc_codel_interval_msec = LLC_CODEL_DISABLE;
-
+ the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_DISABLE;
return CMD_SUCCESS;
}
@@ -694,11 +670,8 @@
QUEUE_STR QUEUE_IDLE_ACK_STR "Idle ACK delay in centi-seconds",
CMD_ATTR_IMMEDIATE)
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
uint16_t csec = atoi(argv[0]);
-
- bts->llc_idle_ack_csec = csec;
-
+ the_pcu->vty.llc_idle_ack_csec = csec;
return CMD_SUCCESS;
}
@@ -708,10 +681,7 @@
NO_STR QUEUE_STR QUEUE_IDLE_ACK_STR,
CMD_ATTR_IMMEDIATE)
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
- bts->llc_idle_ack_csec = 0;
-
+ the_pcu->vty.llc_idle_ack_csec = 0;
return CMD_SUCCESS;
}
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 653db14..ab34ea1 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -202,9 +202,9 @@
void gprs_rlcmac_dl_tbf::start_llc_timer()
{
- if (bts_data()->llc_idle_ack_csec > 0) {
+ if (the_pcu->vty.llc_idle_ack_csec > 0) {
struct timespec tv;
- csecs_to_timespec(bts_data()->llc_idle_ack_csec, &tv);
+ csecs_to_timespec(the_pcu->vty.llc_idle_ack_csec, &tv);
osmo_timer_schedule(&m_llc_timer, tv.tv_sec, tv.tv_nsec / 1000);
}
}
@@ -348,8 +348,8 @@
const unsigned keep_small_thresh = 60;
const MetaInfo *info;
- if (bts_data()->llc_discard_csec)
- csecs_to_timespec(bts_data()->llc_discard_csec, &hyst_delta);
+ if (the_pcu->vty.llc_discard_csec)
+ csecs_to_timespec(the_pcu->vty.llc_discard_csec, &hyst_delta);
osmo_clock_gettime(CLOCK_MONOTONIC, &tv_now);
timespecadd(&tv_now, &hyst_delta, &tv_now2);