pespin submitted this change.
Move function to calculate next PDTCH block FN to library
It will be used in a follow-up patch to validate RTS.req in BTS_Tests
testsuite.
Take the chance to rename the function since it actually calculates
PDTCH blocks.
Change-Id: I49289029c89367c8c6a5db7fafda099748ec15b6
---
M library/GSM_Types.ttcn
M pcu/GPRS_Components.ttcn
M pcu/PCU_Tests.ttcn
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn
index 6d3e170..8333e58 100644
--- a/library/GSM_Types.ttcn
+++ b/library/GSM_Types.ttcn
@@ -535,5 +535,16 @@
/* TS 24.008 10.5.1.1 */
type uint16_t CellIdentity;
+/* 3GPP TS 45.002 Table 6 */
+private function fn2bn(GsmFrameNumber fn) return uint32_t {
+ return (fn mod 52) / 4;
+}
+function f_next_pdtch_block(GsmFrameNumber fn) return GsmFrameNumber
+{
+ var uint32_t bn := fn2bn(fn) + 1;
+ fn := fn - (fn mod 52);
+ fn := fn + bn * 4 + bn / 3;
+ return fn mod GsmMaxFrameNumber;
+}
} with { encode "RAW"; variant "FIELDORDER(msb)" }
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index c48497a..50b552d 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -242,17 +242,6 @@
return 51 * ((st.t3 - st.t2) mod 26) + st.t3 + 51 * 26 * st.t1;
}
-function fn2bn(GsmFrameNumber fn) return uint32_t {
- return (fn mod 52) / 4;
-}
-function f_next_pdch_block(GsmFrameNumber fn) return GsmFrameNumber
-{
- var uint32_t bn := fn2bn(fn) + 1;
- fn := fn - (fn mod 52);
- fn := fn + bn * 4 + bn / 3;
- return fn mod GsmMaxFrameNumber;
-}
-
function f_ultbf_new_from_rr_imm_ass(in GsmRrMessage rr_imm_ass)
runs on MS_BTS_IFACE_CT return UlTbf {
var UlTbf ul_tbf := valueof(t_UlTbf_def);
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 23709dc..98fbbf6 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1433,7 +1433,7 @@
if (rx_usf == ms.ul_tbf.usf[valueof(nr.ts_nr)]) {
/* PCU requests our USF, transmit WITHOUT tlli to avoid contention resolution success */
ul_tbf_usf_req := true;
- f_ms_tx_ul_data_block(ms, f_rnd_octstring(10), cv := 15, with_tlli := false, fn := f_next_pdch_block(data_msg.raw.fn))
+ f_ms_tx_ul_data_block(ms, f_rnd_octstring(10), cv := 15, with_tlli := false, fn := f_next_pdtch_block(data_msg.raw.fn))
} else if (rx_usf == USF_UNUSED) {
if (data_msg.raw.fn >= ms.ul_tbf.start_time_fn) {
if (ul_tbf_usf_req) {
@@ -2240,7 +2240,7 @@
/* Wait until PCU starts requesting for UL block on this TBF: */
dl_fn := f_ms_wait_usf(ms, nr := f_ms_tx_TsTrxBtsNum(ms));
- sched_fn := f_next_pdch_block(dl_fn);
+ sched_fn := f_next_pdtch_block(dl_fn);
/* Send one UL block (with TLLI since we are in One-Phase Access
* contention resolution) and make sure it is ACKED fine. */
@@ -3448,7 +3448,7 @@
/* Wait until PCU starts requesting for UL block on this TBF: */
dl_fn := f_ms_wait_usf(ms, nr := f_ms_tx_TsTrxBtsNum(ms));
- sched_fn := f_next_pdch_block(dl_fn);
+ sched_fn := f_next_pdtch_block(dl_fn);
/* Send one UL block (with TLLI since we are in One-Phase Access
contention resolution) and make sure it is ACKED fine */
@@ -3514,7 +3514,7 @@
/* Wait until PCU starts requesting for UL block on this TBF: */
dl_fn := f_ms_wait_usf(ms, nr := f_ms_tx_TsTrxBtsNum(ms));
- sched_fn := f_next_pdch_block(dl_fn);
+ sched_fn := f_next_pdtch_block(dl_fn);
/* Send one UL block (with TLLI since we are in One-Phase Access
* contention resolution) and make sure it is ACKED fine. */
@@ -3929,7 +3929,7 @@
/* Wait until PCU starts requesting for UL block on this TBF: */
dl_fn := f_ms_wait_usf(ms);
- sched_fn := f_next_pdch_block(dl_fn);
+ sched_fn := f_next_pdtch_block(dl_fn);
/* Send one UL block (with TLLI since we are in One-Phase Access
contention resolution) and make sure it is ACKED fine. */
@@ -4459,7 +4459,7 @@
contention resolution) and make sure it is ACKED fine. */
payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, true));
dl_fn := f_rx_rlcmac_dl_block_exp_dummy(dl_block);
- f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdch_block(dl_fn));
+ f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdtch_block(dl_fn));
f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn);
payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, false));
@@ -4528,7 +4528,7 @@
contention resolution) and make sure it is ACKED fine. */
payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, true));
dl_fn := f_rx_rlcmac_dl_block_exp_dummy(dl_block);
- f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdch_block(dl_fn));
+ f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdtch_block(dl_fn));
f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn);
payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, false));
@@ -4554,7 +4554,7 @@
/* Send one UL block (with TLLI since we are in One-Phase Access
* contention resolution) and make sure it is ACKED fine. */
payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, true));
- f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdch_block(dl_fn));
+ f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdtch_block(dl_fn));
/* UL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */
f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn);
@@ -4608,7 +4608,7 @@
contention resolution) and make sure it is ACKED fine. */
payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, true));
dl_fn := f_rx_rlcmac_dl_block_exp_dummy(dl_block);
- f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdch_block(dl_fn));
+ f_ms_tx_ul_data_block(ms, payload, cv := 1, with_tlli := true, fn := f_next_pdtch_block(dl_fn));
f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn);
payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, false));
To view, visit change 41780. To unsubscribe, or for help writing mail filters, visit settings.