summaryrefslogtreecommitdiff
path: root/sys/dev/mii
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2013-12-28 20:32:17 +0000
committerBrad Smith <brad@cvs.openbsd.org>2013-12-28 20:32:17 +0000
commit99c5aee355fac35ed7133fd2fd2c9d43019d6b15 (patch)
tree9baa89b5ab0c64fc02057bc8e2c34b8dbd3a8cf7 /sys/dev/mii
parent01d1e21a36f00278ec0eb14df4e7fc120a12a468 (diff)
Always call PHY_RESET upon attaching eephy(4) so as to do PHY initialization,
to match behavior before rev 1.52. ok deraadt@
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/eephy.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/mii/eephy.c b/sys/dev/mii/eephy.c
index 5664b4cdfaa..f4c7c078a5b 100644
--- a/sys/dev/mii/eephy.c
+++ b/sys/dev/mii/eephy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eephy.c,v 1.52 2013/12/28 03:28:45 deraadt Exp $ */
+/* $OpenBSD: eephy.c,v 1.53 2013/12/28 20:32:16 brad Exp $ */
/*
* Principal Author: Parag Patel
* Copyright (c) 2001
@@ -170,8 +170,6 @@ eephy_attach(struct device *parent, struct device *self, void *aux)
if ((reg & E1000_ESSR_HWCFG_MODE) == E1000_ESSR_RGMII_COPPER) {
reg |= E1000_ESSR_DIS_FC;
PHY_WRITE(sc, E1000_ESSR, reg);
-
- PHY_RESET(sc);
}
}
@@ -185,10 +183,10 @@ eephy_attach(struct device *parent, struct device *self, void *aux)
reg |= E1000_SCR_MODE_1000BX;
PHY_WRITE(sc, E1000_SCR, reg);
PHY_WRITE(sc, E1000_EADR, page);
-
- PHY_RESET(sc);
}
+ PHY_RESET(sc);
+
sc->mii_capabilities = PHY_READ(sc, E1000_SR) & ma->mii_capmask;
if (sc->mii_capabilities & BMSR_EXTSTAT)
sc->mii_extcapabilities = PHY_READ(sc, E1000_ESR);