From 0b4f168caddf1893515acf7e51da453acc3cea5e Mon Sep 17 00:00:00 2001 From: brad Date: Sat, 28 Dec 2013 20:32:16 +0000 Subject: [PATCH] Always call PHY_RESET upon attaching eephy(4) so as to do PHY initialization, to match behavior before rev 1.52. ok deraadt@ --- sys/dev/mii/eephy.c | 8 +++----- 1 file 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); -- 2.20.1