diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-30 15:03:18 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-23 22:27:36 +0100 |
commit | 7beb6abd0f8477c569e552e04c15f991a2eebb58 (patch) | |
tree | 630bd4978ce86a7a36963c1ef7399d6c0edea16f | |
parent | 9ba35214e4131f76084d8f019719b4fbfeb0d7f6 (diff) |
move t3212 to network level (periodic lu)
Set the T3212 default value in struct gsm_network and take that value when
creating a BTS.
Adjust VTY accordingly.
Change-Id: Ifb730f9d0106fe195adc30459a39290a07313b50
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 3 | ||||
-rw-r--r-- | openbsc/src/libbsc/bsc_vty.c | 12 | ||||
-rw-r--r-- | openbsc/src/libcommon-cs/common_cs.c | 3 | ||||
-rw-r--r-- | openbsc/src/libcommon/gsm_data.c | 2 | ||||
-rw-r--r-- | openbsc/src/libmsc/gsm_subscriber.c | 11 |
5 files changed, 15 insertions, 16 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 631fe20e2..34f1a85f1 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -404,6 +404,9 @@ struct gsm_network { * BTS|RNC specific timezone overrides for multi-tz networks in * OsmoMSC, this should be tied to the location area code (LAC). */ struct gsm_tz tz; + + /* Periodic location update default value */ + uint8_t t3212; }; struct osmo_esme; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 0a55cf4cf..8c10f216d 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -591,13 +591,6 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) (sp->penalty_time*20)+20, VTY_NEWLINE); } - /* Is periodic LU enabled or disabled? */ - if (bts->si_common.chan_desc.t3212 == 0) - vty_out(vty, " no periodic location update%s", VTY_NEWLINE); - else - vty_out(vty, " periodic location update %u%s", - bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); - vty_out(vty, " radio-link-timeout %d%s", get_radio_link_timeout(&bts->si_common.cell_options), VTY_NEWLINE); @@ -832,6 +825,11 @@ static int config_write_net(struct vty *vty) vty_out(vty, " timezone %d %d%s", gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); } + if (gsmnet->t3212 == 0) + vty_out(vty, " no periodic location update%s", VTY_NEWLINE); + else + vty_out(vty, " periodic location update %u%s", + gsmnet->t3212 * 6, VTY_NEWLINE); return CMD_SUCCESS; } diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 3149580f0..b1a5d8d7c 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -66,6 +66,9 @@ struct gsm_network *gsm_network_init(void *ctx, net->country_code = country_code; net->network_code = network_code; + /* Use 30 min periodic update interval as sane default */ + net->t3212 = 5; + INIT_LLIST_HEAD(&net->trans_list); INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 3e12430e4..627efee4f 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -340,7 +340,7 @@ struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_typ bts->si_common.chan_desc.att = 1; /* attachment required */ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */ + bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ set_radio_link_timeout(&bts->si_common.cell_options, 32); /* Use RADIO LINK TIMEOUT of 32 seconds */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 568f1c5d0..9bea0e7a6 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -275,16 +275,12 @@ struct gsm_subscriber *subscr_get_by_id(struct gsm_subscriber_group *sgrp, int subscr_update_expire_lu(struct gsm_subscriber *s, struct gsm_bts *bts) { int rc; + struct gsm_network *network = s->group->net; if (!s) { LOGP(DMM, LOGL_ERROR, "LU Expiration but NULL subscriber\n"); return -1; } - if (!bts) { - LOGP(DMM, LOGL_ERROR, "%s: LU Expiration but NULL bts\n", - subscr_name(s)); - return -1; - } /* Table 10.5.33: The T3212 timeout value field is coded as the * binary representation of the timeout value for @@ -293,11 +289,10 @@ int subscr_update_expire_lu(struct gsm_subscriber *s, struct gsm_bts *bts) * Timeout is twice the t3212 value plus one minute */ /* Is expiration handling enabled? */ - if (bts->si_common.chan_desc.t3212 == 0) + if (network->t3212 == 0) s->expire_lu = GSM_SUBSCRIBER_NO_EXPIRATION; else - s->expire_lu = time(NULL) + - (bts->si_common.chan_desc.t3212 * 60 * 6 * 2) + 60; + s->expire_lu = time(NULL) + (network->t3212 * 60 * 6 * 2) + 60; rc = db_sync_subscriber(s); db_subscriber_update(s); |