From patchwork Tue May 17 21:22:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 623281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3r8VfJ6Nmmz9vKW for ; Wed, 18 May 2016 07:22:32 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 69E1A22F17; Tue, 17 May 2016 21:22:29 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id 1933822F06; Tue, 17 May 2016 21:22:28 +0000 (UTC) Date: Tue, 17 May 2016 21:22:28 +0000 From: gerrit-no-reply@lists.osmocom.org Message-ID: X-Gerrit-MessageType: newchange Subject: Change in openbsc[master]: bsc: Create minimal SI6 rest octets X-Gerrit-Change-Id: I417a40eb91f42a3416b4e07bb9fb4d7a01aaa36b X-Gerrit-ChangeURL: X-Gerrit-Commit: 379f04f66cabb50918d32e0df6897e83af8d6790 MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2-31-gb331dbd-dirty X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: holger@freyther.de Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" From Holger Freyther : Holger Freyther has uploaded a new change for review. https://gerrit.osmocom.org/71 Change subject: bsc: Create minimal SI6 rest octets ...................................................................... bsc: Create minimal SI6 rest octets 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 --- M openbsc/include/openbsc/rest_octets.h M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c 3 files changed, 43 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/71/71/1 diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 32b9963..8d17ddb 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -12,6 +12,7 @@ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); int rest_octets_si2quater(uint8_t *data, const struct osmo_earfcn_si2q *e, const uint16_t *u, const uint16_t *sc, size_t u_len); +int rest_octets_si6(uint8_t *data, int is1800_net); struct gsm48_si_selection_params { uint16_t penalty_time:5, diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index aa286e5..229c4ab 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -450,6 +450,45 @@ return bv.data_len; } + +/* GSM 04.18 ETSI TS 101 503 V8.27.0 (2006-05) + + ::= +{L | H } +{L | H } +{ < 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) > } +; +*/ +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) > diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 1f1d81e..8f9fb9b 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -905,6 +905,7 @@ { struct gsm48_system_information_type_6 *si6; int l2_plen = 11; + int rc; memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); @@ -935,8 +936,9 @@ gsm48_set_dtx(&si6->cell_options, bts->dtxu, bts->dtxu, true); /* SI6 Rest Octets: 10.5.2.35a: PCH / NCH info, VBS/VGCS options */ + rc = rest_octets_si6(si6->rest_octets, is_dcs_net(bts)); - return l2_plen; + return l2_plen + rc; } static struct gsm48_si13_info si13_default = {