From 22704a88e2caa28a231d6f4f4fbb6181fab48e93 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 19 Apr 2017 15:46:11 +0200 Subject: measurement/cosmetic: Fixup source code comment the function ber10k_to_rxqual() has only a very brief comment with the spec reference. This commit adds a more explainatory comment that makes it easier to understand from where the ber10k constants are taken. Change-Id: I3d3488c97d0bffa7d449d3675afcc75b2a6a2703 --- src/common/measurement.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/common/measurement.c') diff --git a/src/common/measurement.c b/src/common/measurement.c index 6a118880..0814bf10 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -114,7 +114,20 @@ int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm) /* input: BER in steps of .01%, i.e. percent/100 */ static uint8_t ber10k_to_rxqual(uint32_t ber10k) { - /* 05.08 / 8.2.4 */ + /* Eight levels of Rx quality are defined and are mapped to the + * equivalent BER before channel decoding, as per in 3GPP TS 45.008, + * secton 8.2.4. + * + * RxQual: BER Range: + * RXQUAL_0 BER < 0,2 % Assumed value = 0,14 % + * RXQUAL_1 0,2 % < BER < 0,4 % Assumed value = 0,28 % + * RXQUAL_2 0,4 % < BER < 0,8 % Assumed value = 0,57 % + * RXQUAL_3 0,8 % < BER < 1,6 % Assumed value = 1,13 % + * RXQUAL_4 1,6 % < BER < 3,2 % Assumed value = 2,26 % + * RXQUAL_5 3,2 % < BER < 6,4 % Assumed value = 4,53 % + * RXQUAL_6 6,4 % < BER < 12,8 % Assumed value = 9,05 % + * RXQUAL_7 12,8 % < BER Assumed value = 18,10 % */ + if (ber10k < 20) return 0; if (ber10k < 40) -- cgit v1.2.3