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
can in some situations exceed the high-water mark, and stay there once it
gets there. Adjust the canrelease function so that it will immediately
bring us back down to the high-water mark in this situation.
How can this happen at all? Consider a machine with two filesystems, one
with a much larger blocksize than the other. If the small-block filesystem
is very busy, growing the cache up to the high-water mark, and then the
large-block filesystem becomes busy, buffers will be recycled (since we
are at the high-water mark) but _grow each time they're recycled_. Once
we're above the high-water mark, the canrelease call in allocbuf (without
this change) doesn't shrink us back down below it; so things get worse and
worse.
them to serial mouse buttons, which were then mapped into events to pass
to the X server).
Also fix bug in mouse motion - putting 2 unsigned bytes into an integer
resulted in a 16-bit unsigned value, so negative mouse motion didn't work.
changes the "tickle" model of wdogctl(8), it was modified as well;
while I was in there, I cleaned up the argument parsing.
The code was reviewed by simonb@.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.
- Reorganize console initialization code like i386 rather than cninit().
Note old pccons/opms and ofcons support still works.
XXX Xserver is not tested because XF86_4 doesn't have support
XXX for IGS CyberPro2010 on shark. (yet?)
foo_mountfs() to foo_mount(), to match the new mountroot API.
Also, for ext2fs and lfs, copy some restructuring from ffs to allow changing
file system parameters without specifying the device name.
(ntfs could use some more work.)
and just passes it on to the file system functions. This avoids opening and
closing the device several times.
Mentioned on tech-kern some time ago, IIRC. I've been running this for a
long time.
NAME
tap - virtual Ethernet device
SYNOPSIS
pseudo-device tap
DESCRIPTION
The tap driver allows the creation and use of virtual Ethernet devices.
Those interfaces appear just as any real Ethernet NIC to the kernel, but
can also be accessed by userland through a character device node in order
to read frames being sent by the system or to inject frames.
In that respect it is very similar to what tun(4) provides, but the added
Ethernet layer allows easy integration with machine emulators or virtual
Ethernet networks through the use of bridge(4) with tunneling.
``Qui tacet consentire videtur.''
o add sc_writereg and sc_readreg functions that get passed the hd44780_chip
struct and RS (register-select) signal
o add sc_dev to struct hd44780_chip so upper level read/write routines can get
back to their parent softc
o change TIMEOUT_XXX to HD_TIMEOUT_XXX
o remove sc_rread and sc_rwrite in favor of new sc_writereg and sc_readreg
o add new flag HD_UP to sc_flags that is set once 4bit/8bit mode selection
has been finalized.
o remove sc_irwrite, MD readreg/writereg should check state of HD_UP instead
depressed keys in each message. Any keys in current message that are
also present in previous message are ignored. However, copying a byte
array into an integer array and comparing entry by entry doesn't have
the desired effect. Change the definition of the save buffer to match
the current message buffer data.
where there might be devices under two I/O bridges (like PowerBook G3s).
Attempt to have devices under 'gatwick' share parental interrupt. This
may still need some work, but a step in the right direction.
From Tim Kelly.
the mediabay interrupt as an internal interrupt.
- Simplify gc_reenable_irq() a bit.
- Ensure that interrupts are off when we call gc_reenable_irq().
- Make the handling for stuck interrupts on old-style interrupt controllers
a bit more robust. If we get stuck interrupts, don't panic. Just disable
them.
response from the device that had 120 bytes of data. The lack of any
bounds-checking in pm_direct.c allowed that data to smash the stack in
the interrupt handler.
do not leak siginfo structures.
Note that in the cases of trap signals and timer events, losing this
information could be very bad; right now it will cause us to spin until the
process is SIGKILLed.
"Needs work."
current linker script, change references for any .eh_frame sections so
that they go in to the special "DISCARD" section so that they are not
included in the final object, and use the resultant linker script when
actually linking the bootblocks.
Idea (and most of the sed expression) from Jakub Jelinek.
(mail@janderson.ca): remove ieee80211_ibss_merge's TSFT argument.
Do the TSFT comparison in the drivers (ath, atw). Remove a lot of
extraneous debug statements from ieee80211_ibss_merge.
Set the ieee80211_node's state to IEEE80211_STA_BSS after it's been
copied to the ic_bss, not before.
In struct ieee80211_node, make the ni_tstamp field a union of a
uint64_t and the 8 TSF octets so that it's easier to compare a
neighbor's TSF with the local TSF.
Log IBSS merges (Greg Troxel's suggestion). Also log IBSS creation.
These are rare and important events that deserve to be logged.
received packet so that the checksum is not performed twice. Also,
tcp_respond() does not fill-in the m_pkthdr.csum_data, so a h/w checksum may
have the wrong offset.
OK from Jason Thorpe.
Cosmetic: remove two short ladders from rtw_init. Fit the
NIC registers print-out onto one line using the RTW_PRINT_REGS
macro.
sys/dev/ic/rtwvar.h:
Add RTW_PRINT_REGS wrapper macro for rtw_print_regs. It
is a null op unless defined(RTW_DEBUG).
Use clue from rtk(4) and re(4) to fix the rtw(4) packet
filter. Previously, I was using the wrong CRC32 function
to hash multicast addresses; to compensate, I set the
multicast filter to all 1s. Now that I hash the addresses
correctly, I do not any longer set the filter to all 1s.
In rtw_ioctl, avoid gratuitous re-initialization when the
interface flags change. If a !IFF_UP -> IFF_UP transition,
call rtw_init(); otherwise, only reload the packet filter.
In sys/dev/ic/rtwreg.h:
Put useful combinations of Receiver Control Register flags
in RTW_RCR_PKTFILT_MASK, RTW_RCR_MONITOR, and
RTW_RCR_PKTFILT_DEFAULT. (XXX RTW_RCR_MONITOR should be
called RTW_RCR_PKTFILT_MONITOR.)
prompted by jittery and/or random movement during tap gestures, lack
of edge motion, and a general desire to make use of the extra features
available with the native protocol.
- Ditch the kernel thread; it was overkill for the small amount of
processing required to deal with touchpad events.
- If we fail to probe a Synaptics touchpad, issue a RESET command
to ensure that whatever device is out there is left in a sane
state (thanks to Reinoud Zandijk for the hint).
- Completely re-write gesture support.
- Put the touchpad in 80 packets per second mode and count them so
they can be used to time gesture durations (instead of using
mono_time).
- Enhance up/down button support with options to use them to emulate
the middle button or Z-axis events (like a traditional wheel mouse).
- Add 'edge motion'. If a drag gesture is in progress, and the reported
finger position moves to the touchpad's border region, continue
to report movement events at a fixed rate as if the finger carried
on moving in the same direction. This restores some functionality
usually provided by the touchpad's firmware in PS/2 mode.
- Filter successive movement events to reduce jitter. When scaling
movement events, fold the remainder into the next event to prevent
loss of information during slow/small finger movements. Pointer
movement is now much more refined.
- Add support for touchpads which can report more than one finger on
the pad simultaneously. Optionally use this feature for middle/right
button emulation (i.e. tap two fingers to emulate middle button).
This feature is disabled by default (for now) to avoid surprise
pasting of clipboard text. ;-)
card. It was using the same index as the Ethernet interface, but didn't
cause any problems until the new xcfb.c driver installed an interrupt
handler. Ethernet interrupts went to the xcfb.c interrupt handler and
hung machine.
is used as the RHS of a << operator. On machines where size_t is unsigned
long, and _LP64, we effectively get int32 << uint64 which is handled
differently in ansi c than K&R. In K&R the int32 would get promoted.
if it's specified, don't use free items as storage for internal state.
so that we can use pools for non memory backed objects.
inspired from solaris's KMC_NOTOUCH.
- allocate kva for vm_map_entry from the map itsself and
remove the static limit, MAX_KMAPENT.
- keep merged entries for later splitting to fix allocate-to-free problem.
PR/24039.
seem to occur fairly often under normal operation with HPC1.5.
Also, do not return if the interrupt is unexpected, but see if
there is anything to handle regardless, which appears to always
be the case with HPC1.5.
NetBSD 2.0 gets confused by them (generating events for keycode 134 when
all keys are released), and even when that's fixed we should keep one release
worth of backward compatibility.
rather than being removed. Also fixed a small comment about the scope of
#if's.
This code is a but ugly IMHO but as long as we dont have to change it ....
the code block, so that the purpose is more clear
avoid NULL pointer dereference in lkmunreserve() called on lkm device
close when ksym_addsymtab() fails for the temporary symbol table
(sanity change only, this can never happen at the moment)
* only add the symbol table for the current module if the LKM_E_LOAD
hook returns success; otherwise we overwrite the LKM_E_LOAD error,
which may ultimately lead to (incorrectly) allowing the module load
* only delete the sumbol table for current module if we actually added
the symbol table; avoids deleting symbol table of previously loaded
module when the same module is loaded twice, when the second load
fails with EEXIST
fixes PR kern/28803 by Jens Kessmeier
_cpu_exception_suspend()/_cpu_exception_resume() pair.
Should fix spontaneous reboot problem on heavy load reported by
Christian Groessler on port-dreamcast.
a year before 1970 or a date beyond the time_t rollover, return -1 so callers
can detect it. Callers which expect the function not to fail just get a
different kind of rubbish from before.
explicitly only for the protocols indicated by the #if
Allthough its unlikely a kernel will be build without NET_INET, it will
fail compilation here when NET_INET is not defined.
HPC1 does not mark transmitted descriptors like HPC3. We must
query the HPC1 chip to determine what it expects the next
descriptor to be, reclaim used ones, and restart if necessary. Each
revision's corresponding logic now lives in its own
sq_txring_hpc{1,3} function.
HPC1's transmit interrupt conditions also differ from HPC3, so
remove the INTR bits from descriptors when tagging new packets on
to the end of the chain in order to avoid unwanted interrupts.
Also, be extra careful when restarting the transmit ring. Since
transmit interrupts seem to be relatively slow on HPC1, sq_start
may be called while the DMA engine is quiescent, and before a
transmit interrupt is asserted. We cannot behave like HPC3, which
begins transmission from the first packet pulled from IFQ if the
DMA engine is quiescent as this would skip enqueued packets. It
appears that sq_start is never called before HPC3 asserts an
interrupt, which restarts the transmit queue at the appropriate
place. However, this often happens with HPC1 and we cannot assume
that if DMA is inactive in sq_start, then all previously queued
packets have fled the coop.
XXX Is there a similar race possible with HPC3?
HPC3 logic should remain functionally unchanged, and HPC1 should
finally work properly.
true on the transmit side, which appears to be significantly slower at
interrupting than HPC3.
XXX I used to be able to occasionally wedge the chip with
SQ_NTXDESC == 32, but have not yet been able to reproduce that
behaviour this evening with a larger value.
multiple seeq interfaces may exist. While here, add a few trace
actions, move the related macros into sqvar.h, and enhance the
sq_trace_dump output a bit.
better than txctl. Change from rtw_txctl/rtw_rxctl to
rtw_txsoft/rtw_rxsoft. Change the descriptor blocks' names to
match: rtw_txctl_blk becomes rtw_txsoft_blk. Change the member-name
prefixes for both software and hardware descriptors.
which is a struct rtw_rxdesc_blk.
Put a copy of the DMA tag and the DMA map into the rx- and tx-ring
blocks so that I don't have to pass them to subroutines all of the
time.
limiting the number of rx buffers an rtw may allocate. Use this
sysctl to test the code that copes with buffer exhaustion.
Allocate at most RTW_RXQLEN rx buffers, stopping at the sysctl
limit. Record in sc_nrxdesc how many were allocated, and put the
end-of-ring indication on sc_rxdesc[sc_nrxdesc - 1]. In rtw_init,
if no rx buffers could be allocated, log a complaint, clear
IFF_RUNNING, and exit with an error.
Many changes to accomodate a short rx ring, mainly of the "add a
rx-ring length argument" variety. XXX I really should consolidate
all of the rx ring variables in one struct and pass that to the
rx-ring subroutines.
Bug fix: after calling MCLGET, use the (m->m_flags & M_EXT) idiom
to check for success, instead of m != NULL.
Bug fix: at the top of rtw_start, if IFF_RUNNING is not set, or
IFF_OACTIVE is, get out.
sc_rxnext.
Add sc_nrxdesc, the number of receive descriptors that we are
actually able to use. sc_nrxdesc will ordinarily equal RTW_RXQLEN.
If buffers are exhausted, sc_nrxdesc < RTW_RXQLEN. My next commit
will change dev/ic/rtw.c to deal with buffer exhaustion.
and adjust callers appropriately. cn_nameptr isn't NUL-terminated
for non-leaf components, so it's incorrect to assume it is always
NUL-terminated.
This fixes previous utf8-ization changes to not panic for cases
like 'echo */*/*.ps' in case the intermediate path components
are not in cache (yet).
the first. Otherwise we can overwrite parts of the TX ring that we shouldn't.
Kluge the basic rate setting for now.
Minor simplification to the dequeueing logic.
Set a shorter 802.11 Duration field, accordingly.
XXX We expect CTS/ACK at 1 Mb/s for 1 & 2 Mb/s stations; and CTS/ACK
at 2 Mb/s for 5.5 & 11 Mb/s stations. We need to check with the
802.11 standard. Rate negotiation may need to be overhauld for
standards compliance, too.
"power-off NIC" function, by adding a 'disable' argument to ath_stop.
Pass disable=0 to ath_stop() at the top of ath_init, so that we
don't power-off the Cardbus slot before resetting the HAL. Thanks
to Greg Troxel for his analysis of this bug.
* Add an intermediate variable, ctsrate, which is currently derived directly
from rate, but may be handled differently later (especially for 11g).
* Assume ACKs are sent at the same rate as the original data packet, as ath
does, shortening the ACK reservation time substantially.
* Add a note that we need to deal with not adding the ACK time for some
packets, though this is not implemented yet.
Questions:
* How do we affect the control rate used to send RTS/CTS packets?
* Is the PLCP header length actually controlled by the preamble length
selection, or should this be based on the transmit rate?
Of course short preamble is not actually implemented/working yet.
empty/unused octets to fill out the data time slot. The value is constrained
by math to 0 for <= 5.5Mb, 0-1 for 11Mb, and 0-2 for 22Mb. It is used to
signal to the MAC that there is residue.
references abound without this fix.
In rtw_intr_rx, skip to the next rx packet earlier if the rx packet
length is too short.
Also in rtw_intr_rx, if a packet is rx'd with unknown rate, printf
a warning, drop the packet, recycle the rx buffer, skip to next rx
packet.
debug flags.
From Linux: handle an RTL8180 bug. Sometimes the NIC skips from
the middle of the ring to the 0th rx descriptor. Now the driver
resynchronizes.
Handle a receive descriptor underrun or Rx FIFO overflow condition
in the way that the Linux driver does. This kind of seems like
overkill, but whatever.
Protect rtw_ioctl with splnet().
Do not load a tx descriptor with a buffer shorter than 4 bytes.
Handle a transmit timeout less disruptively.
is always aligned. This makes md_root_loadaddr always 4 byte aligned.
Without this, may get an un-aligned access trap before we even print
anything on the console which was a pain in the neck to debug since so
early in the bootstrap the CPU usually just halts on exceptions.
bus-independent backend, with PCI and CardBus attachment code.
The committed code has two serious bugs:
1. The driver makes no attempt to recover resources when a (Cardbus)
instance is removed; bus resources are leaked.
2. In testing with a NetGear GA-511, the Cardbus card never responded
to a reset/wakeup if the card is powered down after attachment.
So for now, leave cardbus instances powered up at attachment
(insertion, or at boot if a card is already present).
That aside, it acutally works on my GA-511. Committed as-is despite
the bugs, after repeated requests to make the code available for
further testing. Also requires sys/dev/mii/miidevs rev 1.54 -> 1.55,
and consequent regen of miidevs{,_data}.h.
in two flavours: one with non-IEEE OUI code from FreeSD if_re(4) mii
driver for early 8169S, and a second IEEE-compliant version as
observed on Netgear GA-511 with newer 8196S stepping.
in an 802.11 unicast data packet is equal to the duration of the
SIFS and Acknowledgement. That is, the amount of time reserved
*after* the packet has finished transmitting.
Change the arguments to ieee80211_compute_duration: pass the entire
packet length, not just the payload length. Add a 'debug' argument
to ieee80211_compute_duration and its helper subroutine,
ieee80211_compute_duration1.
If debug != 0, ieee80211_compute_duration printfs its arguments
and several local variables.
In rtw(4), load the 802.11 Duration field with the result from
ieee80211_compute_duration.
in the wanted bus_dma space. If an allocation fails during operation
(i.e. when hotplugging an umass device), fall back to using the reserve.
The amount can be configured as USB_MEM_RESERVE. The default value is
256k.
Ideally, there would be a way to steal pages in the desired area from
UVM, but that's far more complicated, and this is not intrusive, plus
it works.
MFC:
Fix by dhartmei@
IPv6 packets can contain headers (like options) before the TCP/UDP/ICMP6
header. pf finds the first TCP/UDP/ICMP6 header to filter by traversing
the header chain. In the case where headers are skipped, the protocol
checksum verification used the wrong length (included the skipped headers),
leading to incorrectly mismatching checksums. Such IPv6 packets with
headers were silently dropped. Reported by Bernhard Schmidt.
ok deraadt@ dhartmei@ mcbride@
MFC:
Fix by mcbride@
Initialise init_addr in pf_map_addr() in the PF_POOL_ROUNDROBIN,
prevents a possible endless loop in pf_get_sport() with 'static-port'
Reported by adm at celeritystorm dot com in FreeBSD PR74930, debugging
by dhartmei@
ok mcbride@ dhartmei@ deraadt@ henning@
bit in the SROM. It seems as if it is set to 1 when the PHY is
*analog*, not *digital*. Fix my sources.
In rtw_intr_rx, use units of 500kb/s instead of 100kb/s for rate,
to be consistent with net80211's expectations. Polish up some
debugging ugly messages. Dump raw 802.11 packets if IFF_DEBUG|IFF_LINK2
and RTW_DEBUG is defined.
Polish power-state (on/sleep/off) handling. Especially improve
support for RFMD (totally untested) and Maxim. For Philips, take
the Digital PHY property into account.
Call the net80211 watchdog function from rtw_watchdog, so that we
scan again if auth/assoc fails.
Be a little more cautious about writing register[RTW_TPPOLL], since
other drivers are.... Don't frob the high/low-priority queues
right now, since I don't use them.
Add rtw_join_bss which programs the card with the BSSID and other
properties of a BSS. Use it on state transitions. Factor out
rtw_set_nettype.
Make rtw_recv_beacon call ieee80211_recv_mgmt instead of dropping
beacons on the floor! TBD IBSS merges.
Change some rtw_debug=2 printfs to rtw_debug=3 (RTW_DPRINTF3)
printfs so the console doesn't get spammed so badly at rtw_debug=2.
Change some debugging printfs to RTW_DPRINTFs. E.g., print the
"RF programming method" only if debugging is enabled.
Protect SIOCG80211STATS with splnet()/splx() so that it takes a
"snapshot" of the 802.11 statistics, which is superfluous if
ieee80211_ioctl is always called at splnet()....
descriptor rings, move packets from the transmit queues to the
transmit rings, handle transmission-completed interrupts. My
Linksys WPC11 ver. 4 with Maxim RF, generates interrupts like it
is successfully transmitting packets. Clearly there are bugs: my
G4 Powerbook locks up hard. I will debug tomorrow.
For use by the subroutine ieee80211_compute_duration, add struct
ieee80211_duration, and #define a number of microsecond constants
used for the transmit timing of 802.11 packets.
Add the subroutine ieee80211_compute_duration, which computes for
any packet the appropriate 802.11 Duration field, the PLCP Length
field, as well as the Duration and Length fields for an RTS frame.
atw(4), rtw(4), future drivers, and possibly ath(4) will share
ieee80211_compute_duration.
header files, so that they don't become out of sync (again).
- Use bitmask_snprintf() instead of hand-rolled code.
- Always check array bounds before dereferencing print arrays.
- Order arguments in the vnode printing functions consistently.
Connect over tcp on the loopback is broken:
4729 amq 0.000007 CALL connect(4,0x804f2a0,0x1c)
4729 amq 75.007420 RET connect -1 errno 60 Connection timed out