Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2015 05:10:43 +0000 (UTC)
From:      Pyun YongHyeon <yongari@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: r282878 - stable/10/sys/dev/mii
Message-ID:  <201505140510.t4E5Ah7U053583@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Thu May 14 05:10:42 2015
New Revision: 282878
URL: https://svnweb.freebsd.org/changeset/base/282878

Log:
  MFC r281877:
    Add another variant of BCM5708S controller to IBM HS21 workaround
    list.
  
    PR:	118238

Modified:
  stable/10/sys/dev/mii/brgphy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mii/brgphy.c
==============================================================================
--- stable/10/sys/dev/mii/brgphy.c	Thu May 14 04:21:04 2015	(r282877)
+++ stable/10/sys/dev/mii/brgphy.c	Thu May 14 05:10:42 2015	(r282878)
@@ -158,25 +158,33 @@ static const struct mii_phy_funcs brgphy
 	brgphy_reset
 };
 
-#define HS21_PRODUCT_ID	"IBM eServer BladeCenter HS21"
-#define HS21_BCM_CHIPID	0x57081021
+static const struct hs21_type {
+	const uint32_t id;
+	const char *prod;
+} hs21_type_lists[] = {
+	{ 0x57081021, "IBM eServer BladeCenter HS21" },
+	{ 0x57081011, "IBM eServer BladeCenter HS21 -[8853PAU]-" },
+};
 
 static int
 detect_hs21(struct bce_softc *bce_sc)
 {
 	char *sysenv;
-	int found;
+	int found, i;
 
 	found = 0;
-	if (bce_sc->bce_chipid == HS21_BCM_CHIPID) {
-		sysenv = getenv("smbios.system.product");
-		if (sysenv != NULL) {
-			if (strncmp(sysenv, HS21_PRODUCT_ID,
-			    strlen(HS21_PRODUCT_ID)) == 0)
-				found = 1;
-			freeenv(sysenv);
+	sysenv = getenv("smbios.system.product");
+	if (sysenv == NULL)
+		return (found);
+	for (i = 0; i < nitems(hs21_type_lists); i++) {
+		if (bce_sc->bce_chipid == hs21_type_lists[i].id &&
+		    strncmp(sysenv, hs21_type_lists[i].prod,
+		    strlen(hs21_type_lists[i].prod)) == 0) {
+			found++;
+			break;
 		}
 	}
+	freeenv(sysenv);
 	return (found);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505140510.t4E5Ah7U053583>