1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
3 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
4 * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
14 TASK_STATE_DRAINING = 3,
15 TASK_STATE_DRAINED = 4,
16 TASK_STATE_INVALID = 5,
20 * data structure to describe a 'task' which is a short
21 * function that returns 0 as long as it needs to be
25 struct tasklet_struct tasklet;
29 int (*func)(struct rxe_qp *qp);
36 * init rxe_task structure
37 * qp => parameter to pass to func
38 * func => function to call until it returns != 0
40 int rxe_init_task(struct rxe_task *task, struct rxe_qp *qp,
41 int (*func)(struct rxe_qp *));
44 void rxe_cleanup_task(struct rxe_task *task);
46 void rxe_run_task(struct rxe_task *task);
48 void rxe_sched_task(struct rxe_task *task);
50 /* keep a task from scheduling */
51 void rxe_disable_task(struct rxe_task *task);
53 /* allow task to run */
54 void rxe_enable_task(struct rxe_task *task);
56 #endif /* RXE_TASK_H */