Commit Graph

4303 Commits

Author SHA1 Message Date
Matt Macy
b363d3d52a OpenZFS: Fix issues caused by reversed commits + rebase 2021-01-07 17:42:10 -08:00
Vladimir Kondratyev
d97d5c0ce8 hid: Import hidmap-based drivers written by Greg V
This change includes:

hpen    - Generic / MS Windows compatible HID pen tablet driver.
hgame   - Generic game controller and joystick driver.
xb360gp - Xbox360-compatible game controller driver.

Submitted by:	Greg V <greg_unrelenting.technology>
Reviewed by:	hselasky (as part of D27993)
2021-01-08 02:18:44 +03:00
Vladimir Kondratyev
afd590d9e5 hid: Import hidmap and bunch of drivers based on it
hidmap is a kernel module that maps HID input usages to evdev events.

Following dependent drivers is included in the commit:

hms       - HID mouse driver.
hcons     - Consumer page AKA Multimedia keys driver.
hsctrl    - System Controls page (Power/Sleep keys) driver.
ps4dshock - Sony DualShock 4 gamepad driver.

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27993
2021-01-08 02:18:44 +03:00
Vladimir Kondratyev
9be6b22da9 hidraw(4): Add HIDRAW_MAKE_UHID_ALIAS kernel option
which installs /dev/uhid# alias to hidraw character device for
compatibility with some existing uhid(4) users like Firefox.
As side effect it renames traditional uhid(4) driver to hidraw
to make possible using of common unit number allocator.

Requested by:	Greg V <greg_unrelenting.technology>
Reviewed by:	hselasky (as part of D27992)
2021-01-08 02:18:44 +03:00
Vladimir Kondratyev
9477390796 hid: Import hidraw(4) - driver for access to raw HID device data
This driver provides raw access to HID devices through uhid(4)-compatible
interface and is based on pre-8.x uhid(4) code. Unlike uhid(4) it does
not take devices in to monopoly ownership and allows parallel access
from other drivers.

hidraw supports Linux's hidraw-compatible interface as well.

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27992
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
b93f6bfca3 hid: Port ukbd to HID and attach to build
Reviewed by:	hselasky
Differential revision:  https://reviews.freebsd.org/D27991
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
cb022db825 hid: Port multitouch hmt(4) driver to hidbus and attach to build
Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27990
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
10fbbdfbbd hid: Import hconf(4) - digitizer configuration top-level collection support.
Reviewed by:	hselasky (as part of D27990)
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
01f2e864f7 hid: Import usbhid - USB transport backend for HID subsystem.
This change implements hid_if.m methods for HID-over-USB protocol [1].

Also, this change adds USBHID_ENABLED kernel option which changes
device_probe() priority and adds/removes PnP records to prefer usbhid
over ums, ukbd, wmt and other USB HID device drivers and vice-versa.

The module is based on uhid(4) driver.  It is disabled by default for
now due to conflicts with existing USB HID drivers.

[1] https://www.usb.org/sites/default/files/hid1_11.pdf

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27893
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
b1f1b07f6d hid: Import iichid - I2C transport backend for HID subsystem
This implements hid_if.m methods for HID-over-I2C protocol [1].

Following kernel options are added:

IICHID_SAMPLING - Enable support for a sampling mode as interrupt
                  resource acquisition is not always possible in a case
                  of GPIO interrupts.
IICHID_DEBUG    - Enable debug output.

The module is based on prior Marc Priggemeyer work (D16698).

[1] http://download.microsoft.com/download/7/d/d/7dd44bb7-2a7a-4505-ac1c-7227d3d96d5b/hid-over-i2c-protocol-spec-v1-0.docx

Differential revision:	https://reviews.freebsd.org/D27892
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
e49fa9f6f3 hid: Import quirk subsystem.
hidquirk(4) is derived from usb_quirk(4) and inherits all its HID-related
functionality. It does not support ioctl(2) interface yet.

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27890
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev
2b4464b0b1 hid: Import hidbus(4)
This driver provides support for multiple HID driver attachments
to single HID transport backend. This ability existed in Net/OpenBSD
(uhidev and ihidev drivers) but has never been ported to FreeBSD.
Unlike Net/OpenBSD we do not use report number alone to distinct report
source but we follow MS way and use a top level collection (TLC) usage
index that report belongs to as a location key.

The driver performs child device autodiscovery based on HID report
descriptor data, proxying of HID requests from child devices to parent
transport backends and broadcasting of interrupts in backward direction.

Differential revision:	https://reviews.freebsd.org/D27888
2021-01-08 02:18:42 +03:00
Vladimir Kondratyev
961a3535db hid: Import HID transport method definitions and helper functions.
Create an abstract HID interface that provides hardware independent
access to HID capabilities and functions through the device tree.

hid_if.m resembles existing USBHID KPI and consist of next methods:

HID method		USBHID variant
-----------------------------------------------------------------------
hid_intr_setup		usbd_transfer_setup	(INTERRUPT IN xfer)
hid_intr_unsetup	usbd_transfer_unsetup	(INTERRUPT IN xfer)
hid_intr_start		usbd_transfer_start	(INTERRUPT IN xfer)
hid_intr_stop		usbd_transfer_drain	(INTERRUPT IN xfer)
hid_intr_poll		usbd_transfer_poll	(INTERRUPT IN xfer)

hid_get_rdesc		usbd_req_get_report_descriptor
hid_read		No direct analog. Not intended for common use.
hid_write		uhid(4) write()
hid_get_report		usbd_req_get_report
hid_set_report		usbd_req_set_report
hid_set_idle		usbd_req_set_idle
hid_set_protocol	usbd_req_set_protocol

This change is part of D27888
2021-01-08 02:18:42 +03:00
Vladimir Kondratyev
1975878673 hid: Import functions and constants required by new subsystem
This does an import of quirk stubs, debugging macros from USB code and
numerous usage constants used by dependent drivers.

Besides, this change renames some functions to get a better matching
with userland library and NetBSD/OpenBSD HID code. Namely:

- Old hid_report_size() renamed to hid_report_size_max()
- New hid_report_size() calculates size of given report rather than
  maximum size of all reports.
- hid_get_data_unsigned() renamed to hid_get_udata()
- hid_put_data_unsigned() renamed to hid_put_udata()

Compat shim functions are provided in usbhid.h to make possible compile
of legacy code unmodified after this change.

Reviewed by:	manu, hselasky
Differential revision:	https://reviews.freebsd.org/D27887
2021-01-08 02:18:42 +03:00
Vladimir Kondratyev
67de2db262 Factor-out hardware-independent part of USB HID support to new module
It will be used by the upcoming HID-over-i2C implementation.  Should be
no-op, except hid.ko module dependency is to be added to affected drivers.

Reviewed by:	hselasky, manu
Differential revision:	https://reviews.freebsd.org/D27867
2021-01-08 02:18:42 +03:00
Mitchell Horne
40d0971bbe arm64: enable build of the ipmi module
Only ACPI attachment is supported for now, some others depend on the
presence of smbios(4) support, which we lack on arm64.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28009
2021-01-07 15:45:25 -04:00
Alfredo Dal'Ava Junior
4f250d9436 [POWERPC64LE] enable IPMI using OPAL bus
Enable build of IPMI over OPAL on powerpc64le

Reviewed by:	bdragon
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D27443
2020-12-30 22:55:53 -03:00
Ed Maste
ead01bfe86 Move cp(4) module enable to SOURCELESS_HOST
cp contains obfuscated code that runs on the host's processor
2020-12-28 19:36:51 -05:00
Ryan Libby
d021434a79 openzfs: fix gcc kernel module builds
- Suppress -Wredundant-decls.  Ultimately this warning is harmless in
   any case, and it does not look like there is a simple way to avoid
   redundant declarations in this case without a lot of header pollution
   (e.g. having openzfs's shim param.h pulling in sys/kernel.h for hz).
 - Suppress -Wnested-externs, which is useless anyway.

Unfortunately it was not sufficient just to modify OPENZFS_CFLAGS,
because the warning suppressions need to appear on the command line
after they are explicitly enabled by CWARNFLAGS from sys/conf/kern.mk,
but OPENZFS_CFLAGS get added before due to use of -I for the shims.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27685
2020-12-27 14:33:13 -08:00
Marius Strobl
e51ed06ae1 mlphy(4)/tlphy(4): Remove obsolete drivers
These drivers should have been removed along with tl(4) as part of
7c897ca91f and r347918 respectively
as these fromer made sure to only ever attach to the latter, e. g.:
<...>
static int
tlphy_probe(device_t dev)
{

	if (!mii_dev_mac_match(dev, "tl"))
		return (ENXIO);
<...>
2020-12-26 19:40:55 +01:00
Michal Meloun
b9cbd68d1c ARM: Enhance common Nvidia Tegra drivers by support for Tegra210 SoC.
MFC after:	4 weeks
2020-12-26 19:13:10 +01:00
Marius Strobl
b63eeef41f scc(4)/uart(4): Remove obsolete support for Siemens SAB 82532
It's no longer used since 58aa35d429
and r357455 respectively.
2020-12-26 13:48:06 +01:00
Mark Johnston
3b216bfb6c qatfw: Fix firmware autoloading for qat_c2xxx devices
r368193 was suppsed to rename the MOF firmware image, but the
qat_c2xxxfw makefile defined the two images in the wrong order so the
MMP image was renamed instead.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-12-23 11:36:45 -05:00
Vladimir Kondratyev
54d2dfc4b2 cyapa(4): Add support for evdev protocol
Tested-by:	Matthias Apitz <guru@unixarea.de>
MFC-after:	2 weeks
2020-12-23 11:10:49 +03:00
Nathan Whitehorn
6f968a331b Make non-debug kernels installable.
Setting DEBUG_FLAGS results in make installkernel trying to install debug
information that doesn't exist if the kernel was built without it.
2020-12-17 14:20:36 +00:00
Ryan Libby
ec5c07fcea zfs: quiet gcc -Wmissing-include-dirs
Don't tell it to look for headers in a non-existent directory.

Reviewed by:	imp, mmacy
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27565
2020-12-11 22:52:08 +00:00
Ryan Libby
75dd118247 if_wg: appease gcc
- remove -ferror-limit option
 - quiet -Wredundant-decls

Reviewed by:	mmacy
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27559
2020-12-11 22:52:03 +00:00
Brooks Davis
9ee99cec1f hme(4): Remove as previous announced
The hme (Happy Meal Ethernet) driver was the onboard NIC in most
supported sparc64 platforms. A few PCI NICs do exist, but we have seen
no evidence of use on non-sparc systems.

Reviewed by:	imp, emaste, bcr
Sponsored by:	DARPA
2020-12-11 21:40:38 +00:00
Nick Hibma
e8db04c389 New Netgraph module ng_macfilter:
Macfilter to route packets through different hooks based on sender MAC address.

Based on ng_macfilter written by Pekka Nikander

Sponsered by Retina b.v.

Reviewed by:	afedorov
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D27268
2020-12-08 15:09:42 +00:00
Eugene Grosbein
c0460cf2e4 if_em.ko: fix module build outside of kernel build environment
MFC after:	3 days
2020-12-06 17:44:28 +00:00
Tijl Coosemans
df4ca45cf9 Fix i386 linux module after r367395.
In r367395 parts of machine dependent linux_dummy.c were moved to a new
machine independent file sys/compat/linux/linux_dummy.c and the existing
linux_dummy.c was renamed to linux_dummy_machdep.c.

Add linux_dummy_machdep.c to the linux module for i386.
Rename sys/amd64/linux32/linux_dummy.c for consistency.
Add the new linux_dummy.c to the linux module for i386.
2020-12-05 14:53:24 +00:00
Michal Meloun
935b2ac1f1 Connect DTB files based on LX2160A SoC to build.
Mainly LX2K Honeycomb and ClearFog-CX boards.
2020-12-05 11:17:54 +00:00
Michal Meloun
54e82e612f Also build DTB files for Asus Tinker board (RK3288 based). 2020-12-05 10:00:39 +00:00
Mitchell Horne
22bd0c9731 ossl: port to arm64
Enable in-kernel acceleration of SHA1 and SHA2 operations on arm64 by adding
support for the ossl(4) crypto driver. This uses OpenSSL's assembly routines
under the hood, which will detect and use SHA intrinsics if they are
supported by the CPU.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27390
2020-12-04 21:12:17 +00:00
Mitchell Horne
fd86ae6800 ossl: split out x86 bits to x86/ossl_cpuid.c
Make room for adding arm64 support to this driver by moving the
x86-specific feature parsing to a separate file.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27388
2020-12-04 20:54:20 +00:00
Mark Johnston
7695ced633 qat: Fix firmware module autoloading
If firmware_get() fails to find a loaded firmware image, it searches for
candidate KLDs to load.  It will search for a KLD containing a module
with the same name as the requested image, and failing that, will load a
KLD with the same basename as the requested image.

The module name given by fw_stub.awk is simply "<mangled KLD name>_fw".

QAT firmware modules contain two images, neither of which match either
of the names used during lookup, so automatic loading of firmware images
after mountroot does not work.  Work around this by using the same
string for the first image name and for the KLD basename.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-11-30 20:53:25 +00:00
Matt Macy
2338da0373 Import kernel WireGuard support
Data path largely shared with the OpenBSD implementation by
Matt Dunwoodie <ncon@nconroy.net>

Reviewed by:	grehan@freebsd.org
MFC after:	1 month
Sponsored by:	Rubicon LLC, (Netgate)
Differential Revision:	https://reviews.freebsd.org/D26137
2020-11-29 19:38:03 +00:00
Poul-Henning Kamp
5667729fba Add watchdog(9) driver for the Fintek F81803 SuperIO chip 2020-11-28 22:34:33 +00:00
Ian Lepore
0ffeeb414f Convert the imx6_snvs RTC driver to access registers via the syscon device.
This is required for it to work correctly in the GENERIC kernel.
2020-11-25 19:10:20 +00:00
Emmanuel Vadot
78b8d3f136 dtb: allwinner: Add pineh64 to the build 2020-11-25 11:21:03 +00:00
Jung-uk Kim
926ce35a7e Port rtsx(4) driver for Realtek SD card reader from OpenBSD.
This driver provides support for Realtek PCI SD card readers.  It attaches
mmc(4) bus on card insertion and detaches it on card removal.  It has been
tested with RTS5209, RTS5227, RTS5229, RTS522A, RTS525A and RTL8411B.  It
should also work with RTS5249, RTL8402 and RTL8411.

PR:			204521
Submitted by:		Henri Hennebert (hlh at restart dot be)
Reviewed by:		imp, jkim
Differential Revision:	https://reviews.freebsd.org/D26435
2020-11-24 21:28:44 +00:00
Alexander Motin
1b760be482 Remove parallel SCSI and 1/2Gb FC support from isp(4).
This removes 288KB (36%) of the driver code and zillions of hacks and
workarounds, making single driver uniformly support several different
generations of hardware interfaces, not counting minor card variations.
After years of the hopeless fight, I don't think it worth to continue
support for hardware obsolete for 15-20 years.  Instead much cleaner
now code should allow to move forward toward better locking, multiple
queues and other cool features.

All the remaining Qlogic cards starting from 4Gb 24xx to 32Gb 27xx use
the same hardware/firmware interface with minor incremental improvements,
so it seems to be a good new starting point.  Except one PCI-X model all
all of them are PCIe and so still usable in modern systems.

Discussed with:	ken, scottl, jpaetzel, imp
Relnotes:	yes
2020-11-20 01:15:48 +00:00
Marcin Wojtas
0835cc783b Add SPDX license tag to the ENA driver files
Refering to guide: https://wiki.freebsd.org/SPDX the SPDX tag should not
replace the standard license text, however it should be added over the
standard license text to make the automation easier.

Because of that, the old license was kept, but the SPDX tag was added
on top of every ENA driver file.

Submited by:    Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27117
2020-11-18 15:07:34 +00:00
Hans Petter Selasky
db4df56365 Add missing header file when building the LinuxKPI module separately.
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-18 13:45:32 +00:00
Emmanuel Vadot
dab39c11af LinuxKPI: Implement ACPI bits required by drm-kmod in base system
It includes:

ACPI_HANDLE() implementation.
AC and VIDEO ACPI events notification support.
Replacement of hand-rolled GPLed _DSM method evaluation helpers
with in-base ones.

Submitted by:	wulf
Differential Revision:	https://reviews.freebsd.org/D26603
2020-11-09 13:20:14 +00:00
Navdeep Parhar
890efa1ab9 cxgbe(4): Update firmwares to 1.25.0.40.
This fixes a potential crash in firmware 1.25.0.0 on the passive open
side during TOE operation.

Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-11-06 19:04:20 +00:00
Conrad Meyer
e9b13c6612 linux(4): Deduplicate unimpl/dummy syscall handlers
No functional change.

Reviewed by:	emaste, trasz
Differential Revision:	https://reviews.freebsd.org/D27099
2020-11-05 19:30:31 +00:00
Leandro Lupori
68dd718256 [PowerPC] hwpmc: add support for POWER8/9 PMCs
This change adds support for POWER8 and POWER9 PMCs (bare metal and
pseries).
All PowerISA 2.07B non-random events are supported.

Implementation was based on that of PPC970.

Reviewed by:	jhibbits
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D26110
2020-11-05 16:36:39 +00:00
Mark Johnston
f078c492a9 Add firmware modules for qat(4)
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-11-05 16:00:30 +00:00
Mark Johnston
72143e89bb Add qat(4)
This provides an OpenCrypto driver for Intel QuickAssist devices.  The
driver was initially ported from NetBSD and comes with a few
improvements:
- support for GMAC/AES-GCM, AES-CTR and AES-XTS, and support for
  SHA/HMAC-authenticated encryption
- support for detaching the driver
- various bug fixes
- DH895X support

Discussed with:	jhb
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D26963
2020-11-05 15:55:23 +00:00