summaryrefslogtreecommitdiffstats
path: root/sys/dev/de/if_de.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-07-21 16:43:07 +0000
committerjhb <jhb@FreeBSD.org>2005-07-21 16:43:07 +0000
commita46419f0fc27b387743b94b87e5c62cab4f52b99 (patch)
tree52db264b674e9996d43a9707919c5deef7ad3ca5 /sys/dev/de/if_de.c
parent85a0e8deb13950394fa190199b688d7230b3ca6a (diff)
downloadFreeBSD-src-a46419f0fc27b387743b94b87e5c62cab4f52b99.zip
FreeBSD-src-a46419f0fc27b387743b94b87e5c62cab4f52b99.tar.gz
- Use the PCIR_BAR() macro rather than hardcoding rids.
- Use pci_enable_busmaster() rather than fiddling with the PCI command register directly.
Diffstat (limited to 'sys/dev/de/if_de.c')
-rw-r--r--sys/dev/de/if_de.c12
1 files changed, 4 insertions, 8 deletions
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)
OpenPOWER on IntegriCloud