Lines Matching +full:timer +full:-

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
6 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
41 struct ISCI_TIMER *timer = (struct ISCI_TIMER *)arg; in isci_timer_timeout() local
43 isci_log_message(3, "TIMER", "timeout %p\n", timer); in isci_timer_timeout()
45 /* callout_stop() will *not* keep the timer from running if it is in isci_timer_timeout()
49 * the timer routine should actually be run or not. in isci_timer_timeout()
51 if (timer->is_started == TRUE) in isci_timer_timeout()
52 timer->callback(timer->cookie); in isci_timer_timeout()
56 * @brief This callback method asks the user to start the supplied timer.
60 * removes the timer from it's list when a timer actually fires.
62 * calls from the SCI Framework to stop a timer that may already
66 * which this timer is to associated.
67 * @param[in] timer This parameter specifies the timer to be started.
75 scif_cb_timer_start(SCI_CONTROLLER_HANDLE_T controller, void *timer, in scif_cb_timer_start() argument
78 struct ISCI_TIMER *isci_timer = (struct ISCI_TIMER *)timer; in scif_cb_timer_start()
80 isci_timer->is_started = TRUE; in scif_cb_timer_start()
81 isci_log_message(3, "TIMER", "start %p %d\n", timer, milliseconds); in scif_cb_timer_start()
82 callout_reset_sbt(&isci_timer->callout, SBT_1MS * milliseconds, 0, in scif_cb_timer_start()
83 isci_timer_timeout, timer, 0); in scif_cb_timer_start()
87 * @brief This callback method asks the user to stop the supplied timer.
90 * which this timer is to associated.
91 * @param[in] timer This parameter specifies the timer to be stopped.
96 scif_cb_timer_stop(SCI_CONTROLLER_HANDLE_T controller, void *timer) in scif_cb_timer_stop() argument
98 struct ISCI_TIMER *isci_timer = (struct ISCI_TIMER *)timer; in scif_cb_timer_stop()
100 isci_log_message(3, "TIMER", "stop %p\n", timer); in scif_cb_timer_stop()
101 isci_timer->is_started = FALSE; in scif_cb_timer_stop()
102 callout_stop(&isci_timer->callout); in scif_cb_timer_stop()
106 * @brief This callback method asks the user to create a timer and provide
107 * a handle for this timer for use in further timer interactions.
114 * to be invoked whenever the timer expires.
116 * which this timer is to be associated.
119 * user anytime a timeout occurs for the created timer.
121 * @return This method returns a handle to a timer object created by the
123 * relating to this timer.
131 struct ISCI_TIMER *timer; in scif_cb_timer_create() local
133 sci_pool_get(isci_controller->timer_pool, timer); in scif_cb_timer_create()
135 callout_init_mtx(&timer->callout, &isci_controller->lock, FALSE); in scif_cb_timer_create()
137 timer->callback = timer_callback; in scif_cb_timer_create()
138 timer->cookie = cookie; in scif_cb_timer_create()
139 timer->is_started = FALSE; in scif_cb_timer_create()
141 isci_log_message(3, "TIMER", "create %p %p %p\n", timer, timer_callback, cookie); in scif_cb_timer_create()
143 return (timer); in scif_cb_timer_create()
147 * @brief This callback method asks the user to destroy the supplied timer.
150 * which this timer is to associated.
151 * @param[in] timer This parameter specifies the timer to be destroyed.
163 sci_pool_put(isci_controller->timer_pool, (struct ISCI_TIMER *)timer_handle); in scif_cb_timer_destroy()
165 isci_log_message(3, "TIMER", "destroy %p\n", timer_handle); in scif_cb_timer_destroy()