thermal_nl.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: LGPL-2.1+ */
  2. /* Copyright (C) 2022, Linaro Ltd - Daniel Lezcano <[email protected]> */
  3. #ifndef __THERMAL_H
  4. #define __THERMAL_H
  5. #include <netlink/netlink.h>
  6. #include <netlink/genl/genl.h>
  7. #include <netlink/genl/mngt.h>
  8. #include <netlink/genl/ctrl.h>
  9. struct thermal_handler {
  10. int done;
  11. int error;
  12. struct thermal_ops *ops;
  13. struct nl_msg *msg;
  14. struct nl_sock *sk_event;
  15. struct nl_sock *sk_sampling;
  16. struct nl_sock *sk_cmd;
  17. struct nl_cb *cb_cmd;
  18. struct nl_cb *cb_event;
  19. struct nl_cb *cb_sampling;
  20. };
  21. struct thermal_handler_param {
  22. struct thermal_handler *th;
  23. void *arg;
  24. };
  25. /*
  26. * Low level netlink
  27. */
  28. extern int nl_subscribe_thermal(struct nl_sock *nl_sock, struct nl_cb *nl_cb,
  29. const char *group);
  30. extern int nl_unsubscribe_thermal(struct nl_sock *nl_sock, struct nl_cb *nl_cb,
  31. const char *group);
  32. extern int nl_thermal_connect(struct nl_sock **nl_sock, struct nl_cb **nl_cb);
  33. extern void nl_thermal_disconnect(struct nl_sock *nl_sock, struct nl_cb *nl_cb);
  34. extern int nl_send_msg(struct nl_sock *sock, struct nl_cb *nl_cb, struct nl_msg *msg,
  35. int (*rx_handler)(struct nl_msg *, void *),
  36. void *data);
  37. #endif /* __THERMAL_H */