File: em_netlink.h

package info (click to toggle)
linux 6.19.5-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,759,704 kB
  • sloc: ansic: 27,007,363; asm: 273,421; sh: 151,330; python: 81,278; makefile: 58,557; perl: 34,311; xml: 21,064; cpp: 5,986; yacc: 4,841; lex: 2,901; awk: 1,707; sed: 30; ruby: 25
file content (39 lines) | stat: -rw-r--r-- 1,090 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* SPDX-License-Identifier: GPL-2.0 */
/*
 *
 * Generic netlink for energy model.
 *
 * Copyright (c) 2025 Valve Corporation.
 * Author: Changwoo Min <changwoo@igalia.com>
 */
#ifndef _EM_NETLINK_H
#define _EM_NETLINK_H

#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_NET)
int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
			    void *data);
struct em_perf_domain *em_perf_domain_get_by_id(int id);
void em_notify_pd_created(const struct em_perf_domain *pd);
void em_notify_pd_deleted(const struct em_perf_domain *pd);
void em_notify_pd_updated(const struct em_perf_domain *pd);
#else
static inline
int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
			    void *data)
{
	return -EINVAL;
}
static inline
struct em_perf_domain *em_perf_domain_get_by_id(int id)
{
	return NULL;
}

static inline void em_notify_pd_created(const struct em_perf_domain *pd) {}

static inline void em_notify_pd_deleted(const struct em_perf_domain *pd) {}

static inline void em_notify_pd_updated(const struct em_perf_domain *pd) {}
#endif

#endif /* _EM_NETLINK_H */