-/* $NetBSD: ad1848.c,v 1.6 1995/07/07 02:11:51 brezak Exp $ */
+/* $NetBSD: ad1848.c,v 1.7 1995/11/10 04:30:36 mycroft Exp $ */
/*
* Copyright (c) 1994 John Brezak
ad1848_probe(sc)
struct ad1848_softc *sc;
{
- register u_short iobase = sc->sc_iobase;
+ register int iobase = sc->sc_iobase;
u_char tmp, tmp1 = 0xff, tmp2 = 0xff;
int i;
ad1848_attach(sc)
struct ad1848_softc *sc;
{
- register u_short iobase = sc->sc_iobase;
+ register int iobase = sc->sc_iobase;
int i;
struct ad1848_volume vol_mid = {150, 150};
struct ad1848_volume vol_0 = {0, 0};
void *arg;
{
register struct ad1848_softc *sc = addr;
- register u_short iobase;
+ register int iobase;
register u_char reg;
if (sc->sc_locked) {
void *arg;
{
register struct ad1848_softc *sc = addr;
- register u_short iobase;
+ register int iobase;
register u_char reg;
if (sc->sc_locked) {
-/* $NetBSD: ad1848var.h,v 1.6 1995/07/07 02:11:56 brezak Exp $ */
+/* $NetBSD: ad1848var.h,v 1.7 1995/11/10 04:30:40 mycroft Exp $ */
/*
* Copyright (c) 1994 John Brezak
u_int sc_dma_cnt;
#endif
- u_short sc_iobase; /* I/O port base address */
- u_short sc_irq; /* interrupt */
- u_short sc_drq; /* DMA */
- u_short sc_recdrq; /* record/capture DMA */
+ int sc_iobase; /* I/O port base address */
+ int sc_irq; /* interrupt */
+ int sc_drq; /* DMA */
+ int sc_recdrq; /* record/capture DMA */
u_long sc_irate; /* Sample rate for input */
u_long sc_orate; /* ...and output */
-/* $NetBSD: gus.c,v 1.2 1995/07/24 05:54:52 cgd Exp $ */
+/* $NetBSD: gus.c,v 1.3 1995/11/10 04:30:44 mycroft Exp $ */
/*
* Copyright (c) 1994, 1995 Ken Hornstein. All rights reserved.
struct isadev sc_id; /* ISA device */
void *sc_ih; /* interrupt vector */
- u_short sc_iobase; /* I/O base address */
- u_short sc_irq; /* IRQ used */
- u_short sc_drq; /* DMA channel for play */
- u_short sc_recdrq; /* DMA channel for recording */
+ int sc_iobase; /* I/O base address */
+ int sc_irq; /* IRQ used */
+ int sc_drq; /* DMA channel for play */
+ int sc_recdrq; /* DMA channel for recording */
int sc_flags; /* Various flags about the GUS */
#define GUS_MIXER_INSTALLED 0x01 /* An ICS mixer is installed */
* registers. A zero means that the referenced IRQ/DRQ is invalid
*/
-static int gus_irq_map[] = { 0, 0, 1, 3, 0, 2, 0, 4, 0, 1, 0, 5, 6, 0, 0, 7 };
-static int gus_drq_map[] = { 0, 1, 0, 2, 0, 3, 4, 5 };
+static int gus_irq_map[] = {
+ IRQUNK, IRQUNK, 1, 3, IRQUNK, 2, IRQUNK, 4, IRQUNK, 1, IRQUNK, 5, 6,
+ IRQUNK, IRQUNK, 7
+};
+static int gus_drq_map[] = {
+ DRQUNK, 1, DRQUNK, 2, DRQUNK, 3, 4, 5
+};
/*
* A list of valid base addresses for the GUS
*/
-static u_short gus_base_addrs[] = { 0x210, 0x220, 0x230, 0x240, 0x250, 0x260 };
-static int gus_addrs = sizeof(gus_base_addrs) / sizeof(u_short);
+static int gus_base_addrs[] = {
+ 0x210, 0x220, 0x230, 0x240, 0x250, 0x260
+};
+static int gus_addrs = sizeof(gus_base_addrs) / sizeof(gus_base_addrs[0]);
/*
* Maximum frequency values of the GUS based on the number of currently active
register struct isa_attach_args *ia = aux;
struct cfdata *cf = sc->sc_dev.dv_cfdata;
register int iobase = ia->ia_iobase;
- u_short recdrq = cf->cf_flags;
+ int recdrq = cf->cf_flags;
int i;
unsigned char s1, s2;
* valid for this card.
*/
- if (! gus_irq_map[ia->ia_irq]) {
+ if (gus_irq_map[ia->ia_irq] == IRQUNK) {
printf("gus: invalid irq %d, card not probed\n", ia->ia_irq);
return(0);
}
- if (! gus_drq_map[ia->ia_drq]) {
+ if (gus_drq_map[ia->ia_drq] == DRQUNK) {
printf("gus: invalid drq %d, card not probed\n", ia->ia_drq);
return(0);
}
if (recdrq != 0x00) {
- if (recdrq > 7 || ! gus_drq_map[recdrq]) {
+ if (recdrq > 7 || gus_drq_map[recdrq] == DRQUNK) {
printf("gus: invalid flag given for second DMA channel (0x%x), card not probed\n", recdrq);
return(0);
}
{
register struct gus_softc *sc = (void *) self;
register struct isa_attach_args *ia = aux;
- register u_short port = ia->ia_iobase;
+ register int port = ia->ia_iobase;
int s,i;
register unsigned char c,d,m;
{
register struct gus_softc *sc = arg;
unsigned char intr;
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
int retval = 0;
DPRINTF(("gusintr\n"));
void *arg;
{
register struct gus_softc *sc = arg;
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
int s;
printf("%s: dmaout timeout\n", sc->sc_dev.dv_xname);
gus_dmaout_intr(sc)
struct gus_softc *sc;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
/*
* If we got a DMA transfer complete from the GUS DRAM, then deal
gus_dmaout_dointr(sc)
struct gus_softc *sc;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
/* sc->sc_dmaoutcnt - 1 because DMA controller counts from zero?. */
isa_dmadone(B_WRITE,
gus_voice_intr(sc)
struct gus_softc *sc;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
int ignore = 0, voice, rval = 0;
unsigned long addr;
unsigned char intr, status;
struct gus_softc *sc;
int bufno;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
/*
* Start the voices playing, with buffer BUFNO.
*/
register struct gus_softc *sc;
int voice;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
/*
* stop this voice from interrupting while we work.
caddr_t buffaddr;
{
register unsigned char c = (unsigned char) flags;
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
int s;
DMAPRINTF(("gusdmaout flags=%x scflags=%x\n", flags, sc->sc_flags));
int voice;
int intrs;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
unsigned long start;
unsigned long current;
unsigned long end;
int voice;
int intrs_too;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
sc->sc_voc[voice].voccntl |= GUSMASK_VOICE_STOPPED |
GUSMASK_STOP_VOICE;
struct gus_softc *sc;
int voice, volume;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
unsigned int gusvol;
gusvol = gus_log_volumes[volume < 512 ? volume : 511];
struct gus_softc *sc;
int voices;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
/*
* Select the active number of voices
*/
struct gus_softc *sc;
int voice, freq;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
unsigned int fc;
unsigned long temp, f = (unsigned long) freq;
struct gus_softc *sc;
u_long rate;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
u_char realrate;
int s;
DPRINTF(("gus_set_recrate %lu\n", rate));
int voice;
unsigned long addr;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
sc->sc_voc[voice].end_addr = addr;
int voice;
unsigned long addr;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
sc->sc_voc[voice].current_addr = addr;
struct gus_softc *sc;
int voice;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
unsigned long addr;
outb(port+GUS_VOICE_SELECT, (unsigned char) voice);
struct gus_softc *sc;
int voices;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
int i,s;
s = splgus();
gus_init_cs4231(sc)
struct gus_softc *sc;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
u_char ctrl;
ctrl = (port & 0xf0) >> 4; /* set port address middle nibble */
void *arg;
{
register struct gus_softc *sc = addr;
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
register u_char dmac;
DMAPRINTF(("gus_dma_input called\n"));
void * addr;
{
register struct gus_softc *sc = addr;
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
DMAPRINTF(("gus_halt_out_dma called\n"));
/*
void * addr;
{
register struct gus_softc *sc = addr;
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
DMAPRINTF(("gus_halt_in_dma called\n"));
/*
gus_init_ics2101(sc)
struct gus_softc *sc;
{
- register u_short port = sc->sc_iobase;
+ register int port = sc->sc_iobase;
register struct ics2101_softc *ic = &sc->sc_mixer;
sc->sc_mixer.sc_selio = port+GUS_MIXER_SELECT;
sc->sc_mixer.sc_dataio = port+GUS_MIXER_DATA;
-/* $NetBSD: pas.c,v 1.9 1995/07/19 19:58:51 brezak Exp $ */
+/* $NetBSD: pas.c,v 1.10 1995/11/10 05:05:18 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
struct isadev sc_id; /* ISA device */
void *sc_ih; /* interrupt vectoring */
- u_short sc_iobase; /* PAS iobase */
- u_short sc_irq; /* PAS irq */
- u_short sc_drq; /* PAS drq */
+ int sc_iobase; /* PAS iobase */
+ int sc_irq; /* PAS irq */
+ int sc_drq; /* PAS drq */
int model;
int rev;
{
register struct pas_softc *sc = (void *)self;
register struct isa_attach_args *ia = aux;
- register u_short iobase;
+ register int iobase;
u_char id, t;
/*
}
if (sc->model >= 0) {
- int irq = ia->ia_irq;
- if (irq == IRQUNK) {
+ if (ia->ia_irq == IRQUNK) {
printf("pas: sb emulation requires known irq\n");
return (0);
}
- irq = ia->ia_irq;
- pasconf(sc->model, ia->ia_iobase, irq, 1);
+ pasconf(sc->model, ia->ia_iobase, ia->ia_irq, 1);
} else {
DPRINTF(("pas: could not probe pas\n"));
return (0);
} else
#endif
if (!SB_IRQ_VALID(ia->ia_irq)) {
- int irq = ia->ia_irq;
- printf("pas: configured irq %d invalid\n", irq);
+ printf("pas: configured irq chan %d invalid\n", ia->ia_irq);
return 0;
}
{
static char dmabuf;
struct isa_attach_args *ia = aux;
- u_short iobase = ia->ia_iobase;
+ int iobase = ia->ia_iobase;
/*
* Set up a DMA read of one byte.
{
register struct pas_softc *sc = (struct pas_softc *)self;
struct isa_attach_args *ia = (struct isa_attach_args *)aux;
- register u_short iobase = ia->ia_iobase;
+ register int iobase = ia->ia_iobase;
int err;
sc->sc_iobase = iobase;
-/* $NetBSD: pss.c,v 1.9 1995/08/12 22:37:58 mycroft Exp $ */
+/* $NetBSD: pss.c,v 1.10 1995/11/10 04:30:49 mycroft Exp $ */
/*
* Copyright (c) 1994 John Brezak
struct isadev sc_id; /* ISA device */
void *sc_ih; /* interrupt vectoring */
- u_short sc_iobase; /* I/O port base address */
- u_short sc_drq; /* dma channel */
+ int sc_iobase; /* I/O port base address */
+ int sc_drq; /* dma channel */
struct ad1848_softc *ad1848_sc;
struct isadev sc_id; /* ISA device */
void *sc_ih; /* interrupt vectoring */
- u_short sc_iobase; /* MIDI I/O port base address */
- u_short sc_irq; /* MIDI interrupt */
+ int sc_iobase; /* MIDI I/O port base address */
+ int sc_irq; /* MIDI interrupt */
};
struct cd_softc {
struct isadev sc_id; /* ISA device */
void *sc_ih; /* interrupt vectoring */
- u_short sc_iobase; /* CD I/O port base address */
- u_short sc_irq; /* CD interrupt */
+ int sc_iobase; /* CD I/O port base address */
+ int sc_irq; /* CD interrupt */
};
#ifdef AUDIO_DEBUG
pss_dspwrite(struct pss_softc *sc, int data)
{
int i;
- u_short pss_base = sc->sc_iobase;
+ int pss_base = sc->sc_iobase;
/*
* Note! the i<5000000 is an emergency exit. The dsp_command() is sometimes
static int
pss_testirq(struct pss_softc *sc, int intNum)
{
- u_short iobase = sc->sc_iobase;
+ int iobase = sc->sc_iobase;
int val;
int ret;
int i;
int
pss_testdma(struct pss_softc *sc, int dmaNum)
{
- u_short iobase = sc->sc_iobase;
+ int iobase = sc->sc_iobase;
int val;
int i,ret;
pss_reset_dsp(struct pss_softc *sc)
{
u_long i;
- u_short pss_base = sc->sc_iobase;
+ int pss_base = sc->sc_iobase;
outw(pss_base+PSS_CONTROL, PSS_RESET);
pss_download_dsp(struct pss_softc *sc, u_char *block, int size)
{
int i, val, count;
- u_short pss_base = sc->sc_iobase;
+ int pss_base = sc->sc_iobase;
DPRINTF(("pss: downloading boot code..."));
{
struct pss_softc *sc = (void *)self;
struct isa_attach_args *ia = aux;
- u_short iobase = ia->ia_iobase;
+ int iobase = ia->ia_iobase;
int i;
if (!PSS_BASE_VALID(iobase)) {
}
/* Need to probe for iobase when IOBASEUNK {0x220 0x240} */
- if (iobase == (u_short)IOBASEUNK) {
+ if (iobase == IOBASEUNK) {
iobase = 0x220;
if ((inw(iobase+PSS_ID_VERS) & 0xff00) == 0x4500)
{
struct pss_softc *sc = (struct pss_softc *)self;
struct isa_attach_args *ia = (struct isa_attach_args *)aux;
- u_short iobase = ia->ia_iobase;
+ int iobase = ia->ia_iobase;
u_char vers;
struct ad1848_volume vol = {150, 150};
int err;
{
struct ad1848_softc *sc = (struct ad1848_softc *)self;
struct cfdata *cf = (void *)sc->sc_dev.dv_cfdata;
- u_short iobase = cf->cf_iobase;
+ int iobase = cf->cf_iobase;
sc->sc_iobase = iobase;
sc->sc_drq = cf->cf_drq;
{
struct mpu_softc *sc = (struct mpu_softc *)self;
struct cfdata *cf = (void *)sc->sc_dev.dv_cfdata;
- u_short iobase = cf->cf_iobase;
+ int iobase = cf->cf_iobase;
sc->sc_iobase = iobase;
{
struct cd_softc *sc = (struct cd_softc *)self;
struct cfdata *cf = (void *)sc->sc_dev.dv_cfdata;
- u_short iobase = cf->cf_iobase;
+ int iobase = cf->cf_iobase;
/*
* The pss driver simply enables the cd interface. The CD
-/* $NetBSD: sb.c,v 1.27 1995/07/19 19:58:53 brezak Exp $ */
+/* $NetBSD: sb.c,v 1.28 1995/11/10 05:01:05 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
{
register struct sbdsp_softc *sc = (void *)self;
register struct isa_attach_args *ia = aux;
- register u_short iobase = ia->ia_iobase;
+ register int iobase = ia->ia_iobase;
+ static u_char drq_conf[4] = {
+ 0x01, 0x02, -1, 0x08
+ };
static u_char irq_conf[11] = {
- -1, -1, 0x01, -1, -1, 0x02, -1, 0x04, -1, 0x01, 0x08
+ -1, -1, 0x01, -1, -1, 0x02, -1, 0x04, -1, 0x01, 0x08
};
if (!SB_BASE_VALID(ia->ia_iobase)) {
printf("sb: configured dma chan %d invalid\n", ia->ia_drq);
return 0;
}
- if (ISSB16CLASS(sc)) {
- sbdsp_mix_write(sc, SBP_SET_DRQ,
- 1 << ia->ia_drq);
- }
+ if (ISSB16CLASS(sc))
+ sbdsp_mix_write(sc, SBP_SET_DRQ, drq_conf[ia->ia_drq]);
}
else {
if (!SB_DRQ_VALID(ia->ia_drq)) {
printf("sb: configured irq %d invalid\n", ia->ia_irq);
return 0;
}
- if (ISSB16CLASS(sc)) {
- sbdsp_mix_write(sc, SBP_SET_IRQ,
- irq_conf[ia->ia_irq]);
- }
+ if (ISSB16CLASS(sc))
+ sbdsp_mix_write(sc, SBP_SET_IRQ, irq_conf[ia->ia_irq]);
}
else {
if (!SB_IRQ_VALID(ia->ia_irq)) {
{
static char dmabuf;
struct isa_attach_args *ia = aux;
- u_short iobase = ia->ia_iobase;
+ int iobase = ia->ia_iobase;
/*
* Set up a DMA read of one byte.
{
register struct sbdsp_softc *sc = (struct sbdsp_softc *)self;
struct isa_attach_args *ia = (struct isa_attach_args *)aux;
- register u_short iobase = ia->ia_iobase;
+ register int iobase = ia->ia_iobase;
int err;
sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_AUDIO,
-/* $NetBSD: sbdsp.c,v 1.13 1995/07/19 19:58:54 brezak Exp $ */
+/* $NetBSD: sbdsp.c,v 1.14 1995/11/10 05:01:06 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
sbdsp_probe(sc)
struct sbdsp_softc *sc;
{
- register u_short iobase = sc->sc_iobase;
+ register int iobase = sc->sc_iobase;
if (sbdsp_reset(sc) < 0) {
DPRINTF(("sbdsp: couldn't reset card\n"));
sbdsp_attach(sc)
struct sbdsp_softc *sc;
{
- register u_short iobase = sc->sc_iobase;
+ register int iobase = sc->sc_iobase;
sc->sc_locked = 0;
sbdsp_reset(sc)
register struct sbdsp_softc *sc;
{
- register u_short iobase = sc->sc_iobase;
+ register int iobase = sc->sc_iobase;
/*
* erase any memory of last transfer size.
* polling loop and wait until it can take the byte.
*/
int
-sbdsp_wdsp(u_short iobase, int v)
+sbdsp_wdsp(int iobase, int v)
{
register int i;
* Read a byte from the DSP, using polling.
*/
int
-sbdsp_rdsp(u_short iobase)
+sbdsp_rdsp(int iobase)
{
register int i;
sbversion(sc)
struct sbdsp_softc *sc;
{
- register u_short iobase = sc->sc_iobase;
+ register int iobase = sc->sc_iobase;
short v;
if (sbdsp_wdsp(iobase, SB_DSP_VERSION) < 0)
register int tc;
int mode;
int sr = *srp;
- register u_short iobase;
+ register int iobase;
/*
* A SBPro in stereo mode uses time constants at double the
void *arg;
{
register struct sbdsp_softc *sc = addr;
- register u_short iobase;
- u_int phys;
+ register int iobase;
#ifdef AUDIO_DEBUG
if (sbdspdebug > 1)
void *arg;
{
register struct sbdsp_softc *sc = addr;
- register u_short iobase;
+ register int iobase;
#ifdef AUDIO_DEBUG
if (sbdspdebug > 1)
-/* $NetBSD: sbdspvar.h,v 1.6 1995/05/08 22:02:24 brezak Exp $ */
+/* $NetBSD: sbdspvar.h,v 1.7 1995/11/10 05:01:08 mycroft Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
struct isadev sc_id; /* ISA device */
void *sc_ih; /* interrupt vectoring */
- u_short sc_iobase; /* I/O port base address */
- u_short sc_irq; /* interrupt */
- u_short sc_drq; /* DMA */
+ int sc_iobase; /* I/O port base address */
+ int sc_irq; /* interrupt */
+ int sc_drq; /* DMA */
u_short sc_open; /* reference count of open calls */
u_short sc_locked; /* true when doing HS DMA */
void sbdsp_spkron __P((struct sbdsp_softc *));
void sbdsp_spkroff __P((struct sbdsp_softc *));
-int sbdsp_wdsp(u_short iobase, int v);
-int sbdsp_rdsp(u_short iobase);
+int sbdsp_wdsp(int iobase, int v);
+int sbdsp_rdsp(int iobase);
int sbdsp_intr __P((void *));
short sbversion __P((struct sbdsp_softc *));
-/* $NetBSD: wss.c,v 1.6 1995/07/07 02:15:12 brezak Exp $ */
+/* $NetBSD: wss.c,v 1.7 1995/11/10 04:30:52 mycroft Exp $ */
/*
* Copyright (c) 1994 John Brezak
{
register struct wss_softc *sc = (void *)self;
register struct isa_attach_args *ia = aux;
- register u_short iobase = ia->ia_iobase;
+ register int iobase = ia->ia_iobase;
static u_char interrupt_bits[12] = {
-1, -1, -1, -1, -1, -1, -1, 0x08, -1, 0x10, 0x18, 0x20
};
{
register struct wss_softc *sc = (struct wss_softc *)self;
struct isa_attach_args *ia = (struct isa_attach_args *)aux;
- register u_short iobase = ia->ia_iobase;
+ register int iobase = ia->ia_iobase;
int err;
sc->sc_ad1848.sc_recdrq = ia->ia_drq;