diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-10-29 13:44:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-30 14:54:11 -0400 |
commit | 51579c3f1a9192b75365576227d40c7619493285 (patch) | |
tree | e8609bf267a534ab1e5ea4418e868e476a6f517a /include/net/dsa.h | |
parent | 2716777b4f21649fb907b4a4fb96e1c8d0a5ec16 (diff) |
net: dsa: Add support for reporting switch chip temperatures
Some switches provide chip temperature data.
Add support for reporting it through the hwmon subsystem.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r-- | include/net/dsa.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h index b76559293535..55e75e7e8d41 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h | |||
@@ -139,6 +139,14 @@ struct dsa_switch { | |||
139 | */ | 139 | */ |
140 | struct device *master_dev; | 140 | struct device *master_dev; |
141 | 141 | ||
142 | #ifdef CONFIG_NET_DSA_HWMON | ||
143 | /* | ||
144 | * Hardware monitoring information | ||
145 | */ | ||
146 | char hwmon_name[IFNAMSIZ + 8]; | ||
147 | struct device *hwmon_dev; | ||
148 | #endif | ||
149 | |||
142 | /* | 150 | /* |
143 | * Slave mii_bus and devices for the individual ports. | 151 | * Slave mii_bus and devices for the individual ports. |
144 | */ | 152 | */ |
@@ -242,6 +250,14 @@ struct dsa_switch_driver { | |||
242 | struct ethtool_eee *e); | 250 | struct ethtool_eee *e); |
243 | int (*get_eee)(struct dsa_switch *ds, int port, | 251 | int (*get_eee)(struct dsa_switch *ds, int port, |
244 | struct ethtool_eee *e); | 252 | struct ethtool_eee *e); |
253 | |||
254 | #ifdef CONFIG_NET_DSA_HWMON | ||
255 | /* Hardware monitoring */ | ||
256 | int (*get_temp)(struct dsa_switch *ds, int *temp); | ||
257 | int (*get_temp_limit)(struct dsa_switch *ds, int *temp); | ||
258 | int (*set_temp_limit)(struct dsa_switch *ds, int temp); | ||
259 | int (*get_temp_alarm)(struct dsa_switch *ds, bool *alarm); | ||
260 | #endif | ||
245 | }; | 261 | }; |
246 | 262 | ||
247 | void register_switch_driver(struct dsa_switch_driver *type); | 263 | void register_switch_driver(struct dsa_switch_driver *type); |