From: brad Date: Sat, 28 Dec 2013 20:32:16 +0000 (+0000) Subject: Always call PHY_RESET upon attaching eephy(4) so as to do PHY initialization, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0b4f168caddf1893515acf7e51da453acc3cea5e;p=openbsd Always call PHY_RESET upon attaching eephy(4) so as to do PHY initialization, to match behavior before rev 1.52. ok deraadt@ --- 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);