Date: Tue, 12 Jan 2016 06:37:42 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293733 - head/sys/dev/sfxge/common Message-ID: <201601120637.u0C6bga6067428@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Tue Jan 12 06:37:42 2016 New Revision: 293733 URL: https://svnweb.freebsd.org/changeset/base/293733 Log: 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 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:34:45 2016 (r293732) +++ head/sys/dev/sfxge/common/efx.h Tue Jan 12 06:37:42 2016 (r293733) @@ -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 */ Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Tue Jan 12 06:34:45 2016 (r293732) +++ head/sys/dev/sfxge/common/efx_mon.c Tue Jan 12 06:37:42 2016 (r293733) @@ -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; } Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Tue Jan 12 06:34:45 2016 (r293732) +++ head/sys/dev/sfxge/common/mcdi_mon.c Tue Jan 12 06:37:42 2016 (r293733) @@ -478,6 +478,11 @@ mcdi_mon_cfg_build( 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; goto fail1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601120637.u0C6bga6067428>