mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Remove check for obsolete FreeBSD versions
PR: 194517 Submitted by: François Tigeot <ftigeot@wolfpond.org>
This commit is contained in:
parent
08c5dbaeb0
commit
775fcb6e63
16 changed files with 1 additions and 89 deletions
|
|
@ -421,20 +421,16 @@ 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,
|
||||
#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;
|
||||
|
|
@ -446,9 +442,7 @@ gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
|
|||
return 0;
|
||||
}
|
||||
return bus_generic_setup_intr(dev, child, irq, flags,
|
||||
#if __FreeBSD_version >= 700031
|
||||
filter,
|
||||
#endif
|
||||
intr, arg, cookiep);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,10 +176,8 @@ sb_dspwr(struct sb_info *sb, u_char val)
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
#if __FreeBSD_version > 500000
|
||||
if (curthread->td_intr_nesting_level == 0)
|
||||
printf("sb_dspwr(0x%02x) timed out.\n", val);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,9 +85,7 @@ 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,
|
||||
#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,
|
||||
|
|
@ -512,9 +510,7 @@ sbc_intr(void *p)
|
|||
|
||||
static int
|
||||
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)
|
||||
{
|
||||
|
|
@ -522,12 +518,10 @@ sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
|
|||
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) {
|
||||
|
|
|
|||
|
|
@ -466,12 +466,7 @@ done:
|
|||
cv_broadcast(&scp->th_cv);
|
||||
mtx_unlock(&scp->seq_lock);
|
||||
SEQ_DEBUG(2, printf("seq_eventthread finished\n"));
|
||||
#if __FreeBSD_version >= 800002
|
||||
kproc_exit(0);
|
||||
#else
|
||||
mtx_lock(&Giant);
|
||||
kthread_exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -587,11 +582,7 @@ seq_addunit(void)
|
|||
*/
|
||||
|
||||
ret =
|
||||
#if __FreeBSD_version >= 800002
|
||||
kproc_create
|
||||
#else
|
||||
kthread_create
|
||||
#endif
|
||||
(seq_eventthread, scp, NULL, RFHIGHPID, 0,
|
||||
"sequencer %02d", scp->unit);
|
||||
|
||||
|
|
|
|||
|
|
@ -818,22 +818,12 @@ als_pci_attach(device_t dev)
|
|||
* ALS4000 is entirely controlled by the pci powerstate. We
|
||||
* could attempt finer grained control by setting GCR6.31.
|
||||
*/
|
||||
#if __FreeBSD_version > 500000
|
||||
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
|
||||
/* Reset the power state. */
|
||||
device_printf(dev, "chip is in D%d power mode "
|
||||
"-- setting to D0\n", pci_get_powerstate(dev));
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
}
|
||||
#else
|
||||
data = pci_read_config(dev, ALS_PCI_POWERREG, 2);
|
||||
if ((data & 0x03) != 0) {
|
||||
device_printf(dev, "chip is in D%d power mode "
|
||||
"-- setting to D0\n", data & 0x03);
|
||||
data &= ~0x03;
|
||||
pci_write_config(dev, ALS_PCI_POWERREG, data, 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (als_resource_grab(dev, sc)) {
|
||||
device_printf(dev, "failed to allocate resources\n");
|
||||
|
|
|
|||
|
|
@ -768,7 +768,6 @@ cs4281_pci_attach(device_t dev)
|
|||
|
||||
pci_enable_busmaster(dev);
|
||||
|
||||
#if __FreeBSD_version > 500000
|
||||
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
|
||||
/* Reset the power state. */
|
||||
device_printf(dev, "chip is in D%d power mode "
|
||||
|
|
@ -776,17 +775,6 @@ cs4281_pci_attach(device_t dev)
|
|||
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
}
|
||||
#else
|
||||
data = pci_read_config(dev, CS4281PCI_PMCS_OFFSET, 4);
|
||||
if (data & CS4281PCI_PMCS_PS_MASK) {
|
||||
/* Reset the power state. */
|
||||
device_printf(dev, "chip is in D%d power mode "
|
||||
"-- setting to D0\n",
|
||||
data & CS4281PCI_PMCS_PS_MASK);
|
||||
pci_write_config(dev, CS4281PCI_PMCS_OFFSET,
|
||||
data & ~CS4281PCI_PMCS_PS_MASK, 4);
|
||||
}
|
||||
#endif
|
||||
|
||||
sc->regid = PCIR_BAR(0);
|
||||
sc->regtype = SYS_RES_MEMORY;
|
||||
|
|
|
|||
|
|
@ -86,9 +86,7 @@ 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,
|
||||
#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);
|
||||
|
|
@ -450,21 +448,17 @@ 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,
|
||||
#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;
|
||||
|
||||
|
|
|
|||
|
|
@ -3203,9 +3203,7 @@ emu_pci_attach(device_t dev)
|
|||
i = 0;
|
||||
sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE);
|
||||
if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV,
|
||||
#if __FreeBSD_version >= 700031
|
||||
NULL,
|
||||
#endif
|
||||
emu_intr, sc, &sc->ih)) {
|
||||
device_printf(dev, "unable to map interrupt\n");
|
||||
goto bad;
|
||||
|
|
|
|||
|
|
@ -2690,11 +2690,7 @@ static device_method_t envy24_methods[] = {
|
|||
static driver_t envy24_driver = {
|
||||
"pcm",
|
||||
envy24_methods,
|
||||
#if __FreeBSD_version > 500000
|
||||
PCM_SOFTC_SIZE,
|
||||
#else
|
||||
sizeof(struct snddev_info),
|
||||
#endif
|
||||
};
|
||||
|
||||
DRIVER_MODULE(snd_envy24, pci, envy24_driver, pcm_devclass, 0, 0);
|
||||
|
|
|
|||
|
|
@ -2588,11 +2588,7 @@ static device_method_t envy24ht_methods[] = {
|
|||
static driver_t envy24ht_driver = {
|
||||
"pcm",
|
||||
envy24ht_methods,
|
||||
#if __FreeBSD_version > 500000
|
||||
PCM_SOFTC_SIZE,
|
||||
#else
|
||||
sizeof(struct snddev_info),
|
||||
#endif
|
||||
};
|
||||
|
||||
DRIVER_MODULE(snd_envy24ht, pci, envy24ht_driver, pcm_devclass, 0, 0);
|
||||
|
|
|
|||
|
|
@ -87,12 +87,6 @@ SND_DECLARE_FILE("$FreeBSD$");
|
|||
#define AGG_DEFAULT_BUFSZ 0x4000 /* 0x1000, but gets underflows */
|
||||
|
||||
|
||||
/* compatibility */
|
||||
#if __FreeBSD_version < 500000
|
||||
# define critical_enter() disable_intr()
|
||||
# define critical_exit() enable_intr()
|
||||
#endif
|
||||
|
||||
#ifndef PCIR_BAR
|
||||
#define PCIR_BAR(x) (PCIR_MAPS + (x) * 4)
|
||||
#endif
|
||||
|
|
@ -1815,9 +1809,7 @@ agg_attach(device_t dev)
|
|||
/*filter*/ NULL, NULL,
|
||||
/*size */ ess->bufsz, 1, 0x3ffff,
|
||||
/*flags */ 0,
|
||||
#if __FreeBSD_version >= 501102
|
||||
/*lock */ busdma_lock_mutex, &Giant,
|
||||
#endif
|
||||
&ess->buf_dmat) != 0) {
|
||||
device_printf(dev, "unable to create dma tag\n");
|
||||
ret = ENOMEM;
|
||||
|
|
@ -1831,9 +1823,7 @@ agg_attach(device_t dev)
|
|||
/*filter*/ NULL, NULL,
|
||||
/*size */ 3*ess->bufsz, 1, 0x3ffff,
|
||||
/*flags */ 0,
|
||||
#if __FreeBSD_version >= 501102
|
||||
/*lock */ busdma_lock_mutex, &Giant,
|
||||
#endif
|
||||
&ess->stat_dmat) != 0) {
|
||||
device_printf(dev, "unable to create dma tag\n");
|
||||
ret = ENOMEM;
|
||||
|
|
|
|||
|
|
@ -730,13 +730,11 @@ sv_attach(device_t dev) {
|
|||
|
||||
pci_enable_busmaster(dev);
|
||||
|
||||
#if __FreeBSD_version > 500000
|
||||
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
|
||||
device_printf(dev, "chip is in D%d power mode "
|
||||
"-- setting to D0\n", pci_get_powerstate(dev));
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
}
|
||||
#endif
|
||||
sc->enh_rid = SV_PCI_ENHANCED;
|
||||
sc->enh_type = SYS_RES_IOPORT;
|
||||
sc->enh_reg = bus_alloc_resource(dev, sc->enh_type,
|
||||
|
|
|
|||
|
|
@ -2324,9 +2324,7 @@ dsp_stdclone(char *name, char *namep, char *sep, int use_sep, int *u, int *c)
|
|||
|
||||
static void
|
||||
dsp_clone(void *arg,
|
||||
#if __FreeBSD_version >= 600034
|
||||
struct ucred *cred,
|
||||
#endif
|
||||
char *name, int namelen, struct cdev **dev)
|
||||
{
|
||||
struct snddev_info *d;
|
||||
|
|
|
|||
|
|
@ -1328,9 +1328,7 @@ done:
|
|||
|
||||
static void
|
||||
mixer_clone(void *arg,
|
||||
#if __FreeBSD_version >= 600034
|
||||
struct ucred *cred,
|
||||
#endif
|
||||
char *name, int namelen, struct cdev **dev)
|
||||
{
|
||||
struct snddev_info *d;
|
||||
|
|
|
|||
|
|
@ -124,11 +124,7 @@ snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand
|
|||
if (d != NULL && (flags & INTR_MPSAFE))
|
||||
d->flags |= SD_F_MPSAFE;
|
||||
|
||||
return bus_setup_intr(dev, res, flags,
|
||||
#if __FreeBSD_version >= 700031
|
||||
NULL,
|
||||
#endif
|
||||
hand, param, cookiep);
|
||||
return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -53,9 +53,6 @@
|
|||
#include <sys/errno.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/bus.h>
|
||||
#if __FreeBSD_version < 500000
|
||||
#include <sys/buf.h>
|
||||
#endif
|
||||
#include <machine/resource.h>
|
||||
#include <machine/bus.h>
|
||||
#include <sys/rman.h>
|
||||
|
|
@ -120,11 +117,7 @@ struct snd_mixer;
|
|||
#define PCMCHAN(x) (snd_unit2c(dev2unit(x)))
|
||||
|
||||
/* XXX unit2minor compat */
|
||||
#if __FreeBSD_version >= 800062
|
||||
#define PCMMINOR(x) (x)
|
||||
#else
|
||||
#define PCMMINOR(x) unit2minor(x)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* By design, limit possible channels for each direction.
|
||||
|
|
|
|||
Loading…
Reference in a new issue