From 9649a42d5a3c24a21c14bb9f54e7c34a398da7b1 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 7 Jul 2019 19:58:48 +0700 Subject: Clarify and refactor link quality (C/I) handling The radio link quality is defined by C/I (Carrier-to-Interference ratio), which is computed from the training sequence of each received burst, by comparing the "ideal" training sequence with the actual (received) one. Link quality measurements are used by L1SAP to filter out "ghost" Access Bursts, and by the link quality adaptation algorithms. One can define minimum link quality values using the VTY interface. On the VTY interface we expect integer C/I values in centiBels (cB, 10e-2 B), while the internal structures are using float values in deciBels (dB, 10e-1 B). Some PHYs (sysmo, octphy, oc2g, and litecell15) expose C/I measurements in deciBels, while on the L1SAP interface we finally send then in centiBels. Let's avoid this confusion and stick to a single format, that will be used by the internal logic of OsmoBTS - integer values (int16_t) in centiBels. This will give us the range of: -32768 .. 32767 centiBels, or -3276.8 .. 3276.7 deciBels, which is certainly sufficient. Change-Id: If624d6fdc0270e6813af8700d95f1345903c8a01 --- src/common/vty.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/common/vty.c') diff --git a/src/common/vty.c b/src/common/vty.c index f4fc1815..e4f5a16c 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -300,9 +300,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) sapi_buf = osmo_str_tolower(get_value_string(gsmtap_sapi_names, GSMTAP_CHANNEL_ACCH)); vty_out(vty, " gsmtap-sapi %s%s", sapi_buf, VTY_NEWLINE); } - vty_out(vty, " min-qual-rach %.0f%s", bts->min_qual_rach * 10.0f, + vty_out(vty, " min-qual-rach %d%s", bts->min_qual_rach, VTY_NEWLINE); - vty_out(vty, " min-qual-norm %.0f%s", bts->min_qual_norm * 10.0f, + vty_out(vty, " min-qual-norm %d%s", bts->min_qual_norm, VTY_NEWLINE); vty_out(vty, " max-ber10k-rach %u%s", bts->max_ber10k_rach, VTY_NEWLINE); @@ -618,24 +618,24 @@ DEFUN(cfg_bts_ul_power_target, cfg_bts_ul_power_target_cmd, DEFUN(cfg_bts_min_qual_rach, cfg_bts_min_qual_rach_cmd, "min-qual-rach <-100-100>", - "Set the minimum quality level of RACH burst to be accpeted\n" - "C/I level in tenth of dB\n") + "Set the minimum link quality level of Access Bursts to be accepted\n" + "C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)\n") { struct gsm_bts *bts = vty->index; - bts->min_qual_rach = strtof(argv[0], NULL) / 10.0f; + bts->min_qual_rach = atoi(argv[0]); return CMD_SUCCESS; } DEFUN(cfg_bts_min_qual_norm, cfg_bts_min_qual_norm_cmd, "min-qual-norm <-100-100>", - "Set the minimum quality level of normal burst to be accpeted\n" - "C/I level in tenth of dB\n") + "Set the minimum link quality level of Normal Bursts to be accepted\n" + "C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)\n") { struct gsm_bts *bts = vty->index; - bts->min_qual_norm = strtof(argv[0], NULL) / 10.0f; + bts->min_qual_norm = atoi(argv[0]); return CMD_SUCCESS; } -- cgit v1.2.3