aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2016-11-04 22:30:35 +0300
committerHarald Welte <laforge@gnumonks.org>2016-12-01 14:49:15 +0000
commitf4b238f91efddbfc3bc8456bdfef9a2354103c99 (patch)
tree0b3adb80bfe3a7c63593cb34528947444c093dcb
parent103ddc7155c49f0376d1b44c53ccc8569496dd2d (diff)
trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts.
Originally `maxdly` command in osmo-trx was contrlling max TA for Normal Bursts. This was not a proper behaviour, because it was used to "control maximum distance a handset can attach from" which is controlled by Access Bursts max TA. Osmo-trx was corrected to apply `maxdly` to Access Bursts and a new command was introduced to contrl max TA for Normal Bursts - `maxdlynb`. This patch adds support for this configuration command into osmo-bts-trx. If you wonder why would you need that - some test equipment (namely R&S CMD57) has really bad timing sync and can generate signal a few symbols off. That prevents osmo-trx from properly receiving otherwise perfectly good bursts generated by CMD57. This configuration is a solution for this. Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277
-rw-r--r--src/osmo-bts-trx/l1_if.c5
-rw-r--r--src/osmo-bts-trx/l1_if.h4
-rw-r--r--src/osmo-bts-trx/trx_if.c5
-rw-r--r--src/osmo-bts-trx/trx_if.h1
-rw-r--r--src/osmo-bts-trx/trx_vty.c54
5 files changed, 68 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index ea2088b7..202a05e1 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -197,6 +197,10 @@ int l1if_provision_transceiver_trx(struct trx_l1h *l1h)
trx_if_cmd_setmaxdly(l1h, l1h->config.maxdly);
l1h->config.maxdly_sent = 1;
}
+ if (l1h->config.maxdlynb_valid && !l1h->config.maxdlynb_sent) {
+ trx_if_cmd_setmaxdlynb(l1h, l1h->config.maxdlynb);
+ l1h->config.maxdlynb_sent = 1;
+ }
for (tn = 0; tn < TRX_NR_TS; tn++) {
if (l1h->config.slottype_valid[tn]
@@ -217,6 +221,7 @@ int l1if_provision_transceiver_trx(struct trx_l1h *l1h)
plink->u.osmotrx.power_sent = 0;
}
l1h->config.maxdly_sent = 0;
+ l1h->config.maxdlynb_sent = 0;
for (tn = 0; tn < TRX_NR_TS; tn++)
l1h->config.slottype_sent[tn] = 0;
}
diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h
index 187303c6..f0b2e67a 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -24,6 +24,10 @@ struct trx_config {
int maxdly;
int maxdly_sent;
+ int maxdlynb_valid;
+ int maxdlynb;
+ int maxdlynb_sent;
+
uint8_t slotmask;
int slottype_valid[TRX_NR_TS];
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 42d383c3..989e77a7 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -281,6 +281,11 @@ int trx_if_cmd_setmaxdly(struct trx_l1h *l1h, int dly)
return trx_ctrl_cmd(l1h, 0, "SETMAXDLY", "%d", dly);
}
+int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly)
+{
+ return trx_ctrl_cmd(l1h, 0, "SETMAXDLYNB", "%d", dly);
+}
+
int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type)
{
return trx_ctrl_cmd(l1h, 1, "SETSLOT", "%d %d", tn, type);
diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h
index 8659c4a8..fdc8a8d3 100644
--- a/src/osmo-bts-trx/trx_if.h
+++ b/src/osmo-bts-trx/trx_if.h
@@ -22,6 +22,7 @@ int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic);
int trx_if_cmd_setrxgain(struct trx_l1h *l1h, int db);
int trx_if_cmd_setpower(struct trx_l1h *l1h, int db);
int trx_if_cmd_setmaxdly(struct trx_l1h *l1h, int dly);
+int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly);
int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type);
int trx_if_cmd_rxtune(struct trx_l1h *l1h, uint16_t arfcn);
int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn);
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 3aec8bae..ca347e8d 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -105,6 +105,11 @@ static void show_phy_inst_single(struct vty *vty, struct phy_instance *pinst)
VTY_NEWLINE);
else
vty_out(vty, " maxdly : undefined%s", VTY_NEWLINE);
+ if (l1h->config.maxdlynb_valid)
+ vty_out(vty, " maxdlynb : %d%s", l1h->config.maxdlynb,
+ VTY_NEWLINE);
+ else
+ vty_out(vty, " maxdlynb : undefined%s", VTY_NEWLINE);
for (tn = 0; tn < TRX_NR_TS; tn++) {
if (!((1 << tn) & l1h->config.slotmask))
vty_out(vty, " slot #%d: unsupported%s", tn,
@@ -239,7 +244,13 @@ DEFUN(cfg_bts_no_setbsic, cfg_bts_no_setbsic_cmd,
DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd,
"osmotrx maxdly <0-31>",
- "Set the maximum delay of GSM symbols\n"
+ "Set the maximum acceptable delay of an Access Burst (in GSM symbols)."
+ " Access Burst is the first burst a mobile transmits in order to establish"
+ " a connection and it is used to estimate Timing Advance (TA) which is"
+ " then applied to Normal Bursts to compensate for signal delay due to"
+ " distance. So changing this setting effectively changes maximum range of"
+ " the cell, because if we receive an Access Burst with a delay higher than"
+ " this value, it will be ignored and connection is dropped.\n"
"GSM symbols (approx. 1.1km per symbol)\n")
{
struct phy_instance *pinst = vty->index;
@@ -253,6 +264,31 @@ DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd,
return CMD_SUCCESS;
}
+
+DEFUN(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd,
+ "osmotrx maxdlynb <0-31>",
+ "Set the maximum acceptable delay of a Normal Burst (in GSM symbols)."
+ " USE FOR TESTING ONLY, DON'T CHANGE IN PRODUCTION USE!"
+ " During normal operation, Normal Bursts delay are controled by a Timing"
+ " Advance control loop and thus Normal Bursts arrive to a BTS with no more"
+ " than a couple GSM symbols, which is already taken into account in osmo-trx."
+ " So changing this setting will have no effect in production installations"
+ " except increasing osmo-trx CPU load. This setting is only useful when"
+ " testing with a transmitter which can't precisely synchronize to the BTS"
+ " downlink signal, like e.g. R&S CMD57.\n"
+ "GSM symbols (approx. 1.1km per symbol)\n")
+{
+ struct phy_instance *pinst = vty->index;
+ struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+
+ l1h->config.maxdlynb = atoi(argv[0]);
+ l1h->config.maxdlynb_valid = 1;
+ l1h->config.maxdlynb_sent = 0;
+ l1if_provision_transceiver_trx(l1h);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_phyinst_slotmask, cfg_phyinst_slotmask_cmd,
"slotmask (1|0) (1|0) (1|0) (1|0) (1|0) (1|0) (1|0) (1|0)",
"Set the supported slots\n"
@@ -400,6 +436,18 @@ DEFUN(cfg_phyinst_no_maxdly, cfg_phyinst_no_maxdly_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd,
+ "no osmotrx maxdlynb",
+ NO_STR "Unset the maximum delay of GSM symbols\n")
+{
+ struct phy_instance *pinst = vty->index;
+ struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+
+ l1h->config.maxdlynb_valid = 0;
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd,
"osmotrx ip HOST",
OSMOTRX_STR
@@ -458,6 +506,8 @@ void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst
if (l1h->config.maxdly_valid)
vty_out(vty, " maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE);
+ if (l1h->config.maxdlynb_valid)
+ vty_out(vty, " maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE);
if (l1h->config.slotmask != 0xff)
vty_out(vty, " slotmask %d %d %d %d %d %d %d %d%s",
l1h->config.slotmask & 1,
@@ -520,6 +570,8 @@ int bts_model_vty_init(struct gsm_bts *bts)
install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd);
install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd);
install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd);
+ install_element(PHY_INST_NODE, &cfg_phyinst_maxdlynb_cmd);
+ install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdlynb_cmd);
return 0;
}