Deleted Added
full compact
neomagic.c (55700) neomagic.c (55713)
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Derived from the public domain Linux driver
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Derived from the public domain Linux driver
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/dev/sound/pci/neomagic.c 55700 2000-01-10 01:59:12Z cg $
28 * $FreeBSD: head/sys/dev/sound/pci/neomagic.c 55713 2000-01-10 06:19:20Z cg $
29 */
30
31#include "pci.h"
32#include "pcm.h"
33
34#include <dev/sound/pcm/sound.h>
35#include <dev/sound/pcm/ac97.h>
36#include <dev/sound/pci/neomagic.h>

--- 386 unchanged lines hidden (view full) ---

423 return &nm_caps;
424}
425
426/* The interrupt handler */
427static void
428nm_intr(void *p)
429{
430 struct sc_info *sc = (struct sc_info *)p;
29 */
30
31#include "pci.h"
32#include "pcm.h"
33
34#include <dev/sound/pcm/sound.h>
35#include <dev/sound/pcm/ac97.h>
36#include <dev/sound/pci/neomagic.h>

--- 386 unchanged lines hidden (view full) ---

423 return &nm_caps;
424}
425
426/* The interrupt handler */
427static void
428nm_intr(void *p)
429{
430 struct sc_info *sc = (struct sc_info *)p;
431 int status, x;
431 int status, x, active;
432
432
433 active = (sc->pch.channel->buffer.dl || sc->rch.channel->buffer.dl);
433 status = nm_rd(sc, NM_INT_REG, sc->irsz);
434 status = nm_rd(sc, NM_INT_REG, sc->irsz);
434 if (status == 0) {
435 if (status == 0 && active) {
435 if (sc->badintr++ > 1000) {
436 device_printf(sc->dev, "1000 bad intrs\n");
437 sc->badintr = 0;
438 }
439 return;
440 }
441 sc->badintr = 0;
442

--- 58 unchanged lines hidden (view full) ---

501
502 sc->buftop = (nm_rd(sc, 0xa0b, 2)? 6144 : 4096) * 1024;
503
504 sc->irsz = 4;
505 sc->playint = NM2_PLAYBACK_INT;
506 sc->recint = NM2_RECORD_INT;
507 sc->misc1int = NM2_MISC_INT_1;
508 sc->misc2int = NM2_MISC_INT_2;
436 if (sc->badintr++ > 1000) {
437 device_printf(sc->dev, "1000 bad intrs\n");
438 sc->badintr = 0;
439 }
440 return;
441 }
442 sc->badintr = 0;
443

--- 58 unchanged lines hidden (view full) ---

502
503 sc->buftop = (nm_rd(sc, 0xa0b, 2)? 6144 : 4096) * 1024;
504
505 sc->irsz = 4;
506 sc->playint = NM2_PLAYBACK_INT;
507 sc->recint = NM2_RECORD_INT;
508 sc->misc1int = NM2_MISC_INT_1;
509 sc->misc2int = NM2_MISC_INT_2;
509 }
510 } else return -1;
510 sc->badintr = 0;
511 ofs = sc->buftop - 0x0400;
512 sc->buftop -= 0x1400;
513
514 if ((nm_rdbuf(sc, ofs, 4) & NM_SIG_MASK) == NM_SIGNATURE) {
515 i = nm_rdbuf(sc, ofs + 4, 4);
516 if (i != 0 && i != 0xffffffff)
517 sc->buftop = i;

--- 124 unchanged lines hidden ---
511 sc->badintr = 0;
512 ofs = sc->buftop - 0x0400;
513 sc->buftop -= 0x1400;
514
515 if ((nm_rdbuf(sc, ofs, 4) & NM_SIG_MASK) == NM_SIGNATURE) {
516 i = nm_rdbuf(sc, ofs + 4, 4);
517 if (i != 0 && i != 0xffffffff)
518 sc->buftop = i;

--- 124 unchanged lines hidden ---