kern: replace several EBADF with EINVAL
EBADF semantic is that the passed fd is invalid, not that it is of wrong
type. Using EBADF in these places in kern_event.c and sys_procdesc.c
give bad examples to copy from.
Note that places in kern_event.c that checks KQ_CLOSING and return EBADF
are kept, since KQ_CLOSING is the transient state before the fd is
finally closed and become eligible for EBADF.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52410
[net80211] Quieten the logging from ieee80211_vht_get_vhtflags()
The commit in Fixes: introduced logging the output bits from
ieee80211_vht_get_vhtflags(). This ends up causing quite a lot
of logging when net80211 is doing things like processing
received beacons.
So just remove the logging; if it's needed again then a developer
can add it back to that location, or just use dtrace to capture
the return value.
Fixes: 4bf049bfeefd9
Differential Revision: https://reviews.freebsd.org/D52142
Reviewed by: bz
man: Add -l option
Add a -l option which causes man to interpret all arguments as paths to
open directly rather than man pages to search for in MANPATH. See the
PR for a detailed rationale.
PR: 289245
MFC after: 1 week
Reviewed by: ziaee, emaste
Differential Revision: https://reviews.freebsd.org/D52385
contrib/libxo: fix API header files inclusions in C++ source files
C++ source files need `extern "C"` to disable C++ name mangling.
MFC after: 1 week
Reviewed by: aokblast (previous version), phil, imp (previous version)
Differential Revision: https://reviews.freebsd.org/D47930
share/mk: Fix a heuristic in bsd.cpu.mk
When cross-building from MacOS we have MACHINE=arm64 MACHINE_ARCH=arm,
so bsd.cpu.mk infers that sizeof(long) == 4, but of course it isn't.
This breaks the bootstrap build of openssl, which tests
MACHINE_ABI:Mlong64 to decide whether to build ecp_nistp224.c. It
doesn't, and crypto/openssl/freebsd/include/openssl/configuration.h
undefines OPENSSL_NO_EC_NISTP_64_GCC_128, so we end up with a link
error.
Reviewed by: ngie, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D52340
BSD.usr.dist: remove obsolete usr/share/examples/drivers entry
In base 8f0a6a9aadb1f, usr/share/examples/drivers was cleaned up,
because it contained unmaintained scripts. The directory itself is
cleaned up by ObsoleteFiles.inc, but there was still an entry in
BSD.usr.dist that re-created the directory. Remove it.
Fixes: 8f0a6a9aadb1
MFC after: 3 days
nfsd: Fix the NFSv4 Readdir operation for an empty ZFS dir
Commit 9a3edc8 modified the behaviour of ZFS's
VOP_READDIR() such that it will reply EINVAL for
an offset past EOF on the directory.
This exposed a latent bug in the NFSv4 Readdir
code, which would attempt a Readdir with an
offset beyond EOF for a directory that consists
of only "." and "..". This happened because NFSv4
does not reply "." or ".." to the client and, after
skipping over them, attempted another VOP_READDIR().
This patch fixes the problem by checking the eofflag
for the case where all entries have been skipped over.
Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52370
[2 lines not shown]
rtwn: enable seqno offload; migrate to use ieee80211_output_seqno_assign()
This should both enable the sequence number offloading and disable
the net80211 TX lock from being acquired/released/checked.
Locally tested:
* RTL8812AU, STA mode
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D52301
Differential Revision: https://reviews.freebsd.org/D50693
stand: Remove Spleen 32x64 fonts from INDEX
The Spleen 32x64 fonts cause some systems such as the AMD Framework 16
to boot extremely slowly. Adding screen.font="16x32" to
/boot/loader.conf is a partial workaround, but text displayed before the
boot menu still takes ~30 seconds to render on that laptop. With this
change, the same text renders immediately.
By leaving the font files in place but removing them from the INDEX,
users who want to use them can still load them manually. Once pending
work is committed to allow normal booting with these fonts, they can be
added back to the INDEX.
PR: 289007
Reviewed by: emaste, kevans, tsoome, ziaee
Fixes: 1ec2c8b2f364 (stand: Enable Spleen 32x64 font in the bootloader)
Sponsored by: The FreeBSD Foundation
LinuxKPI: devres: divorce dem_kfree from lkpi_devm_kmalloc_release
dem_kfree() is called from all over the place and should actually
do something; contrary to lkpi_devm_kmalloc_release() it can also
take a const void *. We have to __DECONST() that though as the
entire devres framework does otherwise not take a const argument.
This was discovered during the rtw89 upadte to 6.16.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52082
LinuxKPI: kunit: add static_stub.h and more dummy headers
These came up during a wifi driver update.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52079
LinuxKPI: sync overflow.h from Linux v6.16
It seems overflow.h wsa imported directly from Linux in 3208d4ad2b8320a.
Update the file to the newer version as needed for wireless driver updates.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Obtained from: git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
038d61fd642278 (tag: v6.16)
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52078
LinuxKPI: add __struct_size
Use __builtin_object_size() by default.
If __builtin_dynamic_object_size() is available use that instead.
I would hope that in a future version we can remove the conditional
checks but in order to be able to MFC this without checking all
compiler versions simply keep it this way for now.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52077
LinuxKPI: cleanup: implement __free() and DEFINE_FREE(); use for kfree()
A wifi driver update needs this.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52075
LinuxKPI: rename from_timer() to timer_container_of()
With Linux 6.16 from_timer() got renamed to timer_container_of(); add
the LINUXKPI_VERSION check with a default to the current version.
Update all in-tree consumers (apart from wireless drivers managed
otherwise).
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52073
LinuxKPI: add DEFINE_LOCK_GUARD_0 for rcu
This adds guard support for non-real-types like rcu locking meaning
that we need to keep the lock state separately ourselves. _T is still
special and needs to be updated. Given it may not be used it needs
an __unused attribute (we are using the LinuxKPI __maybe_unused which
indeed is more expressive in this case).
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52076
LinuxKPI: timer KPI *_timer -> timer_*
del_timer() got renamed to timer_delete() approximately in Linux 6.2
(similar for *_sync and likely others).
Keep the old functions as compat; unclear when we can gc them.
We should also re-define them with a linuxkpi_ prefix to avoid possible
conflicts in the future if we do a full pass over this at some point.
Sponsored by: The FreeBSD Foundation (intiially)
MFC after: 3 days
X-MFC; preserve symbols, not inline
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52074
LinuxKPI: correct the LINUXKPI_VERSION check for abs_diff()
The code introduced abs_diff() as migrated from drm to standard
linux headers. The LINUXKPI_VERSION check did not allow this to
be visible by default in-tree. Make sure the v6.6 check is optional.
drm-kmod always defines LINUXKPI_VERSION so this should be fine.
Sponsored by: The FreeBSD Foundation (initially)
Fixes: afc450fac9f04
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52071
LinuxKPI: pci: allocate entire pci_dev hiereachy up to root port on attach
In linux_pci_attach_device() allocate a LinuxKPI pci_dev for each device in
the hierarchy up to the root port[1] as we cannot do that later on demand
as we may be in a context where we may not sleep.
Take special care of DRM as there is a non-PCI device in the chain which
needs to be skipped.
iwlwifi(4) can hit this case called from a callout.
While here leave a comment sa the cleanup order of
linux_pci_attach_device() needs correction seperately.
Sponsored by: The FreeBSD Foundation (initially)
PR: 283027
Suggested by: jhb [1]
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52069
LinuxKPI: acpi; fix type to acpi_get_handle()
The native AcpiGetHandle() and acpi_get_handle() take a
const char * argument for pathname and not an acpi_string (char *).
For that they spell it out fully as 'const char *', so should we.
Sponsored by: The FreeBSD Foundation (intially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52072
LinuxKPI: pci: allow children to be attached to a pci_dev
This will be used for hooking suspend/resume in for LinuxKPI 802.11
based drivers.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52070
LinuxKPI: pci: implement for_each_pci_dev() and improve pci_get_device()
Implement for_each_pci_dev() needed by a wireless driver update.
For that also improve pci_get_device() and add the functionality to
support the odev argument to start searching from that.
Sponsored by: The FreeBSD Foundation (intially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52066