aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@espeweb.net>2020-12-14 17:19:30 +0100
committerPau Espin Pedrol <pespin@espeweb.net>2020-12-14 17:19:30 +0100
commitc4286ad056e02e0648822321e6ea198e3422c61c (patch)
tree5d4ad569d8f94cebfb60d2907247c76e9ba86a54
parent30bf0e67451fe8d1cb4ff6ea5b5770acdae974cf (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. This commit is a cherry-pick of osmo-bsc.git 6589f7c3a8dfdaaf66dda3afa6bbb1118ec825f9 Change-Id: Icc1ece39ad162d09720e104c5cbc12b07d6771a8 Related: OS#4652
-rw-r--r--src/gsm/gsm48_rest_octets.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gsm/gsm48_rest_octets.c b/src/gsm/gsm48_rest_octets.c
index 84b7589a..5c7d77a4 100644
--- a/src/gsm/gsm48_rest_octets.c
+++ b/src/gsm/gsm48_rest_octets.c
@@ -165,7 +165,7 @@ static inline void append_earfcn(struct bitvec *bv, const struct osmo_earfcn_si2
{
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;
@@ -193,6 +193,8 @@ static inline void append_earfcn(struct bitvec *bv, const struct osmo_earfcn_si2
/* 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);
@@ -212,6 +214,8 @@ static inline void append_earfcn(struct bitvec *bv, const struct osmo_earfcn_si2
/* 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 */
@@ -235,12 +239,16 @@ static inline void append_earfcn(struct bitvec *bv, const struct osmo_earfcn_si2
/* Repeated E-UTRAN Neighbour Cells */
bitvec_set_bit(bv, 1);
+ /* budget: 34 bits used above */
+
appended = append_eutran_neib_cell(bv, e, e_offset, 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);