summaryrefslogtreecommitdiff
path: root/sys/dev/ic
AgeCommit message (Collapse)Author
2020-06-24kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha
time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of the value that is beingKenneth R Westerback
aassigned to adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of the value of adapter_buswidth toKenneth R Westerback
indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of -1 to indicateKenneth R Westerback
the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Nuke some pointless *_dev_probe() and *_dev_free() functions andKenneth R Westerback
set/trust the scsiconf.c probing limits. Same as was done to vioblk(4). ok dlg@
2020-06-22use ifiq_input and use it's return value to apply backpressure to rxrs.David Gwynne
this is a step toward deprecating softclock based livelock detection.
2020-06-19Add support for BCM4359 SDIO variants such as the AP6359SA module foundMark Kettenis
on the RockPro64 WiFi module. Note that there is no fiirmware for this chip in the bwfm-firmware package at the moment. ok patrick@
2020-06-19Whitespace.Kenneth R Westerback
2020-06-19Whitespace. Two short lines to one line.Kenneth R Westerback
2020-06-11Make use of hardware crypto for CCMP. The tricky bits had been lyingJonathan Matthew
dormant in the driver for years, we just needed to insert the IV before transmission and do packet number checks on received frames. tested by kevlo@ solene@ benno@ and me on a variety of hardware ok kevlo@ stsp@
2020-06-08update drm to linux 5.7Jonathan Gray
adds kernel support for amdgpu: vega20, raven2, renoir, navi10, navi14 inteldrm: icelake, tigerlake Thanks to the OpenBSD Foundation for sponsoring this work, kettenis@ for helping, patrick@ for helping adapt rockchip drm and many developers for testing.
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousTheo de Raadt
conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
2020-05-25change wsdisplay attribute type from long to uint32_tJonathan Gray
miod explained it was initially a long as it was thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. suggested and reviewed by miod@
2020-05-25rename wsdisplay alloc_attr() to pack_attr()Jonathan Gray
Suggested by John Carmack. miod agrees a rename would make sense and explained it was initially thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. ok mpi@
2020-05-23Fix typo in a comment that originated in wpi(4) and has spread elsewhere.Stefan Sperling
2020-05-17restore VGA fonts on VT switchJonathan Gray
Avoids an unusable screen when switching to a VT with a custom VGA font from X. While it is possible to modify the xserver to invoke an ioctl for this kettenis@ points out the xserver may have crashed so doing it in the kernel is preferred. Problem reported by and patch from John Carmack. Changed slightly to do the vga_restore_fonts() (write to video memory) call before vga_setfont() (pointing the character generator at it) at the suggestion of kettenis@. ok kettenis@
2020-05-16Don't attempt to reset the state of the flip-flop associated with theJonathan Gray
vga attribute controller index or set the enable/'palette address source' bit when saving and restoring 256 colour vga palette with 0x3c6-0x3c9 as this does not touch the attribute registers. When this code was ported from FreeBSD in vga.c rev 1.48 the flip-flop reset parts were mistakenly made to read 0x3ca instead of 0x3da. Fixes a problem with VirtualBox where the text mode background was a dim red colour instead of black after VT switch. Problem reported by and patch from John Carmack. ok matthieu@ who notes this also fixes a similiar problem with a KVM / virt-manager virtual machine.
2020-05-15Fix CCMP replay check with 11n Rx aggregation and CCMP hardware offloading.Stefan Sperling
So far, drivers using hardware CCMP decryption were expected to keep the most recently seen CCMP packet number (PN) up-to-date, and to discard frames with lower PNs as replays. A-MPDU subframes may legitimately arrive out of order, and the drivers skipped CCMP replay checking for such frames. Re-ordering happens in ieee80211_inputm(), after the driver is done with a frame. Drivers cannot tell replayed frames apart from legitimate out-of-order retransmissions. To fix this, update the PN value in ieee80211_inputm() after subframes have been reordered into their proper sequence. Drivers still perform replay checks but they no longer have to worry about updating the last seen PN value. The 802.11 spec confirms that replay checking is supposed to happen after A-MPDU re-ordering. Tested by jmc@, benno@, solene@, and myself with the following drivers: athn(4), iwn(4), iwm(4), wpi(4), urtwn(4) ok solene@
2020-05-15Some newer bwfm(4) chips from Cypress hold their regulatoryPatrick Wildt
constraints in a separate blob, instead of in the firmware. This .clm_blob needs to be loaded as well.
2020-04-30Fix use of uninitialized 'wh' variable in error path of ar5008_rx_process().Stefan Sperling
This fix simplifies HW decrytion error checking: Frame header contents aren't relevant because we are going to drop frames that had errors in any case. I made a mistake by trying to add an exception for multicast frames at this point. Frame header contents might not even be valid. This problem was introduced with CCMP hardware offload support and detected by Coverity (CID 1492755). ok mestre@ kevlo@
2020-04-29Add the 'nomimo' nwflag which disables MIMO in 11n mode.Stefan Sperling
This flag restricts a wireless driver to MCS0 - MCS7 for both transmission and reception. It can be set to work around packet loss in 11n mode caused by unused antenna connectors on a MIMO-capable wireless network device. man page tweak from tracey@ ok deraadt@
2020-04-28Configure Tx interrupt mitigation thresholds on athn(4) devices.Stefan Sperling
ok kevlo@ mpi@
2020-04-27Offload CCMP (WPA2) encryption and decryption to athn(4) hardware.Stefan Sperling
This reduces CPU load during traffic bursts, which is especially noticeable on boards with relatively slow CPUs such as Alix and APU. For reference, my rcc-ve boards (Intel Atom C2558) now forward ~2000pps between Ethernet and wifi with <= 1% CPU interrupt time according to systat. Beforehand, these boards became noticeably less responsive with fairly high interrupt and spin %. CCMP offload is used on both PCI and USB devices (thanks kevlo@ for catching my omission of USB devices in the first iteration of this change!) Tested by (at least) Kevin Chadwick, tracey@, kevlo@, kili@, Ted Patterson, David Dahlberg, and Scott Bennett. ok tracey@ kevlo@
2020-04-21Revert r1.207. Apparently mpi(4) on sparc64 blows up ifKenneth R Westerback
sc_link.openings is greater than 34. Encountered by Sigi Rudzio on his Blade 2500, who kindly did some testing to discover that the answer is 34, not 42. Nuke some whitespace on the way by.
2020-04-21Add bcmdmac, a driver for the DMA controller found on BCM283x SoCs.tobhe
Original work by Neil Ashford and dlg@ ok kettenis@
2020-04-20Add athn(4) definitions for the block-ack/block-ack-request control register.Stefan Sperling
Not used yet but may become useful later.
2020-04-19Add bcmmbox, a driver for the VideoCore messagebox interface on BCM283X.tobhe
Original work by Neil Ashford and dlg@ Feedback from jsg@ ok kettenis@, dlg@
2020-04-15wdsc(4), ncr53c9x: timestamp LUNs with time_uptime(9), not time_second(9)cheloha
Use a monotonic clock for timestamping LUNs to avoid problems when the UTC clock jumps. ok krw@
2020-04-14Add bse(4), a driver for the Broadcom GENET v5 network interface found onMark Kettenis
the Raspberry Pi4. ok patrick@
2020-04-06wi(4): tsleep(9) -> tsleep_nsec(9); ok stsp@cheloha
2020-03-21Simplify some goto'ing that jumps a single line orKenneth R Westerback
does nothing at all. The first one spotted as CID 1452976. Reads good to millert@ ok mpi@
2020-03-16Actually attach panel (if we have one).Mark Kettenis
ok patrick@
2020-03-16Replace video "framework" with a more generic port/endpoint "framework".Mark Kettenis
This also adds panel support to rkanxdp(4). Code to hook up simplepanel(4) is still missing and will come later. ok patrick@
2020-03-15sparc64 issue being identified and removed, reapply r1.73:Kenneth R Westerback
"Bump nvme(4) max physio() i/o size to 128K"
2020-03-15Revert nvme back to last working commit for sparc64.kmos
The coverity-related diff breaks sparc64's ability to read the disk. ok deraadt
2020-03-14ahci_get_pmp_ccb() returns a non-NULL pointer, fails aKenneth R Westerback
KASSERT(), or has already blown up by dereferencing the pointer. Two of the four invocations of ahci_get_pmp_ccb() check for NULL. Save a couple of bytes by not bothering. Add comments to the invocations to docuement the assumption.
2020-03-14Trailing whitespace, long lines, incorrect function names inKenneth R Westerback
printf()'s.
2020-03-13Recognize BCM43341 as a BCM43340 variant.Patrick Wildt
From Rob Schmersel
2020-03-13Bump nvme(4) max physio() i/o size to 128K.Kenneth R Westerback
2020-03-10Variables 'nowait' amd 'flags' should have died in 2008 with r1.36'sKenneth R Westerback
removal of internal queuing of scsi_xfer's. Put them out of their misery. Nuke an obsolete comment in passing. CID 1453357.
2020-03-10Coverity points out (12 + MAXMPS) can never be less thanKenneth R Westerback
12. PAGE_SHIFT is 12 (a.k.a. PAGE_SIZE == 4096) or more on OpenBSD architectures. So remove some dead code by unconditionally setting sc_mps (memory page size) to 1 << PAGE_SHIFT. CID 1491655. No functional change.
2020-03-10Ooops. Need both files.Kenneth R Westerback
sgl (scatter gather list) and prpl (physical region page list) are two different things in the NVMe world. Only the latter is currently implemented in nvme(4) so rename sc_max_sgl to sc_max_prpl to reflect this. No functional change.
2020-03-10sgl (scatter gather list) and prpl (physical region page list) are twoKenneth R Westerback
different things in the NVMe world. Only the latter is currently implemented in nvme(4) so rename sc_max_sgl to sc_max_prpl to reflect this. No functional change.
2020-03-09Update the console device always when attaching the real deviceYASUOKA Masahiko
driver. The information by the driver is supposed more reliable than the information which was set up earlier. ok patrick
2020-03-06Process the NVRAM in bwfm(4) itself. So far we have relied on somePatrick Wildt
external tool to pre-process the NVRAM, even though it's simple to do ourselves. This allows easier firmware distribution. ok kurt@
2020-03-04fix typo in previouscheloha
2020-03-04Restrict modes to those with an actually supported pixel clock.Mark Kettenis
ok patrick@
2020-03-02Shuffle logic a bit to make sizes/limits more obvious.Kenneth R Westerback
No functional change.
2020-03-02Add rkdwhdmi(4), a driver for the HDMI transmitter found on the RockchipMark Kettenis
RK3399 SoC. ok patrick@
2020-03-01Use ffs() on sc_mps, removing need for sc_mps_bits. Replace ffs(64)-1Kenneth R Westerback
and ffs(16)-1 with the constant results (i.e. 6 and 4). Add comments to clarify use of these constants. Net result, one less invocation of ffs(), softc smaller by one u_int, and less potential confusion over 'mps'. No functional change.