aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vr
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2010-10-15 14:52:11 +0000
committerMarius Strobl <marius@FreeBSD.org>2010-10-15 14:52:11 +0000
commit8e5d93dbb40452863b266a378868255bf986af67 (patch)
tree6dd0ca5b178547c1f20c8ce1f607ac42d4afe2ae /sys/dev/vr
parentd1457e3703928a249a45a6dd996918bc7eb6ba20 (diff)
Notes
Diffstat (limited to 'sys/dev/vr')
-rw-r--r--sys/dev/vr/if_vr.c22
-rw-r--r--sys/dev/vr/if_vrreg.h1
2 files changed, 8 insertions, 15 deletions
diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c
index e9359aa0964c..49555757b77a 100644
--- a/sys/dev/vr/if_vr.c
+++ b/sys/dev/vr/if_vr.c
@@ -249,8 +249,6 @@ vr_miibus_readreg(device_t dev, int phy, int reg)
int i;
sc = device_get_softc(dev);
- if (sc->vr_phyaddr != phy)
- return (0);
/* Set the register address. */
CSR_WRITE_1(sc, VR_MIIADDR, reg);
@@ -274,8 +272,6 @@ vr_miibus_writereg(device_t dev, int phy, int reg, int data)
int i;
sc = device_get_softc(dev);
- if (sc->vr_phyaddr != phy)
- return (0);
/* Set the register address and data to write. */
CSR_WRITE_1(sc, VR_MIIADDR, reg);
@@ -613,7 +609,7 @@ vr_attach(device_t dev)
struct vr_type *t;
uint8_t eaddr[ETHER_ADDR_LEN];
int error, rid;
- int i, pmc;
+ int i, phy, pmc;
sc = device_get_softc(dev);
sc->vr_dev = dev;
@@ -780,17 +776,15 @@ vr_attach(device_t dev)
goto fail;
}
- /* Save PHY address. */
+ /* Do MII setup. */
if (sc->vr_revid >= REV_ID_VT6105_A0)
- sc->vr_phyaddr = 1;
+ phy = 1;
else
- sc->vr_phyaddr = CSR_READ_1(sc, VR_PHYADDR) & VR_PHYADDR_MASK;
-
- /* Do MII setup. */
- if (mii_phy_probe(dev, &sc->vr_miibus,
- vr_ifmedia_upd, vr_ifmedia_sts)) {
- device_printf(dev, "MII without any phy!\n");
- error = ENXIO;
+ phy = CSR_READ_1(sc, VR_PHYADDR) & VR_PHYADDR_MASK;
+ error = mii_attach(dev, &sc->vr_miibus, ifp, vr_ifmedia_upd,
+ vr_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0);
+ if (error != 0) {
+ device_printf(dev, "attaching PHYs failed\n");
goto fail;
}
diff --git a/sys/dev/vr/if_vrreg.h b/sys/dev/vr/if_vrreg.h
index 9c85962916c2..d686bddb240c 100644
--- a/sys/dev/vr/if_vrreg.h
+++ b/sys/dev/vr/if_vrreg.h
@@ -722,7 +722,6 @@ struct vr_softc {
uint8_t vr_revid; /* Rhine chip revision */
uint8_t vr_flags; /* See VR_F_* below */
#define VR_F_RESTART 0x01 /* Restart unit on next tick */
- int vr_phyaddr;
int vr_if_flags;
struct task vr_link_task;
struct vr_chain_data vr_cdata;