From bf540cb7c3e8fbcb6bd978cc3876340812dbf142 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 6 May 2011 12:11:06 +0200 Subject: src: use namespace prefix osmo_timer* for timer functions Summary of changes: s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g --- openbsc/include/openbsc/bsc_msc.h | 4 ++-- openbsc/include/openbsc/bsc_nat.h | 8 ++++---- openbsc/include/openbsc/e1_input.h | 2 +- openbsc/include/openbsc/gprs_llc.h | 4 ++-- openbsc/include/openbsc/gprs_ns.h | 2 +- openbsc/include/openbsc/gprs_sgsn.h | 4 ++-- openbsc/include/openbsc/gsm_data.h | 16 ++++++++-------- openbsc/include/openbsc/osmo_bsc.h | 4 ++-- openbsc/include/openbsc/osmo_bsc_rf.h | 6 +++--- openbsc/include/openbsc/osmo_msc_data.h | 4 ++-- openbsc/include/openbsc/paging.h | 2 +- openbsc/include/openbsc/sgsn.h | 2 +- openbsc/include/openbsc/transaction.h | 4 ++-- openbsc/src/gprs/gprs_gmm.c | 18 +++++++++--------- openbsc/src/gprs/gprs_sndcp.h | 2 +- openbsc/src/gprs/sgsn_libgtp.c | 2 +- openbsc/src/ipaccess/ipaccess-find.c | 6 +++--- openbsc/src/ipaccess/ipaccess-proxy.c | 8 ++++---- openbsc/src/libabis/e1_input.c | 6 +++--- openbsc/src/libabis/input/dahdi.c | 2 +- openbsc/src/libabis/input/hsl.c | 2 +- openbsc/src/libabis/input/ipaccess.c | 2 +- openbsc/src/libabis/input/lapd.c | 8 ++++---- openbsc/src/libabis/input/misdn.c | 2 +- openbsc/src/libbsc/abis_rsl.c | 10 +++++----- openbsc/src/libbsc/bsc_api.c | 12 ++++++------ openbsc/src/libbsc/bsc_msc.c | 8 ++++---- openbsc/src/libbsc/bsc_rll.c | 8 ++++---- openbsc/src/libbsc/chan_alloc.c | 8 ++++---- openbsc/src/libbsc/handover_logic.c | 10 +++++----- openbsc/src/libbsc/paging.c | 14 +++++++------- openbsc/src/libgb/gprs_ns.c | 12 ++++++------ openbsc/src/libmsc/gsm_04_08.c | 14 +++++++------- openbsc/src/libmsc/gsm_04_11.c | 10 +++++----- openbsc/src/libmsc/sms_queue.c | 12 ++++++------ openbsc/src/osmo-bsc/osmo_bsc_msc.c | 10 +++++----- openbsc/src/osmo-bsc/osmo_bsc_rf.c | 16 ++++++++-------- openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 12 ++++++------ openbsc/src/osmo-bsc_nat/bsc_nat.c | 22 +++++++++++----------- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 6 +++--- openbsc/src/osmo-nitb/bsc_hack.c | 6 +++--- openbsc/src/utils/bs11_config.c | 4 ++-- 42 files changed, 157 insertions(+), 157 deletions(-) (limited to 'openbsc') diff --git a/openbsc/include/openbsc/bsc_msc.h b/openbsc/include/openbsc/bsc_msc.h index e3653ac12..88f0de444 100644 --- a/openbsc/include/openbsc/bsc_msc.h +++ b/openbsc/include/openbsc/bsc_msc.h @@ -44,8 +44,8 @@ struct bsc_msc_connection { void (*connection_loss) (struct bsc_msc_connection *); void (*connected) (struct bsc_msc_connection *); - struct timer_list reconnect_timer; - struct timer_list timeout_timer; + struct osmo_timer_list reconnect_timer; + struct osmo_timer_list timeout_timer; }; struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dest); diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 19f8efa32..7d8c37e73 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -82,11 +82,11 @@ struct bsc_connection { struct bsc_config *cfg; /* a timeout node */ - struct timer_list id_timeout; + struct osmo_timer_list id_timeout; /* pong timeout */ - struct timer_list ping_timeout; - struct timer_list pong_timeout; + struct osmo_timer_list ping_timeout; + struct osmo_timer_list pong_timeout; /* mgcp related code */ char *_endpoint_status; @@ -290,7 +290,7 @@ struct bsc_nat_ussd_con { struct bsc_nat *nat; int authorized; - struct timer_list auth_timeout; + struct osmo_timer_list auth_timeout; }; /* create and init the structures */ diff --git a/openbsc/include/openbsc/e1_input.h b/openbsc/include/openbsc/e1_input.h index 8a966add8..cd8abcabc 100644 --- a/openbsc/include/openbsc/e1_input.h +++ b/openbsc/include/openbsc/e1_input.h @@ -69,7 +69,7 @@ struct e1inp_ts { /* delay for the queue */ int delay; /* timer when to dequeue next frame */ - struct timer_list tx_timer; + struct osmo_timer_list tx_timer; } sign; struct { /* subchannel demuxer for frames from E1 */ diff --git a/openbsc/include/openbsc/gprs_llc.h b/openbsc/include/openbsc/gprs_llc.h index 02945e164..9f1760573 100644 --- a/openbsc/include/openbsc/gprs_llc.h +++ b/openbsc/include/openbsc/gprs_llc.h @@ -99,8 +99,8 @@ struct gprs_llc_lle { enum gprs_llc_lle_state state; - struct timer_list t200; - struct timer_list t201; /* wait for acknowledgement */ + struct osmo_timer_list t200; + struct osmo_timer_list t201; /* wait for acknowledgement */ uint16_t v_sent; uint16_t v_ack; diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/openbsc/gprs_ns.h index 0b5014988..f497e2368 100644 --- a/openbsc/include/openbsc/gprs_ns.h +++ b/openbsc/include/openbsc/gprs_ns.h @@ -163,7 +163,7 @@ struct gprs_nsvc { uint32_t state; uint32_t remote_state; - struct timer_list timer; + struct osmo_timer_list timer; enum nsvc_timer_mode timer_mode; int alive_retries; diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index bd60d4ed3..5023d0684 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -102,7 +102,7 @@ struct sgsn_mm_ctx { uint16_t nsei; uint16_t bvci; struct rate_ctr_group *ctrg; - struct timer_list timer; + struct osmo_timer_list timer; unsigned int T; /* Txxxx number */ unsigned int num_T_exp; /* number of consecutive T expirations */ @@ -168,7 +168,7 @@ struct sgsn_pdp_ctx { //uint32_t charging_id; int reordering_reqd; - struct timer_list timer; + struct osmo_timer_list timer; unsigned int T; /* Txxxx number */ unsigned int num_T_exp; /* number of consecutive T expirations */ }; diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 31044ecb5..e6d6467cc 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -177,7 +177,7 @@ struct gsm_nm_state { * - Accept/Reject according to global policy */ struct gsm_loc_updating_operation { - struct timer_list updating_timer; + struct osmo_timer_list updating_timer; unsigned int waiting_for_imsi : 1; unsigned int waiting_for_imei : 1; unsigned int key_seq : 4; @@ -197,7 +197,7 @@ struct gsm_security_operation { * a couple of seconds to work around MSC issues. */ struct gsm_anchor_operation { - struct timer_list timeout; + struct osmo_timer_list timeout; }; /* Maximum number of neighbor cells whose average we track */ @@ -263,7 +263,7 @@ struct gsm_subscriber_connection { struct gsm_bts *bts; /* for assignment handling */ - struct timer_list T10; + struct osmo_timer_list T10; struct gsm_lchan *secondary_lchan; }; @@ -291,9 +291,9 @@ struct gsm_lchan { uint8_t key[MAX_A5_KEY_LEN]; } encr; - struct timer_list T3101; - struct timer_list T3111; - struct timer_list error_timer; + struct osmo_timer_list T3101; + struct osmo_timer_list T3111; + struct osmo_timer_list error_timer; /* AMR bits */ struct gsm48_multi_rate_conf mr_conf; @@ -464,8 +464,8 @@ struct gsm_bts_paging_state { struct llist_head pending_requests; struct gsm_bts *bts; - struct timer_list work_timer; - struct timer_list credit_timer; + struct osmo_timer_list work_timer; + struct osmo_timer_list credit_timer; /* free chans needed */ int free_chans_need; diff --git a/openbsc/include/openbsc/osmo_bsc.h b/openbsc/include/openbsc/osmo_bsc.h index ef0f11a3b..262014759 100644 --- a/openbsc/include/openbsc/osmo_bsc.h +++ b/openbsc/include/openbsc/osmo_bsc.h @@ -16,8 +16,8 @@ struct osmo_bsc_sccp_con { /* SCCP connection realted */ struct sccp_connection *sccp; struct bsc_msc_connection *msc_con; - struct timer_list sccp_it_timeout; - struct timer_list sccp_cc_timeout; + struct osmo_timer_list sccp_it_timeout; + struct osmo_timer_list sccp_cc_timeout; struct llist_head sccp_queue; unsigned int sccp_queue_size; diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/openbsc/include/openbsc/osmo_bsc_rf.h index 7de986672..f1ff9baec 100644 --- a/openbsc/include/openbsc/osmo_bsc_rf.h +++ b/openbsc/include/openbsc/osmo_bsc_rf.h @@ -16,13 +16,13 @@ struct osmo_bsc_rf { /* delay the command */ char last_request; - struct timer_list delay_cmd; + struct osmo_timer_list delay_cmd; /* verify that RF is up as it should be */ - struct timer_list rf_check; + struct osmo_timer_list rf_check; /* some handling for the automatic grace switch */ - struct timer_list grace_timeout; + struct osmo_timer_list grace_timeout; }; struct osmo_bsc_rf_conn { diff --git a/openbsc/include/openbsc/osmo_msc_data.h b/openbsc/include/openbsc/osmo_msc_data.h index f360da584..495c923c7 100644 --- a/openbsc/include/openbsc/osmo_msc_data.h +++ b/openbsc/include/openbsc/osmo_msc_data.h @@ -43,8 +43,8 @@ struct osmo_msc_data { char *bsc_token; int ping_timeout; int pong_timeout; - struct timer_list ping_timer; - struct timer_list pong_timer; + struct osmo_timer_list ping_timer; + struct osmo_timer_list pong_timer; struct bsc_msc_connection *msc_con; int core_ncc; int core_mcc; diff --git a/openbsc/include/openbsc/paging.h b/openbsc/include/openbsc/paging.h index 991c4ec7c..0872eb866 100644 --- a/openbsc/include/openbsc/paging.h +++ b/openbsc/include/openbsc/paging.h @@ -43,7 +43,7 @@ struct gsm_paging_request { int chan_type; /* Timer 3113: how long do we try to page? */ - struct timer_list T3113; + struct osmo_timer_list T3113; /* How often did we ask the BTS to page? */ int attempts; diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h index 53d3c050d..00e1ec3fb 100644 --- a/openbsc/include/openbsc/sgsn.h +++ b/openbsc/include/openbsc/sgsn.h @@ -25,7 +25,7 @@ struct sgsn_instance { struct bsc_fd gtp_fd1c; struct bsc_fd gtp_fd1u; /* Timer for libGTP */ - struct timer_list gtp_timer; + struct osmo_timer_list gtp_timer; /* GSN instance for libgtp */ struct gsn_t *gsn; }; diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h index 5f11ef236..c008a968d 100644 --- a/openbsc/include/openbsc/transaction.h +++ b/openbsc/include/openbsc/transaction.h @@ -41,14 +41,14 @@ struct gsm_trans { /* current timer and message queue */ int Tcurrent; /* current CC timer */ int T308_second; /* used to send release again */ - struct timer_list timer; + struct osmo_timer_list timer; struct gsm_mncc msg; /* stores setup/disconnect/release message */ } cc; struct { uint8_t link_id; /* RSL Link ID to be used for this trans */ int is_mt; /* is this a MO (0) or MT (1) transfer */ enum gsm411_cp_state cp_state; - struct timer_list cp_timer; + struct osmo_timer_list cp_timer; enum gsm411_rp_state rp_state; diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 7fd8641b3..a49900e15 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -208,7 +208,7 @@ static void mmctx_timer_cb(void *_mm); static void mmctx_timer_start(struct sgsn_mm_ctx *mm, unsigned int T, unsigned int seconds) { - if (bsc_timer_pending(&mm->timer)) + if (osmo_timer_pending(&mm->timer)) LOGP(DMM, LOGL_ERROR, "Starting MM timer %u while old " "timer %u pending\n", T, mm->T); mm->T = T; @@ -218,7 +218,7 @@ static void mmctx_timer_start(struct sgsn_mm_ctx *mm, unsigned int T, mm->timer.data = mm; mm->timer.cb = &mmctx_timer_cb; - bsc_schedule_timer(&mm->timer, seconds, 0); + osmo_timer_schedule(&mm->timer, seconds, 0); } static void mmctx_timer_stop(struct sgsn_mm_ctx *mm, unsigned int T) @@ -226,7 +226,7 @@ static void mmctx_timer_stop(struct sgsn_mm_ctx *mm, unsigned int T) if (mm->T != T) LOGP(DMM, LOGL_ERROR, "Stopping MM timer %u but " "%u is running\n", T, mm->T); - bsc_del_timer(&mm->timer); + osmo_timer_del(&mm->timer); } /* Send a message through the underlying layer */ @@ -1087,7 +1087,7 @@ static void mmctx_timer_cb(void *_mm) /* FIXME */ break; } - bsc_schedule_timer(&mm->timer, GSM0408_T3350_SECS, 0); + osmo_timer_schedule(&mm->timer, GSM0408_T3350_SECS, 0); break; case 3360: /* waiting for AUTH AND CIPH RESP */ if (mm->num_T_exp >= 5) { @@ -1096,7 +1096,7 @@ static void mmctx_timer_cb(void *_mm) break; } /* FIXME: re-transmit the respective msg and re-start timer */ - bsc_schedule_timer(&mm->timer, GSM0408_T3360_SECS, 0); + osmo_timer_schedule(&mm->timer, GSM0408_T3360_SECS, 0); break; case 3370: /* waiting for IDENTITY RESPONSE */ if (mm->num_T_exp >= 5) { @@ -1107,7 +1107,7 @@ static void mmctx_timer_cb(void *_mm) } /* re-tranmit IDENTITY REQUEST and re-start timer */ gsm48_tx_gmm_id_req(mm, mm->t3370_id_type); - bsc_schedule_timer(&mm->timer, GSM0408_T3370_SECS, 0); + osmo_timer_schedule(&mm->timer, GSM0408_T3370_SECS, 0); break; default: LOGP(DMM, LOGL_ERROR, "timer expired in unknown mode %u\n", @@ -1122,7 +1122,7 @@ static void pdpctx_timer_cb(void *_mm); static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T, unsigned int seconds) { - if (bsc_timer_pending(&pdp->timer)) + if (osmo_timer_pending(&pdp->timer)) LOGP(DMM, LOGL_ERROR, "Starting MM timer %u while old " "timer %u pending\n", T, pdp->T); pdp->T = T; @@ -1132,7 +1132,7 @@ static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T, pdp->timer.data = pdp; pdp->timer.cb = &pdpctx_timer_cb; - bsc_schedule_timer(&pdp->timer, seconds, 0); + osmo_timer_schedule(&pdp->timer, seconds, 0); } @@ -1457,7 +1457,7 @@ static void pdpctx_timer_cb(void *_pdp) break; } gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL); - bsc_schedule_timer(&pdp->timer, GSM0408_T3395_SECS, 0); + osmo_timer_schedule(&pdp->timer, GSM0408_T3395_SECS, 0); break; default: LOGP(DMM, LOGL_ERROR, "timer expired in unknown mode %u\n", diff --git a/openbsc/src/gprs/gprs_sndcp.h b/openbsc/src/gprs/gprs_sndcp.h index ec35d7ba0..fef871aa1 100644 --- a/openbsc/src/gprs/gprs_sndcp.h +++ b/openbsc/src/gprs/gprs_sndcp.h @@ -20,7 +20,7 @@ struct defrag_state { /* linked list of defrag_queue_entry: one for each fragment */ struct llist_head frag_list; - struct timer_list timer; + struct osmo_timer_list timer; }; /* See 6.7.1.2 Reassembly */ diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 37d976f6e..7e6603526 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -538,7 +538,7 @@ static void sgsn_gtp_tmr_start(struct sgsn_instance *sgi) gtp_retranstimeout(sgi->gsn, &next); /* re-schedule the timer */ - bsc_schedule_timer(&sgi->gtp_timer, next.tv_sec, next.tv_usec/1000); + osmo_timer_schedule(&sgi->gtp_timer, next.tv_sec, next.tv_usec/1000); } /* timer callback for libgtp retransmissions and ping */ diff --git a/openbsc/src/ipaccess/ipaccess-find.c b/openbsc/src/ipaccess/ipaccess-find.c index 9335ec835..24f602e5c 100644 --- a/openbsc/src/ipaccess/ipaccess-find.c +++ b/openbsc/src/ipaccess/ipaccess-find.c @@ -152,7 +152,7 @@ static int bfd_cb(struct bsc_fd *bfd, unsigned int flags) return 0; } -static struct timer_list timer; +static struct osmo_timer_list timer; static void timer_cb(void *_data) { @@ -160,7 +160,7 @@ static void timer_cb(void *_data) bfd->when |= BSC_FD_WRITE; - bsc_schedule_timer(&timer, 5, 0); + osmo_timer_schedule(&timer, 5, 0); } int main(int argc, char **argv) @@ -192,7 +192,7 @@ int main(int argc, char **argv) timer.cb = timer_cb; timer.data = &bfd; - bsc_schedule_timer(&timer, 5, 0); + osmo_timer_schedule(&timer, 5, 0); printf("Trying to find ip.access BTS by broadcast UDP...\n"); diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c index bb4841c67..f40590a7e 100644 --- a/openbsc/src/ipaccess/ipaccess-proxy.c +++ b/openbsc/src/ipaccess/ipaccess-proxy.c @@ -57,7 +57,7 @@ struct ipa_proxy { /* list of BTS's (struct ipa_bts_conn */ struct llist_head bts_list; /* the BSC reconnect timer */ - struct timer_list reconn_timer; + struct osmo_timer_list reconn_timer; /* global GPRS NS data */ struct in_addr gprs_addr; struct in_addr listen_addr; @@ -657,7 +657,7 @@ static void reconn_tmr_cb(void *data) return; reschedule: - bsc_schedule_timer(&ipp->reconn_timer, 5, 0); + osmo_timer_schedule(&ipp->reconn_timer, 5, 0); } static void handle_dead_socket(struct bsc_fd *bfd) @@ -709,13 +709,13 @@ static void handle_dead_socket(struct bsc_fd *bfd) ipbc->bsc_oml_conn = NULL; bsc_conn = ipbc->oml_conn; /* start reconnect timer */ - bsc_schedule_timer(&ipp->reconn_timer, 5, 0); + osmo_timer_schedule(&ipp->reconn_timer, 5, 0); break; case RSL_TO_BSC: /* incoming RSL data from BSC, forward to BTS RSL */ ipbc->bsc_rsl_conn[trx_id] = NULL; bsc_conn = ipbc->rsl_conn[trx_id]; /* start reconnect timer */ - bsc_schedule_timer(&ipp->reconn_timer, 5, 0); + osmo_timer_schedule(&ipp->reconn_timer, 5, 0); break; default: bsc_conn = NULL; diff --git a/openbsc/src/libabis/e1_input.c b/openbsc/src/libabis/e1_input.c index 1a79261d4..d3a5cdaa8 100644 --- a/openbsc/src/libabis/e1_input.c +++ b/openbsc/src/libabis/e1_input.c @@ -241,7 +241,7 @@ int abis_rsl_sendmsg(struct msgb *msg) sign_link = msg->trx->rsl_link; e1i_ts = sign_link->ts; - if (!bsc_timer_pending(&e1i_ts->sign.tx_timer)) { + if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) { /* notify the driver we have something to write */ e1inp_driver = sign_link->ts->line->driver; e1inp_driver->want_write(e1i_ts); @@ -276,7 +276,7 @@ int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml) sign_link = msg->trx->bts->oml_link; e1i_ts = sign_link->ts; - if (!bsc_timer_pending(&e1i_ts->sign.tx_timer)) { + if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) { /* notify the driver we have something to write */ e1inp_driver = sign_link->ts->line->driver; e1inp_driver->want_write(e1i_ts); @@ -471,7 +471,7 @@ void e1inp_sign_link_destroy(struct e1inp_sign_link *link) } if (link->ts->type == E1INP_TS_TYPE_SIGN) - bsc_del_timer(&link->ts->sign.tx_timer); + osmo_timer_del(&link->ts->sign.tx_timer); talloc_free(link); } diff --git a/openbsc/src/libabis/input/dahdi.c b/openbsc/src/libabis/input/dahdi.c index 93c8fa55c..4fcd64f2a 100644 --- a/openbsc/src/libabis/input/dahdi.c +++ b/openbsc/src/libabis/input/dahdi.c @@ -222,7 +222,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) /* set tx delay timer for next event */ e1i_ts->sign.tx_timer.cb = timeout_ts1_write; e1i_ts->sign.tx_timer.data = e1i_ts; - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 50000); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, 50000); return 0; } diff --git a/openbsc/src/libabis/input/hsl.c b/openbsc/src/libabis/input/hsl.c index 44528dd58..9ff855275 100644 --- a/openbsc/src/libabis/input/hsl.c +++ b/openbsc/src/libabis/input/hsl.c @@ -340,7 +340,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) e1i_ts->sign.tx_timer.data = e1i_ts; /* Reducing this might break the nanoBTS 900 init. */ - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); return ret; } diff --git a/openbsc/src/libabis/input/ipaccess.c b/openbsc/src/libabis/input/ipaccess.c index d2572fb38..95e84f60b 100644 --- a/openbsc/src/libabis/input/ipaccess.c +++ b/openbsc/src/libabis/input/ipaccess.c @@ -633,7 +633,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) e1i_ts->sign.tx_timer.data = e1i_ts; /* Reducing this might break the nanoBTS 900 init. */ - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); return ret; } diff --git a/openbsc/src/libabis/input/lapd.c b/openbsc/src/libabis/input/lapd.c index c8830d2a8..d0fab1815 100644 --- a/openbsc/src/libabis/input/lapd.c +++ b/openbsc/src/libabis/input/lapd.c @@ -137,7 +137,7 @@ struct lapd_sap { int va; /* last acked by peer */ int vr; /* next expected to be received */ - struct timer_list sabme_timer; /* timer to re-transmit SABM message */ + struct osmo_timer_list sabme_timer; /* timer to re-transmit SABM message */ }; /* 3.5.2.2 Send state variable V(S) @@ -259,11 +259,11 @@ static void lapd_sap_set_state(struct lapd_tei *teip, uint8_t sapi, switch (sap->state) { case SAP_STATE_SABM_RETRANS: if (newstate != SAP_STATE_SABM_RETRANS) - bsc_del_timer(&sap->sabme_timer); + osmo_timer_del(&sap->sabme_timer); break; default: if (newstate == SAP_STATE_SABM_RETRANS) - bsc_schedule_timer(&sap->sabme_timer, SABM_INTERVAL); + osmo_timer_schedule(&sap->sabme_timer, SABM_INTERVAL); break; } @@ -608,7 +608,7 @@ static void sabme_timer_cb(void *_sap) lapd_send_sabm(sap->tei->li, sap->tei->tei, sap->sapi); if (sap->state == SAP_STATE_SABM_RETRANS) - bsc_schedule_timer(&sap->sabme_timer, SABM_INTERVAL); + osmo_timer_schedule(&sap->sabme_timer, SABM_INTERVAL); } /* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */ diff --git a/openbsc/src/libabis/input/misdn.c b/openbsc/src/libabis/input/misdn.c index 2d52441e6..3c337920f 100644 --- a/openbsc/src/libabis/input/misdn.c +++ b/openbsc/src/libabis/input/misdn.c @@ -246,7 +246,7 @@ static int handle_ts1_write(struct bsc_fd *bfd) /* set tx delay timer for next event */ e1i_ts->sign.tx_timer.cb = timeout_ts1_write; e1i_ts->sign.tx_timer.data = e1i_ts; - bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); return ret; } diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index eb6ed0366..941a4ba78 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -669,7 +669,7 @@ static int rsl_rf_chan_release(struct gsm_lchan *lchan, int error) rsl_lchan_set_state(lchan, LCHAN_S_REL_ERR); lchan->error_timer.data = lchan; lchan->error_timer.cb = error_timeout_cb; - bsc_schedule_timer(&lchan->error_timer, + osmo_timer_schedule(&lchan->error_timer, msg->trx->bts->network->T3111 + 2, 0); } @@ -694,7 +694,7 @@ static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan) LOGP(DRSL, LOGL_NOTICE, "%s CHAN REL ACK but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); - bsc_del_timer(&lchan->T3111); + osmo_timer_del(&lchan->T3111); /* we have an error timer pending to release that */ if (lchan->state != LCHAN_S_REL_ERR) rsl_lchan_set_state(lchan, LCHAN_S_NONE); @@ -1354,7 +1354,7 @@ static int rsl_send_imm_assignment(struct gsm_lchan *lchan) /* Start timer T3101 to wait for GSM48_MT_RR_PAG_RESP */ lchan->T3101.cb = t3101_expired; lchan->T3101.data = lchan; - bsc_schedule_timer(&lchan->T3101, bts->network->T3101, 0); + osmo_timer_schedule(&lchan->T3101, bts->network->T3101, 0); /* send IMMEDIATE ASSIGN CMD on RSL to BTS (to send on CCCH to MS) */ return rsl_imm_assign_cmd(bts, sizeof(*ia)+ia->mob_alloc_len, (uint8_t *) ia); @@ -1466,7 +1466,7 @@ static void rsl_handle_release(struct gsm_lchan *lchan) lchan->T3111.cb = t3111_expired; lchan->T3111.data = lchan; bts = lchan->ts->trx->bts; - bsc_schedule_timer(&lchan->T3111, bts->network->T3111, 0); + osmo_timer_schedule(&lchan->T3111, bts->network->T3111, 0); } /* ESTABLISH INDICATION, LOCATION AREA UPDATE REQUEST @@ -1500,7 +1500,7 @@ static int abis_rsl_rx_rll(struct msgb *msg) DEBUGPC(DRLL, "ESTABLISH INDICATION\n"); /* lchan is established, stop T3101 */ msg->lchan->sapis[rllh->link_id & 0x7] = LCHAN_SAPI_MS; - bsc_del_timer(&msg->lchan->T3101); + osmo_timer_del(&msg->lchan->T3101); if (msgb_l2len(msg) > sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh) && rllh->data[0] == RSL_IE_L3_INFO) { diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index 4b48ec69b..09e9de485 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -325,7 +325,7 @@ int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, in /* we will now start the timer to complete the assignment */ conn->T10.cb = assignment_t10_timeout; conn->T10.data = conn; - bsc_schedule_timer(&conn->T10, GSM0808_T10_VALUE); + osmo_timer_schedule(&conn->T10, GSM0808_T10_VALUE); return 0; error: @@ -358,7 +358,7 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn, } /* swap channels */ - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); lchan_release(conn->lchan, 0, 1); conn->lchan = conn->secondary_lchan; @@ -387,7 +387,7 @@ static void handle_ass_fail(struct gsm_subscriber_connection *conn, } /* stop the timer and release it */ - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); lchan_release(conn->secondary_lchan, 0, 1); conn->secondary_lchan = NULL; @@ -435,7 +435,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn, handle_ass_fail(conn, msg); break; case GSM48_MT_RR_CHAN_MODE_MODIF_ACK: - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); rc = gsm48_rx_rr_modif_ack(msg); if (rc < 0 && api->assign_fail) { api->assign_fail(conn, @@ -536,7 +536,7 @@ int gsm0808_clear(struct gsm_subscriber_connection *conn) conn->ho_lchan = NULL; conn->bts = NULL; - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); return 0; } @@ -621,7 +621,7 @@ static void handle_release(struct gsm_subscriber_connection *conn, int destruct = 1; if (conn->secondary_lchan == lchan) { - bsc_del_timer(&conn->T10); + osmo_timer_del(&conn->T10); conn->secondary_lchan = NULL; bsc->assign_fail(conn, diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c index 8eef6f4e6..f4eee9ca5 100644 --- a/openbsc/src/libbsc/bsc_msc.c +++ b/openbsc/src/libbsc/bsc_msc.c @@ -77,7 +77,7 @@ static int msc_connection_connect(struct bsc_fd *fd, unsigned int what) con = container_of(queue, struct bsc_msc_connection, write_queue); /* From here on we will either be connected or reconnect */ - bsc_del_timer(&con->timeout_timer); + osmo_timer_del(&con->timeout_timer); /* check the socket state */ rc = getsockopt(fd->fd, SOL_SOCKET, SO_ERROR, &val, &len); @@ -184,7 +184,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con) fd->cb = msc_connection_connect; con->timeout_timer.cb = msc_con_timeout; con->timeout_timer.data = con; - bsc_schedule_timer(&con->timeout_timer, 20, 0); + osmo_timer_schedule(&con->timeout_timer, 20, 0); } else if (ret < 0) { perror("Connection failed"); connection_loss(con); @@ -226,7 +226,7 @@ struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dests) void bsc_msc_lost(struct bsc_msc_connection *con) { write_queue_clear(&con->write_queue); - bsc_del_timer(&con->timeout_timer); + osmo_timer_del(&con->timeout_timer); if (con->write_queue.bfd.fd >= 0) bsc_unregister_fd(&con->write_queue.bfd); @@ -246,7 +246,7 @@ void bsc_msc_schedule_connect(struct bsc_msc_connection *con) LOGP(DMSC, LOGL_NOTICE, "Attempting to reconnect to the MSC.\n"); con->reconnect_timer.cb = reconnect_msc; con->reconnect_timer.data = con; - bsc_schedule_timer(&con->reconnect_timer, 5, 0); + osmo_timer_schedule(&con->reconnect_timer, 5, 0); } struct msgb *bsc_msc_id_get_resp(const char *token) diff --git a/openbsc/src/libbsc/bsc_rll.c b/openbsc/src/libbsc/bsc_rll.c index b02394a59..9fbe7c6e7 100644 --- a/openbsc/src/libbsc/bsc_rll.c +++ b/openbsc/src/libbsc/bsc_rll.c @@ -34,7 +34,7 @@ struct bsc_rll_req { struct llist_head list; - struct timer_list timer; + struct osmo_timer_list timer; struct gsm_lchan *lchan; uint8_t link_id; @@ -92,7 +92,7 @@ int rll_establish(struct gsm_lchan *lchan, uint8_t sapi, rllr->timer.cb = &timer_cb; rllr->timer.data = rllr; - bsc_schedule_timer(&rllr->timer, 10, 0); + osmo_timer_schedule(&rllr->timer, 10, 0); /* send the RSL RLL ESTablish REQuest */ return rsl_establish_request(rllr->lchan, rllr->link_id); @@ -107,7 +107,7 @@ void rll_indication(struct gsm_lchan *lchan, uint8_t link_id, uint8_t type) llist_for_each_entry_safe(rllr, rllr2, &bsc_rll_reqs, list) { if (rllr->lchan == lchan && (rllr->link_id & LINKID_MASK) == (link_id & LINKID_MASK)) { - bsc_del_timer(&rllr->timer); + osmo_timer_del(&rllr->timer); complete_rllr(rllr, type); return; } @@ -127,7 +127,7 @@ static int rll_lchan_signal(unsigned int subsys, unsigned int signal, llist_for_each_entry_safe(rllr, rllr2, &bsc_rll_reqs, list) { if (rllr->lchan == challoc->lchan) { - bsc_del_timer(&rllr->timer); + osmo_timer_del(&rllr->timer); complete_rllr(rllr, BSC_RLLR_IND_ERR_IND); } } diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index b794132a6..ff745f575 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -311,7 +311,7 @@ void lchan_free(struct gsm_lchan *lchan) /* stop the timer */ - bsc_del_timer(&lchan->T3101); + osmo_timer_del(&lchan->T3101); /* clear cached measuement reports */ lchan->meas_rep_idx = 0; @@ -356,9 +356,9 @@ void lchan_free(struct gsm_lchan *lchan) */ void lchan_reset(struct gsm_lchan *lchan) { - bsc_del_timer(&lchan->T3101); - bsc_del_timer(&lchan->T3111); - bsc_del_timer(&lchan->error_timer); + osmo_timer_del(&lchan->T3101); + osmo_timer_del(&lchan->T3111); + osmo_timer_del(&lchan->error_timer); lchan->type = GSM_LCHAN_NONE; lchan->state = LCHAN_S_NONE; diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 976a7fd00..bf9588bc0 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -47,7 +47,7 @@ struct bsc_handover { struct gsm_lchan *old_lchan; struct gsm_lchan *new_lchan; - struct timer_list T3103; + struct osmo_timer_list T3103; uint8_t ho_ref; }; @@ -170,7 +170,7 @@ void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan) if (free_lchan) lchan_release(ho->new_lchan, 0, 1); - bsc_del_timer(&ho->T3103); + osmo_timer_del(&ho->T3103); llist_del(&ho->list); talloc_free(ho); } @@ -214,7 +214,7 @@ static int ho_chan_activ_ack(struct gsm_lchan *new_lchan) * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ ho->T3103.cb = ho_T3103_cb; ho->T3103.data = ho; - bsc_schedule_timer(&ho->T3103, 10, 0); + osmo_timer_schedule(&ho->T3103, 10, 0); /* create a RTP connection */ if (is_ipaccess_bts(new_lchan->ts->trx->bts)) @@ -264,7 +264,7 @@ static int ho_gsm48_ho_compl(struct gsm_lchan *new_lchan) counter_inc(net->stats.handover.completed); - bsc_del_timer(&ho->T3103); + osmo_timer_del(&ho->T3103); /* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) @@ -302,7 +302,7 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) counter_inc(net->stats.handover.failed); - bsc_del_timer(&ho->T3103); + osmo_timer_del(&ho->T3103); llist_del(&ho->list); /* release the channel and forget about it */ diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c index a33614467..324104f87 100644 --- a/openbsc/src/libbsc/paging.c +++ b/openbsc/src/libbsc/paging.c @@ -73,7 +73,7 @@ static unsigned int calculate_group(struct gsm_bts *bts, struct gsm_subscriber * static void paging_remove_request(struct gsm_bts_paging_state *paging_bts, struct gsm_paging_request *to_be_deleted) { - bsc_del_timer(&to_be_deleted->T3113); + osmo_timer_del(&to_be_deleted->T3113); llist_del(&to_be_deleted->entry); subscr_put(to_be_deleted->subscr); talloc_free(to_be_deleted); @@ -102,8 +102,8 @@ static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts) if (llist_empty(&paging_bts->pending_requests)) return; - if (!bsc_timer_pending(&paging_bts->work_timer)) - bsc_schedule_timer(&paging_bts->work_timer, PAGING_TIMER); + if (!osmo_timer_pending(&paging_bts->work_timer)) + osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER); } @@ -192,7 +192,7 @@ static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_b if (paging_bts->available_slots == 0) { paging_bts->credit_timer.cb = paging_give_credit; paging_bts->credit_timer.data = paging_bts; - bsc_schedule_timer(&paging_bts->credit_timer, 5, 0); + osmo_timer_schedule(&paging_bts->credit_timer, 5, 0); return; } @@ -215,7 +215,7 @@ static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_b llist_add_tail(&request->entry, &paging_bts->pending_requests); skip_paging: - bsc_schedule_timer(&paging_bts->work_timer, PAGING_TIMER); + osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER); } static void paging_worker(void *data) @@ -298,7 +298,7 @@ static int _paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, req->cbfn_param = data; req->T3113.cb = paging_T3113_expired; req->T3113.data = req; - bsc_schedule_timer(&req->T3113, bts->network->T3113, 0); + osmo_timer_schedule(&req->T3113, bts->network->T3113, 0); llist_add_tail(&req->entry, &bts_entry->pending_requests); paging_schedule_if_needed(bts_entry); @@ -399,7 +399,7 @@ void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots) { paging_init_if_needed(bts); - bsc_del_timer(&bts->paging.credit_timer); + osmo_timer_del(&bts->paging.credit_timer); bts->paging.available_slots = free_slots; paging_schedule_if_needed(&bts->paging); } diff --git a/openbsc/src/libgb/gprs_ns.c b/openbsc/src/libgb/gprs_ns.c index 95e5a55d7..1c3c1b6cd 100644 --- a/openbsc/src/libgb/gprs_ns.c +++ b/openbsc/src/libgb/gprs_ns.c @@ -166,8 +166,8 @@ struct gprs_nsvc *nsvc_create(struct gprs_ns_inst *nsi, uint16_t nsvci) void nsvc_delete(struct gprs_nsvc *nsvc) { - if (bsc_timer_pending(&nsvc->timer)) - bsc_del_timer(&nsvc->timer); + if (osmo_timer_pending(&nsvc->timer)) + osmo_timer_del(&nsvc->timer); llist_del(&nsvc->list); talloc_free(nsvc); } @@ -405,11 +405,11 @@ static void nsvc_start_timer(struct gprs_nsvc *nsvc, enum nsvc_timer_mode mode) nsvc->nsei, get_value_string(timer_mode_strs, mode), seconds); - if (bsc_timer_pending(&nsvc->timer)) - bsc_del_timer(&nsvc->timer); + if (osmo_timer_pending(&nsvc->timer)) + osmo_timer_del(&nsvc->timer); nsvc->timer_mode = mode; - bsc_schedule_timer(&nsvc->timer, seconds, 0); + osmo_timer_schedule(&nsvc->timer, seconds, 0); } static void gprs_ns_timer_cb(void *data) @@ -786,7 +786,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg, rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]); if (nsvc->persistent || nsvc->remote_end_is_sgsn) { /* stop RESET timer */ - bsc_del_timer(&nsvc->timer); + osmo_timer_del(&nsvc->timer); } /* Initiate TEST proc.: Send ALIVE and start timer */ rc = gprs_ns_tx_simple(nsvc, NS_PDUT_ALIVE); diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 7d6580a19..9b7549fdd 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -243,7 +243,7 @@ static void release_loc_updating_req(struct gsm_subscriber_connection *conn) /* No need to keep the connection up */ release_anchor(conn); - bsc_del_timer(&conn->loc_operation->updating_timer); + osmo_timer_del(&conn->loc_operation->updating_timer); talloc_free(conn->loc_operation); conn->loc_operation = NULL; msc_release_connection(conn); @@ -483,7 +483,7 @@ static void schedule_reject(struct gsm_subscriber_connection *conn) { conn->loc_operation->updating_timer.cb = loc_upd_rej_cb; conn->loc_operation->updating_timer.data = conn; - bsc_schedule_timer(&conn->loc_operation->updating_timer, 5, 0); + osmo_timer_schedule(&conn->loc_operation->updating_timer, 5, 0); } static const char *lupd_name(uint8_t type) @@ -1331,9 +1331,9 @@ static int gsm48_tx_simple(struct gsm_subscriber_connection *conn, static void gsm48_stop_cc_timer(struct gsm_trans *trans) { - if (bsc_timer_pending(&trans->cc.timer)) { + if (osmo_timer_pending(&trans->cc.timer)) { DEBUGP(DCC, "stopping pending timer T%x\n", trans->cc.Tcurrent); - bsc_del_timer(&trans->cc.timer); + osmo_timer_del(&trans->cc.timer); trans->cc.Tcurrent = 0; } } @@ -1816,7 +1816,7 @@ static void gsm48_start_cc_timer(struct gsm_trans *trans, int current, DEBUGP(DCC, "starting timer T%x with %d seconds\n", current, sec); trans->cc.timer.cb = gsm48_cc_timeout; trans->cc.timer.data = trans; - bsc_schedule_timer(&trans->cc.timer, sec, micro); + osmo_timer_schedule(&trans->cc.timer, sec, micro); trans->cc.Tcurrent = current; } @@ -3269,7 +3269,7 @@ static void release_anchor(struct gsm_subscriber_connection *conn) if (!conn->anch_operation) return; - bsc_del_timer(&conn->anch_operation->timeout); + osmo_timer_del(&conn->anch_operation->timeout); talloc_free(conn->anch_operation); conn->anch_operation = NULL; } @@ -3290,7 +3290,7 @@ int gsm0408_new_conn(struct gsm_subscriber_connection *conn) conn->anch_operation->timeout.data = conn; conn->anch_operation->timeout.cb = anchor_timeout; - bsc_schedule_timer(&conn->anch_operation->timeout, 5, 0); + osmo_timer_schedule(&conn->anch_operation->timeout, 5, 0); return 0; } diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index c7ac8f4a4..1db307a1e 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -210,7 +210,7 @@ static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans, trans->sms.cp_timer.data = trans; trans->sms.cp_timer.cb = cp_timer_expired; /* 5.3.2.1: Set Timer TC1A */ - bsc_schedule_timer(&trans->sms.cp_timer, GSM411_TMR_TC1A); + osmo_timer_schedule(&trans->sms.cp_timer, GSM411_TMR_TC1A); DEBUGP(DSMS, "TX: CP-DATA "); break; case GSM411_MT_CP_ACK: @@ -1008,7 +1008,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, DEBUGP(DSMS, "Implicit CP-ACK for trans_id=%x\n", i); /* Finish it for good */ - bsc_del_timer(&ptrans->sms.cp_timer); + osmo_timer_del(&ptrans->sms.cp_timer); ptrans->sms.cp_state = GSM411_CPS_IDLE; trans_free(ptrans); } @@ -1039,7 +1039,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, /* 5.2.3.2.4: MT state exists when SMC has received CP-ACK */ trans->sms.cp_state = GSM411_CPS_MM_ESTABLISHED; /* Stop TC1* after CP-ACK has been received */ - bsc_del_timer(&trans->sms.cp_timer); + osmo_timer_del(&trans->sms.cp_timer); if (!trans->sms.is_mt) { /* FIXME: we have sent one CP-DATA, which was now @@ -1052,7 +1052,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, case GSM411_MT_CP_ERROR: DEBUGPC(DSMS, "RX SMS CP-ERROR, cause %d (%s)\n", gh->data[0], get_value_string(cp_cause_strs, gh->data[0])); - bsc_del_timer(&trans->sms.cp_timer); + osmo_timer_del(&trans->sms.cp_timer); trans->sms.cp_state = GSM411_CPS_IDLE; trans_free(trans); break; @@ -1208,7 +1208,7 @@ void _gsm411_sms_trans_free(struct gsm_trans *trans) trans->sms.sms = NULL; } - bsc_del_timer(&trans->sms.cp_timer); + osmo_timer_del(&trans->sms.cp_timer); } void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn) diff --git a/openbsc/src/libmsc/sms_queue.c b/openbsc/src/libmsc/sms_queue.c index f0d3d375c..18545bf11 100644 --- a/openbsc/src/libmsc/sms_queue.c +++ b/openbsc/src/libmsc/sms_queue.c @@ -54,8 +54,8 @@ struct gsm_sms_pending { }; struct gsm_sms_queue { - struct timer_list resend_pending; - struct timer_list push_queue; + struct osmo_timer_list resend_pending; + struct osmo_timer_list push_queue; struct gsm_network *network; int max_fail; int max_pending; @@ -129,10 +129,10 @@ static void sms_pending_resend(struct gsm_sms_pending *pending) pending->resend = 1; smsq = pending->subscr->net->sms_queue; - if (bsc_timer_pending(&smsq->resend_pending)) + if (osmo_timer_pending(&smsq->resend_pending)) return; - bsc_schedule_timer(&smsq->resend_pending, 1, 0); + osmo_timer_schedule(&smsq->resend_pending, 1, 0); } static void sms_pending_failed(struct gsm_sms_pending *pending, int paging_error) @@ -288,10 +288,10 @@ static void sms_submit_pending(void *_data) */ int sms_queue_trigger(struct gsm_sms_queue *smsq) { - if (bsc_timer_pending(&smsq->push_queue)) + if (osmo_timer_pending(&smsq->push_queue)) return 0; - bsc_schedule_timer(&smsq->push_queue, 1, 0); + osmo_timer_schedule(&smsq->push_queue, 1, 0); return 0; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 66d18c8a9..e1a95a89a 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -239,7 +239,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) else if (msg->l2h[0] == IPAC_MSGT_ID_GET) { send_id_get_response(data, bfd->fd); } else if (msg->l2h[0] == IPAC_MSGT_PONG) { - bsc_del_timer(&data->pong_timer); + osmo_timer_del(&data->pong_timer); } } else if (hh->proto == IPAC_PROTO_SCCP) { sccp_system_incoming(msg); @@ -278,10 +278,10 @@ static void msc_ping_timeout_cb(void *_data) send_ping(data); /* send another ping in 20 seconds */ - bsc_schedule_timer(&data->ping_timer, data->ping_timeout, 0); + osmo_timer_schedule(&data->ping_timer, data->ping_timeout, 0); /* also start a pong timer */ - bsc_schedule_timer(&data->pong_timer, data->pong_timeout, 0); + osmo_timer_schedule(&data->pong_timer, data->pong_timeout, 0); } static void msc_pong_timeout_cb(void *_data) @@ -321,8 +321,8 @@ static void msc_connection_was_lost(struct bsc_msc_connection *msc) LOGP(DMSC, LOGL_ERROR, "Lost MSC connection. Freing stuff.\n"); data = (struct osmo_msc_data *) msc->write_queue.bfd.data; - bsc_del_timer(&data->ping_timer); - bsc_del_timer(&data->pong_timer); + osmo_timer_del(&data->ping_timer); + osmo_timer_del(&data->pong_timer); sig.data = data; dispatch_signal(SS_MSC, S_MSC_LOST, &sig); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_rf.c b/openbsc/src/osmo-bsc/osmo_bsc_rf.c index 436474c0a..8df03069f 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_rf.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_rf.c @@ -160,7 +160,7 @@ static int enter_grace(struct osmo_bsc_rf *rf) { rf->grace_timeout.cb = grace_timeout; rf->grace_timeout.data = rf; - bsc_schedule_timer(&rf->grace_timeout, rf->gsm_network->msc_data->mid_call_timeout, 0); + osmo_timer_schedule(&rf->grace_timeout, rf->gsm_network->msc_data->mid_call_timeout, 0); LOGP(DINP, LOGL_NOTICE, "Going to switch RF off in %d seconds.\n", rf->gsm_network->msc_data->mid_call_timeout); @@ -175,20 +175,20 @@ static void rf_delay_cmd_cb(void *data) switch (rf->last_request) { case RF_CMD_D_OFF: rf->last_state_command = "RF Direct Off"; - bsc_del_timer(&rf->rf_check); - bsc_del_timer(&rf->grace_timeout); + osmo_timer_del(&rf->rf_check); + osmo_timer_del(&rf->grace_timeout); switch_rf_off(rf); break; case RF_CMD_ON: rf->last_state_command = "RF Direct On"; - bsc_del_timer(&rf->grace_timeout); + osmo_timer_del(&rf->grace_timeout); lock_each_trx(rf->gsm_network, 0); send_signal(rf, S_RF_ON); - bsc_schedule_timer(&rf->rf_check, 3, 0); + osmo_timer_schedule(&rf->rf_check, 3, 0); break; case RF_CMD_OFF: rf->last_state_command = "RF Scheduled Off"; - bsc_del_timer(&rf->rf_check); + osmo_timer_del(&rf->rf_check); enter_grace(rf); break; } @@ -218,8 +218,8 @@ static int rf_read_cmd(struct bsc_fd *fd) case RF_CMD_ON: case RF_CMD_OFF: conn->rf->last_request = buf[0]; - if (!bsc_timer_pending(&conn->rf->delay_cmd)) - bsc_schedule_timer(&conn->rf->delay_cmd, 1, 0); + if (!osmo_timer_pending(&conn->rf->delay_cmd)) + osmo_timer_schedule(&conn->rf->delay_cmd, 1, 0); break; default: conn->rf->last_state_command = "Unknown command"; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index 718f3054e..099552b6f 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -95,8 +95,8 @@ static void msc_outgoing_sccp_state(struct sccp_connection *conn, int old_state) LOGP(DMSC, LOGL_DEBUG, "Connection established: %p\n", conn); con_data = (struct osmo_bsc_sccp_con *) conn->data_ctx; - bsc_del_timer(&con_data->sccp_cc_timeout); - bsc_schedule_timer(&con_data->sccp_it_timeout, SCCP_IT_TIMER, 0); + osmo_timer_del(&con_data->sccp_cc_timeout); + osmo_timer_schedule(&con_data->sccp_it_timeout, SCCP_IT_TIMER, 0); send_queued(con_data); } @@ -122,7 +122,7 @@ static void sccp_it_timeout(void *_data) (struct osmo_bsc_sccp_con *) _data; sccp_connection_send_it(data->sccp); - bsc_schedule_timer(&data->sccp_it_timeout, SCCP_IT_TIMER, 0); + osmo_timer_schedule(&data->sccp_it_timeout, SCCP_IT_TIMER, 0); } static void sccp_cc_timeout(void *_data) @@ -231,7 +231,7 @@ int bsc_create_new_connection(struct gsm_subscriber_connection *conn) int bsc_open_connection(struct osmo_bsc_sccp_con *conn, struct msgb *msg) { - bsc_schedule_timer(&conn->sccp_cc_timeout, 10, 0); + osmo_timer_schedule(&conn->sccp_cc_timeout, 10, 0); sccp_connection_connect(conn->sccp, &sccp_ssn_bssap, msg); msgb_free(msg); return 0; @@ -246,8 +246,8 @@ int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp) LOGP(DMSC, LOGL_ERROR, "Should have been cleared.\n"); llist_del(&sccp->entry); - bsc_del_timer(&sccp->sccp_it_timeout); - bsc_del_timer(&sccp->sccp_cc_timeout); + osmo_timer_del(&sccp->sccp_it_timeout); + osmo_timer_del(&sccp->sccp_cc_timeout); talloc_free(sccp); return 0; } diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 3112ff37e..ffcd3884c 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -66,7 +66,7 @@ static const char *config_file = "bsc-nat.cfg"; static struct in_addr local_addr; static struct bsc_fd bsc_listen; static const char *msc_ip = NULL; -static struct timer_list sccp_close; +static struct osmo_timer_list sccp_close; static int daemonize = 0; const char *openbsc_copyright = @@ -153,10 +153,10 @@ static void bsc_ping_timeout(void *_bsc) send_ping(bsc); /* send another ping in 20 seconds */ - bsc_schedule_timer(&bsc->ping_timeout, bsc->nat->ping_timeout, 0); + osmo_timer_schedule(&bsc->ping_timeout, bsc->nat->ping_timeout, 0); /* also start a pong timer */ - bsc_schedule_timer(&bsc->pong_timeout, bsc->nat->pong_timeout, 0); + osmo_timer_schedule(&bsc->pong_timeout, bsc->nat->pong_timeout, 0); } static void start_ping_pong(struct bsc_connection *bsc) @@ -848,9 +848,9 @@ void bsc_close_connection(struct bsc_connection *connection) struct rate_ctr *ctr = NULL; /* stop the timeout timer */ - bsc_del_timer(&connection->id_timeout); - bsc_del_timer(&connection->ping_timeout); - bsc_del_timer(&connection->pong_timeout); + osmo_timer_del(&connection->id_timeout); + osmo_timer_del(&connection->ping_timeout); + osmo_timer_del(&connection->pong_timeout); if (connection->cfg) ctr = &connection->cfg->stats.ctrg->ctr[BCFG_CTR_DROPPED_SCCP]; @@ -930,7 +930,7 @@ static void ipaccess_auth_bsc(struct tlv_parsed *tvp, struct bsc_connection *bsc rate_ctr_inc(&conf->stats.ctrg->ctr[BCFG_CTR_NET_RECONN]); bsc->authenticated = 1; bsc->cfg = conf; - bsc_del_timer(&bsc->id_timeout); + osmo_timer_del(&bsc->id_timeout); LOGP(DNAT, LOGL_NOTICE, "Authenticated bsc nr: %d on fd %d\n", conf->nr, bsc->write_queue.bfd.fd); start_ping_pong(bsc); @@ -1177,7 +1177,7 @@ static int ipaccess_bsc_read_cb(struct bsc_fd *bfd) /* stop the pong timeout */ if (hh->proto == IPAC_PROTO_IPACCESS) { if (msg->l2h[0] == IPAC_MSGT_PONG) { - bsc_del_timer(&bsc->pong_timeout); + osmo_timer_del(&bsc->pong_timeout); msgb_free(msg); return 0; } else if (msg->l2h[0] == IPAC_MSGT_PING) { @@ -1275,7 +1275,7 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) */ bsc->id_timeout.data = bsc; bsc->id_timeout.cb = ipaccess_close_bsc; - bsc_schedule_timer(&bsc->id_timeout, nat->auth_timeout, 0); + osmo_timer_schedule(&bsc->id_timeout, nat->auth_timeout, 0); return 0; } @@ -1391,7 +1391,7 @@ static void sccp_close_unconfirmed(void *_data) bsc_maybe_close(bsc); out: - bsc_schedule_timer(&sccp_close, SCCP_CLOSE_TIME, 0); + osmo_timer_schedule(&sccp_close, SCCP_CLOSE_TIME, 0); } extern void *tall_msgb_ctx; @@ -1511,7 +1511,7 @@ int main(int argc, char **argv) sccp_set_log_area(DSCCP); sccp_close.cb = sccp_close_unconfirmed; sccp_close.data = NULL; - bsc_schedule_timer(&sccp_close, SCCP_CLOSE_TIME, 0); + osmo_timer_schedule(&sccp_close, SCCP_CLOSE_TIME, 0); while (1) { bsc_select_main(0); diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index 0392e9b10..5d599c734 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -59,7 +59,7 @@ static void bsc_nat_ussd_destroy(struct bsc_nat_ussd_con *con) close(con->queue.bfd.fd); bsc_unregister_fd(&con->queue.bfd); - bsc_del_timer(&con->auth_timeout); + osmo_timer_del(&con->auth_timeout); write_queue_clear(&con->queue); talloc_free(con); } @@ -168,7 +168,7 @@ static void ussd_auth_con(struct tlv_parsed *tvp, struct bsc_nat_ussd_con *conn) bsc_nat_ussd_destroy(conn->nat->ussd_con); LOGP(DNAT, LOGL_ERROR, "USSD token specified. USSD provider is connected.\n"); - bsc_del_timer(&conn->auth_timeout); + osmo_timer_del(&conn->auth_timeout); conn->authorized = 1; conn->nat->ussd_con = conn; } @@ -179,7 +179,7 @@ static void ussd_start_auth(struct bsc_nat_ussd_con *conn) conn->auth_timeout.data = conn; conn->auth_timeout.cb = ussd_auth_cb; - bsc_schedule_timer(&conn->auth_timeout, conn->nat->auth_timeout, 0); + osmo_timer_schedule(&conn->auth_timeout, conn->nat->auth_timeout, 0); msg = msgb_alloc_headroom(4096, 128, "auth message"); if (!msg) { diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 739253b90..8fec3688e 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -53,7 +53,7 @@ static int use_mncc_sock = 0; /* timer to store statistics */ #define DB_SYNC_INTERVAL 60, 0 -static struct timer_list db_sync_timer; +static struct osmo_timer_list db_sync_timer; extern int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), const char *cfg_file); @@ -204,7 +204,7 @@ static void db_sync_timer_cb(void *data) { /* store counters to database and re-schedule */ counters_for_each(_db_store_counter, NULL); - bsc_schedule_timer(&db_sync_timer, DB_SYNC_INTERVAL); + osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); } extern int bts_model_unknown_init(void); @@ -285,7 +285,7 @@ int main(int argc, char **argv) /* setup the timer */ db_sync_timer.cb = db_sync_timer_cb; db_sync_timer.data = NULL; - bsc_schedule_timer(&db_sync_timer, DB_SYNC_INTERVAL); + osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); signal(SIGINT, &signal_handler); signal(SIGABRT, &signal_handler); diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 9a61f4c16..8e987de6d 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -50,7 +50,7 @@ enum bs11cfg_state { }; static enum bs11cfg_state bs11cfg_state = STATE_NONE; static char *command, *value; -struct timer_list status_timer; +struct osmo_timer_list status_timer; static const uint8_t obj_li_attr[] = { NM_ATT_BS11_BIT_ERR_THESH, 0x09, 0x00, @@ -731,7 +731,7 @@ int handle_serial_msg(struct msgb *rx_msg) abis_nm_bs11_factory_logon(g_bts, 1); break; case STATE_LOGON_ACK: - bsc_schedule_timer(&status_timer, 5, 0); + osmo_timer_schedule(&status_timer, 5, 0); break; default: break; -- cgit v1.2.3