aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Diniz <rafael@rhizomatica.org>2019-01-23 12:32:12 +0100
committerKeith <keith@rhizomatica.org>2019-01-23 12:32:12 +0100
commitc57ac38d68976938be6a099875267a82b8d3c54a (patch)
treefc4aac0420811ec2c0d698f98a7c3229ffd0f6d4
parent99278b105018af24cc5a28673ffa960e933f3979 (diff)
Adds vty param/command default-timing-advance
The idea of this patch is to be able to play with the TA to use when unknown in real time and observe changes in behaviour of MS (if any)
-rw-r--r--src/bts.h3
-rw-r--r--src/pcu_vty.c17
-rw-r--r--src/tbf_dl.cpp4
3 files changed, 24 insertions, 0 deletions
diff --git a/src/bts.h b/src/bts.h
index df81440..3400a9c 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -151,6 +151,9 @@ struct gprs_rlcmac_bts {
/* State for dynamic algorithm selection */
int multislot_disabled;
+ /* default-timing-advance */
+ int default_timing_advance;
+
/**
* Point back to the C++ object. This is used during the transition
* period.
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 6f50bf1..797bdc0 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -257,6 +257,9 @@ static int config_write_pcu(struct vty *vty)
if (strcmp(bts->pcu_sock_path, PCU_SOCK_DEFAULT))
vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE);
+ if (bts->default_timing_advance >= 0)
+ vty_out(vty, " default-timing-advance %d%s", bts->default_timing_advance, VTY_NEWLINE);
+
for (i = 0; i < 32; i++) {
unsigned int cs = (1 << i);
if (bts->gsmtap_categ_mask & cs) {
@@ -615,6 +618,19 @@ DEFUN(cfg_pcu_window_size,
return CMD_SUCCESS;
}
+DEFUN(cfg_default_timing_advance,
+ cfg_default_timing_advance_cmd,
+ "default-timing-advance <0-220>",
+ "default-timing-advance hack\n")
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+ int b = atoi(argv[0]);
+
+ bts->default_timing_advance = b;
+
+ return CMD_SUCCESS;
+}
+
#define QUEUE_STR "Packet queue options\n"
#define LIFETIME_STR "Set lifetime limit of LLC frame in centi-seconds " \
@@ -1189,6 +1205,7 @@ int pcu_vty_init(const struct log_info *cat)
install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd);
install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd);
install_element(PCU_NODE, &cfg_pcu_sock_cmd);
+ install_element(PCU_NODE, &cfg_default_timing_advance_cmd);
install_element_ve(&show_bts_stats_cmd);
install_element_ve(&show_tbf_cmd);
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index dd24963..3278764 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -140,6 +140,10 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
}
/* TODO: if (!ms) create MS before tbf_alloc is called? */
+ // force default_timing_advance
+ if (bts->default_timing_advance >= 0)
+ ta = bts->default_timing_advance;
+
if (ul_tbf && ul_tbf->m_contention_resolution_done
&& !ul_tbf->m_final_ack_sent) {
use_trx = ul_tbf->trx->trx_no;