From b26de2e3989225bef41a1a28af56dbcda9ec4bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 28 Nov 2007 22:16:55 +0000 Subject: [PATCH] Some additions from FreeBSD 7 code. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23017 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../compat/freebsd_network/compat/dev/mii/miivar.h | 4 ++++ src/libs/compat/freebsd_network/fbsd_mii_physubr.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/libs/compat/freebsd_network/compat/dev/mii/miivar.h b/src/libs/compat/freebsd_network/compat/dev/mii/miivar.h index 1bbce2d428..9f716ef7d5 100644 --- a/src/libs/compat/freebsd_network/compat/dev/mii/miivar.h +++ b/src/libs/compat/freebsd_network/compat/dev/mii/miivar.h @@ -165,6 +165,9 @@ struct mii_phydesc { u_int32_t mpd_model; /* the PHY's model */ const char *mpd_name; /* the PHY's name */ }; +#define MII_PHY_DESC(a, b) { MII_OUI_ ## a, MII_MODEL_ ## a ## _ ## b, \ + MII_STR_ ## a ## _ ## b } +#define MII_PHY_END { 0, 0, NULL } /* * An array of these structures map MII media types to BMCR/ANAR settings. @@ -243,6 +246,7 @@ void mii_phy_update(struct mii_softc *, int); int mii_phy_tick(struct mii_softc *); const struct mii_phydesc * mii_phy_match(const struct mii_attach_args *ma, const struct mii_phydesc *mpd); +int mii_phy_dev_probe(device_t dev, const struct mii_phydesc *mpd, int mrv); void ukphy_status(struct mii_softc *); #endif /* _KERNEL */ diff --git a/src/libs/compat/freebsd_network/fbsd_mii_physubr.c b/src/libs/compat/freebsd_network/fbsd_mii_physubr.c index e775e46dbc..cfd7f27bda 100644 --- a/src/libs/compat/freebsd_network/fbsd_mii_physubr.c +++ b/src/libs/compat/freebsd_network/fbsd_mii_physubr.c @@ -542,3 +542,16 @@ mii_phy_match(const struct mii_attach_args *ma, const struct mii_phydesc *mpd) } return (NULL); } + +int +mii_phy_dev_probe(device_t dev, const struct mii_phydesc *mpd, int mrv) +{ + + mpd = mii_phy_match(device_get_ivars(dev), mpd); + if (mpd != NULL) { + device_set_desc(dev, mpd->mpd_name); + return (mrv); + } + + return (ENXIO); +}