Commit Graph

39343 Commits

Author SHA1 Message Date
Vladimir Kondratyev
250ab00407 wsp(4): Compact parameter structure.
MFC after:	2 weeks
2021-08-25 01:59:48 +03:00
Vladimir Kondratyev
9fa1201d60 atp(4), wsp(4): Return correct priority from probe() method;
MFC after:	2 weeks
2021-08-25 01:59:17 +03:00
Vladimir Kondratyev
d056693d7b evdev: Add support for automatic MT protocol type A to type B conversion.
MFC after:	2 weeks
2021-08-25 01:53:56 +03:00
Vladimir Kondratyev
f76051c7da evdev: Add implicit mode for touch tracking.
In implicit mode assignment of slot number and tracking id is performed
automatically on each synchronization requested by device driver.

This is done with creation of intermediate buffer for multitouch events.
This buffer holds untracked events until synchronization is requested by
device driver. It is needed as touch assigment requires
knowledges of all touch positions pushed in current and previous reports.

MFC after:	2 weeks
2021-08-25 01:52:37 +03:00
Vladimir Kondratyev
4c0a134e32 evdev: Import support for touch-tracking.
Touch tracking is a process of assignment of unique trackingID to each
initiated contact on the surface.  Keeping the trackingIDs persistent
across multitouch reports requires solving of so called Euclidian
Bipartite Matching problem.

This commit imports EBM-solver implementation based on Dinitz-Kronrod
algorithm to find minimum cost matching between contacts listed in two
consecutive reports.

Obtained from:	OpenBSD
MFC after:	2 weeks
2021-08-25 01:50:53 +03:00
Vladimir Kondratyev
66bd52f5e2 evdev: Make MT tracking IDs monotonically increasing sequence.
MFC after:	2 weeks
2021-08-25 01:48:33 +03:00
Vladimir Kondratyev
059360287e evdev: Give short aliases to items of evdev_mt_slot array
with using of unioned anonymous structure.

Access to the same data by using different members of union generally
works despite it is not supported by C specs.

Also add helper function to report entire slot state.

MFC after:	2 weeks
2021-08-25 01:47:34 +03:00
Vladimir Kondratyev
127e54deb6 evdev: Normalize width and pressure of single touch compat events
to match Synaptics touchpad reporting range.

MFC after:	2 weeks
2021-08-25 01:46:49 +03:00
Vladimir Kondratyev
314913ed7c evdev: force no fuzz for autogenerated single touch compat events.
As fuzz has already been applied on multitouch event processing.
This allows to remove existing workaround for double fuzz procesing.

MFC after:	2 weeks
2021-08-25 01:45:50 +03:00
Vladimir Kondratyev
fbe17f9017 evdev: Send first active rather than 0-th slot state as ST report
MFC after:	2 weeks
2021-08-25 01:45:16 +03:00
Vladimir Kondratyev
2dc7188e53 evdev: Use bitsets to track active touches and slots changed in current report
Obtained from:	OpenBSD

MFC after: 	2 weeks
2021-08-25 01:44:36 +03:00
Vladimir Kondratyev
98a7606b85 evdev: Multitouch code style changes.
1. Move touch count reporting helpers to utils. They are not multitouch.
2. Use evdev_mt prefix for private multitouch support routines.
3. Use int instead of int32_t where fixed size is not required.
4. Export some internal functions.

This change should be no-op.

MFC after:	2 weeks
2021-08-25 01:43:41 +03:00
John Baldwin
4f0f5bf995 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
2021-08-24 14:58:34 -07:00
Kevin Bowling
5de5419b5e ixgbe: Avoid sbuf_trim(9) in sysctl handler
This was an error, we cannot use sbuf_trim(9) in the
ixgbe_sbuf_fw_version function because it also gets called in
the context of sbuf_new_for_sysctl(9). sbuf(9) explains the interaction
with drain functions as used by sbuf_new_for_sysctl(9).

Reviewed by:	imp
Fixes:		7660e4ea5c
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D31633
2021-08-23 10:28:59 -07:00
Zhenlei Huang
62e1a437f3 routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549).
Implement kernel support for RFC 5549/8950.

* Relax control plane restrictions and allow specifying IPv6 gateways
 for IPv4 routes. This behavior is controlled by the
 net.route.rib_route_ipv6_nexthop sysctl (on by default).

* Always pass final destination in ro->ro_dst in ip_forward().

* Use ro->ro_dst to exract packet family inside if_output() routines.
 Consistently use RO_GET_FAMILY() macro to handle ro=NULL case.

* Pass extracted family to nd6_resolve() to get the LLE with proper encap.
 It leverages recent lltable changes committed in c541bd368f.

Presence of the functionality can be checked using ipv4_rfc5549_support feature(3).
Example usage:
  route add -net 192.0.0.0/24 -inet6 fe80::5054:ff:fe14:e319%vtnet0

Differential Revision: https://reviews.freebsd.org/D30398
MFC after:	2 weeks
2021-08-22 22:56:08 +00:00
Vincenzo Maffione
98399ab06f netmap: import changes from upstream
- make sure rings are disabled during resets
 - introduce netmap_update_hostrings_mode(), with support
   for multiple host rings
 - always initialize ni_bufs_head in netmap_if
      ni_bufs_head was not properly initialized when no external buffers were
      requestedx and contained the ni_bufs_head from the last request. This
      was causing spurious buffer frees when alternating between apps that
      used external buffers and apps that did not use them.
 - check na validitity under lock on detach
 - netmap_mem: fix leak on error path
 - nm_dispatch: fix compilation on Raspberry Pi

MFC after:	2 weeks
2021-08-22 09:31:05 +00:00
Krzysztof Galazka
c4622b01d2
ixl(4): Fix reporting of unqualified transceivers
When link_active_on_if_down flag is disabled and link is brought down
with ifconfig, FW reports a false positive link event about an
unqualified transceiver. The condition used in the driver to filter out
those false positive events was incorrect and caused that unqualified
module event to also not be reported when the event was valid.

Change the condition to rely on IFF_UP flag instead of
link_active_on_if_down and bump driver version to 2.3.1-k.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	stallamr@netapp.com, erj@
Tested by:	gowtham.kumar.ks@intel.com
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D30733
2021-08-20 14:44:32 -07:00
Kevin Bowling
0e5811a2a9 intel ethernet: Use ether_gen_addr(9)
Use ether_gen_addr(9) for VF MAC generation

Reviewed by:	Intel Networking (erj), kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31616
2021-08-20 14:21:48 -07:00
Alexander Motin
9781c28c6d mpr(4): Fix unmatched devq release.
Before this change devq was frozen only if some command was sent to
the target after reset started, but release was called always.  This
change freezes the devq immediately, leaving mprsas_action_scsiio()
check only to cover race condition due to different lock devq use.

This should also avoid unnecessary requeue of the commands, creating
additional log noise and confusing some broken apps.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2021-08-20 14:51:12 -04:00
Wei Hu
f12b1b8b47 Remove unused function mana_reset_counters.
This fixes the build warning caused by this function.
Reported by:	markj
Tested by:	whu
MFC after:	2 weeks
Sponsored by:	Microsoft
2021-08-20 16:05:40 +00:00
Hans Petter Selasky
ec97e9ca1f Fully revert f83f5d5839 for the sys/dev/usb/serial
folder, only keeping the zero length packet API introduced in sys/dev/usb
after more reports of USB serial devices not supporting ZLPs.

Reported by:	mav@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-08-20 18:00:42 +02:00
Alexander Motin
e3c5965c25 mpr(4): Handle mprsas_alloc_tm() errors on device removal.
SAS9305-16e with firmware 16.00.01.00 report HighPriorityCredit of
only 8, while for comparison some other combinations I have report
100 or even 128.  In case of large JBOD detach requirement to send
target reset command to each target same time overflows the limit,
and without adequate handling makes devices stuck in half-detached
state, preventing later re-attach.

To handle that in case of allocation error mark the target with new
MPRSAS_TARGET_TOREMOVE flag, and retry the removal attempt next time
something else free high priority command.  With this patch I can
successfully detach/attach 102 disk JBOD from/to the SAS9305-16e.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2021-08-20 10:03:32 -04:00
Wei Hu
ce110ea12f Microsoft Azure Network Adapter(MANA) VF support
MANA is the new network adapter from Microsoft which will be available
in Azure public cloud. It provides SRIOV NIC as virtual function to
guest OS running on Hyper-V.

The code can be divided into two major parts. Gdma_main.c is the one to
bring up the hardware board and drives all underlying hardware queue
infrastructure. Mana_en.c contains all main ethernet driver code.
It has only tested and supported on amd64 architecture.

PR:		256336
Reviewed by:	decui@microsoft.com
Tested by:	whu
MFC after:	2 week
Relnotes:	yes
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D31150
2021-08-20 10:44:57 +00:00
Hans Petter Selasky
bcb195d917 Partial revert of f83f5d5839 for uftdi(4).
Apparently devices with bcdDevice less than 0x0600, have problems receiving ZLPs.

Reported by:	kevlo@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-08-20 09:54:34 +02:00
Kevin Bowling
fc7682b17f e1000: Update intel shared code
Sync the e1000 shared code with DPDK shared code
"cid-gigabit.2020.06.05.tar.gz released by ND"

Primary focus was on client platforms (ich8lan). More work remains here
but we need an Intel contact for client networking.

Reviewed by:	grehan, Intel Networking (erj, earlier rev)
Obtained from:	DPDK <http://git.dpdk.org/dpdk/tree/drivers/net/e1000/base>
MFC after:	1 week
Sponsored by:	me
Differential Revision:	https://reviews.freebsd.org/D31547
2021-08-19 07:59:36 -07:00
Ka Ho Ng
78267c2e70 md: Replace BIO_DELETE emulation with vn_deallocate(9)
Both zero-filling and/or deallocation can be done with vn_deallocate(9).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D28899
2021-08-19 18:30:13 +08:00
John Baldwin
c261b6ea4e iscsi: Teach the iSCSI stack about "large" received PDUs.
When using iSCSI PDU offload (cxgbei) on T6 adapters, a burst of
received PDUs can be reported via a single message to the driver.

Previously the driver passed these multi-PDU bursts up to the iSCSI
stack up as a single "large" PDU by rewriting the buffer offset, data
segment length, and DataSN fields in the iSCSI header.  The DataSN
field in particular was rewritten so that each of the "large" PDUs
used consecutively increasing values.  While this worked, the forged
DataSN values did not match the ExpDataSN value in the subsequent SCSI
Response PDU.  The initiator does not currently verify this value, but
the forged DataSN values prevent adding a check.

To avoid this, allow a logical iSCSI PDU (struct icl_pdu) to describe
a burst of PDUs via a new 'ip_additional_pdus' field.  Normally this
field is set to zero when 'struct icl_pdu' represents a single PDU.
If logical PDU represents a burst of on-the-wire PDUs, then 'ip_npdus'
contains the count of additional on-the-wire PDUs.  The header of this
"large" PDU is still modified, but the DataSN field now contains the
DataSN value of the first on-the-wire PDU in the burst.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D31577
2021-08-18 10:56:28 -07:00
Hans Petter Selasky
8a46f021c2 Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-08-18 11:42:37 +02:00
Wojciech Macek
e3500c602b ipmi: fix negative logic in watchdog control flag
Use wd_enable instead of wd_disable
2021-08-18 08:21:14 +02:00
John Baldwin
d75b0870e5 cxgbei: Restrict received PDUs to 4 DDP pages in length.
Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D31576
2021-08-17 11:14:37 -07:00
John Baldwin
f28715fdc1 cxgbei: Only round PDU data segment lengths down by 512 on T5.
Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D31575
2021-08-17 11:14:29 -07:00
John Baldwin
cbc186360c cxgbei: Restructure how PDU limits are managed.
- Compute data segment limits in read_pdu_limits() rather than PDU
  length limits.

- Add back connection-specific PDU overhead lengths to compute PDU
  length limits in icl_cxgbei_conn_handoff().

Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D31574
2021-08-17 11:14:11 -07:00
Bartlomiej Grzesik
6ad816a999 sdhci_xenon: remove redundant code in property parsing
Remove redundant ofw property parsing in driver code, is already
taken care of in mmc_fdt_helpers.

Move ofw parsing to attach method.

Reviewed by: manu
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D31409
2021-08-17 09:03:45 +02:00
Bartlomiej Grzesik
1b9ce0885e sdhci_xenon: add AP807 compatible string
This patch adds compatible string for xenon controller found on
AP807 north brige. It is fully compatible with existing driver.

Reviewed by: manu
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D31407
2021-08-17 09:03:37 +02:00
Wojciech Macek
e8ad0a0059 ipmi: New tunable to deactivate IPMI watchdog
In case we want to use other WD than IPMI-provided, add
sysctl to disable initialization.

Obtained from:		Semihalf
Sponsored by:		Stormshield
Differential revision:	https://reviews.freebsd.org/D31548
2021-08-17 08:31:00 +02:00
Vladimir Kondratyev
5f99ae56c9 evdev: Use bit_foreach helper macro
for traversing all bits set in the bitstring(9).

While here move bit_change() definition to common header.

MFC after:	1 week
2021-08-17 00:29:47 +03:00
Vladimir Kondratyev
9b78891df1 hms(4): Allow attachment to pointer top level collection.
to be in line with Microsoft mouse driver [1]

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/top-level-collections-opened-by-windows-for-system-use

MFC after:	1 week
2021-08-16 23:24:05 +03:00
Vladimir Kondratyev
9b2b5f42b4 ps4dshock(4): Fix touchpad width in HID report descriptor
MFC after:	1 week
2021-08-16 23:24:05 +03:00
Greg V
51b2216114 hid: move proper hat switch handling from ps4dshock to hgame
Generic "DirectInput" HID gamepads need this handling too.

Reviewed by:	wulf
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31398
2021-08-16 23:24:05 +03:00
Jack
cb910670ac hmt(4): Do not ignore constant usages in HID report descriptor parser
This fixes hmt to work with MELF0411 1FD2:7012 touchscreen

Obtained from:	sysutils/iichid
MFC after:	1 week
2021-08-16 23:24:05 +03:00
Vladimir Kondratyev
be75951af1 hid: Add extra constant to units of measurement
Some devices like eGalax touchscreens use value of 0x33 instead of 0x13
for inches as unit of measure.

Reported by:	Mark Kane <mark_AT_kane_DOT_mn>
MFC after:	1 week
2021-08-16 23:13:24 +03:00
Vladimir Kondratyev
e40fec4ec9 evdev: Do not check maximal contact number for MT initialization
This allows singletouch devices which use multitouch protocols to work.

Reported by:	Mark Kane <mark_AT_kane_DOT_mn>
MFC after:	1 week
2021-08-16 23:12:01 +03:00
Vladimir Kondratyev
95add157e3 hmt(4): Store Contact Count in separate variable.
No functional changes.

MFC after:	1 week
2021-08-16 23:11:36 +03:00
Kevin Bowling
69e8e8ea3d e1000: always enable PCSD when RSS hashing
To enable RSS hashing in the NIC, the PCSD bit must be set.

By default, this is never set when RXCSUM is disabled - which
causes problems higher up in the stack.

While here improve the RXCSUM flag assignments when enabling or
disabling IFCAP_RXCSUM.

See also: https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076148.html

Reviewed by:	markj, Franco Fichtner <franco@opnsense.org>,
		Stephan de Wit <stephan.dewt@yahoo.co.uk>
Obtained from:	OPNsense
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31501
Co-authored-by: Stephan de Wit <stephan.dewt@yahoo.co.uk>
Co-authored-by: Franco Fichtner <franco@opnsense.org>
2021-08-16 10:24:01 -07:00
Ed Maste
c3295781fd bxe: tag files to skip clang-format formatting
bxe contains three files which are sets of constants or other data, and
might be auto-generated or have an upstream.  They are rather large
files and clang-format takes quite some time when run against them, so
just skip formatting.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27806
2021-08-16 10:48:44 -04:00
Kyle Evans
625932c9aa hvsock: fail the probe on non-HyperV machines
Differential Revision:	https://reviews.freebsd.org/D25459
2021-08-16 00:59:56 -05:00
Kornel Duleba
59d1661cd8 tpm_tis: Improve interrupt allocation
Validate the irq received from ACPI. Test if it works by sending a simple command and checking if the interrupt handler was executed.
Internal buffer allocation was moved away from common code to tis and crb parts - in order to test the interrupt we need to have it allocated early.

Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D31395
2021-08-16 06:28:33 +02:00
Mark Johnston
7e14be0b07 pci: Add an ioctl to perform I/O to BARs
This is useful for bhyve, which otherwise has to use /dev/io to handle
accesses to I/O port BARs when PCI passthrough is in use.

Reviewed by:	imp, kib
Discussed with:	jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31307
2021-08-14 10:59:03 -04:00
Adam Fenn
d4b2d3035a pvclock: Add vDSO support
Add vDSO support for timekeeping devices that support the KVM/XEN
paravirtual clock API.

Also, expose, in the userspace-accessible '<machine/pvclock.h>',
definitions that will be needed by 'libc' to support
'VDSO_TH_ALGO_X86_PVCLK'.

Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D31418
2021-08-14 15:57:54 +03:00
Adam Fenn
6c69c6bb4c kvm_clock: KVM paravirtual clock support
Add support for the KVM paravirtual clock device.

Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D29733
2021-08-14 15:57:54 +03:00