src: use osmo_timer_setup()

Use new function available in libosmocore to set up timers. Compile
tested only.

Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a
This commit is contained in:
Pablo Neira Ayuso 2017-06-07 18:38:21 +02:00
parent 31b1dbd894
commit 57b5f82491
3 changed files with 6 additions and 10 deletions

View File

@ -721,8 +721,7 @@ void osmux_xfrm_input_init(struct osmux_in_handle *h)
INIT_LLIST_HEAD(&batch->circuit_list);
batch->remaining_bytes = h->batch_size;
batch->timer.cb = osmux_batch_timer_expired;
batch->timer.data = h;
osmo_timer_setup(&batch->timer, osmux_batch_timer_expired, h);
h->internal_data = (void *)batch;
@ -803,8 +802,7 @@ osmux_tx(struct msgb *msg, struct timeval *when,
h->msg = msg;
h->tx_cb = tx_cb;
h->data = data;
h->timer.cb = osmux_tx_cb;
h->timer.data = h;
osmo_timer_setup(&h->timer, osmux_tx_cb, h);
#ifdef DEBUG_TIMING
osmo_gettimeofday(&h->start, NULL);

View File

@ -234,10 +234,9 @@ int osmo_rs232_open(struct osmo_rs232 *r)
return rc;
}
if (r->cfg.delay_us) {
r->tx_timer.cb = rs232_tx_timer_cb;
r->tx_timer.data = r;
}
if (r->cfg.delay_us)
osmo_timer_setup(&r->tx_timer, rs232_tx_timer_cb, r);
return 0;
}

View File

@ -281,8 +281,7 @@ struct osmo_stream_cli *osmo_stream_cli_create(void *ctx)
cli->ofd.cb = osmo_stream_cli_fd_cb;
cli->ofd.data = cli;
cli->state = STREAM_CLI_STATE_CONNECTING;
cli->timer.cb = cli_timer_cb;
cli->timer.data = cli;
osmo_timer_setup(&cli->timer, cli_timer_cb, cli);
cli->reconnect_timeout = 5; /* default is 5 seconds. */
INIT_LLIST_HEAD(&cli->tx_queue);