summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-29 21:27:43 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-10-29 21:27:43 +0100
commit86f3d798cc314eed9a57c884fc7ebbdb90f453fb (patch)
treea0e3124ad8662682bb47d9e7d5ce4ac9de592718
parenta32a7e993c255ad06dfca255d02285d4a42acb38 (diff)
WIP: Use altsteppespin/foo
-rw-r--r--pcu/GPRS_Components.ttcn73
-rw-r--r--pcu/PCU_Tests.ttcn12
2 files changed, 53 insertions, 32 deletions
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index 49d076a..be3562e 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -487,37 +487,58 @@ runs on MS_BTS_IFACE_CT {
function f_ms_rx_pkt_ass_pacch(inout GprsMS ms, out uint32_t poll_fn,
template RlcmacDlBlock t_pkt_ass := ?,
template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum)
-runs on MS_BTS_IFACE_CT return RlcmacDlBlock {
- var RlcmacDlBlock dl_block;
- var uint32_t dl_fn;
+runs on MS_BTS_IFACE_CT {
+ BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
+ sapi := PCU_IF_SAPI_PDTCH, fn := 0,
+ arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), block_nr := nr.blk_nr));
+ as_ms_rx_pkt_ass_pacch(ms, poll_fn, t_pkt_ass, nr);
+}
- f_rx_rlcmac_dl_block(dl_block, dl_fn, nr := nr);
- if (not match(dl_block, t_pkt_ass)) {
- setverdict(fail, "Failed to match Packet Assignment:", t_pkt_ass);
- f_shutdown(__BFILE__, __LINE__);
- }
+altstep as_ms_rx_pkt_ass_pacch(inout GprsMS ms, out uint32_t poll_fn,
+ template RlcmacDlBlock t_pkt_ass := ?,
+ template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum,
+ boolean ignore_dummy := true)
+runs on MS_BTS_IFACE_CT {
+ var PCUIF_Message pcu_msg;
+ [] BTS.receive(tr_PCUIF_DATA_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
+ sapi := PCU_IF_SAPI_PDTCH)) -> value pcu_msg {
+ var RlcmacDlBlock dl_block;
+ var uint32_t dl_fn;
+ dl_block := dec_RlcmacDlBlock(pcu_msg.u.data_req.data);
+ if (ignore_dummy and match(dl_block, tr_RLCMAC_DUMMY_CTRL())) {
+ /* TODO: sleep? */
+ BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
+ sapi := PCU_IF_SAPI_PDTCH, fn := 0,
+ arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), block_nr := nr.blk_nr));
+ repeat;
+ }
- poll_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp);
-
- if (match(dl_block, tr_RLCMAC_UL_PACKET_ASS)) {
- ms.ul_tbf := f_ultbf_new_from_ass_pacch(dl_block);
- if (ms.ul_tbf.ass.pacch.identity.tlli.tlli != ms.tlli) {
- setverdict(fail, "Wrong TLLI ", ms.ul_tbf.ass.pacch.identity.tlli, " received vs exp ", ms.tlli);
- f_shutdown(__BFILE__, __LINE__);
- }
- } else if (match(dl_block, tr_RLCMAC_DL_PACKET_ASS)) {
- ms.dl_tbf := f_dltbf_new_from_ass_pacch(dl_block);
- if (ischosen(ms.dl_tbf.ass.pacch.tfi_or_tlli.tlli) and
- ms.dl_tbf.ass.pacch.tfi_or_tlli.tlli.tlli != ms.tlli) {
- setverdict(fail, "Wrong TLLI ", ms.dl_tbf.ass.pacch.tfi_or_tlli.tlli.tlli, " received vs exp ", ms.tlli);
+ if (not match(dl_block, t_pkt_ass)) {
+ setverdict(fail, "Failed to match Packet Assignment:", t_pkt_ass);
f_shutdown(__BFILE__, __LINE__);
}
- } else {
- setverdict(fail, "Should not happen:", dl_block);
- f_shutdown(__BFILE__, __LINE__);
- }
- return dl_block;
+ dl_fn := pcu_msg.u.data_req.fn;
+ poll_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp);
+
+ if (match(dl_block, tr_RLCMAC_UL_PACKET_ASS)) {
+ ms.ul_tbf := f_ultbf_new_from_ass_pacch(dl_block);
+ if (ms.ul_tbf.ass.pacch.identity.tlli.tlli != ms.tlli) {
+ setverdict(fail, "Wrong TLLI ", ms.ul_tbf.ass.pacch.identity.tlli, " received vs exp ", ms.tlli);
+ f_shutdown(__BFILE__, __LINE__);
+ }
+ } else if (match(dl_block, tr_RLCMAC_DL_PACKET_ASS)) {
+ ms.dl_tbf := f_dltbf_new_from_ass_pacch(dl_block);
+ if (ischosen(ms.dl_tbf.ass.pacch.tfi_or_tlli.tlli) and
+ ms.dl_tbf.ass.pacch.tfi_or_tlli.tlli.tlli != ms.tlli) {
+ setverdict(fail, "Wrong TLLI ", ms.dl_tbf.ass.pacch.tfi_or_tlli.tlli.tlli, " received vs exp ", ms.tlli);
+ f_shutdown(__BFILE__, __LINE__);
+ }
+ } else {
+ setverdict(fail, "Should not happen:", dl_block);
+ f_shutdown(__BFILE__, __LINE__);
+ }
+ }
}
function f_ms_establish_ul_tbf(inout GprsMS ms, template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum)
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index e09bd0d..b23b9be 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1703,7 +1703,7 @@ testcase TC_dl_multislot_tbf_ms_class_from_sgsn() runs on RAW_PCU_Test_CT {
};
var MSRadioAccessCapabilityV_BSSGP ms_racap := { valueof(ts_RaCapRec_BSSGP('0001'B /* E-GSM */, mscap_gprs, omit)) };
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, ms_racap));
- dl_block := f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms));
+ f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms));
if (f_dltbf_num_slots(ms.dl_tbf) != 8) {
setverdict(fail, "Expected 8 PDCH slot allocated but got ", f_dltbf_num_slots(ms.dl_tbf));
f_shutdown(__BFILE__, __LINE__);
@@ -1754,7 +1754,7 @@ testcase TC_dl_multislot_tbf_ms_class_from_2phase() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts);
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data));
- dl_block := f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms));
+ f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms));
if (f_dltbf_num_slots(ms.dl_tbf) != 8) {
setverdict(fail, "Expected 8 PDCH slot allocated but got ", f_dltbf_num_slots(ms.dl_tbf));
f_shutdown(__BFILE__, __LINE__);
@@ -2530,8 +2530,8 @@ testcase TC_pcuif_fh_pkt_ass_ul() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, omit)));
/* Expect an RLC/MAC block with Packet Uplink Assignment on PACCH (see 11.2.29) */
- var RlcmacDlBlock blk := f_ms_rx_pkt_ass_pacch(ms, poll_fn, tr_RLCMAC_UL_PACKET_ASS);
- var PacketUlAssignment ua := blk.ctrl.payload.u.ul_assignment;
+ f_ms_rx_pkt_ass_pacch(ms, poll_fn, tr_RLCMAC_UL_PACKET_ASS);
+ var PacketUlAssignment ua := ms.ul_tbf.ass.pacch;
/* 3GPP TS 44.060, section 12.8 "Frequency Parameters" */
var template (omit) FrequencyParameters fp;
@@ -2586,8 +2586,8 @@ testcase TC_pcuif_fh_pkt_ass_dl() runs on RAW_PCU_Test_CT {
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data));
/* Expect an RLC/MAC block with Packet Downlink Assignment on PACCH (see 11.2.29) */
- dl_block := f_ms_rx_pkt_ass_pacch(ms, poll_fn, tr_RLCMAC_DL_PACKET_ASS);
- var PacketDlAssignment da := dl_block.ctrl.payload.u.dl_assignment;
+ f_ms_rx_pkt_ass_pacch(ms, poll_fn, tr_RLCMAC_DL_PACKET_ASS);
+ var PacketDlAssignment da := ms.dl_tbf.ass.pacch;
/* This is an optional IE, so it's worth to check its presence */
if (not ispresent(da.freq_par)) {