File: thermal_nl.h

package info (click to toggle)
linux 6.1.139-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,495,880 kB
  • sloc: ansic: 23,469,452; asm: 266,614; sh: 110,522; makefile: 49,887; python: 36,990; perl: 36,834; cpp: 6,056; yacc: 4,908; lex: 2,725; awk: 1,440; ruby: 25; sed: 5
file content (46 lines) | stat: -rw-r--r-- 1,207 bytes parent folder | download | duplicates (17)
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
40
41
42
43
44
45
46
/* SPDX-License-Identifier: LGPL-2.1+ */
/* Copyright (C) 2022, Linaro Ltd - Daniel Lezcano <daniel.lezcano@linaro.org> */
#ifndef __THERMAL_H
#define __THERMAL_H

#include <netlink/netlink.h>
#include <netlink/genl/genl.h>
#include <netlink/genl/mngt.h>
#include <netlink/genl/ctrl.h>

struct thermal_handler {
	int done;
	int error;
	struct thermal_ops *ops;
	struct nl_msg *msg;
	struct nl_sock *sk_event;
	struct nl_sock *sk_sampling;
	struct nl_sock *sk_cmd;
	struct nl_cb *cb_cmd;
	struct nl_cb *cb_event;
	struct nl_cb *cb_sampling;
};

struct thermal_handler_param {
	struct thermal_handler *th;
	void *arg;
};

/*
 * Low level netlink
 */
extern int nl_subscribe_thermal(struct nl_sock *nl_sock, struct nl_cb *nl_cb,
				const char *group);

extern int nl_unsubscribe_thermal(struct nl_sock *nl_sock, struct nl_cb *nl_cb,
				  const char *group);

extern int nl_thermal_connect(struct nl_sock **nl_sock, struct nl_cb **nl_cb);

extern void nl_thermal_disconnect(struct nl_sock *nl_sock, struct nl_cb *nl_cb);

extern int nl_send_msg(struct nl_sock *sock, struct nl_cb *nl_cb, struct nl_msg *msg,
		       int (*rx_handler)(struct nl_msg *, void *),
		       void *data);

#endif /* __THERMAL_H */