Commit graph

39347 commits

Author SHA1 Message Date
Elyes HAOUAS
27fceea98c Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
(cherry picked from commit 9097ac9af4)
2021-12-06 08:55:55 -07:00
Colin Percival
d03a8d181c randomdev: Remove 100 ms sleep from write routine
This was introduced in 2014 along with the comment (which has since
been deleted):
	/* Introduce an annoying delay to stop swamping */

Modern cryptographic random number generators can ingest arbitrarily
large amounts of non-random (or even maliciously selected) input
without losing their security.

Depending on the number of "boot entropy files" present on the system,
this can speed up the boot process by up to 1 second.

Reviewed by:	cem
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D32984

(cherry picked from commit 1580afcd6e)
2021-12-05 10:27:01 -08:00
Gordon Bergling
8460767ded mlx5: Correct a typo in a sysctl description
- s/parameteres/parameters/

(cherry picked from commit c937fb286f)
2021-12-05 10:08:07 +01:00
Gordon Bergling
abc50fc549 bce(4): Fix a typo in a sysctl description
- s/duirng/during/

(cherry picked from commit 25d0ccbe10)
2021-12-05 10:07:52 +01:00
Gordon Bergling
f51048b535 if_hn: Fix a few typos in comments and a sysctl description
- s/segement/segment/

(cherry picked from commit b15a632c41)
2021-12-03 16:54:11 +01:00
Gordon Bergling
d4c648f779 xen(4): Fix two typos in source code comments
- s/segement/segment/

(cherry picked from commit e3080a9cca)
2021-12-03 16:52:44 +01:00
Gordon Bergling
3f9dc7b20b mpr(4): Fix a typo in a source code comment
- s/segement/segment/

(cherry picked from commit ddeb702f7b)
2021-12-03 16:52:17 +01:00
Gordon Bergling
022814e08b nvme(4): Correct a typo in a sysctl description
- s/printting/printing/

(cherry picked from commit 5f8ccf6515)
2021-12-03 16:51:46 +01:00
Andriy Gapon
a138038f69 twsi: compile in support for debug messages, disabled by default
Debug messages can now be enabled per driver instance via a new sysctl.
Also, debug messages in TWSI_READ and TWSI_WRITE require debug level
greater than 1 as they are mostly redundant because callers of those
functions already log most interesting results.

NB: the twsi drivers call their device iichb, so the new sysctl will
appear under dev.iichb.N.

(cherry picked from commit a2793d6182)
2021-12-03 09:24:22 +02:00
Andriy Gapon
c141cad41d twsi: remove write-only softc field
(cherry picked from commit f00bc54f62)
2021-12-03 09:24:11 +02:00
Andriy Gapon
3b7478a7c4 twsi: add more of status definitions
For completeness and for future use.

(cherry picked from commit de86f339cd)
2021-12-03 09:23:58 +02:00
Andriy Gapon
bab53d3532 twsi: sort headers, remove unneeded
(cherry picked from commit 26559dd177)
2021-12-03 09:21:36 +02:00
Hans Petter Selasky
9e89269ee7 usb/u3g: Add support for Quectel EM05.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/565
Sponsored by:	NVIDIA Networking

(cherry picked from commit 0229172a65)
2021-12-02 15:51:46 +01:00
Mark Johnston
aa5664c0f5 safexcel: Fix -Wunused-but-set-variable warnings
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 60c95f3163)
2021-12-01 07:40:49 -05:00
John Baldwin
1097f2f40d evdev: Add parentheses around '-' expression in operand of '&'.
This fixes a -Wparentheses error with GCC 9.

Reviewed by:	wulf
Differential Revision:	https://reviews.freebsd.org/D31947

(cherry picked from commit d99c87c8d5)
2021-12-01 00:45:30 +03:00
Wei Hu
d11e9de955 Hyper-V: vPCI: Prepopulate device bars
In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weird problems cuasing PCI code failure when configuring
bars.

Just write all 1's to those bars whose probed values are not the same
as current read ones. This seems to make Hyper-V vPCI and
pci_write_bar() to cooperate correctly on these releases.

Reported by:	khng@freebsd.org
Tested by:	khng@freebsd.org
MFC after:	2 weeks
Sponsored by:	Microsoft

(cherry picked from commit 75412a521f)
2021-11-30 07:43:32 +00:00
Gordon Bergling
18e627e9c7 ppbus(4): Fix a typo in source code comment
- s/quering/querying/

Obtained from:	NetBSD

(cherry picked from commit 975e2e3f84)
2021-11-28 12:43:11 +01:00
Gordon Bergling
7125ea0f15 firewire(4): Fix a typo in a source code comment
- s/unavailabe/unavailable/

(cherry picked from commit 3e5ddef0fd)
2021-11-28 12:42:33 +01:00
Gordon Bergling
f9236943e1 ixl(4): Fix a typo in a sysctl description
(cherry picked from commit d7125850f0)
2021-11-28 12:42:14 +01:00
Gordon Bergling
197f36e000 iscsi(4): Fix a typo in a source code comment
- s/conditon/condition/

(cherry picked from commit 5e21882bb4)
2021-11-28 12:41:52 +01:00
Andriy Gapon
f537b30564 icee: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 01e3492337)
2021-11-27 10:47:25 +02:00
Andriy Gapon
83f68b84c2 ds1307: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 27645265c4)
2021-11-27 10:44:16 +02:00
Alfredo Dal'Ava Junior
c41d129485 ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)
On recent OpenBMC firmware, the onboard ASMEDIA video card framebuffer
address was removed from device tree for security purposes (value is set
to zero to avoid leaking the address).

This patch works around the problem by taking framebuffer base address
from the "ranges" property of a parent node.

Reviewed by:	luporl, jhibbits (on IRC)
MFC after:	2 weeks
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D30626

(cherry picked from commit b042d10cdc)
2021-11-26 20:50:55 -03:00
Ed Maste
c433c96d86 Update deprecation version for drivers removed in main
Removal of the amr, esp, iir, mly and twa drivers was planned before
FreeBSD 13, but did not happen before the branch.  Update the
depreciation notices to indicate that they are gone in FreeBSD 14.

Sponsored by:	The FreeBSD Foundation
2021-11-25 11:54:12 -05:00
Ka Ho Ng
35f26bdf59 iser: Remove redundant linuxkpi MODULE_DEPEND
Since ibcore depends on linuxkpi, there is no need to pull in the
linuxkpi dependency in iser.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	trasz
Differential Revision:	https://reviews.freebsd.org/D32977

(cherry picked from commit f7523c8a19)
2021-11-24 15:17:26 -05:00
Andriy Gapon
f1d2f22b34 pca954x: driver for PCA954x / TCA954x I2C switches
At the moment only PCA9548A is supported and has been tested.

(cherry picked from commit c0525ab1d1)
2021-11-24 16:19:09 +02:00
John Baldwin
d8feb950a6 Move the ICL_CONN_*LOCK* macros to <dev/iscsi/icl.h>.
These macros are not backend-specific but reference a
backend-independent field in struct icl_conn.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32858

(cherry picked from commit e900338c09)
2021-11-23 15:11:53 -08:00
John Baldwin
412a8b92d9 Further refine the ExpDataSN checks for SCSI Response PDUs.
According to 11.4.8 in RFC 7143, ExpDataSN MUST be 0 if the response
code is not Command Completed, but we were requiring it to always be
the count of DataIn PDUs regardless of the response code.

In addition, at least one target (OCI Oracle iSCSI block device)
returns an ExpDataSN of 0 when returning a valid completion with an
error status (Check Condition) in response to a SCSI Inquiry.  As a
workaround for this target, only warn without resetting the connection
for a 0 ExpDataSN for responses with a non-zero error status.

PR:		259152
Reported by:	dch
Reviewed by:	dch, mav, emaste
Fixes:		4f0f5bf995 iscsi: Validate DataSN values in Data-In PDUs in the initiator.
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32650

(cherry picked from commit cdbc4a074b)
2021-11-23 15:11:44 -08:00
John Baldwin
9811763b41 iscsi: Validate DataSN values in Data-In PDUs in the initiator.
As is done in the target, require that DataSN values are consecutive
and in-order.  If an out of order Data-In PDU is received, force a
session reconnect.  In addition, when a SCSI Response PDU is received,
verify that the ExpDataSN field matches the count of Data-In PDUs
received for this command.  If not, force a session reconnect.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D31594

(cherry picked from commit 4f0f5bf995)
2021-11-23 15:11:44 -08:00
John Baldwin
ff590791ff cxgbe: Only run ktls_tick when NIC TLS is enabled.
Previously the body of ktls_tick was a nop when NIC TLS was disabled,
but the callout was still scheduled consuming power on otherwise-idle
systems with Chelsio T6 adapters.  Now the callout only runs while NIC
TLS is enabled on at least one interface of an adapter.

Reported by:	mav
Reviewed by:	np, mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32491

(cherry picked from commit ef3f98ae47)
2021-11-23 15:11:43 -08:00
Mark Johnston
200d473202 hyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISOR
This reverts commit 9ef7df022a ("hyperv: Register hyperv_timecounter
later during boot") and adds a comment explaining why the timecounter
needs to be registered as early as it is.

PR:		259878
Fixes:	9ef7df022a ("hyperv: Register hyperv_timecounter later during boot")
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ed6a9452be)
2021-11-22 08:45:34 -05:00
Andriy Gapon
ee82e15cd9 pcf8574: driver for 8-pin quasi-bidirectional GPIO over I2C
(cherry picked from commit 6354154ef5)
2021-11-21 11:59:34 +02:00
Warner Losh
706f4f705b vt: fix git mismerge
I made a mistaking in merging the final commits for the devctl changes. This
adds the 'hushed' variable and has the correct dates for the manuals.

Pointy hat to: imp

(cherry picked from commit 80f21bb039)
2021-11-18 22:10:07 -07:00
Warner Losh
a82d7aeb3f vt: Add devctl message for bells
Generate VT events when the bell beeps. When coupled with disabling the
bell,this allows custom bells to be rung when we'd otherwise beep.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D32656

(cherry picked from commit 4ac3d08a96)
2021-11-18 21:52:22 -07:00
Warner Losh
534fb4b8ae vt(4): Connect to teken's TP_SETBELLPD
Add the glue needed to listen to TP_SETBELLPD which teken uses to
inform its client drivers about the results of parsing
\e[=<pitch>;<duration>B. It converts these to a Hz value for the
tone/pitch of the bell and a duration in ms. There's some loss of
precision because <pitch> in the escape seuquence is defined to be
(1193182 / pitch) Hz and <duration> is in 10ms units. Also note that
kbdcontrol also parses 'off' but then doesn't send the proper escape
sequence, leading me to wonder if that's another bug since teken
appears to parse that sequence properly and I've added code here to
treat that as the same as quiet or disabled.

In general, Hz from 100 to 2000 is good. Outside that range is possible,
but even at 100Hz the square wave is starting to sound bad and above
2000Hz the speaker may not respond.

Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D32620

(cherry picked from commit 2533eca1c2)
2021-11-18 21:52:22 -07:00
Warner Losh
87586bff11 sysbeep: Adjust interface to take a duration as a sbt
Change the 'period' argument to 'duration' and change its type to
sbintime_t so we can more easily express different durations.

Reviewed by:	tsoome, glebius
Differential Revision:	https://reviews.freebsd.org/D32619

(cherry picked from commit 072d5b98c4)
2021-11-18 21:52:22 -07:00
Bjoern A. Zeeb
54aa95f082 mii: update URL for OUIs
Update the URL for OUIs as the old one is 404 not even 301 anymore.

(cherry picked from commit 8e902c1d21)
2021-11-19 00:01:27 +00:00
Dmitry Salychev
151d59e386 Parse named nodes from IORT ACPI on arm64
Add the ability to map named components from IORT to their
SMMU or ITS node in order to setup interrupts.
It is now possible to find a node by its name (substring) and
resource ID similar to PCI nodes.
This is needed by work on a driver for NXP's Second Generation
Data Path Acceleration Architecture (DPAA2).

Reviewed by:	andrew

(cherry picked from commit d178b1f878)
2021-11-19 00:01:27 +00:00
Bjoern A. Zeeb
378083e188 mlx4: rename conflicting netdev_priv() to mlx4_netdev_priv()
netdev_priv() is a LinuxKPI function which was used with the old ifnet
linux/netdevice.h implementation which was not adaptable to modern
Linux drviers unless rewriting them for ifnet in first place which
defeats the purpose.
Rename the netdev_priv() calls in mlx4 to mlx4_netdev_priv()
returning the ifnet softc to avoid conflicting symbol names
with different implementations in the future.

(cherry picked from commit 9d593d5a76)
2021-11-19 00:01:26 +00:00
Bjoern A. Zeeb
6acb9d5f95 net80211/drivers: improve ieee80211_rx_stats for band
While IEEE80211_R_BAND was defined, there was no place to store the
band.  Add a field for that, adjust ieee80211_lookup_channel_rxstatus()
to require it, and update drivers passing "R_{FREQ|IEEE}" in already to
provide the band as well.  For the moment keep the fall-back code
requiring all three fields.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9a6695532b)
2021-11-19 00:01:25 +00:00
Hans Petter Selasky
7d95b0f328 snd_uaudio(4): Fix string index computations for iFeature.
This allows the iFeature strings to be properly read by the snd_uaudio(4) driver,
when parsing the audio feature unit descriptors.

Submitted by:	Zhichao1.Li@dell.com
Sponsored by:	NVIDIA Networking

(cherry picked from commit 11f09b17fe)
2021-11-16 09:09:09 +01:00
Mark Johnston
ab9866cc79 pci: Implement pci_bar_enabled() for SR-IOV VFs
In a VF's configuration space, "memory space enable" is hard-wired to 0,
so the existing implementation always returns false.  We need to read
the SR-IOV control register from the PF device to get the value of the
MSE bit.

Fix pci_bar_enabled() to read this register instead for VFs.  I don't
see any way to access the PF's config space without a backpointer in the
pci device ivars, so I added one.

This fixes a regression where bhyve(8) fails to map the MSI-X table
after commit 7fa2335347 ("bhyve: Map the MSI-X table unconditionally
for passthrough") when a VF is passed through, since with that commit we
use PCIOCBARMMAP to map the table and that ioctl always fails for VFs
without this change.  As a bonus, pciconf(8) now correctly reports the
enablement of BARs for VFs.

Reported and tested by:	Raúl Muñoz <raul.munoz@custos.es>
Reviewed by:	rstone, jhb
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1f960e646b)
2021-11-15 13:11:52 -05:00
Mitchell Horne
5c2e6d9610 hwpmc: initialize arm64 counter/interrupt state
Performance counters and overflow interrupts are assumed to be disabled
by default, but this is not guaranteed. Ensure we disable both during
per-cpu initialization, before enabling the PMU. Otherwise, some systems
(such as the Ampere eMAG) would experience an interrupt storm upon
loading the hwpmc module.

Reviewed by:	br
MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32854

(cherry picked from commit b826cc3caf)
2021-11-15 11:13:50 -04:00
Andriy Gapon
7785ea3373 gpioled: allow the driver to be disabled via fdt
(cherry picked from commit 832503063e)
2021-11-13 11:12:36 +02:00
Andriy Gapon
8f57430de1 driver for MAX44009 I2C illuminance sensor
(cherry picked from commit ff6fe29835)
2021-11-13 11:12:05 +02:00
Andriy Gapon
d6f71e09a7 pcf8591: driver for adc/dac with i2c interface
(cherry picked from commit a60b304697)
2021-11-13 11:10:44 +02:00
Andriy Gapon
737ed8b99f htu21: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit a75159eabc)
2021-11-13 11:04:29 +02:00
Andriy Gapon
c9882d7600 htu21: don't needlessly bother hardware when measurements are not needed
sysctl(8) first queries a sysctl to get a size of its value even if the
sysctl is of a fixed size, e.g. it has an integer type.
Only after that sysctl(8) queries an actual value of the sysctl.

Previosuly the driver would needlessly read a sensor in the first step.

(cherry picked from commit 43b031a371)
2021-11-13 10:59:33 +02:00
Alexander Motin
1e5dc6aa18 Add some of Intel Alder Lake device IDs.
MFC after:	1 week

(cherry picked from commit dc238358f9)
2021-11-12 23:02:46 -05:00
Peter Grehan
37bfb1c965 igc: Use hardware routine for PHY reset
Summary:
The previously used software reset routine wasn't sufficient
to reset the PHY if the	bootloader hadn't left the device in
an initialized state. This was seen with the onboard igc port
on an 11th-gen Intel NUC.

The software reset isn't used in the Linux driver so all related
code has been removed.

Tested on: Netgate 6100 onboard ports, a discrete PCIe I225-LM card,
and an 11th-gen Intel NUC.

Reported by:	woodsb02
Tested by:	woodsb02 (NUC)
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 561cd74b17)
2021-11-13 06:45:41 +10:00