Add initial support for Packet Uplink Ack/nack EGPRS Struct
Some stuff like EGPRS Ack/Nack description is still not implemented, but
it's enouh for now to be able to match against this kind of ACK blocks.
Change-Id: I8066fba0e71911f0c6344c1540a501f1853daa7f
diff --git a/library/RLCMAC_CSN1_Templates.ttcn b/library/RLCMAC_CSN1_Templates.ttcn
index 772df13..eebda7f 100644
--- a/library/RLCMAC_CSN1_Templates.ttcn
+++ b/library/RLCMAC_CSN1_Templates.ttcn
@@ -217,4 +217,32 @@
multi_block_alloc := omit
};
+ template UlAckNackGprs tr_UlAckNackGprs(template GprsTlli tlli := *) := {
+ ch_coding_cmd := ?,
+ ack_nack_desc := ?,
+ cont_res_tlli_present := ?,
+ cont_res_tlli := tlli,
+ pkt_ta_present := ?,
+ pkt_ta := *,
+ pwr_ctrl_present := ?,
+ pwr_ctrl := *
+ };
+
+ template UlAckNackEgprs tr_UlAckNackEgprs(template GprsTlli tlli := *) := {
+ ch_coding_cmd := ?,
+ resegment := ?,
+ preemptive_tx := ?,
+ prr_retrans_req := ?,
+ arac_retrans_req := ?,
+ cont_res_tlli_present := ?,
+ cont_res_tlli := tlli,
+ tbf_est := ?,
+ pkt_ta_present := ?,
+ pkt_ta := *,
+ pkt_ext_ta_present := ?,
+ pkt_ext_ta := *,
+ pwr_ctrl_present := ?,
+ pwr_ctrl := *
+ };
+
} with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" };
diff --git a/library/RLCMAC_CSN1_Types.ttcn b/library/RLCMAC_CSN1_Types.ttcn
index d4c6efd..1f1fb0a 100644
--- a/library/RLCMAC_CSN1_Types.ttcn
+++ b/library/RLCMAC_CSN1_Types.ttcn
@@ -395,14 +395,44 @@
variant (pwr_ctrl) "PRESENCE(pwr_ctrl_present = '1'B)"
variant (cont_res_tlli) "BYTEORDER(first)"
};
+ type record UlAckNackEgprs {
+ EgprsChCodingCommand ch_coding_cmd,
+ BIT1 resegment,
+ BIT1 preemptive_tx,
+ BIT1 prr_retrans_req,
+ BIT1 arac_retrans_req,
+ BIT1 cont_res_tlli_present,
+ GprsTlli cont_res_tlli optional,
+ BIT1 tbf_est,
+ BIT1 pkt_ta_present,
+ PacketTimingAdvance pkt_ta optional,
+ BIT1 pkt_ext_ta_present,
+ BIT2 pkt_ext_ta optional,
+ BIT1 pwr_ctrl_present,
+ PowerControlParameters pwr_ctrl optional
+ /* TODO: TS 44.060 12.3.1 EGPRS Ack/Nack Description */
+ /* EgprsAckNackDescription ack_nack_desc, */
+ /* BIT1 not_used('0'B) */
+ /* TODO: Extension Bits, Rel5 ,... */
+ } with {
+ variant (cont_res_tlli) "PRESENCE(cont_res_tlli_present = '1'B)"
+ variant (pkt_ta) "PRESENCE(pkt_ta_present = '1'B)"
+ variant (pkt_ext_ta) "PRESENCE(pkt_ext_ta_present = '1'B)"
+ variant (pwr_ctrl) "PRESENCE(pwr_ctrl_present = '1'B)"
+ variant (cont_res_tlli) "BYTEORDER(first)"
+ };
type record PacketUlAckNack {
PageMode page_mode,
BIT2 msg_excape ('00'B),
uint5_t uplink_tfi,
- BIT1 is_egprs ('0'B), /* msg escape */
- UlAckNackGprs gprs optional
+ BIT1 is_egprs,
+ UlAckNackGprs gprs optional,
+ UlAckNackEgprs egprs optional
/* TODO: EGPRS */
- } with { variant (gprs) "PRESENCE(is_egprs = '0'B)" };
+ } with {
+ variant (gprs) "PRESENCE(is_egprs = '0'B)"
+ variant (egprs) "PRESENCE(is_egprs = '1'B)"
+ };
/* 11.2.8 Packet Downlink Dummy Control Block */
type record PacketDlDummy {
diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index 1774197..0ffa840 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -508,7 +508,7 @@
}
/* Receive Template for Uplink ACK/NACK */
- template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK(template uint5_t ul_tfi, template GprsTlli tlli := ?) := {
+ template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK(template uint5_t ul_tfi) := {
ctrl := {
mac_hdr := {
payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),
@@ -524,22 +524,44 @@
page_mode := ?,
msg_excape := ?,
uplink_tfi := ul_tfi,
- is_egprs := '0'B,
- gprs := {
- ch_coding_cmd := ?,
- ack_nack_desc := ?,
- cont_res_tlli_present := ?,
- cont_res_tlli := tlli,
- pkt_ta_present := ?,
- pkt_ta := *,
- pwr_ctrl_present := ?,
- pwr_ctrl := *
- }
+ is_egprs := ?,
+ gprs := *,
+ egprs := *
}
}
}
}
- }
+ };
+
+ template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK_GPRS(template uint5_t ul_tfi, template UlAckNackGprs gprs := tr_UlAckNackGprs(*))
+ modifies tr_RLCMAC_UL_ACK_NACK := {
+ ctrl := {
+ payload := {
+ u := {
+ ul_ack_nack := {
+ is_egprs := '0'B,
+ gprs := gprs,
+ egprs := omit
+ }
+ }
+ }
+ }
+ };
+
+ template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK_EGPRS(template uint5_t ul_tfi, template UlAckNackEgprs egprs := tr_UlAckNackEgprs(*))
+ modifies tr_RLCMAC_UL_ACK_NACK := {
+ ctrl := {
+ payload := {
+ u := {
+ ul_ack_nack := {
+ is_egprs := '1'B,
+ gprs := omit,
+ egprs := egprs
+ }
+ }
+ }
+ }
+ };
template RlcmacDlBlock tr_RLCMAC_PACKET_PAG_REQ(template uint3_t usf := ?) := {
ctrl := {
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index c3ec440..cbb6cda 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -418,12 +418,13 @@
var uint32_t dl_fn;
f_rx_rlcmac_dl_block(dl_block, dl_fn);
- if (not match(dl_block, tr_RLCMAC_UL_ACK_NACK(ul_tfi := ?, tlli := ?))) {
- setverdict(fail, "Failed to match Packet Uplink ACK / NACK");
- f_shutdown(__BFILE__, __LINE__);
+ if (match(dl_block, tr_RLCMAC_UL_ACK_NACK_GPRS(ul_tfi := ?)) or
+ match(dl_block, tr_RLCMAC_UL_ACK_NACK_EGPRS(ul_tfi := ?))) {
+ poll_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp);
+ return;
}
-
- poll_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp);
+ setverdict(fail, "Failed to match Packet Uplink ACK / NACK:", dl_block);
+ f_shutdown(__BFILE__, __LINE__);
}
function f_rx_rlcmac_dl_block_exp_dummy(out RlcmacDlBlock dl_block)