diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-03-06 12:02:33 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-03-10 17:39:50 +0100 |
commit | f876c39887029bda0319b055e9ab2794d9164584 (patch) | |
tree | 6403e596db79bd5f7271794f012d5e90a3c785d8 | |
parent | e1145cf0f9c746e4b1d7707d958705d4923af835 (diff) |
si: Another round of PCS related fixes
Inside the SI1 rest_octets we will need to indicate if the ARFCN
is band 1800 or 1900. If the BTS is either 850 or 1900 we assume
we are running a PCS network, otherwise it is a DCS network.
The band indicator is not documented in GSM 04.08 but it is in the
GSM 05.14 version 6.1.0 Release 1997.
-rw-r--r-- | openbsc/include/openbsc/rest_octets.h | 2 | ||||
-rw-r--r-- | openbsc/src/libbsc/rest_octets.c | 9 | ||||
-rw-r--r-- | openbsc/src/libbsc/system_information.c | 16 |
3 files changed, 22 insertions, 5 deletions
diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 2d16a1f4f..56d4e0de8 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -4,7 +4,7 @@ #include <openbsc/gsm_04_08.h> /* generate SI1 rest octets */ -int rest_octets_si1(uint8_t *data, uint8_t *nch_pos); +int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, 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 0545426c0..41bf5050b 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -30,7 +30,7 @@ #include <openbsc/rest_octets.h> /* generate SI1 rest octets */ -int rest_octets_si1(uint8_t *data, uint8_t *nch_pos) +int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net) { struct bitvec bv; @@ -44,7 +44,12 @@ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos) } else bitvec_set_bit(&bv, L); - bitvec_spare_padding(&bv, 7); + if (is1800_net) + bitvec_set_bit(&bv, L); + else + bitvec_set_bit(&bv, H); + + bitvec_spare_padding(&bv, 6); return bv.data_len; } diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 41881d9ac..acf713414 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -58,6 +58,15 @@ static int band_compatible(const struct gsm_bts *bts, int arfcn) return 0; } +static int is_dcs_net(const struct gsm_bts *bts) +{ + if (bts->band == GSM_BAND_850) + return 0; + if (bts->band == GSM_BAND_1900) + return 0; + return 1; +} + static int use_arfcn(const struct gsm_bts *bts, const int bis, const int ter, const int pgsm, const int arfcn) { @@ -388,8 +397,11 @@ static int generate_si1(uint8_t *output, struct gsm_bts *bts) si1->rach_control = bts->si_common.rach_control; - /* SI1 Rest Octets (10.5.2.32), contains NCH position */ - rc = rest_octets_si1(si1->rest_octets, NULL); + /* + * SI1 Rest Octets (10.5.2.32), contains NCH position and band + * indicator but that is not in the 04.08. + */ + rc = rest_octets_si1(si1->rest_octets, NULL, is_dcs_net(bts)); return sizeof(*si1) + rc; } |