Change in osmo-bts[master]: l1sap: fix TDMA frame number arithmetic in fn_ms_adj()

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Thu Jun 10 21:50:48 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/24601 )

Change subject: l1sap: fix TDMA frame number arithmetic in fn_ms_adj()
......................................................................

l1sap: fix TDMA frame number arithmetic in fn_ms_adj()

Using the normal arithmetic for TDMA frame numbers is wrong.

Change-Id: Ie17670d150489014a4a2e140cede42086100bbc0
---
M src/common/l1sap.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index cd2af57..0debae0 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -139,7 +139,8 @@
 		/* 12/13 frames usable for audio in TCH,
 		   160 samples per RTP packet,
 		   1 RTP packet per 4 frames */
-		samples_passed = (fn - lchan->tch.last_fn) * 12 * 160 / (13 * 4);
+		const uint32_t num_fn = GSM_TDMA_FN_SUB(fn, lchan->tch.last_fn);
+		samples_passed = num_fn * 12 * 160 / (13 * 4);
 		/* round number of samples to the nearest multiple of
 		   GSM_RTP_DURATION */
 		r = samples_passed + GSM_RTP_DURATION / 2;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24601
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie17670d150489014a4a2e140cede42086100bbc0
Gerrit-Change-Number: 24601
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210610/abb91647/attachment.htm>


More information about the gerrit-log mailing list