Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jan 2009 20:13:22 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r187306 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb
Message-ID:  <200901152013.n0FKDMiC086112@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Thu Jan 15 20:13:22 2009
New Revision: 187306
URL: http://svn.freebsd.org/changeset/base/187306

Log:
  MFC: r183281
  
  - Don't read the identifier string from the VPD if there's no chip
    containing an Ethernet address fitted as this is yet another thing
    that fails in that case in order to avoid the one second delay
    until pci_read_vpd_reg() times out.
  - Const'ify the bge_devs array.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/bge/if_bge.c
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c	Thu Jan 15 19:57:45 2009	(r187305)
+++ stable/7/sys/dev/bge/if_bge.c	Thu Jan 15 20:13:22 2009	(r187306)
@@ -134,7 +134,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1);
  * ID burned into it, though it will always be overriden by the vendor
  * ID in the EEPROM. Just to be safe, we cover all possibilities.
  */
-static struct bge_type {
+static const struct bge_type {
 	uint16_t	bge_vid;
 	uint16_t	bge_did;
 } bge_devs[] = {
@@ -1861,7 +1861,7 @@ bge_lookup_vendor(uint16_t vid)
 static int
 bge_probe(device_t dev)
 {
-	struct bge_type *t = bge_devs;
+	const struct bge_type *t = bge_devs;
 	struct bge_softc *sc = device_get_softc(dev);
 	uint16_t vid, did;
 
@@ -1883,7 +1883,8 @@ bge_probe(device_t dev)
 #if __FreeBSD_version > 700024
 				const char *pname;
 
-				if (pci_get_vpd_ident(dev, &pname) == 0)
+				if (bge_has_eaddr(sc) &&
+				    pci_get_vpd_ident(dev, &pname) == 0)
 					snprintf(model, 64, "%s", pname);
 				else
 #endif



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