summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_dc.c4
-rw-r--r--sys/pci/if_mn.c4
-rw-r--r--sys/pci/if_rl.c4
-rw-r--r--sys/pci/xrpu.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 06e57b1..8ddf661 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -3773,7 +3773,7 @@ dc_suspend(device_t dev)
dc_stop(sc);
for (i = 0; i < 5; i++)
- sc->saved_maps[i] = pci_read_config(dev, PCIR_MAPS + i * 4, 4);
+ sc->saved_maps[i] = pci_read_config(dev, PCIR_BAR(i), 4);
sc->saved_biosaddr = pci_read_config(dev, PCIR_BIOS, 4);
sc->saved_intline = pci_read_config(dev, PCIR_INTLINE, 1);
sc->saved_cachelnsz = pci_read_config(dev, PCIR_CACHELNSZ, 1);
@@ -3806,7 +3806,7 @@ dc_resume(device_t dev)
#endif
/* better way to do this? */
for (i = 0; i < 5; i++)
- pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4);
+ pci_write_config(dev, PCIR_BAR(i), sc->saved_maps[i], 4);
pci_write_config(dev, PCIR_BIOS, sc->saved_biosaddr, 4);
pci_write_config(dev, PCIR_INTLINE, sc->saved_intline, 1);
pci_write_config(dev, PCIR_CACHELNSZ, sc->saved_cachelnsz, 1);
diff --git a/sys/pci/if_mn.c b/sys/pci/if_mn.c
index 00745ba..a87e4bb 100644
--- a/sys/pci/if_mn.c
+++ b/sys/pci/if_mn.c
@@ -1349,7 +1349,7 @@ mn_attach (device_t self)
sc->framing = E1;
sprintf(sc->name, "mn%d", sc->unit);
- rid = PCIR_MAPS;
+ rid = PCIR_BAR(0);
res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE);
if (res == NULL) {
@@ -1360,7 +1360,7 @@ mn_attach (device_t self)
sc->m0v = rman_get_virtual(res);
sc->m0p = rman_get_start(res);
- rid = PCIR_MAPS + 4;
+ rid = PCIR_BAR(1);
res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE);
if (res == NULL) {
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index eca9a19..19a6859 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -3024,7 +3024,7 @@ rl_suspend(dev)
rl_stop(sc);
for (i = 0; i < 5; i++)
- sc->saved_maps[i] = pci_read_config(dev, PCIR_MAPS + i * 4, 4);
+ sc->saved_maps[i] = pci_read_config(dev, PCIR_BAR(i), 4);
sc->saved_biosaddr = pci_read_config(dev, PCIR_BIOS, 4);
sc->saved_intline = pci_read_config(dev, PCIR_INTLINE, 1);
sc->saved_cachelnsz = pci_read_config(dev, PCIR_CACHELNSZ, 1);
@@ -3053,7 +3053,7 @@ rl_resume(dev)
/* better way to do this? */
for (i = 0; i < 5; i++)
- pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4);
+ pci_write_config(dev, PCIR_BAR(i), sc->saved_maps[i], 4);
pci_write_config(dev, PCIR_BIOS, sc->saved_biosaddr, 4);
pci_write_config(dev, PCIR_INTLINE, sc->saved_intline, 1);
pci_write_config(dev, PCIR_CACHELNSZ, sc->saved_cachelnsz, 1);
diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c
index 9782399..08dbe82 100644
--- a/sys/pci/xrpu.c
+++ b/sys/pci/xrpu.c
@@ -225,7 +225,7 @@ xrpu_attach(device_t self)
unit = device_get_unit(self);
sc = device_get_softc(self);
sc->mode = NORMAL;
- rid = PCIR_MAPS;
+ rid = PCIR_BAR(0);
res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE);
if (res == NULL) {
OpenPOWER on IntegriCloud