- 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().
This commit is contained in:
parent
78bb065b84
commit
2cc08b748c
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user