diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-07-06 02:02:42 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2020-07-06 02:22:54 +0200 |
commit | 6589f7c3a8dfdaaf66dda3afa6bbb1118ec825f9 (patch) | |
tree | 40bfb196137b4ebd08ab39503e9053b80e74abd2 /src/osmo-bsc/rest_octets.c | |
parent | b8425680391c96b3bb3635cbfdfca4931e85d70b (diff) |
si2quater: fix budget calculation for multiple EARFCNs
In rest_octets.c append_earfcn(), the unconditional bits added are 40, not 25.
Removing only 25 bits from the budget resulted in malformed SI2quater starting
with 4 configured EARFCNs, by adding more EARFCNs than fit in 20 bits.
These malformed SI2quater were also expected in gsm0408_test.c. Update the
expected SI2quater to what is being generated now. This patch passes the ttcn3
testing added in I45382f88686ca60e68569e93569fc4cfb63a0e0d, which provides some
confidence that the coding expected in gsm0408_test.c is now correct.
Related: OS#4652
Change-Id: I5df269f713456a6ccbb874d6b7faac4a6f123c67
Diffstat (limited to 'src/osmo-bsc/rest_octets.c')
-rw-r--r-- | src/osmo-bsc/rest_octets.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/osmo-bsc/rest_octets.c b/src/osmo-bsc/rest_octets.c index 2238b088d..0d806f393 100644 --- a/src/osmo-bsc/rest_octets.c +++ b/src/osmo-bsc/rest_octets.c @@ -162,7 +162,7 @@ static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t { bool appended; unsigned int old = bv->cur_bit; /* save current position to make rollback possible */ - int rem = budget - 25; + int rem = ((int)budget) - 40; if (rem <= 0) return; @@ -190,6 +190,8 @@ static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t /* Priority and E-UTRAN Parameters Description */ bitvec_set_bit(bv, 1); + /* budget: 10 bits used above */ + /* Serving Cell Priority Parameters Descr. is Present, * see also: 3GPP TS 44.018, Table 10.5.2.33b.1 */ bitvec_set_bit(bv, 1); @@ -209,6 +211,8 @@ static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t /* T_Reselection */ bitvec_set_uint(bv, 0, 2); + /* budget: 26 bits used above */ + /* No 3G Priority Parameters Description */ bitvec_set_bit(bv, 0); /* E-UTRAN Parameters Description */ @@ -232,12 +236,16 @@ static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t /* Repeated E-UTRAN Neighbour Cells */ bitvec_set_bit(bv, 1); + /* budget: 34 bits used above */ + appended = append_eutran_neib_cell(bv, bts, rem); if (!appended) { /* appending is impossible within current budget: rollback */ bv->cur_bit = old; return; } + /* budget: further 6 bits used below, totalling 40 bits */ + /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */ bitvec_set_bit(bv, 0); |