summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_init.c
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-05-30 14:40:54 -0400
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-06-02 08:43:29 +0200
commitc36a13b073d39a5249418e7e0e78b7a45bfeb310 (patch)
treefd48291c2d4e1452e7ccd7ff438523d461a03dde /openbsc/src/libbsc/bsc_init.c
parent9cb249bf84b256168b807305a1c4884c5c5fc9fb (diff)
libbsc: Move SIs update/generation for a BTS into a separate function.
The code to do that doesn't belong to the control interface, so abstract it out to a separate function gsm_bts_set_system_infos(). [hfreyther: Fix the coding style...]
Diffstat (limited to 'openbsc/src/libbsc/bsc_init.c')
-rw-r--r--openbsc/src/libbsc/bsc_init.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index a59ab3dad..374ad7b77 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -120,7 +120,7 @@ static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len)
return rc;
}
-/* set all system information types */
+/* set all system information types for a TRX */
int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx)
{
int i, rc;
@@ -197,6 +197,26 @@ err_out:
return rc;
}
+/* set all system information types for a BTS */
+int gsm_bts_set_system_infos(struct gsm_bts *bts)
+{
+ struct gsm_bts_trx *trx;
+
+ /* Generate a new ID */
+ bts->bcch_change_mark += 1;
+ bts->bcch_change_mark %= 0x7;
+
+ llist_for_each_entry(trx, &bts->trx_list, list) {
+ int rc;
+
+ rc = gsm_bts_trx_set_system_infos(trx);
+ if (rc != 0)
+ return rc;
+ }
+
+ return 0;
+}
+
/* Produce a MA as specified in 10.5.2.21 */
static int generate_ma_for_ts(struct gsm_bts_trx_ts *ts)
{