diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-09-09 16:02:10 +0200 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-09-09 16:30:47 +0200 |
commit | c9b2ba25c589289e766e11632c3905d7cdd01f02 (patch) | |
tree | 8933b5a3bf93628f6edf3a77ea63a104d2ba5839 | |
parent | 6edd4f5a0692cdd3efe839a929a4b2629ebba758 (diff) |
library/LAPDm_RAW_PT.ttcn: use templates from GSM_RR_Types
Get rid of t_IMM_ASS_TBF_UL_DYN, use tr_IMM_TBF_ASS instead. Also,
use both tr_PacketUlDynAssign and tr_PacketUlSglAssign for matching
UL TBF assignment.
Change-Id: Icb7dab04a1e2a833c14754d872bd4b85af3d58a5
-rw-r--r-- | library/LAPDm_RAW_PT.ttcn | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn index 5a8d9eae..75d18d91 100644 --- a/library/LAPDm_RAW_PT.ttcn +++ b/library/LAPDm_RAW_PT.ttcn @@ -261,15 +261,6 @@ module LAPDm_RAW_PT { a[idx] := tfi_usf; } - /* Match an IMM.ASS for an Uplink TBF with a dynamic allocation - * FIXME: this template has nothing to do with LAPDm, move to GSM_RR_Types.ttcn */ - template ImmediateAssignment t_IMM_ASS_TBF_UL_DYN(uint8_t ra, GsmFrameNumber fn) modifies t_IMM_ASS := { - ded_or_tbf := { spare := ?, tma := ?, downlink := false, tbf := true}, - chan_desc := omit, - pkt_chan_desc := ?, - rest_octets := tr_IaRestOctets_ULAss(tr_PacketUlDynAssign()) - }; - template (value) RLCMAC_ph_data_req ts_PH_DATA_ABS(uint8_t tbf_id, GprsCodingScheme cs, uint8_t ts, uint32_t fn, Arfcn arfcn, RlcmacUlBlock block) := { @@ -283,8 +274,10 @@ module LAPDm_RAW_PT { } } - private function f_establish_tbf(uint8_t ra) runs on lapdm_CT { + private function f_establish_tbf(uint8_t ra) runs on lapdm_CT return boolean { + var template GsmRrMessage imm_ass_rr; var ImmediateAssignment imm_ass; + var PacketUlAssign pkt_ul_ass; var GsmFrameNumber rach_fn; var TfiUsfArr tua := f_TfiUsfArrInit(); @@ -294,20 +287,35 @@ module LAPDm_RAW_PT { /* wait for receiving matching IMM ASS */ imm_ass := f_L1CTL_WAIT_IMM_ASS(L1CTL, ra, rach_fn); - if (match(imm_ass, t_IMM_ASS_TBF_UL_DYN(ra, rach_fn))) { + /* make sure we got *Packet* (Uplink) Immediate Assignment */ + imm_ass_rr := tr_IMM_TBF_ASS(dl := false, ra := ra, fn := rach_fn, + rest := tr_IaRestOctets_ULAss(?)); + if (not match(imm_ass, imm_ass_rr.payload.imm_ass)) { + log("Failed to match Packet Immediate Assignment"); + return false; + } + + /* decapsulate PacketUlAssign for further matching */ + pkt_ul_ass := imm_ass.rest_octets.hh.pa.uldl.ass.ul; + + /* Dynamic Block Allocation */ + if (match(pkt_ul_ass, tr_PacketUlDynAssign)) { set_ph_state(PH_STATE_TBF); /* store/save channel description */ //chan_desc := imm_ass.chan_desc; /* Important: ARFCN, TN, TSC, USF, USF_GRANULARITY, CH_CODING_CMD */ - f_TfiUsfArrSet(tua, imm_ass.pkt_chan_desc.tn, - imm_ass.rest_octets.hh.pa.uldl.ass.ul.dynamic.usf); + f_TfiUsfArrSet(tua, imm_ass.pkt_chan_desc.tn, pkt_ul_ass.dynamic.usf); f_L1CTL_TBF_CFG(L1CTL, true, tua); - } else { - /* FIXME: single block uplink allocation */ - log("Failed to match ", t_IMM_ASS_TBF_UL_DYN(ra, rach_fn)); + return true; + /* FIXME: Single Block Allocation */ + } else if (match(pkt_ul_ass, tr_PacketUlSglAssign)) { log("Non-dynamic UL TBF assignment not supported yet"); + return false; + } else { + log("Failed to match Uplink Block Allocation: ", pkt_ul_ass); + return false; } } |