[PATCH] osmo-bts[master]: measurement.c

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Sep 22 12:35:57 UTC 2016


Review at  https://gerrit.osmocom.org/901

measurement.c

This was handed in by octasic. The particular purpose of this is
unclear to me. Please leave a comment on how to proceed with this.

Change-Id: Id362c52ff5482732a6ee5ce2d9c813f2b66201f9
---
M src/common/measurement.c
1 file changed, 6 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/901/1

diff --git a/src/common/measurement.c b/src/common/measurement.c
index be1d4f6..8c1012b 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -71,15 +71,11 @@
 		break;
 	case GSM_PCHAN_SDCCH8_SACCH8C:
 	case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:
-		fn_mod = fn % 102;
-		if (fn_mod == 11)
-			rc = 1;
+		rc = 1;
 		break;
 	case GSM_PCHAN_CCCH_SDCCH4:
 	case GSM_PCHAN_CCCH_SDCCH4_CBCH:
-		fn_mod = fn % 102;
-		if (fn_mod == 36)
-			rc = 1;
+		rc = 1;
 		break;
 	default:
 		rc = 0;
@@ -135,13 +131,6 @@
 static int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
 {
 	struct gsm_meas_rep_unidir *mru;
-	uint32_t ber_full_sum = 0;
-	uint32_t irssi_full_sum = 0;
-	uint32_t ber_sub_sum = 0;
-	uint32_t irssi_sub_sum = 0;
-	int32_t taqb_sum = 0;
-	unsigned int num_meas_sub = 0;
-	int i;
 
 	/* if measurement period is not complete, abort */
 	if (!is_meas_complete(lchan->ts->pchan, lchan->ts->nr,
@@ -152,45 +141,12 @@
 	if (lchan->meas.num_ul_meas == 0)
 		return 0;
 
-	/* compute the actual measurements */
-
-	/* step 1: add up */
-	for (i = 0; i < lchan->meas.num_ul_meas; i++) {
-		struct bts_ul_meas *m = &lchan->meas.uplink[i];
-
-		ber_full_sum += m->ber10k;
-		irssi_full_sum += m->inv_rssi;
-		taqb_sum += m->ta_offs_qbits;
-
-		if (m->is_sub) {
-			num_meas_sub++;
-			ber_sub_sum += m->ber10k;
-			irssi_sub_sum += m->inv_rssi;
-		}
-	}
-
-	/* step 2: divide */
-	ber_full_sum = ber_full_sum / lchan->meas.num_ul_meas;
-	irssi_full_sum = irssi_full_sum / lchan->meas.num_ul_meas;
-	taqb_sum = taqb_sum / lchan->meas.num_ul_meas;
-
-	if (num_meas_sub) {
-		ber_sub_sum = ber_sub_sum / num_meas_sub;
-		irssi_sub_sum = irssi_sub_sum / num_meas_sub;
-	}
-
-	DEBUGP(DMEAS, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), RSSI-FULL(-%3udBm), "
-		"BER-SUB(%2u.%02u%%), RSSI-SUB(-%3udBm)\n", gsm_lchan_name(lchan),
-		taqb_sum, ber_full_sum/100,
-		ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, ber_sub_sum%100,
-		irssi_sub_sum);
-
 	/* store results */
 	mru = &lchan->meas.ul_res;
-	mru->full.rx_lev = dbm2rxlev((int)irssi_full_sum * -1);
-	mru->sub.rx_lev = dbm2rxlev((int)irssi_sub_sum * -1);
-	mru->full.rx_qual = ber10k_to_rxqual(ber_full_sum);
-	mru->sub.rx_qual = ber10k_to_rxqual(ber_sub_sum);
+	mru->full.rx_lev = lchan->meas.uplink[0].inv_rssi;
+	mru->sub.rx_lev = lchan->meas.uplink[0].inv_rssi;
+	mru->full.rx_qual = (uint8_t)lchan->meas.uplink[0].ber10k;
+	mru->sub.rx_qual = (uint8_t)lchan->meas.uplink[0].ber10k;
 
 	lchan->meas.flags |= LC_UL_M_F_RES_VALID;
 	lchan->meas.num_ul_meas = 0;

-- 
To view, visit https://gerrit.osmocom.org/901
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id362c52ff5482732a6ee5ce2d9c813f2b66201f9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list