aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/rest_octets.c10
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);