Change in osmo-ttcn3-hacks[master]: pcu: Introduce helpers to update AckNackDescription

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

pespin gerrit-no-reply at lists.osmocom.org
Thu Dec 5 13:42:56 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16502 )


Change subject: pcu: Introduce helpers to update AckNackDescription
......................................................................

pcu: Introduce helpers to update AckNackDescription

Change-Id: Ic62ab9e4a854239b95c434068543d95c5352f1c6
---
M pcu/PCU_Tests_RAW.ttcn
1 file changed, 42 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/02/16502/1

diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 7bfcbd0..12f1c8e 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -765,7 +765,7 @@
 	}
 }
 
-private function f_rx_rlcmac_dl_block_exp_data(out RlcmacDlBlock dl_block, out uint32_t ack_fn, octetstring data)
+private function f_rx_rlcmac_dl_block_exp_data(out RlcmacDlBlock dl_block, out uint32_t ack_fn, octetstring data, uint7_t exp_bsn := 0)
 runs on RAW_PCU_Test_CT {
 	var PCUIF_Message pcu_msg;
 	var uint32_t dl_fn;
@@ -780,6 +780,11 @@
 
 	ack_fn := dl_fn + f_rrbp_fn_delay(dl_block.data.mac_hdr.mac_hdr.rrbp);
 
+	if (dl_block.data.mac_hdr.hdr_ext.bsn != exp_bsn) {
+		setverdict(fail, "DL block BSN doesn't match: ",
+			   dl_block.data.blocks[0].hdr.length_ind, " vs exp ", exp_bsn);
+	}
+
 	if (lengthof(dl_block.data.blocks) < 1) {
 		setverdict(fail, "DL block has no LLC payload: ", dl_block);
 		mtc.stop;
@@ -1365,6 +1370,39 @@
 	f_rx_rlcmac_dl_block_exp_dummy(dl_block);
 }
 
+private function f_acknackdesc_init(inout AckNackDescription desc)
+{
+	desc.final_ack := '0'B;
+	desc.starting_seq_nr := 0;
+	desc.receive_block_bitmap := '0000000000000000000000000000000000000000000000000000000000000000'B;
+}
+
+/* TS 44.060 sec 12.3 Ack/Nack Description */
+private function f_acknackdesc_ack_block(inout AckNackDescription desc, uint7_t bsn, BIT1 final_ack := '0'B)
+{
+	var integer i;
+	var integer inc := bsn - desc.starting_seq_nr + 1;
+	/* Filling hole? */
+	if (bsn < desc.starting_seq_nr) {
+		desc.receive_block_bitmap[lengthof(desc.receive_block_bitmap) - (desc.starting_seq_nr - bsn)] := int2bit(1, 1);
+		return;
+	}
+
+	/* SSN is increased, and so RBB values need to be moved */
+	for (i := 0; i < lengthof(desc.receive_block_bitmap) - inc; i := i+1) {
+		desc.receive_block_bitmap[i] := desc.receive_block_bitmap[i + inc];
+	}
+	for (i := lengthof(desc.receive_block_bitmap) - inc; i < lengthof(desc.receive_block_bitmap) - 1; i := i+1) {
+		desc.receive_block_bitmap[i] := int2bit(0, 1);
+	}
+	/* Now we can set current bit and update SSN */
+	desc.starting_seq_nr := bsn + 1;
+	desc.receive_block_bitmap[lengthof(desc.receive_block_bitmap) - 1] := int2bit(1, 1);
+
+	/* Finally update the final_ack bit as requested: */
+	desc.final_ack := final_ack;
+}
+
 /* Test scenario where MS wants to send some data on PDCH against SGSN and it is
  * answered, so TBFs for uplink and later for downlink are created.
  */
@@ -1380,10 +1418,7 @@
 	var OCT4 tlli := '00000001'O;
 	var AckNackDescription ack_nack_desc;
 
-	ack_nack_desc.final_ack := '0'B;
-	ack_nack_desc.starting_seq_nr := 0;
-	ack_nack_desc.receive_block_bitmap := '0000000000000000000000000000000000000000000000000000000000000000'B;
-
+	f_acknackdesc_init(ack_nack_desc);
 
 	/* Initialize NS/BSSGP side */
 	f_init_bssgp();
@@ -1428,9 +1463,10 @@
 
 	/* Wait timer X2002 and DL block is available after CCCH IMM ASS: */
 	f_sleep(X2002);
-	f_rx_rlcmac_dl_block_exp_data(dl_block, sched_fn, data);
+	f_rx_rlcmac_dl_block_exp_data(dl_block, sched_fn, data, 0);
 
 	/* ACK the DL block */
+	f_acknackdesc_ack_block(ack_nack_desc, dl_block.data.mac_hdr.hdr_ext.bsn, '1'B)
 	f_tx_rlcmac_ul_block(ts_RLCMAC_DL_ACK_NACK(dl_block.data.mac_hdr.hdr_ext.tfi, ack_nack_desc), 0, sched_fn);
 
 	f_sleep(3.0);

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic62ab9e4a854239b95c434068543d95c5352f1c6
Gerrit-Change-Number: 16502
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191205/9d42158d/attachment.htm>


More information about the gerrit-log mailing list