This also means that drivers that have a static block size will have more
latency at lower sample rates/precision/channels. Also audio drivers that
do more than supply rounded blocksizes in their round_blocksize functions
will have to be changed.
buffers (mix ring, streams) are set to be a power of 2.
This allows for consistent latency where a static blocksize is enforced by
the underlying audio device driver.
Ok christos@.
Implement it in a few tty drivers. If this flag is set, the underlying
hardware is used by another driver and userland has no right to open
it. A few uses will appear soon in sys/dev/sun/sun{kbd,ms}.c.
Apparently this breaks compiling some kernels, although how they ever
managed to link if midi_cd is not declared in ioconf.h, and therefore
presumably not defined in ioconf.c, is beyond me.
Maybe someone who knows how sequencer is supposed to work, and/or
someone who knows how arm kernels are linked, can figure this out...
with the existing options (COM_16650, COM_16750, COM_AWIN, COM_HAYESP, and
COM_PXA2X0) will select the correct type in com_attach_subr. New code
should specify the com type by passing COM_TYPE_xxx to comcnattach and/or
setting sc_type.
This broke the module build, because it needs midi_cd which is defined
in another module and not declared by the ioconf.h generated from
sequencer.ioconf.
But... It also needs sequencer_cd, which is _also_ not declared by
the ioconf.h generated from sequencer.ioconf, nor defined in the
ioconf.c generated from sequencer.ioconf. Did this ever work???
in PR kern/52639, as well as some general cleaning-up...
(As proposed on tech-kern@ with additional changes and enhancements.)
Details of changes:
* All history arguments are now stored as uintmax_t values[1], both in
the kernel and in the structures used for exporting the history data
to userland via sysctl(9). This avoids problems on some architectures
where passing a 64-bit (or larger) value to printf(3) can cause it to
process the value as multiple arguments. (This can be particularly
problematic when printf()'s format string is not a literal, since in
that case the compiler cannot know how large each argument should be.)
* Update the data structures used for exporting kernel history data to
include a version number as well as the length of history arguments.
* All [2] existing users of kernhist(9) have had their format strings
updated. Each format specifier now includes an explicit length
modifier 'j' to refer to numeric values of the size of uintmax_t.
* All [2] existing users of kernhist(9) have had their format strings
updated to replace uses of "%p" with "%#jx", and the pointer
arguments are now cast to (uintptr_t) before being subsequently cast
to (uintmax_t). This is needed to avoid compiler warnings about
casting "pointer to integer of a different size."
* All [2] existing users of kernhist(9) have had instances of "%s" or
"%c" format strings replaced with numeric formats; several instances
of mis-match between format string and argument list have been fixed.
* vmstat(1) has been modified to handle the new size of arguments in the
history data as exported by sysctl(9).
* vmstat(1) now provides a warning message if the history requested with
the -u option does not exist (previously, this condition was silently
ignored, with only a single blank line being printed).
* vmstat(1) now checks the version and argument length included in the
data exported via sysctl(9) and exits if they do not match the values
with which vmstat was built.
* The kernhist(9) man-page has been updated to note the additional
requirements imposed on the format strings, along with several other
minor changes and enhancements.
[1] It would have been possible to use an explicit length (for example,
uint64_t) for the history arguments. But that would require another
"rototill" of all the users in the future when we add support for an
architecture that supports a larger size. Also, the printf(3) format
specifiers for explicitly-sized values, such as "%"PRIu64, are much
more verbose (and less aesthetically appealing, IMHO) than simply
using "%ju".
[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
but it is possible that I've missed some of them. I would be glad to
update any stragglers that anyone identifies.
usage: sysctl -w hw.hdafg0.lantency="value in milliseconds"
It is possible to set the latency of the mixer unless a static blocksize
is configured by the underlying hardware driver (pad, vcaudio on RPI).
Documentation updates to audio.4 will occur in a follow up commit.
OK christos@. XXX pullup-8.
- Remove special handling of IXGBE_DEV_ID_82598AT's 1000BaseT. The PHY is
compliant with clause 45, so the media is added in the beginning of
ixgbe_add_media_types().
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)
on topic of PR kern/52606
product array, rather than switch inside attach routine
XXX judging from product name, Silicon Image 0680 might be newer than 0649
XXX and hence have actually independant channels, but I don't have the hw
XXX so keeping as-is
no functional change, just to improve visibility in course of fixing
PR kern/52606
process the interrupt when the flag is set - this fixes spurious interrupt
during post-reset drive setup in wdc_ata_bio_start(), and wdc_atapi_start()
while those functions set WDCTL_IDS, this seems to be ignored by certain
(maybe all) PCI-IDE controllers; usually the implicit KERNEL_LOCK() would
prevent the interrupt anyway, but not when the start routine is started
from the atabus thread, which doesn't take it
fixes 'panic: wdc_ata_bio_intr: bad state' reported on current-users
by Chavdar Ivanov
twice - seems setting WDSD_IBM actually has no effect at least
on some PCI-IDE, and the interrupt ends up being triggered when we release
the channel lock to call c_poll hook
fixes PR kern/52605, and should also fix the 'New panic in wdc_ata_bio_intr'
reported on current-users@
so it's done regardless if the actual reset is run from thread context
or e.g. call with AT_POLL; fixes a hang after xfer failure and dma downgrade
add some debugging printfs, so freeze/thaw issues are easier to track
polled, so that the logic for AT_POLL matches how e.g. ata_dmaerr() is
called; this was the original intent of the change in 1.428.2.25,
to make the error handling safe wrt. polled xfers
this is stopgap fix for ATA channel wedge after DMA error, as reported
by Martin Husemann in PR kern/52606, and PR kern/52605
problem happened due to ata_reset_channel() being called once in ata_dmaerr()
with flags == 0, which freezed channel and set flag to reset via thread,
then ata_reset_channel() was called via wdc_drive_reset() with AT_POLL, which
just executed the reset and cleared the flag, without clearing the extra
freeze; that logic will be refactored in separate commit
if_baudrate atomatically by mii_phy_statusmsg(). ixg(4) and ixv(4) don't
use mii(4), so calling ifmedia_baudrate() directly is required.
XXX need the same same work for wm(4)'s TBI and SERDEV devices.
was before NCQ merge; it got broken during the efford to remove ch_status
and ch_error on the branch
fixes atapi timeouts in vbox and with real harware reported separately
by Abhinav Upadhyay, Pault Goyette, Chavdar Ivanov, and Rares
Aioanei; with a bit of luck it could also fix PR kern/52605 and/or PR
kern/52606 by Martin Husemann
if no atabus is configured, so that kernels with just 'wd* at umass?'
and no atabus compile; fixes kernel builds for vax, pmax and evbmips
after NCQ branch merge
XXX wd* at umass? still actually untested after the merge, need to discuss
XXX what to do with it
ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.
Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).
Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.
Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).
Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.
Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
argument. This bug was added in rev. 1.68.
- Don't check neither VTEICR nor VTEICS same as Linux. It seems that both
registers can't be used to check which MSI-X vector is triggered. A bit is
set on very low probability and the bit location is incorrect. Is this an
errata?
because those medias are not in the spec.
- Add 2.5GBASE-T and 5GBASE-T support. Tested with X550-T1.
Example:
ixg0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=fff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
capabilities=fff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
capabilities=fff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6,LRO>
enabled=7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
enabled=7ff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
enabled=7ff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
ec_capabilities=7<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
ec_enabled=7<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
address: a0:36:9f:b0:f5:b0
media: Ethernet 2.5GBASE-T full-duplex
status: active
supported Ethernet media:
media 10Gbase-T
media 10Gbase-T mediaopt full-duplex
media 1000baseT
media 1000baseT mediaopt full-duplex
media 100baseTX
media 100baseTX mediaopt full-duplex
media 2.5GBASE-T mediaopt full-duplex
media 5GBASE-T mediaopt full-duplex
media autoselect
inet 172.16.0.1/24 broadcast 172.16.0.255 flags 0x0
inet6 fe80::a236:9fff:feb0:f5b0%ixg0/64 flags 0x0 scopeid 0x1
interrupt related registers and VF's interrupt registers a completely
different. VF's registers (VF{EICR, EICS, EIMS, EIMC, EIAC, EIAM})'s bits are
just MSI-X vector bitmask, so read/write correctly. Read VTEICR instead of
VTEICS in ixv_msix_mbx (note that "PF" has a errata that EICS is required to
read the cause). Don't write IXGBE_VTEICR in ixv_msix_mbx() because we use
auto-clear for mailbox interrupt.
We have gotten link status change by timer instead of interrupt before
this fix...
Fix logic for /dev/sound so audiosetinfo is only called once.
These changes are to ensure that init_output/input is only called once for
the respective function play back or recording. For multiple recording or
plack back streams init_input/output is only called once fot the first
play/rec stream.
This addresses PR kern/52580, PR kern/52581 and PR kern/52582 analyzed and
reported by isaki@.
https://www.intel.com/content/www/us/en/standards/
high-definition-audio-specification.html
page 186 shows the layout of the baseline block of the ELD (EDID Like Data)
struct - and allows a reserved (effectively padding) area at the end of the
struct. This is required to keep the struct an even number of words long
(size measured in units of 32 bits) while allowing for a variable length
monitor name, followed by a variable number of 3 byte structs - the
combination of which is not likely to be a multiple of 4.
Code here assumed that there was no padding, and objected to the ELD
format if any padding bytes existed (hdafg_dd_parse_info() would return
EINVAL) causing a "failed to parse ELD data" message (if HDAFG_HDMI_DEBUG
is defined) from hdafg_assoc_dump_dd() making it difficult (or at least
confusing) to debug HDMI related audio issues (hdafg_assoc_dump_dd would
not print most of the data it is expected to print) although this would
most likely have no effect on actual operations.
Change a test from a != to < (there must be enough data, not exactly the
amount needed) for the EINVAL. As a consequence, the length after the
SAD data is parsed (the 3 byte structs) is no longer required to be 0,
so remove the KASSERT() (previously it was just useless, the code guaranteed
a 0 value, now it is incorrect.) While here also change a related
diagnostic message to be slightly more informative as to what is being shown.
OK jmcneill@
"EERD polling failed" error on attach. if_wm.c rev. 1.534 was not perfect.
Reported by ozaki-r@.
- Print NVM offset and word count when EERD polling failed.
XXX pullup-8.
between when xhci interrupts are enabled and the usb bus driver is
attached. If an irq occurs in this window, xhci will attempt to schedule
a softint with an invalid softint handle.
Add a quirk flag, XHCI_DEFERRED_START, that when set skips starting the
controller at the end of xhci_init. Bus glue that sets this is responsible
to call xhci_start after attaching the child usb devices.
- Dirty hack for VID mask bits. On ixg(4), VLAN filter is disabled. So any
vlan ID's packet passes RX filter. On ixv(4), usually, PF driver uses
VLAN filter enabled. There is no way to disable PF's VLAN filter function
itself. NetBSD's Ethernet driver has currently no API to know which VLAN ID
should be accepted. To avoid this proble, enable all VIDs... Yes, I know
this is dirty hack. We should rethink.
- Call ixv_setup_vlan_support() in ixv_ifflags_cb().
- Don't use global ixv_shadow_vfta[].
- Use local variable (rxr->) to reduce diff against ixgbe.c. No functional
change.
"struct ixgbe_hw_stats *" even if its a virtual function. The layout between
ixgbe_hw_stats and ixgbevf_hw_stats are different, so ixgbe_rx_checksum()
wrote wrong area if a device is a virtual function. To fix this problem with
small change, move the location of ipcs, ipcs_bad, l4cs and l4cs_bad of
struct ixgbe(vf)_hw_stats to the same location at the biggining of the struct.
queries or modifications of the state with the sme_mtx mutex.
Detach the rndsrc before re-attaching it (with potentially new values).
Clean up some lock-ordering issues.
And a couple of KNF issues for good measure!
Should address PR kern/52533
XXX Pullup-8 along with the previous fixes from msaitoh@
XXX http://mail-index.netbsd.org/source-changes/2017/09/06/msg088028.html
~
~
use sysmon_envsys sleep waiting at "rndsrc" when "drvctl -d".
Don't call rnd_detach_source() in sme_remove_event() which is called
from sme_event_unregister_all(). Instead, call rnd_detach_source() in
sysmon_envsys_sensor_detach() and call sysmon_envsys_sensor_detach()
before sme_event_unregister_sensor(). Each sensor(envsys_data) has each
rnd_src, but some sme_events point to the same rnd_src in a sensor.
Calling rnd_detach_souce() twice with the same rnd_src brokes a reference
count in rnd_src. OK'd by pgoyette@.
Enable XON/XOFF flowcontrol in SLIP layer depending on config response.
Send an acknowlegment packet on timeout/retry.
Compute tx{ack,seq} and rx{ack,seq} according to the specification.
For hwvc, audio_calc_blksize() appears soon again.
For user vc, the userland format and HW format are separeted, so
audio_calc_blksize() here is no longer necessary. In addition,
vc->sc_mpr.blksize is already initialized in audio_open().
- Add C3000(Denvertion(-NS)) support.
- Add bypass function support for bypass adapters. Sysctls are provided.
Not tested because I have no any bypass adapter.
- ixv(4): set RSS mapping.
- Change EEE sysctl.
- ixv(4): Add TSOv6.
- ixv(4): Mailbox API 1.2 and more are implemented and comment says it
negotiate with 1.2 but it really does 1.1...
- Remove thermal test sysctl.
- Fix unknown bugs.
- Print driver feature capabilities and enable bits when verbose boot.
into account. 82598 has 32 TX queue and 64 RX queues. Others has 128 TX queues
and 128 RX queues. Number of MSI-X table entries is 64, so the max queue pairs
is 63 (64 minus the Others (e.g. link status change)).
while here, assert that the len is indeed non-negative. this is already
confirmed by sys_fdiscard, but let's be sure.
reported by: GCC, but with different compile flags
- plug the external TMDS into the right CRTC when in use
- use the right output types for Mini configs
now VGA works properly ( and not just by accident ) on my Mini 2. DVI is still
garbled but at least produces output.
signal completion through new callback lddiscardend. Use a standard
struct buf to pass disk address and range instead of two off_t values.
make lddiscard synchronous again. This is a requirement of the current
ffs discard code.
from 8bit to 16bit and check with it strictly.
- s/lm_match/nslm_match/
- split {wb,lm,def}_match() to XXX_match and XXX_attach().
- Rename lm_probe with lm_match and call {wb,nslm,def}_match() at the end of
the function to check strictly.
- NCT610[246]D is different from otehrs, so add new nct6102d_sensors[] table.
- Register offsets of vendor ID and chip id of NCT610[246]D are different
from others. When it failed reading vendor ID or chip ID, fallback to
NCT610[246]D's register offsets.
- Add debug messages.
- On 32bit arch and type argument is int32_t, orig[m] * tomix[m] is
calculated first with int32 (possibility of overflow here) and then
cast to int64_t for assignment.
- bigger_type is sufficient for product and result.
- This makes sc_audiochan a list of only open audio chan.
- "SIMPLEQ_FIRST(&sc->sc_audiochan)->vc" is now "sc->hwvc".
No functional changes (except one debug message).
device is known to be quirky.)
Some of the most-widely-compatible methods of implementing USB Keyboard
NKRO depend on this Request to function as designed.
Issuing this Request is recommended by the HID 1.11 spec (7.2.6):
... "the host should not make any assumptions about the device's state
and should set the desired protocol whenever initializing a device."
The previous code asssumed reports would closely match the Bootstrap
Keyboard Protocol. This is no longer always the case, particularly
with higher-end keyboards.
Now sc_audiochan contains opened audio chan (and first special
element) only.
First I splitted sc_audiochan into sc_audiochan which has
audio chan (and first special element) and sc_mixerchan
which has mixer chan only. However nobody else refers this
sc_mixerchan except additions to list and deletions from
list. So mixer chan's list is not necessary.