diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2017-05-08 20:57:52 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2017-05-10 11:21:24 +0200 |
commit | 5121576b0c6c323ae5f92d8d987b8c0899d99db0 (patch) | |
tree | c0157908247ea2f068fa942575753be416e43402 /openbsc/src/gprs | |
parent | 7b62d54b52457ecae649ead12e67369b3e09c235 (diff) |
src: use osmo_timer_setup()
Use new function available in libosmocore to set up timers. Compile
tested only.
Change-Id: Ibcfd915688e97d370a888888a83a7c95cbe16819
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 8 | ||||
-rw-r--r-- | openbsc/src/gprs/gprs_sgsn.c | 4 | ||||
-rw-r--r-- | openbsc/src/gprs/gtphub.c | 4 | ||||
-rw-r--r-- | openbsc/src/gprs/sgsn_ares.c | 4 | ||||
-rw-r--r-- | openbsc/src/gprs/sgsn_cdr.c | 4 | ||||
-rw-r--r-- | openbsc/src/gprs/sgsn_libgtp.c | 3 |
6 files changed, 8 insertions, 19 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index aa0389130..e6751db7c 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -227,9 +227,7 @@ static void mmctx_timer_start(struct sgsn_mm_ctx *mm, unsigned int T, mm->num_T_exp = 0; /* FIXME: we should do this only once ? */ - mm->timer.data = mm; - mm->timer.cb = &mmctx_timer_cb; - + osmo_timer_setup(&mm->timer, mmctx_timer_cb, mm); osmo_timer_schedule(&mm->timer, seconds, 0); } @@ -2167,9 +2165,7 @@ static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T, pdp->num_T_exp = 0; /* FIXME: we should do this only once ? */ - pdp->timer.data = pdp; - pdp->timer.cb = &pdpctx_timer_cb; - + osmo_timer_setup(&pdp->timer, pdpctx_timer_cb, pdp); osmo_timer_schedule(&pdp->timer, seconds, 0); } diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 5d9af7807..071dd97c8 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -889,9 +889,7 @@ static void sgsn_llme_check_cb(void *data_) void sgsn_inst_init() { - sgsn->llme_timer.cb = sgsn_llme_check_cb; - sgsn->llme_timer.data = NULL; - + osmo_timer_setup(&sgsn->llme_timer, sgsn_llme_check_cb, NULL); osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0); } diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index a1aaed213..211018b53 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -2438,9 +2438,7 @@ static void gtphub_gc_cb(void *data) static void gtphub_gc_start(struct gtphub *hub) { - hub->gc_timer.cb = gtphub_gc_cb; - hub->gc_timer.data = hub; - + osmo_timer_setup(&hub->gc_timer, gtphub_gc_cb, hub); osmo_timer_schedule(&hub->gc_timer, GTPH_GC_TICK_SECONDS, 0); } diff --git a/openbsc/src/gprs/sgsn_ares.c b/openbsc/src/gprs/sgsn_ares.c index dd1bdb57b..d94d184a3 100644 --- a/openbsc/src/gprs/sgsn_ares.c +++ b/openbsc/src/gprs/sgsn_ares.c @@ -71,12 +71,10 @@ static void osmo_ares_reschedule(struct sgsn_instance *sgsn) osmo_timer_del(&sgsn->ares_timer); timeout = ares_timeout(sgsn->ares_channel, NULL, &tv); if (timeout) { - sgsn->ares_timer.cb = ares_timeout_cb; - sgsn->ares_timer.data = sgsn; - LOGP(DGPRS, LOGL_DEBUG, "C-ares scheduling timeout %llu.%llu\n", (unsigned long long) tv.tv_sec, (unsigned long long) tv.tv_usec); + osmo_timer_setup(&sgsn->ares_timer, ares_timeout_cb, sgsn); osmo_timer_schedule(&sgsn->ares_timer, tv.tv_sec, tv.tv_usec); } } diff --git a/openbsc/src/gprs/sgsn_cdr.c b/openbsc/src/gprs/sgsn_cdr.c index bf0d6f704..091089610 100644 --- a/openbsc/src/gprs/sgsn_cdr.c +++ b/openbsc/src/gprs/sgsn_cdr.c @@ -227,8 +227,8 @@ static int handle_sgsn_sig(unsigned int subsys, unsigned int signal, clock_gettime(CLOCK_MONOTONIC, &signal_data->pdp->cdr_start); signal_data->pdp->cdr_charging_id = signal_data->pdp->lib->cid; cdr_log_pdp(inst, "pdp-act", signal_data->pdp); - signal_data->pdp->cdr_timer.cb = cdr_pdp_timeout; - signal_data->pdp->cdr_timer.data = signal_data->pdp; + osmo_timer_setup(&signal_data->pdp->cdr_timer, cdr_pdp_timeout, + signal_data->pdp); osmo_timer_schedule(&signal_data->pdp->cdr_timer, inst->cfg.cdr.interval, 0); break; case S_SGSN_PDP_DEACT: diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index c26abc992..001e61146 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -845,8 +845,7 @@ int sgsn_gtp_init(struct sgsn_instance *sgi) } /* Start GTP re-transmission timer */ - sgi->gtp_timer.cb = sgsn_gtp_tmr_cb; - sgi->gtp_timer.data = sgi; + osmo_timer_setup(&sgi->gtp_timer, sgsn_gtp_tmr_cb, sgi); sgsn_gtp_tmr_start(sgi); /* Register callbackcs with libgtp */ |