Some additions from FreeBSD 7 code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23017 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
78f45b048f
commit
b26de2e398
@ -165,6 +165,9 @@ struct mii_phydesc {
|
|||||||
u_int32_t mpd_model; /* the PHY's model */
|
u_int32_t mpd_model; /* the PHY's model */
|
||||||
const char *mpd_name; /* the PHY's name */
|
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.
|
* 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 *);
|
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);
|
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 *);
|
void ukphy_status(struct mii_softc *);
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL */
|
||||||
|
@ -542,3 +542,16 @@ mii_phy_match(const struct mii_attach_args *ma, const struct mii_phydesc *mpd)
|
|||||||
}
|
}
|
||||||
return (NULL);
|
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);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user