Home | History | Annotate | Download | only in tc
History log of /src/sys/dev/tc/bba.c
RevisionDateAuthorComments
 1.46  12-Sep-2020  isaki Improve am7930 family drivers to share more code.
audioamd(4) on sparc, vsaudio(4) on vax, and bba(4) are.
- Remove complex and useless callbacks: onopen, onclose, and
indirect_{read,write}. This makes audioamd and vsaudio almost the same.
- Remove (already disabled) assembly fast interrupt path from audioamd(4).
cf. http://mail-index.netbsd.org/source-changes/2009/12/19/msg004585.html
- Use trigger_* method rather than start_* method. It's more suitable.
vsaudio(4) was tested by naru@, bba(4) was tested by tsutsui@.
 1.45  29-Aug-2020  isaki Fix white space and indent.
 1.44  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.43  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
 1.42  16-Mar-2019  isaki branches: 1.42.2;
Use C99 style struct initializer to audio_hw_if.
 1.41  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.40  01-Jun-2017  chs branches: 1.40.8; 1.40.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.
 1.39  23-Nov-2011  jmcneill branches: 1.39.8; 1.39.26;
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.
 1.38  04-Jun-2011  tsutsui branches: 1.38.2; 1.38.4;
Split device_t/softc of am7930. No crash on TME and GXemul.
 1.37  22-Aug-2009  tsutsui branches: 1.37.4; 1.37.6; 1.37.10;
u_intNN_t -> uintNN_t
 1.36  12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.35  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.34  28-Apr-2008  martin branches: 1.34.14;
Remove clause 3 and 4 from TNF licenses
 1.33  05-Apr-2008  cegger branches: 1.33.2; 1.33.4;
use aprint_*_dev and device_xname
 1.32  19-Oct-2007  ad branches: 1.32.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.31  04-Mar-2007  christos branches: 1.31.2; 1.31.14; 1.31.16; 1.31.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30  31-Mar-2006  he branches: 1.30.14; 1.30.16;
Correct typo.
 1.29  30-Mar-2006  thorpej Use device_private() more.
 1.28  30-Mar-2006  thorpej Liberally apply static.
 1.27  30-Mar-2006  thorpej Use device_private().
 1.26  02-Dec-2005  kleink branches: 1.26.4; 1.26.6; 1.26.8; 1.26.10; 1.26.12;
Fix AUDIO_DEBUG printf formatting of size_t; from Pavel Cahyna in
PR kern/32207.
 1.25  01-Jun-2005  drochner branches: 1.25.2;
fix cast-qual fallout
 1.24  15-Jan-2005  kent branches: 1.24.8;
ansify and KNF
 1.23  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
 1.22  29-Oct-2004  yamt branches: 1.22.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.21  09-Jul-2004  mycroft Clean up open/close.
 1.20  03-May-2003  wiz branches: 1.20.2;
DMA, not dma nor Dma.
 1.19  04-Feb-2003  matt deal with malloc_type fallout.
 1.18  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.17  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15  13-Nov-2001  lukem add/cleanup RCSIDs
 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).
 1.13  19-Jul-2001  thorpej branches: 1.13.2;
Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.
 1.12  18-Jul-2000  thorpej branches: 1.12.2; 1.12.4; 1.12.6;
PAGE_SIZE -> IOASIC_DMA_BLOCKSIZE in one last place. From Izumi Tsutsui.
 1.11  18-Jul-2000  thorpej Back out previous. It is no longer needed, as both the Alpha
and DECstation IOASIC drivers clear the appropriate interrupts
in the dispatch routine.
 1.10  17-Jul-2000  thorpej Clear the DMA pointer reload interrupt bits in the IOASIC_INTR
register to prevent interrups from looping on the Alpha.

From Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>.
 1.9  17-Jul-2000  thorpej - Write the registers 7930 registers properly on the Alpha (it's
different than on the DECstation).
- Use IOASIC_DMA_BLOCKSIZE instead of PAGE_SIZE.

Should make this work on the Alpha. From discussion with
Izumi Tsutsui, Gregory McGarry, and Chris Demetriou, and
much reading of EK-D3SYS-PM.
 1.8  28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.7  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.
 1.6  12-Jun-2000  gmcgarry branches: 1.6.2;
- add mmap support
- correct bug which wouldn't free allocated DMA segments
 1.5  05-Jun-2000  gmcgarry - remove conditional compilation on NAUDIO
- use preprocessor for constants
 1.4  04-Jun-2000  gmcgarry Cleanup #if 0 cruft.
 1.3  01-Jun-2000  gmcgarry Remove wbflush(). These are not necessary with the new IOASIC bus_space
framework. From Tohru Nishimura.
 1.2  28-May-2000  gmcgarry Merge pmax and alpha ISDN register definitions.
 1.1  02-May-2000  augustss branches: 1.1.2;
Add am7930 audio driver.
 1.1.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.2.3  18-Jul-2000  thorpej Pull up rev. 1.12:
PAGE_SIZE -> IOASIC_DMA_BLOCKSIZE in one last place. From Izumi Tsutsui.
 1.6.2.2  18-Jul-2000  thorpej Pull up revs. 1.9-1.11:
Changes to make 7930 ISDN/Audio work on TurboChannel Alphas.
 1.6.2.1  30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.12.6.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.6.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.6.1  03-Aug-2001  lukem update to -current
 1.12.4.4  18-Oct-2002  nathanw Catch up to -current.
 1.12.4.3  14-Nov-2001  nathanw Catch up to -current.
 1.12.4.2  08-Oct-2001  nathanw Catch up to -current.
 1.12.4.1  24-Aug-2001  nathanw Catch up with -current.
 1.12.2.2  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.2.1  18-Jul-2000  bouyer file bba.c was added on branch thorpej_scsipi on 2000-11-20 11:43:13 +0000
 1.13.2.1  11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.20.2.7  11-Dec-2005  christos Sync with head.
 1.20.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.2.5  17-Jan-2005  skrll Sync with HEAD.
 1.20.2.4  02-Nov-2004  skrll Sync with HEAD.
 1.20.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1  03-Aug-2004  skrll Sync with HEAD
 1.22.2.3  09-Jan-2005  kent audio_hw_if change
* make open() and close() optional
* add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
 1.22.2.2  05-Jan-2005  kent introduce FILTER_LOOP_PROLOGUE() and FILTER_LOOP_EPILOGUE() macros, and
simplify filter implementations by the macros.
 1.22.2.1  03-Jan-2005  kent adopt the filter pipeline framework
 1.24.8.1  06-Dec-2005  riz Pull up following revision(s) (requested by kleink in ticket #1019):
sys/dev/tc/bba.c: revision 1.26
Fix AUDIO_DEBUG printf formatting of size_t; from Pavel Cahyna in
PR kern/32207.
 1.25.2.3  27-Oct-2007  yamt sync with head.
 1.25.2.2  03-Sep-2007  yamt sync with head.
 1.25.2.1  21-Jun-2006  yamt sync with head.
 1.26.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.26.10.1  19-Apr-2006  elad sync with head.
 1.26.8.1  01-Apr-2006  yamt sync with head.
 1.26.6.1  22-Apr-2006  simonb Sync with head.
 1.26.4.1  09-Sep-2006  rpaulo sync with head
 1.30.16.1  27-Feb-2007  ad Add MP locking for audio drivers.
 1.30.14.1  12-Mar-2007  rmind Sync with HEAD.
 1.31.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.31.16.1  06-Nov-2007  matt sync with HEAD
 1.31.14.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.31.2.1  23-Oct-2007  ad Sync with head.
 1.32.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.33.4.3  16-Sep-2009  yamt sync with head
 1.33.4.2  16-May-2009  yamt sync with head
 1.33.4.1  16-May-2008  yamt sync with head.
 1.33.2.1  18-May-2008  yamt sync with head.
 1.34.14.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.10.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.37.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.37.4.1  12-Jun-2011  rmind sync with head
 1.38.4.2  22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.38.4.1  20-Nov-2011  mrg port the am7930 drivers to audiomp. sparc and pmax GENERIC builds,
but i am unable to test these drivers.
 1.38.2.1  17-Apr-2012  yamt sync with head
 1.39.26.1  28-Aug-2017  skrll Sync with HEAD
 1.39.8.1  03-Dec-2017  jdolecek update from HEAD
 1.40.10.1  10-Jun-2019  christos Sync with HEAD
 1.40.8.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.42.2.2  04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.42.2.1  22-Apr-2019  isaki Adapt am7930 families to audio2.
- Remove {input/output}_conv stuff from am7930_glue.
Filter pipelines for user encoding are not necessary in audio2
so the driver only needs to handle its hardware encoding.
- audioamd/vsaudio use an ordinal linear-mulaw conversion filter
and bba requires special one. dev/audio/mulaw.c supports this
variant just for bba. It might not a good way for bba but it
keeps all other drivers simple.
- Tested on vsaudio(4) by naru@, bba(4) by tsutsui@ (a few months ago).
Thanks!

RSS XML Feed