Change in osmo-pcu[master]: Rewrite 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 19 17:53:39 UTC 2019


Max has uploaded this change for review. ( https://gerrit.osmocom.org/12961


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

Rewrite 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 93d947f5e8a30acc9250c124bf9d5bb6a8863526.

Change-Id: Ibe294b26ac374b9264a734db9663cacc105a4474
Related: OS#3014
---
M src/encoding.cpp
1 file changed, 22 insertions(+), 20 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/61/12961/1

diff --git a/src/encoding.cpp b/src/encoding.cpp
index 3d88e47..c46ca2a 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -257,30 +257,31 @@
 }
 
 static int write_ia_rest_uplink_mba(const gprs_rlcmac_ul_tbf *tbf, bitvec *dest, uint8_t usf,
-				    uint8_t alpha, uint8_t gamma, unsigned& wp)
+				    uint8_t alpha, uint8_t gamma)
 {
 	int rc = 0;
 
-	bitvec_write_field(dest, &wp, 1, 1);    // Block Allocation: Not Single Block Allocation
-	bitvec_write_field(dest, &wp, tbf->tfi(), 5);  // TFI_ASSIGNMENT Temporary Flow Identity
-	bitvec_write_field(dest, &wp, 0, 1);    // POLLING
-	bitvec_write_field(dest, &wp, 0, 1);    // ALLOCATION_TYPE: dynamic
-	bitvec_write_field(dest, &wp, usf, 3);    // USF
-	bitvec_write_field(dest, &wp, 0, 1);    // USF_GRANULARITY
-	bitvec_write_field(dest, &wp, 0, 1);   // "0" power control: Not Present
-	bitvec_write_field(dest, &wp, tbf->current_cs().to_num() - 1, 2);    // CHANNEL_CODING_COMMAND
-	bitvec_write_field(dest, &wp, 1, 1);    // TLLI_BLOCK_CHANNEL_CODING
-	if (alpha) {
-		bitvec_write_field(dest, &wp, 0x1, 1);   // ALPHA = present
-		bitvec_write_field(dest, &wp, alpha, 4);   // ALPHA
-	} else
-		bitvec_write_field(dest, &wp, 0x0, 1);   // ALPHA = not present
+	SET_1(dest); /* Multi Block Allocation */
 
-	bitvec_write_field(dest, &wp, gamma, 5);   // GAMMA power control parameter
+	rc = write_tfi_usf(dest, tbf, usf);
+	CHECK(rc);
 
-	/* note: there is no choise for TAI and no starting time */
-	bitvec_write_field(dest, &wp, 0, 1);   // switch TIMING_ADVANCE_INDEX = off
-	bitvec_write_field(dest, &wp, 0, 1);    // TBF_STARTING_TIME_FLAG
+	/* 3GPP TS 44.060 Table 11.2.28.2 Channel Coding Indicator */
+	rc = bitvec_set_u64(dest, tbf->current_cs().to_num() - 1, 2, false); /* CHANNEL_CODING_COMMAND */
+	CHECK(rc);
+
+	/* TLLI_BLOCK_CHANNEL_CODING */
+	rc = bitvec_set_bit(dest, (bit_value)tbf->tlli());
+	CHECK(rc);
+
+	rc = write_alpha_gamma(dest, alpha, gamma);
+	CHECK(rc);
+
+	 /* No TIMING_ADVANCE_INDEX */
+	SET_0(dest);
+
+	 /* No TBF_STARTING_TIME */
+	SET_0(dest);
 
 	return rc;
 }
@@ -520,7 +521,8 @@
 		bitvec_write_field(dest, &wp, 0, 2);    // "0" Packet Uplink Assignment
 
 		if (as_ul_tbf(tbf) != NULL) {
-			rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, usf, alpha, gamma, wp);
+			dest->cur_bit = wp;
+			rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, usf, alpha, gamma);
 		} else {
 			rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma, ta_idx, wp);
 		}

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe294b26ac374b9264a734db9663cacc105a4474
Gerrit-Change-Number: 12961
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190219/29ec7c92/attachment.htm>


More information about the gerrit-log mailing list