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
This commit is contained in:
Neels Hofmeyr
2016-05-30 15:03:18 +02:00
parent 145091bcc1
commit f2e5bc97cd
5 changed files with 15 additions and 11 deletions

View File

@@ -388,6 +388,9 @@ struct gsm_network {
* BTS|RNC specific timezone overrides for multi-tz networks in
* OsmoCSCN, 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;

View File

@@ -587,13 +587,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);
@@ -818,6 +811,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;
}

View File

@@ -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 */

View File

@@ -275,6 +275,7 @@ 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;
/* Table 10.5.33: The T3212 timeout value field is coded as the
* binary representation of the timeout value for
@@ -283,11 +284,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);

View File

@@ -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);