blob: e322d813e4ea0ea1f634e58f0b7c3cc4c35377ec [file] [log] [blame]
Amir Levy9659e592016-10-27 18:08:27 +03001/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _IPA_RM_DEPENDENCY_GRAPH_H_
14#define _IPA_RM_DEPENDENCY_GRAPH_H_
15
16#include <linux/list.h>
17#include <linux/ipa.h>
18#include "ipa_rm_resource.h"
19
20struct ipa_rm_dep_graph {
21 struct ipa_rm_resource *resource_table[IPA_RM_RESOURCE_MAX];
22};
23
24int ipa_rm_dep_graph_get_resource(
25 struct ipa_rm_dep_graph *graph,
26 enum ipa_rm_resource_name name,
27 struct ipa_rm_resource **resource);
28
29int ipa_rm_dep_graph_create(struct ipa_rm_dep_graph **dep_graph);
30
31void ipa_rm_dep_graph_delete(struct ipa_rm_dep_graph *graph);
32
33int ipa_rm_dep_graph_add(struct ipa_rm_dep_graph *graph,
34 struct ipa_rm_resource *resource);
35
36int ipa_rm_dep_graph_remove(struct ipa_rm_dep_graph *graph,
37 enum ipa_rm_resource_name resource_name);
38
39int ipa_rm_dep_graph_add_dependency(struct ipa_rm_dep_graph *graph,
40 enum ipa_rm_resource_name resource_name,
41 enum ipa_rm_resource_name depends_on_name,
42 bool userspsace_dep);
43
44int ipa_rm_dep_graph_delete_dependency(struct ipa_rm_dep_graph *graph,
45 enum ipa_rm_resource_name resource_name,
46 enum ipa_rm_resource_name depends_on_name,
47 bool userspsace_dep);
48
49#endif /* _IPA_RM_DEPENDENCY_GRAPH_H_ */