Change in osmo-bts[master]: scheduler_trx: use stored block fn instead of calculating it.

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
Fri Feb 1 17:27:46 UTC 2019


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/12779


Change subject: scheduler_trx: use stored block fn instead of calculating it.
......................................................................

scheduler_trx: use stored block fn instead of calculating it.

When the block is passed up into the higher layers it it marked with the
frame number that points to the beginning of the block. At the moment
some strange calculations are used to calculate the beginning of the
block fn from the current fn that points at the end of the block:

PDTCH: fn != (fn + GSM_HYPERFRAME - 3) % GSM_HYPERFRAME
FACCH/F: fn != (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME
TCH/F: fn != (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME

Despite the fact that those equations do not look very trustworthy, it
is also not necessary to calculate the fn since the code stores the fn
of each beginning of a new block in chan_state->ul_first_fn (*first_fn),
so we can just use the stored fn when passing the block up. This also
makes the code more logical since the measurement indications already
use the stored frame number as well.

Change-Id: Ia27254bbf6e36426f7890ece6154dcd395673f63
Related: OS#2977
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 10 insertions(+), 14 deletions(-)



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

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index fa3aed2..30ef674 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -946,9 +946,9 @@
 		return 0;
 	}
 	ber10k = compute_ber10k(n_bits_total, n_errors);
-	return _sched_compose_ph_data_ind(l1t, tn, (fn + GSM_HYPERFRAME - 3) % GSM_HYPERFRAME, chan,
-		l2, rc, *rssi_sum / *rssi_num, 4 * (*toa256_sum) / *toa_num, 0,
-					  ber10k, PRES_INFO_BOTH);
+	return _sched_compose_ph_data_ind(l1t, tn, *first_fn, chan, l2, rc,
+		*rssi_sum / *rssi_num, 4 * (*toa256_sum) / *toa_num, 0, ber10k,
+		PRES_INFO_BOTH);
 }
 
 /*! \brief a single TCH/F burst was received by the PHY, process it */
@@ -1070,9 +1070,8 @@
 	/* FACCH */
 	if (rc == GSM_MACBLOCK_LEN) {
 		uint16_t ber10k = compute_ber10k(n_bits_total, n_errors);
-		_sched_compose_ph_data_ind(l1t, tn, (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME, chan,
-			tch_data + amr, GSM_MACBLOCK_LEN, rssi, 4 * toa256, 0,
-					   ber10k, PRES_INFO_UNKNOWN);
+		_sched_compose_ph_data_ind(l1t, tn, *first_fn, chan, tch_data + amr,
+			GSM_MACBLOCK_LEN, rssi, 4 * toa256, 0, ber10k, PRES_INFO_UNKNOWN);
 bfi:
 		if (rsl_cmode == RSL_CMOD_SPD_SPEECH) {
 			/* indicate bad frame */
@@ -1124,7 +1123,7 @@
 
 	/* TCH or BFI */
 compose_l1sap:
-	return _sched_compose_tch_ind(l1t, tn, (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME, chan,
+	return _sched_compose_tch_ind(l1t, tn, *first_fn, chan,
 		tch_data, rc);
 }
 
@@ -1261,10 +1260,8 @@
 	if (rc == GSM_MACBLOCK_LEN) {
 		chan_state->ul_ongoing_facch = 1;
 		uint16_t ber10k = compute_ber10k(n_bits_total, n_errors);
-		_sched_compose_ph_data_ind(l1t, tn,
-			(fn + GSM_HYPERFRAME - 10 - ((fn % 26) >= 19)) % GSM_HYPERFRAME, chan,
-			tch_data + amr, GSM_MACBLOCK_LEN, rssi, toa256/64, 0,
-					   ber10k, PRES_INFO_UNKNOWN);
+		_sched_compose_ph_data_ind(l1t, tn, *first_fn, chan, tch_data + amr,
+			GSM_MACBLOCK_LEN, rssi, toa256/64, 0, ber10k, PRES_INFO_UNKNOWN);
 bfi:
 		if (rsl_cmode == RSL_CMOD_SPD_SPEECH) {
 			/* indicate bad frame */
@@ -1306,9 +1303,8 @@
 	 * with the slot 12, so an extra FN must be subtracted to get correct
 	 * start of frame.
 	 */
-	return _sched_compose_tch_ind(l1t, tn,
-		(fn + GSM_HYPERFRAME - 10 - ((fn%26)==19) - ((fn%26)==20)) % GSM_HYPERFRAME,
-		chan, tch_data, rc);
+	printf("TCHH\n");
+	return _sched_compose_tch_ind(l1t, tn, *first_fn, chan, tch_data, rc);
 }
 
 /* schedule all frames of all TRX for given FN */

-- 
To view, visit https://gerrit.osmocom.org/12779
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia27254bbf6e36426f7890ece6154dcd395673f63
Gerrit-Change-Number: 12779
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190201/df36aecc/attachment.htm>


More information about the gerrit-log mailing list