summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordyoung <dyoung@NetBSD.org>2011-07-26 20:51:23 +0000
committerdyoung <dyoung@NetBSD.org>2011-07-26 20:51:23 +0000
commit9d3c07c5f3b032e3472d80875d6ca2e7e7313e21 (patch)
treeab558b470bf5b59c1ee9ea86240999aac207274a /sys/dev
parenta79aa931bd32a7a300a4b943ce461673662f2a0e (diff)
Replace anonymous constants, 0x10, 0x14, ..., with PCI_BAR(0),
PCI_BAR(1), .... There was no change in the generated assembly. I used this semantic patch: @ mapsit @ identifier bar; expression pact; @@ ( pci_mapreg_map | Cardbus_mapreg_map )(pact, bar, ...) @ depends on mapsit @ identifier mapsit.bar; @@ ( - #define bar 0x10 + #define bar PCI_BAR(0) | - #define bar 0x14 + #define bar PCI_BAR(1) | - #define bar 0x18 + #define bar PCI_BAR(2) | - #define bar 0x1C + #define bar PCI_BAR(3) | - #define bar 0x20 + #define bar PCI_BAR(4) )
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cardbus/if_ath_cardbus.c6
-rw-r--r--sys/dev/cardbus/if_atw_cardbus.c8
-rw-r--r--sys/dev/cardbus/if_rtw_cardbus.c8
-rw-r--r--sys/dev/cardbus/if_tlp_cardbus.c8
-rw-r--r--sys/dev/pci/if_an_pci.c6
-rw-r--r--sys/dev/pci/if_ath_pci.c6
-rw-r--r--sys/dev/pci/if_atw_pci.c8
-rw-r--r--sys/dev/pci/if_bwi_pci.c6
-rw-r--r--sys/dev/pci/if_en_pci.c6
-rw-r--r--sys/dev/pci/if_ep_pci.c6
-rw-r--r--sys/dev/pci/if_epic_pci.c8
-rw-r--r--sys/dev/pci/if_esh_pci.c8
-rw-r--r--sys/dev/pci/if_ex_pci.c8
-rw-r--r--sys/dev/pci/if_le_pci.c6
-rw-r--r--sys/dev/pci/if_mtd_pci.c8
-rw-r--r--sys/dev/pci/if_ne_pci.c6
-rw-r--r--sys/dev/pci/if_ntwoc_pci.c8
-rw-r--r--sys/dev/pci/if_ral_pci.c6
-rw-r--r--sys/dev/pci/if_rtw_pci.c8
-rw-r--r--sys/dev/pci/if_tlp_pci.c8
-rw-r--r--sys/dev/pci/if_wi_pci.c12
21 files changed, 77 insertions, 77 deletions
diff --git a/sys/dev/cardbus/if_ath_cardbus.c b/sys/dev/cardbus/if_ath_cardbus.c
index 1d05d34c2ae..978a5a38ee9 100644
--- a/sys/dev/cardbus/if_ath_cardbus.c
+++ b/sys/dev/cardbus/if_ath_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ath_cardbus.c,v 1.42 2010/03/04 22:34:37 dyoung Exp $ */
+/* $NetBSD: if_ath_cardbus.c,v 1.43 2011/07/26 20:51:23 dyoung Exp $ */
/*
* Copyright (c) 2003
* Ichiro FUKUHARA <ichiro@ichiro.org>.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.42 2010/03/04 22:34:37 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.43 2011/07/26 20:51:23 dyoung Exp $");
#include "opt_inet.h"
@@ -81,7 +81,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.42 2010/03/04 22:34:37 dyoung E
/*
* PCI configuration space registers
*/
-#define ATH_PCI_MMBA 0x10 /* memory mapped base */
+#define ATH_PCI_MMBA PCI_BAR(0) /* memory mapped base */
struct ath_cardbus_softc {
struct ath_softc sc_ath;
diff --git a/sys/dev/cardbus/if_atw_cardbus.c b/sys/dev/cardbus/if_atw_cardbus.c
index b94e000c994..1bff9deb4de 100644
--- a/sys/dev/cardbus/if_atw_cardbus.c
+++ b/sys/dev/cardbus/if_atw_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atw_cardbus.c,v 1.34 2010/03/04 22:34:37 dyoung Exp $ */
+/* $NetBSD: if_atw_cardbus.c,v 1.35 2011/07/26 20:51:23 dyoung Exp $ */
/*-
* Copyright (c) 1999, 2000, 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.34 2010/03/04 22:34:37 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.35 2011/07/26 20:51:23 dyoung Exp $");
#include "opt_inet.h"
@@ -85,8 +85,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.34 2010/03/04 22:34:37 dyoung E
/*
* PCI configuration space registers used by the ADM8211.
*/
-#define ATW_PCI_IOBA 0x10 /* i/o mapped base */
-#define ATW_PCI_MMBA 0x14 /* memory mapped base */
+#define ATW_PCI_IOBA PCI_BAR(0) /* i/o mapped base */
+#define ATW_PCI_MMBA PCI_BAR(1) /* memory mapped base */
struct atw_cardbus_softc {
struct atw_softc sc_atw;
diff --git a/sys/dev/cardbus/if_rtw_cardbus.c b/sys/dev/cardbus/if_rtw_cardbus.c
index 2a93558c8dc..d0797af6a9e 100644
--- a/sys/dev/cardbus/if_rtw_cardbus.c
+++ b/sys/dev/cardbus/if_rtw_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_cardbus.c,v 1.40 2010/03/05 00:54:01 dyoung Exp $ */
+/* $NetBSD: if_rtw_cardbus.c,v 1.41 2011/07/26 20:51:23 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2005 David Young. All rights reserved.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtw_cardbus.c,v 1.40 2010/03/05 00:54:01 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtw_cardbus.c,v 1.41 2011/07/26 20:51:23 dyoung Exp $");
#include "opt_inet.h"
@@ -105,8 +105,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_rtw_cardbus.c,v 1.40 2010/03/05 00:54:01 dyoung E
/*
* PCI configuration space registers used by the RTL8180.
*/
-#define RTW_PCI_IOBA 0x10 /* i/o mapped base */
-#define RTW_PCI_MMBA 0x14 /* memory mapped base */
+#define RTW_PCI_IOBA PCI_BAR(0) /* i/o mapped base */
+#define RTW_PCI_MMBA PCI_BAR(1) /* memory mapped base */
struct rtw_cardbus_softc {
struct rtw_softc sc_rtw; /* real RTL8180 softc */
diff --git a/sys/dev/cardbus/if_tlp_cardbus.c b/sys/dev/cardbus/if_tlp_cardbus.c
index 068a9f0d03b..3ad24e9cb32 100644
--- a/sys/dev/cardbus/if_tlp_cardbus.c
+++ b/sys/dev/cardbus/if_tlp_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tlp_cardbus.c,v 1.68 2011/07/09 23:18:05 christos Exp $ */
+/* $NetBSD: if_tlp_cardbus.c,v 1.69 2011/07/26 20:51:23 dyoung Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_cardbus.c,v 1.68 2011/07/09 23:18:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_cardbus.c,v 1.69 2011/07/26 20:51:23 dyoung Exp $");
#include "opt_inet.h"
@@ -82,8 +82,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_tlp_cardbus.c,v 1.68 2011/07/09 23:18:05 christos
/*
* PCI configuration space registers used by the Tulip.
*/
-#define TULIP_PCI_IOBA 0x10 /* i/o mapped base */
-#define TULIP_PCI_MMBA 0x14 /* memory mapped base */
+#define TULIP_PCI_IOBA PCI_BAR(0) /* i/o mapped base */
+#define TULIP_PCI_MMBA PCI_BAR(1) /* memory mapped base */
#define TULIP_PCI_CFDA 0x40 /* configuration driver area */
#define CFDA_SLEEP 0x80000000 /* sleep mode */
diff --git a/sys/dev/pci/if_an_pci.c b/sys/dev/pci/if_an_pci.c
index 3424fe232f7..e593c7066b6 100644
--- a/sys/dev/pci/if_an_pci.c
+++ b/sys/dev/pci/if_an_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_an_pci.c,v 1.31 2009/11/26 15:17:09 njoly Exp $ */
+/* $NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.31 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -70,7 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.31 2009/11/26 15:17:09 njoly Exp $")
#include <dev/pci/pcidevs.h>
#define AN_PCI_PLX_IOBA 0x14 /* i/o base for PLX chip */
-#define AN_PCI_IOBA 0x18 /* i/o base */
+#define AN_PCI_IOBA PCI_BAR(2) /* i/o base */
struct an_pci_softc {
struct an_softc sc_an; /* real "an" softc */
diff --git a/sys/dev/pci/if_ath_pci.c b/sys/dev/pci/if_ath_pci.c
index 33939c454e8..5d90cbcf0b8 100644
--- a/sys/dev/pci/if_ath_pci.c
+++ b/sys/dev/pci/if_ath_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ath_pci.c,v 1.41 2011/02/21 14:43:58 jmcneill Exp $ */
+/* $NetBSD: if_ath_pci.c,v 1.42 2011/07/26 20:51:23 dyoung Exp $ */
/*-
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.41 2011/02/21 14:43:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.42 2011/07/26 20:51:23 dyoung Exp $");
/*
* PCI/Cardbus front-end for the Atheros Wireless LAN controller driver.
@@ -62,7 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.41 2011/02/21 14:43:58 jmcneill Exp
/*
* PCI configuration space registers
*/
-#define ATH_PCI_MMBA 0x10 /* memory mapped base */
+#define ATH_PCI_MMBA PCI_BAR(0) /* memory mapped base */
struct ath_pci_softc {
struct ath_softc sc_sc;
diff --git a/sys/dev/pci/if_atw_pci.c b/sys/dev/pci/if_atw_pci.c
index fcc5a73aa2e..6bb0173fe57 100644
--- a/sys/dev/pci/if_atw_pci.c
+++ b/sys/dev/pci/if_atw_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atw_pci.c,v 1.24 2010/02/24 22:38:00 dyoung Exp $ */
+/* $NetBSD: if_atw_pci.c,v 1.25 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atw_pci.c,v 1.24 2010/02/24 22:38:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atw_pci.c,v 1.25 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -75,8 +75,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_atw_pci.c,v 1.24 2010/02/24 22:38:00 dyoung Exp $
/*
* PCI configuration space registers used by the ADM8211.
*/
-#define ATW_PCI_IOBA 0x10 /* i/o mapped base */
-#define ATW_PCI_MMBA 0x14 /* memory mapped base */
+#define ATW_PCI_IOBA PCI_BAR(0) /* i/o mapped base */
+#define ATW_PCI_MMBA PCI_BAR(1) /* memory mapped base */
struct atw_pci_softc {
struct atw_softc psc_atw; /* real ADM8211 softc */
diff --git a/sys/dev/pci/if_bwi_pci.c b/sys/dev/pci/if_bwi_pci.c
index 7cc6adcc089..8d81b43a1c3 100644
--- a/sys/dev/pci/if_bwi_pci.c
+++ b/sys/dev/pci/if_bwi_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwi_pci.c,v 1.11 2011/05/18 01:02:43 dyoung Exp $ */
+/* $NetBSD: if_bwi_pci.c,v 1.12 2011/07/26 20:51:24 dyoung Exp $ */
/* $OpenBSD: if_bwi_pci.c,v 1.6 2008/02/14 22:10:02 brad Exp $ */
/*
@@ -24,7 +24,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.11 2011/05/18 01:02:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.12 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -54,7 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.11 2011/05/18 01:02:43 dyoung Exp $
#include <dev/pci/pcidevs.h>
/* Base Address Register */
-#define BWI_PCI_BAR0 0x10
+#define BWI_PCI_BAR0 PCI_BAR(0)
static int bwi_pci_match(device_t, cfdata_t, void *);
static void bwi_pci_attach(device_t, device_t, void *);
diff --git a/sys/dev/pci/if_en_pci.c b/sys/dev/pci/if_en_pci.c
index 0648171d143..1029cbc774c 100644
--- a/sys/dev/pci/if_en_pci.c
+++ b/sys/dev/pci/if_en_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_en_pci.c,v 1.35 2011/07/18 00:58:51 mrg Exp $ */
+/* $NetBSD: if_en_pci.c,v 1.36 2011/07/26 20:51:24 dyoung Exp $ */
/*
* Copyright (c) 1996 Charles D. Cranor and Washington University.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_en_pci.c,v 1.35 2011/07/18 00:58:51 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_en_pci.c,v 1.36 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -85,7 +85,7 @@ static void adp_get_macaddr(struct en_pci_softc *, struct pci_attach_args *);
* (this is card specific)
*/
-#define PCI_CBMA 0x10
+#define PCI_CBMA PCI_BAR(0)
/*
* tonga (pci bridge). ENI cards only!
diff --git a/sys/dev/pci/if_ep_pci.c b/sys/dev/pci/if_ep_pci.c
index 4270a2192d9..5ec7119150a 100644
--- a/sys/dev/pci/if_ep_pci.c
+++ b/sys/dev/pci/if_ep_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ep_pci.c,v 1.51 2009/11/26 15:17:09 njoly Exp $ */
+/* $NetBSD: if_ep_pci.c,v 1.52 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ep_pci.c,v 1.51 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ep_pci.c,v 1.52 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -95,7 +95,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ep_pci.c,v 1.51 2009/11/26 15:17:09 njoly Exp $")
/*
* PCI constants.
*/
-#define PCI_CBIO 0x10 /* Configuration Base IO Address */
+#define PCI_CBIO PCI_BAR(0) /* Configuration Base IO Address */
static int ep_pci_match(device_t , cfdata_t, void *);
static void ep_pci_attach(device_t , device_t , void *);
diff --git a/sys/dev/pci/if_epic_pci.c b/sys/dev/pci/if_epic_pci.c
index f4d8cd8b3c4..55825ca890d 100644
--- a/sys/dev/pci/if_epic_pci.c
+++ b/sys/dev/pci/if_epic_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_epic_pci.c,v 1.38 2009/11/26 15:17:09 njoly Exp $ */
+/* $NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.38 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -68,8 +68,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.38 2009/11/26 15:17:09 njoly Exp $
/*
* PCI configuration space registers used by the EPIC.
*/
-#define EPIC_PCI_IOBA 0x10 /* i/o mapped base */
-#define EPIC_PCI_MMBA 0x14 /* memory mapped base */
+#define EPIC_PCI_IOBA PCI_BAR(0) /* i/o mapped base */
+#define EPIC_PCI_MMBA PCI_BAR(1) /* memory mapped base */
struct epic_pci_softc {
struct epic_softc sc_epic; /* real EPIC softc */
diff --git a/sys/dev/pci/if_esh_pci.c b/sys/dev/pci/if_esh_pci.c
index 5272d17662d..23b9ef5f65d 100644
--- a/sys/dev/pci/if_esh_pci.c
+++ b/sys/dev/pci/if_esh_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_esh_pci.c,v 1.28 2009/11/26 15:17:09 njoly Exp $ */
+/* $NetBSD: if_esh_pci.c,v 1.29 2011/07/26 20:51:24 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_esh_pci.c,v 1.28 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_esh_pci.c,v 1.29 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -69,9 +69,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_esh_pci.c,v 1.28 2009/11/26 15:17:09 njoly Exp $"
* XXX These should be in a common file!
*/
#define PCI_CONN 0x48 /* Connector type */
-#define PCI_CBIO 0x10 /* Configuration Base IO Address */
+#define PCI_CBIO PCI_BAR(0) /* Configuration Base IO Address */
-#define MEM_MAP_REG 0x10
+#define MEM_MAP_REG PCI_BAR(0)
static int esh_pci_match(device_t, cfdata_t, void *);
static void esh_pci_attach(device_t, device_t, void *);
diff --git a/sys/dev/pci/if_ex_pci.c b/sys/dev/pci/if_ex_pci.c
index c3c6f754c08..78ab9e3a092 100644
--- a/sys/dev/pci/if_ex_pci.c
+++ b/sys/dev/pci/if_ex_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ex_pci.c,v 1.53 2010/03/22 23:03:30 dyoung Exp $ */
+/* $NetBSD: if_ex_pci.c,v 1.54 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ex_pci.c,v 1.53 2010/03/22 23:03:30 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ex_pci.c,v 1.54 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -81,9 +81,9 @@ struct ex_pci_softc {
* XXX These should be in a common file!
*/
#define PCI_CONN 0x48 /* Connector type */
-#define PCI_CBIO 0x10 /* Configuration Base IO Address */
+#define PCI_CBIO PCI_BAR(0) /* Configuration Base IO Address */
#define PCI_POWERCTL 0xe0
-#define PCI_FUNCMEM 0x18
+#define PCI_FUNCMEM PCI_BAR(2)
#define PCI_INTR 4
#define PCI_INTRACK 0x00008000
diff --git a/sys/dev/pci/if_le_pci.c b/sys/dev/pci/if_le_pci.c
index 1a31f7cc276..15acfaa2fc3 100644
--- a/sys/dev/pci/if_le_pci.c
+++ b/sys/dev/pci/if_le_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le_pci.c,v 1.50 2010/11/13 13:52:06 uebayasi Exp $ */
+/* $NetBSD: if_le_pci.c,v 1.51 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_pci.c,v 1.50 2010/11/13 13:52:06 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_pci.c,v 1.51 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -104,7 +104,7 @@ CFATTACH_DECL_NEW(le_pci, sizeof(struct le_softc),
* PCI constants.
* XXX These should be in a common file!
*/
-#define PCI_CBIO 0x10 /* Configuration Base IO Address */
+#define PCI_CBIO PCI_BAR(0) /* Configuration Base IO Address */
#define LE_PCI_MEMSIZE 16384
diff --git a/sys/dev/pci/if_mtd_pci.c b/sys/dev/pci/if_mtd_pci.c
index 2faac5c48ab..c23d5a85ea2 100644
--- a/sys/dev/pci/if_mtd_pci.c
+++ b/sys/dev/pci/if_mtd_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mtd_pci.c,v 1.15 2009/11/26 15:17:09 njoly Exp $ */
+/* $NetBSD: if_mtd_pci.c,v 1.16 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
/* TODO: Check why in IO space, the MII won't work. Memory mapped works */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mtd_pci.c,v 1.15 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mtd_pci.c,v 1.16 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -54,8 +54,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_mtd_pci.c,v 1.15 2009/11/26 15:17:09 njoly Exp $"
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
-#define PCI_IO_MAP_REG 0x10
-#define PCI_MEM_MAP_REG 0x14
+#define PCI_IO_MAP_REG PCI_BAR(0)
+#define PCI_MEM_MAP_REG PCI_BAR(1)
struct mtd_pci_device_id {
pci_vendor_id_t vendor; /* PCI vendor ID */
diff --git a/sys/dev/pci/if_ne_pci.c b/sys/dev/pci/if_ne_pci.c
index d7a73b267ce..c51af212032 100644
--- a/sys/dev/pci/if_ne_pci.c
+++ b/sys/dev/pci/if_ne_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ne_pci.c,v 1.35 2011/05/17 17:34:54 dyoung Exp $ */
+/* $NetBSD: if_ne_pci.c,v 1.36 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ne_pci.c,v 1.35 2011/05/17 17:34:54 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ne_pci.c,v 1.36 2011/07/26 20:51:24 dyoung Exp $");
#include "opt_ipkdb.h"
@@ -169,7 +169,7 @@ ne_pci_lookup(const struct pci_attach_args *pa)
* PCI constants.
* XXX These should be in a common file!
*/
-#define PCI_CBIO 0x10 /* Configuration Base IO Address */
+#define PCI_CBIO PCI_BAR(0) /* Configuration Base IO Address */
static int
ne_pci_match(device_t parent, cfdata_t match, void *aux)
diff --git a/sys/dev/pci/if_ntwoc_pci.c b/sys/dev/pci/if_ntwoc_pci.c
index 99a88fc7ef2..8f6d4fcd5b9 100644
--- a/sys/dev/pci/if_ntwoc_pci.c
+++ b/sys/dev/pci/if_ntwoc_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ntwoc_pci.c,v 1.26 2009/11/26 15:17:09 njoly Exp $ */
+/* $NetBSD: if_ntwoc_pci.c,v 1.27 2011/07/26 20:51:24 dyoung Exp $ */
/*
* Copyright (c) 1998 Vixie Enterprises
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_pci.c,v 1.26 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_pci.c,v 1.27 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -96,8 +96,8 @@ static void ntwoc_pci_config_interrupts(device_t);
/*
* Card specific config register location
*/
-#define PCI_CBMA_ASIC 0x10 /* Configuration Base Memory Address */
-#define PCI_CBMA_SCA 0x18
+#define PCI_CBMA_ASIC PCI_BAR(0) /* Configuration Base Memory Address */
+#define PCI_CBMA_SCA PCI_BAR(2)
struct ntwoc_pci_softc {
/* Generic device stuff */
diff --git a/sys/dev/pci/if_ral_pci.c b/sys/dev/pci/if_ral_pci.c
index fb7d2e4fb89..feb42466b57 100644
--- a/sys/dev/pci/if_ral_pci.c
+++ b/sys/dev/pci/if_ral_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ral_pci.c,v 1.17 2011/05/10 23:48:33 dyoung Exp $ */
+/* $NetBSD: if_ral_pci.c,v 1.18 2011/07/26 20:51:24 dyoung Exp $ */
/* $OpenBSD: if_ral_pci.c,v 1.6 2006/01/09 20:03:43 damien Exp $ */
/*-
@@ -22,7 +22,7 @@
* PCI front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.17 2011/05/10 23:48:33 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.18 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
@@ -87,7 +87,7 @@ struct ral_pci_softc {
};
/* Base Address Register */
-#define RAL_PCI_BAR0 0x10
+#define RAL_PCI_BAR0 PCI_BAR(0)
int ral_pci_match(device_t, cfdata_t, void *);
void ral_pci_attach(device_t, device_t, void *);
diff --git a/sys/dev/pci/if_rtw_pci.c b/sys/dev/pci/if_rtw_pci.c
index 45376731658..9dd3f004a5e 100644
--- a/sys/dev/pci/if_rtw_pci.c
+++ b/sys/dev/pci/if_rtw_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_pci.c,v 1.19 2011/01/26 00:16:52 dyoung Exp $ */
+/* $NetBSD: if_rtw_pci.c,v 1.20 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2005, 2010 David Young. All rights reserved.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtw_pci.c,v 1.19 2011/01/26 00:16:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtw_pci.c,v 1.20 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -102,8 +102,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_rtw_pci.c,v 1.19 2011/01/26 00:16:52 dyoung Exp $
/*
* PCI configuration space registers used by the RTL8180.
*/
-#define RTW_PCI_IOBA 0x10 /* i/o mapped base */
-#define RTW_PCI_MMBA 0x14 /* memory mapped base */
+#define RTW_PCI_IOBA PCI_BAR(0) /* i/o mapped base */
+#define RTW_PCI_MMBA PCI_BAR(1) /* memory mapped base */
struct rtw_pci_softc {
struct rtw_softc psc_rtw;
diff --git a/sys/dev/pci/if_tlp_pci.c b/sys/dev/pci/if_tlp_pci.c
index 4b03cf923dc..1f9fcbe6b3f 100644
--- a/sys/dev/pci/if_tlp_pci.c
+++ b/sys/dev/pci/if_tlp_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tlp_pci.c,v 1.117 2011/07/09 23:18:05 christos Exp $ */
+/* $NetBSD: if_tlp_pci.c,v 1.118 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.117 2011/07/09 23:18:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.118 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -71,8 +71,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.117 2011/07/09 23:18:05 christos Ex
/*
* PCI configuration space registers used by the Tulip.
*/
-#define TULIP_PCI_IOBA 0x10 /* i/o mapped base */
-#define TULIP_PCI_MMBA 0x14 /* memory mapped base */
+#define TULIP_PCI_IOBA PCI_BAR(0) /* i/o mapped base */
+#define TULIP_PCI_MMBA PCI_BAR(1) /* memory mapped base */
#define TULIP_PCI_CFDA 0x40 /* configuration driver area */
#define CFDA_SLEEP 0x80000000 /* sleep mode */
diff --git a/sys/dev/pci/if_wi_pci.c b/sys/dev/pci/if_wi_pci.c
index 3b562b4eacc..6ce553861b4 100644
--- a/sys/dev/pci/if_wi_pci.c
+++ b/sys/dev/pci/if_wi_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wi_pci.c,v 1.52 2010/11/23 04:36:09 christos Exp $ */
+/* $NetBSD: if_wi_pci.c,v 1.53 2011/07/26 20:51:24 dyoung Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.52 2010/11/23 04:36:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.53 2011/07/26 20:51:24 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -66,11 +66,11 @@ __KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.52 2010/11/23 04:36:09 christos Exp
#include <dev/ic/wireg.h>
#include <dev/ic/wivar.h>
-#define WI_PCI_CBMA 0x10 /* Configuration Base Memory Address */
+#define WI_PCI_CBMA PCI_BAR(0) /* Configuration Base Memory Address */
#define WI_PCI_PLX_LOMEM 0x10 /* PLX chip membase */
-#define WI_PCI_PLX_LOIO 0x14 /* PLX chip iobase */
-#define WI_PCI_LOMEM 0x18 /* ISA membase */
-#define WI_PCI_LOIO 0x1C /* ISA iobase */
+#define WI_PCI_PLX_LOIO PCI_BAR(1) /* PLX chip iobase */
+#define WI_PCI_LOMEM PCI_BAR(2) /* ISA membase */
+#define WI_PCI_LOIO PCI_BAR(3) /* ISA iobase */
#define CHIP_PLX_OTHER 0x01
#define CHIP_PLX_9052 0x02