1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * drivers/auth_ctl/auth_ctrl.h
4 *
5 * Copyright (c) 2022 Huawei Device Co., Ltd.
6 *
7 */
8
9#ifndef __AUTH_CTRL_H
10#define __AUTH_CTRL_H
11
12#include <linux/ioctl.h>
13#include <linux/types.h>
14#include <linux/spinlock.h>
15#include <linux/list.h>
16#include <linux/refcount.h>
17
18#include <linux/sched/qos_ctrl.h>
19
20struct auth_struct {
21	struct mutex mutex;
22	refcount_t usage;
23	unsigned int status;
24#ifdef CONFIG_RTG_AUTHORITY
25	unsigned int rtg_auth_flag;
26#endif
27#ifdef CONFIG_QOS_AUTHORITY
28	unsigned int qos_auth_flag;
29#endif
30#ifdef CONFIG_QOS_CTRL
31	unsigned int num[NR_QOS];
32	struct list_head tasks[NR_QOS];
33#endif
34};
35
36/*
37 * for debug fs
38 */
39struct idr *get_auth_ctrl_idr(void);
40struct mutex *get_auth_idr_mutex(void);
41
42#ifdef CONFIG_AUTH_QOS_DEBUG
43int __init init_sched_auth_debug_procfs(void);
44#else
45static inline int init_sched_auth_debug_procfs(void)
46{
47	return 0;
48}
49#endif
50
51#endif /* __AUTH_CTRL_H */
52
53