diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-12-30 23:04:40 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-12-30 23:04:40 +0000 |
commit | 93446b31c3db5d2813b10cf04b55932e1495c511 (patch) | |
tree | 009fdb82e45f90145dc366a844bec385df5b0dca /sys/dev/mii/brgphy.c | |
parent | cb871034265eaf501f859284e8a5c4cf65e55cb0 (diff) |
Set MASTER based on IFM_ETH_MASTER instead of LINK0.
ok brad@
Diffstat (limited to 'sys/dev/mii/brgphy.c')
-rw-r--r-- | sys/dev/mii/brgphy.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 0023bb98bb1..0e9ddb5576e 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brgphy.c,v 1.67 2006/12/22 14:11:03 kettenis Exp $ */ +/* $OpenBSD: brgphy.c,v 1.68 2006/12/30 23:04:39 kettenis Exp $ */ /* * Copyright (c) 2000 @@ -256,21 +256,9 @@ setit: if (sc->mii_model != MII_MODEL_xxBROADCOM_BCM5701) break; - /* - * When setting the link manually, one side must - * be the master and the other the slave. However - * ifmedia doesn't give us a good way to specify - * this, so we fake it by using one of the LINK - * flags. If LINK0 is set, we program the PHY to - * be a master, otherwise it's a slave. - */ - if ((mii->mii_ifp->if_flags & IFF_LINK0)) { - PHY_WRITE(sc, BRGPHY_MII_1000CTL, - gig|BRGPHY_1000CTL_MSE|BRGPHY_1000CTL_MSC); - } else { - PHY_WRITE(sc, BRGPHY_MII_1000CTL, - gig|BRGPHY_1000CTL_MSE); - } + if (mii->mii_media.ifm_media & IFM_ETH_MASTER) + gig |= BRGPHY_1000CTL_MSE|BRGPHY_1000CTL_MSC; + PHY_WRITE(sc, BRGPHY_MII_1000CTL, gig); break; default: return (EINVAL); |