-/* $OpenBSD: rgephy.c,v 1.31 2013/12/28 03:30:41 deraadt Exp $ */
+/* $OpenBSD: rgephy.c,v 1.32 2013/12/30 22:25:25 brad Exp $ */
/*
* Copyright (c) 2003
* Bill Paul <wpaul@windriver.com>. All rights reserved.
{
struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
int anar, reg, speed, gig = 0;
+ char *devname;
+
+ devname = sc->mii_dev.dv_parent->dv_cfdata->cf_driver->cd_name;
switch (cmd) {
case MII_POLLSTAT:
* need to restart the autonegotiation process. Read
* the BMSR twice in case it's latched.
*/
- if (sc->mii_rev < 2) {
+ if (strcmp(devname, "re") == 0) {
reg = PHY_READ(sc, RL_GMEDIASTAT);
if (reg & RL_GMEDIASTAT_LINK) {
sc->mii_ticks = 0;
{
struct mii_data *mii = sc->mii_pdata;
int bmsr, bmcr, gtsr;
+ char *devname;
+
+ devname = sc->mii_dev.dv_parent->dv_cfdata->cf_driver->cd_name;
mii->mii_media_status = IFM_AVALID;
mii->mii_media_active = IFM_ETHER;
- if (sc->mii_rev < 2) {
+ if (strcmp(devname, "re") == 0) {
bmsr = PHY_READ(sc, RL_GMEDIASTAT);
-
if (bmsr & RL_GMEDIASTAT_LINK)
mii->mii_media_status |= IFM_ACTIVE;
} else {
}
}
- if (sc->mii_rev < 2) {
+ if (strcmp(devname, "re") == 0) {
bmsr = PHY_READ(sc, RL_GMEDIASTAT);
if (bmsr & RL_GMEDIASTAT_1000MBPS)
mii->mii_media_active |= IFM_1000_T;