sfxge: add Medford sensor support

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4858
This commit is contained in:
Andrew Rybchenko 2016-01-12 06:37:42 +00:00
parent 19bc938f5a
commit b13ad4deb6
3 changed files with 33 additions and 32 deletions

View File

@ -594,6 +594,7 @@ typedef enum efx_mon_type_e {
EFX_MON_MAX6647,
EFX_MON_SFC90X0,
EFX_MON_SFC91X0,
EFX_MON_SFC92X0,
EFX_MON_NTYPES
} efx_mon_type_t;
@ -1148,12 +1149,12 @@ typedef struct efx_nic_cfg_s {
uint32_t enc_mcdi_phy_stat_mask;
#endif /* EFSYS_OPT_PHY_STATS */
#endif /* EFSYS_OPT_SIENA */
#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
#if EFSYS_OPT_MON_STATS
uint32_t *enc_mcdi_sensor_maskp;
uint32_t enc_mcdi_sensor_mask_size;
#endif /* EFSYS_OPT_MON_STATS */
#endif /* (EFSYS_OPT_SIENA | EFSYS_OPT_HUNTINGTON) */
#endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */
#if EFSYS_OPT_BIST
uint32_t enc_bist_mask;
#endif /* EFSYS_OPT_BIST */

View File

@ -62,6 +62,7 @@ static const char *__efx_mon_name[] = {
"max6647",
"sfx90x0",
"sfx91x0"
"sfx92x0"
};
const char *
@ -119,34 +120,6 @@ static efx_mon_ops_t __efx_mon_mcdi_ops = {
};
#endif
static efx_mon_ops_t *__efx_mon_ops[] = {
NULL,
#if EFSYS_OPT_MON_NULL
&__efx_mon_null_ops,
#else
NULL,
#endif
#if EFSYS_OPT_MON_LM87
&__efx_mon_lm87_ops,
#else
NULL,
#endif
#if EFSYS_OPT_MON_MAX6647
&__efx_mon_max6647_ops,
#else
NULL,
#endif
#if EFSYS_OPT_MON_MCDI
&__efx_mon_mcdi_ops,
#else
NULL,
#endif
#if EFSYS_OPT_MON_MCDI
&__efx_mon_mcdi_ops
#else
NULL
#endif
};
__checkReturn efx_rc_t
efx_mon_init(
@ -170,8 +143,30 @@ efx_mon_init(
emp->em_type = encp->enc_mon_type;
EFSYS_ASSERT(encp->enc_mon_type != EFX_MON_INVALID);
EFSYS_ASSERT3U(emp->em_type, <, EFX_MON_NTYPES);
if ((emop = (efx_mon_ops_t *)__efx_mon_ops[emp->em_type]) == NULL) {
switch (emp->em_type) {
#if EFSYS_OPT_MON_NULL
case EFX_MON_NULL:
emop = &__efx_mon_null_ops;
break;
#endif
#if EFSYS_OPT_MON_LM87
case EFX_MON_LM87:
emop = &__efx_mon_lm87_ops;
break;
#endif
#if EFSYS_OPT_MON_MAX6647
case EFX_MON_MAX6647:
emop = &__efx_mon_max6647_ops;
break;
#endif
#if EFSYS_OPT_MON_MCDI
case EFX_MON_SFC90X0:
case EFX_MON_SFC91X0:
case EFX_MON_SFC92X0:
emop = &__efx_mon_mcdi_ops;
break;
#endif
default:
rc = ENOTSUP;
goto fail2;
}

View File

@ -477,6 +477,11 @@ mcdi_mon_cfg_build(
case EFX_FAMILY_HUNTINGTON:
encp->enc_mon_type = EFX_MON_SFC91X0;
break;
#endif
#if EFSYS_OPT_MEDFORD
case EFX_FAMILY_MEDFORD:
encp->enc_mon_type = EFX_MON_SFC92X0;
break;
#endif
default:
rc = EINVAL;