summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_pcn.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-09-22 03:49:12 +0000
committerwpaul <wpaul@FreeBSD.org>2000-09-22 03:49:12 +0000
commit9d6e371055262bb0fc5bc944c8c181497fe46bae (patch)
tree49b72d0508479aeb93622f1301ce0f7909bfd8a3 /sys/pci/if_pcn.c
parentb2e6e23935fb9861be50729e5ca7dd953565f3b1 (diff)
downloadFreeBSD-src-9d6e371055262bb0fc5bc944c8c181497fe46bae.zip
FreeBSD-src-9d6e371055262bb0fc5bc944c8c181497fe46bae.tar.gz
Make pcn_miibus_readreg() latch onto the first PHY that it finds (as
a result of mii_phy_probe()) and use that rather than hardcoding a constant. The hardcoded way was too specific to the particular card I had and caused PHY probing to fail on at least one laptop with a built-in AMD chip. Reported by: rjk@grauel.com (Richard J Kuhns)
Diffstat (limited to 'sys/pci/if_pcn.c')
-rw-r--r--sys/pci/if_pcn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index 5f6625b..0767dff 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -238,13 +238,16 @@ static int pcn_miibus_readreg(dev, phy, reg)
sc = device_get_softc(dev);
- if (phy >= 30)
+ if (sc->pcn_phyaddr && phy > sc->pcn_phyaddr)
return(0);
pcn_bcr_write(sc, PCN_BCR_MIIADDR, reg | (phy << 5));
val = pcn_bcr_read(sc, PCN_BCR_MIIDATA) & 0xFFFF;
if (val == 0xFFFF)
return(0);
+
+ sc->pcn_phyaddr = phy;
+
return(val);
}
OpenPOWER on IntegriCloud