diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-06-14 22:26:10 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-06-20 10:44:53 +0200 |
commit | a39b0f2bb7a7c8b97dc654a1ecdf3f58072a7fbb (patch) | |
tree | 401c3a3eb9b0470d80f2b9df28f85226d215ea5d /openbsc/src/system_information.c | |
parent | 6e0cd04725db4a3c467ca689233b904d4e9800cc (diff) |
[BSC] Implement per-timeslot ARFCN lists for frequency hopping
We now compute the Cell Channel Description for SI 1 by bit-wise
OR of the ARFCN bitmask of each timeslot on all the TRX of the BTS.
Also, support generating a GSM 04.08 Channel Description IE for
the hopping case (with HSN/MAIO instead of ARFCN).
What's still missing now: Sending the 04.08 Mobile Allocation IE
Diffstat (limited to 'openbsc/src/system_information.c')
-rw-r--r-- | openbsc/src/system_information.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/openbsc/src/system_information.c b/openbsc/src/system_information.c index 337f756ce..508787d40 100644 --- a/openbsc/src/system_information.c +++ b/openbsc/src/system_information.c @@ -177,9 +177,23 @@ static int generate_cell_chan_list(u_int8_t *chan_list, struct gsm_bts *bts) struct gsm_bts_trx *trx; struct bitvec *bv = &bts->si_common.cell_alloc; + /* Zero-initialize the bit-vector */ + memset(&bv->data, 0, bv->data_len); + /* first we generate a bitvec of all TRX ARFCN's in our BTS */ - llist_for_each_entry(trx, &bts->trx_list, list) + llist_for_each_entry(trx, &bts->trx_list, list) { + unsigned int i, j; + /* Always add the TRX's ARFCN */ bitvec_set_bit_pos(bv, trx->arfcn, 1); + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + /* Add any ARFCNs present in hopping channels */ + for (j = 0; j < 1024; j++) { + if (bitvec_get_bit_pos(&ts->hopping.arfcns, j)) + bitvec_set_bit_pos(bv, j, 1); + } + } + } /* then we generate a GSM 04.08 frequency list from the bitvec */ return bitvec2freq_list(chan_list, bv, bts); @@ -191,6 +205,9 @@ static int generate_bcch_chan_list(u_int8_t *chan_list, struct gsm_bts *bts) struct gsm_bts *cur_bts; struct bitvec *bv = &bts->si_common.neigh_list; + /* Zero-initialize the bit-vector */ + memset(&bv->data, 0, bv->data_len); + /* first we generate a bitvec of the BCCH ARFCN's in our BSC */ llist_for_each_entry(cur_bts, &bts->network->bts_list, list) { if (cur_bts == bts) |