Commit Graph

23 Commits

Author SHA1 Message Date
Eric Wild 9864efc10b gsm48_rest_octets: fix wrong value
The compiler complains:

gsm48_rest_octets.c:79:11: warning: initializer overrides prior
initialization of this subobject [-Winitializer-overrides]
   79 |         [0x08] = {2,  2},
      |                  ^~~~~~~
gsm48_rest_octets.c:78:11: note: previous initialization is here
   78 |         [0x08] = {2,  1},
      |                  ^~~~~~~

And a quick look at 04.18 confirms:

0 1 0 0 0	2	1
0 1 0 0 1	2	2

Change-Id: I672e2ce53fd07157d15fec350cfbe32a19a52941
2023-06-03 16:28:37 +02:00
Harald Welte 1192687620 Add osmo_gsm48_si1ro_nch_pos_{encode,decode} functions
These functions encode/decode the NCH position field within the SI1
rest octets.  This is used within ASCI (VBS/VGCS).

Change-Id: I24a0095ac6eee0197f9d9ef9895c7795df6cdc49
Related: OS#5781
2023-05-22 10:33:10 +00:00
Pau Espin Pedrol d7a209bce9 gsm: Introduce API osmo_gsm48_rest_octets_si13_decode
Related: SYS#5358
Change-Id: I74fb0a3afc1ac4aadbfc609b882d929401f790eb
2021-02-18 00:54:33 +00:00
Pau Espin Pedrol c31809faf3 cosmetic: Move comment one line below in append_gprs_cell_opt
Move it above the place where the bit is set, since the bit represents
whether Extension Information is available, not whether R99 is
available.

Change-Id: Ice592acc50a24efd7fe4cf1a91f1d48fd74f38d8
2021-02-10 15:04:22 +00:00
Pau Espin 5b6f1d7d7a gsm: Fix wrong length in SI13 GPRS Cell Options IE
Older commit adding the 2 bits for Rel-4 extension forgot to increase
the length field (see TS 44.060 Table 12.24.1)

Fixes: 946bb95af1
Change-Id: I20efb4403cdf6c5bc717502a7075630044142f17
2021-01-29 18:01:14 +01:00
Pau Espin Pedrol d01163a977 rest_octets: Fix decoding of SI3 3G Early Classmark Sending Restriction
Restriction is applied if the value is L, so fix it.

Fixes: f85b33f68f
Change-Id: Idd170bc0f12e8b215a624e0632a106bde076179b
2020-12-23 12:39:17 +00:00
Pau Espin Pedrol 3f6a282a14 Revert "rest_octets: fix encoding of 3G Early Classmark Sending Restriction"
This reverts commit c9eab828ea.

The initial code was correct, which has also been used in osmo-bsc until
recently, where it moved to use this function from libosmocore and
errors started to show up in TTCN3 tests.

See 3GPP TS 44.018 Section 10.5.2.34 / Table 10.5.2.34.1: "SI 3 Rest
Octets information element":

"""
<SI3 Rest Octet> ::=
...
<3G Early Classmark Sending Restriction>
...

<3G Early Classmark Sending Restriction>::= L | H;
"""

Change-Id: I0ee48d3240c62c4d2e15063b26da7a2a617f383e
Related: OS#3075
Related: SYS#4021
2020-12-23 12:39:17 +00:00
Pau Espin Pedrol 946bb95af1 GPRS Cell Options (SI13): Add REL-4 CCN_ACTIVE bit
This is required in order to tell MS that osmo-pcu now supports
Network Assisted Cell Change (NACC).

Related: SYS#4909
Change-Id: I2aaa8c1107c977f711c2d7530034f57e36e3a237
2020-12-17 15:22:09 +00:00
Pau Espin Pedrol 0f619de715 gsm: append_eutran_neib_cell: Fix SI2quater EARFCN list
Commit bd6e7a9f2d did the initial porting
of rest_octet APIs from osmo-bsc, but introduced a bug when moving
bts->e_offset to a generic pointer independent of bts structure.
As a result, using this API from osmo-bsc makes gsm0408 unit test fail
due to bad encoding of several EARFCNs in si2quater.

Fixes: bd6e7a9f2d
Change-Id: I2bf5635b8536b11d69774d17ac1908019633e3af
2020-12-14 17:58:23 +01:00
Pau Espin Pedrol c4286ad056 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
2020-12-14 17:19:30 +01:00
Pau Espin Pedrol 30bf0e6745 gsm: si13: Fix encode of EGPRS_PACKET_CHANNEL_REQUEST
Cherry-pick from osmo-bsc.git e981f17200bf3a5d5114f46d9f7515fd10b96dbb

Change-Id: I0aae385a427205cc73f60feca161e38608e608d8
2020-12-14 17:13:47 +01:00
Pau Espin Pedrol 908224c1a4 rest_octets: add Serving Cell Priority Parameters
When we add an EARFCN to to the SI2quater struct we do not add Serving
Cell Priority Parameters. This essentially causes to MS to ignore the
EARFCN because it is still undefined under which conditions the MS
should change to LTE.

This is a cherry-pick from osmo-bsc.git 295c965c063a8c431507191f6aef1ef78b720685

Related: SYS#4510
Change-Id: If9134759e9bc4ae0920800972632fd8c5dc9c2d9
2020-12-14 17:11:21 +01:00
Harald Welte 65aabd437c [cosmetic] rest_octets: Follow coding style regarding {}
As pespin point out, the kernel coding style says:

Do not unnecessarily use braces where a single statement will do.
[...]
This does not apply if only one branch of a conditional statement is a single
statement; in the latter case use braces in both branches:

Change-Id: Ia23c4bd018db141ff0afe77fe25678a9b2a395f0
2020-10-15 08:06:08 +02:00
Harald Welte 5e1cd5e411 gsm48_rest_octets: Add parser for SI4 rest octets
Introduces osmo_gsm48_rest_octets_si4_decode()

Change-Id: I9d6ed06731ae15fdcef1a1f397d6ac2b7b1ca980
Related: OS#3075
2020-10-15 08:01:43 +02:00
Vadim Yanitskiy c9eab828ea rest_octets: fix encoding of 3G Early Classmark Sending Restriction
Change-Id: I6df515a00518fabb3eb8f65054addd3aead14bfe
Relates: OS#3075
2020-05-05 02:03:51 +07:00
Vadim Yanitskiy 74474cf8a6 osmo_gsm48_rest_octets_si3_decode(): fix copy-paste error in comment
Change-Id: I57a330e16cc2910597672e1b27cf971499cea5bc
2019-07-18 09:07:30 +00:00
Harald Welte bdf70347fb rest_octets: Remove SI2ter + SI2bis encoders that don't do anything
The library should either provide functions that implement encoding
of those rest octets, or it shouldn't.  Providing a function that
doesn't do anything but pad the buffer is useless.

Change-Id: Ie10684de6a6b2663e2a871fcdb2b275b6ad7a1e7
2019-05-28 20:02:04 +02:00
Harald Welte 86156de20e rest_octets: Implement actual SI6 rest octets encoding
There's very little sense behind introducing a function into
libosmogsm which doesn't implement 90% of the spec.  Let's allow
the caller to provide the various optional bits of information to
the encoder, rather than generating mostly static SI6 rest octets.

Change-Id: Id75005a0c4a02ce7f809692d58b3bd226bc582b2
2019-05-28 20:02:04 +02:00
Harald Welte f85b33f68f rest_octets: Add function to parse SI3 rest octets
Change-Id: I690cf308311f910005a325d50f5d5d825678d2b2
Related: OS#3075
Related: OS#4023
2019-05-28 20:02:04 +02:00
Harald Welte 428d03b919 rest_octets: Suffix encoder functiosn with _encode
... otherwise it's not really clear what they do.

Change-Id: I08e0ca9a8d13c7aa40b9d90f34f0e13adb87d4e0
2019-05-28 20:02:04 +02:00
Harald Welte 1276c17bd6 rest_octets: Use correct symbols names for range encoder
As gsm48_rest_octets.c is not listed in the Makefile.am, it's
never actually compiled and we never noticed that it's calling
functions by symbol names that don't exist :/

Change-Id: I7b1e436f70e0c60979261db87606f38271ec47d3
Related: OS#3075
2019-05-28 20:02:04 +02:00
Harald Welte 912d96db9f gsm48_rest_octets: Fix license: GPLv2+ instead of AGPLv3+
libosmo{core,gsm,vty} code is GPLv2+.  The rest octet code originated in
osmo-bsc.git and was moved here without changing the license. That was a
mistake, it always was meant to be under GPLv2-or-later after moving to
libosmocore.git.

Original copyright is mine.  For contributions by sysmocom, I as the
managing director can approve the license change.

This means only Holger needs to ACK this.

Change-Id: Ief3009dc28dd83e1e26a7101af2eed2341684a87
2019-05-28 18:01:35 +00:00
Stefan Sperling bd6e7a9f2d port rest octets encoding code from osmo-bsc
As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports osmo-bsc code for encoding SI rest octets.

The conversion was a bit tricky in some places because some
functions receive a 'struct gsm_bts' parameter in osmo-bsc.
In this libosmocore version, such functions expect parameters
which correspond to the individual fields of 'struct gsm_bts'
which are used by these functions.

Several structs from osmo-bsc's system_information.h are now
also declared in libosmocore headers, with an added osmo_ prefix
to avoid collisions with existing definitions in osmo-bsc.

Some helpers were ported from osmo-bsc's system_information.c
to libosmocore's gsm48_rest_octets.c. Contrary to osmo-bsc's
implementation they are now only visible within this file.

Unfortunately, this code ported from osmo-bsc lacks unit tests.

Change-Id: I47888965ab11bba1186c21987f1365c9270abeab
Related: OS#3075
2019-01-12 09:51:08 +00:00