summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pci')
-rw-r--r--sys/dev/sound/pci/als4000.c2
-rw-r--r--sys/dev/sound/pci/au88x0.c4
-rw-r--r--sys/dev/sound/pci/aureal.c2
-rw-r--r--sys/dev/sound/pci/cmi.c2
-rw-r--r--sys/dev/sound/pci/cs4281.c4
-rw-r--r--sys/dev/sound/pci/csa.c8
-rw-r--r--sys/dev/sound/pci/csamidi.c4
-rw-r--r--sys/dev/sound/pci/csapcm.c4
-rw-r--r--sys/dev/sound/pci/ds1.c2
-rw-r--r--sys/dev/sound/pci/emu10k1.c6
-rw-r--r--sys/dev/sound/pci/es137x.c2
-rw-r--r--sys/dev/sound/pci/fm801.c6
-rw-r--r--sys/dev/sound/pci/maestro.c2
-rw-r--r--sys/dev/sound/pci/maestro3.c2
-rw-r--r--sys/dev/sound/pci/neomagic.c6
-rw-r--r--sys/dev/sound/pci/solo.c20
-rw-r--r--sys/dev/sound/pci/t4dwave.c2
-rw-r--r--sys/dev/sound/pci/via8233.c2
-rw-r--r--sys/dev/sound/pci/via82c686.c2
19 files changed, 41 insertions, 41 deletions
diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c
index 85c48dd..0c1a85d 100644
--- a/sys/dev/sound/pci/als4000.c
+++ b/sys/dev/sound/pci/als4000.c
@@ -713,7 +713,7 @@ als_resource_free(device_t dev, struct sc_info *sc)
static int
als_resource_grab(device_t dev, struct sc_info *sc)
{
- sc->regid = PCIR_MAPS;
+ sc->regid = PCIR_BAR(0);
sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->regid, 0, ~0,
ALS_CONFIG_SPACE_BYTES, RF_ACTIVE);
if (sc->reg == 0) {
diff --git a/sys/dev/sound/pci/au88x0.c b/sys/dev/sound/pci/au88x0.c
index ab00d0f..53905c8 100644
--- a/sys/dev/sound/pci/au88x0.c
+++ b/sys/dev/sound/pci/au88x0.c
@@ -499,14 +499,14 @@ au88x0_pci_attach(device_t dev)
config = pci_read_config(dev, PCIR_COMMAND, 2);
if (config & PCIM_CMD_MEMEN) {
/* try memory-mapped I/O */
- aui->aui_regid = PCIR_MAPS;
+ aui->aui_regid = PCIR_BAR(0);
aui->aui_regtype = SYS_RES_MEMORY;
aui->aui_reg = bus_alloc_resource(dev, aui->aui_regtype,
&aui->aui_regid, 0, ~0, 1, RF_ACTIVE);
}
if (aui->aui_reg == NULL && (config & PCIM_CMD_PORTEN)) {
/* fall back on port I/O */
- aui->aui_regid = PCIR_MAPS;
+ aui->aui_regid = PCIR_BAR(0);
aui->aui_regtype = SYS_RES_IOPORT;
aui->aui_reg = bus_alloc_resource(dev, aui->aui_regtype,
&aui->aui_regid, 0, ~0, 1, RF_ACTIVE);
diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c
index a822f38..47ba3c5 100644
--- a/sys/dev/sound/pci/aureal.c
+++ b/sys/dev/sound/pci/aureal.c
@@ -582,7 +582,7 @@ au_pci_attach(device_t dev)
printf("at 0x%x...", config_id->map[i].base);
}
#endif
- regid[j] = PCIR_MAPS + i*4;
+ regid[j] = PCIR_BAR(i);
type[j] = SYS_RES_MEMORY;
reg[j] = bus_alloc_resource(dev, type[j], &regid[j],
0, ~0, 1, RF_ACTIVE);
diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c
index 787f079..52c519a 100644
--- a/sys/dev/sound/pci/cmi.c
+++ b/sys/dev/sound/pci/cmi.c
@@ -849,7 +849,7 @@ cmi_attach(device_t dev)
data = pci_read_config(dev, PCIR_COMMAND, 2);
sc->dev = dev;
- sc->regid = PCIR_MAPS;
+ sc->regid = PCIR_BAR(0);
sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->regid,
0, BUS_SPACE_UNRESTRICTED, 1, RF_ACTIVE);
if (!sc->reg) {
diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c
index 27b1730..3a7a957 100644
--- a/sys/dev/sound/pci/cs4281.c
+++ b/sys/dev/sound/pci/cs4281.c
@@ -785,7 +785,7 @@ cs4281_pci_attach(device_t dev)
}
#endif
- sc->regid = PCIR_MAPS;
+ sc->regid = PCIR_BAR(0);
sc->regtype = SYS_RES_MEMORY;
sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE);
@@ -801,7 +801,7 @@ cs4281_pci_attach(device_t dev)
sc->st = rman_get_bustag(sc->reg);
sc->sh = rman_get_bushandle(sc->reg);
- sc->memid = PCIR_MAPS + 4;
+ sc->memid = PCIR_BAR(1);
sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, 0,
~0, CS4281PCI_BA1_SIZE, RF_ACTIVE);
if (sc->mem == NULL) {
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
index 67fd3f7..3c45e19 100644
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -258,11 +258,11 @@ csa_attach(device_t dev)
scp->card = csa_findsubcard(dev);
scp->binfo.card = scp->card;
printf("csa: card is %s\n", scp->card->name);
- resp->io_rid = PCIR_MAPS;
+ resp->io_rid = PCIR_BAR(0);
resp->io = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->io_rid, 0, ~0, 1, RF_ACTIVE);
if (resp->io == NULL)
return (ENXIO);
- resp->mem_rid = PCIR_MAPS + 4;
+ resp->mem_rid = PCIR_BAR(1);
resp->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->mem_rid, 0, ~0, 1, RF_ACTIVE);
if (resp->mem == NULL)
goto err_io;
@@ -392,10 +392,10 @@ csa_alloc_resource(device_t bus, device_t child, int type, int *rid,
break;
case SYS_RES_MEMORY:
switch (*rid) {
- case PCIR_MAPS:
+ case PCIR_BAR(0):
res = resp->io;
break;
- case PCIR_MAPS + 4:
+ case PCIR_BAR(1):
res = resp->mem;
break;
default:
diff --git a/sys/dev/sound/pci/csamidi.c b/sys/dev/sound/pci/csamidi.c
index 7fe6ae7..4b9ce3d 100644
--- a/sys/dev/sound/pci/csamidi.c
+++ b/sys/dev/sound/pci/csamidi.c
@@ -165,8 +165,8 @@ csamidi_probe(device_t dev)
scp = device_get_softc(dev);
bzero(scp, sizeof(*scp));
- scp->io_rid = PCIR_MAPS;
- scp->mem_rid = PCIR_MAPS + 4;
+ scp->io_rid = PCIR_BAR(0);
+ scp->mem_rid = PCIR_BAR(1);
scp->irq_rid = 0;
device_set_desc(dev, s);
diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c
index a6e40eb..c9df849 100644
--- a/sys/dev/sound/pci/csapcm.c
+++ b/sys/dev/sound/pci/csapcm.c
@@ -762,8 +762,8 @@ pcmcsa_attach(device_t dev)
/* Allocate the resources. */
resp = &csa->res;
- resp->io_rid = PCIR_MAPS;
- resp->mem_rid = PCIR_MAPS + 4;
+ resp->io_rid = PCIR_BAR(0);
+ resp->mem_rid = PCIR_BAR(1);
resp->irq_rid = 0;
if (csa_allocres(csa, dev)) {
csa_releaseres(csa, dev);
diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c
index dad3015..323a07d 100644
--- a/sys/dev/sound/pci/ds1.c
+++ b/sys/dev/sound/pci/ds1.c
@@ -953,7 +953,7 @@ ds_pci_attach(device_t dev)
pci_write_config(dev, PCIR_COMMAND, data, 2);
data = pci_read_config(dev, PCIR_COMMAND, 2);
- sc->regid = PCIR_MAPS;
+ sc->regid = PCIR_BAR(0);
sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regid,
0, ~0, 1, RF_ACTIVE);
if (!sc->reg) {
diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c
index f7b8d48..3752277 100644
--- a/sys/dev/sound/pci/emu10k1.c
+++ b/sys/dev/sound/pci/emu10k1.c
@@ -1478,7 +1478,7 @@ emu_pci_attach(device_t dev)
pci_write_config(dev, PCIR_COMMAND, data, 2);
data = pci_read_config(dev, PCIR_COMMAND, 2);
- i = PCIR_MAPS;
+ i = PCIR_BAR(0);
sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0, 1, RF_ACTIVE);
if (sc->reg == NULL) {
device_printf(dev, "unable to map register space\n");
@@ -1531,7 +1531,7 @@ emu_pci_attach(device_t dev)
bad:
if (codec) ac97_destroy(codec);
- if (sc->reg) bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS, sc->reg);
+ if (sc->reg) bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0), sc->reg);
if (sc->ih) bus_teardown_intr(dev, sc->irq, sc->ih);
if (sc->irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq);
if (sc->parent_dmat) bus_dma_tag_destroy(sc->parent_dmat);
@@ -1554,7 +1554,7 @@ emu_pci_detach(device_t dev)
/* shutdown chip */
emu_uninit(sc);
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_MAPS, sc->reg);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0), sc->reg);
bus_teardown_intr(dev, sc->irq, sc->ih);
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq);
bus_dma_tag_destroy(sc->parent_dmat);
diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c
index 77716d8..544bb61 100644
--- a/sys/dev/sound/pci/es137x.c
+++ b/sys/dev/sound/pci/es137x.c
@@ -864,7 +864,7 @@ es_pci_attach(device_t dev)
}
}
if (mapped == 0 && (data & PCIM_CMD_PORTEN)) {
- es->regid = PCIR_MAPS;
+ es->regid = PCIR_BAR(0);
es->regtype = SYS_RES_IOPORT;
es->reg = bus_alloc_resource(dev, es->regtype, &es->regid,
0, ~0, 1, RF_ACTIVE);
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c
index 40f2bde..50d2121 100644
--- a/sys/dev/sound/pci/fm801.c
+++ b/sys/dev/sound/pci/fm801.c
@@ -587,7 +587,7 @@ fm801_pci_attach(device_t dev)
data = pci_read_config(dev, PCIR_COMMAND, 2);
for (i = 0; (mapped == 0) && (i < PCI_MAXMAPS_0); i++) {
- fm801->regid = PCIR_MAPS + i*4;
+ fm801->regid = PCIR_BAR(i);
fm801->regtype = SYS_RES_MEMORY;
fm801->reg = bus_alloc_resource(dev, fm801->regtype, &fm801->regid,
0, ~0, 1, RF_ACTIVE);
@@ -712,7 +712,7 @@ fm801_pci_probe( device_t dev )
pci_write_config(dev, PCIR_COMMAND, data, 2);
data = pci_read_config(dev, PCIR_COMMAND, 2);
- regid = PCIR_MAPS;
+ regid = PCIR_BAR(0);
regtype = SYS_RES_IOPORT;
reg = bus_alloc_resource(dev, regtype, &regid, 0, ~0, 1,
RF_ACTIVE);
@@ -760,7 +760,7 @@ fm801_alloc_resource(device_t bus, device_t child, int type, int *rid,
fm801 = pcm_getdevinfo(bus);
- if (type == SYS_RES_IOPORT && *rid == PCIR_MAPS)
+ if (type == SYS_RES_IOPORT && *rid == PCIR_BAR(0))
return (fm801->reg);
return (NULL);
diff --git a/sys/dev/sound/pci/maestro.c b/sys/dev/sound/pci/maestro.c
index b7124f7..41d1ad0 100644
--- a/sys/dev/sound/pci/maestro.c
+++ b/sys/dev/sound/pci/maestro.c
@@ -950,7 +950,7 @@ agg_attach(device_t dev)
struct agg_info *ess = NULL;
u_int32_t data;
int mapped = 0;
- int regid = PCIR_MAPS;
+ int regid = PCIR_BAR(0);
struct resource *reg = NULL;
struct ac97_info *codec = NULL;
int irqid = 0;
diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c
index 72ee0c5..78d1398 100644
--- a/sys/dev/sound/pci/maestro3.c
+++ b/sys/dev/sound/pci/maestro3.c
@@ -1109,7 +1109,7 @@ m3_pci_attach(device_t dev)
data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN);
pci_write_config(dev, PCIR_COMMAND, data, 2);
- sc->regid = PCIR_MAPS;
+ sc->regid = PCIR_BAR(0);
sc->regtype = SYS_RES_MEMORY;
sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid,
0, ~0, 1, RF_ACTIVE);
diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c
index 039df03..f4631be 100644
--- a/sys/dev/sound/pci/neomagic.c
+++ b/sys/dev/sound/pci/neomagic.c
@@ -608,7 +608,7 @@ nm_pci_probe(device_t dev)
PCIM_CMD_PORTEN | PCIM_CMD_MEMEN |
PCIM_CMD_BUSMASTEREN, 2);
- sc->regid = PCIR_MAPS + 4;
+ sc->regid = PCIR_BAR(1);
sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY,
&sc->regid, 0, ~0, 1,
RF_ACTIVE);
@@ -675,10 +675,10 @@ nm_pci_attach(device_t dev)
pci_write_config(dev, PCIR_COMMAND, data, 2);
data = pci_read_config(dev, PCIR_COMMAND, 2);
- sc->bufid = PCIR_MAPS;
+ sc->bufid = PCIR_BAR(0);
sc->buf = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->bufid,
0, ~0, 1, RF_ACTIVE);
- sc->regid = PCIR_MAPS + 4;
+ sc->regid = PCIR_BAR(1);
sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regid,
0, ~0, 1, RF_ACTIVE);
diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c
index d166b29..2051680 100644
--- a/sys/dev/sound/pci/solo.c
+++ b/sys/dev/sound/pci/solo.c
@@ -812,27 +812,27 @@ ess_release_resources(struct ess_info *sc, device_t dev)
sc->irq = 0;
}
if (sc->io) {
- bus_release_resource(dev, SYS_RES_IOPORT, 0 * 4 + PCIR_MAPS, sc->io);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0), sc->io);
sc->io = 0;
}
if (sc->sb) {
- bus_release_resource(dev, SYS_RES_IOPORT, 1 * 4 + PCIR_MAPS, sc->sb);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sb);
sc->sb = 0;
}
if (sc->vc) {
- bus_release_resource(dev, SYS_RES_IOPORT, 2 * 4 + PCIR_MAPS, sc->vc);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(2), sc->vc);
sc->vc = 0;
}
if (sc->mpu) {
- bus_release_resource(dev, SYS_RES_IOPORT, 3 * 4 + PCIR_MAPS, sc->mpu);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(3), sc->mpu);
sc->mpu = 0;
}
if (sc->gp) {
- bus_release_resource(dev, SYS_RES_IOPORT, 4 * 4 + PCIR_MAPS, sc->gp);
+ bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(4), sc->gp);
sc->gp = 0;
}
@@ -849,19 +849,19 @@ ess_alloc_resources(struct ess_info *sc, device_t dev)
{
int rid;
- rid = 0 * 4 + PCIR_MAPS;
+ rid = PCIR_BAR(0);
sc->io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
- rid = 1 * 4 + PCIR_MAPS;
+ rid = PCIR_BAR(1);
sc->sb = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
- rid = 2 * 4 + PCIR_MAPS;
+ rid = PCIR_BAR(2);
sc->vc = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
- rid = 3 * 4 + PCIR_MAPS;
+ rid = PCIR_BAR(3);
sc->mpu = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
- rid = 4 * 4 + PCIR_MAPS;
+ rid = PCIR_BAR(4);
sc->gp = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
rid = 0;
diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c
index 6b814b5..a1a911b 100644
--- a/sys/dev/sound/pci/t4dwave.c
+++ b/sys/dev/sound/pci/t4dwave.c
@@ -818,7 +818,7 @@ tr_pci_attach(device_t dev)
pci_write_config(dev, PCIR_COMMAND, data, 2);
data = pci_read_config(dev, PCIR_COMMAND, 2);
- tr->regid = PCIR_MAPS;
+ tr->regid = PCIR_BAR(0);
tr->regtype = SYS_RES_IOPORT;
tr->reg = bus_alloc_resource(dev, tr->regtype, &tr->regid, 0, ~0, 1, RF_ACTIVE);
if (tr->reg) {
diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c
index fad276c..1551cfb 100644
--- a/sys/dev/sound/pci/via8233.c
+++ b/sys/dev/sound/pci/via8233.c
@@ -765,7 +765,7 @@ via_attach(device_t dev)
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
pci_enable_busmaster(dev);
- via->regid = PCIR_MAPS;
+ via->regid = PCIR_BAR(0);
via->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &via->regid, 0, ~0,
1, RF_ACTIVE);
if (!via->reg) {
diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c
index 10e21a2..7247f07 100644
--- a/sys/dev/sound/pci/via82c686.c
+++ b/sys/dev/sound/pci/via82c686.c
@@ -506,7 +506,7 @@ via_attach(device_t dev)
DELAY(5000);
}
- via->regid = PCIR_MAPS;
+ via->regid = PCIR_BAR(0);
via->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &via->regid, 0, ~0, 1, RF_ACTIVE);
if (!via->reg) {
device_printf(dev, "cannot allocate bus resource.");
OpenPOWER on IntegriCloud