diff options
author | marius <marius@FreeBSD.org> | 2007-01-13 17:18:44 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2007-01-13 17:18:44 +0000 |
commit | a30df086c1b7f991e3ff4f1c5cf8e3870935a9ac (patch) | |
tree | eed0b3b24547fed0ced143d85c5a011b1447444c /sys | |
parent | ab7949c755ac38a6493f16840332fb5a32cf4c56 (diff) | |
download | FreeBSD-src-a30df086c1b7f991e3ff4f1c5cf8e3870935a9ac.zip FreeBSD-src-a30df086c1b7f991e3ff4f1c5cf8e3870935a9ac.tar.gz |
- Allow multiple (external) PHYs with Am79C97{2,6}, which actually
only support external PHYs (besides not connectable internal ones
which respond at the usual addresses, but which don't hurt if we
let them show up) and don't wedge when isolating PHYs. Actually,
this change special cases limiting PHYs to Am79C97{3,5,8}, for
which this driver doesn't implement swiching between the internal
and external PHYs, yet, and Am79C971, where isolating the external
PHY (at least in case it's a DP83840A) wedges the chip. Together
with sys/dev/mii/acphy.c rev. 1.21 this adds support for the
100baseFX port of AT-2700 series adaptors, which use two AC101,
one for the copper and one for the fibre port (there might be
variants which only use one PHY though).
- Fix a bug in the previous revision that prevented the address of
the used (external) PHY to be actually recorded.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pci/if_pcn.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index 13bf6cb..bd1827f 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -279,14 +279,23 @@ pcn_miibus_readreg(dev, phy, reg) /* * At least Am79C971 with DP83840A wedge when isolating the * external PHY so we can't allow multiple external PHYs. - * This needs refinement as there are some Allied Telesyn - * card models which use multiple external PHYs. + * There are cards that use Am79C971 with both the internal + * and an external PHY though. * For internal PHYs it doesn't really matter whether we can * isolate the remaining internal and the external ones in * the PHY drivers as the internal PHYs have to be enabled * individually in PCN_BCR_PHYSEL, PCN_CSR_MODE, etc. + * With Am79C97{3,5,8} we don't support switching beetween + * the internal and external PHYs, yet, so we can't allow + * multiple PHYs with these either. + * Am79C97{2,6} actually only support external PHYs (not + * connectable internal ones respond at the usual addresses, + * which don't hurt if we let them show up on the bus) and + * isolating them works. */ - if (phy != PCN_PHYAD_10BT && sc->pcn_extphyaddr != -1 && + if (((sc->pcn_type == Am79C971 && phy != PCN_PHYAD_10BT) || + sc->pcn_type == Am79C973 || sc->pcn_type == Am79C975 || + sc->pcn_type == Am79C978) && sc->pcn_extphyaddr != -1 && phy != sc->pcn_extphyaddr) return(0); @@ -295,7 +304,9 @@ pcn_miibus_readreg(dev, phy, reg) if (val == 0xFFFF) return(0); - if (phy != PCN_PHYAD_10BT && sc->pcn_extphyaddr != -1) + if (((sc->pcn_type == Am79C971 && phy != PCN_PHYAD_10BT) || + sc->pcn_type == Am79C973 || sc->pcn_type == Am79C975 || + sc->pcn_type == Am79C978) && sc->pcn_extphyaddr == -1) sc->pcn_extphyaddr = phy; return(val); @@ -616,7 +627,6 @@ pcn_attach(dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = pcn_ioctl; ifp->if_start = pcn_start; |