summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/pci/if_pcn.c5
-rw-r--r--sys/pci/if_pcnreg.h1
2 files changed, 5 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);
}
diff --git a/sys/pci/if_pcnreg.h b/sys/pci/if_pcnreg.h
index 7074035..dc234b6 100644
--- a/sys/pci/if_pcnreg.h
+++ b/sys/pci/if_pcnreg.h
@@ -453,6 +453,7 @@ struct pcn_softc {
device_t pcn_miibus;
u_int8_t pcn_unit;
u_int8_t pcn_link;
+ u_int8_t pcn_phyaddr;
int pcn_if_flags;
int pcn_type;
struct pcn_list_data *pcn_ldata;
OpenPOWER on IntegriCloud