diff options
author | phk <phk@FreeBSD.org> | 2002-04-29 14:09:10 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-04-29 14:09:10 +0000 |
commit | cb257785b2a32f6e52693af129eaf0adb5921d40 (patch) | |
tree | 7c7882efabdcfc55f525359c8bb0d069ecf84930 /sys/dev/mii/mii_physubr.c | |
parent | 623b9c8449c71dee51ac80bd8c451872724d4f4e (diff) | |
download | FreeBSD-src-cb257785b2a32f6e52693af129eaf0adb5921d40.zip FreeBSD-src-cb257785b2a32f6e52693af129eaf0adb5921d40.tar.gz |
Introduce NetBSD's mii_phy_match() API and use it in the nsgphy to
get a description printed.
Diffstat (limited to 'sys/dev/mii/mii_physubr.c')
-rw-r--r-- | sys/dev/mii/mii_physubr.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index 34f50dd..07ea088 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -593,3 +593,15 @@ mii_phy_detach(device_t dev) return(0); } + +const struct mii_phydesc * +mii_phy_match(const struct mii_attach_args *ma, const struct mii_phydesc *mpd) +{ + + for (; mpd->mpd_name != NULL; mpd++) { + if (MII_OUI(ma->mii_id1, ma->mii_id2) == mpd->mpd_oui && + MII_MODEL(ma->mii_id2) == mpd->mpd_model) + return (mpd); + } + return (NULL); +} |