Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: LGPL-2.1+ */
0002 /* Copyright (C) 2022, Linaro Ltd - Daniel Lezcano <daniel.lezcano@linaro.org> */
0003 #ifndef __THERMAL_H
0004 #define __THERMAL_H
0005 
0006 #include <netlink/netlink.h>
0007 #include <netlink/genl/genl.h>
0008 #include <netlink/genl/mngt.h>
0009 #include <netlink/genl/ctrl.h>
0010 
0011 struct thermal_handler {
0012     int done;
0013     int error;
0014     struct thermal_ops *ops;
0015     struct nl_msg *msg;
0016     struct nl_sock *sk_event;
0017     struct nl_sock *sk_sampling;
0018     struct nl_sock *sk_cmd;
0019     struct nl_cb *cb_cmd;
0020     struct nl_cb *cb_event;
0021     struct nl_cb *cb_sampling;
0022 };
0023 
0024 struct thermal_handler_param {
0025     struct thermal_handler *th;
0026     void *arg;
0027 };
0028 
0029 /*
0030  * Low level netlink
0031  */
0032 extern int nl_subscribe_thermal(struct nl_sock *nl_sock, struct nl_cb *nl_cb,
0033                 const char *group);
0034 
0035 extern int nl_unsubscribe_thermal(struct nl_sock *nl_sock, struct nl_cb *nl_cb,
0036                   const char *group);
0037 
0038 extern int nl_thermal_connect(struct nl_sock **nl_sock, struct nl_cb **nl_cb);
0039 
0040 extern void nl_thermal_disconnect(struct nl_sock *nl_sock, struct nl_cb *nl_cb);
0041 
0042 extern int nl_send_msg(struct nl_sock *sock, struct nl_cb *nl_cb, struct nl_msg *msg,
0043                int (*rx_handler)(struct nl_msg *, void *),
0044                void *data);
0045 
0046 #endif /* __THERMAL_H */