Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 15:50:13 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293978 - stable/10/sys/dev/sfxge/common
Message-ID:  <201601141550.u0EFoDl6050186@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Thu Jan 14 15:50:13 2016
New Revision: 293978
URL: https://svnweb.freebsd.org/changeset/base/293978

Log:
  MFC r293733
  
  sfxge: add Medford sensor support
  
  Submitted by:   Mark Spender <mspender at solarflare.com>
  Reviewed by:    gnn
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_mon.c
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx.h	Thu Jan 14 15:49:24 2016	(r293977)
+++ stable/10/sys/dev/sfxge/common/efx.h	Thu Jan 14 15:50:13 2016	(r293978)
@@ -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: stable/10/sys/dev/sfxge/common/efx_mon.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_mon.c	Thu Jan 14 15:49:24 2016	(r293977)
+++ stable/10/sys/dev/sfxge/common/efx_mon.c	Thu Jan 14 15:50:13 2016	(r293978)
@@ -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: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c	Thu Jan 14 15:49:24 2016	(r293977)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c	Thu Jan 14 15:50:13 2016	(r293978)
@@ -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?201601141550.u0EFoDl6050186>