projects/linux·blob master · refs

39 lines · 1.1 KiB

1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 *
4 * Generic netlink for energy model.
5 *
6 * Copyright (c) 2025 Valve Corporation.
7 * Author: Changwoo Min <[email protected]>
8 */
9#ifndef _EM_NETLINK_H
10#define _EM_NETLINK_H
11
12#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_NET)
13int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
14 void *data);
15struct em_perf_domain *em_perf_domain_get_by_id(int id);
16void em_notify_pd_created(const struct em_perf_domain *pd);
17void em_notify_pd_deleted(const struct em_perf_domain *pd);
18void em_notify_pd_updated(const struct em_perf_domain *pd);
19#else
20static inline
21int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
22 void *data)
23{
24 return -EINVAL;
25}
26static inline
27struct em_perf_domain *em_perf_domain_get_by_id(int id)
28{
29 return NULL;
30}
31
32static inline void em_notify_pd_created(const struct em_perf_domain *pd) {}
33
34static inline void em_notify_pd_deleted(const struct em_perf_domain *pd) {}
35
36static inline void em_notify_pd_updated(const struct em_perf_domain *pd) {}
37#endif
38
39#endif /* _EM_NETLINK_H */