From Holger Freyther holger@freyther.de:
Holger Freyther has uploaded a new change for review.
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) + +<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) > 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 = {
Patch Set 1:
(3 comments)
https://gerrit.osmocom.org/#/c/71/1/openbsc/include/openbsc/rest_octets.h File openbsc/include/openbsc/rest_octets.h:
Line 15: int rest_octets_si6(uint8_t *data, int is1800_net); I would prefer bool unless is1800_net can potentially take something else besides 0 and 1 but that's matter of taste of course.
https://gerrit.osmocom.org/#/c/71/1/openbsc/src/libbsc/rest_octets.c File openbsc/src/libbsc/rest_octets.c:
Line 453: I would prefer 3GPP TS 44.018 for new code - it's newer and already referred to in this file.
Line 487: bitvec_spare_padding() accept up_to_bit as a 2nd argument so it's better to put last bit in there: bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); This way we don't have to change it while extending rest octets in future.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
to look at the new patch set (#2).
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.
Target a slightly older version of the SI6 rest octets as we neither support MBMS nor Random bit stream but should include the 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/2
diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 32b9963..91413b5 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, bool 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..065fb7b 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) + +<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, bool 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, (bv.data_len * 8) - 1); + 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 bf20394..d40bbaf 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, false);
/* 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 = {
Patch Set 2: Code-Review+1
Would be nice to expand gsm0408_test.c (or add new) to include this and other SI (right now only SI2quater is tested).
Patch Set 2: Code-Review+2
Holger Freyther has submitted this change and it was merged.
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.
Target a slightly older version of the SI6 rest octets as we neither support MBMS nor Random bit stream but should include the band indicator.
Change-Id: I417a40eb91f42a3416b4e07bb9fb4d7a01aaa36b Fixes: OS#1698 Related: OS#1725 Reviewed-on: https://gerrit.osmocom.org/71 Tested-by: Jenkins Builder Reviewed-by: Max msuraev@sysmocom.de Reviewed-by: Holger Freyther holger@freyther.de --- 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(-)
Approvals: Max: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved
diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 32b9963..91413b5 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, bool 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..065fb7b 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) + +<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, bool 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, (bv.data_len * 8) - 1); + 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 bf20394..d40bbaf 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, false);
/* 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 = {