Commit Graph

281050 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
3dd980267f LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT
Add code (currently disabled by #ifdef) for HT and VHT to
lkpi_scan_ies_add().  Switch to a local variable for ic given
the new code also needs the value.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-31 23:00:28 +00:00
Jean-Sébastien Pédron
a83b3ec719
linuxkpi: list_sort()'s callback now takes list arguments
This change breaks the API of `list_sort()`. `LINUXKPI_VERSION >= 51300`
is used to keep the header compatible with both versions of the
prototype.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38082
2023-01-31 23:36:33 +01:00
Eric Joyner
5354596764
vtd: Increase DRHD_MAX_UNITS
Observed on a couple Ice Lake-SP platforms (Intel Coyote Pass, Dell
R750), there are more than 8 DRHD sections enumerated in the DMAR ACPI
section.  Since the previous limit was 8, this resulted in some of these
not being parsed by vtd when the iommu is initialized; in this case when
PCI devices are being passthru'd to a bhyve VM.

This omission later causes a kernel panic later in initialization when
devices could not be found in a valid DRHD scope because the DHRD
containing the device's scope was not added to vtd.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

PR:		268486
Sponsored by:	Intel Corporation
Reviewed by:	rew@, corvink@
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D38285
2023-01-31 13:57:42 -08:00
Justin Hibbits
dc57ec3ca0 Mechanically convert ffec(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37836
2023-01-31 16:26:36 -05:00
Justin Hibbits
13f2ef1637 Mechanically convert mwl(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37840
2023-01-31 16:26:35 -05:00
Justin Hibbits
9f012efb63 Mechanically convert gem(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37809
2023-01-31 16:26:35 -05:00
Justin Hibbits
3df047e3f3 Mechanically convert ps3 if_glc(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37792
2023-01-31 16:26:35 -05:00
Justin Hibbits
44e65355a3 Mechanically convert if_cas(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37793
2023-01-31 16:26:34 -05:00
Justin Hibbits
98fe10c8fc Mechanically convert mge(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37833
2023-01-31 16:26:34 -05:00
Justin Hibbits
b7459fb0ad Mechanically convert genet(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37832
2023-01-31 16:26:34 -05:00
Justin Hibbits
ad06fc3283 re(4): Fix whitespace from IfAPI conversion
Fixes:		4519a073c3
Sponsored by:	Juniper Networks, Inc.
2023-01-31 16:26:33 -05:00
Justin Hibbits
74c592c047 etherswitch: Clean up whitespace after IfAPI conversion
Sponsored by:	Juniper Networks, Inc.
Fixes:		2e6a8c1ae
2023-01-31 16:26:33 -05:00
Justin Hibbits
34d5a6a3dc Last change for mgb(4) needed for IfAPI conversion
Sponsored by:	Juniper Networks, Inc.
2023-01-31 16:26:33 -05:00
Justin Hibbits
087f0d352a Mechanically convert bge(4) to DrvAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37842
2023-01-31 15:02:18 -05:00
Justin Hibbits
56c1eafe50 IfAPI: Finish conversion of bnxt(4) to IfAPI.
Sponsored by:	Juniper Networks, Inc.
2023-01-31 15:02:18 -05:00
Justin Hibbits
4519a073c3 Mechanically convert if_re(4) to DrvAPI
Reviewed By:	kevlo
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37790
2023-01-31 15:02:18 -05:00
Justin Hibbits
d79539e6f2 IfAPI: Add if_altq_is_enabled() interface.
Summary:
The only user of the ALTQ_IS_ENABLED() in a driver checks against the
ifnet queue.  Abstract that all out and present the interface to check
if ALTQ is enabled on the interface.

Sponsored by:	Juniper Networks, Inc.
Reviewed By:	glebius
Differential Revision: https://reviews.freebsd.org/D38204
2023-01-31 15:02:17 -05:00
Justin Hibbits
31cfaf191b IfAPI: Add l2com accessor for firewire.
Summary:
Firewire is the only device driver that accesses the l2com member, all
other accesses are handled within the netstack itself.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38203
2023-01-31 15:02:17 -05:00
Justin Hibbits
0d2684e15e IfAPI: Add some more accessors
Summary:
* if_setreassignfn for wireguard.
* if_getinputfn() and if_getstartfn() for various drivers.  Use the
  function descriptor typedefs for these and the setters.
* vlantrunk accessor.  This is used by VLAN_CAPABILITIES() used by
  several drivers, as well as directly by mxge(4).
* if_pcp member accessor, used by cxgbe.
* accessors for netmap adapter.

Sponsored by:	Juniper Networks, Inc.
Reviewed By:	glebius
Differential Revision: https://reviews.freebsd.org/D38202
2023-01-31 15:02:17 -05:00
Justin Hibbits
9507d03bfe IfAPI: Use the ifnet APIs in kern_poll()
The only API used is if_name().

Sponsored by:	Juniper Networks, Inc.
2023-01-31 15:02:16 -05:00
Justin Hibbits
c255d1a401 IfAPI: Add if_llsoftc member accessors for TOEDEV
Summary:
Keep TOEDEV() macro for backwards compatibility, and add a SETTOEDEV()
macro to complement with the new accessors.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius
Differential Revision: https://reviews.freebsd.org/D38199
2023-01-31 15:02:16 -05:00
Justin Hibbits
3d0d5b21c9 IfAPI: Explicitly include <net/if_private.h> in netstack
Summary:
In preparation of making if_t completely opaque outside of the netstack,
explicitly include the header.  <net/if_var.h> will stop including the
header in the future.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38200
2023-01-31 15:02:16 -05:00
Justin Hibbits
30af2c131b IfAPI: Add if_get/setmaclabel() and use it.
Summary:
Port the MAC modules to use the IfAPI APIs as part of this.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius
Differential Revision: https://reviews.freebsd.org/D38197
2023-01-31 15:02:15 -05:00
Justin Hibbits
113af4fd2b IfAPI: Add if_gettype() API and use it for vlan
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	#network, glebius
Differential Revision: https://reviews.freebsd.org/D38198
2023-01-31 15:02:15 -05:00
Justin Hibbits
950cc1f44f bpf: Add "_if" tap APIs
Summary:
Hide more netstack by making the BPF_TAP macros real functions in the
netstack.  "struct ifnet" is used in the header instead of "if_t" to
keep header pollution down.

Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38103
2023-01-31 15:02:14 -05:00
Justin Hibbits
1bfa548b1f ifnet/API: Privatize the implementation of the drbr_* APIs
When ALTQ is enabled ifnet accessors already need to be called, largely
defeating the purpose of the inline.  To that extent, make the ALTQ form
functions in the netstack proper, and make them always available.

Reviewed By:	glebius
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38104
2023-01-31 15:02:14 -05:00
Justin Hibbits
361ac40b0f IfAPI: Hide the in6m_lookup_locked() implementation.
Summary:
in6m_lookup_locked() iterates over the ifnet's multiaddrs list.  Keep
this implementation detail private, by moving the implementation to the
netstack source from the header.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38201
2023-01-31 15:02:14 -05:00
Mitchell Horne
537c166b76 elftoolchain: update the list of riscv relocations
A few have been added, a couple removed.

Reviewed by:	jrtc27, imp, emaste
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38175
2023-01-31 14:32:40 -04:00
Mitchell Horne
7738bb89a3 elf_common.h: remove obsolete riscv relocations
These were specified at one time, but later removed.

Reviewed by:	jrtc27, imp, emaste
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38174
2023-01-31 14:31:48 -04:00
Justin Hibbits
3d100b2a5a Remove dme(4) from files
Fixes:	69759b0c69
2023-01-31 11:44:42 -05:00
Bjoern A. Zeeb
2336248a8b LinuxKPI: 802.11: fix ff76cbc81d (pspoll)
Add the lost "inline".

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
X-MFC with:	ff76cbc81d
2023-01-31 16:41:41 +00:00
Justin Hibbits
69759b0c69 Remove dme(4).
This was used only on an Ingenic MIPS SoC.
2023-01-31 11:39:48 -05:00
Bjoern A. Zeeb
ff76cbc81d LinuxKPI: 802.11: implement ieee80211_is_pspoll()
Implement ieee80211_is_pspoll() and move it up to the set of implemented
ieee80211_is_*() functions.

There are no further changes (git diff just looks weird).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-31 16:36:24 +00:00
Bjoern A. Zeeb
5a9a0d7803 LinuxKPI: 802.11: basic implementation of *queue(s)/*txq*
Very basic implementations of ieee80211_{wake,stop}_queue[s],
as well as ieee80211_txq_schedule_start(), ieee80211_next_txq(),
and ieee80211_schedule_txq().
Various combinations of these are used by different wireless
drivers, incl. iwlwifi.

Sponsored by:	The FreeBSD Foundation (parts of this work)
MFC after:	3 days
2023-01-31 16:17:14 +00:00
Bjoern A. Zeeb
a839757109 LinuxKPI: 802.11: implement ieee80211_tx_status_ext()
Add an implementation of ieee80211_tx_status_ext() extending the
internal linuxkpi_ieee80211_tx_status() implementation.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-31 15:35:59 +00:00
Bjoern A. Zeeb
e30e05d3ab LinuxKPI: 802.11: extend linuxkpi_ieee80211_rx()
Extend linuxkpi_ieee80211_rx() by another argument for
the ieee80211_rx_list() implementation (even though the argument
is currently ignored).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-31 15:05:30 +00:00
Alexander V. Chernikov
e80699a809 netlink: add NETLINK to GENERIC.
This is a followup of 692e19cf51 (add netlink to GENERIC@amd64).

Netlink is a communication protocol defined in RFC 3549. It is async,
TLV-based protocol, providing 1-1 and 1-many communications between kernel
and userland. Netlink is currently used in Linux kernel to modify, read and
subscribe for nearly all networking states. Interface state, addresses, routes,
firewall, rules, fibs, etc, are controlled via Netlink.

Netlink support was added in D36002. It has got a number of improvements and
first customers since then:
* net/bird2 got netlink support, enabling route multipath in FreeBSD
* netlink-based devd notifications are being worked on ( D37574 ).
* linux(4) fully supports and depends on Netlink

Enabling Netlink in GENERIC targets two goals.
The first one is to provide stability for the third-party userland applications,
so they can rely on the fact that netlink always exists since 14.0 and potentially 13.2.
Loadable module makes life of the app delepers harder. For example, `net/bird2` can be
either build with netlink or rtsock support, but not both.

The second goal is to enable gradual conversion of the base userland tools
to use netlink(4) interfaces. Converting tools like netstat (D36529), route,
ifconfig one-by-one simplifies testing and addressing the feedback.
Othewise, switching all base to use netlink at once may be too big of a leap.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D37783
2023-01-31 14:22:11 +00:00
Bjoern A. Zeeb
a3baca22d0 LinuxKPI: 802.11: fix types and whitespace
Correct struct member types, fix whitespace, and remove superfluous
return statements in void functions.

No functional changes.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-31 13:39:04 +00:00
Dag-Erling Smørgrav
134841a7f3 cmp: Increase buffer size for non-mmap case.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	rpokala
Differential Revision:	https://reviews.freebsd.org/D38281
2023-01-31 01:29:05 +01:00
Dag-Erling Smørgrav
6673a5476d cmp: Print a summary on SIGINFO.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38280
2023-01-31 01:29:05 +01:00
Jean-Sébastien Pédron
b9ef068943
linuxkpi: Define dev_is_platform() and to_platform_device()
The former returns false and the latter returns NULL.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38163
2023-01-30 23:10:03 +01:00
Jean-Sébastien Pédron
11aaefc9ca
linuxkpi: Try to solve headers dependencies
I'm sure I got it wrong but at least the DRM drivers compile.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38157
2023-01-30 23:09:52 +01:00
Jean-Sébastien Pédron
29d0c85c86
linuxkpi: Add io_mapping_map_local_wc() and io_mapping_unmap_local()
`io_mapping_map_local_wc()` is synonymous to `io_mapping_map_atomic_wc()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38156
2023-01-30 23:09:38 +01:00
Jean-Sébastien Pédron
9dafbd0c69
linuxkpi: Add kmap_local_page_prot() and kunmap_local()
They are synonymous to `kmap_atomic_prot()` and `kunmap_atomic()`
respectively.

While here, fix several style(9) issues.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38155
2023-01-30 23:09:22 +01:00
Jean-Sébastien Pédron
7649b89cc1
linuxkpi: Add <linux/pgtable.h>
For now, it's empty. It is included by the DRM drivers but nothing is
missing otherwise. Perhaps something we already defined should be in
`pgtable.h` instead of another header.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38153
2023-01-30 23:09:13 +01:00
Jean-Sébastien Pédron
25faccaaca
linuxkpi: Add <linux/limits.h>
For now, it's empty. It is included by the DRM drivers but nothing is
missing otherwise. Perhaps something we already defined should be in
`limits.h` instead of another header.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38147
2023-01-30 23:08:59 +01:00
Jean-Sébastien Pédron
19be627cfd
linuxkpi: Define might_alloc()
... as a no-op.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38146
2023-01-30 23:08:45 +01:00
Jean-Sébastien Pédron
e400b69599
linuxkpi: Add freeram and freehigh to struct sysinfo
The struct layout is modified with this commit because new fields are
added in the middle, keeping original Linux order.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D37932
2023-01-30 23:08:32 +01:00
Gleb Smirnoff
bcad3f96ae gh-bc: fix build with WITHOUT_NLS_CATALOGS=YES 2023-01-30 13:26:49 -08:00
Phil Shafer
ef7d10fde4 Add missing check for xo_parse_args return code. 2023-01-30 15:43:01 -05:00