History log of /netbsd-current/sys/dev/pci/sv.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.63 09-Feb-2024 andvar

fix spelling mistakes, mainly in comments and log messages.


# 1.62 08-Jan-2024 chs

mpu / opl: add an interface attribute to config_found() calls for these

specify an interface attribute when attaching mpu and opl devices.
the PCI devices that are the parents of these midi devices
(cmpci, eso, fms, sv, yds) have two interface attributes:
"audiobus", and also one named the same as the parent device,
eg. "cmpci" has an interface attribute named "cmpci".
we must specify the latter one to attach these children.


Revision tags: netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base
# 1.61 07-Aug-2021 thorpej

branches: 1.61.6;
Merge thorpej-cfargs2.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base
# 1.60 24-Apr-2021 thorpej

branches: 1.60.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).


Revision tags: thorpej-cfargs-base thorpej-futex-base
# 1.59 06-Feb-2021 isaki

branches: 1.59.2;
Add a missing mutex_spin_exit().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1
# 1.58 19-Apr-2020 isaki

branches: 1.58.2;
Fix round_blocksize not to return 0.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.57 28-Oct-2019 joerg

branches: 1.57.6;
Fix operand priority of bit op vs ternary operator.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.56 08-Jun-2019 isaki

branches: 1.56.2;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8; 1.52.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.62 08-Jan-2024 chs

mpu / opl: add an interface attribute to config_found() calls for these

specify an interface attribute when attaching mpu and opl devices.
the PCI devices that are the parents of these midi devices
(cmpci, eso, fms, sv, yds) have two interface attributes:
"audiobus", and also one named the same as the parent device,
eg. "cmpci" has an interface attribute named "cmpci".
we must specify the latter one to attach these children.


Revision tags: netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base
# 1.61 07-Aug-2021 thorpej

Merge thorpej-cfargs2.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base
# 1.60 24-Apr-2021 thorpej

branches: 1.60.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).


Revision tags: thorpej-cfargs-base thorpej-futex-base
# 1.59 06-Feb-2021 isaki

branches: 1.59.2;
Add a missing mutex_spin_exit().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1
# 1.58 19-Apr-2020 isaki

branches: 1.58.2;
Fix round_blocksize not to return 0.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.57 28-Oct-2019 joerg

branches: 1.57.6;
Fix operand priority of bit op vs ternary operator.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.56 08-Jun-2019 isaki

branches: 1.56.2;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8; 1.52.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.61 07-Aug-2021 thorpej

Merge thorpej-cfargs2.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base
# 1.60 24-Apr-2021 thorpej

branches: 1.60.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).


Revision tags: thorpej-cfargs-base thorpej-futex-base
# 1.59 06-Feb-2021 isaki

branches: 1.59.2;
Add a missing mutex_spin_exit().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1
# 1.58 19-Apr-2020 isaki

branches: 1.58.2;
Fix round_blocksize not to return 0.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.57 28-Oct-2019 joerg

branches: 1.57.6;
Fix operand priority of bit op vs ternary operator.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.56 08-Jun-2019 isaki

branches: 1.56.2;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8; 1.52.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.60 24-Apr-2021 thorpej

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).


Revision tags: thorpej-cfargs-base thorpej-futex-base
# 1.59 06-Feb-2021 isaki

branches: 1.59.2;
Add a missing mutex_spin_exit().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1
# 1.58 19-Apr-2020 isaki

branches: 1.58.2;
Fix round_blocksize not to return 0.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.57 28-Oct-2019 joerg

branches: 1.57.6;
Fix operand priority of bit op vs ternary operator.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.56 08-Jun-2019 isaki

branches: 1.56.2;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8; 1.52.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.59 06-Feb-2021 isaki

Add a missing mutex_spin_exit().


Revision tags: thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1
# 1.58 19-Apr-2020 isaki

Fix round_blocksize not to return 0.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.57 28-Oct-2019 joerg

branches: 1.57.6;
Fix operand priority of bit op vs ternary operator.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.56 08-Jun-2019 isaki

branches: 1.56.2;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8; 1.52.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.58 19-Apr-2020 isaki

Fix round_blocksize not to return 0.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.57 28-Oct-2019 joerg

Fix operand priority of bit op vs ternary operator.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.56 08-Jun-2019 isaki

branches: 1.56.2;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8; 1.52.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.57 28-Oct-2019 joerg

Fix operand priority of bit op vs ternary operator.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.56 08-Jun-2019 isaki

Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8; 1.52.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.56 08-Jun-2019 isaki

Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.55 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


Revision tags: isaki-audio2-base
# 1.54 16-Mar-2019 isaki

branches: 1.54.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.53 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.52 01-Jun-2017 chs

branches: 1.52.8;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


# 1.52 01-Jun-2017 chs

remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.51 14-Jul-2016 msaitoh

- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.50 29-Mar-2014 christos

branches: 1.50.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


# 1.49 18-Mar-2014 riastradh

Merge riastradh-drm2 to HEAD.


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1
# 1.48 17-Jul-2013 soren

A few "isa" files are so tightly integrated into the x86 platform code
as to not really be part of the optional isa bus autoconf machinery.

Allows configuring a kernel like so:

include "arch/amd64/conf/GENERIC"
no isa


Revision tags: riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.47 27-Oct-2012 chs

branches: 1.47.2; 1.47.8;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base
# 1.46 24-Nov-2011 mrg

branches: 1.46.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.


# 1.45 23-Nov-2011 jmcneill

Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.44 26-Nov-2009 njoly

branches: 1.44.12; 1.44.14;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.43 18-Aug-2009 drochner

comparision with a string literal by "==" can't work (found by gcc-4.4.1),
replace with strcmp()


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.42 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.41 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.40 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.39 28-Apr-2008 martin

branches: 1.39.12; 1.39.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.38 10-Apr-2008 cegger

branches: 1.38.2; 1.38.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.37 19-Oct-2007 ad

branches: 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.36 04-Mar-2007 christos

branches: 1.36.2; 1.36.14; 1.36.16; 1.36.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.35 16-Nov-2006 christos

branches: 1.35.4; 1.35.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.34 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.33 03-Sep-2006 christos

branches: 1.33.2; 1.33.4;
add missing initializer


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base simonb-timecounters-base
# 1.32 08-Mar-2006 lukem

Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.


Revision tags: yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.30 28-Jun-2005 thorpej

branches: 1.30.2;
Use ANSI function decls and static.


# 1.29 30-Apr-2005 hannken

sv_set_params(): avoid null pointer dereference when `setmode' is 0.

Reviewed by: Lennart Augustsson <augustss@netbsd.org>


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.28 27-Feb-2005 perry

branches: 1.28.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.27 15-Jan-2005 kent

branches: 1.27.2; 1.27.4;
ansify and KNF


# 1.26 10-Jan-2005 kent

merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.25 29-Oct-2004 yamt

branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.24 09-Jul-2004 mycroft

Clean up. Attempt to make these safer against stray interrupts.


# 1.23 09-Jul-2004 mycroft

There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 03-May-2003 wiz

branches: 1.22.2;
DMA, not dma nor Dma.


# 1.21 22-Feb-2003 tsutsui

{HZ,hz,hZ} -> Hz


# 1.20 20-Feb-2003 hannken

The SonicVibes DMA is broken and only works on 24-bit addresses. As long
as bus_dmamem_alloc_range() is missing we use the ISA dma tag on i386.

The iorange for the dma registers now gets allocated near the used range.
Chances are high, that this range is valid on this PCI bus.

This one is really ugly :-)

Approved by: Lennart Augustsson <augustss@netbsd.org>


# 1.19 01-Feb-2003 thorpej

Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.18 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.17 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.16 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base
# 1.15 13-Nov-2001 lukem

add RCSID


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.14 03-Oct-2001 augustss

Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.13 19-Jul-2001 kleink

branches: 1.13.2;
Hint BUS_DMA_READ and BUS_DMA_WRITE.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.12 28-Dec-2000 sommerfeld

branches: 1.12.2; 1.12.4;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q


# 1.11 26-Jun-2000 simonb

Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.


Revision tags: netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base
# 1.10 01-Nov-1999 augustss

branches: 1.10.6;
Make little endian and big endian version of all functions
that deal with 16 bit samples. Let the drivers decide which ones
to use.


Revision tags: chs-ubc2-base
# 1.9 10-Jul-1999 kleink

branches: 1.9.2; 1.9.4; 1.9.6;
Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.


# 1.8 14-Apr-1999 jonathan

initialize 'p' for lame gcc-2.7.2.2 flow analysis.


Revision tags: netbsd-1-4-base
# 1.7 22-Mar-1999 mycroft

branches: 1.7.2;
Make 48KHz output work.


# 1.6 19-Feb-1999 mycroft

This is an utterly revolting hack to work around the previously mentioned
lossage. On the Alpha, we force the buffers to be allocated through the SGMAP
so that the PCI bus addresses are low enough.
At least it's only one line of code...


# 1.5 18-Feb-1999 mycroft

Pass the correct address (PCI bus address, not PA) to the card.
Also fix some typos and add more debugging printf()s.
This would work on the Alpha, but the card I have appears to have the upper
address bits chopped off, and the ring buffer gets mapped using the DGMAP,
which uses the upper bits. Boom.


# 1.4 18-Feb-1999 mycroft

spaces -> tabs


# 1.3 18-Feb-1999 mycroft

A few things:
* Use the trigger interface.
* Permit different encodings for record and playback.
* Set AUDIO_PROP_INDEPENDENT.
* Fix the mmap(2) hole again.
* Use 16-bit mode for a-law and u-law playback.


# 1.2 17-Feb-1999 mycroft

Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.


# 1.1 10-Dec-1998 augustss

Add a driver for the S3 SonicVibes chip. From OpenBSD and
Constantine Paul Sapuntzakis (csapuntz@cvs.openbsd.org) with
some changes by me.
XXX The driver still needs work.