summaryrefslogtreecommitdiff
path: root/sys/dev
AgeCommit message (Collapse)Author
2021-09-03Ensure that iwm(4) and iwx(4) will reload firmware from disk on down/up,Stefan Sperling
and will not do so during resume. Tested by kevlo@ on iwx(4) and by myself on iwm(4).
2021-09-02follow-up on previous commit and rename the _sys union to _argsJasper Lievisse Adriaanse
2021-09-02Initialize the uvm object when we actually need it such that we canMark Kettenis
use uvm_obj_init() to initialize the pager ops and initial reference count. This will help future uvm unlocking diffs. ok mpi@, jsg@
2021-09-02rename struct dt_evt fields to make it clear this isn't only used for ↵Jasper Lievisse Adriaanse
tracing syscalls and adjust btrace(8) accordingly. extracted from a larger diff by Tom Rollet. ok mpi@
2021-09-02Explain in a comment why two wscons_keydesc structures are needed.Anton Lindqvist
2021-09-02Fix our iwx(4) xtal latency values to match the values used by Linux iwlwifi.Stefan Sperling
with a fix from + ok kevlo@
2021-09-02The PCI_PRODUCT_INTEL_WL_22500_1 device is part of the 22000Kevin Lo
family (discrete) not integrated. ok stsp@
2021-09-02aq(4) driver for Aquantia 1/2.5/5/10Gb/s PCIe ethernet adaptersMike Larkin
Adds support for Aquantia AQC1xx family of PCIe ethernet adapters. This driver supports 1Gbps through 10Gbps modes of operation based on the hardware and media/switch capabilities. The initial code was ported from NetBSD, with jmatthew@ finishing up the Tx/Rx ring support and interrupt handler routine. The driver only supports devices using firmware V2. This diff enables aq(4) on riscv64 and amd64, the only platforms where I have tested the driver, but it likely works on other architectures as well.
2021-09-01Use ttopen in tty drivers open functions as ttysleep string, as the others do.Jan Klemkow
ok patrick@
2021-09-01Add support for the more rare volume usage which differs compared to theAnton Lindqvist
more common volume increment/decrement usages in which each volume change direction is represented using a distinct usage. The volume usage instead uses bits of the interrupt buffer to represent the wanted volume. The same bits should be within the bounds given by the logical min/max associated with the HID item. However, the volume is not interpreted as an absolute value but rather just looking at the sign bit in order to determine the volume change direction. I couldn't find any documentation of this usage and the implementation is therefore solely based on analysing actual data from Richard Toohey's <richardjtoohey at gmail dot com> Dell keyboard.
2021-09-01Rename ucc_bits_to_usage() to ucc_bits_to_int() as it's about to be usedAnton Lindqvist
in more than one context.
2021-09-01Remove dead poweroff functions, as they not appear in otherJan Klemkow
serial drivers. ok patrick@
2021-08-31Implement suspend/resume for bwfm(4) with PCIe backend. We try to send thePatrick Wildt
device into D3 and do a hot-resume if possible. Otherwise we need to clean up the resources to allow complete HW re-initialization to take place.
2021-08-31regenJonathan Matthew
2021-08-31Add Aquantia USB ethernet devicesJonathan Matthew
from Brad originally
2021-08-31Clean up the list of chips upon detach and mark us uninitialized.Patrick Wildt
2021-08-31Properly deallocate some more structures upon detach, and make sure we'rePatrick Wildt
not considered initialized anymore.
2021-08-31Initialize some struct variables to make sure that upon reinit, caused byPatrick Wildt
a suspend/resume cycle, the values are set to a sane default.
2021-08-31Initialize ring read/write pointers to make sure that upon reinit, causedPatrick Wildt
by a suspend/resume cycle, the pointers are set to a sane default.
2021-08-31When running on Hyper-V, make use of its timecounter as delay func in casePatrick Wildt
we're still using the i8254 for that. On Hyper-V Gen 2 VMs there is no i8254 we can trust, so we need some kind of fallback, especially if there is no TSC either. Discussed with the hackroom ok kettenis@
2021-08-31Fix use of wrong pointer argument when freeing firmware paging info in iwx(4).Stefan Sperling
Found by mpi@ and gnezdo@ ok gnezdo@
2021-08-31Using suser() instead of doing it manually.Jan Klemkow
ok patrick@
2021-08-31remove empty forward structs fro bge_ring_data as found with ctfconv.Jasper Lievisse Adriaanse
tested by and ok jmatthew@
2021-08-31In enumerating mode, calculate the bit offset using the HID inputAnton Lindqvist
location as the product of the corresponding Report Count and Report Size can be greater than one. Fixes Richard Toohey's <richardjtoohey at gmail dot com> Dell keyboard.
2021-08-31Protect against missing bit to key symbols in ucc_bit_to_sym(). This canAnton Lindqvist
only happen if ucc_hid_parse() has a bug, better play it safe.
2021-08-31sprinkle barriers and dmamem_syncs around the hibernate io path.David Gwynne
at the very least it stops the compiler omgoptimising away important code. tested by and ok deraadt@ jmatthew@
2021-08-30Remove magic offset from data structures. This makes it much easier toMark Kettenis
compare the data structures with the Linux code which unfortunately is the only documentation we have for the pin numbers used by ACPI. While there make the data structures const. ok jcs@
2021-08-30remove a bunch of forward-only structs that were found with ctfconv.Jasper Lievisse Adriaanse
ok mpi@
2021-08-29iwm/iwx: propagate errors out of iw{m,x}_set_bits_mask_prph routinesGreg Steuck
This might help with troubleshooting "iwx0: acquiring device failed" errors. OK stsp@
2021-08-29Pass volume related key presses as both raw and translating input toAnton Lindqvist
wskbd in order to make them visible in X11. Matches what ukbd(4) already does.
2021-08-29correct range upper bound in commentAnton Lindqvist
2021-08-29Make the ucc match criteria more stringent by requiring at least oneAnton Lindqvist
usage greater than zero. Usage zero is defined as unassigned by the specification and cannot be mapped to anything sensible. Prevents ucc from attaching to bunch of odd report IDs from a Lenovo ThinkPad USB-C Dock which only exposes the unassigned usage. This is not a problem in practice but I think we're better attaching them as uhid devices instead as ucc cannot provide any functionality. Thanks to Mario Peter <mp at mpeter dot de> for reporting and testing.
2021-08-29Some reports embeds multiple report IDs inside the same collectionAnton Lindqvist
causing ucc to only being able to attach to the last report ID. This in turn is caused by hid_is_collection() only being able to observe an end of collection item with the last report ID for the same collection. Instead, change the matching of ucc to only consider report IDs with at least one corresponding Consumer Control usage. Fixes gnezdo@'s Google Pixel earbuds.
2021-08-29An interrupt report contains the state of all items (Input, Output andAnton Lindqvist
Feature) from the corresponding descriptor report for a given report ID. The ordering of the items is identical in both the descriptor and interrupt report. As the interrupt report can cover more than Consumer Control related key presses, ucc must be more careful while examining the interrupt report in order to not confuse other items as key presses. While parsing the descriptor report, take note of the bits that represents Consumer Control key presses and use it to slice the interrupt report. Thanks to florian@ gnezdo@ and Alessandro De Laurenzis <just22 at atlantide dot mooo dot com> for testing.
2021-08-29As the Consumer Control usages are well defined by the HID Usage TablesAnton Lindqvist
specification ucc might as well enumerate all of them. Finding an appropriate scan code recognized by X11 for each usage is more tricky. I've added a few more but the majority are still unmapped. Linux has defined a couple of more usages covered by the evdev[1] key codes but those symbols are not picked up in an vanilla X11 configuration on OpenBSD, according to setxkbmap(1). This should at least lower the barrier for adding scan codes for wanted keys. Note that the strings are discarded unless UCC_DEBUG is enabled. Thanks to gnezdo@ for testing. [1] xenocara/dist/xkeyboard-config/keycodes/evdev
2021-08-29Reduce the number of openings for aplns(4) to 1. This isn't correct butMark Kettenis
make NVMe on the Apple M1 stable. Hopefully we can figure out the real issue in the future. ok jmatthew@
2021-08-29Reduce the number of openings for aplns(4) to 1. This isn't correct butMark Kettenis
make NVMe on the Apple M1 stable. Hopefully we can figure out the real issue in the future. ok jmatthew@
2021-08-28Remove bogus code that tries to unmap GTT pages in a codepath that clearlyMark Kettenis
doesn't deal with non-GTT mappings. What the Linux code does here isn't possible on OpenBSD and probably unecessary. Seems to fix a crash reported by sthen@ ok jsg@
2021-08-27drm/amd/display: workaround for hard hang on HPD on native DPJonathan Gray
From Qingqing Zhuo 2e6cc93e1b8cf3ec2966961c1e98722ee7281023 in linux 5.10.y/5.10.61 c4152b297d56d3696ad0a9003169bc5b98ad7b72 in mainline linux
2021-08-27drm/amd/display: Fix Dynamic bpp issue with 8K30 with Navi 1XJonathan Gray
From Bing Guo dcc8c5fb8d8595f5061c7b000ca1d16449a5e865 in linux 5.10.y/5.10.61 06050a0f01dbac2ca33145ef19a72041206ea983 in mainline linux
2021-08-27drm/amdgpu: fix the doorbell missing when in CGPG issue for renoir.Jonathan Gray
From Yifan Zhang 7525f2e4de0069983497a9d3eab1ca9813ae1b4b in linux 5.10.y/5.10.61 1c0539a6fc8a4a4b77278e35d763073890de96b9 in mainline linux
2021-08-26Request wMaxInputLength bytes of data on each interrupt which shouldJoshua Stein
already account for the two-byte length and one-byte report id, rather than adding them ourself and requesting wMaxInputLength + 3. Fixes dwiic timeouts requesting data from at least one touchpad. Tested by various
2021-08-26Rename ucc_intr_to_usage() to ucc_bits_to_usage(), no functional change.Anton Lindqvist
2021-08-26Add missing leading colon to error message.Anton Lindqvist
2021-08-26There are some races in the hardware which thus require a few more triesKevin Lo
to get ownership. See Linux commit 501fd9895c1d7d8161ed56698ae2fccb10ef14f5 ok stsp@
2021-08-25Make all conversion routines consistent by returning a structAnton Lindqvist
ucc_keysym. No functional change.
2021-08-25Remove the KB_DEFAULT flag from the wskbd keymap layout. Presence ofAnton Lindqvist
this flag will cause wskbd to discard the given keymap layout and instead favor the layout of the associated wsmux. This is not a problem while attaching ucc(4) during boot as the wsmux uses the default layout at this point. However, if the layout is changed using /etc/kbdtype from rc(8) during boot, attaching ucc(4) at this point would cause wskbd_attach() to get stuck in an infinite loop: wskbdX: cannot load keymap, falling back to default ... which in turn is caused by ucc(4) only providing a us layout and using anything else in /etc/kbdtype would not work. I missed this as I don't use /etc/kbdtype but cwen@ and Mazzurco Riccardo <mazzurco dot riccardo at protonmail dot com> reported the same problem.
2021-08-25Prevent ucc(4) from matching report IDs with an empty input report.Anton Lindqvist
Fixes cwen@'s Creative BT-W3 audio device.
2021-08-25If the buffer given to the ucc interrupt handler is too long, do notAnton Lindqvist
discard it but instead just inspect the first bytes that can make up a usage. This is a work around as the correct solution is to only inspect a limited number of bits as given by the report count and size associated with the Consumer usage page. Final piece to get florian@'s Microsoft Sculpt keyboard working.
2021-08-25Determine if a hid item is an array by solely inspecting presence ofAnton Lindqvist
associated min/max boundaries. Assuming that every usage array starts with the Control usage is incorrect. Fixes claudio@'s GMMK keyboard and partial fix for florian@'s Microsoft Sculpt keyboard.