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

Max gerrit-no-reply at lists.osmocom.org
Wed Mar 27 12:32:06 UTC 2019


Max has submitted this change and it was merged. ( 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, 21 insertions(+), 20 deletions(-)

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



diff --git a/src/encoding.cpp b/src/encoding.cpp
index b0d0467..769e049 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -257,30 +257,30 @@
 }
 
 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, mcs_chan_code(tbf->current_cs()), 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, mcs_chan_code(tbf->current_cs()), 2, false); /* CHANNEL_CODING_COMMAND */
+	CHECK(rc);
+
+	/* TLLI_BLOCK_CHANNEL_CODING */
+	SET_1(dest); /* use coding scheme as specified by the corresponding CHANNEL CODING COMMAND */
+
+	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 +520,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: merged
Gerrit-Change-Id: Ibe294b26ac374b9264a734db9663cacc105a4474
Gerrit-Change-Number: 12961
Gerrit-PatchSet: 11
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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190327/c8330bfc/attachment.html>


More information about the gerrit-log mailing list