Lines Matching refs:timer

90 QDF_TIMER_STATE qdf_mc_timer_get_current_state(qdf_mc_timer_t *timer)  in qdf_mc_timer_get_current_state()  argument
94 if (!timer) { in qdf_mc_timer_get_current_state()
99 qdf_spin_lock_irqsave(&timer->platform_info.spinlock); in qdf_mc_timer_get_current_state()
101 switch (timer->state) { in qdf_mc_timer_get_current_state()
106 timer_state = timer->state; in qdf_mc_timer_get_current_state()
111 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_get_current_state()
252 timer); in __os_mc_timer_shim()
253 qdf_mc_timer_t *timer = qdf_container_of(platform_info_ptr, in __os_mc_timer_shim() local
257 scheduler_timer_callback(timer); in __os_mc_timer_shim()
260 static void qdf_mc_timer_setup(qdf_mc_timer_t *timer, in qdf_mc_timer_setup() argument
268 timer_setup(&timer->platform_info.timer, in qdf_mc_timer_setup()
274 qdf_mc_timer_t *timer = (qdf_mc_timer_t *)data; in __os_mc_timer_shim() local
276 scheduler_timer_callback(timer); in __os_mc_timer_shim()
279 static void qdf_mc_timer_setup(qdf_mc_timer_t *timer, in qdf_mc_timer_setup() argument
283 init_timer_deferrable(&timer->platform_info.timer); in qdf_mc_timer_setup()
285 init_timer(&timer->platform_info.timer); in qdf_mc_timer_setup()
287 timer->platform_info.timer.function = __os_mc_timer_shim; in qdf_mc_timer_setup()
288 timer->platform_info.timer.data = (unsigned long)timer; in qdf_mc_timer_setup()
292 QDF_STATUS qdf_mc_timer_init_debug(qdf_mc_timer_t *timer, in qdf_mc_timer_init_debug() argument
303 if ((!timer) || (!callback)) { in qdf_mc_timer_init_debug()
310 timer->timer_node = qdf_mem_malloc(sizeof(qdf_mc_timer_node_t)); in qdf_mc_timer_init_debug()
312 if (!timer->timer_node) { in qdf_mc_timer_init_debug()
317 timer->timer_node->file_name = file_name; in qdf_mc_timer_init_debug()
318 timer->timer_node->line_num = line_num; in qdf_mc_timer_init_debug()
319 timer->timer_node->qdf_timer = timer; in qdf_mc_timer_init_debug()
323 &timer->timer_node->node); in qdf_mc_timer_init_debug()
334 qdf_spinlock_create(&timer->platform_info.spinlock); in qdf_mc_timer_init_debug()
335 qdf_mc_timer_setup(timer, timer_type); in qdf_mc_timer_init_debug()
336 timer->callback = callback; in qdf_mc_timer_init_debug()
337 timer->user_data = user_data; in qdf_mc_timer_init_debug()
338 timer->type = timer_type; in qdf_mc_timer_init_debug()
339 timer->platform_info.cookie = LINUX_TIMER_COOKIE; in qdf_mc_timer_init_debug()
340 timer->platform_info.thread_id = 0; in qdf_mc_timer_init_debug()
341 timer->state = QDF_TIMER_STATE_STOPPED; in qdf_mc_timer_init_debug()
347 QDF_STATUS qdf_mc_timer_init(qdf_mc_timer_t *timer, QDF_TIMER_TYPE timer_type, in qdf_mc_timer_init() argument
352 if ((!timer) || (!callback)) { in qdf_mc_timer_init()
362 qdf_spinlock_create(&timer->platform_info.spinlock); in qdf_mc_timer_init()
363 qdf_mc_timer_setup(timer, timer_type); in qdf_mc_timer_init()
364 timer->callback = callback; in qdf_mc_timer_init()
365 timer->user_data = user_data; in qdf_mc_timer_init()
366 timer->type = timer_type; in qdf_mc_timer_init()
367 timer->platform_info.cookie = LINUX_TIMER_COOKIE; in qdf_mc_timer_init()
368 timer->platform_info.thread_id = 0; in qdf_mc_timer_init()
369 timer->state = QDF_TIMER_STATE_STOPPED; in qdf_mc_timer_init()
377 QDF_STATUS qdf_mc_timer_destroy(qdf_mc_timer_t *timer) in qdf_mc_timer_destroy() argument
384 if (!timer) { in qdf_mc_timer_destroy()
392 if (LINUX_TIMER_COOKIE != timer->platform_info.cookie) { in qdf_mc_timer_destroy()
401 &timer->timer_node->node); in qdf_mc_timer_destroy()
407 qdf_mem_free(timer->timer_node); in qdf_mc_timer_destroy()
409 qdf_spin_lock_irqsave(&timer->platform_info.spinlock); in qdf_mc_timer_destroy()
411 switch (timer->state) { in qdf_mc_timer_destroy()
419 del_timer(&(timer->platform_info.timer)); in qdf_mc_timer_destroy()
436 timer->platform_info.cookie = LINUX_INVALID_TIMER_COOKIE; in qdf_mc_timer_destroy()
437 timer->state = QDF_TIMER_STATE_UNUSED; in qdf_mc_timer_destroy()
438 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_destroy()
439 qdf_spinlock_destroy(&timer->platform_info.spinlock); in qdf_mc_timer_destroy()
443 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_destroy()
447 timer->state); in qdf_mc_timer_destroy()
456 QDF_STATUS qdf_mc_timer_destroy(qdf_mc_timer_t *timer) in qdf_mc_timer_destroy() argument
461 if (!timer) { in qdf_mc_timer_destroy()
469 if (LINUX_TIMER_COOKIE != timer->platform_info.cookie) { in qdf_mc_timer_destroy()
475 qdf_spin_lock_irqsave(&timer->platform_info.spinlock); in qdf_mc_timer_destroy()
477 switch (timer->state) { in qdf_mc_timer_destroy()
485 del_timer(&(timer->platform_info.timer)); in qdf_mc_timer_destroy()
503 timer->platform_info.cookie = LINUX_INVALID_TIMER_COOKIE; in qdf_mc_timer_destroy()
504 timer->state = QDF_TIMER_STATE_UNUSED; in qdf_mc_timer_destroy()
505 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_destroy()
509 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_destroy()
513 timer->state); in qdf_mc_timer_destroy()
521 QDF_STATUS qdf_mc_timer_start(qdf_mc_timer_t *timer, uint32_t expiration_time) in qdf_mc_timer_start() argument
524 if (!timer) { in qdf_mc_timer_start()
532 if (LINUX_TIMER_COOKIE != timer->platform_info.cookie) { in qdf_mc_timer_start()
549 qdf_spin_lock_irqsave(&timer->platform_info.spinlock); in qdf_mc_timer_start()
552 if (QDF_TIMER_STATE_STOPPED != timer->state) { in qdf_mc_timer_start()
553 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_start()
556 __func__, timer->state, (void *)timer->callback); in qdf_mc_timer_start()
561 mod_timer(&(timer->platform_info.timer), in qdf_mc_timer_start()
564 timer->state = QDF_TIMER_STATE_RUNNING; in qdf_mc_timer_start()
570 timer->timer_start_jiffies = jiffies; in qdf_mc_timer_start()
573 timer->platform_info.thread_id = current->pid; in qdf_mc_timer_start()
575 if (QDF_TIMER_TYPE_WAKE_APPS == timer->type) { in qdf_mc_timer_start()
585 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_start()
591 QDF_STATUS qdf_mc_timer_stop(qdf_mc_timer_t *timer) in qdf_mc_timer_stop() argument
594 if (!timer) { in qdf_mc_timer_stop()
602 if (LINUX_TIMER_COOKIE != timer->platform_info.cookie) { in qdf_mc_timer_stop()
611 qdf_spin_lock_irqsave(&timer->platform_info.spinlock); in qdf_mc_timer_stop()
613 if (QDF_TIMER_STATE_RUNNING != timer->state) { in qdf_mc_timer_stop()
614 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_stop()
618 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_stop()
620 del_timer(&(timer->platform_info.timer)); in qdf_mc_timer_stop()
622 qdf_spin_lock_irqsave(&timer->platform_info.spinlock); in qdf_mc_timer_stop()
623 timer->state = QDF_TIMER_STATE_STOPPED; in qdf_mc_timer_stop()
624 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_stop()
626 qdf_try_allowing_sleep(timer->type); in qdf_mc_timer_stop()
632 QDF_STATUS qdf_mc_timer_stop_sync(qdf_mc_timer_t *timer) in qdf_mc_timer_stop_sync() argument
635 if (!timer) { in qdf_mc_timer_stop_sync()
643 if (LINUX_TIMER_COOKIE != timer->platform_info.cookie) { in qdf_mc_timer_stop_sync()
652 qdf_spin_lock_irqsave(&timer->platform_info.spinlock); in qdf_mc_timer_stop_sync()
654 if (QDF_TIMER_STATE_RUNNING != timer->state) { in qdf_mc_timer_stop_sync()
655 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_stop_sync()
659 timer->state = QDF_TIMER_STATE_STOPPED; in qdf_mc_timer_stop_sync()
661 qdf_spin_unlock_irqrestore(&timer->platform_info.spinlock); in qdf_mc_timer_stop_sync()
662 del_timer_sync(&(timer->platform_info.timer)); in qdf_mc_timer_stop_sync()
664 qdf_try_allowing_sleep(timer->type); in qdf_mc_timer_stop_sync()