diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-09-18 03:33:56 +0200 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2013-08-21 20:43:27 +0200 |
commit | f3ad50034425692965a0f2becdd9c45ecb45cd66 (patch) | |
tree | 0ada5470ce0cc43c1589ebd619bba22716b4844f /drivers/net/ethernet/sfc/mcdi.h | |
parent | sfc: Make efx_mcdi_init() call efx_mcdi_handle_assertion() (diff) | |
download | linux-f3ad50034425692965a0f2becdd9c45ecb45cd66.tar.xz linux-f3ad50034425692965a0f2becdd9c45ecb45cd66.zip |
sfc: Make MCDI independent of Siena
Move the lowest layer (transport) of the current MCDI code to
per-NIC-type operations.
Introduce a new structure and efx_nic member for MCDI-specific data.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi.h')
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h index 6c58dbd7f581..0bfed2a64399 100644 --- a/drivers/net/ethernet/sfc/mcdi.h +++ b/drivers/net/ethernet/sfc/mcdi.h @@ -65,7 +65,28 @@ struct efx_mcdi_mon { unsigned int n_attrs; }; +/** + * struct efx_mcdi_data - extra state for NICs that implement MCDI + * @iface: Interface/protocol state + * @hwmon: Hardware monitor state + */ +struct efx_mcdi_data { + struct efx_mcdi_iface iface; +#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) +{ + EFX_BUG_ON_PARANOID(!efx->mcdi); + return &efx->mcdi->hwmon; +} +#endif + extern int efx_mcdi_init(struct efx_nic *efx); +extern void efx_mcdi_fini(struct efx_nic *efx); extern int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf, size_t inlen, |