aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-13 17:03:37 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-10-14 12:53:04 +0200
commite91544d740a8606a994053b2f9eaf99059f40e33 (patch)
tree94e32b203c6dc8e5af4eb8de280c6c841dc6d55e /CommonLibs
parent93fee1f163054094ec52a87db33ab31e3b5ab74e (diff)
Calculate RSSI offset based on RxGain configuration
Prior to this patch, osmo-trx relied totally on proper VTY configuration being set in "rssi-offset" together with the RxGain set through TRXC in order to provide correct Uplink RSSI measurements to bts-trx. With this patch, RSSI is now by default calculated (in LMS and UHD backends) based on the currently set RxGain, by providing empirically discovered values. Still, for backward compatibility, the old "rssi-offset" command will overwrite completely the per-default calculated rssi offset. A new optional parameter "relative" is added at the end of the "rssi-offset" VTY command to flag the value as relative to the newly per-default calculated value. This way specific setups (like adding a LNA / RF fronted) can still be expressed while still keeping the automatic per-default offset. Related: OS#4468 Change-Id: I8ef78fd20c22c60d61bfb18d80a4a36df4fd6c20
Diffstat (limited to 'CommonLibs')
-rw-r--r--CommonLibs/config_defs.h1
-rw-r--r--CommonLibs/trx_vty.c12
2 files changed, 9 insertions, 4 deletions
diff --git a/CommonLibs/config_defs.h b/CommonLibs/config_defs.h
index 7d501cd..a9ed25e 100644
--- a/CommonLibs/config_defs.h
+++ b/CommonLibs/config_defs.h
@@ -47,6 +47,7 @@ struct trx_cfg {
bool multi_arfcn;
double offset;
double rssi_offset;
+ bool force_rssi_offset; /* Force value set in VTY? */
bool swap_channels;
bool ext_rach;
bool egprs;
diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c
index cf36547..fd6faed 100644
--- a/CommonLibs/trx_vty.c
+++ b/CommonLibs/trx_vty.c
@@ -231,13 +231,15 @@ DEFUN(cfg_offset, cfg_offset_cmd,
}
DEFUN(cfg_rssi_offset, cfg_rssi_offset_cmd,
- "rssi-offset FLOAT",
+ "rssi-offset FLOAT [relative]",
"Set the RSSI to dBm offset in dB (default=0)\n"
- "RSSI to dBm offset in dB\n")
+ "RSSI to dBm offset in dB\n"
+ "Add to the default rssi-offset value instead of completely replacing it\n")
{
struct trx_ctx *trx = trx_from_vty(vty);
trx->cfg.rssi_offset = atof(argv[0]);
+ trx->cfg.force_rssi_offset = (argc == 1);
return CMD_SUCCESS;
}
@@ -580,8 +582,9 @@ static int config_write_trx(struct vty *vty)
vty_out(vty, " multi-arfcn %s%s", trx->cfg.multi_arfcn ? "enable" : "disable", VTY_NEWLINE);
if (trx->cfg.offset != 0)
vty_out(vty, " offset %f%s", trx->cfg.offset, VTY_NEWLINE);
- if (trx->cfg.rssi_offset != 0)
- vty_out(vty, " rssi-offset %f%s", trx->cfg.rssi_offset, VTY_NEWLINE);
+ if (!(trx->cfg.rssi_offset == 0 && !trx->cfg.force_rssi_offset))
+ vty_out(vty, " rssi-offset %f%s%s", trx->cfg.rssi_offset,
+ trx->cfg.force_rssi_offset ? " relative": "", VTY_NEWLINE);
vty_out(vty, " swap-channels %s%s", trx->cfg.swap_channels ? "enable" : "disable", VTY_NEWLINE);
vty_out(vty, " egprs %s%s", trx->cfg.egprs ? "enable" : "disable", VTY_NEWLINE);
vty_out(vty, " ext-rach %s%s", trx->cfg.ext_rach ? "enable" : "disable", VTY_NEWLINE);
@@ -716,6 +719,7 @@ struct trx_ctx *vty_trx_ctx_alloc(void *talloc_ctx)
trx->cfg.tx_sps = DEFAULT_TX_SPS;
trx->cfg.rx_sps = DEFAULT_RX_SPS;
trx->cfg.filler = FILLER_ZERO;
+ trx->cfg.rssi_offset = 0.0f;
return trx;
}