Commit Graph

35166 Commits

Author SHA1 Message Date
nat bc03d86400 Allow for block sizes less than hw block size. This allows for the lowest
possible latency for all precision, sample rate and frequencies.

This is a rework of rev 1.419.
2017-11-03 05:07:37 +00:00
nat 4a6596f95c Use mix ring block size in audio write, startp, and audio drain. 2017-11-03 05:04:17 +00:00
msaitoh 1def392b27 - Handle hw.ixgN.advertise_speed correctly.
- Fix hw.ixgN.advertise_speed sysctl's description.
2017-11-02 08:41:15 +00:00
nat 69a2b841f3 Revert commit rev 1.419 to audio.c. This should address PR kern/52685.
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.
2017-11-02 02:08:02 +00:00
jdolecek 8b7dc80956 one down - mlelstv converted wd(4) to dksubr 2017-11-01 21:27:22 +00:00
mlelstv cd89d24ed3 refactor wd and ataraid drivers to use common disk subroutines. 2017-11-01 19:34:45 +00:00
mlelstv de36159cee Protect against multiple inclusion. 2017-11-01 19:15:31 +00:00
nat cadf46dc9e Add padding to gus.c so fields match up when it ts cast to a ad1848_isa
softc for the allocation of hw ring buffers.

Locking fixes as gus KASSERTS / uses the codec locks.

Ok christos@.
2017-10-31 21:53:48 +00:00
nat caf77590f5 Only allow blocksizes greater or equal to the calculated one.
This should help applications as the blocksize obtained (AUDIO_SET/GETINFO)
will work without stutter.

Ok christos@.
2017-10-31 21:18:02 +00:00
nat 3cd3e8f101 Move calculation of sc_latency into a function.
The latency of the audio device is updated on attach in the audio auto
config and shown on screen.

Ok christos@.
2017-10-31 21:13:24 +00:00
nat a7a2f28741 round_blocksize is only used for the hardware ring buffer. All other
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@.
2017-10-31 21:09:26 +00:00
martin 4908bc3fd9 PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
controll).
2017-10-31 10:46:47 +00:00
martin 6e7b93fc42 As discussed on tech-kern: define a new tty internal state flag: TS_KERN_ONLY
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.
2017-10-31 10:45:19 +00:00
khorben 4228541099 Also attach the RTL8192EU from TP-LINK 2017-10-31 00:57:14 +00:00
khorben 7d62c8416a Re-generate 2017-10-31 00:30:07 +00:00
khorben 04d5c90239 Add the TP-LINK TL-WN823N (version 2) 2017-10-31 00:20:51 +00:00
sevan a38c93c330 regen 2017-10-30 01:25:27 +00:00
sevan f73382f4e2 Add Areca ARC1214 & ARC1880.
From OpenBSD.
2017-10-30 01:24:47 +00:00
riastradh e33bbc1b18 Provisionally return to declaring midi_cd unconditionally.
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...
2017-10-29 17:57:21 +00:00
jmcneill 36a27f76f7 Allow drivers to provide their own read/write register functions. While
here, sprinkle KASSERTs to verify that the i2c lock is held where it
should be.
2017-10-29 14:59:05 +00:00
jmcneill 1d72c7e24d Make all of the COM_xxx type options runtime selectable. Kernel configs
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.
2017-10-29 14:06:08 +00:00
mlelstv 0e8cd33553 Use driver specific label code as fallback. This fixes the UDF label for CDs. 2017-10-29 09:44:17 +00:00
pgoyette b1dd402259 And yet another one. :( 2017-10-28 20:57:51 +00:00
pgoyette 338d2420f5 Misssed one cast of pointer --> uintptr_t in previous kernhist(9) commit 2017-10-28 20:56:51 +00:00
skrll cbf544482e Update format to report sC 2017-10-28 07:36:02 +00:00
riastradh 792031649a Add some #includes to make a few more header files compile. 2017-10-28 06:27:32 +00:00
riastradh 2803f25f6a Add #includes to make this compile.
<sys/cdefs.h> for __packed
<sys/types.h> for uint32_t
2017-10-28 06:24:24 +00:00
riastradh 82b8caba92 Kill some more extern struct cfdriver declarations.
Down with externs in .c!
2017-10-28 04:53:54 +00:00
riastradh af7f88ad32 Back out extern struct cfdriver -> ioconf.h change to sequencer.c.
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???
2017-10-28 04:16:04 +00:00
riastradh 1f73c3c78a Kill some more extern cfdriver xyz_cd in favour of #include "ioconf.h". 2017-10-28 03:47:24 +00:00
riastradh f89317cae1 No externs in .c files! Include ioconf.h for struct cfdriver xyz_cd. 2017-10-28 03:34:26 +00:00
pgoyette cb32a134a5 Update the kernhist(9) kernel history code to address issues identified
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.
2017-10-28 00:37:11 +00:00
nat a896b4ad4b Independent blocksizes for virtual channels where a static blocksize is
not stipulated by the underlying hw driver.

This improves latency in games esp. when the stream format differs from
the harware format.

OK christos@.
2017-10-27 01:34:32 +00:00
nat 0d21d703c2 Ensure that the low/high water marks are at least PREFILL_BLOCKS. 2017-10-26 22:45:00 +00:00
nat 49ed8a423f Add latency sysctl to adjust hw blocksize and hence latency of the mixer.
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.
2017-10-26 22:38:27 +00:00
msaitoh cb7d1e1bf1 - Remove all half duplex setting.
- 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().
2017-10-26 01:40:33 +00:00
msaitoh f684249cb6 Whitespace fix. 2017-10-25 08:21:41 +00:00
maya 18b796d442 Use C99 initializer for filterops
Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- 	{ a, b, c, d
+ 	{
+ 	.f_isfd = a,
+ 	.f_attach = b,
+ 	.f_detach = c,
+ 	.f_event = d,
};
2017-10-25 08:12:37 +00:00
msaitoh 75c2f6afe1 - For X550 and newer, print NVM Image Version with %u.%02x (e.g. "0.05").
- Fix value check of OEM_NVM_IMAGE_VER.
2017-10-25 04:45:41 +00:00
msaitoh d56090d313 Print Error Source Identification register correctly. 2017-10-24 08:32:41 +00:00
msaitoh 28efd03de4 Print "ECC" or "no ECC" for DDR4. 2017-10-24 08:02:06 +00:00
knakahara a7e55fd9ff fix wm(4) vlan panic. Reported and tested by Tom Ivar Helbekkmo, thanks.
wm(4) used PRI bits and CFI bit as vlantag by mistake. It is found out
by if_ether.h:r1.67.

XXX need pullup-8
2017-10-23 23:29:38 +00:00
jmcneill c18007e771 Initialize txrate to 0 for new associations; firmware handles rate adaptation for us 2017-10-23 15:21:10 +00:00
jakllsch 48639836e3 We don't need '&mii', but just 'mii' for mii_detach(). 2017-10-23 15:08:05 +00:00
jmcneill 91a0a07085 - Get SDIO reset working (from OpenBSD).
- After switching bus width, notify the host controller of the change.
2017-10-23 13:47:17 +00:00
msaitoh 916c83ee9b If if_initialize() failed in the attach function, free resources and return. 2017-10-23 09:31:17 +00:00
msaitoh 28ff446d00 - If if_initialize() failed in the attach function, free resources and return.
- Fix error path in the attach function correctly.
2017-10-23 09:28:38 +00:00
msaitoh 914f678899 - If if_initialize() failed in the attach function, free resources and return.
- ifp is always not NULL in iwi_detach(). Check correctly with ifp->if_softc.
2017-10-23 09:28:13 +00:00
msaitoh a80b2b73e3 - If if_initialize() failed in the attach function, free resources and return.
- Add missing dwc_gmac_free_dma_rings() and mutex_destroy() when attach
   failed.
2017-10-23 09:27:46 +00:00
msaitoh 82d818af91 If if_initialize() failed in the attach function, return. 2017-10-23 09:27:21 +00:00
msaitoh e4a9eb5a72 - Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
2017-10-23 09:25:31 +00:00
msaitoh fe1f4f1b8f - If if_initialize() failed in athn_attach(), free resources and return.
- Add missing pmf_event_deregister() in athn_detach().
2017-10-23 09:25:11 +00:00
msaitoh 35096a90e3 If error occured in the attach function, free resources and return. 2017-10-23 09:24:34 +00:00
msaitoh cb49e3c2fa If if_attach() failed in the attach function, return. 2017-10-23 09:22:24 +00:00
skrll c0bc3a8543 KNF 2017-10-22 14:13:40 +00:00
jmcneill cabc1f361d Add support for simple MMC power sequence provider bindings. 2017-10-22 13:56:49 +00:00
jdolecek 984e7914c1 do not share queue between the non-indepedant channels; instead make
sure only one of the channels is ever active on the same controller

fixes PR kern/52606 by Martin Husemann, thanks for report and testing
2017-10-22 13:13:55 +00:00
jmcneill 7a54b18649 AXP209 isn't an SMBus device, so don't use iic_smbus_* APIs. 2017-10-22 11:00:28 +00:00
jmcneill 96babd6042 Pass WME access classification to bcdc header 2017-10-21 20:36:12 +00:00
jmcneill c8ae02a2ea Initialize all fields in bcdc header. 2017-10-21 18:18:44 +00:00
isaki 05c8278c15 Fix return value. fo_kqfilter is expected to return errno on error.
This is the rest of 1.226 (10 years ago).
2017-10-21 09:58:56 +00:00
isaki 3e40697aa0 Fix return value. fo_poll is expected to return revents on error. 2017-10-21 09:12:40 +00:00
isaki d9c230b0b3 Fix return value. fo_mmap is expected to return errno on error. 2017-10-21 09:02:23 +00:00
jmcneill db9ad7f83e match atmel,24c16 2017-10-21 03:17:09 +00:00
jmcneill 3cec904f41 Set maximum supported bwfm_bss_info length 2017-10-20 23:38:56 +00:00
jmcneill f3782174ea Fix an alignment problem with scan results within an escan event 2017-10-20 23:38:21 +00:00
jdolecek e86198ff27 actually 0680 uses different chip map func, which doesn't call the function
handing non-independant channels, so don't set IDE_SHARED_CHANNELS for it
2017-10-20 21:51:29 +00:00
christos c11e935624 regen 2017-10-20 12:03:15 +00:00
christos 96e561ac8e update entry for Marvel Yukon 8058, and fix URL for pci ids (Rocky Hotas) 2017-10-20 12:01:43 +00:00
msaitoh c1f515b7e7 On I219, drop TARC0 bit 28 for DMA hang workaround (from Linux). 2017-10-20 09:26:13 +00:00
jdolecek 62fb613155 move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
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
2017-10-20 07:06:05 +00:00
jmcneill 362753ef69 Add bwfm 2017-10-19 23:59:30 +00:00
jmcneill 6d494689b1 Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.
2017-10-19 23:58:41 +00:00
jmcneill cc5188baf3 regen 2017-10-19 23:55:02 +00:00
jmcneill 6df2ee4644 Add USB IDs for Broadcom BCM43236, BCM43143, BCM43242, and BCM43569 USB
wireless devices.
2017-10-19 23:54:42 +00:00
jdolecek e5c1f84bb6 more detailed debug info; also sync DEBUG_* values in wd.c with ata.c 2017-10-19 20:45:07 +00:00
jdolecek 573c5146a9 replace the chek for the shared channel of cmdide(4) a flag of the
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
2017-10-19 20:11:38 +00:00
msaitoh 2cc66b4771 Fix a bug that the TPH ST table is decoded even if it's not in the TPH
Requester extended capability structure.
2017-10-19 05:52:57 +00:00
skrll 2f93eddcf8 KASSERT -> KASSERTMSG and while I'm here update a comment 2017-10-19 05:39:22 +00:00
jmcneill cadc6bb824 Match BUFFALO CEWL-1 (Sony UWA-BR100 WLAN) 2017-10-18 16:01:58 +00:00
jmcneill 030d0c3789 regen 2017-10-18 16:01:21 +00:00
jmcneill d8660ee7d1 Add Sony UWA-BR100 WLAN adapter 2017-10-18 16:00:53 +00:00
msaitoh 3c7d057a21 Protect ec_multi* with mutex like other MP safe Ethernet drivers.
See if_ether.h rev. 1.66 and related stuff:
http://mail-index.netbsd.org/source-changes/2016/12/28/msg080289.html
2017-10-18 10:43:32 +00:00
jdolecek bc37d5c3ea add newlines to the debug messages 2017-10-18 08:38:35 +00:00
jdolecek 2ee262ca2c reintroduce ATACH_IRQ_WAIT flag for attachments using wdcintr(), only
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
2017-10-17 18:52:50 +00:00
jdolecek fc3dcf85cb no need to clear DMA WAIT flag in mvsata_edma_handle(), it's not needed
by atabus layer
2017-10-17 16:24:14 +00:00
christos c9c3919a67 simplify previous. 2017-10-16 17:52:10 +00:00
christos d72cb7ab3f dedup 2017-10-16 11:37:20 +00:00
msaitoh f0f5e556f8 A part number field of DDR3 and DDR4 is not NUL terminated. All unused chars
are filled by 0x20. Print it correctly.

Before:
spdmem0 at iic0 addr 0x50: 8KTF51264AZ-1G6E1 E1M^@,DPAFEQZ021
spdmem1 at iic0 addr 0x51: ACR256X64D3U1333C9BA^AM^X
spdmem2 at iic0 addr 0x52: KP223C-ELD        BA^BM-~

After:
spdmem0 at iic0 addr 0x50: 8KTF51264AZ-1G6E1
spdmem1 at iic0 addr 0x51: ACR256X64D3U1333C9
spdmem2 at iic0 addr 0x52: KP223C-ELD
2017-10-16 08:33:48 +00:00
jdolecek fc8e5b3175 fix comment - it's WDCTL_IDS which is supposed to disable interrupts 2017-10-16 05:52:43 +00:00
jdolecek 351abcce56 explicitely ignore polled xfers in wdcintr(), so it won't be processed
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@
2017-10-15 18:02:33 +00:00
jdolecek 63bd69a800 move the extra thaw for scheduled ata_reset_channel() to the function itself,
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
2017-10-15 14:41:06 +00:00
jdolecek d374073a97 revert the logic for wdc_wait_for_unbusy() in wdc_ata_bio_intr() to pre-NCQ,
wdcintr() and wdctimeout() need that; follows same change
in atapi_wdc.c rev. 1.128
2017-10-15 11:27:14 +00:00
jdolecek 59fc8a81da do not use the NCQ priority by default; seems it negatively affects
performance at least with some drives, so this needs better understood first
2017-10-14 13:20:32 +00:00
jdolecek fd181cba14 only call drive reset with AT_POLL when the command itself was
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
2017-10-14 13:15:14 +00:00
msaitoh 524c760621 Show 2.5GBASE-T and 5GBASE-T correctly on ixv(4). Tested on a virtual function
on X550 T1.
2017-10-13 08:17:44 +00:00
msaitoh 4a1ccf504b Set baudrate correctly. A device which use mii(4) interface can set
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.
2017-10-13 04:52:40 +00:00
msaitoh 96b0f7c6ab IOMMU cap dump fixes:
- Print Capability Register's value.
- Indent output correctly.
- s/cahced/cached/
- Print MSI Message number with 0x%02x
2017-10-12 02:40:34 +00:00
macallan 93121220b3 add missing break;s 2017-10-11 17:08:32 +00:00
jdolecek 7ba88ded53 revert the logic in wdc_atapi_intr() for wdc_wait_for_unbusy() to what it
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
2017-10-10 21:37:49 +00:00
jdolecek 911f84397f split off functions used by 'wd* at umass?' into separate file, unfortunately
the previous approach with NATABUS doesn't work for kernels which include
MODULAR, but not atabus - such as macppc and evbarm
2017-10-10 17:19:38 +00:00
jdolecek b6c8af7411 make compile with UISDATA_DEBUG 2017-10-10 16:44:24 +00:00
jdolecek 7d0b184e29 make compile with ATAPI_DEBUG_PROBE (by copying over the code from
atapi_wdc.c), which is on e.g. for i386/amd64 ALL kernels
problem found by hannken@, thanks
2017-10-10 16:30:23 +00:00
maya ad7c2f3929 Reorder to test for null before null deref in debug code 2017-10-10 11:43:26 +00:00
maya cd9dd986ea Reorder to test for null before null deref in debug code 2017-10-10 11:40:54 +00:00
jdolecek b148501769 fix wdc_init_shadow_regs() arg 2017-10-10 05:35:15 +00:00
msaitoh af8a3835e0 Decode IOMMU capability of PCI secure device capability. From "AMD I/O
Virtualization Technology(IOMMU) Specification (#48882) Revision 3.00".
2017-10-10 03:11:01 +00:00
maya 3055b623ac Delete bogus NULL test.
We deref session just above, and all callers already have session != NULL
already.

suggested by riastradh, spotted by coccinelle
2017-10-09 23:42:40 +00:00
maya 50d6d804f3 Reorder to avoid null deref before null test 2017-10-09 23:24:22 +00:00
jmcneill 2c74340e25 Change aprint_verbose on voltage change to aprint_debug to prevent dmesg
spam when running estd. While here, remove ": " prefix on aprint_*_dev
format strings.
2017-10-09 14:52:43 +00:00
christos 58c1488ec8 don't initialize tfd twice. 2017-10-08 21:33:38 +00:00
christos 11d6f11f63 initialize tfd 2017-10-08 21:29:34 +00:00
joerg efda439fbd Initialize tfd even when not waiting for DSC. 2017-10-08 21:18:14 +00:00
jdolecek 08a994ece7 as a stopgap measure, include necessary parts of dev/ata/ata.c even
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
2017-10-08 19:00:29 +00:00
christos 4948da768d Re-use the err label more so it is not unused for drivers that don't support
dma.
2017-10-08 13:35:03 +00:00
mlelstv 82053e94ae Don't assert channel lock in polled mode.
ahcisata (and maybe others) use ata_delay during initialization where
lock isn't taken.
2017-10-08 04:52:33 +00:00
jmcneill 0030161a28 add direct config support 2017-10-07 20:31:48 +00:00
jmcneill b4e8deecae Add FDT support 2017-10-07 20:18:16 +00:00
jdolecek 46f3d27a6d adapt for NCQ branch merge too 2017-10-07 20:02:07 +00:00
jdolecek 166f05f2db adapt several more wdc attachments for NCQ branch merge 2017-10-07 19:52:11 +00:00
jmcneill 774ffdd63d Hook axp20x into fdt regulator api 2017-10-07 18:22:06 +00:00
jdolecek 26cf68556f Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch
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)
2017-10-07 16:05:31 +00:00
msaitoh 3014bc82c5 Use pcireg.h's macro. No functional change. 2017-10-05 06:37:45 +00:00
msaitoh 7c17378f49 - Add PCI_MAPREG_ROM_ADDR_MASK macro and PCI_MAPREG_ROM_ADDR() macro.
- print PCI_MAPREG_ROM_ENABLE bit.
- Decode Expansion ROM Validation ECN.
- Add Native PCIe Enclosure Management ECN's extended capability type.
  Not decoded yet.
2017-10-05 06:14:30 +00:00
jmcneill f72fc94a0e Listen for PMFE_THROTTLE_* events and limit CPU frequency when throttling
is enabled.
2017-10-05 01:28:01 +00:00
msaitoh 2b4a7b077a - ixv_enableintr(): Fix a bug that ixv_enable_queue() is called with incorrect
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?
2017-10-04 11:03:20 +00:00
msaitoh bbb4721c42 Add 2.5GBASE-T and 5GBASE-T support. (forgotten in the last commit) 2017-10-04 08:47:26 +00:00
msaitoh e2ef7204bc - Remove half-duplex setting for more than 1000Mbps in ixgbe_add_media_types()
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
2017-10-04 07:13:00 +00:00
msaitoh 35701a32de Fix a bug that X550EM (Denverton) can't force 10BaseT. 2017-10-04 06:19:47 +00:00
msaitoh 04e0dbf410 Fix a problem that mailbox interrupt never occured. Bit definitions of PF's
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...
2017-10-03 03:12:29 +00:00
msaitoh a17157486b Make mailbox statistic counters evcnt(9).
Example:
 > ixv0 message TXs                                            23    0 misc
 > ixv0 message RXs                                          2911    0 misc
 > ixv0 ACKs                                                   23    0 misc
 > ixv0 REQs                                                   22    0 misc
 > ixv0 RSTs                                                    0    0 misc
2017-10-03 02:55:37 +00:00
jmcneill 53f52772b5 Add generic DT cpu frequency and voltage scaling driver. 2017-10-02 22:49:38 +00:00
jmcneill 5d55713f67 Add driver for Silergy SY8106A regulator 2017-10-02 22:48:02 +00:00
nat d6164e7f83 Allow maxused to be an odd number of bytes. This makes single byte
conversions work for the test described in the PR.

Addresses another part of PR kern/52586.
2017-10-02 07:06:15 +00:00
nat ddfda0360c Improve LINEAR_LINEARN macro - inparticular BE/LE conversions.
Addresses part of PR kern/52586 analyzed and reported by isaki@.
2017-10-02 06:06:43 +00:00
nat 15c69bdde5 Ensure proper use of sc_opens (play back) and sc_recopens (recording).
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@.
2017-10-01 21:49:20 +00:00
macallan afb42843f6 attach to ds1775 which was already more or less supported as DS75
also, get sensor name/location from OpenFirmware if we know how
2017-10-01 05:12:18 +00:00
sevan a07ca73d88 Remove comment about BlackBerry devices which are not relevant here. 2017-09-30 13:01:50 +00:00
isaki fdac6d12b2 Improve logic in audio_initbufs(). No functional changes intended. 2017-09-30 05:37:55 +00:00
scole ac9b79b0ca Add ELAN keyboard 2017-09-29 22:05:54 +00:00
macallan 0cdd6f1a35 get sensor descriptions from OpenFirmware if we know how
this needs to be generalized
2017-09-29 14:17:47 +00:00
christos 1706b6f5e4 - only get the vtag if we have it like the other drivers
- mask the hardware vlan tag
2017-09-28 16:24:39 +00:00
christos 5ee97c1d12 only get vtag when we have vtag like the other drivers. 2017-09-28 16:23:57 +00:00
jmcneill 1e1980ee8d Fix register write location 2017-09-28 13:08:00 +00:00
msaitoh cf73666af4 Print device name in ixv_attach(). 2017-09-27 10:31:29 +00:00
kre 659488a459 In rev 1.0a of the Intel High Definition Audio Spec:
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@
2017-09-26 09:24:22 +00:00
msaitoh 82fd8c9b22 - Correct NVM word size check in wm_nvm_version() to prevent
"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.
2017-09-26 08:25:56 +00:00
knakahara a6e88d7809 VLAN ID uses pkthdr instead of mtag now. Contributed by s-yamaguchi@IIJ.
I just commit by proxy. Reviewed by joerg@n.o and christos@n.o, thanks.
See http://mail-index.netbsd.org/tech-net/2017/09/26/msg006459.html

XXX need pullup to -8 branch
2017-09-26 07:42:05 +00:00
nat 00629487c4 Call audio_mix for a third time - thus ensuring there is a block of data
in the mix ring before the audio interrupt occurs.

This addresses the instability seen in the audio atf tests.
2017-09-26 04:34:59 +00:00
jmcneill 272c2c9ec5 If the bus glue calls xhci_init with interrupts enabled, there is a window
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.
2017-09-25 00:03:10 +00:00
nat 8ca3cdf594 Move play/rec mix ring buffers into a virtual channel sc_mixring. NFCI. 2017-09-24 23:40:41 +00:00
jmcneill b6e9d7090f For known Linux keycodes, report key press events through a wskbd device
instead of using sysmon pswitch hotkey events.
2017-09-23 23:54:30 +00:00
skrll 1c54b514be PR/52553 Panic on "ifconfig athn0 up"
Don't race for a transfer in athn_usb_init on the free list for beacons.
Instead pre-assign a transfer to beacons in athn_usb_alloc_tx_list
2017-09-23 14:27:44 +00:00
jmcneill 15f5428a45 Add GPIO drivers for MAX77620 and TCA9539 as found in Jetson TX1 2017-09-22 18:12:31 +00:00
jmcneill 50506f2028 Print an error if we fail to acquire a regulator 2017-09-22 15:33:21 +00:00
macallan 7dde0073e7 use direct config 2017-09-22 04:07:34 +00:00
macallan a380c9d9c1 add more names for direct config 2017-09-22 03:04:17 +00:00
macallan a3b7d81bb2 add MAX6690 which seems to be a straight up ADM1032 clone 2017-09-20 22:44:28 +00:00
jmcneill 4f39fa4e41 fdtbus_get_string: support special 'name' property 2017-09-19 22:55:49 +00:00
hikaru 5f9b792aa8 Regen. 2017-09-15 14:25:24 +00:00
hikaru 08dae23ab9 Add Intel QuickAssist devices. 2017-09-15 14:24:32 +00:00
msaitoh 8c36354b1f xv(4) VLAN fixes:
- 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.
2017-09-15 08:31:32 +00:00
msaitoh 0fd253c14f Make ixv(4) TX/RX descriptors size the same as ixg(4). 2017-09-15 04:52:32 +00:00
msaitoh 61c94a1b88 Quick hack to fix ixv(4)'s hardware counter. ixgbe_rx_checksum() passes
"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.
2017-09-14 09:25:58 +00:00
macallan cbc62b266e MAX6642 does not have lower limit registers 2017-09-13 21:15:11 +00:00
msaitoh 99915adbe7 - Print driver feature capabilities and enable bits when verbose boot as
ixgbe.c rev. 1.99.
- Whitespace fix.
2017-09-13 04:50:50 +00:00
msaitoh 1f01128ca2 Set get_link_status to true in ixv_init_locked() to get the first link status
correctly.
2017-09-13 04:48:40 +00:00
jmcneill 20fc9fd202 For SD cards, send the SET_WR_BLK_ERASE_COUNT app command before a
multi-block write to improve write performance.
2017-09-12 13:43:37 +00:00
msaitoh 6c6661e72c Add IT8728F and IT877[12]E. 2017-09-12 09:54:45 +00:00
msaitoh 449d087742 Fix panic caused by rev. 1.58's change. Don't if_start from interrupt context.
The restart code exists in ixv_handle_que().
2017-09-12 05:28:31 +00:00
msaitoh c513660698 Print Mailbox API version. 2017-09-11 10:11:05 +00:00
msaitoh f8cb90f1a0 Use cprng_strong64() insread of cprng_fast64() to prevent panic. 2017-09-11 09:52:13 +00:00
pgoyette cf97431927 Improve tracking of the state of an event's callout, and protect all
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
~
~
2017-09-11 06:02:09 +00:00
christos 31d64fd89d use arraycount. 2017-09-07 10:18:26 +00:00
christos 2252fe52a5 PR/52522: ent_name is not necessarily 0 terminated, so check bounds.
XXX: pullup-8
2017-09-06 18:21:17 +00:00
msaitoh 01bfdbc214 Fixes a problem that some driver(e.g. acpitz(4) or coretemp(5)) which
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@.
2017-09-06 11:08:53 +00:00
skrll 959954eaf3 Add an XHCI_DISABLE_MSI option 2017-09-05 08:01:43 +00:00
mrg 75b8e95395 remove redundant checks against sc and sc->sc_dying.
check sc_dying in more places.
2017-09-05 05:03:02 +00:00
jmcneill aee26b4bb9 Add console support. 2017-09-04 18:01:28 +00:00
nat e68c19236b Remove references to BlueCore.
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.
2017-09-03 23:11:19 +00:00
isaki afd2573085 Separete sc->sc_pr/rr (mix ring) block size and hwvc->sc_mpr/mrr (hw ring)
block size.  Now MI audio supports(revives) device with different precision
than mix ring's precision like vs(4) (4bit ADPCM).
2017-09-02 15:26:43 +00:00
isaki eab2ddfde4 Remove duplicated code.
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().
2017-09-02 13:28:11 +00:00
isaki ae42b57fad Don't assign sc->sc_pr/rr.blksize in audio_initbufs().
For hwvc, it is calculated in audiosetinfno().  And the user vc should
not change sc->sc_pr/rr.blksize.  In addition, this assignments appear twice.
2017-09-02 13:22:51 +00:00
isaki 7f22a55c63 Revert previous local conversion for vs(4). 2017-09-02 12:57:35 +00:00
ryoon 58bb514de8 Support some Wacom pen tablets:
* Graphire (pen)
* Graphire2 (pen)
* Intuos2 A4 (pen)
* Intuos Art (pen, no finger touch)

Remove report descriptor override workaround for
Graphire and Graphire2.
2017-09-02 04:35:51 +00:00
macallan 3c8b989b82 support MAX6642 - yet another adm1021 kinda-sorta clone 2017-09-01 20:11:59 +00:00
skrll 2ca785ae43 Add a missing break that should have been included in revision 1.163.
Spotted by "sc dying" and reported on current-users
2017-09-01 15:19:59 +00:00
jmcneill 66995669d3 Instead of a Linux keymap, convert Linux event codes to USB scan codes and
use the ukbd keymaps instead.
2017-08-31 19:55:43 +00:00
msaitoh 287fff2eb1 If _ENABLED flag of ACPI_SRAT_TYPE_CPU_AFFINITY, ACPI_SRAT_TYPE_MEMORY_AFFINITY
or ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY isn't set, don't use the table.
2017-08-31 08:45:03 +00:00
msaitoh b7bbade77e Fix 2500 KX media setting in last commit. 2017-08-31 02:48:55 +00:00
msaitoh dc7f84c858 - Sync with FreeBSD r320688 (and up to r322865):
- 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.
2017-08-30 08:49:18 +00:00
msaitoh c91dc6deb1 FreeBSD r320688 sorted a lot of functions. Merging that change by one commit
makes difficult to know what was really changed. To make change understandable,
commit only function sort and white space changes before real change.
2017-08-30 08:24:57 +00:00
msaitoh 07cce385bc Don't limit number of queue pair to 8. Take max TX queues and max RX queues
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)).
2017-08-30 01:25:07 +00:00
jmcneill 088e9f05e9 Use linux_keymap instead of pckbd keymap 2017-08-30 00:40:09 +00:00
jmcneill fd3aded8b4 Add a keymap for converting Linux event codes to wscons keysyms. 2017-08-30 00:39:27 +00:00
ryoon c6a72218c6 Regen. 2017-08-29 18:33:15 +00:00
ryoon 6ea1e3aab6 Add Wacom Intuos2 A4 and Intuos Art pen tablets 2017-08-29 18:31:19 +00:00
jmcneill 15cd199c01 Add powerdown support and hook it in to FDT 2017-08-29 10:10:54 +00:00
jmcneill 90be26ce03 Add direct configuration support. 2017-08-29 09:55:03 +00:00
isaki f383323805 Fix two typos. pfil -> rfil for recording.
One was introduced a month ago and the other was 12 years ago.
2017-08-29 06:38:49 +00:00
jmcneill e5c2949b71 Add an FDT "Simple Framebuffer" driver. This lets us take over framebuffers
configured by U-Boot without any knowledge of the underlying hardware.
2017-08-27 19:14:32 +00:00
jmcneill 5de54da794 Scan children of the /chosen node to pick up simplefb nodes 2017-08-27 19:13:31 +00:00
jmcneill 0d97882d9f wscons is not mpsafe, so take kernel lock for intr handler 2017-08-26 22:31:02 +00:00
jmcneill 9cc94ca9d8 add WSKBD_TYPE_TCAKP for Texas Instruments TCA8418 2017-08-26 21:16:54 +00:00
jmcneill ed1131f531 Add driver for Texas Instruments TCA8418 I2C Controller Keypad Scan IC. 2017-08-26 21:02:35 +00:00
macallan a9c7e04328 Radeon PLLs can't have odd post dividers when used with digital outputs -
add a flag to track this in relevant functions.
Now DVI output works properly on my Mini 2
Needs testing on Mini 1 and other hardware...
2017-08-25 22:45:33 +00:00
jmcneill a285dbd20c Add fdtbus_get_reg_byname 2017-08-25 12:28:10 +00:00
maya 7bdf8d594a Initialize error also in the case where len=0, which just succeeds.
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
2017-08-24 11:26:32 +00:00
msaitoh 0a15ee0de7 Remove unused counters. 2017-08-24 10:43:42 +00:00
macallan 3f623854c7 Mac Mini WIP:
- 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.
2017-08-23 19:47:39 +00:00
macallan e0975726cb consistency... 2017-08-23 19:21:14 +00:00
skrll 7f0f554e65 Check both buses for ub_usepolling and schedule the soft interrupt handler
or call it directly.  Fixes usb keyboard in ddb when attached to xhci.
2017-08-22 16:57:00 +00:00
mlelstv aaf4d31325 make the sc_discard interface for the ld backend asynchronous and
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.
2017-08-20 15:58:43 +00:00
maxv 4afdd42b50 M_WAITOK cannot fail, so remove the test, otherwise it looks like an
spl leak; found by mootja
2017-08-20 11:00:30 +00:00
maxv e4957024d0 M_WAITOK cannot fail, so remove the test branches. Otherwise it looks
like leak/uninitialized area.
2017-08-20 10:55:37 +00:00
isaki 98ece02d7a hw_if->set_params is mandatory, so it will never be NULL. 2017-08-20 05:12:17 +00:00
isaki 32fa4cd32c Remove meaningless sc_blkset.
audio_calc_blksize() checks whether sc_blkset is set but
it seems to be always cleared before calling audio_calc_blksize().
2017-08-20 03:13:04 +00:00
isaki 4e30345bd6 Remove goto in mix_write() 2017-08-20 03:02:36 +00:00
msaitoh beeeafc6d4 - WBSIO_ID_W83627DHG and newer devices have 12bit device ID. So, change sioid
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.
2017-08-18 04:07:51 +00:00
msaitoh 43565adf9b Print chip name correctly. 2017-08-17 05:32:04 +00:00
msaitoh 3ad4b27256 Use uint8_t instead of int. No functional change. 2017-08-17 05:27:48 +00:00
isaki b42ab93218 Fix typo. sc_mrr -> sc_mpr for play buffer. 2017-08-17 04:33:22 +00:00
msaitoh e38d44d138 Add C3000 devices. 2017-08-17 01:24:09 +00:00
msaitoh 3e4c5bfebb Regen. 2017-08-17 01:05:51 +00:00
msaitoh e9a2d4fa2a Add C3000 devices. 2017-08-17 01:05:22 +00:00
nat 1940716d95 Remove extra newline. 2017-08-16 21:18:58 +00:00
nat d7b3efdac7 If ALPS probe fails, send a PMS_RESET.
Restores functionality on a wrong version ALPS touchpad.

Addresses PR kern/52489.

This patch was prepared by/committed on behalf of maya@.
2017-08-16 21:09:48 +00:00
ryoon 9828247cf0 Do not print ALPS related message when generic PS/2 case 2017-08-15 22:23:09 +00:00
isaki e813916daa Clean up mix_write(). 2017-08-15 08:30:21 +00:00
isaki 0147e9b47c Avoid possibility of integer overflow (and clean up).
- 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.
2017-08-15 08:28:21 +00:00
isaki 91cbb00a7c Clean up audio_open().
As a result of sc_audiochan cleanup, this loop is the same as last + 1.
2017-08-15 05:31:52 +00:00
isaki 9e73f18cf7 Clean up audio_allocbufs().
As a result of sc_audiochan cleanup, it is easy to access sc_hwvc.
2017-08-15 05:11:25 +00:00
isaki f74024e8cb Remove dead codes.
sc->sc_opens never changes in this loop and as a result of
previous sc_audiochan cleanup "sc_opens == 0" is the same as
"sc_audiochan is empty".
2017-08-15 05:05:32 +00:00
isaki c241a3c1cb Split the first special element from sc_audiochan list.
- 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).
2017-08-15 04:42:56 +00:00
nat b79ea570a8 Apply the sequence number mask to txack. 2017-08-14 12:51:11 +00:00
hauke 42554a387c Enable the IT8628E shipped with my gigabyte GA-N3150N-D3V board.
XXX These IT suoer IO chips appear to be all fairly alike. Maybe add a
comprehensive list of IDs to recognize them, then deal with the
fallout?
2017-08-14 11:49:30 +00:00
nat cb47fae4db Conform to the spec. with regards to acknowlegment packets. This prevents
the host controller from freezing.

Inmprove communication from inactive to active state.
2017-08-14 05:33:30 +00:00
jakllsch fc12da1821 Always try to set USB HID devices into Report Protocol. (Unless the
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."
2017-08-13 22:29:42 +00:00
mlelstv 146bc77840 validate length for discard operation and split operation when byte length
doesn't fit into 'int'.
2017-08-13 22:23:16 +00:00
jakllsch 0d0313ba43 Support more varieties of USB keyboard reports.
The previous code asssumed reports would closely match the Bootstrap
Keyboard Protocol.  This is no longer always the case, particularly
with higher-end keyboards.
2017-08-13 22:19:56 +00:00
jakllsch 8780d8c54a Fix memory leak in report parsing error paths. 2017-08-13 21:11:45 +00:00
jmcneill 721ac4a3ed Add GPIO regulator driver. 2017-08-13 18:27:31 +00:00
jmcneill 97d3260c03 Add fdtbus_gpio_acquire_index for accessing multi-xref gpios properties. 2017-08-13 18:27:11 +00:00
christos 014b6d5aae PR/52483: Ryo ONODERA: Add support for ALPS PS/2 pointing devices 2017-08-13 08:49:27 +00:00
isaki 7abef65771 Remove mixer chan from sc_audiochan.
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.
2017-08-13 05:04:08 +00:00
isaki e0da01f938 Move defines to the appropriate place. 2017-08-13 04:09:27 +00:00
martin db5d35351f Do not deref a NULL pointer if no current media has been selected.
This error condition does not happen with properly working hardware, but it is
no good reason for a kernel panic either.
2017-08-12 11:21:15 +00:00
mlelstv d001a53273 tag arcmsr scsipi adapter and pci interrupt as MPSAFE. I/O is now done
without taking kernel lock.
2017-08-12 11:03:47 +00:00
macallan 0c7c75bc0c set display output parameters according to properties
Now VGA output works as intended on my Mini 2. DVI is still garbled ( but
visible ) and Mini 1 is untested.
2017-08-11 22:59:05 +00:00
jmcneill 82e84007f0 Defer sdmmc discard operations to the sdmmc task queue. Fixes a panic
introduced by ld.c r1.102.
2017-08-11 18:41:42 +00:00