pcu: Split f_ms_tx_ul_data_block() into helper functions
This allows shrinking some tests which wish to send specificaly crafter
LlcBlocks (since the way LlcBlocks are created for f_ms_tx_ul_data_block
only allows sending data related to the same upper LLC PDU)
Change-Id: I81176fa5c7caa2535bcc97eec26833579933ed7a
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index 64a39dd..491a496 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -669,6 +669,45 @@
f_ms_tx_data_ind(ms, data, fn, nr := nr);
}
+function f_ms_tx_ul_data_blocks_gprs(inout GprsMS ms, template (value) LlcBlocks blocks,
+ uint4_t cv := 15, boolean with_tlli := false, uint32_t fn := 0,
+ template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum)
+runs on MS_BTS_IFACE_CT {
+ var template (value) RlcmacUlBlock ul_data;
+
+ ul_data := t_RLCMAC_UL_DATA(cs := ms.ul_tbf.tx_cs_mcs,
+ tfi := ms.ul_tbf.tfi,
+ cv := cv,
+ bsn := ms.ul_tbf.bsn,
+ blocks := blocks);
+ if (with_tlli) {
+ ul_data.data.mac_hdr.tlli_ind := true;
+ ul_data.data.tlli := ms.tlli;
+ }
+ f_ultbf_inc_bsn(ms.ul_tbf);
+ f_ms_tx_ul_block(ms, ul_data, fn, nr := nr);
+}
+
+function f_ms_tx_ul_data_blocks_egprs(inout GprsMS ms, template (value) EgprsLlcBlocks blocks,
+ uint4_t cv := 15, boolean with_tlli := false, uint32_t fn := 0,
+ template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum)
+runs on MS_BTS_IFACE_CT {
+ var template (value) RlcmacUlBlock ul_data;
+
+ ul_data := t_RLCMAC_UL_EGPRS_DATA(mcs := ms.ul_tbf.tx_cs_mcs,
+ tfi := ms.ul_tbf.tfi,
+ cv := cv,
+ bsn1 := ms.ul_tbf.bsn,
+ bsn2_offset := 0,
+ blocks := blocks);
+ if (with_tlli) {
+ ul_data.data_egprs.tlli_ind := true;
+ ul_data.data_egprs.tlli := ms.tlli;
+ }
+ f_ultbf_inc_bsn(ms.ul_tbf);
+ f_ms_tx_ul_block(ms, ul_data, fn, nr := nr);
+}
+
function f_ms_tx_ul_data_block(inout GprsMS ms, octetstring payload,
uint4_t cv := 15, boolean with_tlli := false, uint32_t fn := 0,
template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum)
@@ -676,29 +715,10 @@
var template (value) RlcmacUlBlock ul_data;
if (f_rlcmac_cs_mcs_is_mcs(ms.ul_tbf.tx_cs_mcs)) {
- ul_data := t_RLCMAC_UL_EGPRS_DATA(mcs := ms.ul_tbf.tx_cs_mcs,
- tfi := ms.ul_tbf.tfi,
- cv := cv,
- bsn1 := ms.ul_tbf.bsn,
- bsn2_offset := 0,
- blocks := {t_RLCMAC_LLCBLOCK_EGPRS(payload)})
- if (with_tlli) {
- ul_data.data_egprs.tlli_ind := true;
- ul_data.data_egprs.tlli := ms.tlli;
- }
+ f_ms_tx_ul_data_blocks_egprs(ms, {t_RLCMAC_LLCBLOCK_EGPRS(payload)}, cv, with_tlli, fn, nr)
} else {
- ul_data := t_RLCMAC_UL_DATA(cs := ms.ul_tbf.tx_cs_mcs,
- tfi := ms.ul_tbf.tfi,
- cv := cv,
- bsn := ms.ul_tbf.bsn,
- blocks := {t_RLCMAC_LLCBLOCK(payload)});
- if (with_tlli) {
- ul_data.data.mac_hdr.tlli_ind := true;
- ul_data.data.tlli := ms.tlli;
- }
+ f_ms_tx_ul_data_blocks_gprs(ms, {t_RLCMAC_LLCBLOCK(payload)}, cv, with_tlli, fn, nr);
}
- f_ultbf_inc_bsn(ms.ul_tbf);
- f_ms_tx_ul_block(ms, ul_data, fn, nr := nr);
}
/* Send random payload for last "num_blocks" blocks in Ul TBF (ending with CV=0). */
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index c360e97..82ecb57 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -3603,7 +3603,6 @@
var PCUIF_info_ind info_ind;
var RlcmacDlBlock dl_block;
var octetstring payload;
- var template (value) RlcmacUlBlock ul_data;
var template (value) LlcBlockHdr blk_hdr;
var template (value) LlcBlocks blocks;
var uint32_t sched_fn;
@@ -3644,14 +3643,7 @@
more := false, e := true);
blocks := { t_RLCMAC_LLCBLOCK(payload, blk_hdr) };
/* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */
- ul_data := t_RLCMAC_UL_DATA_TLLI(cs := ms.ul_tbf.tx_cs_mcs,
- tfi := ms.ul_tbf.tfi,
- cv := 15,
- bsn := ms.ul_tbf.bsn,
- blocks := blocks,
- tlli := ms.tlli);
- f_ultbf_inc_bsn(ms.ul_tbf);
- f_ms_tx_ul_block(ms, ul_data, f_next_pdch_block(sched_fn));
+ f_ms_tx_ul_data_blocks_gprs(ms, blocks, cv := 15, with_tlli := true, fn := sched_fn);
blocks_sent := blocks_sent + 1;
/* UL block should be received in SGSN */
@@ -3662,12 +3654,6 @@
tr_AckNackDescription(final_ack := '0'B)))
f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn, acknack_tmpl);
- ul_data := t_RLCMAC_UL_DATA(cs := ms.ul_tbf.tx_cs_mcs,
- tfi := ms.ul_tbf.tfi,
- cv := 15,
- bsn := ms.ul_tbf.bsn,
- blocks := blocks);
-
nr := f_ms_tx_TsTrxBtsNum(ms);
BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
sapi := PCU_IF_SAPI_PDTCH, fn := 0,
@@ -3683,9 +3669,7 @@
log("ACKING FN ", data_msg.raw.fn, " on FN ", ack_fn);
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), ack_fn);
}
- ul_data.data.mac_hdr.bsn := ms.ul_tbf.bsn;
- f_ms_tx_ul_block(ms, ul_data, 0);
- f_ultbf_inc_bsn(ms.ul_tbf);
+ f_ms_tx_ul_data_blocks_gprs(ms, blocks);
blocks_sent := blocks_sent + 1;
if (blocks_sent == target_bsn_set) {
@@ -3703,9 +3687,7 @@
tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH),
tr_RLCMAC_DL_DUMMY_CTRL)) -> value data_msg {
- ul_data.data.mac_hdr.bsn := ms.ul_tbf.bsn;
- f_ms_tx_ul_block(ms, ul_data, 0);
- f_ultbf_inc_bsn(ms.ul_tbf);
+ f_ms_tx_ul_data_blocks_gprs(ms, blocks);
blocks_sent := blocks_sent + 1;
if (blocks_sent == target_bsn_set) {