From a46419f0fc27b387743b94b87e5c62cab4f52b99 Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 21 Jul 2005 16:43:07 +0000 Subject: - Use the PCIR_BAR() macro rather than hardcoding rids. - Use pci_enable_busmaster() rather than fiddling with the PCI command register directly. --- sys/dev/de/if_de.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sys/dev/de/if_de.c') diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 55f746e..d116015 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -4742,8 +4742,8 @@ tulip_initring( * This is the PCI configuration support. */ -#define PCI_CBIO 0x10 /* Configuration Base IO Address */ -#define PCI_CBMA 0x14 /* Configuration Base Memory Address */ +#define PCI_CBIO PCIR_BAR(0) /* Configuration Base IO Address */ +#define PCI_CBMA PCIR_BAR(1) /* Configuration Base Memory Address */ #define PCI_CFDA 0x40 /* Configuration Driver Area */ static int @@ -4807,7 +4807,7 @@ tulip_pci_attach(device_t dev) tulip_media_t media = TULIP_MEDIA_UNKNOWN; #endif int retval, idx; - u_int32_t revinfo, cfdainfo, cfcsinfo; + u_int32_t revinfo, cfdainfo; unsigned csroffset = TULIP_PCI_CSROFFSET; unsigned csrsize = TULIP_PCI_CSRSIZE; tulip_csrptr_t csr_base; @@ -4825,13 +4825,9 @@ tulip_pci_attach(device_t dev) revinfo = pci_get_revid(dev); cfdainfo = pci_read_config(dev, PCI_CFDA, 4); - cfcsinfo = pci_read_config(dev, PCIR_COMMAND, 4); /* turn busmaster on in case BIOS doesn't set it */ - if(!(cfcsinfo & PCIM_CMD_BUSMASTEREN)) { - cfcsinfo |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, cfcsinfo, 4); - } + pci_enable_busmaster(dev); if (pci_get_vendor(dev) == DEC_VENDORID) { if (pci_get_device(dev) == CHIPID_21040) -- cgit v1.1