PERFORCE change 114813 for review
John Baldwin
jhb at FreeBSD.org
Wed Feb 21 18:35:21 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=114813
Change 114813 by jhb at jhb_mutex on 2007/02/21 18:34:58
IFC @114811.
Affected files ...
.. //depot/projects/smpng/sys/dev/mii/brgphy.c#39 integrate
.. //depot/projects/smpng/sys/dev/mii/miidevs#24 integrate
.. //depot/projects/smpng/sys/dev/mxge/if_mxge.c#11 integrate
.. //depot/projects/smpng/sys/dev/mxge/if_mxge_var.h#6 integrate
Differences ...
==== //depot/projects/smpng/sys/dev/mii/brgphy.c#39 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/brgphy.c,v 1.64 2007/02/14 18:21:32 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/brgphy.c,v 1.65 2007/02/21 18:17:44 jhb Exp $");
/*
* Driver for the Broadcom BCM54xx/57xx 1000baseTX PHY.
@@ -97,6 +97,7 @@
static int brgphy_mii_phy_auto(struct mii_softc *);
static void brgphy_reset(struct mii_softc *);
static void brgphy_loop(struct mii_softc *);
+static int bcm5706_is_tbi(device_t);
static void bcm5401_load_dspcode(struct mii_softc *);
static void bcm5411_load_dspcode(struct mii_softc *);
static void brgphy_fixup_5704_a0_bug(struct mii_softc *);
@@ -122,6 +123,7 @@
MII_PHY_DESC(xxBROADCOM, BCM5752),
MII_PHY_DESC(xxBROADCOM, BCM5754),
MII_PHY_DESC(xxBROADCOM, BCM5780),
+ MII_PHY_DESC(xxBROADCOM, BCM5708C),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787),
MII_PHY_END
};
@@ -129,8 +131,29 @@
static int
brgphy_probe(device_t dev)
{
+ struct mii_attach_args *ma;
+ int error;
- return (mii_phy_dev_probe(dev, brgphys, BUS_PROBE_DEFAULT));
+ error = mii_phy_dev_probe(dev, brgphys, BUS_PROBE_DEFAULT);
+ if (error != BUS_PROBE_DEFAULT)
+ return (error);
+
+ ma = device_get_ivars(dev);
+ if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxBROADCOM &&
+ MII_MODEL(ma->mii_id2) == MII_MODEL_xxBROADCOM_BCM5706C) {
+ /*
+ * Broadcom uses the same MII model ID on two
+ * different types of phys. The first is found on the
+ * BCM 5706 and is supported by this driver. The
+ * other is found on the BCM 5706S and 5708S and is
+ * supported by the gentbi(4) driver, so we check to
+ * see if this phy is supported by gentbi(4) and fail
+ * the probe if so.
+ */
+ if (bcm5706_is_tbi(dev))
+ return (ENXIO);
+ }
+ return (error);
}
static int
@@ -488,6 +511,34 @@
}
}
+/*
+ * Check to see if a 5706 phy is really a SerDes phy. Copied from
+ * gentbi_probe().
+ */
+static int
+bcm5706_is_tbi(device_t dev)
+{
+ device_t parent;
+ struct mii_attach_args *ma;
+ int bmsr, extsr;
+
+ parent = device_get_parent(dev);
+ ma = device_get_ivars(dev);
+
+ bmsr = MIIBUS_READREG(parent, ma->mii_phyno, MII_BMSR);
+ if ((bmsr & BMSR_EXTSTAT) == 0 || (bmsr & BMSR_MEDIAMASK) != 0)
+ return (0);
+
+ extsr = MIIBUS_READREG(parent, ma->mii_phyno, MII_EXTSR);
+ if (extsr & (EXTSR_1000TFDX|EXTSR_1000THDX))
+ return (0);
+
+ if (extsr & (EXTSR_1000XFDX|EXTSR_1000XHDX))
+ return (1);
+
+ return (0);
+}
+
/* Turn off tap power management on 5401. */
static void
bcm5401_load_dspcode(struct mii_softc *sc)
==== //depot/projects/smpng/sys/dev/mii/miidevs#24 (text+ko) ====
@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/dev/mii/miidevs,v 1.40 2007/01/26 17:05:24 dwhite Exp $
+$FreeBSD: src/sys/dev/mii/miidevs,v 1.41 2007/02/21 18:17:44 jhb Exp $
/*$NetBSD: miidevs,v 1.6 1999/05/14 11:37:30 drochner Exp $*/
/*-
@@ -123,13 +123,14 @@
model xxBROADCOM BCM5754 0x000e BCM5754 10/100/1000baseTX PHY
model xxBROADCOM BCM5752 0x0010 BCM5752 10/100/1000baseTX PHY
model xxBROADCOM BCM5701 0x0011 BCM5701 10/100/1000baseTX PHY
+model xxBROADCOM BCM5706C 0x0015 BCM5706C 10/100/1000baseTX PHY
model xxBROADCOM BCM5703 0x0016 BCM5703 10/100/1000baseTX PHY
model xxBROADCOM BCM5704 0x0019 BCM5704 10/100/1000baseTX PHY
model xxBROADCOM BCM5705 0x001a BCM5705 10/100/1000baseTX PHY
model xxBROADCOM BCM5750 0x0018 BCM5750 10/100/1000baseTX PHY
model xxBROADCOM BCM5714 0x0034 BCM5714 10/100/1000baseTX PHY
model xxBROADCOM BCM5780 0x0035 BCM5780 10/100/1000baseTX PHY
-model xxBROADCOM BCM5706C 0x0036 BCM5706C/5708C 10/100/1000baseTX PHY
+model xxBROADCOM BCM5708C 0x0036 BCM5708C 10/100/1000baseTX PHY
model xxBROADCOM_ALT1 BCM5787 0x000e BCM5787 10/100/1000baseTX PHY
/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
==== //depot/projects/smpng/sys/dev/mxge/if_mxge.c#11 (text+ko) ====
@@ -32,7 +32,7 @@
***************************************************************************/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.21 2007/02/15 17:21:31 luigi Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.22 2007/02/21 17:34:05 gallatin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -482,7 +482,7 @@
static int
mxge_validate_firmware(mxge_softc_t *sc, const mcp_gen_header_t *hdr)
{
- int major, minor;
+
if (be32toh(hdr->mcp_type) != MCP_TYPE_ETH) {
device_printf(sc->dev, "Bad firmware type: 0x%x\n",
@@ -495,10 +495,11 @@
if (mxge_verbose)
device_printf(sc->dev, "firmware id: %s\n", hdr->version);
- sscanf(sc->fw_version, "%d.%d", &major, &minor);
+ sscanf(sc->fw_version, "%d.%d.%d", &sc->fw_ver_major,
+ &sc->fw_ver_minor, &sc->fw_ver_tiny);
- if (!(major == MXGEFW_VERSION_MAJOR
- && minor == MXGEFW_VERSION_MINOR)) {
+ if (!(sc->fw_ver_major == MXGEFW_VERSION_MAJOR
+ && sc->fw_ver_minor == MXGEFW_VERSION_MINOR)) {
device_printf(sc->dev, "Found firmware version %s\n",
sc->fw_version);
device_printf(sc->dev, "Driver needs %d.%d\n",
@@ -713,6 +714,21 @@
hdr_offset, (char *)hdr, bytes);
status = mxge_validate_firmware(sc, hdr);
free(hdr, M_DEVBUF);
+
+ /*
+ * check to see if adopted firmware has bug where adopting
+ * it will cause broadcasts to be filtered unless the NIC
+ * is kept in ALLMULTI mode
+ */
+ if (sc->fw_ver_major == 1 && sc->fw_ver_minor == 4 &&
+ sc->fw_ver_tiny >= 4 && sc->fw_ver_tiny <= 11) {
+ sc->adopted_rx_filter_bug = 1;
+ device_printf(sc->dev, "Adopting fw %d.%d.%d: "
+ "working around rx filter bug\n",
+ sc->fw_ver_major, sc->fw_ver_minor,
+ sc->fw_ver_tiny);
+ }
+
return status;
}
@@ -875,7 +891,9 @@
" error status: %d\n", err);
return;
}
-
+
+ if (sc->adopted_rx_filter_bug)
+ return;
if (ifp->if_flags & IFF_ALLMULTI)
/* request to disable multicast filtering, so quit here */
==== //depot/projects/smpng/sys/dev/mxge/if_mxge_var.h#6 (text+ko) ====
@@ -29,7 +29,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-$FreeBSD: src/sys/dev/mxge/if_mxge_var.h,v 1.9 2007/01/31 19:53:36 gallatin Exp $
+$FreeBSD: src/sys/dev/mxge/if_mxge_var.h,v 1.10 2007/02/21 17:34:05 gallatin Exp $
***************************************************************************/
@@ -153,6 +153,10 @@
char *fw_name;
char eeprom_strings[MXGE_EEPROM_STRINGS_SIZE];
char fw_version[128];
+ int fw_ver_major;
+ int fw_ver_minor;
+ int fw_ver_tiny;
+ int adopted_rx_filter_bug;
device_t dev;
struct ifmedia media;
int read_dma;
More information about the p4-projects
mailing list