summaryrefslogtreecommitdiff
path: root/drivers/thermal/thermal_netlink.h
diff options
context:
space:
mode:
authorStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>2024-02-23 18:59:40 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-03-27 16:50:26 +0300
commitcf580ad490514cca4abbfef710fe4099738abfbd (patch)
tree52ac67b131a0aba3207d0e9155fb77f8ae62135f /drivers/thermal/thermal_netlink.h
parentf67cf45deedb118af302534643627ce59074e8eb (diff)
downloadlinux-cf580ad490514cca4abbfef710fe4099738abfbd.tar.xz
thermal: netlink: Add genetlink bind/unbind notifications
Introduce a new feature to the thermal netlink framework, enabling the registration of sub drivers to receive events via a notifier mechanism. Specifically, implement genetlink family bind and unbind callbacks to send BIND and UNBIND events. The primary purpose of this enhancement is to facilitate the tracking of user-space consumers by the Intel HFI driver. By leveraging these notifications, the driver can determine when consumers are present or absent. Suggested-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_netlink.h')
-rw-r--r--drivers/thermal/thermal_netlink.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
index 93a927e144d5..e01221e8816b 100644
--- a/drivers/thermal/thermal_netlink.h
+++ b/drivers/thermal/thermal_netlink.h
@@ -10,6 +10,19 @@ struct thermal_genl_cpu_caps {
int efficiency;
};
+enum thermal_genl_multicast_groups {
+ THERMAL_GENL_SAMPLING_GROUP = 0,
+ THERMAL_GENL_EVENT_GROUP = 1,
+ THERMAL_GENL_MAX_GROUP = THERMAL_GENL_EVENT_GROUP,
+};
+
+#define THERMAL_NOTIFY_BIND 0
+#define THERMAL_NOTIFY_UNBIND 1
+
+struct thermal_genl_notify {
+ int mcgrp;
+};
+
struct thermal_zone_device;
struct thermal_trip;
struct thermal_cooling_device;
@@ -18,6 +31,9 @@ struct thermal_cooling_device;
#ifdef CONFIG_THERMAL_NETLINK
int __init thermal_netlink_init(void);
void __init thermal_netlink_exit(void);
+int thermal_genl_register_notifier(struct notifier_block *nb);
+int thermal_genl_unregister_notifier(struct notifier_block *nb);
+
int thermal_notify_tz_create(const struct thermal_zone_device *tz);
int thermal_notify_tz_delete(const struct thermal_zone_device *tz);
int thermal_notify_tz_enable(const struct thermal_zone_device *tz);
@@ -48,6 +64,16 @@ static inline int thermal_notify_tz_create(const struct thermal_zone_device *tz)
return 0;
}
+static inline int thermal_genl_register_notifier(struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int thermal_genl_unregister_notifier(struct notifier_block *nb)
+{
+ return 0;
+}
+
static inline int thermal_notify_tz_delete(const struct thermal_zone_device *tz)
{
return 0;