View | Details | Raw Unified | Return to bug 194517 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/dev/sound/isa/gusc.c (-6 lines)
Lines 421-440 gusc_release_resource(device_t bus, device_t child, int type, int rid, Link Here
421
421
422
static int
422
static int
423
gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
423
gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
424
#if __FreeBSD_version >= 700031
425
		driver_filter_t *filter,
424
		driver_filter_t *filter,
426
#endif
427
		driver_intr_t *intr, void *arg, void **cookiep)
425
		driver_intr_t *intr, void *arg, void **cookiep)
428
{
426
{
429
	sc_p scp = (sc_p)device_get_softc(dev);
427
	sc_p scp = (sc_p)device_get_softc(dev);
430
	devclass_t devclass;
428
	devclass_t devclass;
431
429
432
#if __FreeBSD_version >= 700031
433
	if (filter != NULL) {
430
	if (filter != NULL) {
434
		printf("gusc.c: we cannot use a filter here\n");
431
		printf("gusc.c: we cannot use a filter here\n");
435
		return (EINVAL);
432
		return (EINVAL);
436
	}
433
	}
437
#endif
438
	devclass = device_get_devclass(child);
434
	devclass = device_get_devclass(child);
439
	if (strcmp(devclass_get_name(devclass), "midi") == 0) {
435
	if (strcmp(devclass_get_name(devclass), "midi") == 0) {
440
		scp->midi_intr.intr = intr;
436
		scp->midi_intr.intr = intr;
Lines 446-454 gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, Link Here
446
		return 0;
442
		return 0;
447
	}
443
	}
448
	return bus_generic_setup_intr(dev, child, irq, flags,
444
	return bus_generic_setup_intr(dev, child, irq, flags,
449
#if __FreeBSD_version >= 700031
450
				filter,
445
				filter,
451
#endif
452
				intr, arg, cookiep);
446
				intr, arg, cookiep);
453
}
447
}
454
448
(-)b/sys/dev/sound/isa/sb16.c (-2 lines)
Lines 176-185 sb_dspwr(struct sb_info *sb, u_char val) Link Here
176
			return 1;
176
			return 1;
177
		}
177
		}
178
    	}
178
    	}
179
#if __FreeBSD_version > 500000
180
	if (curthread->td_intr_nesting_level == 0)
179
	if (curthread->td_intr_nesting_level == 0)
181
		printf("sb_dspwr(0x%02x) timed out.\n", val);
180
		printf("sb_dspwr(0x%02x) timed out.\n", val);
182
#endif
183
    	return 0;
181
    	return 0;
184
}
182
}
185
183
(-)b/sys/dev/sound/isa/sbc.c (-6 lines)
Lines 85-93 static int sbc_release_resource(device_t bus, device_t child, int type, int rid, Link Here
85
				struct resource *r);
85
				struct resource *r);
86
static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
86
static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
87
   	       int flags,
87
   	       int flags,
88
#if __FreeBSD_version >= 700031
89
	       driver_filter_t *filter,
88
	       driver_filter_t *filter,
90
#endif
91
	       driver_intr_t *intr, 
89
	       driver_intr_t *intr, 
92
   	       void *arg, void **cookiep);
90
   	       void *arg, void **cookiep);
93
static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq,
91
static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq,
Lines 512-520 sbc_intr(void *p) Link Here
512
510
513
static int
511
static int
514
sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
512
sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
515
#if __FreeBSD_version >= 700031
516
   	       driver_filter_t *filter,
513
   	       driver_filter_t *filter,
517
#endif
518
	       driver_intr_t *intr, 
514
	       driver_intr_t *intr, 
519
   	       void *arg, void **cookiep)
515
   	       void *arg, void **cookiep)
520
{
516
{
Lines 522-533 sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, Link Here
522
	struct sbc_ihl *ihl = NULL;
518
	struct sbc_ihl *ihl = NULL;
523
	int i, ret;
519
	int i, ret;
524
520
525
#if __FreeBSD_version >= 700031
526
	if (filter != NULL) {
521
	if (filter != NULL) {
527
		printf("sbc.c: we cannot use a filter here\n");
522
		printf("sbc.c: we cannot use a filter here\n");
528
		return (EINVAL);
523
		return (EINVAL);
529
	}
524
	}
530
#endif
531
	sbc_lock(scp);
525
	sbc_lock(scp);
532
	i = 0;
526
	i = 0;
533
	while (i < IRQ_MAX) {
527
	while (i < IRQ_MAX) {
(-)b/sys/dev/sound/midi/sequencer.c (-9 lines)
Lines 466-477 done: Link Here
466
	cv_broadcast(&scp->th_cv);
466
	cv_broadcast(&scp->th_cv);
467
	mtx_unlock(&scp->seq_lock);
467
	mtx_unlock(&scp->seq_lock);
468
	SEQ_DEBUG(2, printf("seq_eventthread finished\n"));
468
	SEQ_DEBUG(2, printf("seq_eventthread finished\n"));
469
#if __FreeBSD_version >= 800002
470
	kproc_exit(0);
469
	kproc_exit(0);
471
#else
472
	mtx_lock(&Giant);
473
	kthread_exit(0);
474
#endif
475
}
470
}
476
471
477
/*
472
/*
Lines 587-597 seq_addunit(void) Link Here
587
	 */
582
	 */
588
583
589
	ret =
584
	ret =
590
#if __FreeBSD_version >= 800002
591
	    kproc_create
585
	    kproc_create
592
#else
593
	    kthread_create
594
#endif
595
	    (seq_eventthread, scp, NULL, RFHIGHPID, 0,
586
	    (seq_eventthread, scp, NULL, RFHIGHPID, 0,
596
	    "sequencer %02d", scp->unit);
587
	    "sequencer %02d", scp->unit);
597
588
(-)b/sys/dev/sound/pci/als4000.c (-10 lines)
Lines 818-839 als_pci_attach(device_t dev) Link Here
818
         * ALS4000 is entirely controlled by the pci powerstate.  We
818
         * ALS4000 is entirely controlled by the pci powerstate.  We
819
         * could attempt finer grained control by setting GCR6.31.
819
         * could attempt finer grained control by setting GCR6.31.
820
	 */
820
	 */
821
#if __FreeBSD_version > 500000
822
	if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
821
	if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
823
		/* Reset the power state. */
822
		/* Reset the power state. */
824
		device_printf(dev, "chip is in D%d power mode "
823
		device_printf(dev, "chip is in D%d power mode "
825
			      "-- setting to D0\n", pci_get_powerstate(dev));
824
			      "-- setting to D0\n", pci_get_powerstate(dev));
826
		pci_set_powerstate(dev, PCI_POWERSTATE_D0);
825
		pci_set_powerstate(dev, PCI_POWERSTATE_D0);
827
	}
826
	}
828
#else
829
	data = pci_read_config(dev, ALS_PCI_POWERREG, 2);
830
	if ((data & 0x03) != 0) {
831
		device_printf(dev, "chip is in D%d power mode "
832
			      "-- setting to D0\n", data & 0x03);
833
		data &= ~0x03;
834
		pci_write_config(dev, ALS_PCI_POWERREG, data, 2);
835
	}
836
#endif
837
827
838
	if (als_resource_grab(dev, sc)) {
828
	if (als_resource_grab(dev, sc)) {
839
		device_printf(dev, "failed to allocate resources\n");
829
		device_printf(dev, "failed to allocate resources\n");
(-)b/sys/dev/sound/pci/cs4281.c (-12 lines)
Lines 768-774 cs4281_pci_attach(device_t dev) Link Here
768
768
769
    pci_enable_busmaster(dev);
769
    pci_enable_busmaster(dev);
770
770
771
#if __FreeBSD_version > 500000
772
    if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
771
    if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
773
	/* Reset the power state. */
772
	/* Reset the power state. */
774
	device_printf(dev, "chip is in D%d power mode "
773
	device_printf(dev, "chip is in D%d power mode "
Lines 776-792 cs4281_pci_attach(device_t dev) Link Here
776
775
777
	pci_set_powerstate(dev, PCI_POWERSTATE_D0);
776
	pci_set_powerstate(dev, PCI_POWERSTATE_D0);
778
    }
777
    }
779
#else
780
    data = pci_read_config(dev, CS4281PCI_PMCS_OFFSET, 4);
781
    if (data & CS4281PCI_PMCS_PS_MASK) {
782
	    /* Reset the power state. */
783
	    device_printf(dev, "chip is in D%d power mode "
784
			  "-- setting to D0\n",
785
			  data & CS4281PCI_PMCS_PS_MASK);
786
	    pci_write_config(dev, CS4281PCI_PMCS_OFFSET,
787
			     data & ~CS4281PCI_PMCS_PS_MASK, 4);
788
    }
789
#endif
790
778
791
    sc->regid   = PCIR_BAR(0);
779
    sc->regid   = PCIR_BAR(0);
792
    sc->regtype = SYS_RES_MEMORY;
780
    sc->regtype = SYS_RES_MEMORY;
(-)b/sys/dev/sound/pci/csa.c (-6 lines)
Lines 86-94 static int csa_release_resource(device_t bus, device_t child, int type, int rid, Link Here
86
				   struct resource *r);
86
				   struct resource *r);
87
static int csa_setup_intr(device_t bus, device_t child,
87
static int csa_setup_intr(device_t bus, device_t child,
88
			  struct resource *irq, int flags,
88
			  struct resource *irq, int flags,
89
#if __FreeBSD_version >= 700031
90
			  driver_filter_t *filter,
89
			  driver_filter_t *filter,
91
#endif
92
			  driver_intr_t *intr,  void *arg, void **cookiep);
90
			  driver_intr_t *intr,  void *arg, void **cookiep);
93
static int csa_teardown_intr(device_t bus, device_t child,
91
static int csa_teardown_intr(device_t bus, device_t child,
94
			     struct resource *irq, void *cookie);
92
			     struct resource *irq, void *cookie);
Lines 450-470 csa_release_resource(device_t bus, device_t child, int type, int rid, Link Here
450
static int
448
static int
451
csa_setup_intr(device_t bus, device_t child,
449
csa_setup_intr(device_t bus, device_t child,
452
	       struct resource *irq, int flags,
450
	       struct resource *irq, int flags,
453
#if __FreeBSD_version >= 700031
454
	       driver_filter_t *filter,
451
	       driver_filter_t *filter,
455
#endif
456
	       driver_intr_t *intr, void *arg, void **cookiep)
452
	       driver_intr_t *intr, void *arg, void **cookiep)
457
{
453
{
458
	sc_p scp;
454
	sc_p scp;
459
	csa_res *resp;
455
	csa_res *resp;
460
	struct sndcard_func *func;
456
	struct sndcard_func *func;
461
457
462
#if __FreeBSD_version >= 700031
463
	if (filter != NULL) {
458
	if (filter != NULL) {
464
		printf("ata-csa.c: we cannot use a filter here\n");
459
		printf("ata-csa.c: we cannot use a filter here\n");
465
		return (EINVAL);
460
		return (EINVAL);
466
	}
461
	}
467
#endif
468
	scp = device_get_softc(bus);
462
	scp = device_get_softc(bus);
469
	resp = &scp->res;
463
	resp = &scp->res;
470
464
(-)b/sys/dev/sound/pci/emu10kx.c (-2 lines)
Lines 3203-3211 emu_pci_attach(device_t dev) Link Here
3203
	i = 0;
3203
	i = 0;
3204
	sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE);
3204
	sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE);
3205
	if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV,
3205
	if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV,
3206
#if __FreeBSD_version >= 700031
3207
	    NULL,
3206
	    NULL,
3208
#endif
3209
	    emu_intr, sc, &sc->ih)) {
3207
	    emu_intr, sc, &sc->ih)) {
3210
		device_printf(dev, "unable to map interrupt\n");
3208
		device_printf(dev, "unable to map interrupt\n");
3211
		goto bad;
3209
		goto bad;
(-)b/sys/dev/sound/pci/envy24.c (-4 lines)
Lines 2690-2700 static device_method_t envy24_methods[] = { Link Here
2690
static driver_t envy24_driver = {
2690
static driver_t envy24_driver = {
2691
	"pcm",
2691
	"pcm",
2692
	envy24_methods,
2692
	envy24_methods,
2693
#if __FreeBSD_version > 500000
2694
	PCM_SOFTC_SIZE,
2693
	PCM_SOFTC_SIZE,
2695
#else
2696
	sizeof(struct snddev_info),
2697
#endif
2698
};
2694
};
2699
2695
2700
DRIVER_MODULE(snd_envy24, pci, envy24_driver, pcm_devclass, 0, 0);
2696
DRIVER_MODULE(snd_envy24, pci, envy24_driver, pcm_devclass, 0, 0);
(-)b/sys/dev/sound/pci/envy24ht.c (-4 lines)
Lines 2588-2598 static device_method_t envy24ht_methods[] = { Link Here
2588
static driver_t envy24ht_driver = {
2588
static driver_t envy24ht_driver = {
2589
	"pcm",
2589
	"pcm",
2590
	envy24ht_methods,
2590
	envy24ht_methods,
2591
#if __FreeBSD_version > 500000
2592
	PCM_SOFTC_SIZE,
2591
	PCM_SOFTC_SIZE,
2593
#else
2594
	sizeof(struct snddev_info),
2595
#endif
2596
};
2592
};
2597
2593
2598
DRIVER_MODULE(snd_envy24ht, pci, envy24ht_driver, pcm_devclass, 0, 0);
2594
DRIVER_MODULE(snd_envy24ht, pci, envy24ht_driver, pcm_devclass, 0, 0);
(-)b/sys/dev/sound/pci/maestro.c (-10 lines)
Lines 87-98 SND_DECLARE_FILE("$FreeBSD$"); Link Here
87
#define AGG_DEFAULT_BUFSZ	0x4000 /* 0x1000, but gets underflows */
87
#define AGG_DEFAULT_BUFSZ	0x4000 /* 0x1000, but gets underflows */
88
88
89
89
90
/* compatibility */
91
#if __FreeBSD_version < 500000
92
# define critical_enter()	disable_intr()
93
# define critical_exit()	enable_intr()
94
#endif
95
96
#ifndef PCIR_BAR
90
#ifndef PCIR_BAR
97
#define PCIR_BAR(x)	(PCIR_MAPS + (x) * 4)
91
#define PCIR_BAR(x)	(PCIR_MAPS + (x) * 4)
98
#endif
92
#endif
Lines 1815-1823 agg_attach(device_t dev) Link Here
1815
			       /*filter*/ NULL, NULL,
1809
			       /*filter*/ NULL, NULL,
1816
			       /*size  */ ess->bufsz, 1, 0x3ffff,
1810
			       /*size  */ ess->bufsz, 1, 0x3ffff,
1817
			       /*flags */ 0,
1811
			       /*flags */ 0,
1818
#if __FreeBSD_version >= 501102
1819
			       /*lock  */ busdma_lock_mutex, &Giant,
1812
			       /*lock  */ busdma_lock_mutex, &Giant,
1820
#endif
1821
			       &ess->buf_dmat) != 0) {
1813
			       &ess->buf_dmat) != 0) {
1822
		device_printf(dev, "unable to create dma tag\n");
1814
		device_printf(dev, "unable to create dma tag\n");
1823
		ret = ENOMEM;
1815
		ret = ENOMEM;
Lines 1831-1839 agg_attach(device_t dev) Link Here
1831
			       /*filter*/ NULL, NULL,
1823
			       /*filter*/ NULL, NULL,
1832
			       /*size  */ 3*ess->bufsz, 1, 0x3ffff,
1824
			       /*size  */ 3*ess->bufsz, 1, 0x3ffff,
1833
			       /*flags */ 0,
1825
			       /*flags */ 0,
1834
#if __FreeBSD_version >= 501102
1835
			       /*lock  */ busdma_lock_mutex, &Giant,
1826
			       /*lock  */ busdma_lock_mutex, &Giant,
1836
#endif
1837
			       &ess->stat_dmat) != 0) {
1827
			       &ess->stat_dmat) != 0) {
1838
		device_printf(dev, "unable to create dma tag\n");
1828
		device_printf(dev, "unable to create dma tag\n");
1839
		ret = ENOMEM;
1829
		ret = ENOMEM;
(-)b/sys/dev/sound/pci/vibes.c (-2 lines)
Lines 730-742 sv_attach(device_t dev) { Link Here
730
730
731
	pci_enable_busmaster(dev);
731
	pci_enable_busmaster(dev);
732
732
733
#if __FreeBSD_version > 500000
734
        if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
733
        if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
735
                device_printf(dev, "chip is in D%d power mode "
734
                device_printf(dev, "chip is in D%d power mode "
736
                              "-- setting to D0\n", pci_get_powerstate(dev));
735
                              "-- setting to D0\n", pci_get_powerstate(dev));
737
                pci_set_powerstate(dev, PCI_POWERSTATE_D0);
736
                pci_set_powerstate(dev, PCI_POWERSTATE_D0);
738
        }
737
        }
739
#endif
740
	sc->enh_rid  = SV_PCI_ENHANCED;
738
	sc->enh_rid  = SV_PCI_ENHANCED;
741
	sc->enh_type = SYS_RES_IOPORT;
739
	sc->enh_type = SYS_RES_IOPORT;
742
	sc->enh_reg  = bus_alloc_resource(dev, sc->enh_type,
740
	sc->enh_reg  = bus_alloc_resource(dev, sc->enh_type,
(-)b/sys/dev/sound/pcm/dsp.c (-2 lines)
Lines 2324-2332 dsp_stdclone(char *name, char *namep, char *sep, int use_sep, int *u, int *c) Link Here
2324
2324
2325
static void
2325
static void
2326
dsp_clone(void *arg,
2326
dsp_clone(void *arg,
2327
#if __FreeBSD_version >= 600034
2328
    struct ucred *cred,
2327
    struct ucred *cred,
2329
#endif
2330
    char *name, int namelen, struct cdev **dev)
2328
    char *name, int namelen, struct cdev **dev)
2331
{
2329
{
2332
	struct snddev_info *d;
2330
	struct snddev_info *d;
(-)b/sys/dev/sound/pcm/mixer.c (-2 lines)
Lines 1328-1336 done: Link Here
1328
1328
1329
static void
1329
static void
1330
mixer_clone(void *arg,
1330
mixer_clone(void *arg,
1331
#if __FreeBSD_version >= 600034
1332
    struct ucred *cred,
1331
    struct ucred *cred,
1333
#endif
1334
    char *name, int namelen, struct cdev **dev)
1332
    char *name, int namelen, struct cdev **dev)
1335
{
1333
{
1336
	struct snddev_info *d;
1334
	struct snddev_info *d;
(-)b/sys/dev/sound/pcm/sound.c (-5 / +1 lines)
Lines 124-134 snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand Link Here
124
	if (d != NULL && (flags & INTR_MPSAFE))
124
	if (d != NULL && (flags & INTR_MPSAFE))
125
		d->flags |= SD_F_MPSAFE;
125
		d->flags |= SD_F_MPSAFE;
126
126
127
	return bus_setup_intr(dev, res, flags,
127
	return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep);
128
#if __FreeBSD_version >= 700031
129
			NULL,
130
#endif
131
			hand, param, cookiep);
132
}
128
}
133
129
134
static void
130
static void
(-)b/sys/dev/sound/pcm/sound.h (-8 lines)
Lines 53-61 Link Here
53
#include <sys/errno.h>
53
#include <sys/errno.h>
54
#include <sys/malloc.h>
54
#include <sys/malloc.h>
55
#include <sys/bus.h>
55
#include <sys/bus.h>
56
#if __FreeBSD_version < 500000
57
#include <sys/buf.h>
58
#endif
59
#include <machine/resource.h>
56
#include <machine/resource.h>
60
#include <machine/bus.h>
57
#include <machine/bus.h>
61
#include <sys/rman.h>
58
#include <sys/rman.h>
Lines 120-130 struct snd_mixer; Link Here
120
#define PCMCHAN(x)		(snd_unit2c(dev2unit(x)))
117
#define PCMCHAN(x)		(snd_unit2c(dev2unit(x)))
121
118
122
/* XXX unit2minor compat */
119
/* XXX unit2minor compat */
123
#if __FreeBSD_version >= 800062
124
#define PCMMINOR(x)	(x)
120
#define PCMMINOR(x)	(x)
125
#else
126
#define PCMMINOR(x)	unit2minor(x)
127
#endif
128
121
129
/*
122
/*
130
 * By design, limit possible channels for each direction.
123
 * By design, limit possible channels for each direction.
131
- 

Return to bug 194517