Module Name:    src
Committed By:   dyoung
Date:           Tue Jul 26 20:51:24 UTC 2011

Modified Files:
        src/sys/dev/cardbus: if_ath_cardbus.c if_atw_cardbus.c if_rtw_cardbus.c
            if_tlp_cardbus.c
        src/sys/dev/pci: if_an_pci.c if_ath_pci.c if_atw_pci.c if_bwi_pci.c
            if_en_pci.c if_ep_pci.c if_epic_pci.c if_esh_pci.c if_ex_pci.c
            if_le_pci.c if_mtd_pci.c if_ne_pci.c if_ntwoc_pci.c if_ral_pci.c
            if_rtw_pci.c if_tlp_pci.c if_wi_pci.c

Log Message:
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)
)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/cardbus/if_atw_cardbus.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/cardbus/if_rtw_cardbus.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/cardbus/if_tlp_cardbus.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_an_pci.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_ath_pci.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_atw_pci.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_bwi_pci.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_en_pci.c \
    src/sys/dev/pci/if_ne_pci.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_ep_pci.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/if_epic_pci.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/if_esh_pci.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pci/if_ex_pci.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/if_le_pci.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/if_mtd_pci.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_ntwoc_pci.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/if_ral_pci.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_rtw_pci.c
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/pci/if_tlp_pci.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/if_wi_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_ath_cardbus.c
diff -u src/sys/dev/cardbus/if_ath_cardbus.c:1.42 src/sys/dev/cardbus/if_ath_cardbus.c:1.43
--- src/sys/dev/cardbus/if_ath_cardbus.c:1.42	Thu Mar  4 22:34:37 2010
+++ src/sys/dev/cardbus/if_ath_cardbus.c	Tue Jul 26 20:51:23 2011
@@ -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 <ich...@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 @@
 /*
  * 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;

Index: src/sys/dev/cardbus/if_atw_cardbus.c
diff -u src/sys/dev/cardbus/if_atw_cardbus.c:1.34 src/sys/dev/cardbus/if_atw_cardbus.c:1.35
--- src/sys/dev/cardbus/if_atw_cardbus.c:1.34	Thu Mar  4 22:34:37 2010
+++ src/sys/dev/cardbus/if_atw_cardbus.c	Tue Jul 26 20:51:23 2011
@@ -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 @@
 /*
  * 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;

Index: src/sys/dev/cardbus/if_rtw_cardbus.c
diff -u src/sys/dev/cardbus/if_rtw_cardbus.c:1.40 src/sys/dev/cardbus/if_rtw_cardbus.c:1.41
--- src/sys/dev/cardbus/if_rtw_cardbus.c:1.40	Fri Mar  5 00:54:01 2010
+++ src/sys/dev/cardbus/if_rtw_cardbus.c	Tue Jul 26 20:51:23 2011
@@ -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 @@
 /*
  * 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 */

Index: src/sys/dev/cardbus/if_tlp_cardbus.c
diff -u src/sys/dev/cardbus/if_tlp_cardbus.c:1.68 src/sys/dev/cardbus/if_tlp_cardbus.c:1.69
--- src/sys/dev/cardbus/if_tlp_cardbus.c:1.68	Sat Jul  9 23:18:05 2011
+++ src/sys/dev/cardbus/if_tlp_cardbus.c	Tue Jul 26 20:51:23 2011
@@ -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 @@
 /*
  * 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 */

Index: src/sys/dev/pci/if_an_pci.c
diff -u src/sys/dev/pci/if_an_pci.c:1.31 src/sys/dev/pci/if_an_pci.c:1.32
--- src/sys/dev/pci/if_an_pci.c:1.31	Thu Nov 26 15:17:09 2009
+++ src/sys/dev/pci/if_an_pci.c	Tue Jul 26 20:51:23 2011
@@ -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 @@
 #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 */

Index: src/sys/dev/pci/if_ath_pci.c
diff -u src/sys/dev/pci/if_ath_pci.c:1.41 src/sys/dev/pci/if_ath_pci.c:1.42
--- src/sys/dev/pci/if_ath_pci.c:1.41	Mon Feb 21 14:43:58 2011
+++ src/sys/dev/pci/if_ath_pci.c	Tue Jul 26 20:51:23 2011
@@ -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 @@
 /*
  * 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;

Index: src/sys/dev/pci/if_atw_pci.c
diff -u src/sys/dev/pci/if_atw_pci.c:1.24 src/sys/dev/pci/if_atw_pci.c:1.25
--- src/sys/dev/pci/if_atw_pci.c:1.24	Wed Feb 24 22:38:00 2010
+++ src/sys/dev/pci/if_atw_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 /*
  * 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 */

Index: src/sys/dev/pci/if_bwi_pci.c
diff -u src/sys/dev/pci/if_bwi_pci.c:1.11 src/sys/dev/pci/if_bwi_pci.c:1.12
--- src/sys/dev/pci/if_bwi_pci.c:1.11	Wed May 18 01:02:43 2011
+++ src/sys/dev/pci/if_bwi_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 #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 *);

Index: src/sys/dev/pci/if_en_pci.c
diff -u src/sys/dev/pci/if_en_pci.c:1.35 src/sys/dev/pci/if_en_pci.c:1.36
--- src/sys/dev/pci/if_en_pci.c:1.35	Mon Jul 18 00:58:51 2011
+++ src/sys/dev/pci/if_en_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
  * (this is card specific)
  */
 
-#define PCI_CBMA        0x10
+#define PCI_CBMA PCI_BAR(0)
 
 /*
  * tonga (pci bridge).   ENI cards only!
Index: src/sys/dev/pci/if_ne_pci.c
diff -u src/sys/dev/pci/if_ne_pci.c:1.35 src/sys/dev/pci/if_ne_pci.c:1.36
--- src/sys/dev/pci/if_ne_pci.c:1.35	Tue May 17 17:34:54 2011
+++ src/sys/dev/pci/if_ne_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
  * 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)

Index: src/sys/dev/pci/if_ep_pci.c
diff -u src/sys/dev/pci/if_ep_pci.c:1.51 src/sys/dev/pci/if_ep_pci.c:1.52
--- src/sys/dev/pci/if_ep_pci.c:1.51	Thu Nov 26 15:17:09 2009
+++ src/sys/dev/pci/if_ep_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 /*
  * 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 *);

Index: src/sys/dev/pci/if_epic_pci.c
diff -u src/sys/dev/pci/if_epic_pci.c:1.38 src/sys/dev/pci/if_epic_pci.c:1.39
--- src/sys/dev/pci/if_epic_pci.c:1.38	Thu Nov 26 15:17:09 2009
+++ src/sys/dev/pci/if_epic_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 /*
  * 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 */

Index: src/sys/dev/pci/if_esh_pci.c
diff -u src/sys/dev/pci/if_esh_pci.c:1.28 src/sys/dev/pci/if_esh_pci.c:1.29
--- src/sys/dev/pci/if_esh_pci.c:1.28	Thu Nov 26 15:17:09 2009
+++ src/sys/dev/pci/if_esh_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
  * 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 *);

Index: src/sys/dev/pci/if_ex_pci.c
diff -u src/sys/dev/pci/if_ex_pci.c:1.53 src/sys/dev/pci/if_ex_pci.c:1.54
--- src/sys/dev/pci/if_ex_pci.c:1.53	Mon Mar 22 23:03:30 2010
+++ src/sys/dev/pci/if_ex_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
  * 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

Index: src/sys/dev/pci/if_le_pci.c
diff -u src/sys/dev/pci/if_le_pci.c:1.50 src/sys/dev/pci/if_le_pci.c:1.51
--- src/sys/dev/pci/if_le_pci.c:1.50	Sat Nov 13 13:52:06 2010
+++ src/sys/dev/pci/if_le_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
  * 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
 

Index: src/sys/dev/pci/if_mtd_pci.c
diff -u src/sys/dev/pci/if_mtd_pci.c:1.15 src/sys/dev/pci/if_mtd_pci.c:1.16
--- src/sys/dev/pci/if_mtd_pci.c:1.15	Thu Nov 26 15:17:09 2009
+++ src/sys/dev/pci/if_mtd_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 #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 */

Index: src/sys/dev/pci/if_ntwoc_pci.c
diff -u src/sys/dev/pci/if_ntwoc_pci.c:1.26 src/sys/dev/pci/if_ntwoc_pci.c:1.27
--- src/sys/dev/pci/if_ntwoc_pci.c:1.26	Thu Nov 26 15:17:09 2009
+++ src/sys/dev/pci/if_ntwoc_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 /*
  * 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 */

Index: src/sys/dev/pci/if_ral_pci.c
diff -u src/sys/dev/pci/if_ral_pci.c:1.17 src/sys/dev/pci/if_ral_pci.c:1.18
--- src/sys/dev/pci/if_ral_pci.c:1.17	Tue May 10 23:48:33 2011
+++ src/sys/dev/pci/if_ral_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 };
 
 /* 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 *);

Index: src/sys/dev/pci/if_rtw_pci.c
diff -u src/sys/dev/pci/if_rtw_pci.c:1.19 src/sys/dev/pci/if_rtw_pci.c:1.20
--- src/sys/dev/pci/if_rtw_pci.c:1.19	Wed Jan 26 00:16:52 2011
+++ src/sys/dev/pci/if_rtw_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 /*
  * 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;

Index: src/sys/dev/pci/if_tlp_pci.c
diff -u src/sys/dev/pci/if_tlp_pci.c:1.117 src/sys/dev/pci/if_tlp_pci.c:1.118
--- src/sys/dev/pci/if_tlp_pci.c:1.117	Sat Jul  9 23:18:05 2011
+++ src/sys/dev/pci/if_tlp_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 /*
  * 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 */

Index: src/sys/dev/pci/if_wi_pci.c
diff -u src/sys/dev/pci/if_wi_pci.c:1.52 src/sys/dev/pci/if_wi_pci.c:1.53
--- src/sys/dev/pci/if_wi_pci.c:1.52	Tue Nov 23 04:36:09 2010
+++ src/sys/dev/pci/if_wi_pci.c	Tue Jul 26 20:51:24 2011
@@ -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 @@
 #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

Reply via email to