Lines Matching refs:task
73 static void __irda_task_delete(struct irda_task *task);
280 void irda_task_next_state(struct irda_task *task, IRDA_TASK_STATE state) in irda_task_next_state() argument
284 task->state = state; in irda_task_next_state()
287 static void __irda_task_delete(struct irda_task *task) in __irda_task_delete() argument
289 del_timer(&task->timer); in __irda_task_delete()
291 kfree(task); in __irda_task_delete()
294 void irda_task_delete(struct irda_task *task) in irda_task_delete() argument
297 hashbin_remove(tasks, (int) task, NULL); in irda_task_delete()
299 __irda_task_delete(task); in irda_task_delete()
310 int irda_task_kick(struct irda_task *task) in irda_task_kick() argument
318 ASSERT(task != NULL, return -1;); in irda_task_kick()
319 ASSERT(task->magic == IRDA_TASK_MAGIC, return -1;); in irda_task_kick()
323 timeout = task->function(task); in irda_task_kick()
326 irda_task_delete(task); in irda_task_kick()
329 } while ((timeout == 0) && (task->state != IRDA_TASK_DONE)); in irda_task_kick()
333 irda_task_delete(task); in irda_task_kick()
338 if (task->state == IRDA_TASK_DONE) { in irda_task_kick()
339 del_timer(&task->timer); in irda_task_kick()
342 if (task->finished) in irda_task_kick()
343 task->finished(task); in irda_task_kick()
346 if (task->parent) { in irda_task_kick()
348 if (task->parent->state == IRDA_TASK_CHILD_WAIT) { in irda_task_kick()
349 task->parent->state = IRDA_TASK_CHILD_DONE; in irda_task_kick()
352 del_timer(&task->parent->timer); in irda_task_kick()
355 irda_task_kick(task->parent); in irda_task_kick()
358 irda_task_delete(task); in irda_task_kick()
360 irda_start_timer(&task->timer, timeout, (void *) task, in irda_task_kick()
390 struct irda_task *task; in irda_task_execute() local
395 task = kmalloc(sizeof(struct irda_task), GFP_ATOMIC); in irda_task_execute()
396 if (!task) in irda_task_execute()
399 task->state = IRDA_TASK_INIT; in irda_task_execute()
400 task->instance = instance; in irda_task_execute()
401 task->function = function; in irda_task_execute()
402 task->finished = finished; in irda_task_execute()
403 task->parent = parent; in irda_task_execute()
404 task->param = param; in irda_task_execute()
405 task->magic = IRDA_TASK_MAGIC; in irda_task_execute()
407 init_timer(&task->timer); in irda_task_execute()
410 hashbin_insert(tasks, (irda_queue_t *) task, (int) task, NULL); in irda_task_execute()
413 ret = irda_task_kick(task); in irda_task_execute()
417 return task; in irda_task_execute()
428 struct irda_task *task; in irda_task_timer_expired() local
432 task = (struct irda_task *) data; in irda_task_timer_expired()
434 irda_task_kick(task); in irda_task_timer_expired()