summaryrefslogtreecommitdiff
path: root/sys/dev/mii/inphy.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-04-17 01:19:23 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-04-17 01:19:23 +0000
commit11e45fbe81b264d1ced97e777a5d25d7a0a74824 (patch)
tree074a6af8cd9fc829a62c4012a73b52ec222fb75e /sys/dev/mii/inphy.c
parentcfd0b4f9b30902333ed7a1c2ab4c0b78a4802ad2 (diff)
add support for the 82562E[MT] phys (These are essentially 82555's will
all support for T4 gone). There are some register definition conflicts (SCR), but that is qualified by the presence of T4 support.
Diffstat (limited to 'sys/dev/mii/inphy.c')
-rw-r--r--sys/dev/mii/inphy.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/sys/dev/mii/inphy.c b/sys/dev/mii/inphy.c
index 2d6b5c9b614..1f736bde779 100644
--- a/sys/dev/mii/inphy.c
+++ b/sys/dev/mii/inphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inphy.c,v 1.6 2000/08/26 20:04:17 nate Exp $ */
+/* $OpenBSD: inphy.c,v 1.7 2001/04/17 01:19:21 jason Exp $ */
/* $NetBSD: inphy.c,v 1.18 2000/02/02 23:34:56 thorpej Exp $ */
/*-
@@ -112,9 +112,14 @@ inphymatch(parent, match, aux)
{
struct mii_attach_args *ma = aux;
- if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_INTEL &&
- MII_MODEL(ma->mii_id2) == MII_MODEL_INTEL_I82555)
- return (10);
+ if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_INTEL) {
+ switch (MII_MODEL(ma->mii_id2)) {
+ case MII_MODEL_INTEL_I82555:
+ case MII_MODEL_INTEL_I82562EM:
+ case MII_MODEL_INTEL_I82562ET:
+ return (10);
+ }
+ }
return (0);
}
@@ -127,9 +132,23 @@ inphyattach(parent, self, aux)
struct mii_softc *sc = (struct mii_softc *)self;
struct mii_attach_args *ma = aux;
struct mii_data *mii = ma->mii_data;
+ char *mstr;
- printf(": %s, rev. %d\n", MII_STR_INTEL_I82555,
- MII_REV(ma->mii_id2));
+ switch (MII_MODEL(ma->mii_id2)) {
+ case MII_MODEL_INTEL_I82555:
+ mstr = MII_STR_INTEL_I82555;
+ break;
+ case MII_MODEL_INTEL_I82562EM:
+ mstr = MII_STR_INTEL_I82562EM;
+ break;
+ case MII_MODEL_INTEL_I82562ET:
+ mstr = MII_STR_INTEL_I82562ET;
+ break;
+ default:
+ mstr = "unknown inphy";
+ break;
+ }
+ printf(": %s, rev. %d\n", mstr, MII_REV(ma->mii_id2));
sc->mii_inst = mii->mii_instance;
sc->mii_phy = ma->mii_phyno;
@@ -244,7 +263,7 @@ inphy_status(sc)
return;
}
scr = PHY_READ(sc, MII_INPHY_SCR);
- if (scr & SCR_T4)
+ if ((bmsr & BMSR_100T4) && (scr & SCR_T4))
mii->mii_media_active |= IFM_100_T4;
else if (scr & SCR_S100)
mii->mii_media_active |= IFM_100_TX;