aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/rest_octets.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-05-17 23:20:03 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-05-19 20:23:28 +0200
commit55101ae00455d0c75a908a6dd4625fc08c0318e7 (patch)
tree4c24e739dbb944b1bb8b4123e9daf85d4a0170ac /openbsc/src/libbsc/rest_octets.c
parent8b2fcce98481888ed38c9724ed5800a0cbe6e301 (diff)
bsc: Create minimal SI6 rest octetssysmocom/201504-stable
In GSM R99 SI6 has mandatory SI6 rest octets and so far we did not include them. Add minimal support to generate the right band indicator. Change-Id: I417a40eb91f42a3416b4e07bb9fb4d7a01aaa36b Fixes: OS#1698 Related: OS#1725
Diffstat (limited to 'openbsc/src/libbsc/rest_octets.c')
-rw-r--r--openbsc/src/libbsc/rest_octets.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c
index 41bf5050b..7e352e182 100644
--- a/openbsc/src/libbsc/rest_octets.c
+++ b/openbsc/src/libbsc/rest_octets.c
@@ -187,6 +187,45 @@ int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4)
return bv.data_len;
}
+
+/* GSM 04.18 ETSI TS 101 503 V8.27.0 (2006-05)
+
+<SI6 rest octets> ::=
+{L | H <PCH and NCH info>}
+{L | H <VBS/VGCS options : bit(2)>}
+{ < DTM_support : bit == L > I < DTM_support : bit == H >
+< RAC : bit (8) >
+< MAX_LAPDm : bit (3) > }
+< Band indicator >
+{ L | H < GPRS_MS_TXPWR_MAX_CCH : bit (5) > }
+<implicit spare >;
+*/
+int rest_octets_si6(uint8_t *data, int is1800_net)
+{
+ struct bitvec bv;
+
+ memset(&bv, 0, sizeof(bv));
+ bv.data = data;
+ bv.data_len = 1;
+
+ /* no PCH/NCH info */
+ bitvec_set_bit(&bv, L);
+ /* no VBS/VGCS options */
+ bitvec_set_bit(&bv, L);
+ /* no DTM_support */
+ bitvec_set_bit(&bv, L);
+ /* band indicator */
+ if (is1800_net)
+ bitvec_set_bit(&bv, L);
+ else
+ bitvec_set_bit(&bv, H);
+ /* no GPRS_MS_TXPWR_MAX_CCH */
+ bitvec_set_bit(&bv, L);
+
+ bitvec_spare_padding(&bv, 3);
+ return bv.data_len;
+}
+
/* GPRS Mobile Allocation as per TS 04.60 Chapter 12.10a:
< GPRS Mobile Allocation IE > ::=
< HSN : bit (6) >