aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-07-07 19:58:48 +0700
committerlaforge <laforge@gnumonks.org>2019-07-21 13:51:57 +0000
commit9649a42d5a3c24a21c14bb9f54e7c34a398da7b1 (patch)
tree66363546279249833a49769a609a7989a4e9358f
parentdb6c7863506ea3685d73df26c45723073ee1f109 (diff)
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
-rw-r--r--doc/manuals/vty/bts_vty_reference.xml8
-rw-r--r--include/osmo-bts/gsm_data_shared.h4
-rw-r--r--src/common/bts.c4
-rw-r--r--src/common/l1sap.c2
-rw-r--r--src/common/pcu_sock.c4
-rw-r--r--src/common/vty.c16
-rw-r--r--src/osmo-bts-litecell15/l1_if.c2
-rw-r--r--src/osmo-bts-oc2g/l1_if.c2
-rw-r--r--src/osmo-bts-sysmo/l1_if.c2
9 files changed, 22 insertions, 22 deletions
diff --git a/doc/manuals/vty/bts_vty_reference.xml b/doc/manuals/vty/bts_vty_reference.xml
index b50ac1ba..4697ee79 100644
--- a/doc/manuals/vty/bts_vty_reference.xml
+++ b/doc/manuals/vty/bts_vty_reference.xml
@@ -1613,14 +1613,14 @@
</command>
<command id='min-qual-rach &lt;-100-100&gt;'>
<params>
- <param name='min-qual-rach' doc='Set the minimum quality level of RACH burst to be accpeted' />
- <param name='&lt;-100-100&gt;' doc='C/I level in tenth of dB' />
+ <param name='min-qual-rach' doc='Set the minimum link quality level of Access Bursts to be accepted' />
+ <param name='&lt;-100-100&gt;' doc='C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)' />
</params>
</command>
<command id='min-qual-norm &lt;-100-100&gt;'>
<params>
- <param name='min-qual-norm' doc='Set the minimum quality level of normal burst to be accpeted' />
- <param name='&lt;-100-100&gt;' doc='C/I level in tenth of dB' />
+ <param name='min-qual-norm' doc='Set the minimum link quality level of Normal Bursts to be accepted' />
+ <param name='&lt;-100-100&gt;' doc='C/I (Carrier-to-Interference) ratio in centiBels (10e-2 B or 10e-1 dB)' />
</params>
</command>
<command id='nominal-tx-power &lt;0-100&gt;'>
diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index a4e326ac..dd2a14c0 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -759,8 +759,8 @@ struct gsm_bts {
int smscb_queue_max_len; /* maximum queue length */
int smscb_queue_hyst; /* hysteresis for CBCH laod indications */
- float min_qual_rach; /* minimum quality for RACH bursts */
- float min_qual_norm; /* minimum quality for normal daata */
+ int16_t min_qual_rach; /* minimum link quality (in centiBels) for Access Bursts */
+ int16_t min_qual_norm; /* minimum link quality (in centiBels) for Normal Bursts */
uint16_t max_ber10k_rach; /* Maximum permitted RACH BER in 0.01% */
struct {
diff --git a/src/common/bts.c b/src/common/bts.c
index f582ebd1..5c415e86 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -51,8 +51,8 @@
#include <osmo-bts/dtx_dl_amr_fsm.h>
#include <osmo-bts/cbch.h>
-#define MIN_QUAL_RACH 5.0f /* at least 5 dB C/I */
-#define MIN_QUAL_NORM -0.5f /* at least -1 dB C/I */
+#define MIN_QUAL_RACH 50 /* minimum link quality (in centiBels) for Access Bursts */
+#define MIN_QUAL_NORM -5 /* minimum link quality (in centiBels) for Normal Bursts */
static void bts_update_agch_max_queue_length(struct gsm_bts *bts);
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index b730b853..79af8e21 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1218,7 +1218,7 @@ static int l1sap_tch_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap,
* the content is not available due to decoding issues. Content not
* available is expected as empty payload. We also check if quality is
* good enough. */
- if (msg->len && tch_ind->lqual_cb / 10 >= bts->min_qual_norm) {
+ if (msg->len && tch_ind->lqual_cb >= bts->min_qual_norm) {
/* hand msg to RTP code for transmission */
if (lchan->abis_ip.rtp_socket)
osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 1d9fa72f..36cc6edf 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -330,8 +330,8 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn,
LOGP(DPCU, LOGL_DEBUG, "Sending data indication: sapi=%s arfcn=%d block=%d data=%s\n",
sapi_string[sapi], arfcn, block_nr, osmo_hexdump(data, len));
- if (lqual / 10 < bts->min_qual_norm) {
- LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n",
+ if (lqual < bts->min_qual_norm) {
+ LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %d, dropping packet\n",
lqual, bts->min_qual_norm);
return 0;
}
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;
}
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 3710fa80..77b72bd0 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -1004,7 +1004,7 @@ static int handle_ph_ra_ind(struct lc15l1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind,
struct ph_rach_ind_param rach_ind_param;
/* FIXME: this should be deprecated/obsoleted as it bypasses rach.busy counting */
- if (ra_ind->measParam.fLinkQuality < bts->min_qual_rach) {
+ if (ra_ind->measParam.fLinkQuality * 10 < bts->min_qual_rach) {
msgb_free(l1p_msg);
return 0;
}
diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c
index d9c8da0d..9affc89b 100644
--- a/src/osmo-bts-oc2g/l1_if.c
+++ b/src/osmo-bts-oc2g/l1_if.c
@@ -1060,7 +1060,7 @@ static int handle_ph_ra_ind(struct oc2gl1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind,
struct ph_rach_ind_param rach_ind_param;
/* FIXME: this should be deprecated/obsoleted as it bypasses rach.busy counting */
- if (ra_ind->measParam.fLinkQuality < bts->min_qual_rach) {
+ if (ra_ind->measParam.fLinkQuality * 10 < bts->min_qual_rach) {
msgb_free(l1p_msg);
return 0;
}
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index c431e49e..58fc24ef 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -998,7 +998,7 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind,
struct ph_rach_ind_param rach_ind_param;
/* FIXME: this should be deprecated/obsoleted as it bypasses rach.busy counting */
- if (ra_ind->measParam.fLinkQuality < bts->min_qual_rach) {
+ if (ra_ind->measParam.fLinkQuality * 10 < bts->min_qual_rach) {
msgb_free(l1p_msg);
return 0;
}