From 344823993bf31d22dc1a4bccb3b6cc20c7e10781 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 3 Jun 2006 20:37:56 +0000 Subject: [PATCH] Use PCI bus accessors rather than reading config registers directly to get the subvendor device id. --- sys/dev/dc/dcphy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/dc/dcphy.c b/sys/dev/dc/dcphy.c index e11fa54889f..3c0e60b82d1 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; -- 2.45.2