diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-07 00:25:39 +0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-27 04:10:53 +0400 |
commit | 55c5e0f85dc550f03dc8a0b0097da6af3b4865c5 (patch) | |
tree | b6f2087958e641be791136e79912f69656391225 /drivers/net/ethernet/sfc/nic.h | |
parent | 1646a6f352a6f70fcca828589ed04797aa09d494 (diff) | |
download | linux-55c5e0f85dc550f03dc8a0b0097da6af3b4865c5.tar.xz |
sfc: Add hwmon driver for boards using SFC9000-family controllers
The SFC9000-family controllers have firmware to manage all board
peripherals including temperature, heat sink continuity and voltage
sensors. The firmware reports sensor alarms, which we log, and
will shut down the board if necessary.
Some users may want to monitor their boards more closely, so add an
hwmon driver that exposes all sensors reported by the firmware. Move
efx_mcdi_sensor_event() into the new file so it can share the array of
sensor labels with the hwmon driver.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/nic.h')
-rw-r--r-- | drivers/net/ethernet/sfc/nic.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h index a3ccd0b9d78d..905a1877d603 100644 --- a/drivers/net/ethernet/sfc/nic.h +++ b/drivers/net/ethernet/sfc/nic.h @@ -144,12 +144,26 @@ static inline struct falcon_board *falcon_board(struct efx_nic *efx) * struct siena_nic_data - Siena NIC state * @mcdi: Management-Controller-to-Driver Interface * @wol_filter_id: Wake-on-LAN packet filter id + * @hwmon: Hardware monitor state */ struct siena_nic_data { struct efx_mcdi_iface mcdi; int wol_filter_id; +#ifdef CONFIG_SFC_MCDI_MON + struct efx_mcdi_mon hwmon; +#endif }; +#ifdef CONFIG_SFC_MCDI_MON +static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx) +{ + struct siena_nic_data *nic_data; + EFX_BUG_ON_PARANOID(efx_nic_rev(efx) < EFX_REV_SIENA_A0); + nic_data = efx->nic_data; + return &nic_data->hwmon; +} +#endif + extern const struct efx_nic_type falcon_a1_nic_type; extern const struct efx_nic_type falcon_b0_nic_type; extern const struct efx_nic_type siena_a0_nic_type; |