diff options
author | jhb <jhb@FreeBSD.org> | 2006-06-03 20:37:56 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-06-03 20:37:56 +0000 |
commit | fae2502406efe812bb5df287bc6e34c5a4ea1146 (patch) | |
tree | d328e014c497b71e0acd82b01d529d25d2cae576 /sys/dev/dc | |
parent | f16c41b4d8c8abc7c4b05ea931d0229854f10b23 (diff) | |
download | FreeBSD-src-fae2502406efe812bb5df287bc6e34c5a4ea1146.zip FreeBSD-src-fae2502406efe812bb5df287bc6e34c5a4ea1146.tar.gz |
Use PCI bus accessors rather than reading config registers directly to
get the subvendor device id.
Diffstat (limited to 'sys/dev/dc')
-rw-r--r-- | sys/dev/dc/dcphy.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/dc/dcphy.c b/sys/dev/dc/dcphy.c index e11fa54..3c0e60b 100644 --- a/sys/dev/dc/dcphy.c +++ b/sys/dev/dc/dcphy.c @@ -141,6 +141,7 @@ dcphy_attach(device_t dev) struct mii_attach_args *ma; struct mii_data *mii; struct dc_softc *dc_sc; + device_t brdev; sc = device_get_softc(dev); ma = device_get_ivars(dev); @@ -166,8 +167,8 @@ dcphy_attach(device_t dev) CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0); CSR_WRITE_4(dc_sc, DC_10BTCTRL, 0); - switch(pci_read_config(device_get_parent(sc->mii_dev), - DC_PCI_CSID, 4)) { + brdev = device_get_parent(sc->mii_dev); + switch (pci_get_subdevice(brdev) << 16 | pci_get_subvendor(brdev)) { case COMPAQ_PRESARIO_ID: /* Example of how to only allow 10Mbps modes. */ sc->mii_capabilities = BMSR_ANEG|BMSR_10TFDX|BMSR_10THDX; |