Change in osmo-pcu[master]: Rewrite EGPRS Packet Uplink IA Rest Octets for MBA

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

Max gerrit-no-reply at lists.osmocom.org
Tue Feb 26 09:17:10 UTC 2019


Max has submitted this change and it was merged. ( https://gerrit.osmocom.org/12952 )

Change subject: Rewrite EGPRS Packet Uplink IA Rest Octets for MBA
......................................................................

Rewrite EGPRS Packet Uplink IA Rest Octets for MBA

Use bitvec_set_*() directly without external write pointer tracking to
simplify the code. This is part of IA Rest Octets (3GPP TS 44.018
§10.5.2.16) which is the last part of the message so it should not
interfere with the rest of encoding functions.

That's partially based on reverted commit 529ce885450946d85d1920fb3d1a994c3efe5849.

Change-Id: I19cc4226e7e831e7d7f70212b2078f5589a87ff0
Related: OS#3014
---
M src/encoding.cpp
1 file changed, 11 insertions(+), 15 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/encoding.cpp b/src/encoding.cpp
index e7e13ac..ba0e474 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -258,26 +258,21 @@
 	return rc;
 }
 
-static int write_ia_rest_egprs_uplink_mba(bitvec * dest, uint32_t fn, uint8_t alpha, uint8_t gamma, unsigned& wp)
+static int write_ia_rest_egprs_uplink_mba(bitvec * dest, uint32_t fn, uint8_t alpha, uint8_t gamma)
 {
 	int rc = 0;
 
-	bitvec_write_field(dest, &wp, 0, 1); /* multiblock allocation */
+	SET_0(dest); /* Multi Block Allocation */
 
-	if (alpha) {
-		bitvec_write_field(dest, &wp, 0x1, 1); /* ALPHA =yes */
-		bitvec_write_field(dest, &wp, alpha, 4); /* ALPHA */
-	} else {
-		bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = no */
-	}
+	rc = write_alpha_gamma(dest, alpha, gamma);
+	CHECK(rc);
 
-	bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power contrl */
-	bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5);/* T1' */
-	bitvec_write_field(dest, &wp, fn % 51, 6);              /* T3 */
-	bitvec_write_field(dest, &wp, fn % 26, 5);              /* T2 */
-	bitvec_write_field(dest, &wp, 0, 2); /* Radio block allocation */
+	rc = write_tbf_start_time(dest, fn);
+	CHECK(rc);
 
-	bitvec_write_field(dest, &wp, 0, 1);
+	SET_0(dest); /* NUMBER OF RADIO BLOCKS ALLOCATED: */
+	SET_0(dest); /* 1 radio block reserved for uplink transmission */
+	SET_0(dest); /* No P0 */
 
 	return rc;
 }
@@ -483,7 +478,8 @@
 		if (as_ul_tbf(tbf) != NULL) {
 			rc = write_ia_rest_egprs_uplink_sba(as_ul_tbf(tbf), dest, usf, alpha, gamma, wp);
 		} else {
-			rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, gamma, wp);
+			dest->cur_bit = wp;
+			rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, gamma);
 		}
 	} else {
 		OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled());

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I19cc4226e7e831e7d7f70212b2078f5589a87ff0
Gerrit-Change-Number: 12952
Gerrit-PatchSet: 6
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-CC: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190226/0807088c/attachment.htm>


More information about the gerrit-log mailing list