Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/mii - 5720S and 5709S share the same PHY id. Assume ...
details: https://anonhg.NetBSD.org/src/rev/7322a1dc8eb9
branches: trunk
changeset: 797048:7322a1dc8eb9
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Wed Jul 02 22:21:50 2014 +0000
description:
- 5720S and 5709S share the same PHY id. Assume 5720S PHY if parent device
is bge(4). Same as FreeBSD. Tested on HP Moonshot.
- Fix media detect on some Fiber chips. Tested on my own BCM5709 card.
Same as {Free,Open}BSD.
diffstat:
sys/dev/mii/brgphy.c | 64 +++++++++++++++++++++++++++------------------------
1 files changed, 34 insertions(+), 30 deletions(-)
diffs (101 lines):
diff -r 39ef8b257611 -r 7322a1dc8eb9 sys/dev/mii/brgphy.c
--- a/sys/dev/mii/brgphy.c Wed Jul 02 22:01:44 2014 +0000
+++ b/sys/dev/mii/brgphy.c Wed Jul 02 22:21:50 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brgphy.c,v 1.74 2014/07/02 22:01:44 msaitoh Exp $ */
+/* $NetBSD: brgphy.c,v 1.75 2014/07/02 22:21:50 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.74 2014/07/02 22:01:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.75 2014/07/02 22:21:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -315,9 +315,18 @@
&& sc->mii_mpd_model == MII_MODEL_BROADCOM2_BCM5708S)
sc->mii_funcs = &brgphy_5708s_funcs;
else if ((sc->mii_mpd_oui == MII_OUI_BROADCOM2)
- && (sc->mii_mpd_model == MII_MODEL_BROADCOM2_BCM5709S))
- sc->mii_funcs = &brgphy_5709s_funcs;
- else
+ && (sc->mii_mpd_model == MII_MODEL_BROADCOM2_BCM5709S)) {
+ if (bsc->sc_isbnx)
+ sc->mii_funcs = &brgphy_5709s_funcs;
+ else {
+ /*
+ * XXX
+ * 5720S and 5709S shares the same PHY id.
+ * Assume 5720S PHY if parent device is bge(4).
+ */
+ sc->mii_funcs = &brgphy_5708s_funcs;
+ }
+ } else
sc->mii_funcs = &brgphy_fiber_funcs;
} else
sc->mii_funcs = &brgphy_copper_funcs;
@@ -329,40 +338,35 @@
sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR);
aprint_normal_dev(self, "");
- if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 &&
- (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0)
- aprint_error("no media present");
- else {
- if (sc->mii_flags & MIIF_HAVEFIBER) {
- sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP;
+ if (sc->mii_flags & MIIF_HAVEFIBER) {
+ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP;
+ /*
+ * Set the proper bits for capabilities so that the
+ * correct media get selected by mii_phy_add_media()
+ */
+ sc->mii_capabilities |= BMSR_ANEG;
+ sc->mii_capabilities &= ~BMSR_100T4;
+ sc->mii_extcapabilities |= EXTSR_1000XFDX;
+
+ if (bsc->sc_isbnx) {
/*
- * Set the proper bits for capabilities so that the
- * correct media get selected by mii_phy_add_media()
+ * 2.5Gb support is a software enabled feature
+ * on the BCM5708S and BCM5709S controllers.
*/
- sc->mii_capabilities |= BMSR_ANEG;
- sc->mii_capabilities &= ~BMSR_100T4;
- sc->mii_extcapabilities |= EXTSR_1000XFDX;
-
- if (bsc->sc_isbnx) {
- /*
- * 2.5Gb support is a software enabled feature
- * on the BCM5708S and BCM5709S controllers.
- */
#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL)
- if (bsc->sc_phyflags
- & BNX_PHY_2_5G_CAPABLE_FLAG) {
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX,
- IFM_FDX, sc->mii_inst), 0);
- aprint_normal("2500baseSX-FDX, ");
+ if (bsc->sc_phyflags
+ & BNX_PHY_2_5G_CAPABLE_FLAG) {
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX,
+ IFM_FDX, sc->mii_inst), 0);
+ aprint_normal("2500baseSX-FDX, ");
#undef ADD
- }
}
}
- mii_phy_add_media(sc);
}
+ mii_phy_add_media(sc);
+
aprint_normal("\n");
-
}
static int
Home |
Main Index |
Thread Index |
Old Index