diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-07-22 18:58:44 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-07-22 18:58:44 +0000 |
commit | 6e2ef43eedee8839bc7db512e0692c80a73cb935 (patch) | |
tree | f4a41db88d1b666d72d1654df1c10001a074800c | |
parent | 5064dfdc7ca942c44349640d82b2d486a6fae544 (diff) | |
download | FreeBSD-src-6e2ef43eedee8839bc7db512e0692c80a73cb935.zip FreeBSD-src-6e2ef43eedee8839bc7db512e0692c80a73cb935.tar.gz |
Attach the miibus for Linksys/Dlink cards from the attach routine,
not from the probe routine. This was an oversight when I originally
ported the miibus support to -current, though it was mostly harmless.
We now set the vendor code to the new value ED_VENDOR_LINKSYS in
ed_pccard_Linksys() at probe time. Then ed_pccard_attach() checks
the vendor code, and sets up the miibus if appropriate.
Reviewed by: imp
-rw-r--r-- | sys/dev/ed/if_ed_pccard.c | 16 | ||||
-rw-r--r-- | sys/dev/ed/if_edreg.h | 1 |
2 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c index 23ef71d..38af728 100644 --- a/sys/dev/ed/if_ed_pccard.c +++ b/sys/dev/ed/if_ed_pccard.c @@ -565,6 +565,15 @@ ed_pccard_attach(device_t dev) } error = ed_attach(sc, device_get_unit(dev), flags); + if (error == 0 && sc->vendor == ED_VENDOR_LINKSYS) { + /* Probe for an MII bus, but ignore errors. */ + ed_pccard_dlink_mii_reset(sc); + sc->mii_readbits = ed_pccard_dlink_mii_readbits; + sc->mii_writebits = ed_pccard_dlink_mii_writebits; + mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, + ed_ifmedia_sts); + } + return (error); } @@ -668,15 +677,10 @@ ed_pccard_Linksys(device_t dev) ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); sc->isa16bit = 1; + sc->vendor = ED_VENDOR_LINKSYS; sc->type = ED_TYPE_NE2000; sc->type_str = "Linksys"; - /* Probe for an MII bus, but continue as normal if there isn't one. */ - ed_pccard_dlink_mii_reset(sc); - sc->mii_readbits = ed_pccard_dlink_mii_readbits; - sc->mii_writebits = ed_pccard_dlink_mii_writebits; - mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, ed_ifmedia_sts); - return (1); } diff --git a/sys/dev/ed/if_edreg.h b/sys/dev/ed/if_edreg.h index a2e1882..068361a 100644 --- a/sys/dev/ed/if_edreg.h +++ b/sys/dev/ed/if_edreg.h @@ -577,6 +577,7 @@ struct ed_ring { #define ED_VENDOR_NOVELL 0x02 /* Novell */ #define ED_VENDOR_PCCARD 0x03 /* PCMCIA/PCCARD */ #define ED_VENDOR_HP 0x04 /* Hewlett Packard */ +#define ED_VENDOR_LINKSYS 0x05 /* Linksys (Dlink) */ /* * Compile-time config flags |