aboutsummaryrefslogtreecommitdiffstats
path: root/pcu
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-09-05 21:35:13 +0700
committerfixeria <vyanitskiy@sysmocom.de>2020-09-08 19:04:20 +0000
commit43ccaf51f2206f63f963a87d8eb5f3261d9556a5 (patch)
tree6dbece894cab1576e1e8c0bd9956c4e7d33aab05 /pcu
parentef0c1b5943740750679f61eed70c660fbe6b915e (diff)
library/PCUIF_Types: version 10: add Mobile Allocation length field
My initial assumption was that we can skip redundant '0'B bits or even '00'O octets in the Mobile Allocation IE, and thus reduce the overall size of this element. Unfortunately, this is wrong. 3GPP TS 44.018, section 10.5.2.21 clearly states that the Mobile Allocation IE contains a bit-string of size NF, where NF is the number of frequencies in the cell allocation. If NF % 8 != 0, then '0'B padding bits must be appended to make it octet-aligned. In other words, if the cell allocation contains let's say 13 frequencies, but a hopping timeslot makes use of only a small fraction of it (e.g. 4 first channels), we would still need to transmit at least 13 bits (+padding), including all redundant bits and octets. In RLC/MAC frames though it's not required to make the bit-string octet aligned, so we need to send exactly NF bits without padding. In order to achieve that: a) add MA length field to INFO.ind (record PCUIF_InfoTrxTs); b) ajust the existing test cases to use this field. It's safe to merge this change as the related patches have not been merged to osmo-pcu and osmo-bts yet. Change-Id: I2709673c90a0cd7d76de9db8b8ad82ac59ca84a0 Related: SYS#4868, OS#4547
Diffstat (limited to 'pcu')
-rw-r--r--pcu/PCU_Tests.ttcn30
1 files changed, 8 insertions, 22 deletions
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 2d209752..a4596bff 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -2193,18 +2193,12 @@ private function f_TC_pcuif_fh_check_imm_ass(in PCUIF_info_ind info_ind,
ia.pkt_chan_desc, " vs ", tr_pkt_chan_desc);
}
- var MobileAllocationLV tr_ma := { len := 0, ma := ''B };
- var octetstring ma_oct := bit2oct(ts.ma);
-
- /* Calculate length of the useful part of Mobile Allocation */
- for (var integer i := 0; i < lengthof(ma_oct); i := i + 1) {
- if (ma_oct[i] != '00'O) {
- tr_ma.len := i + 1;
- }
- }
-
- /* Strip zero bytes from the right side of MA */
- tr_ma.ma := substr(ts.ma, 0, tr_ma.len * 8);
+ /* Mobile Allocation is expected to be octet-aligned */
+ var uint8_t ma_oct_len := (ts.ma_bit_len + 8 - 1) / 8;
+ var template MobileAllocationLV tr_ma := {
+ len := ma_oct_len, /* in bytes */
+ ma := substr(ts.ma, 0, ma_oct_len * 8)
+ };
if (not match(ia.mobile_allocation, tr_ma)) {
setverdict(fail, "Mobile Allocation does not match: ",
@@ -2284,14 +2278,6 @@ private function f_TC_pcuif_fh_check_pkt_ass(in PCUIF_info_ind info_ind,
{
/* FIXME: TRX0/TS7 is a hard-coded expectation, make it configurable */
var PCUIF_InfoTrxTs ts := info_ind.trx.v10[0].ts[7];
- var integer ma_bit_len := 0;
-
- /* Calculate length of the useful part of Mobile Allocation */
- for (var integer i := 0; i < lengthof(ts.ma); i := i + 1) {
- if (ts.ma[i] == '1'B) {
- ma_bit_len := i + 1;
- }
- }
/* Table 12.8.1: Frequency Parameters information elements */
var template FrequencyParameters tr_fp := {
@@ -2307,8 +2293,8 @@ private function f_TC_pcuif_fh_check_pkt_ass(in PCUIF_info_ind info_ind,
rfl_number_list_present := '0'B,
rfl_number_list := omit,
ma_present := '0'B, /* inverted logic */
- ma_length := ma_bit_len,
- ma_bitmap := substr(ts.ma, 0, ma_bit_len)
+ ma_length := ts.ma_bit_len,
+ ma_bitmap := substr(ts.ma, 0, ts.ma_bit_len)
}
},
direct2 := omit