summaryrefslogtreecommitdiffstats
path: root/sys/i4b
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i4b')
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_pci.c6
-rw-r--r--sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c6
-rw-r--r--sys/i4b/layer1/isic/i4b_elsa_qs1p.c10
-rw-r--r--sys/i4b/layer1/itjc/i4b_itjc_pci.c4
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_pci.c7
5 files changed, 15 insertions, 18 deletions
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
index 8a0e7ba..6e4c354 100644
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
+++ b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
@@ -514,7 +514,7 @@ avma1pp_attach_avma1pp(device_t dev)
ifpi_scp[unit] = sc;
- sc->sc_resources.io_rid[0] = PCIR_MAPS+4;
+ sc->sc_resources.io_rid[0] = PCIR_BAR(1);
sc->sc_resources.io_base[0] = bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[0],
0, ~0, 1, RF_ACTIVE);
@@ -534,7 +534,7 @@ avma1pp_attach_avma1pp(device_t dev)
&sc->sc_resources.irq_rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE);
if (sc->sc_resources.irq == NULL) {
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS+4, sc->sc_resources.io_base[0]);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
printf("avma1pp%d: couldn't map interrupt\n", unit);
error = ENXIO;
goto fail;
@@ -544,7 +544,7 @@ avma1pp_attach_avma1pp(device_t dev)
if (error) {
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq);
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS+4, sc->sc_resources.io_base[0]);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
printf("avma1pp%d: couldn't set up irq\n", unit);
goto fail;
}
diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c b/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c
index 0281fb8..7284af0 100644
--- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c
+++ b/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c
@@ -468,7 +468,7 @@ avma1pp2_attach_avma1pp(device_t dev)
ifpi2_scp[unit] = sc;
- sc->sc_resources.io_rid[0] = PCIR_MAPS+4;
+ sc->sc_resources.io_rid[0] = PCIR_BAR(1);
sc->sc_resources.io_base[0] = bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[0],
0, ~0, 1, RF_ACTIVE);
@@ -488,7 +488,7 @@ avma1pp2_attach_avma1pp(device_t dev)
&sc->sc_resources.irq_rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE);
if (sc->sc_resources.irq == NULL) {
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS+4, sc->sc_resources.io_base[0]);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
printf("ifpi2-%d: couldn't map interrupt\n", unit);
error = ENXIO;
goto fail;
@@ -498,7 +498,7 @@ avma1pp2_attach_avma1pp(device_t dev)
if (error) {
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq);
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS+4, sc->sc_resources.io_base[0]);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
printf("ifpi2-%d: couldn't set up irq\n", unit);
goto fail;
}
diff --git a/sys/i4b/layer1/isic/i4b_elsa_qs1p.c b/sys/i4b/layer1/isic/i4b_elsa_qs1p.c
index 836daa6..d55ac83 100644
--- a/sys/i4b/layer1/isic/i4b_elsa_qs1p.c
+++ b/sys/i4b/layer1/isic/i4b_elsa_qs1p.c
@@ -58,12 +58,12 @@ __FBSDID("$FreeBSD$");
#include <i4b/layer1/isic/i4b_isic.h>
#include <i4b/layer1/isic/i4b_ipac.h>
-#define MEM0_MAPOFF 0
-#define PORT0_MAPOFF 4
-#define PORT1_MAPOFF 12
+#define MEM0_BAR 0
+#define PORT0_BAR 1
+#define PORT1_BAR 3
-#define ELSA_PORT0_MAPOFF (PCIR_MAPS+PORT0_MAPOFF)
-#define ELSA_PORT1_MAPOFF (PCIR_MAPS+PORT1_MAPOFF)
+#define ELSA_PORT0_MAPOFF PCIR_BAR(PORT0_BAR)
+#define ELSA_PORT1_MAPOFF PCIR_BAR(PORT1_BAR)
#define PCI_QS1000_DID 0x1000
#define PCI_QS1000_VID 0x1048
diff --git a/sys/i4b/layer1/itjc/i4b_itjc_pci.c b/sys/i4b/layer1/itjc/i4b_itjc_pci.c
index 4b19678..f319ea0 100644
--- a/sys/i4b/layer1/itjc/i4b_itjc_pci.c
+++ b/sys/i4b/layer1/itjc/i4b_itjc_pci.c
@@ -1538,7 +1538,7 @@ itjc_attach(device_t dev)
itjc_scp[unit] = sc;
- sc->sc_resources.io_rid[0] = PCIR_MAPS+0;
+ sc->sc_resources.io_rid[0] = PCIR_BAR(0);
sc->sc_resources.io_base[0] = bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[0], 0, ~0, 1, RF_ACTIVE);
@@ -1763,7 +1763,7 @@ itjc_attach(device_t dev)
/* FALL TRHU */
case 1:
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS+0,
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0),
sc->sc_resources.io_base[0]);
/* FALL TRHU */
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_pci.c b/sys/i4b/layer1/iwic/i4b_iwic_pci.c
index bae1a5c..c8bbbe0 100644
--- a/sys/i4b/layer1/iwic/i4b_iwic_pci.c
+++ b/sys/i4b/layer1/iwic/i4b_iwic_pci.c
@@ -64,11 +64,8 @@ extern struct i4b_l1mux_func iwic_l1mux_func;
/* Winbond PCI Configuration Space */
-#define BASEREG0_MAPOFF 0x00
-#define BASEREG1_MAPOFF 0x04
-
-#define BADDR0 (PCIR_MAPS + BASEREG0_MAPOFF)
-#define BADDR1 (PCIR_MAPS + BASEREG1_MAPOFF)
+#define BADDR0 PCIR_BAR(0)
+#define BADDR1 PCIR_BAR(1)
static void iwic_pci_intr(struct iwic_softc *sc);
OpenPOWER on IntegriCloud