summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_ste.c
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2002-08-19 16:54:26 +0000
committerambrisko <ambrisko@FreeBSD.org>2002-08-19 16:54:26 +0000
commitd0709eea67e0ae904f80928991bf3ce66b3fcbc4 (patch)
tree3b28a452672adda5c0d4512889bd87ef39d14e41 /sys/pci/if_ste.c
parent1a7cd1a210c4be2ec85df8513276938c23be1b95 (diff)
downloadFreeBSD-src-d0709eea67e0ae904f80928991bf3ce66b3fcbc4.zip
FreeBSD-src-d0709eea67e0ae904f80928991bf3ce66b3fcbc4.tar.gz
Don't read the PCI config space during mii operations. Instead save whether
or not we have to limit the PHY detection in the softc structure. Then just check the flag. Suggested by: jdp Reviewed by: jdp MFC after: 3 days
Diffstat (limited to 'sys/pci/if_ste.c')
-rw-r--r--sys/pci/if_ste.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c
index 5a2a814..5dca5da 100644
--- a/sys/pci/if_ste.c
+++ b/sys/pci/if_ste.c
@@ -380,9 +380,7 @@ static int ste_miibus_readreg(dev, phy, reg)
sc = device_get_softc(dev);
- if (pci_get_vendor(dev) == DL_VENDORID &&
- pci_get_device(dev) == DL_DEVICEID_550TX &&
- phy != 0)
+ if ( sc->ste_one_phy && phy != 0 )
return (0);
bzero((char *)&frame, sizeof(frame));
@@ -906,6 +904,13 @@ static int ste_attach(dev)
bzero(sc, sizeof(struct ste_softc));
sc->ste_dev = dev;
+ /*
+ * Only use the first PHY since this chip reports multiple
+ */
+ if (pci_get_vendor(dev) == DL_VENDORID &&
+ pci_get_device(dev) == DL_DEVICEID_550TX )
+ sc->ste_one_phy = 1;
+
mtx_init(&sc->ste_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE);
STE_LOCK(sc);
OpenPOWER on IntegriCloud