summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2021-11-09Add gpiokeys(4) for arm64Klemens Nanni
This driver handles events triggered by GPIO keys such as lid status and power button. OK kettenis
2021-11-09Sort gpio{leds,charger}Klemens Nanni
2021-11-09Add IPv4, TCP4/6 and UDP4/6 checksum offloading.Jan Klemkow
ok jmatthew@
2021-11-09The uhidevsubmatch() routine was imported from NetBSD back in 2002 along withAnton Lindqvist
the reportid locator. The same locator was removed in 2004 making the routine redundant. ok gnezdo@ mpi@
2021-11-08Use plen consistently.Tobias Heider
ok patrick@
2021-11-08remove reference to ieee80211_mira.c which has been sent to the AtticStefan Sperling
2021-11-08Send MiRA source files to the Attic.Stefan Sperling
These files were unhooked from the build in April 2021.
2021-11-08Plug uhidev memory leak during detach.Anton Lindqvist
Thanks to Damien Couderc <openbsd at petrocore dot eu> for testing and ok gnezdo@
2021-11-08whitespace tweak, no functional changeDavid Gwynne
2021-11-08whitespace tweaks, no functional change.David Gwynne
2021-11-08veb rules are an smr list, so traversal should be in an smr crit sectionDavid Gwynne
reported by stsp@ an earlier diff was tested by and ok stsp@ ok jmatthew@
2021-11-07net.inet6.icmp6.nd6_debug doesn't need to warn about RDNSS/DNSSL optionsStuart Henderson
ok phessler@
2021-11-07Fall back to label if function is missingKlemens Nanni
The "label" property is obsolete and "function" should be used, but devices like the Raspberry Pi 4b still use it. Detect LEDs on such machines: -gpioleds0 at mainbus0: no LEDs +gpioleds0 at mainbus0: "led0", "led1" OK patrick
2021-11-07Simplify print logicKlemens Nanni
OK patrick
2021-11-07Enable igc(4).Patrick Wildt
ok deraadt@
2021-11-07Constify struct cfattach, not struct cfdriver.Patrick Wildt
Fixes panic seen on the Pinebook Pro.
2021-11-07Fix handling of interrupts shared between multiple dwiic(4) devices.Stefan Sperling
Interrupt sharing did not work correctly when two dwiic(4) devices share an interrupt line. We ended up with an interrupt storm. One of the two interrupt handlers would see interrupt status bits set to zero but claim the interrupt regardless. The second handler would never get to run, and the interrupt condition on the second device was not cleared as a result. Fix this by returning zero from dwiic_intr() if the device's interrupt status bits read back as zero. The storm occurred as soon as X11 was started. xenodm(1) never managed to display its login prompt. Observed on the Thinkpad Helix2 which had been unable to start X since dwiic(4) started to attach on this machine in 2018. (I already saw the problem back then but never dug into it, and temporarily lost access to helix2 hardware for a long time.) With help from jcs@ who provided debugging hints already back in 2018. ok kettenis@
2021-11-07Fix tpyo of ecma. Reported by Matthew (chohag at jtan dot com)Claudio Jeker
2021-11-06Make `unp_msgcount' and `unp_file' atomic. Introduce `unp_rights_mtx'Vitaliy Makkoveev
mutex(9) to protect `unp_rights'. This removes global rwlock(9) from unp_internalize() and unp_externalize() normal paths and leaves it in the unp_externalize() error path only. Also we don't need to simultaneously hold fdplock() and `unp_lock' within unp_internalize(). The `unp_rights' can't be atomic. Otherwise the thread which exceeding the limit will break all other not-exceeding threads until it decrements `unp_rights'. That why the mutex(9) used for protection. It's safe to call fptounp() without `unp_lock' held. We always got this file descriptor by fd_getfile(9) so we always have the extra reference and this descriptor can't be closed by concurrent thread. Some sockets could be destroyed through 'PRU_ABORT' path but they don't have associated file descriptor and they are not accessible in the unp_internalize() path. The `unp_file' access without `unp_lock' held is also safe. Each socket could have the only associated file descriptor and each file descriptor could have the only associated socket. We only assign `unp_file' in the unp_internalize() path where we got the socket by fd_getfile(9). This descriptor has the extra reference and couldn't be closed concurrently. We could override `unp_file' but with the same address because the associated file descriptor can't be changed so the address will be also the same. While unp_gc() concurrently runs the dereference of non-NULL `unp_file' is always safe. Discussed with kettenis@ and mpi@. ok mpi@
2021-11-06Make kqread event filter MP-safeVisa Hankala
Use the monitored kqueue's kq_lock to serialize kqueue and knote access. Typically, the "object lock" would cover also the klist, but that is not possible with kqueues. knote_activate() needs kq_lock of the monitoring kqueue, which would create lock order troubles if kq_lock was held when calling KNOTE(&kq->kq_sel.si_note). Avoid this by using a separate klist lock for kqueues. The new klist lock is system-wide. Each kqueue instance could have a dedicated klist lock. However, the efficacy of dedicated versus system-wide lock is somewhat limited because the current implementation activates kqueue knotes through a single thread. OK mpi@
2021-11-06Allocate socket and initialize so_lock in one placeVisa Hankala
This makes witness(4) use a single lock type for tracking so_lock. Previously, so_lock was covered by two distinct lock types because there were separate rw_init() initializers in socreate() and sonewconn(). OK kettenis@
2021-11-05Newer i.MX device trees store the skew information in the PHY's node, whichPatrick Wildt
we can access through the phy-handle. If there's no reference, keep doing what we have been doing so far. ok kettenis@
2021-11-05Constify struct cfattach.Martin Pieuchot
2021-11-05Newer i.MX device trees retriee the USB phy using the more generic propertyPatrick Wildt
name "phys". To handle those, make sure that we look it up and in case it's not there fall back to "fsl,usbphy". ok kettenis@
2021-11-04The authenticator is removed elsewhere.Tobias Heider
ok patrick@
2021-11-04revert rev 1.30 of ttm_bo_util.cJonathan Gray
Laurence Tratt reported firefox would hard lock a machine with polaris12 with the ttm change from linux 5.10.77. robert@ also hit the same problem.
2021-11-03In addition to the WEP key(s) being set at device initialization withKenneth R Westerback
'nwid'/'nwkey', the keys will be set at random times when 'join'/'nwkey' is used. So also stop trying to set IEEE80211_CIPHER_NONE keys on that path. James Hastings confirms this fixes his '(null node)' panics on run(4). Thanks! ok stsp@
2021-11-03drm/amdgpu: fix out of bounds writeJonathan Gray
From Thelford Williams eb3b6805e3e9d98b2507201fd061a231988ce623 in linux 5.10.y/5.10.77 5afa7898ab7a0ec9c28556a91df714bf3c2f725e in mainline linux
2021-11-03drm/ttm: fix memleak in ttm_transfered_destroyJonathan Gray
From Christian Koenig c21b4002214c1c7e7b627b9b53375612f7aab6db in linux 5.10.y/5.10.77 0db55f9a1bafbe3dac750ea669de9134922389b5 in mainline linux
2021-11-02Remove trailing whitespaceMike Larkin
2021-11-02Enable spleen16x32 and spleen32x64 on powerpc64 for GENERIC kernels.Frederic Cambus
Pointed out by Brad, thanks! OK kettenis@, deraadt@
2021-11-02Recognize BCM43436, as seen on the Raspberry Pi Zero 2 W.Patrick Wildt
ok jsg@
2021-11-02add handling for parity and character size config.David Gwynne
i wanted to talk modbus to a thing using a uchcom rs485 adapter, but i needed even parity enabled to do that which the code didnt support. this pulls in the necessary changes from netbsd uchcom.c r1.26. it does not pull in the reset changes in 1.26 because netbsd r1.28 reverts the reset code back to what we have now. existing functionality tested by felix kronlage-dammers ok patrick@
2021-11-02Enable igc(4).Patrick Wildt
Tested by kevlo@
2021-11-02knfTheo de Raadt
2021-11-01Remove backwards compat code.Mark Kettenis
2021-11-01Catch up with the Linux device tree bindings. Put the USB DARTs into bypassMark Kettenis
mode for now as we need to enter translations into both of them which is hard to do now that they have separate device tree bindings.
2021-11-01Enable spleen16x32 and spleen32x64 on riscv64 for GENERIC kernels.Frederic Cambus
OK deraadt@
2021-11-01Ignore obj like in srcKlemens Nanni
sys/ only checkouts are common, especiall in got(1) times, but they don't include the global .gitignore which is annoying. Duplicate it here. OK sthen
2021-11-01Add CRC-16 implementation. From NetBSD.Mark Kettenis
ok krw@, deraadt@
2021-11-01Restore some NULL checks lost in r1.132, add a couple more to deal with WEP keyKenneth R Westerback
installation happening w/o a node, and don't attempt to set WEP keys that don't exist. Should fix the '(null node)' panics reported by James Hastings. ok stsp@
2021-11-01In ipsec_common_input_cb() pass mbuf pointer to pf_test() so thatAlexander Bluhm
all callers get an update if the mbuf changes. OK tobhe@
2021-11-01Add support for the keyboard/touchpad on Apple M1 laptops.Mark Kettenis
ok patrick@
2021-11-01use hw_power to implement power_supply_is_system_supplied()Jonathan Gray
2021-10-31Add aplspi(4), a driver for the SPI controller found on the Apple M1 SoC.Mark Kettenis
ok patrick@
2021-10-31Disable both TCP/UDP checksum offloading and VLAN HW tag offloading for now,Patrick Wildt
as we currently configure neither in the transmit code path. Found by sf@
2021-10-31Implement transmit and transmit completion path.Patrick Wildt
2021-10-31Extend the SPI bus API a bit. The config structure gets an sc_cs_delayMark Kettenis
member to allow us to specify a delay between assert the CS# signal and starting the clock. And the transfer function gains a flags argument, which can be used to specify a new SPI_KEEP_CS flag to keep CS# asserted after the transfer. This allows us to do another transfer immediately afterwards without de-asserting CS# which is necessary for sending commands to the upcoming Apple M1 keyboard/touchpad driver. ok patrick@
2021-10-31Move the fill and the tail pointer change to a later point, to make surePatrick Wildt
that the RDT is written, and that it is written not too early. Doing it before writing IGC_RXDCTL definitely doesn't work. The tail pointer needs to be set to the next empty slot, so it has to be "last desc filled + 1". Make sure sure that the rss mapping does not happen in the middle of the RX checksum block, and that it happens only if nqueues > 1. Also disable storing bad packets. With this, igc(4) receives packets just fine. ok kevlo@
2021-10-31Add igc(4), a driver for the Intel 2.5Gb Ethernet controllers.Patrick Wildt
Ported by kevlo@ ok jmatthew@