summaryrefslogtreecommitdiffstats
path: root/sys/dev/hme
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2002-03-11 02:37:19 +0000
committertmm <tmm@FreeBSD.org>2002-03-11 02:37:19 +0000
commit747cc01268eadabdf7bd49fa5303608ff8875259 (patch)
tree3d9585bdc0249024a93c71d565e4b1ec610d9289 /sys/dev/hme
parent195b3106209ab8868842a186e0c4cf67aba72d32 (diff)
downloadFreeBSD-src-747cc01268eadabdf7bd49fa5303608ff8875259.zip
FreeBSD-src-747cc01268eadabdf7bd49fa5303608ff8875259.tar.gz
Use the pci_enable_* functions instead of manually fiddling with the
command register. Pointed out by: msmith
Diffstat (limited to 'sys/dev/hme')
-rw-r--r--sys/dev/hme/if_hme_pci.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/hme/if_hme_pci.c b/sys/dev/hme/if_hme_pci.c
index 6128608..3978e00 100644
--- a/sys/dev/hme/if_hme_pci.c
+++ b/sys/dev/hme/if_hme_pci.c
@@ -120,16 +120,14 @@ hme_pci_attach(device_t dev)
{
struct hme_pci_softc *hsc = device_get_softc(dev);
struct hme_softc *sc = &hsc->hsc_hme;
- u_int16_t csr;
int error;
/*
- * enable io/memory-space accesses. this is kinda of gross; but
- * the hme comes up with neither IO space enabled, or memory space.
+ * Enable memory-space and bus master accesses. This is kinda of
+ * gross; but the hme comes up with neither enabled.
*/
- csr = pci_read_config(dev, PCIR_COMMAND, 2);
- csr |= PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN;
- pci_write_config(dev, PCIR_COMMAND, csr, 2);
+ pci_enable_busmaster(dev);
+ pci_enable_io(dev, SYS_RES_MEMORY);
sc->sc_pci = 1; /* XXXXX should all be done in bus_dma. */
sc->sc_dev = dev;
OpenPOWER on IntegriCloud