summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorariff <ariff@FreeBSD.org>2007-02-23 19:40:13 +0000
committerariff <ariff@FreeBSD.org>2007-02-23 19:40:13 +0000
commit6a57a4f091e836942c8dae1106edeeb3f7fb205a (patch)
treea6e649ad66163a3f481e5bc4648f3c1e6625a401
parentb702560df406d6630bcb89b3c26d8f93fc7c5cad (diff)
downloadFreeBSD-src-6a57a4f091e836942c8dae1106edeeb3f7fb205a.zip
FreeBSD-src-6a57a4f091e836942c8dae1106edeeb3f7fb205a.tar.gz
- Compile time compatibility for pre/post newbus API (intr filter)
changes. This should ease the job of maintaining codebase since much of the regression tests are done across os versions. - bus_setup_intr() -> snd_setup_intr().
-rw-r--r--sys/dev/sound/isa/gusc.c18
-rw-r--r--sys/dev/sound/isa/sbc.c15
-rw-r--r--sys/dev/sound/pci/csa.c14
-rw-r--r--sys/dev/sound/pcm/sound.c6
4 files changed, 40 insertions, 13 deletions
diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c
index 27aa649..706081c 100644
--- a/sys/dev/sound/isa/gusc.c
+++ b/sys/dev/sound/isa/gusc.c
@@ -316,7 +316,7 @@ gusc_attach(device_t dev)
}
if (scp->irq != NULL)
- bus_setup_intr(dev, scp->irq, INTR_TYPE_AV, NULL, gusc_intr, scp, &ih);
+ snd_setup_intr(dev, scp->irq, 0, gusc_intr, scp, &ih);
bus_generic_attach(dev);
return (0);
@@ -418,16 +418,21 @@ gusc_release_resource(device_t bus, device_t child, int type, int rid,
}
static int
-gusc_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep)
+gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
+#if __FreeBSD_version >= 700031
+ driver_filter_t *filter,
+#endif
+ driver_intr_t *intr, void *arg, void **cookiep)
{
sc_p scp = (sc_p)device_get_softc(dev);
devclass_t devclass;
+#if __FreeBSD_version >= 700031
if (filter != NULL) {
printf("gusc.c: we cannot use a filter here\n");
return (EINVAL);
}
+#endif
devclass = device_get_devclass(child);
if (strcmp(devclass_get_name(devclass), "midi") == 0) {
scp->midi_intr.intr = intr;
@@ -438,8 +443,11 @@ gusc_setup_intr(device_t dev, device_t child, struct resource *irq,
scp->pcm_intr.arg = arg;
return 0;
}
- return bus_generic_setup_intr(dev, child, irq, flags, filter, intr,
- arg, cookiep);
+ return bus_generic_setup_intr(dev, child, irq, flags,
+#if __FreeBSD_version >= 700031
+ filter,
+#endif
+ intr, arg, cookiep);
}
static device_t
diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c
index d8787a1..ef4b119 100644
--- a/sys/dev/sound/isa/sbc.c
+++ b/sys/dev/sound/isa/sbc.c
@@ -80,7 +80,11 @@ static struct resource *sbc_alloc_resource(device_t bus, device_t child, int typ
static int sbc_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_filter_t *filter, driver_intr_t *intr,
+ int flags,
+#if __FreeBSD_version >= 700031
+ driver_filter_t *filter,
+#endif
+ driver_intr_t *intr,
void *arg, void **cookiep);
static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq,
void *cookie);
@@ -502,18 +506,23 @@ sbc_intr(void *p)
}
static int
-sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_filter_t *filter, driver_intr_t *intr,
+sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
+#if __FreeBSD_version >= 700031
+ driver_filter_t *filter,
+#endif
+ driver_intr_t *intr,
void *arg, void **cookiep)
{
struct sbc_softc *scp = device_get_softc(dev);
struct sbc_ihl *ihl = NULL;
int i, ret;
+#if __FreeBSD_version >= 700031
if (filter != NULL) {
printf("sbc.c: we cannot use a filter here\n");
return (EINVAL);
}
+#endif
sbc_lock(scp);
i = 0;
while (i < IRQ_MAX) {
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
index ee3e33e..fec5a2e 100644
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -82,8 +82,10 @@ static int csa_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
static int csa_setup_intr(device_t bus, device_t child,
struct resource *irq, int flags,
- driver_filter_t *filter, driver_intr_t *intr,
- void *arg, void **cookiep);
+#if __FreeBSD_version >= 700031
+ driver_filter_t *filter,
+#endif
+ driver_intr_t *intr, void *arg, void **cookiep);
static int csa_teardown_intr(device_t bus, device_t child,
struct resource *irq, void *cookie);
static driver_intr_t csa_intr;
@@ -440,17 +442,21 @@ csa_release_resource(device_t bus, device_t child, int type, int rid,
static int
csa_setup_intr(device_t bus, device_t child,
struct resource *irq, int flags,
- driver_filter_t *filter, driver_intr_t *intr, void *arg,
- void **cookiep)
+#if __FreeBSD_version >= 700031
+ driver_filter_t *filter,
+#endif
+ driver_intr_t *intr, void *arg, void **cookiep)
{
sc_p scp;
csa_res *resp;
struct sndcard_func *func;
+#if __FreeBSD_version >= 700031
if (filter != NULL) {
printf("ata-csa.c: we cannot use a filter here\n");
return (EINVAL);
}
+#endif
scp = device_get_softc(bus);
resp = &scp->res;
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index 4aa2ec6..5e54ee8 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -129,7 +129,11 @@ snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand
#else
flags = INTR_TYPE_AV;
#endif
- return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep);
+ return bus_setup_intr(dev, res, flags,
+#if __FreeBSD_version >= 700031
+ NULL,
+#endif
+ hand, param, cookiep);
}
#ifndef PCM_DEBUG_MTX
OpenPOWER on IntegriCloud