good while ago and it had problems under load. Changes were made to address
that, but I don't have the ability to test them. So, I'm committing it
before it rots.
turned off. It seems that IDEDMA_CTL_INTR is asserted before DMA transfer
is complete, leading to race condition in case of interrupt sharing.
Discovered reading the FreeBSD code.
'voice' is not initialized
This fixes kern/15394 by Onno van der Linden.
Code fragment to trigger the bug:
AUDIO_INITINFO(&info);
info.mode = AUMODE_PLAY;
info.play.channels = 2;
fd = open("/dev/audioctl0", O_RDWR);
(void)ioctl(fd, AUDIO_SETINFO, &info);
emuxki_voice_set_audioparms(): g/c check for voice == NULL, this is
never called with null voice
some minor style changes in emuxki_open()/emuxki_close()
to the mixer. Ie:
$ mixerctl -w outputs.master=0,191
Would result in the _right_ speaker being turned off.
So, we will swap the left and right mixer channels to compensate
for this.
fancy, works for the basic output case, but does not support programs
which use playback while going into suspend.
Sketched after code found in FreeBSD and Linux drivers.
using one word as both attribute and device doesn't work well,
radio.c is pulled in even with no such device in the configuration,
and the kernel doesn't link due to missing "radio_cd".
So call the attribute "radiodev" to avoid confusion.
containing the userland visible thinks (i.e. ioctl definitions).
Remove all (both) old ioctls, as they had a brain dead API and made keeping
binary compatibility more or less impossible.
Replace by several new ioctls. While there, remove any arbitrary limits
(resulting from the old, broken ioctls) and allow any length of names
and passwords.
Love <lha@stacken.kth.se>.
I suspect this is true for the 648 too; if someone with a 648 and one device
on each channel could test that all works with one_channel = 1, it would
be great !
the response queue. Instead of the ad hoc ISP_SWIZZLE_REQUEST, we now have
a complete set of inline functions in isp_inline.h. Each platform is
responsible for providing just one of a set of ISP_IOX_{GET,PUT}{8,16,32}
macros.
The reason this needs to be done is that we need to have a single set of
functions that will work correctly on multiple architectures for both little
and big endian machines. It also needs to work correctly in the case that
we have the request or response queues in memory that has to be treated
specially (e.g., have ddi_dma_sync called on it for Solaris after we update
it or before we read from it).
One thing that falls out of this is that we no longer build requests in the
request queue itself. Instead, we build the request locally (e.g., on the
stack) and then as part of the swizzling operation, copy it to the request
queue entry we've allocated. I thought long and hard about whether this was
too expensive a change to make as it in a lot of cases requires an extra
copy. On balance, the flexbility is worth it. With any luck, the entry that
we build locally stays in a processor writeback cache (after all, it's only
64 bytes) so that the cost of actually flushing it to the memory area that is
the shared queue with the PCI device is not all that expensive. We may examine
this again and try to get clever in the future to try and avoid copies.
Another change that falls out of this is that MEMORYBARRIER should be taken
a lot more seriously. The macro ISP_ADD_REQUEST does a MEMORYBARRIER on the
entry being added. But there had been many other places this had been missing.
It's now very important that it be done.
For NetBSD, it does a ddi_dmamap_sync as appropriate. This gets us out of
the explicit ddi_dmamap_sync on the whole response queue that we did for SBus
cards at each interrupt.
Set things up so that platforms that cannot have an SBus don't get a lot of
the SBus code checks (dead coded out).
Additional changes:
Fix a longstanding buglet of sorts. When we get an entry via isp_getrqentry,
the iptr value that gets returned is the value we intend to eventually plug
into the ISP registers as the entry *one past* the last one we've written-
*not* the current entry we're updating. All along we've been calling sync
functions on the wrong index value. Argh. The 'fix' here is to rename all
'iptr' variables as 'nxti' to remember that this is the 'next' pointer-
not the current pointer.
Devote a single bit to mboxbsy- and set aside bits for output mbox registers
that we need to pick up- we can have at least one command which does not
have any defined output registers (MBOX_EXECUTE_FIRMWARE).
Explicitly decode GetAllNext SNS Response back *as* a GetAllNext response.
Otherwise, we won't unswizzle it correctly.
Nuke some additional __P macros.
not support a value (e.g., it's to be used as "options FOO" instead of
"options FOO=xxx"). options that take a value were converted to
defparam recently.
- minor whitespace & formatting cleanups
- correct trm_clock_period[] value
- pass BUS_DMA_{READ,WRITE,STREAMING} to bus_dmamap_load() as appropriate
- make sure to call bus_dmamap_unload() even after request sense
- saved srb params on request sense do not seem to be used,
so remove them from struct trm_srb
- handle target status more properly in trm_srb_done() and no need
to handle error retry in lower driver layer
- fix some comments
XXX Maybe need more cleanup around TQING for MI SCSI callback..
o Implement SPDIF selection/monitoring function.
Now, say, playback to both analog output and SPDIF is possible.
o Implement support of AUX input, MIC preamp and MIC recording gain.
o L-R selection of record source doesn't seem to work on cmpci.
Therefore, the *.swap mixer functions are and deleted.
o Following SB mixer registers don't exist on cmpci, and they are removed.
input gain, output gain, AGC, equalization (bass, treble)
o Other mixer changes, including
inputs.XXX.mute -> (deleted)
outputs.XXX.mute -> inputs.XXX.mute
inputs.pc_speaker -> inputs.speaker
spdif.* -> reorganized to spdif.input.*, spdif.output.*
o Current status:
I have tested these and confirmed to work fine.
- Output and recording from Line-in, AUX, CD and MIC analog inputs,
- Output and recording from FM synthesizer,
- Output from PC speaker input,
- Output wave playback.
- SPDIF (44.1kHz) input selection (#1, #2 (6ch version only),
wave to spdin), phase selection, monitoring and recording,
- SPDIF (44.1kHz) playback, through (SPDIF in to SPDIF out)
and monitoring.
I haven't tested these but may work.
- SPDIF 48kHz input and output,
- Full-duplex operation,
- Recording wave output.
I don't think these are working.
- Legacy (wave + FM synthesizer) to SPDIF output (and the monitoring),
- Exchanging front and rear outputs,
- Surround.
These are not implemented.
- 4ch / 6ch support,
- Joystick port support.
which have the Tekram TRM-S1040 ASIC.
This driver is written by Rui-Xiang Guo <rxg@ms25.url.com.tw>,
and a number of cosmetic changes by me.
Tested on i386 by the author, and on macppc and sparc64 by me.
XXX On arc, kernel got panic in ltsleep() called from scsipi_execute_xs(),
XXX but I'm not sure what is wrong...
broken hueristic to determine memory vs. i/o (one should never make
an assumption that the bus_space_tag_t is a pointer, as this code
did).
- Fix the "can't map registers" error message.
- Garbage-collect some code that is not relevant to the GEM (which
was already #if 0'd out).
- Cluster all the SPARC-specific code into one place (will be
replaced with Properties once that is fleshed out).
If __PCI_DEV_FUNCORDER is defined, don't do the song-and-dance to check if
a device is multi-function; machdep code is going to tell us exactly which
functions to probe.
Note this required changing how pci_func_devorder() works in the
sparc64 PCI machdep code; now the "curnode" is assumed to point
to the bus, rather than some function (typically 0) on the device,
just as pci_bus_devorder() makes that assumption.
All this should allow the PCI code to actually locate the second
HME device on a Sun Netra t1, which is at 3,1 -- previously, the
PCI code would have missed it because there is no device at 3,0.
(Sun deserves a brick to the head for this one -- this seems clearly
out of line with the PCI spec.)
to see if there's an interrupt (avoids PCI parity errors
which can occur on the 2312 if you access some registers
from the host at the same time the RISC on the 2312 is
accessing them).
Avoids using bus_dmamem_alloc/bus_dmamem_map at interrupt time.
Should fix PRs kern/13924 and kern/13979 from dive@endersgame.net
- while I'm there convert to use ether_ioctl.
- remove special treatment of pager_map mappings in pmaps. this is
required now, since I've removed the globals that expose the address range.
pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
no longer any need to special-case it.
- eliminate struct uvm_vnode by moving its fields into struct vnode.
- rewrite the pageout path. the pager is now responsible for handling the
high-level requests instead of only getting control after a bunch of work
has already been done on its behalf. this will allow us to UBCify LFS,
which needs tighter control over its pages than other filesystems do.
writing a page to disk no longer requires making it read-only, which
allows us to write wired pages without causing all kinds of havoc.
- use a new PG_PAGEOUT flag to indicate that a page should be freed
on behalf of the pagedaemon when it's unlocked. this flag is very similar
to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
pageout fails due to eg. an indirect-block buffer being locked.
this allows us to remove the "version" field from struct vm_page,
and together with shrinking "loan_count" from 32 bits to 16,
struct vm_page is now 4 bytes smaller.
- no longer use PG_RELEASED for swap-backed pages. if the page is busy
because it's being paged out, we can't release the swap slot to be
reallocated until that write is complete, but unlike with vnodes we
don't keep a count of in-progress writes so there's no good way to
know when the write is done. instead, when we need to free a busy
swap-backed page, just sleep until we can get it busy ourselves.
- implement a fast-path for extending writes which allows us to avoid
zeroing new pages. this substantially reduces cpu usage.
- encapsulate the data used by the genfs code in a struct genfs_node,
which must be the first element of the filesystem-specific vnode data
for filesystems which use genfs_{get,put}pages().
- eliminate many of the UVM pagerops, since they aren't needed anymore
now that the pager "put" operation is a higher-level operation.
- enhance the genfs code to allow NFS to use the genfs_{get,put}pages
instead of a modified copy.
- clean up struct vnode by removing all the fields that used to be used by
the vfs_cluster.c code (which we don't use anymore with UBC).
- remove kmem_object and mb_object since they were useless.
instead of allocating pages to these objects, we now just allocate
pages with no object. such pages are mapped in the kernel until they
are freed, so we can use the mapping to find the page to free it.
this allows us to remove splvm() protection in several places.
The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
device (rather, the device that carries that attribute) also
carry one or more attributes indicating which type of controller
it might be.
This will allow systems that might have AGP, but would never have
e.g. an Intel PCI-Host bridge, to trim out code that won't be used.
attach time. Allow access to these regions in vga_pci_mmap().
Note: we also have to allow access to the legacy ISA "hole" in
vga_pci_mmap(), since the X server needs to be able to read
the legacy BIOS on many cards.
XXX Need to address the PCI Expansion ROM.
Based on changes from Simon Burge <simonb@wasabisystems.com>.