diff options
author | marius <marius@FreeBSD.org> | 2006-12-02 15:32:34 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2006-12-02 15:32:34 +0000 |
commit | 923629baa0e29adb56de97ed5d8fd54e71cd3b49 (patch) | |
tree | 25749fe19f52ff6e7be4f3431382ac173c7c08fc /sys/dev/mii/ciphy.c | |
parent | 2db40ccfce7ea070a08fa10f3969ee21f4d49779 (diff) | |
download | FreeBSD-src-923629baa0e29adb56de97ed5d8fd54e71cd3b49.zip FreeBSD-src-923629baa0e29adb56de97ed5d8fd54e71cd3b49.tar.gz |
Add a helper function mii_phy_dev_probe(), which wraps around the
mii_phy_match() API and takes care of the PHY device probe based on
the struct mii_phydesc array and the match return value provided.
Convert PHY drivers to take advantage of mii_phy_dev_probe(),
converting drivers to provide a mii_phydesc table in the first
place where necessary.
Reviewed by: yongari
MFC after: 2 weeks
Diffstat (limited to 'sys/dev/mii/ciphy.c')
-rw-r--r-- | sys/dev/mii/ciphy.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c index dbd6b1d..ed601ad 100644 --- a/sys/dev/mii/ciphy.c +++ b/sys/dev/mii/ciphy.c @@ -88,32 +88,18 @@ static void ciphy_status(struct mii_softc *); static void ciphy_reset(struct mii_softc *); static void ciphy_fixup(struct mii_softc *); +static const struct mii_phydesc ciphys[] = { + MII_PHY_DESC(CICADA, CS8201), + MII_PHY_DESC(CICADA, CS8201A), + MII_PHY_DESC(CICADA, CS8201B), + MII_PHY_END +}; + static int ciphy_probe(device_t dev) { - struct mii_attach_args *ma; - - ma = device_get_ivars(dev); - - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_CICADA && - MII_MODEL(ma->mii_id2) == MII_MODEL_CICADA_CS8201) { - device_set_desc(dev, MII_STR_CICADA_CS8201); - return (BUS_PROBE_DEFAULT); - } - - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_CICADA && - MII_MODEL(ma->mii_id2) == MII_MODEL_CICADA_CS8201A) { - device_set_desc(dev, MII_STR_CICADA_CS8201A); - return (BUS_PROBE_DEFAULT); - } - - if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_CICADA && - MII_MODEL(ma->mii_id2) == MII_MODEL_CICADA_CS8201B) { - device_set_desc(dev, MII_STR_CICADA_CS8201B); - return (BUS_PROBE_DEFAULT); - } - return (ENXIO); + return (mii_phy_dev_probe(dev, ciphys, BUS_PROBE_DEFAULT)); } static int |